PageSourceSearch

https://deepstatemap.live/js/bundle-be1a1f.min.js

js deepstatemap.live collected 2026-09-24 08:27:16 UTC 504,035 bytes, 23 lines download raw bytes

1!function(){"use strict";!function(){const e={production:!1};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();var e,t,i,n,r,a,s,o,l,c={},u=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h=Array.isArray;function p(e,t){for(var i in t)e[i]=t[i];return e}function v(e){var t=e.parentNode;t&&t.removeChild(e)}function f(t,i,n){var r,a,s,o={};for(s in i)"key"==s?r=i[s]:"ref"==s?a=i[s]:o[s]=i[s];if(arguments.length>2&&(o.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return m(t,o,r,a,null)}function m(e,n,r,a,s){var o={type:e,props:n,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(o),o}function g(e){return e.children}function y(e,t){this.props=e,this.context=t}function b(e,t){if(null==t)return e.__?b(e.__,e.__i+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?b(e):null}function k(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 k(e)}}function w(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!C.__r++||a!==t.debounceRendering)&&((a=t.debounceRendering)||s)(C)}function C(){var e,i,n,a,s,l,c,u,d;for(r.sort(o);e=r.shift();)e.__d&&(i=r.length,a=void 0,l=(s=(n=e).__v).__e,u=[],d=[],(c=n.__P)&&((a=p({},s)).__v=s.__v+1,t.vnode&&t.vnode(a),R(c,a,s,n.__n,void 0!==c.ownerSVGElement,32&s.__u?[l]:null,u,null==l?b(s):l,!!(32&s.__u),d),a.__.__k[a.__i]=a,A(u,a,d),a.__e!=l&&k(a)),r.length>i&&r.sort(o));C.__r=0}function S(e,t,i,n,r,a,s,o,l,d,p){var v,f,y,k,w,C=n&&n.__k||u,S=t.length;for(i.__d=l,function(e,t,i){var n,r,a,s,o,l=t.length,c=i.length,u=c,d=0;for(e.__k=[],n=0;n<l;n++)null!=(r=e.__k[n]=null==(r=t[n])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?m(null,r,null,null,r):h(r)?m(g,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?m(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,o=E(r,i,s=n+d,u),r.__i=o,a=null,-1!==o&&(u--,(a=i[o])&&(a.__u|=131072)),null==a||null===a.__v?(-1==o&&d--,"function"!=typeof r.type&&(r.__u|=65536)):o!==s&&(o===s+1?d++:o>s?u>l-s?d+=o-s:d--:d=o<s&&o==s-1?o-s:0,o!==n+d&&(r.__u|=65536))):(a=i[n])&&null==a.key&&a.__e&&(a.__e==e.__d&&(e.__d=b(a)),P(a,a,!1),i[n]=null,u--);if(u)for(n=0;n<c;n++)null!=(a=i[n])&&0==(131072&a.__u)&&(a.__e==e.__d&&(e.__d=b(a)),P(a,a))}(i,t,C),l=i.__d,v=0;v<S;v++)null!=(y=i.__k[v])&&"boolean"!=typeof y&&"function"!=typeof y&&(f=-1===y.__i?c:C[y.__i]||c,y.__i=v,R(e,y,f,r,a,s,o,l,d,p),k=y.__e,y.ref&&f.ref!=y.ref&&(f.ref&&T(f.ref,null,y),p.push(y.ref,y.__c||k,y)),null==w&&null!=k&&(w=k),65536&y.__u||f.__k===y.__k?l=_(y,l,e):"function"==typeof y.type&&void 0!==y.__d?l=y.__d:k&&(l=k.nextSibling),y.__d=void 0,y.__u&=-196609);i.__d=l,i.__e=w}function _(e,t,i){var n,r;if("function"==typeof e.type){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=_(n[r],t,i));return t}return e.__e!=t&&(i.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function E(e,t,i,n){var r=e.key,a=e.type,s=i-1,o=i+1,l=t[i];if(null===l||l&&r==l.key&&a===l.type)return i;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||o<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&r==l.key&&a===l.type)return s;s--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&r==l.key&&a===l.type)return o;o++}}return-1}function x(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||d.test(t)?i:i+"px"}function I(e,t,i,n,r){var a;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||x(e.style,t,"");if(i)for(t in i)n&&i[t]===n[t]||x(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])a=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=i,i?n?i.u=n.u:(i.u=Date.now(),e.addEventListener(t,a?M:F,a)):e.removeEventListener(t,a?M:F,a);else{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&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,i))}}function F(e){var i=this.l[e.type+!1];if(e.t){if(e.t<=i.u)return}else e.t=Date.now();return i(t.event?t.event(e):e)}function M(e){return this.l[e.type+!0](t.event?t.event(e):e)}function R(i,n,r,a,s,o,l,u,d,f){var m,k,w,C,_,E,L,x,F,M,R,A,T,P,D,O=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(d=!!(32&r.__u),o=[u=n.__e=r.__e]),(m=t.__b)&&m(n);e:if("function"==typeof O)try{if(x=n.props,F=(m=O.contextType)&&a[m.__c],M=m?F?F.props.value:m.__:a,r.__c?L=(k=n.__c=r.__c).__=k.__E:("prototype"in O&&O.prototype.render?n.__c=k=new O(x,M):(n.__c=k=new y(x,M),k.constructor=O,k.render=N),F&&F.sub(k),k.props=x,k.state||(k.state={}),k.context=M,k.__n=a,w=k.__d=!0,k.__h=[],k._sb=[]),null==k.__s&&(k.__s=k.state),null!=O.getDerivedStateFromProps&&(k.__s==k.state&&(k.__s=p({},k.__s)),p(k.__s,O.getDerivedStateFromProps(x,k.__s))),C=k.props,_=k.state,k.__v=n,w)null==O.getDerivedStateFromProps&&null!=k.componentWillMount&&k.componentWillMount(),null!=k.componentDidMount&&k.__h.push(k.componentDidMount);else{if(null==O.getDerivedStateFromProps&&x!==C&&null!=k.componentWillReceiveProps&&k.componentWillReceiveProps(x,M),!k.__e&&(null!=k.shouldComponentUpdate&&!1===k.shouldComponentUpdate(x,k.__s,M)||n.__v===r.__v)){for(n.__v!==r.__v&&(k.props=x,k.state=k.__s,k.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEac
vendor: 4,143 bytes, line 1
1h((function(e){e&&(e.__=n)})),R=0;R<k._sb.length;R++)k.__h.push(k._sb[R]);k._sb=[],k.__h.length&&l.push(k);break e}null!=k.componentWillUpdate&&k.componentWillUpdate(x,k.__s,M),null!=k.componentDidUpdate&&k.__h.push((function(){k.componentDidUpdate(C,_,E)}))}if(k.context=M,k.props=x,k.__P=i,k.__e=!1,A=t.__r,T=0,"prototype"in O&&O.prototype.render){for(k.state=k.__s,k.__d=!1,A&&A(n),m=k.render(k.props,k.state,k.context),P=0;P<k._sb.length;P++)k.__h.push(k._sb[P]);k._sb=[]}else do{k.__d=!1,A&&A(n),m=k.render(k.props,k.state,k.context),k.state=k.__s}while(k.__d&&++T<25);k.state=k.__s,null!=k.getChildContext&&(a=p(p({},a),k.getChildContext())),w||null==k.getSnapshotBeforeUpdate||(E=k.getSnapshotBeforeUpdate(C,_)),S(i,h(D=null!=m&&m.type===g&&null==m.key?m.props.children:m)?D:[D],n,r,a,s,o,l,u,d,f),k.base=n.__e,n.__u&=-161,k.__h.length&&l.push(k),L&&(k.__E=k.__=null)}catch(i){n.__v=null,d||null!=o?(n.__e=u,n.__u|=d?160:32,o[o.indexOf(u)]=null):(n.__e=r.__e,n.__k=r.__k),t.__e(i,n,r)}else null==o&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=function(t,i,n,r,a,s,o,l,u){var d,p,f,m,g,y,k,w=n.props,C=i.props,_=i.type;if("svg"===_&&(a=!0),null!=s)for(d=0;d<s.length;d++)if((g=s[d])&&"setAttribute"in g==!!_&&(_?g.localName===_:3===g.nodeType)){t=g,s[d]=null;break}if(null==t){if(null===_)return document.createTextNode(C);t=a?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,C.is&&C),s=null,l=!1}if(null===_)w===C||l&&t.data===C||(t.data=C);else{if(s=s&&e.call(t.childNodes),w=n.props||c,!l&&null!=s)for(w={},d=0;d<t.attributes.length;d++)w[(g=t.attributes[d]).name]=g.value;for(d in w)g=w[d],"children"==d||("dangerouslySetInnerHTML"==d?f=g:"key"===d||d in C||I(t,d,null,g,a));for(d in C)g=C[d],"children"==d?m=g:"dangerouslySetInnerHTML"==d?p=g:"value"==d?y=g:"checked"==d?k=g:"key"===d||l&&"function"!=typeof g||w[d]===g||I(t,d,g,w[d],a);if(p)l||f&&(p.__html===f.__html||p.__html===t.innerHTML)||(t.innerHTML=p.__html),i.__k=[];else if(f&&(t.innerHTML=""),S(t,h(m)?m:[m],i,n,r,a&&"foreignObject"!==_,s,o,s?s[0]:n.__k&&b(n,0),l,u),null!=s)for(d=s.length;d--;)null!=s[d]&&v(s[d]);l||(d="value",void 0!==y&&(y!==t[d]||"progress"===_&&!y||"option"===_&&y!==w[d])&&I(t,d,y,w[d],!1),d="checked",void 0!==k&&k!==t[d]&&I(t,d,k,w[d],!1))}return t}(r.__e,n,r,a,s,o,l,d,f);(m=t.diffed)&&m(n)}function A(e,i,n){i.__d=void 0;for(var r=0;r<n.length;r++)T(n[r],n[++r],n[++r]);t.__c&&t.__c(i,e),e.some((function(i){try{e=i.__h,i.__h=[],e.some((function(e){e.call(i)}))}catch(e){t.__e(e,i.__v)}}))}function T(e,i,n){try{"function"==typeof e?e(i):e.current=i}catch(e){t.__e(e,n)}}function P(e,i,n){var r,a;if(t.unmount&&t.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||T(r,null,i)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){t.__e(e,i)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&P(r[a],i,n||"function"!=typeof e.type);n||null==e.__e||v(e.__e),e.__=e.__e=e.__d=void 0}function N(e,t,i){return this.constructor(e,i)}function D(i,n,r){var a,s,o,l;t.__&&t.__(i,n),s=(a="function"==typeof r)?null:r&&r.__k||n.__k,o=[],l=[],R(n,i=(!a&&r||n).__k=f(g,null,[i]),s||c,c,void 0!==n.ownerSVGElement,!a&&r?[r]:s?null:n.firstChild?e.call(n.childNodes):null,o,!a&&r?r:s?s.__e:n.firstChild,a,l),A(o,i,l)}function O(t,i,n){var r,a,s,o,l=p({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),i)"key"==s?r=i[s]:"ref"==s?a=i[s]:l[s]=void 0===i[s]&&void 0!==o?o[s]:i[s];return arguments.length>2&&(l.children=arguments.length>3?e.call(arguments,2):n),m(t.type,l,r||t.key,a||t.ref,null)}function U(e,t,i){return t=X(t),ee(e,H()?Reflect.construct(t,i||[],X(e).constructor):t.apply(e,i))}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(H=function(){return!!e})()}function B(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 V(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
vendor: 8,195 bytes, line 1
1t%2?B(Object(i),!0).forEach((function(t){J(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):B(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function G(){G=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",l=a.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 u(e,t,i,n){var a=t&&t.prototype instanceof g?t:g,s=Object.create(a.prototype),o=new M(n||[]);return r(s,"_invoke",{value:L(e,i,o)}),s}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h="suspendedStart",p="suspendedYield",v="executing",f="completed",m={};function g(){}function y(){}function b(){}var k={};c(k,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(R([])));C&&C!==i&&n.call(C,s)&&(k=C);var S=b.prototype=g.prototype=Object.create(k);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function i(r,a,s,o){var l=d(e[r],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,s,o)}),(function(e){i("throw",e,s,o)})):t.resolve(u).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,o)}))}o(l.arg)}var a;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function L(t,i,n){var r=h;return function(a,s){if(r===v)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw s;return{value:e,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var l=x(o,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=v;var c=d(t,i,n);if("normal"===c.type){if(r=n.done?f:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}function x(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,x(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=d(r,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,m;var s=a.arg;return s?s.done?(i[t.resultName]=s.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,m):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function I(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 F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function R(t){if(t||""===t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=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 a.next=a}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,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,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},_(E.prototype),c(E.prototype,o,(function(){return this})),t.AsyncIterator=E,t.async=function(e,i,n,r,a){void 0===a&&(a=Promise);var s=new E(u(e,i,n,r),a);return t.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(S),c(S,l,"Generator"),c(S,s,(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=R,M.prototype={constructor:M,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(F),!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 o.type="throw",o.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(l&&c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.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 a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=e,s.arg=t,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(s)},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),m},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),F(i),m}},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;F(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:R(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function j(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function W(e,t,i,n,r,a,s){try{var o=e[a](s),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(n,r)}function z(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var a=e.apply(t,i);function s(e){W(a,n,r,s,o,"next",e)}function o(e){W(a,n,r,s,o,"throw",e)}s(void 0)}))}}function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(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,j(n.key),n)}}function Y(e,t,i){return t&&q(e.prototype,t),i&&q(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function J(e,t,i){return(t=j(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function K(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&&Q(e,t)}
vendor: 3,373 bytes, line 1
1function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X(e)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q(e,t)}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ee(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 $(e)}function te(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,a,s,o=[],l=!0,c=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return o}}(e,t)||ne(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 ie(e){return function(e){if(Array.isArray(e))return re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ne(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 ne(e,t){if(e){if("string"==typeof e)return re(e,t);var i=Object.prototype.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)?re(e,t):void 0}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ae(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=ne(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 a,s=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==i.return||i.return()}finally{if(o)throw a}}}}e=u.slice,t={__e:function(e,t,i,n){for(var r,a,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((a=r.constructor)&&null!=a.getDerivedStateFromError&&(r.setState(a.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,n||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},i=0,n=function(e){return null!=e&&null==e.constructor},y.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},i),this.props)),e&&p(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),w(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},y.prototype.render=g,r=[],s="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,function(e){e[e.SINGLE_IF_POSSIBLE=0]="SINGLE_IF_POSSIBLE",e[e.USE_MINIMUN_HEIGHT=1]="USE_MINIMUN_HEIGHT",e[e.FULL_HEIGHT=2]="FULL_HEIGHT"}(l||(l={}));var se,oe,le,ce,ue=function(){function e(){Z(this,e),J(this,"isEnabled",!1),this.mapController=window.mapController,this.featuresController=window.featuresController,this.profileService=window.profile}return Y(e,[{key:"enable",value:function(){}},{key:"disable",value:function(){}}]),e}(),de=0,he=[],pe=[],ve=t.__b,fe=t.__r,me=t.diffed,ge=t.__c,ye=t.unmount;function be(e,i){t.__h&&t.__h(oe,e,de||i),de=0;var n=oe.__H||(oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:pe}),n.__[e]}function ke(e){return de=1,function(e,t,i){var n=be(se++,2);if(n.t=e,!n.__c&&(n.__=[i?i(t):Me(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=oe,!oe.u)){var r=function(e,t,i){if(!n.__c.__H)return!0;var r=n.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!a||a.call(this,e,t,i);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&n.__c.props===e)&&(!a||a.call(this,e,t,i))};oe.u=!0;var a=oe.shouldComponentUpdate,s=oe.componentWillUpdate;oe.componentWillUpdate=function(e,t,i){if(this.__e){var n=a;a=void 0,r(e,t,i),a=n}s&&s.call(this,e,t,i)},oe.shouldComponentUpdate=r}return n.__N||n.__}(Me,e)}function we(e,i){var n=be(se++,3);!t.__s&&Fe(n.__H,i)&&(n.__=e,n.i=i,oe.__H.__h.push(n))}function Ce(e){return de=5,Se((function(){return{current:e}}),[])}function Se(e,t){var i=be(se++,7);return Fe(i.__H,t)?(i.__V=e(),i.i=t,i.__h=e,i.__V):i.__}function _e(){for(var e;e=he.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xe),e.__H.__h.forEach(Ie),e.__H.__h=[]}catch(i){e.__H.__h=[],t.__e(i,e.__v)}}t.__b=function(e){oe=null,ve&&ve(e)},t.__r=function(e){fe&&fe(e),se=0;var t=(oe=e.__c).__H;t&&(le===oe?(t.__h=[],oe.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=pe,e.__N=e.i=void 0}))):(t.__h.forEach(xe),t.__h.forEach(Ie),t.__h=[],se=0)),le=oe},t.diffed=function(e){me&&me(e);var i=e.__c;i&&i.__H&&(i.__H.__h.length&&(1!==he.push(i)&&ce===t.requestAnimationFrame||((ce=t.requestAnimationFrame)||Le)(_e)),i.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==pe&&(e.__=e.__V),e.i=void 0,e.__V=pe}))),le=oe=null},t.__c=function(e,i){i.some((function(e){try{e.__h.forEach(xe),e.__h=e.__h.filter((function(e){return!e.__||Ie(e)}))}catch(n){i.some((function(e){e.__h&&(e.__h=[])})),i=[],t.__e(n,e.__v)}})),ge&&ge(e,i)},t.unmount=function(e){ye&&ye(e);var i,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{xe(e)}catch(e){i=e}})),n.__H=void 0,i&&t.__e(i,n.__v))};var Ee="function"==typeof requestAnimationFrame;function Le(e){var t,i=function(){clearTimeout(n),Ee&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,100);Ee&&(t=requestAnimationFrame(i))}function xe(e){var t=oe,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),oe=t}function Ie(e){var t=oe;e.__c=e.__(),oe=t}function Fe(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function Me(e,t){return"function"==typeof t?t(e):t}function Re(){throw new Error("Cycle detected")}const Ae=Symbol.for("preact-signals");function Te(){if(Oe>1)return void Oe--;let e,t=!1;for(;void 0!==Ne;){let i=Ne;for(Ne=void 0,Ue++;void 0!==i;){const n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&je(i))try{i.c()}catch(i){t||(e=i,t=!0)}i=n}}if(Ue=0,Oe--,t)throw e}let Pe,Ne,De,Oe=0,Ue=0,He=0;function Be(e){if(void 0===Pe)return;let t=e.n;return void 0===t||t.t!==Pe?(t={i:0,S:e,p:Pe.s,n:void 0,t:Pe,e:void 0,x:void 0,r:t},void 0!==Pe.s&&(Pe.s.n=t),Pe.s=t,e.n=t,32&Pe.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Pe.s,t.n=void 0,Pe.s.n=t,Pe.s=t),t):void 0}function Ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function Ge(e){return new Ve(e)}function je(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function We(e){for(let t=e.s;void 0!==t;t=t.n){const i=t.S.n;if(void 0!==i&&(t.r=i),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function ze(e){let t,i=e.s;for(;void 0!==i;){const e=i.p;-1===i.i?(i.S.U(i),void 0!==e&&(e.n=i.n),void 0!==i.n&&(i.n.p=e)):t=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=e}e.s=t}function Ze(e){Ve.call(this,void 0),this.x=e,this.s=void 0,this.g=He-1,this.f=4}function qe(e){return new Ze(e)}function Ye(e){const t=e.u;if(e.u=void 0,"function"==typeof t){Oe++;const i=Pe;Pe=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Je(e),t}finally{Pe=i,Te()}}}function Je(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ye(e)}function Ke(e){if(Pe!==this)throw new Error("Out-of-order effect");ze(this),Pe=e,this.f&=-2,8&this.f&&Je(this),Te()}function Xe(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Qe(e){const t=new Xe(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function $e(e,i){t[e]=i.bind(null,t[e]||(()=>{}))}function et(e){De&&De(),De=e&&e.S()}function tt({data:e}){const t=function(e){return Se((()=>Ge(e)),[])}(e);t.value=e;const i=Se((()=>{let e=this.__v;for(;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return this.__$u.c=()=>{var e;n(i.peek())||3!==(null==(e=this.base)?void 0:e.nodeType)?(this.__$f|=1,this.setState({})):this.base.data=i.peek()},qe((()=>{let e=t.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return i.value}function it(e,t,i,n){const r=t in e&&void 0===e.ownerSVGElement,a=Ge(i);return{o:(e,t)=>{a.value=e,n=t},d:Qe((()=>{const i=a.value.value;n[t]!==i&&(n[t]=i,r?e[t]=i:i?e.setAttribute(t,i):e.removeAttribute(t))}))}}Ve.prototype.brand=Ae,Ve.prototype.h=function(){return!0},Ve.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},Ve.prototype.U=function(e){if(void 0!==this.t){const t=e.e,i=e.x;void 0!==t&&(t.x=i,e.e=void 0),void 0!==i&&(i.e=t,e.x=void 0),e===this.t&&(this.t=i)}},Ve.prototype.subscribe=function(e){const t=this;return Qe((function(){const i=t.value,n=32&this.f;this.f&=-33;try{e(i)}finally{this.f|=n}}))},Ve.prototype.valueOf=function(){return this.value},Ve.prototype.toString=function(){return this.value+""},Ve.prototype.toJSON=function(){return this.value},Ve.prototype.peek=function(){return this.v},Object.defineProperty(Ve.prototype,"value",{get(){const e=Be(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(Pe instanceof Ze&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Ue>100&&Re(),this.v=e,this.i++,He++,Oe++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{Te()}}}}),(Ze.prototype=new Ve).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;
1if(this.f&=-5,this.g===He)return!0;if(this.g=He,this.f|=1,this.i>0&&!je(this))return this.f&=-2,!0;const e=Pe;try{We(this),Pe=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Pe=e,ze(this),this.f&=-2,!0},Ze.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}Ve.prototype.S.call(this,e)},Ze.prototype.U=function(e){if(void 0!==this.t&&(Ve.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Ze.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Ze.prototype.peek=function(){if(this.h()||Re(),16&this.f)throw this.v;return this.v},Object.defineProperty(Ze.prototype,"value",{get(){1&this.f&&Re();const e=Be(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Xe.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},Xe.prototype.S=function(){1&this.f&&Re(),this.f|=1,this.f&=-9,Ye(this),We(this),Oe++;const e=Pe;return Pe=this,Ke.bind(this,e)},Xe.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ne,Ne=this)},Xe.prototype.d=function(){this.f|=8,1&this.f||Je(this)},tt.displayName="_st",Object.defineProperties(Ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:tt},props:{configurable:!0,get(){return{data:this}}},__b:{configurable:!0,value:1}}),$e("__b",((e,t)=>{if("string"==typeof t.type){let e,i=t.props;for(let n in i){if("children"===n)continue;let r=i[n];r instanceof Ve&&(e||(t.__np=e={}),e[n]=r,i[n]=r.peek())}}e(t)})),$e("__r",((e,t)=>{et();let i,n=t.__c;n&&(n.__$f&=-2,i=n.__$u,void 0===i&&(n.__$u=i=function(e){let t;return Qe((function(){t=this})),t.c=()=>{n.__$f|=1,n.setState({})},t}())),et(i),e(t)})),$e("__e",((e,t,i,n)=>{et(),e(t,i,n)})),$e("diffed",((e,t)=>{let i;if(et(),"string"==typeof t.type&&(i=t.__e)){let e=t.__np,n=t.props;if(e){let t=i.U;if(t)for(let i in t){let n=t[i];void 0===n||i in e||(n.d(),t[i]=void 0)}else t={},i.U=t;for(let r in e){let a=t[r],s=e[r];void 0===a?(a=it(i,r,s,n),t[r]=a):a.o(s,n)}}}e(t)})),$e("unmount",((e,t)=>{if("string"==typeof t.type){let e=t.__e;if(e){const t=e.U;if(t){e.U=void 0;for(let e in t){let i=t[e];i&&i.d()}}}}else{let e=t.__c;if(e){const t=e.__$u;t&&(e.__$u=void 0,t.d())}}e(t)})),$e("__h",((e,t,i,n)=>{(n<3||9===n)&&(t.__$f|=2),e(t,i,n)})),y.prototype.shouldComponentUpdate=function(e,t){const i=this.__$u;if(!(i&&void 0!==i.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(let e in t)return!0;for(let t in e)if("__source"!==t&&e[t]!==this.props[t])return!0;for(let t in this.props)if(!(t in e))return!0;return!1};var nt={languages:[{code:"uk",label:"Українська",icon:"/images/flags/ua.svg"},{code:"en",label:"English",icon:"/images/flags/gb.svg"}],layers:{DEFAULT:"default",TOPOGRAPHIC:"hillshade",SATELLITE:"satellite",OFFLINE:"default_offline",CUSTOM:"custom"},onboardingSteps:[{id:1,name:"settings",title:"onboarding.steps.settings.title",description:"onboarding.steps.settings.description",image:"/images/onboarding/settings.webp",selector:'[data-site-nav="settings"]'},{id:2,name:"draw",title:"onboarding.steps.drawing.title",description:"onboarding.steps.drawing.description",image:"/images/onboarding/drawing.webp",selector:'[data-site-nav="draw"]'},{id:3,name:"drawer",title:"onboarding.steps.sidebar.title",description:"onboarding.steps.sidebar.description",image:"/images/onboarding/sidebar.webp",selector:'[data-site-nav="drawer"]'}],features:{INFO:"info",CHRISTMAS:"christmas",SETTINGS:"settings",LANGUAGE:"language",RULER:"ruler",DRAW:"drawing",UPDATES:"updates",CALENDAR:"history-calendar",NUCLEAR:"nuclear",ARTY:"arty",FIRMS:"firms",RADIATION:"seb",ONBOARDING:"onboarding",MOBILE_APPS:"mobile-tools",SHORTCUTS:"shortcuts",RETICLE:"reticle",GEOLOCATION:"geolocation",DRAWER:"drawer",WEATHER:"weather",TRENCHES_LEGEND:"trenches-legend",STATS:"stats"}},rt=Ge({translates:Ge({}),code:Ge("uk"),languages:Ge(nt.languages),language:qe((function(){var e=rt.value,t=e.languages,i=e.code;return t.value.find((function(e){return e.code===i.value}))||t.value[0]}))}),at=0;function st(e,i,n,r,a,s){var o,l,c={};for(l in i)"ref"==l?o=i[l]:c[l]=i[l];var u={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--at,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===c[l]&&(c[l]=o[l]);return t.vnode&&t.vnode(u),u}var ot,lt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"selectLanguage",(function(t){e.translatesController.setLanguage(t).then((function(){var e="uk"===t?"":t,i=new URL(window.location.href),n=[i.origin,e,i.hash].filter((function(e){return e}));window.location.href=n.join("/")}))})),e.translatesController=window.translatesController,e}return K(t,e),Y(t,[{key:"render",value:function(){var e=this;return st("div",{className:"sidebar-stack-item sidebar-language",children:st("ul",{className:"languages-list",children:rt.value.languages.value.map((function(t,i){return st("li",{class:"language-item",onClick:function(){return e.selectLanguage(t.code)},children:[st(ct,{code:t.code}),st("span",{class:"label",children:t.label}),t.code===rt.value.code.value&&st("span",{class:"icon material-symbols-outlined",children:"done "})]},i)}))})})}}]),t}(y),ct=function(e){var t=nt.languages.find((function(t){return t.code===e.code}))||nt.languages[0],i=te(ke({}),2),n=i[0],r=i[1];
1return we((function(){e.radius&&r({height:e.radius,width:e.radius})}),[e.radius]),st("div",{class:"language-flag",style:n,children:st("img",{class:"flag",src:t.icon,alt:t.code})})},ut=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","language"),J($(e),"toolbarButtonSelector",'[data-site-nav="language"]'),J($(e),"stackNode",lt),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue),dt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Z(this,e),J(this,"handler",(function(e){return e})),this.baseURL=t?this.isAbsoluteLink(t)?t:"":window.location.origin}var t,i,n,r;return Y(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n=this.getFullLink(e);return Object.keys(t).forEach((function(e){return n.searchParams.append(e,t[e])})),fetch(n).then(this.handler).then((function(e){return i&&i.headersCb&&i.headersCb(e.headers),e.json()})).catch((function(e){throw new Error("HTTP error! Status: ".concat(e.status))}))}},{key:"post",value:(r=z(G().mark((function e(t,i){var n,r;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new URL(t,this.baseURL),e.next=3,fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});case 3:if((r=e.sent).ok){e.next=6;break}throw new Error("HTTP error! Status: ".concat(r.status));case 6:return e.abrupt("return",r.json());case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"patch",value:(n=z(G().mark((function e(t,i){var n,r;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(this.baseURL,"/").concat(t),e.next=3,fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});case 3:if((r=e.sent).ok){e.next=6;break}throw new Error("HTTP error! Status: ".concat(r.status));case 6:return e.abrupt("return",r.json());case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"delete",value:(i=z(G().mark((function e(t){var i,n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="".concat(this.baseURL,"/").concat(t),e.next=3,fetch(i,{method:"DELETE"});case 3:if((n=e.sent).ok){e.next=6;break}throw new Error("HTTP error! Status: ".concat(n.status));case 6:return e.abrupt("return",n.json());case 7:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"sendFormData",value:(t=z(G().mark((function e(t,i){var n,r,a,s=arguments;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:"POST",r=new URL(t,this.baseURL),e.next=4,fetch(r,{method:n,body:i});case 4:if((a=e.sent).ok){e.next=7;break}throw new Error("HTTP error! Status: ".concat(a.status));case 7:return e.abrupt("return",a.json());case 8:case"end":return e.stop()}}),e,this)}))),function(e,i){return t.apply(this,arguments)})},{key:"isAbsoluteLink",value:function(e){return e.startsWith("http")}},{key:"getFullLink",value:function(e){return this.isAbsoluteLink(e)?new URL(e):new URL(e,this.baseURL)}}]),e}(),ht=function(){function e(){Z(this,e),J(this,"apiUrl",""),J(this,"isLastResponseWasCached",{}),this.httpClient=new dt(this.apiUrl)}return Y(e,[{key:"fetchHistoryVersions",value:function(){var e=this;return this.httpClient.get("/api/history/public",void 0,{headersCb:function(t){t.has("x-sw-cache")&&"hit"===t.get("x-sw-cache")?e.isLastResponseWasCached["/api/history/public"]=!0:e.isLastResponseWasCached["/api/history/public"]=!1}})}},{key:"fetchHistoryGeoJson",value:function(e){var t=this;return this.httpClient.get("/api/history/".concat(e,"/geojson"),void 0,{headersCb:function(i){i.has("x-sw-cache")&&"hit"===i.get("x-sw-cache")?t.isLastResponseWasCached["/api/history/".concat(e,"/geojson")]=!0:t.isLastResponseWasCached["/api/history/".concat(e,"/geojson")]=!1}})}},{key:"fetchLatestHistory",value:function(){var e=this;return this.httpClient.get("/api/history/last",void 0,{headersCb:function(t){t.has("x-sw-cache")&&"hit"===t.get("x-sw-cache")?e.isLastResponseWasCached["/api/history/last"]=!0:e.isLastResponseWasCached["/api/history/last"]=!1}})}},{key:"fetchDifferenceByVersions",value:function(e){return this.httpClient.get("/api/history/".concat(e,"/diff/prev"))}},{key:"fetchHistoryArea",value:function(e){return this.httpClient.get("/api/history/".concat(e,"/areas"))}}]),e}(),pt=function(){function e(){Z(this,e),this.storage=window.localStorage}return Y(e,[{key:"getItem",value:function(e){var t=this.storage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return t}return null}},{key:"setItem",value:function(e,t){t&&("string"!=typeof t&&(t=JSON.stringify(t)),this.storage.setItem(e,t))}},{key:"clear",value:function(e){e?this.storage.removeItem(e):this.storage.clear()}}]),e}(),vt={revisions:[],currentRevisionId:0,latestViewedRevisionId:0},ft=Ge({revisions:Ge([]),currentRevisionId:Ge(0),latestRevisionId:Ge(0),lastViewedRevisionId:Ge(0),isLatestRevision:qe((function(){var e=ft.value,t=e.revisions,i=e.currentRevisionId;if(!t.value.length)return!0;var n=t.value.findIndex((function(e){return e.id===i.value}));return t.value.length-1===n})),isFirstRevisionVersion:qe((function(){var e,t=ft.value,i=t.revisions,n=t.currentRevisionId,r=(null===(e=i.value)||void 0===e?void 0:e.findIndex((function(e){return e.id===n.value})))||0;return 0===r})),currentRevisionDate:qe((function(){var e=ft.value.currentRevisionId.value;return new Date(1e3*e)}))}),mt=function(){function e(){Z(this,e),J(this,"storageKey","dsm-latest-ver"),J(this,"polygonsLayer",window.polygonsLayer),J(this,"historyService",new ht),J(this,"profileService",window.profile),J(this,"storageService",new pt);var t=Number(this.profileService.getSetting("lastViewedRevision"));this.state=V(V({},vt),{},{latestViewedRevisionId:t}),ft.value.lastViewedRevisionId.value=t}return Y(e,[{key:"revisions",value:function(){var e=this;return this.state.revisions.length?new Promise((function(t){return t(e.state.revisions)})):this.historyService.fetchHistoryVersions().then((function(t){var i=t.map((function(e){return V(V({},e),{},{descriptionEn:void 0,description:{uk:e.description,en:e.descriptionEn}})}));return e.state.revisions=i,ft.value.revisions.value=i,i}))}},{key:"selectRevision",value:function(e){var t=this;this.historyService.fetchHistoryGeoJson(e).then((function(i){ft.value.currentRevisionId.value=e,t.polygonsLayer.setLayerData(i)}))}},{key:"viewRevisionFromDescription",value:function(e){var t=this;this.historyService.fetchHistoryGeoJson(e).then((function(i){ft.value.currentRevisionId.value=e,t.updateViewedRevision(e),t.polygonsLayer.setLayerData(i)}))}},{key:"loadLastRevision",value:function(){var e=this;return this.historyService.fetchLatestHistory().then((function(t){return ft.value.currentRevisionId.value=t.id,ft.value.latestRevisionId.value=t.id,e.polygonsLayer.setLayerData(t.map),t}))}},{key:"updateViewedRevision",value:function(e){this.state.currentRevisionId=e,ft.value.currentRevisionId.value=e,e>=this.state.latestViewedRevisionId&&(this.storageService.setItem(this.storageKey,e),this.profileService.updateSetting("lastViewedRevision",e),ft.value.lastViewedRevisionId.value=e,this.state.latestViewedRevisionId=e)}}]),e}(),gt=function(e){var t=e.children,i=te(ke(t),2),n=i[0],r=i[1];return we((function(){var i=window.translateService;i.loaded$.value?r(i.translate(t,e.options)):i.loaded$.subscribe((function(){r(i.translate(t,e.options))}))}),[e]),st(g,{children:n})},yt=function(){return st("div",{class:"knight-preloader",children:st("svg",{width:"19",height:"36",viewBox:"0 0 19 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"preloader-knight",children:st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.4545 1.11519C10.9846 1.76884 11.9704 2.87911 12.6454 3.58285C14.2951 5.30253 16.7469 8.34013 17.2474 9.28405C17.5609 9.87519 17.5262 10.2302 17.0959 10.8378C16.5366 11.6274 15.1013 11.9382 15.1013 11.2695C15.1013 10.6564 13.0187 9.8
11487 11.63 9.86642C10.7887 9.89786 10.0102 9.6595 9.50712 9.21715L8.71275 8.51816L8.98148 9.96768C9.38402 12.1385 10.0727 13.2085 12.2554 15.0525C14.654 17.0793 16.1954 19.7466 16.466 22.3389C16.6394 23.9982 16.534 24.4552 15.699 25.6719C15.1671 26.4472 14.7317 27.2109 14.7317 27.3685C14.7317 27.5264 15.2351 28.0382 15.8502 28.5058C19.0635 30.9479 18.9851 30.8521 18.5416 31.8147C18.2895 32.3619 18.2562 32.9151 18.4569 33.2284C18.638 33.5113 18.7889 34.116 18.7922 34.5719L18.7977 35.4006C18.7977 35.4006 18.6099 35.3988 9.46424 35.303C0.318528 35.2072 1.34494 35.303 0.0205967 35.303C-0.0400248 34.8833 0.00878906 33.75 0.491891 33.2017C1.02048 32.7677 1.01937 32.6654 0.480432 32.0761C0.0124644 31.5646 -0.0259782 31.2667 0.298938 30.666C0.525899 30.2471 0.804116 30.0414 1.00126 29.9045C1.13379 29.8125 1.98229 29.3196 2.82693 28.6045C4.43857 27.2406 4.46001 26.8073 2.99548 25.2313C2.71825 24.9334 2.52826 23.6835 2.52049 22.11C2.51347 20.6664 2.24511 18.1694 1.92426 16.5609C0.716266 10.5055 0.798326 9.00219 2.46985 6.54075C3.64753 4.80608 5.55157 3.41103 7.37428 2.94711C8.4869 2.66378 8.64585 2.47039 8.74713 1.27678C8.88833 -0.381855 9.21547 -0.412564 10.4545 1.11519Z","stroke-width":"2"})})})},bt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"v",qe((function(){return ft.value.currentRevisionId.value}))),e.translateService=window.translateService,e.revisionsController=window.revisionsController,e.state={areas:[],prevAreas:[]},ft.value.currentRevisionId.subscribe((function(t){e.fetchRevisionArea(t)})),e}return K(t,e),Y(t,[{key:"fetchRevisionArea",value:function(e){var t=this,i=new ht;i.fetchHistoryArea(e).then((function(e){var i=e.find((function(e){return"occupied_to_24_02_2022"===e.type})),n=e.find((function(e){return"occupied_after_24_02_2022"===e.type})),r=e.find((function(e){return"unspecified"===e.type}));(e=e.filter((function(e){return!["other_territories","unspecified"].includes(e.type)}))).push({hash:"#bcaaa4",area:r.area||0,percent:r.percent,type:r.type}),e.push({hash:"#eb0c0c",area:(null==i?void 0:i.area)+(null==n?void 0:n.area)||0,percent:Number(i.percent)+Number(n.percent),type:"occupied_total"}),t.setState({areas:e})})),this.revisionsController&&this.revisionsController.revisions().then((function(n){var r=n.findIndex((function(t){return t.id===e}));if(-1!==r){var a=n[r-1>=0?r-1:0].id;i.fetchHistoryArea(a).then((function(e){var i=e.find((function(e){return"occupied_to_24_02_2022"===e.type})),n=e.find((function(e){return"occupied_after_24_02_2022"===e.type})),r=e.find((function(e){return"unspecified"===e.type}));(e=e.filter((function(e){return!["other_territories","unspecified"].includes(e.type)}))).push({hash:"#bcaaa4",area:r.area||0,percent:r.percent,type:r.type}),e.push({hash:"#eb0c0c",area:(null==i?void 0:i.area)+(null==n?void 0:n.area)||0,percent:Number(i.percent)+Number(n.percent),type:"occupied_total"}),t.setState({prevAreas:e})}))}}))}},{key:"render",value:function(){var e=this;return st("div",{class:"sidebar-stack-item sidebar-info",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"info.header"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{className:"stack-item-body",children:[st("div",{class:"stack-item-section",style:"padding-right:6px",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"areas.chartTitle"})}),this.state.areas.length?this.state.areas.map((function(t,i){var n=null;if(e.state.prevAreas.length&&e.state.prevAreas[i]){var r=e.state.prevAreas.find((function(e){return e.hash===t.hash}));r&&(n=t.area-r.area)}return st("div",{class:"sidebar-info-bar-item",children:[st("h3",{class:"sidebar-info-bar-label",children:[" ",st(gt,{children:"areas.labels.".concat(t.type)})]}),st("div",{class:"sidebar-info-bar-wrap",children:st("div",{class:"sidebar-info-bar",style:"width:".concat(t.percent,"%; background-color:").concat(t.hash)})}),st("div",{class:"sidebar-info-bar-subtext",children:[st("div",{children:[st("span",{children:[new Intl.NumberFormat(e.translateService.language).format(t.area/1e3)," ",st(gt,{children:"info.square"})]}),n&&n>0?st("span",{style:"margin-left: 12px; font-size: 0.85rem; color: var(--theme-text-secondary);",children:["+",n.toFixed(1)+" "+e.translateService.translate("info.square").split(" ")[1]]}):null,n&&n<0?st("span",{style:"margin-left: 12px; font-size: 0.85rem; color: var(--theme-text-secondary);",children:n.toFixed(1)+" "+e.translateService.translate("info.square").split(" ")[1]}):null]}),st("div",{children:[Number(t.percent).toFixed(2),"%"]})]})]})})):st(yt,{})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"info.legend"})}),st("div",{class:"sidebar-info-legend",children:[st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #BFDBF1; border: 2px solid #0088D1;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.blue"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #C2E2CE; border: 2px solid #0B9D58;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.green"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #EBE6E4; border: 2px solid #BCAAA4;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.gray"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #E6C0BB; border: 2px solid #A52714;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.red"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #DEBACA; border: 2px solid #870E4F;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.purple"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #FFD2D1; border: 2px solid #FF6666;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.pink"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box striped",children:st("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("g",{"clip-path":"url(#clipbox)",children:[st("rect",{x:"14.4558",y:"-10",width:"27",height:"4",transform:"rotate(45 14.4558 -10)",fill:"#333333"}),st("rect",{x:"8.79895",y:"-4.34326",width:"27",height:"4",transform:"rotate(45 8.79895 -4.34326)",fill:"#333333"}),st("rect",{x:"3.14209",y:"1.31372",width:"27",height:"4",transform:"rotate(45 3.14209 1.31372)",fill:"#333333"}),st("rect",{x:"-2.51477",y:"6.97046",width:"27",height:"4",transform:"rotate(45 -2.51477 6.97046)",fill:"#333333"}),st("rect",{x:"-8.17163",y:"12.6274",width:"27",height:"4",transform:"rotate(45 -8.17163 12.6274)",fill:"#333333"})]}),st("rect",{x:"1",y:"1",width:"18",height:"18",stroke:"#333333","stroke-width":"2"}),st("defs",{children:st("clipPath",{id:"clipbox",children:st("rect",{width:"20",height:"20",fill:"white"})})})]})}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.railway"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box striped-yellow",children:st("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("g",{"clip-path":"url(#clipbox)",children:[st("rect",{x:"14.4558",y:"-10",width:"27",height:"4",transform:"rotate(45 14.4558 -10)",fill:"#FFBF00"}),st("rect",{x:"8.79895",y:"-4.34326",width:"27",height:"4",transform:"rotate(45 8.79895 -4.34326)",fill:"#FFBF00"}),st("rect",{x:"3.14209",y:"1.31372",width:"27",height:"4",transform:"rotate(45 3.14209 1.31372)",fill:"#FFBF00"}),st("rect",{x:"-2.51477",y:"6.97046",width:"27",height:"4",transform:"rotate(45 -2.51477 6.97046)",fill:"#FFBF00"}),st("rect",{x:"-8.17163",y:"12.6274",width:"27",height:"4",transform:"rotate(45 -8.17163 12.6274)",fill:"#FFBF00"})]}),st("rect",{x:"1",y:"1",width:"18",height:"18",stroke:"#FFBF00","stroke-width":"2"}),st("defs",{children:st("clipPath",{id:"clipbox",children:st("rect",{width:"20",height:"20",fill:"white"})})})]})}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"info.railway-construction"})})]})]})]})]})]})}}]),t}(y),kt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","info"),J($(e),"toolbarButtonSelector",'[data-site-nav="info"]'),J($(e),"stackNode",bt),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],mobileLayout:l.
1USE_MINIMUN_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue);!function(e){e.DISABLED="disabled",e.FULL="full",e.SIMPLIFIED="simplified"}(ot||(ot={}));var wt,Ct=function(){function e(t,i,n){Z(this,e),J(this,"themeController",window.themeController),J(this,"mapController",window.mapController),J(this,"state",ot.DISABLED),J(this,"trenchesUrl","https://st2.deepstatemap.live/trenches/{z}/{x}/{y}.webp"),J(this,"simpleTrenchesUrl","/simple_trenches.geojson"),this.map=t,this.featuresController=i,this.translateSvc=n}return Y(e,[{key:"getState",value:function(){return this.state}},{key:"setState",value:function(e){this.state=e,this.render()}},{key:"setOverrideUrl",value:function(e){this.trenchesUrlOverride=e||void 0}},{key:"loadData",value:function(e){var t=this;if(void 0!==this.simplifiedTrenchesData)return console.log("[TrenchesLayer] Data exists"),e();fetch(this.simpleTrenchesUrl).then((function(e){return e.json()})).then((function(i){return console.log("[TrenchesLayer] Data loaded"),t.simplifiedTrenchesData=i,e()})).catch((function(e){t.setState(ot.DISABLED)}))}},{key:"getLegend",value:function(){return'<div class="legend-title" style="display: none;">\n        '.concat(this.translateSvc.translate("defenceStructures.title"),'\n    </div>\n    <div class="legend-row">\n        <div class="legend-marker" style="background-color: #56FFFF;"></div>\n        <div class="legend-value">\n            ').concat(this.translateSvc.translate("defenceStructures.teeth"),'\n        </div>\n    </div>\n    <div class="legend-row">\n        <div class="legend-marker" style="background-color: #FF5601;"></div>\n        <div class="legend-value">\n            ').concat(this.translateSvc.translate("defenceStructures.trenches"),'\n        </div>\n    </div>\n    <div class="legend-row">\n        <div class="legend-marker" style="background-color: #FFFF00;"></div>\n        <div class="legend-value">\n            ').concat(this.translateSvc.translate("defenceStructures.moats"),'\n        </div>\n    </div>\n    <div class="legend-row">\n        <div class="legend-marker" style="background-color: #FF56FE;"></div>\n        <div class="legend-value">\n            ').concat(this.translateSvc.translate("defenceStructures.caponiers"),'\n        </div>\n    </div>\n    <div class="legend-row">\n        <div class="legend-marker" style="background-color: #000000;"></div>\n        <div class="legend-value">\n            ').concat(this.translateSvc.translate("defenceStructures.other"),"\n        </div>\n    </div>")}},{key:"render",value:function(){var e=this;-1===Object.keys(this.map.getPanes()).indexOf("trenches")&&this.map.createPane("trenches");var t;if(this.state===ot.DISABLED)this.leafletLayerFull&&(this.leafletLayerFull.remove(),this.leafletLayerFull=void 0),this.leafletLayerSimplified&&(this.leafletLayerSimplified.remove(),this.leafletLayerSimplified=void 0),this.trenchesLegendElement&&(this.trenchesLegendElement.style.display="none");else if(this.state===ot.FULL)this.leafletLayerSimplified&&(this.leafletLayerSimplified.remove(),this.leafletLayerSimplified=void 0),this.leafletLayerFull||(this.leafletLayerFull=L.tileLayer(this.trenchesUrlOverride||this.trenchesUrl,{pane:"trenches",maxNativeZoom:14,minNativeZoom:5,bounds:[[44.02738,22.10166],[52.42326,40.25842]]})),this.leafletLayerFull.addTo(this.map),e.trenchesLegendElement||(e.trenchesLegendElement=document.createElement("div"),e.trenchesLegendElement.classList.add("trenches-legend"),e.trenchesLegendElement.setAttribute("onClick",'document.querySelector(".trenches-legend").style["display"] = "none";'),e.trenchesLegendElement.innerHTML=e.getLegend(),null===(t=document.querySelector("section.main"))||void 0===t||t.prepend(e.trenchesLegendElement)),e.trenchesLegendElement&&(e.trenchesLegendElement.style.display="flex");else if(this.state===ot.SIMPLIFIED){if(this.leafletLayerFull&&(this.leafletLayerFull.remove(),this.leafletLayerFull=void 0),!this.leafletLayerSimplified){var i="dark"===this.themeController.getTheme()||"satellite"===this.mapController.baseLayer.value;this.leafletLayerSimplified=L.geoJSON(void 0,{pane:"trenches",style:function(){return{weight:2,fillColor:i?"#ffffff"
1:"#000000",fillOpacity:1,color:i?"#ffffff":"#000000"}}})}this.loadData((function(){e.leafletLayerSimplified&&(e.leafletLayerSimplified.addData(e.simplifiedTrenchesData),e.leafletLayerSimplified.addTo(e.map))}))}}}]),e}(),St=function(e){var t="";for(var i in e){t=e[i]?t+" "+i:t}return t.trim()};function _t(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document.body;return new Promise((function(n,r){var a=document.querySelector('[src*="'.concat(e.split("?")[0],'"]'));a?n(!0):(a=document.createElement("script"),Object.entries(t).forEach((function(e){var t,i=te(e,2),n=i[0],r=i[1];null===(t=a)||void 0===t||t.setAttribute(n,r)})),a.setAttribute("src",e),i.appendChild(a)),a.onload=function(){return n(!0)},a.onerror=function(){return r(new Error('Failed to load "'.concat(e," script")))}}))}function Et(e){var t=e.getBoundingClientRect(),i=+t.top.toFixed(0),n=+t.left.toFixed(0),r=t.left+t.width/2,a=t.top+t.height/2;return{top:i,left:n,center:{x:+r.toFixed(0),y:+a.toFixed(0)}}}!function(e){e.CAN_DOWNLOAD="can_download",e.CAN_UPDATE="can_update",e.CAN_DELETE="can_delete",e.DO_NOTHING="do_nothing",e.ALREADY_INSTALLED="already_installed",e.NO_FREE_SPACE="no_free_space",e.REQUIREMENTS_NOT_MET="requirements_not_met",e.OTHER_TASK_IN_PROGRESS="other_task_in_progress"}(wt||(wt={}));var Lt=function(){function e(){Z(this,e)}return Y(e,null,[{key:"formatBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 B";var i=t<0?0:t,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(i))," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}},{key:"controlKey",value:function(){return navigator.platform.toLowerCase().includes("mac")?"⌘":"Ctrl"}}]),e}(),xt=function(e){return st("span",{class:"shortcut",children:e.shortcut.replace("opt",Lt.controlKey())})},It=function(e){var t=te(ke(!1),2),i=t[0],n=t[1],r=te(ke({}),2),a=r[0],s=r[1],o=Ce(null),l=Ce(null),c=function(){l.current&&l.current.parentNode&&l.current.parentNode.removeChild(l.current)},u=function(){if(o.current&&l.current){var t=o.current.getBoundingClientRect(),i=l.current.getBoundingClientRect(),n=d(t,i,e.placement||"top");s(n)}},d=function(e,t,i){switch(i){case"top":return{left:"".concat(e.left+e.width/2-t.width/2,"px"),top:"".concat(e.top-t.height,"px")};case"bottom":return{left:"".concat(e.left+e.width/2-t.width/2,"px"),top:"".concat(e.bottom,"px")};case"left":return{left:"".concat(e.left-t.width,"px"),top:"".concat(e.top+e.height/2-t.height/2,"px")};case"right":return{left:"".concat(e.right+18,"px"),top:"".concat(e.top+e.height/2-t.height/2,"px")};default:return{}}};return we((function(){return i&&l.current?(document.body.appendChild(l.current),u()):c(),function(){return c()}}),[i]),st(g,{children:[O(e.children,{ref:o,onMouseEnter:function(){n(!0),u()},onMouseLeave:function(){n(!1)}}),i&&st("div",{ref:l,className:St(J({tooltip:!0},e.placement||"top",!0)),style:a,children:[st(gt,{children:e.text}),e.shortcut&&st(xt,{shortcut:e.shortcut})]})]})},Ft=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"offlineMapsController",window.offlineMapsController),J($(e),"translateService",window.translateService),J($(e),"progressListener",null),e.state={},e.offlineMapsController.isAppOffline.subscribe((function(t){e.setState({isAppOffline:t})})),e}var i,n,r;return K(t,e),Y(t,[{key:"componentDidMount",value:(r=z(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(new dt).get("/offline-config.json");case 2:return t=e.sent,e.next=5,this.fetchUsage();case 5:this.setState({offlineConfig:t});case 6:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"fetchUsage",value:(n=z(G().mark((function e(){var t,i;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={},!navigator.storage){e.next=8;break}return e.next=4,navigator.storage.estimate();case 4:(i=e.sent).quota&&(t.quota=i.quota),i.usage&&(t.reportedUsage=i.usage),i.usageDetails&&i.usageDetails.caches&&(t.reportedCache
1Usage=i.usageDetails.caches);case 8:Object.values(t).filter((function(e){return void 0!==e})).length>0&&this.setState({usageDetails:t});case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"mapRange",value:function(e,t,i,n,r){return(e-t)*(r-n)/(i-t)+n}},{key:"downloadAsset",value:function(e,t,i){var n=this;this.offlineMapsController.progressEmitter.removeAllListeners(e.assetId),this.offlineMapsController.progressEmitter.addListener(e.assetId,(function(e){var r=e.status,a=e.progress,s=e.code,o=e.message,l=e.errorObj;return"done"===r?i(null,!0):"error"===r?(l&&(console.log("[Offline] Worker error"),console.error(l)),i("".concat(s,": ").concat(o),!1)):void(void 0!==a&&n.setState({activeItemProgress:n.mapRange(a,0,100,t[0],t[1])}))})),this.offlineMapsController.downloadAndProcessAsset(e)}},{key:"divideNumberIntoRanges",value:function(e,t){for(var i=Math.floor(e/t),n=[],r=0,a=0;a<t;a++){var s=r+i+(a===t-1?e%t:0)-1;n.push({start:r,end:s}),r=s+1}return n}},{key:"mapErrorCodeAndMessage",value:function(e){if(-1===e.indexOf(": "))return e;var t=te(e.split(": "),2),i=t[0],n=t[1];switch(i){case"verify_error":return this.translateService.translate("offline.errors.integrity");case"worker_error":return this.translateService.translate("offline.errors.worker",{message:n});case"fetch_error":return this.translateService.translate("offline.errors.fetch",{message:n});default:return e}}},{key:"handleItemAction",value:function(e,t){var i=this;if(console.log("handleItemAction",e,t),t===wt.CAN_DOWNLOAD){window.featuresController.setDisableFeatureActions(!0),this.setState({activeItemId:e.id,activeItemProgress:0});var n=this.divideNumberIntoRanges(100,e.assets.length),r=e.assets.length,a=0;!function t(s){console.log("processing asset ",s,[n[s].start,n[s].end]);var o=e.assets[s];i.downloadAsset(o,[n[s].start,n[s].end],(function(n,s){n?i.setState({sectionError:i.mapErrorCodeAndMessage(n)}):s&&(a+1<r?(console.log("asset done, next asset is "+(a+1)),t(a+=1)):(i.offlineMapsController.addItemToLocalConfig(e),window.featuresController.setDisableFeatureActions(!1),i.setState({activeItemId:void 0,activeItemProgress:void 0})))}))}(a)}}},{key:"handleCancelClick",value:function(){this.offlineMapsController.terminateWorker(),window.featuresController.setDisableFeatureActions(!1),this.setState({activeItemId:void 0,activeItemProgress:void 0})}},{key:"handlePurgeClick",value:(i=z(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.offlineMapsController.purgeAllCaches();case 2:this.forceUpdate();case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"formatUsagePercentage",value:function(e,t){var i=e/t;return i<.01?"< 1%":"".concat((100*i).toFixed(1),"%")}},{key:"formatUsagePercentageStyle",value:function(e,t){var i=e/t;return i<.01?"1%":"".concat((100*i).toFixed(1),"%")}},{key:"renderConfigItem",value:function(e,t){var i=this,n=e.assets.reduce((function(e,t){return e+t.size}),0),r=t.find((function(t){return t.assetId===e.id}));return st("div",{class:"sidebar-settings-offline-row",children:[st("div",{class:"offline-row-details",children:[st("p",{class:"asset-name",children:[" ",e.title," "]}),st("p",{class:"asset-description",children:[" ",e.description," "]}),st("div",{class:"asset-meta",children:[st("span",{children:st(gt,{options:{version:e.version},children:"offline.version"})}),st("span",{children:"•"}),st("span",{children:Lt.formatBytes(n)}),void 0!==(null==r?void 0:r.actionProgress)&&(null==r?void 0:r.actionProgress)!==1/0?st(g,{children:[st("span",{children:"•"}),st("span",{children:[r.actionProgress.toFixed(0),"%"]})]}):null]})]}),st("div",{class:"offline-row-actions",children:function(){var t,n,a,s;if(!r)return st(It,{placement:"right",text:"offline.package-status",children:st("button",{disabled:!0,children:st("span",{class:"material-symbols-outlined",children:"block"})})});r.action===wt.REQUIREMENTS_NOT_MET&&(a=null===(s=i.state.offlineConfig)||void 0===s?void 0:s.filter((function(e){var t;return-1!==(null===(t=r.missingAssetIds)||void 0===t?void 0:t.indexOf(e.id))})).map((function(e){return'"'.concat(e.title,'"')})).join(", "));var o=J(J(J(J(J(J(J(J({},wt.CAN_DOWNLOAD,{tooltipText:"offline.messages.load",icon:"download",disable:!1}),wt.CAN_UPDATE,{tooltipText:"offline.messages.update",icon:"system_update_alt",disable:!1}),wt.CAN_DELETE,{tooltipText:"offline.messages.remove",icon:"delete_forever",disable:!1}),wt.DO_NOTHING,{tooltipText:"offline.messages.not-available",icon:"block",disable:!0}),wt.OTHER_TASK_IN_PROGRESS,{tooltipText:"offline.messages.another-task",icon:"hourglass",disable:!0}),wt.ALREADY_INSTALLED,{tooltipText:"offline.messages.installed",icon:"done",disable:!0}),wt.NO_FREE_SPACE,{tooltipText:"offline.messages.memory",icon:"warning",disable:!0}),wt.REQUIREMENTS_NOT_MET,{icon:"lock",disable:!0,tooltipText:i.translateService.translate("offline.messages.need-to-install",{package:null!==(t=a)&&void 0!==t?t:i.translateService.translate("offline.messages.another-packages",{package:null!==(n=a)&&void 0!==n?n:i.translateService.translate("offline.messages.another-packages")})})});return void 0!==r.actionProgress?st("div",{class:"progress-indicator",style:{background:"radial-gradient(closest-side, var(--theme-bg) 80%, transparent 85% 100%), conic-gradient(#0C87F8 ".concat(r.actionProgress,"%, var(--theme-bg
1-hover) 0)")},onClick:i.handleCancelClick.bind(i),children:st("span",{class:"material-symbols-outlined",children:"close"})}):o[r.action]?st(It,{placement:"right",text:o[r.action].tooltipText,children:st("button",{disabled:o[r.action].disable,onClick:o[r.action].disable?void 0:i.handleItemAction.bind(i,e,r.action),children:st("span",{class:"material-symbols-outlined",children:o[r.action].icon})})}):st(It,{placement:"right",text:"offline.messages.not-available",children:st("button",{disabled:!0,children:st("span",{class:"material-symbols-outlined",children:"block"})})})}()})]})}},{key:"render",value:function(){var e,t,i,n,r=this,a=[];this.state.offlineConfig&&(void 0!==(null===(e=this.state)||void 0===e||null===(e=e.usageDetails)||void 0===e?void 0:e.quota)&&void 0!==(null===(t=this.state)||void 0===t||null===(t=t.usageDetails)||void 0===t?void 0:t.reportedUsage)&&(n=this.state.usageDetails.quota-this.state.usageDetails.reportedUsage),a=this.offlineMapsController.evaluatePossibleActions(this.state.offlineConfig,null===(i=this.state.usageDetails)||void 0===i?void 0:i.quota,n));if(this.state.activeItemId&&void 0!==this.state.activeItemProgress){var s=a.find((function(e){return e.assetId===r.state.activeItemId}));if(s){var o=+this.state.activeItemProgress.toFixed(0);s.actionProgress!==o&&(s.actionProgress=o)}var l,c=ae(a.filter((function(e){return e.assetId!==r.state.activeItemId})));try{for(c.s();!(l=c.n()).done;){l.value.action=wt.OTHER_TASK_IN_PROGRESS}}catch(e){c.e(e)}finally{c.f()}}return st("div",{class:"sidebar-stack-item sidebar-settings",children:[st("div",{class:"stack-item-subheader",onClick:function(){return r.props.dismissSelf()},children:[st("span",{class:"material-symbols-outlined",children:"arrow_back"})," ",st(gt,{children:"offline.settings"})]}),st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:["  ",st(gt,{children:"settings.offline.header"}),"    "]}),st("div",{class:"stack-item-dismiss",onClick:function(){return r.props.dismissSettings()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),this.state.usageDetails&&this.state.usageDetails.reportedUsage&&this.state.usageDetails.quota?st("div",{class:"sidebar-info-bar-item sidebar-settings-offline-usage",children:[st("h3",{class:"sidebar-info-bar-label",children:st(gt,{children:"offline.memory"})}),st("div",{class:"sidebar-info-bar-wrap",children:st("div",{class:"sidebar-info-bar info-bar-general",style:{width:this.formatUsagePercentageStyle(this.state.usageDetails.reportedUsage,this.state.usageDetails.quota)}})}),st("div",{class:"sidebar-info-bar-subtext",children:[st("div",{children:[Lt.formatBytes(this.state.usageDetails.reportedUsage),st("br",{}),this.formatUsagePercentage(this.state.usageDetails.reportedUsage,this.state.usageDetails.quota)]}),st("div",{children:Lt.formatBytes(this.state.usageDetails.quota)})]})]}):null,this.state.isAppOffline?null:st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-settings-full-width-button",onClick:function(){return r.offlineMapsController.handleMapErrorAction()},children:st(gt,{children:"offline.switchToOffline"})})}),this.state.activeItemId?st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-settings-message",children:st(gt,{children:"offline.messages.pleaseBePatient"})})}):null,this.state.sectionError?st("div",{class:"stack-item-section",children:st("div",{class:"stack-error",children:[st(gt,{children:"offline.errors.header"}),st("br",{}),this.state.sectionError]})}):r.state.offlineConfig?st("div",{class:"stack-item-section",children:r.state.offlineConfig.map((function(e){return r.renderConfigItem(e,a)}))}):st("div",{class:"stack-item-section",children:st(yt,{})}),st("div",{class:"stack-item-section",children:st("button",{class:"sidebar-settings-offline-purge",onClick:this.handlePurgeClick.bind(this),children:st(gt,{children:"offline.removeAll"})})})]})}}]),t}(y),Mt=[{property:"units",icon:{nato:"/images/custom_nato/enemy.png",custom:"/images/custom/enemy.png"},label:"settings.map-marks.units"},{property:"headquarters",icon:{nato:"/images/custom_nato/headquarter.png",custom:"/images/custom/headquarter.png"},label:"settings.map-marks.headquarters"},{property:"airfields",icon:{nato:"/images/custom_nato/airport.png",custom:"/images/custom/airport.png"},label:"settings.map-marks.airfields"},{property:"arrows",icon:{nato:"/images/custom_nato/arrow_2.png",custom:"/images/custom/arrow_2.png"},label:"settings.map-marks.arrows"},{property:"railway",icon:{nato:"/images/custom_nato/railway.png",custom:"/images/custom/railway.png"},label:"settings.map-marks.railway"}],Rt=function(e){function t(){var e,i,n;return Z(this,t),J($(n=U(this,t)),"featuresController",window.featuresController),J($(n),"profileService",window.profile),J($(n),"trenchesLayerRef",window.trenchesLayer),J($(n),"mapUnitsControllerRef",window.mapUnitsController),J($(n),"accessibilityControllerRef",window.accessibilityController),J($(n),"reticle",qe((function(){return n.featuresController.getFeatureSignals()[nt.features.RETICLE].value}))),J($(n),"mapLayer",qe((function(){var e;return null===(e=window.mapController)||void 0===e?void 0:e.getBaseLayer().value}))),n.state={currentTheme:null===(e=window.themeController)||void 0===e?void 0:e.getTheme(),filterSettings:null===(i=window.polygonsLayer)||void 0===i?void 0:i.markersSettingsState,isImperialScale:n.mapUnitsControllerRef.getIsImperial(),withBorders:n.profileService.getSetting("polygonBorders"),accessibilityReduceMotion:n.accessibilityControllerRef.getSettings().reduceMotion,accessibilityNeedReload:!1,trenchesToggle:!1,trenchesToggleSimple:!1},n}
1return K(t,e),Y(t,[{key:"componentDidMount",value:function(){var e=this;if("serviceWorker"in navigator){if(navigator.serviceWorker.getRegistration("/").then((function(t){t&&t.active&&"activated"===t.active.state?e.setState({offlineMapsSupported:!0}):e.setState({offlineMapsSupported:!1})})).catch((function(t){e.setState({offlineMapsSupported:!1})})),this.trenchesLayerRef)switch(this.trenchesLayerRef.getState()){case ot.DISABLED:this.setState({trenchesToggle:!1,trenchesToggleSimple:!1});break;case ot.SIMPLIFIED:this.setState({trenchesToggle:!1,trenchesToggleSimple:!0});break;default:case ot.FULL:this.setState({trenchesToggle:!0,trenchesToggleSimple:!1})}}else this.setState({offlineMapsSupported:!1})}},{key:"selectBaseLayer",value:function(e){var t,i,n;null===(t=window.mapController)||void 0===t||t.setBaseLayer(e),this.setState({currentTheme:null===(i=window.themeController)||void 0===i?void 0:i.getTheme(),filterSettings:null===(n=window.polygonsLayer)||void 0===n?void 0:n.markersSettingsState})}},{key:"handleThemeChange",value:function(e){var t,i=e.target;null===(t=window.themeController)||void 0===t||t.setTheme(i.checked?"dark":"light")}},{key:"handleUnitFiltersChange",value:function(e){var t=e.target,i=t.getAttribute("data-filter-property");if(i&&void 0!==this.state.filterSettings[i]){var n=window.polygonsLayer;null==n||n.changeMarkersSettingsState(i,t.checked),this.setState({filterSettings:null==n?void 0:n.markersSettingsState})}}},{key:"handleUnitFilterToggleOff",value:function(e){var t=window.polygonsLayer;t&&(["airfields","headquarters","units","arrows"].map((function(e){t.changeMarkersSettingsState(e,!1)})),this.setState({filterSettings:null==t?void 0:t.markersSettingsState}))}},{key:"handleReticleToggleClick",value:function(){this.featuresController.enableFeatureById(nt.features.RETICLE)}},{key:"handleIsImperialScaleToggleClick",value:function(e){var t=e.target;this.mapUnitsControllerRef.setImperial(t.checked);var i=window.polygonsLayer;i&&i.refreshPolygons(),this.setState({isImperialScale:t.checked})}},{key:"handleBorderToggleClick",value:function(e){var t=e.target.checked,i=window.polygonsLayer;i&&(this.profileService.updateSetting("polygonBorders",t),i.refreshStyles()),this.setState({withBorders:t})}},{key:"trenchesToggleToState",value:function(e,t){return e?e&&!t?ot.FULL:e&&t?ot.SIMPLIFIED:ot.DISABLED:ot.DISABLED}},{key:"handleTrenchesToggleChange",value:function(){this.trenchesLayerRef.setState(this.trenchesToggleToState(!!this.state.trenchesToggle,!!this.state.trenchesToggleSimple))}},{key:"handleTrenchesToggleClick",value:function(e){e.target.checked,this.setState({trenchesToggle:!this.state.trenchesToggle,trenchesToggleSimple:!1},this.handleTrenchesToggleChange.bind(this))}},{key:"handleTrenchesToggleSimpleClick",value:function(e){var t=e.target.checked;!0===t&&!1===this.state.trenchesToggle?this.setState({trenchesToggle:!0,trenchesToggleSimple:!0},this.handleTrenchesToggleChange.bind(this)):this.setState({trenchesToggleSimple:t},this.handleTrenchesToggleChange.bind(this))}},{key:"handleAccessibilityReduceMotionClick",value:function(e){var t=!e.target.checked;this.accessibilityControllerRef.setReduceMotion(t),this.setState({accessibilityReduceMotion:t,accessibilityNeedReload:!0})}},{key:"render",value:function(){var e=this;if(!0===this.state.offlineMapsMode)return st(Ft,{dismissSelf:function(){e.setState({offlineMapsMode:!1})},dismissSettings:this.props.dismissSelf});var t=Object.entries(this.state.filterSettings).filter((function(e){return-1===["isNato","railway"].indexOf(e[0])})).filter((function(e){return!0===e[1]})).length>0;return st("div",{class:"sidebar-stack-item sidebar-settings",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.settings"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"settings.map-view.header"})}),st("div",{class:"sidebar-settings-basemaps",children:st(At,{type:this.mapLayer.value,onSelect:function(t){return e.selectBaseLayer(t)}})})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header section-header-with-link",children:[st("div",{children:st(gt,{children:"settings.map-marks.header"})}),t?st("div",{class:"section-header-link",onClick:this.handleUnitFilterToggleOff.bind(this),children:st(gt,{children:"settings.filter-toggle-off"})}):null]}),st("div",{class:"sidebar-settings-icon-toggles",children:[st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("img",{width:"24",height:"24",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAF0WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDI0LTAyLTA5VDA0OjI2OjQ1KzAyOjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDI0LTAyLTA5VDA0OjI2OjQ1KzAyOjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNC0wMi0wOVQwNDoyNjo0NSswMjowMCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpkNmJlNTVlYi1mNWM3LTY1NDMtOWVmMC03ZjcwMzgwOGE2ZTciIHhtcE1NOkRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo2Mjg5NTg4OS05YzI3LTY4NGQtOGMwOS04NDc4ZjdkY2FkM2MiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpjNTc2Njk3MC05YmYxLTA4NGEtYTY1Yy1kOGM0OTEwNjU1NjIiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpjNTc2Njk3MC05YmYxLTA4NGEtYTY1Yy1kOGM0OTEwNjU1NjIiIHN0RXZ0OndoZW49IjIwMjQtMDItMDlUMDQ6MjY6NDUrMDI6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZDZiZTU1ZWItZjVjNy02NTQzLTllZjAtN2Y3MDM4MDhhNmU3IiBzdEV2dDp3aGVuPSIyMDI0LTAyLTA5VDA0OjI2OjQ1KzAyOjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+L6gJqgAACH1JREFUaN7dWmtUVOcV5VfX6g+zYtskkIiK1JqANbpWbZv0oTHRBp+ACoqvamLjo8YYHxjQaOpKjA+iFjEaTWwrIjAMAgKKvAVBFBAFBgYGETG+KhDBqCh0d5+PGToZSB1wxkrvWmehd+6d7+xz9tnnfPeOw09naB0szI32Ga2Mdo+G/7GJDzqjT26W/pr/5we0nbTWJ8Dp7zPxbTfth5YAxPnkJ9hxS0s1+twOIKQHOW+ynSYA7rSWHghAfHYXANvstYirnxYD7Atim4NRbWz+5QP8ojB4bgy8PsrEgOlR9gJQJgCa7fHlzlMjMSkwFVu05XBV2bALiGYHe6XX0SscQZGl2HXUgKHvxMPFV2OXdWwOoP80jYp+/2lRKKpqwCZNKTwC0hSN+vpE2pxODrakzPOTIzDs7TiMWnYMo1ccR0vrvxCw/ywmsw5+v/Qo/rDyOF6aFQ0n73D0s1FGHGwR8ee9IzCGzu2Jr8C5Cw0IitJh7VdnIceKvQXqs9mbTiL6ZC3yym/i47BiDF8Yr4A8akYeCcALUyKU0ojjuku3EBKnx5urktGf0c0qvq4A+H9ZiKHMysovCtU90zecgCazBrqaW1j7tyKVib4+mscPQKLnsToFBZX1iMi4iFcWJ6jCfdbzEEa8dwy377UoAAF08jme26rRKXrJNUI1TypU5vnrSDz9NV7m+T5TIx4fACdSxnttGqqu3ob/ngI6FaEK1ARsPZ02HYF/L0KvNw9gHc/N+TRbZU1k9QWCGMBC35dYiSLS7hfvHFF1ZHcAsshvliSi4utGLNt5Gs9MOtSu8fLXxTcK2SU3/gOAjj89/iCpk4kgbRmjH2lRP+H4PLZcZUPd38Wa6BIAKTgXLppadA07tDpSI1yNC6bPJQuj3k9qp48JwDOk0LD5cQgn94fMi/1O4bpMa5PXo2euIDimTGXQbgCEv/5fFCBX90+1sJjl5yb1MQfgSKf6kDqhqdWY9UmWopFlVl/9s2S1CR7+KV2iktUAJLVucw4jv6IOsz4+0SFSoiQCIKv4RqcAxARcyBE9epNSllSRbH4aXgLNiZo2gH42BiDKsWh7LtJJn76UPuGr4jDP95kSqYpQsmN5mAAITV5jgysw1Kt6+BkbmgAWZwWMyOkvF8TjfHUDfvtuotWNzmoAohrarEtYR1V5amwo+jHir1I6F+44ha+OVeH42WuIJMe3RJSgoam5Ywbo7Dj/ZDR+ex9s0CgkkO1RZfCimg0yguk97iA0XOND3iNKZzMAwnWJyPLP8zH+g1TM3piNzZE6fJlUhc8468zdfFJlQDLxowlhSi6b7jxoB9DL4wDeWJaEitrGDhm639KqwGwmcBk1PNemk6JZqp9Y06Udvn8z0ua0fMnLb8VibEAq5m7JwdKQM/hTUC5ep9oIsGcpoxI9Z5+2AU7o8GMFIgtNdx+oTvxrjg3VV5vwsKOFmcmhBH8SWowJXO/F2dGq+IV+rn5dBODGEWH0qhRMWpcBT5rH6mT8io68ODNaSelAuWb2YbjP6WhS7M5ceBWb3C6OGXn6Ooiw3n3Q+l+tWbhlPOpu30c6e8OGg8XwXJOOQQTTJQBD2N7f25WPKKpCof4mDLW3UHW5EfpL36Ds4sPNcPkWEnJrsSehEr6UzpErkjDmgxSMWd25vcH6GLk8CSOY2TEMli9ptGDXGSxmEGbyfrc/xnQNgFCnH1P3c2Zi6voM7Iwpx7mqelh73Gxs5hSajH+kVCP+1GWl7Y6USvkrJtRwIvV+QrqJDeR6r7NOfP+SqRyeyFoYvjBBUdJZUSiqe0UsQETqxCauSYMPF9jBkUDG5tbWzp2/UncH4xjtXh6hCEurVudklDbNSmIiwTKSzGc9beHOLZgBWkUZnk7nPT9MV8GTa1z9bCSjEoXo7FoumIOn6JgUmGQmJEaPUlLGxN5r9XcwITBNFbbT5Lbuazo0WTWqOGU/cJ
1iAtPw+aV5T16ersVxkNJhz0cZDJVaPFFYDEC0PpKLE5tSq5uVizIzotRStF6O2P8mAzHPXFUUk5ZYAFMCGu9wr6+DN693mxLQ1Ql4viudOnp+lpI7nqO3sE2lbALJJGc5OKaPvaBab+bwicioAXadr1VQ5ilwWhzoDcIiU6j0+TM3/5jovGXuX020GA9Df9+HU6d4wRydD4ioQyQ2MLOjayT5h95FKpV7ifGcA5m3K7kAPCYB0Y4n+/K05Kit2mUalqGQsPk/Oy0LPeX3XEVGWGSzCfYmGNnpZAKi58a3alcn3mN8nXTf4cBmS8q8Y6WfHDY1Eb9bGLOg5+o4ilRzNQJi6dlj6RSW/AtAcgCiSeXTFUdkQSWfXc8yQbWlX98cO3X1oFbivEKXcmI9l01Fzi1GnZegL4pDmScmVkcIcwLxNJ9uHNOG57JUX/TUPBm5Np6xLt3qAe2QAEjnJRMDeAhiuNGHl7nw1r8jjFYnwDHbRZayDpymLJgAXSZ+hb8UpxZEAyBgizVHP7u77UYaqr8f6VEJAiCOTOScVcJNzvOAqp9Qsdf4lOreBA5mjGYVCUy6ojcyQeTF4nyOCzEfC+Ve4E3PqpvM2ebAllJHNyZr9Rcgrr0NO+U0sZ0aWcGqV/nCAjsuxaNspjsylyK+sRxr3Dm+T95K1vt14EmHzR4vS1IQCIoWShcXBp+HNLv0a+0Fo6gXc+OYeRvDf/nsLMZFdWvgvVLPFE2ubPtwVFepj7M7D5h/BODobxR1WLKdSJ2N9mLr0E/t0ur1GCGYk9xMazjxLg/O6pTDWArDLCw7prsMWJGDPUQN+tyTRZk+jLazJbq+YhCbubGZzt+ba8x1ZiV1f8g2cqcUgKlFXRoMu2nYBMLgHv2Yd3JNfdIf8X/3UoMf/2MPc5KcH22nltPtPgNO3RW2MPg229Pff7w7/qmmeQjsAAAAASUVORK5CYII="})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.nato"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input","data-filter-property":"isNato",defaultChecked:this.state.filterSettings.isNato,onChange:this.handleUnitFiltersChange.bind(this)})})]}),Mt.map((function(t){return st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("img",{width:"24",height:"24",src:e.state.filterSettings.isNato?t.icon.nato:t.icon.custom})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:t.label})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input","data-filter-property":t.property,defaultChecked:e.state.filterSettings[t.property],checked:e.state.filterSettings[t.property],onChange:e.handleUnitFiltersChange.bind(e)})})]})}))]})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"settings.fortifications"})}),st("div",{class:"sidebar-settings-icon-toggles",children:[st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"fort"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.show-fortifications"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:this.state.trenchesToggle,checked:this.state.trenchesToggle,onChange:this.handleTrenchesToggleClick.bind(this)})})]}),st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon"}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.lite-view"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:this.state.trenchesToggleSimple,checked:this.state.trenchesToggleSimple,onChange:this.handleTrenchesToggleSimpleClick.bind(this)})})]})]})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"settings.general"})}),st("div",{class:"sidebar-settings-icon-toggles",children:[st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"dark_mode"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.theme"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:"dark"===this.state.currentTheme,onChange:this.handleThemeChange.bind(this)})})]}),st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"filter_center_focus"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.map-center-marker"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:this.reticle.value,onChange:this.handleReticleToggleClick.bind(this)})})]}),st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"linear_scale"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.measures"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:this.state.isImperialScale,onChange:this.handleIsImperialScaleToggleClick.bind(this)})})]}),st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"border_style"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.borders"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:this.state.withBorders,onChange:this.handleBorderToggleClick.bind(this)})})]})]})]}),st("div",{class:"stack-item-section",children:[st("h2",{class:"stack-item-section-header",children:st(gt,{children:"settings.accessibility"})}),st("div",{class:"sidebar-settings-icon-toggles",children:st("div",{class:"icon-toggle-row",children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"animation"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.animations.header"})}),st("div",{class:"icon-toggle-switch switch",children:st("input",{type:"checkbox",class:"switch__input",defaultChecked:!this.state.accessibilityReduceMotion,onChange:this.handleAccessibilityReduceMotionClick.bind(this)})})]})}),this.state.accessibilityNeedReload?st("div",{children:[st(gt,{children:"settings.animations.need"})," ",st("a",{href:"#",class:"accessibility-link",onClick:function(){return location.reload()},children:st(gt,{children:"settings.animations.reload"})})," ",st(gt,{children:"settings.animations.page"}),"."]}):null]}),!1===this.state.offlineMapsSupported?st("div",{class:"stack-item-section",children:st("div",{class:"stack-error",children:st(gt,{children:"settings.offline.not-support"})})}):st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-settings-icon-toggles",children:st("div",{class:"icon-toggle-row hoverable",onClick:function(){e.setState({offlineMapsMode:!0})},children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"wifi_off"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"settings.offline.header"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]})})})]})}}]),t}(y),At=function(e){var t=te(ke(e.type),2),i=t[0],n=t[1];we((function(){n(e.type)}),[e.type]);var r=[{type:nt.layers.DEFAULT,label:"settings.map-view.standard",preview:"/images/base_default.jpg"},{type:nt.layers.TOPOGRAPHIC,label:"settings.map-view.topographic",preview:"/images/base_terrain.jpg"},{type:nt.layers.SATELLITE,label:"settings.map-view.satellite",preview:"/images/base_satellite.jpg"}];return st("div",{class:"sidebar-settings-basemap",children:r.map((function(t){return st("div",{className:St({"basemap-item":!0,active:i===t.type}),onClick:function(){return function(t){n(t),e.onSelect(t)}(t.type)},children:[st("div",{class:"basemap-item-preview",style:"background-image: url(".concat(t.preview,")")}),st("div",{class:"basemap-item-label",children:[" ",st(gt,{children:t.label})," "]})]})}))})},Tt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","settings"),J($(e),"toolbarButtonSelector",'[data-site-nav="settings"]'),J($(e),"stackNode",Rt),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],mobileLayout:l.FULL_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue),Pt=function(e){function t(e){var i,n;return Z(this,t),J($(n=U(this,t)),"mapUnitsControllerRef",window.mapUnitsController),n.setState({points:0,distance:0,area:0}),null===(i=e.eventEmitter)||void 0===i||i.addListener("ui",(function(e){n.setState({points:e.points||0,distance:e.distance||0,area:e.area||0,ext:e.ext||void 0,isImperialUnits:!!e.isImperialUnits})})),n}
1return K(t,e),Y(t,[{key:"componentWillUnmount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.removeAllListeners("ui")}},{key:"render",value:function(){var e,t,i,n=this,r=function(){return!0===n.state.isImperialUnits?["ft","mi"]:["м","км"]};return st("div",{class:"sidebar-stack-item sidebar-ruler",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.rule"})}),void 0!==this.props.minimizeButtonCb&&st("div",{class:"stack-item-minimize",onClick:function(){return n.props.minimizeButtonCb?n.props.minimizeButtonCb():null},children:st("span",{class:"material-symbols-outlined",children:"minimize"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return n.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section",children:[0===this.state.points&&st("p",{class:"text-secondary",style:"margin-bottom: 12px;",children:st(gt,{children:"ruler.steps.1"})}),1===this.state.points&&st("p",{class:"text-secondary",style:"margin-bottom: 12px;",children:st(gt,{children:"ruler.steps.2"})}),this.state.points>=2&&st("p",{class:"text-secondary ruler-hint",style:"margin-bottom: 12px;",children:st(gt,{children:"ruler.steps.3"})}),(0!==n.state.distance||0!==n.state.area)&&st("div",{class:"ruler-results",children:[0!==this.state.distance&&st("div",{class:"ruler-result-item",children:[st("div",{class:"ruler-result-value",children:(i=this.state.distance,n.state.isImperialUnits?i>5280?(i/5280).toFixed(2):i.toFixed(0):i>1e3?(i/1e3).toFixed(2):i.toFixed(0))}),st("div",{class:"ruler-result-description",children:[st(gt,{children:"ruler.distance"}),", ",this.state.distance<(this.state.isImperialUnits?5280:1e3)?r()[0]:r()[1]]})]}),0!==this.state.area&&st("div",{class:"ruler-result-item",children:[st("div",{class:"ruler-result-value",children:function(e){return e.toFixed(2)}(this.state.area)}),st("div",{class:"ruler-result-description",children:[st(gt,{children:"ruler.area"}),", ",(!0===n.state.isImperialUnits?["ft","mi"]:["м","км"])[1],st("sup",{children:"2"})]})]}),void 0!==this.state.ext&&st("div",{class:"ruler-result-item",children:[st("div",{class:"ruler-result-value",children:null===(e=this.state.ext)||void 0===e?void 0:e.value}),st("div",{class:"ruler-result-description",children:null===(t=this.state.ext)||void 0===t?void 0:t.title})]})]})]})]})}}]),t}(y),Nt=function(){function e(){Z(this,e),J(this,"RADIUS",6378137)}return Y(e,[{key:"geometry",value:function(e){var t,i=0;switch(e.type){case"Polygon":return this.polygonArea(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)i+=this.polygonArea(e.coordinates[t]);return i;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(t=0;t<e.geometries.length;t++)i+=this.geometry(e.geometries[t]);return i}return 0}},{key:"polygonArea",value:function(e){var t=0;if(e&&e.length>0){t+=Math.abs(this.ringArea(e[0]));for(var i=1;i<e.length;i++)t-=Math.abs(this.ringArea(e[i]))}return t}},{key:"ringArea",value:function(e){var t,i,n,r,a,s,o,l=0,c=e.length;if(c>2){for(o=0;o<c;o++)o===c-2?(r=c-2,a=c-1,s=0):o===c-1?(r=c-1,a=0,s=1):(r=o,a=o+1,s=o+2),t=e[r],i=e[a],n=e[s],l+=(this.rad(n[0])-this.rad(t[0]))*Math.sin(this.rad(i[1]));l=l*this.RADIUS*this.RADIUS/2}return l}},{key:"rad",value:function(e){return e*Math.PI/180}}]),e}(),Dt=new Nt,Ot=function(){function e(t){Z(this,e),this.opt=t,this.logger=(null==t?void 0:t.logger)||console,this.options=t||{collapsed:!1,enabled:!0}}return Y(e,[{key:"setOptions",value:function(e){this.options=e||{collapsed:!1,enabled:!0}}},{key:"log",value:function(e){var t=this;if(1==this.options.enabled){this.startGroup(e);for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];Array.isArray(n)?n.forEach((function(e){t.logGrey("",e)})):this.logGrey.apply(this,[""].concat(n)),this.endGroup()}}},{key:"startGroup",value:function(e){var t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{var i=this.getPosition().replace("at","").replace("new","").trim();t.call(this.logger,"%c ".concat(e,"  ").concat(i),"color: green;")}catch(t){console.log(e)}}},{key:"endGroup",value:function(){try{this.logger.groupEnd()}catch(e){this.logger.log("—— log end ——")}}},{key:"logGrey",value: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];this.send.apply(this,[e,"color: #9E9E9E;font-weight: bold"].concat(i))}},{key:"logGreen",value:function(e,t){this.send(e,"color: #4CAF50; font-weight: bold",t)}},{key:"logRedish",value:function(e,t){this.send(e,"color: #FD8182; font-weight: bold",t)}},{key:"send",value:function(e,t){for(var i,n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];(i=this.logger).log.apply(i,["%c "+e,t].concat(r))}},{key:"getPosition",value:function(){var e=(new Error).stack.split("\n")[4],t=e.match(/at (.+?) \((.+?):(\d+):(\d+)\)/);if(t){var i=te(t,5),n=i[2],r=i[3],a=i[4];return"".concat(n,":").concat(r,":").concat(a)}return e.trim()}}],[{key:"getInstance",value:function(t){return e.instance||(e.instance=new e(t)),e.instance}}]),e}();J(Ot,"instance",null);var Ut=Ot.getInstance(),Ht=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","ruler"),J($(e),"toolbarButtonSelector",'[data-site-nav="ruler"]'),J($(e),"stackNode",Pt),J($(e),"modality",{exclusive:!1,requires:[],incompatible:["arty"],zIndex:10}),J($(e),"polyline",null),J($(e),"arealine",null),J($(e),"points",[]),J($(e),"mapUnitsControllerRef",window.mapUnitsController),e.useImperialUnits=e.mapUnitsControllerRef.getIsImperial(),e}return K(t,e),Y(t,[{key:"createPaneIfNeeded",value:function(){-1===Object.keys(this.mapController.getLeafletMap().getPanes()).indexOf("ruler-pane")&&this.mapController.getLeafletMap().createPane("ruler-pane")}},{key:"enable",value:function(){this.isEnabled=!0,this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),this.extController||(this.extController=window.extController),this.mapClickListener=this.handleMapClick.bind(this),window.polygonsLayer.setInteractive(!1),this.mapController.getLeafletMap().addEventListener("click",this.mapClickListener),this.useImperialUnits=this.mapUnitsControllerRef.getIsImperial()}},{key:"disable",value:function(){this.isEnabled=!1;var e,t=ae(this.points);try{for(t.s();!(e=t.n()).done;){e.value.marker.remove()}}catch(e){t.e(e)}finally{t.f()}this.points=[],null!==this.polyline&&this.polyline.remove(),this.polyline=null,window.polygonsLayer.setInteractive(!0),this.mapClickListener&&this.mapController.getLeafletMap().removeEventListener("click",this.mapClickListener)}},{key:"renderPolyline",value:function(){if(this.points.length>1){null!==this.polyline&&(this.polyline.remove(),this.polyline=null);var e=this.points.map((function(e){return[e.lat,e.lng]}));this.polyline=L.polyline(e,{className:"ruler-polyline",bubblingMouseEvents:!1}),this.polyline.on("click",this.handlePolylineClick.bind(this)),this.polyline.addTo(this.mapController.getLeafletMap())}else 1===this.points.length&&null!==this.polyline&&(this.polyline.remove(),this.polyline=null)}},{key:"handleMapClick",value:function(e){var t=e.latlng,i=t.lat,n=t.lng;Ut.log("map:click",e);var r=this.points.findIndex((function(e){return e.lat===i&&e.lng===n}));if(-1===r){var a=L.icon({iconUrl:"/images/ruler-marker.png",iconSize:[18,18]}),s=L.marker([i,n],{icon:a,draggable:!0});s.on("move",this.handleMarkerDrag.bind(this)),0!==this.points.length&&s.on("click",this.handleMarkerClick.bind(this)),s.addTo(this.mapController.getLeafletMap()),this.points.push({lat:i,lng:n,marker:s})}this.renderPolyline(),this.points.length>0&&this.doCalculations()}},{key:"handleMarkerDrag",value:function(e){for(var t=e.target,i=e.latlng,n=t._leaflet_id,r=!1,a=0;a<this.points.length;a++){if(this.points[a].marker._leaflet_id===n){this.points[a].lat=i.lat,this.points[a].lng=i.lng,r=!0;break}}r&&(this.renderPolyline(),this.points.length>0&&this.doCalculations())}},{key:"handleMarkerClick",value:function(e){var t=e.target;e.latlng;for(var i=t._leaflet_id,n=!1,r=0;r<this.points.length;r++){var a=this.points[r].marker;if(a._leaflet_id===i){a.remove(),this.points.splice(r,1),n=!0;break}}1===this.points.length&&(n=!0),n&&(this.renderPolyline(),this.points.length>0&&this.doCalculations())}},{key:"getClickedPolylineSegment",value:function(e,t){for(var i=t.getLatLngs(),n=[],r=0;r<i.length-1;r++){var a=L.LineUtil.pointToSegmentDistance(this.mapController.getLeafletMap().latLngToLayerPoint(e),this.mapController.getLeafletMap().latLngToLayerPoint(i[r]),this.mapController.getLeafletMap().latLngToLayerPoint(i[r+1]));n.push({index:r,pointToLineDistance:a,segment:[i[r],i[r+1]]})}return n.sort((function(e,t){return e.pointToLineDistance<t.pointToLineDistance?-1:1})),n[0]}},{key:"handlePolylineClick",value:function(e){var t=e.target,i=e.latlng;t._leaflet_id;for(var n=this.getClickedPolylineSegment(i,e.sourceTarget).segment,r=null,a=null,s=!1,o=0;o<this.points.length;o++){var l=this.points[o];l.lat===n[0].lat&&l.lng===n[0].lng?r=o:l.lat===n[1].lat&&l.lng===n[1].lng&&(a=o)}if(null!==r&&null!==a){var c=Math.max(r,a),u=L.icon({iconUrl:"/images/ruler-marker.png",iconSize:[18,18]}),d=L.marker(i,{icon:u,draggable:!0});d.on("move",this.handleMarkerDrag.bind(this)),d.on("click",this.handleMarkerClick.bind(this)),d.addTo(this.mapController.getLeafletMap()),this.points.splice(c,0,{lat:i.lat,lng:i.lng,marker:d}),s=!0}s&&(this.renderPolyline(),this.points.length>0&&this.doCalculations())}},{key:"doCalculations",value:function(){for(var e,t=0,i=0,n=1;n<this.points.length;n++){var r=this.points[n],a=this.points[n-1];t+=this.mapController.getLeafletMap().distance([r.lat,r.lng],[a.lat,a.lng])}if(this.points.length>=3){var s=this.points[0],o=this.points[this.points.length-1];if(this.mapController.getLeafletMap().distance([s.lat,s.lng],[o.lat,o.lng])<={5:2e4,6:2e4,7:15e3,8:8e3,9:5e3,10:2500,11:1250,12:750,13:500,14:400,15:300,16:200,17:150,18:100}[this.mapController.getLeafletMap().getZoom()]){var l={type:"Polygon",coordinates:[this.points.map((function(e){return[e.lng,e.lat]}))]};i=Dt.geometry(l)/1e6}}this.useImperialUnits&&(t=this.mapUnitsControllerRef.mToImperial(t),i=this.mapUnitsControllerRef.sqKmToImperial(i));var c={points:this.points.length,distance:t,area:i,ext:void 0,isImperialUnits:this.useImperialUnits};if(this.extController){var u=this.extController.runRulerExtensionFunction(this.points);void 0!==u&&(c.ext=u)}null===(e=this.eventEmitter)||void 0===e||e.emit("ui",c)}}]),t}(ue),Bt=function(e){function t(e){var i,n;return Z(this,t),J($(n=U(this,t)),"colors",["#FF0000","#FF746C","#3B82F6","#79BAEC","#10B981","#525252","#FFEC3E","#FFA115","#F
1FFFFF"]),n.setState({tool:"brush",radius:3,color:"#FF0000",canUndo:!1,isClearConfirmation:!1}),null===(i=e.eventEmitter)||void 0===i||i.addListener("ui",(function(e){n.setState({canUndo:!0===e.canUndo})})),n}var i,n;return K(t,e),Y(t,[{key:"componentWillUnmount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.removeAllListeners("ui")}},{key:"handleRangeInput",value:function(e){var t,i=parseInt(e.target.value||"5");this.setState({radius:i}),null===(t=this.props.eventEmitter)||void 0===t||t.emit("backend",V(V({},this.state),{},{radius:i}))}},{key:"changeTool",value:function(e){var t,i=this.state;"brush"===e?i={tool:"brush",radius:3,color:"#FF0000",canUndo:this.state.canUndo}:"eraser"===e?i={tool:"eraser",radius:3,color:"#FFFFFF",canUndo:this.state.canUndo}:"circle"===e?i={tool:"circle",radius:3,color:this.state.color,canUndo:this.state.canUndo}:"rectangle"===e?i={tool:"rectangle",radius:3,color:this.state.color,canUndo:this.state.canUndo}:"arrow"===e?i={tool:"arrow",radius:3,color:this.state.color,canUndo:this.state.canUndo}:"line"===e&&(i={tool:"line",radius:3,color:this.state.color,canUndo:this.state.canUndo}),this.setState(V({},i)),null===(t=this.props.eventEmitter)||void 0===t||t.emit("backend",V({},i))}},{key:"componentDidMount",value:function(){var e;console.log("event sent"),null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",V({},this.state))}},{key:"handleDownloadClick",value:(n=z(G().mark((function e(t){var i,n,r,a,s;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.querySelector(".drawing-deepstate-logo"),n=document.querySelector('[data-drawing-action="download"]'),i.style.display="block",n.classList.add("in-progress"),n.disabled=!0,r=document.querySelector("section.main")){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,e.next=11,window.domtoimage.toPng(r,{width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height});case 11:(a=e.sent)&&((s=document.createElement("a")).download="deepstatemap_export.png",s.href=a,document.body.appendChild(s),s.click(),document.body.removeChild(s),s=null),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(8),console.error(e.t0);case 18:i.style.display="",n.classList.remove("in-progress"),n.disabled=!1;case 21:case"end":return e.stop()}}),e,null,[[8,15]])}))),function(e){return n.apply(this,arguments)})},{key:"handleShareClick",value:(i=z(G().mark((function e(t){var i,n,r,a,s,o;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.querySelector(".drawing-deepstate-logo"),n=document.querySelector('[data-drawing-action="share"]'),i.style.display="block",n.classList.add("in-progress"),n.disabled=!0,r=document.querySelector("section.main")){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,e.next=11,window.domtoimage.toPng(r,{width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height});case 11:if(!(a=e.sent)){e.next=20;break}return e.next=15,fetch(a);case 15:return e.next=17,e.sent.blob();case 17:s=e.sent,o=new File([s],"deepstatemap_export.png",{type:s.type}),navigator.share({files:[o]});case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(8),console.error(e.t0);case 25:i.style.display="",n.classList.remove("in-progress"),n.disabled=!1;case 28:case"end":return e.stop()}}),e,null,[[8,22]])}))),function(e){return i.apply(this,arguments)})},{key:"handleClearAllClick",value:function(e){var t;null===(t=this.props.eventEmitter)||void 0===t||t.emit("backend",{action:"clear-canvas"}),this.setState({isClearConfirmation:!1})}},{key:"handleColorPick",value:function(e){var t=this;this.setState({color:e},(function(){var e;null===(e=t.props.eventEmitter)||void 0===e||e.emit("backend",V({},t.state))}))}},{key:"handleUndoClick",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",{action:"undo"})}},{key:"render",value:function(){var e=this;return!0===this.state.isClearConfirmation?st("div",{class:"sidebar-stack-item sidebar-drawing",children:[st("p",{class:"drawing-clear-prompt",children:st(gt,{children:"drawing.confirmation"})}),st("div",{class:"drawing-clear-confirm-buttons",children:[st("button",{class:"clear-confirm-btn btn-cancel",onClick:function(){e.setState({isClearConfirmation:!1})},children:[st("em",{class:"material-symbols-outlined",children:"close"}),st("span",{children:[" ",st(gt,{children:"drawing.no"})," "]})]}),st("button",{class:"clear-confirm-btn btn-confirm",onClick:this.handleClearAllClick.bind(this),children:[st("em",{class:"material-symbols-outlined",children:"delete"}),st("span",{children:[" ",st(gt,{children:"drawing.yes"})," "]})]})]})]}):st("div",{class:"sidebar-stack-item sidebar-drawing",children:[st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-drawing-actions",children:[st("button",{class:"drawing-action-btn",disabled:!e.state.canUndo,onClick:e.handleUndoClick.bind(e),children:st("span",{class:"material-symbols-outlined",children:"und
1o"})}),st("button",{class:"drawing-action-btn hidden",disabled:!0,children:st("span",{class:"material-symbols-outlined",children:"redo"})}),st("button",{class:"drawing-action-btn",onClick:function(){e.setState({isClearConfirmation:!0})},children:st("span",{class:"material-symbols-outlined",children:"delete_forever"})}),st("button",{class:"drawing-action-btn",onClick:e.handleDownloadClick.bind(e),"data-drawing-action":"download",children:[st("span",{class:"material-symbols-outlined",children:"download"}),st("span",{class:"material-symbols-outlined when-in-progress",children:"hourglass_empty"})]}),void 0!==navigator.share?st("button",{class:"drawing-action-btn",onClick:e.handleShareClick.bind(e),"data-drawing-action":"share",children:[st("span",{class:"material-symbols-outlined",children:"share"}),st("span",{class:"material-symbols-outlined when-in-progress",children:"hourglass_empty"})]}):null,st("div",{style:"flex: 1 0 auto"}),void 0!==e.props.minimizeButtonCb?st("button",{class:"drawing-action-btn",onClick:function(){return e.props.minimizeButtonCb?e.props.minimizeButtonCb():null},children:st("span",{class:"material-symbols-outlined",children:"minimize"})}):null,st("button",{class:"drawing-action-btn",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]})}),st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-drawing-tools",children:[st("button",{class:"drawing-tool-btn"+("brush"===e.state.tool?" active":""),onClick:function(){return e.changeTool("brush")},children:st("span",{class:"material-symbols-outlined",children:"stylus_note"})}),st("button",{class:St({"drawing-tool-btn":!0,active:"eraser"===e.state.tool}),onClick:function(){return e.changeTool("eraser")},children:st("span",{class:"material-symbols-outlined",children:"ink_eraser"})}),st("button",{class:St({"drawing-tool-btn":!0,active:"circle"===e.state.tool}),onClick:function(){return e.changeTool("circle")},children:st("span",{class:"material-symbols-outlined",children:"circle"})}),st("button",{class:St({"drawing-tool-btn":!0,active:"rectangle"===e.state.tool}),onClick:function(){return e.changeTool("rectangle")},children:st("span",{class:"material-symbols-outlined",children:"square"})}),st("button",{class:St({"drawing-tool-btn":!0,active:"line"===e.state.tool}),onClick:function(){return e.changeTool("line")},children:st("span",{class:"material-symbols-outlined",children:"pen_size_1"})}),st("button",{class:St({"drawing-tool-btn":!0,active:"arrow"===e.state.tool}),onClick:function(){return e.changeTool("arrow")},children:st("span",{class:"material-symbols-outlined",children:"north_east"})}),st("div",{style:"flex: 1 0 auto"})]})}),function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-drawing-tool-params",children:[st("div",{class:"drawing-brush",children:st("div",{class:"drawing-brush-sample",style:"background-color: ".concat(e.state.color,"; width: ").concat(4*e.state.radius,"px; height: ").concat(4*e.state.radius,"px; border: ").concat("eraser"===e.state.tool?"2px solid #aaa":"none",";")})}),st("div",{class:"drawing-slider"+(!1===t?" disabled":""),children:st("input",{type:"range",id:"drawing-freehand-radius",name:"drawing-freehand-radius",min:"1",max:"8",value:e.state.radius,disabled:!t,onInput:e.handleRangeInput.bind(e)})})]})})}(["brush","eraser","circle","rectangle","line"].includes(this.state.tool)),st("div",{class:"stack-item-section sidebar-drawing-section",children:st("div",{class:"sidebar-drawing-colors",children:"eraser"!==e.state.tool&&e.colors.map((function(t){return st("div",{className:St({"drawing-color":!0,"drawing-color-contrast":"#FFFFFF"===t,active:e.state.color===t}),style:"background-color: "+t,onClick:function(){return e.handleColorPick(t)}})}))})})]})}}]),t}(y),Vt=function(){function e(t,i){Z(this,e),J(this,"enabled",!1),J(this,"drawing",!1),J(this,"strokeColor","#FF0000"),J(this,"strokeWidth",3),this.canvas=t,this.historyCb=i}return Y(e,[{key:"bindEvents",value:function(){this.canvas.on("mouse:up",this.onMouseUp.bind(this)),this.canvas.on("mouse:down",this.onMouseDown.bind(this)),this.canvas.on("mouse:move",this.onMouseMove.bind(this))}},{key:"unbindEvents",value:function(){this.canvas.off({"mouse:up":this.onMouseUp,"mouse:down":this.onMouseDown,"mouse:move":this.onMouseMove})}},{key:"onMouseUp",value:function(e){this.enabled&&(this.drawing=!1,this.historyCb&&this.historyCb())}},{key:"onMouseDown",value:function(e){if(this.enabled){this.drawing=!0;var t=this.canvas.getPointer(e.e);this.origX=t.x,this.origY=t.y;var i=new fabric.Ellipse({top:this.origY,left:this.origX,rx:0,ry:0,transparentCorners:!1,hasBorders:!1,hasControls:!1});i.evented=!1,i.selectable=!1,this.canvas.add(i),this.canvas.setActiveObject(i)}}},{key:"onMouseMove",value:function(e){if(this.enabled&&this.drawing){var t=this.canvas.getPointer(e.e),i=this.canvas.getActiveObject();
1i&&this.origX&&this.origY&&(i.stroke=this.strokeColor,i.strokeWidth=this.strokeWidth,i.fill=void 0,this.origX>t.x&&i.set({left:Math.abs(t.x)}),this.origY>t.y&&i.set({top:Math.abs(t.y)}),i.set({rx:Math.abs(this.origX-t.x)/2}),i.set({ry:Math.abs(this.origY-t.y)/2}),i.setCoords(),this.canvas.renderAll())}}},{key:"enable",value:function(e,t){this.strokeColor=e,this.strokeWidth=t,this.enabled||(this.enabled=!0,this.bindEvents())}},{key:"disable",value:function(){this.unbindEvents(),this.drawing=!1,this.enabled=!1}}]),e}(),Gt=function(){function e(t,i){Z(this,e),J(this,"enabled",!1),J(this,"drawing",!1),J(this,"strokeColor","#FF0000"),J(this,"strokeWidth",3),this.canvas=t,this.historyCb=i}return Y(e,[{key:"bindEvents",value:function(){this.canvas.on("mouse:up",this.onMouseUp.bind(this)),this.canvas.on("mouse:down",this.onMouseDown.bind(this)),this.canvas.on("mouse:move",this.onMouseMove.bind(this))}},{key:"unbindEvents",value:function(){this.canvas.off({"mouse:up":this.onMouseUp,"mouse:down":this.onMouseDown,"mouse:move":this.onMouseMove})}},{key:"onMouseUp",value:function(e){this.enabled&&(this.drawing=!1,this.historyCb&&this.historyCb())}},{key:"onMouseDown",value:function(e){if(this.enabled){this.drawing=!0;var t=this.canvas.getPointer(e.e);this.origX=t.x,this.origY=t.y;var i=new fabric.Rect({top:this.origY,left:this.origX,width:0,height:0,transparentCorners:!1,hasBorders:!1,hasControls:!1});i.evented=!1,i.selectable=!1,this.canvas.add(i),this.canvas.setActiveObject(i)}}},{key:"onMouseMove",value:function(e){if(this.enabled&&this.drawing){var t=this.canvas.getPointer(e.e),i=this.canvas.getActiveObject();i&&this.origX&&this.origY&&(i.stroke=this.strokeColor,i.strokeWidth=this.strokeWidth,i.fill=void 0,this.origX>t.x&&i.set({left:Math.abs(t.x)}),this.origY>t.y&&i.set({top:Math.abs(t.y)}),i.set({width:Math.abs(this.origX-t.x)}),i.set({height:Math.abs(this.origY-t.y)}),i.setCoords(),this.canvas.renderAll())}}},{key:"enable",value:function(e,t){this.strokeColor=e,this.strokeWidth=t,this.enabled||(this.enabled=!0,this.bindEvents())}},{key:"disable",value:function(){this.unbindEvents(),this.drawing=!1,this.enabled=!1}}]),e}(),jt=function(){function e(t,i){Z(this,e),J(this,"enabled",!1),J(this,"drawing",!1),J(this,"strokeColor","#FF0000"),J(this,"strokeWidth",3),J(this,"arrowHeadSize",15),this.canvas=t,this.historyCb=i,this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseDown=this.onMouseDown.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this)}return Y(e,[{key:"bindEvents",value:function(){this.canvas.on("mouse:up",this.boundOnMouseUp),this.canvas.on("mouse:down",this.boundOnMouseDown),this.canvas.on("mouse:move",this.boundOnMouseMove)}},{key:"unbindEvents",value:function(){this.canvas.off("mouse:up",this.boundOnMouseUp),this.canvas.off("mouse:down",this.boundOnMouseDown),this.canvas.off("mouse:move",this.boundOnMouseMove)}},{key:"createArrow",value:function(e,t,i,n){var r=Math.atan2(n-t,i-e),a=new fabric.Line([e,t,i,n],{stroke:this.strokeColor,strokeWidth:this.strokeWidth,selectable:!1,evented:!1}),s=Math.PI/4,o=this.arrowHeadSize,l=i-o*Math.cos(r-s),c=n-o*Math.sin(r-s),u=i-o*Math.cos(r+s),d=n-o*Math.sin(r+s),h=new fabric.Line([i,n,l,c],{stroke:this.strokeColor,strokeWidth:this.strokeWidth,selectable:!1,evented:!1}),p=new fabric.Line([i,n,u,d],{stroke:this.strokeColor,strokeWidth:this.strokeWidth,selectable:!1,evented:!1});return new fabric.Group([a,h,p],{selectable:!1,evented:!1,hasControls:!1,hasBorders:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,transparentCorners:!1})}},{key:"onMouseUp",value:function(e){this.enabled&&(this.drawing=!1,void 0!==this.origX&&void 0!==this.origY&&void 0!==this.currentX&&void 0!==this.currentY&&(this.arrowGroup&&this.canvas.remove(this.arrowGroup),this.arrowGroup=this.createArrow(this.origX,this.origY,this.currentX,this.currentY),this.canvas.add(this.arrowGroup),this.canvas.discardActiveObject(),this.canvas.requestRenderAll()),this.historyCb&&this.historyCb())}},{key:"onMouseDown",value:function(e){if(this.enabled){this.canvas.discardActiveObject(),this.drawing=!0;var t=this.canvas.getPointer(e.e);this.origX=t.x,this.origY=t.y,this.currentX=t.x,this.currentY=t.y,this.arrowGroup=this.createArrow(this.origX,this.origY,this.origX,this.origY),this.canvas.add(this.arrowGroup),this.canvas.requestRenderAll()}}},{key:"onMouseMove",value:function(e){if(this.enabled&&this.drawing){var t=this.canvas.getPointer(e.e);this.currentX=t.x,this.currentY=t.y,void 0!==this.origX&&void 0!==this.origY&&void 0!==this.currentX&&void 0!==this.currentY&&(this.arrowGroup&&this.canvas.remove(this.arrowGroup),this.arrowGroup=this.createArrow(this.origX,this.origY,this.currentX,this.currentY),this.canvas.add(this.arrowGroup),this.canvas.requestRenderAll())}}},{key:"enable",value:function(e){this.strokeColor=e,this.enabled||(this.enabled=!0,this.bindEvents(),this.canvas.discardActiveObject(),this.canvas.requestRenderAll())}},{key:"disable",value:function(){this.unbindEvents(),this.drawing=!1,this.enabled=!1}}]),e}(),Wt=function(){function e(t,i){Z(this,e),J(this,"enabled",!1),J(this,"drawing",!1),J(this,"strokeColor","#FF0000"),J(this,"strokeWidth",3),this.canvas=t,this.historyCb=i}return Y(e,[{key:"bindEvents",value:function(){this.canvas.on("mouse:up",this.onMouseUp.bind(this)),this.canvas.on("mouse:down",this.onMouseDown.bind(this)),this.canvas.on("mouse:move",this.onMouseMove.bind(this))}},{key:"unbindEvents",value:function(){this.canvas.off({"mouse:up":this.onMouseUp,"mouse:down":this.onMouseDown,"mouse:move":this.onMouseMove})}},{key:"createLine",value:function(e,t,i,n){return new fabric.Line([e,t,i,n],{stroke:this.strokeColor,strokeWidth:this.strokeWidth,selectable:!1,evented:!1,hasControls:!1,hasBorders:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,transparentCorners:!1})}},{key:"onMouseUp",value:function(e){this.enabled&&(this.drawing=!1,void 0!==this.origX&&void 0!==this.origY&&void 0!==this.currentX&&void 0!==this.currentY&&(this.lineObject&&this.canvas.remove(this.lineObject),this.lineObject=this.createLine(this.origX,this.origY,this.currentX,this.currentY),this.canvas.add(this.lineObject),this.canvas.discardActiveObject(),this.canvas.requestRenderAll()),this.historyCb&&this.historyCb())}},{key:"onMouseDown",value:function(e){if(this.enabled){this.canvas.discardActiveObject(),this.drawing=!0;var t=this.canvas.getPointer(e.e);this.origX=t.x,this.origY=t.y,this.currentX=t.x,this.currentY=t.y,this.lineObject=this.createLine(this.origX,this.origY,this.origX,this.origY),this.canvas.add(this.lineObject),this.canvas.requestRenderAll()}}},{key:"onMouseMove",value:function(e){if(this.enabled&&this.drawing){var t=this.canvas.getPointer(e.e);this.currentX=t.x,this.currentY=t.y,void 0!==this.origX&&void 0!==this.origY&&void 0!==this.currentX&&void 0!==this.currentY&&(this.lineObject&&this.canvas.remove(this.lineObject),this.lineObject=this.createLine(this.origX,this.origY,this.currentX,this.currentY),this.canvas.add(this.lineObject),this.canvas.requestRenderAll())}}},{key:"enable",value:function(e,t){this.strokeColor=e,this.strokeWidth=t,this.enabled||(this.enabled=!0,this.bindEvents(),this.canvas.discardActiveObject(),this.canvas.requestRenderAll())}},{key:"disable",value:function(){this.unbindEvents(),this.drawing=!1,this.enabled=!1}}]),e}(),zt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","drawing"),J($(e),"toolbarButtonSelector",'[data-site-nav="draw"]'),J($(e),"stackNode",Bt),J($(e),"modality",{exclusive:!1,requires:[],incompatible:[],zIndex:10}),J($(e),"eventEmitterListenerRef",null),J($(e),"canvas",null),J($(e),"canvasWrapperElement",document.getElementById("canvas-wrapper")),J($(e),"clickListenerBound",!1),J($(e),"drawingModeSet",!1),J($(e),"history",[]),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e,t=this;(this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),null===this.eventEmitterListenerRef)&&(this.eventEmitterListenerRef=this.uiEventListener.bind(this),null===(e=this.eventEmitter)||void 0===e||e.addListener("backend",this.uiEventListener.bind(this)));if(this.canvasWrapperElement){var i;this.canvasWrapperElement.style.display="block";var n=null===(i=document.querySelector("#map"))||void 0===i?void 0:i.getBoundingClientRect(),r={width:(null==n?void 0:n.width)||window.outerWidth,height:(null==n?void 0:n.height)||window.outerHeight};Ut.log("DrawingFeature: creating canvas with options",r),this.canvas=new fabric.Canvas("fabric-canvas",r),this.canvas.skipTargetFind=!0,this.canvas.selection=!1,this.circleShapeTool=new Vt(this.canvas,(function(){return t.onHistoryAction()})),this.rectShapeTool=new Gt(this.canvas,(function(){return t.onHistoryAction()})),this.arrowShapeTool=new jt(this.canvas,(function(){return t.onHistoryAction()})),this.lineShapeTool=new Wt(this.canvas,(function(){return t.onHistoryAction()})),this.canvas.on("after:render",(function(){var e;null===(e=t.canvas)||void 0===e||e.calcOffset()})),this.canvas.on("path:created",this.onHistoryAction.bind(this)),this.isEnabled=!0}}},{key:"disable",value:function(){if(this.canvasWrapperElement&&this.canvas){var e;if(this.canvasWrapperElement.style.display="none",this.canvas.isDrawingMode=!1,this.canvas.clear(),this.canvas.dispose(),this.canvas=null,this.circleShapeTool=void 0,null!==this.eventEmitterListenerRef)null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners(),this.eventEmitterListenerRef=null;this.history=[],this.isEnabled=!1}}},{key:"onHistoryAction",value:function(){this.canvas&&(this.history.push(this.canvas.toDatalessJSON()),this.emitUndoState())}},{key:"emitUndoState",value:function(){var e,t;this.history.length>0?null===(e=this.eventEmitter)||void 0===e||e.emit("ui",{canUndo:!0}):null===(t=this.eventEmitter)||void 0===t||t.emit("ui",{canUndo:!1})}},{key:"handleUndoClick",value:function(){0!==this.history.length&&this.canvas&&(this.history.pop(),this.canvas.clear(),this.canvas.loadFromJSON(this.history[this.history.length-1],(function(){})),this.emitUndoState())}},{key:"uiEventListener",value:function(e){var t=e.tool,i=e.radius,n=e.color,r=e.action;
1if(this.canvas){if(r){if("clear-canvas"===r)return this.canvas.clear(),this.history=[],void this.emitUndoState();if("undo"===r)return void this.handleUndoClick()}var a,s,o,l;if("circle"!==t)null===(a=this.circleShapeTool)||void 0===a||a.disable();if("rectangle"!==t)null===(s=this.rectShapeTool)||void 0===s||s.disable();if("arrow"!==t)null===(o=this.arrowShapeTool)||void 0===o||o.disable();if("line"!==t)null===(l=this.lineShapeTool)||void 0===l||l.disable();if("brush"===t)this.canvas.freeDrawingBrush=new fabric.PencilBrush(this.canvas),this.canvas.freeDrawingBrush.color=n,this.canvas.freeDrawingBrush.width=i,this.canvas.isDrawingMode||(this.canvas.isDrawingMode=!0);else if("eraser"===t)this.canvas.freeDrawingBrush=new fabric.EraserBrush(this.canvas),this.canvas.freeDrawingBrush.width=3*i,this.canvas.isDrawingMode||(this.canvas.isDrawingMode=!0);else if("circle"===t){var c;this.canvas.isDrawingMode&&(this.canvas.isDrawingMode=!1),null===(c=this.circleShapeTool)||void 0===c||c.enable(n,i)}else if("rectangle"===t){var u;this.canvas.isDrawingMode&&(this.canvas.isDrawingMode=!1),null===(u=this.rectShapeTool)||void 0===u||u.enable(n,i)}else if("arrow"===t){var d;this.canvas.isDrawingMode&&(this.canvas.isDrawingMode=!1),null===(d=this.arrowShapeTool)||void 0===d||d.enable(n)}else if("line"===t){var h;this.canvas.isDrawingMode&&(this.canvas.isDrawingMode=!1),null===(h=this.lineShapeTool)||void 0===h||h.enable(n,i)}}}}]),t}(ue);function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",i=new Date(e),n=i.getDate().toString().padStart(2,"0"),r=(i.getMonth()+1).toString().padStart(2,"0"),a=i.getFullYear();return"".concat(n).concat(t).concat(r).concat(t).concat(a)}function qt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout((function(){return t()}),e)}))}var Yt=function(e){var t=Ce(null),i=function(e){return new Intl.DateTimeFormat(rt.value.code.value,{dateStyle:"long"}).format(e)},n=function(e){return new Intl.DateTimeFormat(rt.value.code.value,{timeStyle:"short"}).format(e)},r=window.revisionsController;return we((function(){t.current&&t.current.scrollIntoView({behavior:"smooth"})}),[e.revisions,ft.value.currentRevisionId.value]),st(g,{children:Object.keys(e.revisions).length?Object.entries(e.revisions).map((function(e){var a=te(e,2),s=a[0],o=a[1];return st("div",{class:"revisions flex-col gap-16",ref:o.map((function(e){return e.id})).includes(ft.value.currentRevisionId.value)?t:null,children:[st("span",{class:St({"revisions-date":!0,sticky:o.length>1}),children:i(new Date(s))}),st("div",{class:"revisions-per-day flex-col gap-4",children:o.map((function(e){return st("div",{className:St({"revisions-information flex-col gap-8":!0,current:e.id===ft.value.currentRevisionId.value,unread:e.id>ft.value.lastViewedRevisionId.value}),onClick:function(t){return function(e,t){var i="a"===e.target.tagName,n=ft.value.currentRevisionId.value===t;i||n||r.viewRevisionFromDescription(t)}(t,e.id)},children:[st("span",{class:"revision-description",dangerouslySetInnerHTML:{__html:(t=e,t.description[rt.value.code.value]||t.description.en)},children:" "}),st("span",{class:"revision-time",children:n(new Date(1e3*e.id))})]},e.id);var t}))})]},s)})):st(yt,{})})},Jt=function(e){function t(){var e;return Z(this,t),(e=U(this,t)).revisionsController=window.revisionsController,e.setState({current:"",updates:{},isCached:!1}),e}return K(t,e),Y(t,[{key:"componentDidMount",value:function(){var e=this;this.revisionsController.revisions().then((function(t){var i=ie(t).reverse().reduce((function(e,t){var i=new Date(1e3*t.id),n=new Date(i.getFullYear(),i.getMonth(),i.getDate()).toISOString();return e[n]||(e[n]=[]),e[n].push(t),e}),{});e.setState({updates:i})}))}},{key:"componentWillUnmount",value:function(){this.revisionsController.viewRevisionFromDescription(ft.value.currentRevisionId.value)}},{key:"render",value:function(){var e=this;return st("div",{class:"sidebar-stack-item sidebar-updates",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.updates"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"version-list flex-col gap-16",children:st(Yt,{revisions:this.state.updates})})]})}}]),t}(y),Kt=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","updates"),J($(e),"toolbarButtonSelector",'[data-site-nav="updates"]'),J($(e),"stackNode",Jt),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10,mobileLayout:l.FULL_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue);const Xt=65,Qt=73,$t=79;function ei(e,t){if(t="number"==typeof t?t:5,!Array.isArray(e))throw new TypeError("forward did not receive an array");if("string"==typeof e[0]||"string"==typeof e[1])throw new TypeError("forward received an array of str
1ings, but it only accepts an array of numbers.");const[i,n]=e;if(i<-180||i>180)throw new TypeError("forward received an invalid longitude of "+i);if(n<-90||n>90)throw new TypeError("forward received an invalid latitude of "+n);if(n<-80||n>84)throw new TypeError(`forward received a latitude of ${n}, but this library does not support conversions of points in polar regions below 80°S and above 84°N`);return function(e,t){const i="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+function(e,t,i){const n=si(i);return function(e,t,i){const n=i-1,r="AJSAJS".charCodeAt(n),a="AFAFAF".charCodeAt(n);let s=r+e-1,o=a+t,l=!1;return s>90&&(s=s-90+Xt-1,l=!0),(s===Qt||r<Qt&&s>Qt||(s>Qt||r<Qt)&&l)&&s++,(s===$t||r<$t&&s>$t||(s>$t||r<$t)&&l)&&(s++,s===Qt&&s++),s>90&&(s=s-90+Xt-1),o>86?(o=o-86+Xt-1,l=!0):l=!1,(o===Qt||a<Qt&&o>Qt||(o>Qt||a<Qt)&&l)&&o++,(o===$t||a<$t&&o>$t||(o>$t||a<$t)&&l)&&(o++,o===Qt&&o++),o>86&&(o=o-86+Xt-1),String.fromCharCode(s)+String.fromCharCode(o)}(Math.floor(e/1e5),Math.floor(t/1e5)%20,n)}(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+n.substr(n.length-5,t)}(function(e){const t=e.lat,i=e.lon,n=6378137,r=ii(t),a=ii(i);let s;s=Math.floor((i+180)/6)+1,180===i&&(s=60),t>=56&&t<64&&i>=3&&i<12&&(s=32),t>=72&&t<84&&(i>=0&&i<9?s=31:i>=9&&i<21?s=33:i>=21&&i<33?s=35:i>=33&&i<42&&(s=37));const o=ii(6*(s-1)-180+3),l=n/Math.sqrt(1-.00669438*Math.sin(r)*Math.sin(r)),c=Math.tan(r)*Math.tan(r),u=.006739496752268451*Math.cos(r)*Math.cos(r),d=Math.cos(r)*(a-o),h=.9996*l*(d+(1-c+u)*d*d*d/6+(5-18*c+c*c+72*u-.39089081163157013)*d*d*d*d*d/120)+5e5;let p=.9996*(n*(.9983242984503243*r-.002514607064228144*Math.sin(2*r)+2639046602129982e-21*Math.sin(4*r)-3.418046101696858e-9*Math.sin(6*r))+l*Math.tan(r)*(d*d/2+(5-c+9*u+4*u*u)*d*d*d*d/24+(61-58*c+c*c+600*u-2.2240339282485886)*d*d*d*d*d*d/720));return t<0&&(p+=1e7),{northing:Math.trunc(p),easting:Math.trunc(h),zoneNumber:s,zoneLetter:ai(t)}}({lat:n,lon:i}),t)}function ti(e){if(""===e)throw new TypeError("toPoint received a blank string");const t=ri(oi(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function ii(e){return e*(Math.PI/180)}function ni(e){return e/Math.PI*180}function ri(e){const t=e.northing,i=e.easting,{zoneLetter:n,zoneNumber:r}=e;if(r<0||r>60)return null;const a=6378137,s=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),o=i-5e5;let l=t;n<"N"&&(l-=1e7);const c=6*(r-1)-180+3,u=l/.9996/6367449.145945056,d=u+(3*s/2-27*s*s*s/32)*Math.sin(2*u)+(21*s*s/16-55*s*s*s*s/32)*Math.sin(4*u)+151*s*s*s/96*Math.sin(6*u),h=a/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),p=Math.tan(d)*Math.tan(d),v=.006739496752268451*Math.cos(d)*Math.cos(d),f=.99330562*a/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),m=o/(.9996*h);let g=d-h*Math.tan(d)/f*(m*m/2-(5+3*p+10*v-4*v*v-.06065547077041606)*m*m*m*m/24+(61+90*p+298*v+45*p*p-1.6983531815716497-3*v*v)*m*m*m*m*m*m/720);g=ni(g);let y,b=(m-(1+2*p+v)*m*m*m/6+(5-2*v+28*p-3*v*v+.05391597401814761+24*p*p)*m*m*m*m*m/120)/Math.cos(d);if(b=c+ni(b),"number"==typeof e.accuracy){const t=ri({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});y={top:t.lat,right:t.lon,bottom:g,left:b}}else y={lat:g,lon:b};return y}function ai(e){if(e<=84&&e>=72)return"X";if(e<72&&e>=-80){const t=8,i=-80;return"CDEFGHJKLMNPQRSTUVWX"[Math.floor((e-i)/t)]}return e>84||e<-80?"Z":void 0}function si(e){let t=e%6;return 0===t&&(t=6),t}function oi(e){if(e&&0===e.length)throw new TypeError("MGRSPoint coverting from nothing");e=e.replace(/ /g,"");const{length:t}=e;let i,n=null,r="",a=0;for(;!/[A-Z]/.test(i=e.charAt(a));){if(a>=2)throw new Error("MGRSPoint bad conversion from: "+e);r+=i,a++}const s=parseInt(r,10);if(0===a||a+3>t)throw new Error("MGRSPoint bad conversion from "+e);const o=e.charAt(a++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw new Error(`MGRSPoint zone letter ${o} not handled: ${e}`);n=e.substring(a,a+=2);const l=si(s),c=function(e,t){let i="AJSAJS".charCodeAt(t-1),n=1e5,r=!1;for(;i!==e.charCodeAt(0);){if(i++,i===Qt&&i++,i===$t&&i++,i>90){if(r)throw new Error("Bad character: "+e);i=Xt,r=!0}n+=1e5}return n}(n.charAt(0),l);let u=function(e,t){if(e>"V")throw new TypeError("MGRSPoint given invalid Northing "+e);let i="AFAFAF".charCodeAt(t-1),n=0,r=!1;for(;i!==e.charCodeAt(0);){if(i++,i===Qt&&i++,i===$t&&i++,i>86){if(r)throw new Error("Bad character: "+e);i=Xt,r=!0}n+=1e5}return n}(n.charAt(1),l);for(;u<li(o);)u+=2e6;const d=t-a;if(d%2!=0)throw new Error("MGRSPoint has to have an even number\nof digits after the zone letter and two 100km letters - front\nhalf for easting meters, second half for\nnorthing meters "+e);const h=d/2;let p,v,f,m=0,g=0;return h>0&&(p=1e5/Math.pow(10,h),v=e.substring(a,a+h),m=parseFloat(v)*p,f=e.substring(a+h),g=parseFloat(f)*p),{easting:m+c,northing:g+u,zone
1Letter:o,zoneNumber:s,accuracy:p}}function li(e){let t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw new TypeError("Invalid zone letter: "+e)}var ci,ui=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var n=this,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];clearTimeout(t),t=setTimeout((function(){return e.apply(n,a)}),i)}},di=function(e){var t,i={},n=ae(e["data-translate-attributes"]);try{for(n.s();!(t=n.n()).done;){i[t.value]=""}}catch(e){n.e(e)}finally{n.f()}var r=te(ke(i),2),a=r[0],s=r[1];return we((function(){var t=window.translateService;if(e.children&&"string"!=typeof e.children){var i=e.children.props;for(var n in a){var r=i[n],o=t.translate(r);s(J({},n,o))}}}),[e.children]),O(e.children,a)};!function(e){e[e.INACTIVE=0]="INACTIVE",e[e.RECENT=1]="RECENT",e[e.ERROR=2]="ERROR",e[e.RESULTS=3]="RESULTS",e[e.ACTIVE_RESULT=4]="ACTIVE_RESULT"}(ci||(ci={}));var hi,pi,vi,fi,mi=function(e){function t(){var e;Z(this,t),J($(e=U(this,t)),"searchInputElem",null),J($(e),"searchController",window.searchController),J($(e),"cityBoundsLayer",window.cityBoundsLayer),J($(e),"translateSvc",window.translateService),J($(e),"keyUpDebounce",ui((function(){var t,i=(null===(t=e.searchInputElem)||void 0===t?void 0:t.value)||"";if((e.extController=window.extController,e.extController)&&e.extController.execSearchExtensionFunctionRegexp(i))return void e.extController.runSearchExtensionFunction(i).then((function(t){e.setState({searchResults:t||[],currentState:ci.RESULTS})})).catch((function(t){console.log("[Omnibox] SearchExt error",t),e.setState({currentState:ci.ERROR,searchError:"Помилка / Error"})}));var n=/([0-9]{2}\.[0-9]{4,16}),?\s*([0-9]{2}\.[0-9]{4,16})/.exec(i);if(n){var r=parseFloat(n[1]),a=parseFloat(n[2]);e.setState({searchResults:[{geometry:{type:"Point",coordinates:[a,r]},type:"coordinate",bbox:void 0,title:r.toFixed(6)+", "+a.toFixed(6),subtitle:"WGS-84",recent:!1,handleMarkerClick:e.searchController.coordsMarkerClickHandler}],currentState:ci.RESULTS})}else{var s=/(\d{1,3})°(\d{1,2})'(\d{1,2})\.(\d{1,2})"([NSns])\s*(\d{1,3})°(\d{1,2})'(\d{1,2})\.(\d{1,2})"([EwEw])/.exec(i);if(s){var o=function(e,t,i,n){var r=e+t/60+i/3600;return"s"!==n.toLowerCase()&&"w"!==n.toLowerCase()||(r*=-1),r},l=o(+s[1],+s[2],+(s[3]+"."+s[4]),s[5]),c=o(+s[6],+s[7],+(s[8]+"."+s[9]),s[10]);e.setState({searchResults:[{geometry:{type:"Point",coordinates:[c,l]},type:"coordinate",bbox:void 0,title:i,subtitle:"DMS",recent:!1,handleMarkerClick:e.searchController.coordsMarkerClickHandler}],currentState:ci.RESULTS})}else{var u=i.replace(/\s\s+/g," "),d=/\s*([1-9]\d?)\s*([^IO])\s*([^IO])\s*([^IO])?\s*(\d{1,5})?\s*(\d{1,5})?\s*/gi.exec(u);if(d){for(var h=d[0].replace(/[\s]/g,""),p=0,v=Object.entries({"С":"C","Т":"T","Р":"P","А":"A","В":"B","Е":"E","К":"K","М":"M","Н":"H","Х":"X"});p<v.length;p++){var f=v[p];h=h.replace(f[0],f[1])}var m=te(ti(h),2),g=m[0],y=m[1];e.setState({searchResults:[{geometry:{type:"Point",coordinates:[g,y]},type:"coordinate",bbox:void 0,title:i,subtitle:"MGRS",recent:!1,handleMarkerClick:e.searchController.coordsMarkerClickHandler}],currentState:ci.RESULTS})}else e.searchController.performSearch(i,"autocomplete").then((function(t){e.setState({currentState:ci.RESULTS,searchResults:t})})).catch((function(t){e.setState({currentState:ci.ERROR,searchError:"Помилка / Error"})}))}}}),500)),e.state={currentState:ci.INACTIVE,geolocationError:null},e.searchController.locateError.subscribe((function(t){e.setState({geolocationError:t})}));var i=!0;return e.searchController.controllerEnforcedState.subscribe((function(t){i?i=!1:t&&t.term?(e.searchInputElem&&(e.searchInputElem.value=t.term,e.searchInputElem.blur()),e.setState({currentState:ci.ACTIVE_RESULT})):e.handleClearBtnClick()})),e}
1return K(t,e),Y(t,[{key:"componentDidMount",value:function(){this.searchInputElem=document.querySelector(".omnibox-wrap .search-wrap .search-input input")}},{key:"searchIconClick",value:function(){this.searchInputElem&&this.searchInputElem.focus()}},{key:"handleClearBtnClick",value:function(){this.searchController.clearState(),this.searchInputElem&&(this.searchInputElem.value=""),this.setState({currentState:ci.INACTIVE,searchResults:void 0}),this.cityBoundsLayer.hide()}},{key:"handleInputFocusIn",value:function(e){var t;if(this.props.hideHistoryPager(!0),null===(t=this.searchInputElem)||void 0===t?void 0:t.value)this.searchController.lastResults&&this.searchController.lastResults.length>0?this.setState({searchResults:this.searchController.lastResults,currentState:ci.RESULTS}):this.keyUpDebounce();else{var i=this.searchController.getRecentSearches();i.length>0?this.setState({searchResults:i,currentState:ci.RECENT}):this.setState({searchResults:[],currentState:ci.RECENT})}}},{key:"handleInputFocusOut",value:function(e){var t=this;setTimeout((function(){var e;(t.props.hideHistoryPager(!1),document.activeElement===t.searchInputElem)||t.setState({currentState:""===(null===(e=t.searchInputElem)||void 0===e?void 0:e.value)?ci.INACTIVE:ci.ACTIVE_RESULT,searchResults:void 0})}),250)}},{key:"handleInputKeyUp",value:function(e){var t,i=this,n=null===(t=this.searchInputElem)||void 0===t?void 0:t.value;if(n&&n.length>3&&e instanceof KeyboardEvent&&"Enter"===e.key)this.searchController.performSearch(n,"search").then((function(e){i.setState({currentState:ci.RESULTS,searchResults:e})})).catch((function(e){i.setState({currentState:ci.ERROR,searchError:"Помилка / Error"})}));else{if(n&&n.length>=2){var r=this.searchController.findUnits(n);if(r.length>0)return void this.setState({currentState:ci.RESULTS,searchResults:r.slice(0,10)})}if(n&&n.length<=3)this.setState({currentState:ci.RECENT,searchResults:[]});else if(n&&n.startsWith("#")&&5===n.length){var a=window.extController;if(!a)return;"#0000"===n?a.clearExternal():(a.handleExternal(n.replace("#","")),this.handleClearBtnClick())}else this.keyUpDebounce()}}},{key:"handleResultClick",value:function(e){this.searchInputElem&&(this.searchInputElem.value=e.title,this.searchInputElem.blur()),this.setState({currentState:ci.ACTIVE_RESULT}),this.searchController.handleResultClick(e)}},{key:"handleLocateClick",value:function(){this.state.geolocationInProgress?(this.setState({geolocationInProgress:!1}),this.searchController.stopLocate()):(this.setState({geolocationInProgress:!0}),this.searchController.locate())}},{key:"showGeoErrorDialog",value:function(){var e=window.dialogController;e&&e.open(st(g,{children:[st(gt,{children:"geolocation.error"}),st("br",{}),st("br",{}),st(gt,{children:"geolocation.errorText"})]}),{header:this.translateSvc.translate("omnibox.geoError"),closeOnBackdrop:!0,closeOnEscape:!0})}},{key:"render",value:function(e){var t,i,n=this;return st(g,{children:[st("div",{className:St({"omnibox-wrap":!0,slim:e.slim&&(this.state.currentState===ci.INACTIVE||this.state.currentState===ci.ACTIVE_RESULT),"search-active":this.state.currentState!==ci.INACTIVE&&this.state.currentState!==ci.ACTIVE_RESULT}),children:[st("div",{class:"site-logo",children:st("svg",{width:"77",height:"36",viewBox:"0 0 77 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.4545 1.11519C10.9846 1.76884 11.9704 2.87911 12.6454 3.58285C14.2951 5.30253 16.7469 8.34013 17.2474 9.28405C17.5609 9.87519 17.5262 10.2302 17.0959 10.8378C16.5366 11.6274 15.1013 11.9382 15.1013 11.2695C15.1013 10.6564 13.0187 9.81487 11.63 9.86642C10.7887 9.89786 10.0102 9.6595 9.50712 9.21715L8.71275 8.51816L8.98148 9.96768C9.38402 12.1385 10.0727 13.2085 12.2554 15.0525C14.654 17.0793 16.1954 19.7466 16.466 22.3389C16.6394 23.9982 16.534 24.4552 15.699 25.6719C15.1671 26.4472 14.7317 27.2109 14.7317 27.3685C14.7317 27.5264 15.2351 28.0382 15.8502 28.5058C19.0635 30.9479 18.9851 30.8521 18.5416 31.8147C18.2895 32.362 18.2562 32.9151 18.4569 33.2284C18.638 33.5113 18.7889 34.116 18.7922 34.5719L18.7977 35.4006C18.7977 35.4006 18.6099 35.3988 9.46424 35.303C0.318528 35.2072 1.34494 35.303 0.0205967 35.303C-0.0400248 34.8833 0.00878906 33.75 0.491891 33.2017C1.02048 32.7677 1.01937 32.6654 0.480432 32.0761C0.0124644 31.5646 -0.0259782 31.2667 0.298938 30.666C0.525899 30.2471 0.804116 30.0414 1.00126 29.9045C1.13379 29.8125 1.98229 29.3196 2.82693 28.6045C4.43857 27.2406 4.46001 26.8073 2.99548 25.2313C2.71825 24.9334 2.52826 23.6835 2.52049 22.11C2.51347 20.6664 2.24511 18.1694 1.92426 16.5609C0.716266 10.5055 0.798326 9.00219 2.46985 6.54075C3.64753 4.80608 5.55157 3.41103 7.37428 2.94711C8.4869 2.66378 8.64585 2.47039 8.74713 1.27678C8.88833 -0.381856 9.21547 -0.412564 10.4545 1.11519Z",fill:"#33334E"}
1),st("path",{class:"letter",d:"M61.04 10.6776H58.0935V8.2749H61.04C61.4487 8.2749 61.7816 8.18262 62.0387 7.99805C62.3024 7.81348 62.4935 7.55969 62.6122 7.23669C62.7308 6.9071 62.7902 6.53796 62.7902 6.12927C62.7902 5.71399 62.7275 5.32837 62.6023 4.97241C62.4836 4.60986 62.2958 4.31653 62.0387 4.09241C61.7882 3.86829 61.4553 3.75623 61.04 3.75623H59.0229V15.75H56.1357V1.35352H61.04C62.009 1.35352 62.8429 1.55786 63.5416 1.96655C64.2404 2.37524 64.7743 2.93884 65.1434 3.65735C65.5192 4.36926 65.707 5.18665 65.707 6.1095C65.707 7.03894 65.5192 7.84644 65.1434 8.53198C64.7743 9.21094 64.2404 9.73828 63.5416 10.114C62.8429 10.4897 62.009 10.6776 61.04 10.6776Z",fill:"#33334E"}),st("path",{class:"letter",d:"M54.4449 13.3572V15.75H48.186V13.3572H54.4449ZM49.0858 1.35352V15.75H46.1887V1.35352H49.0858ZM53.6045 7.18726V9.51086H48.186V7.18726H53.6045ZM54.4252 1.35352V3.75623H48.186V1.35352H54.4252Z",fill:"#33334E"}),st("path",{class:"letter",d:"M44.4979 13.3572V15.75H38.239V13.3572H44.4979ZM39.1388 1.35352V15.75H36.2417V1.35352H39.1388ZM43.6575 7.18726V9.51086H38.239V7.18726H43.6575ZM44.4781 1.35352V3.75623H38.239V1.35352H44.4781Z",fill:"#33334E"}),st("path",{class:"letter",d:"M28.5491 15.75H26.0079L26.0277 13.3572H28.5491C29.2478 13.3572 29.7916 13.2319 30.1805 12.9814C30.5695 12.731 30.843 12.3354 31.0012 11.7949C31.166 11.2544 31.2484 10.5458 31.2484 9.66907V7.42456C31.2484 6.75879 31.2056 6.19519 31.1199 5.73376C31.0342 5.26575 30.8892 4.89001 30.6848 4.60657C30.4805 4.31653 30.2069 4.10229 29.8641 3.96387C29.5214 3.82544 29.0962 3.75623 28.5886 3.75623H25.9585V1.35352H28.5886C29.4192 1.35352 30.174 1.48865 30.8529 1.75891C31.5319 2.02917 32.1152 2.42468 32.603 2.94543C33.0908 3.45959 33.4666 4.0957 33.7302 4.85376C33.9939 5.61182 34.1257 6.47534 34.1257 7.44434V9.66907C34.1257 10.6447 33.9939 11.5082 33.7302 12.2596C33.4666 13.0111 33.0908 13.6472 32.603 14.168C32.1218 14.6821 31.5385 15.0743 30.8529 15.3446C30.1674 15.6149 29.3994 15.75 28.5491 15.75ZM27.6888 1.35352V15.75H24.7917V1.35352H27.6888Z",fill:"#33334E"}),st("path",{class:"letter",d:"M75.7035 32.4822V34.875H69.4446V32.4822H75.7035ZM70.3444 20.4785V34.875H67.4473V20.4785H70.3444ZM74.863 26.3123V28.6359H69.4446V26.3123H74.863ZM75.6837 20.4785V22.8812H69.4446V20.4785H75.6837Z",fill:"#33334E"}),st("path",{class:"letter",d:"M62.187 20.4785V34.875H59.3097V20.4785H62.187ZM65.7664 20.4785V22.8812H55.7996V20.4785H65.7664Z",fill:"#33334E"}),st("path",{class:"letter",d:"M50.7469 23.0493L47.6521 34.875H44.5968L49.0957 20.4785H51.004L50.7469 23.0493ZM53.1892 34.875L50.0746 23.0493L49.7878 20.4785H51.7258L56.2643 34.875H53.1892ZM53.298 29.506V31.9087H46.8018V29.506H53.298Z",fill:"#33334E"}),st("path",{class:"letter",d:"M41.4624 20.4785V34.875H38.5851V20.4785H41.4624ZM45.0417 20.4785V22.8812H35.075V20.4785H45.0417Z",fill:"#33334E"}),st("path",{class:"letter",d:"M30.8826 31.088C30.8826 30.8309 30.8595 30.5969 30.8134 30.386C30.7672 30.175 30.6683 29.9806 30.5167 29.8026C30.3717 29.6246 30.1575 29.4467 29.874 29.2687C29.5972 29.0907 29.2346 28.9061 28.7864 28.715C28.2524 28.4908 27.735 28.2535 27.234 28.0031C26.733 27.746 26.2815 27.4493 25.8794 27.1132C25.4773 26.777 25.1576 26.3815 24.9203 25.9266C24.6896 25.4652 24.5742 24.9247 24.5742 24.3051C24.5742 23.6986 24.683 23.1482 24.9005 22.6538C25.1246 22.1594 25.441 21.7375 25.8497 21.3882C26.2584 21.0322 26.7363 20.7587 27.2834 20.5675C27.8372 20.3763 28.4535 20.2808 29.1324 20.2808C30.0553 20.2808 30.8529 20.4719 31.5253 20.8542C32.2042 21.2366 32.7283 21.7606 33.0974 22.4264C33.4731 23.0922 33.661 23.8568 33.661 24.7203H30.7738C30.7738 24.3116 30.7145 23.9524 30.5958 23.6426C30.4838 23.3262 30.3025 23.079 30.052 22.901C29.8015 22.723 29.4785 22.634 29.083 22.634C28.7139 22.634 28.4073 22.7098 28.1635 22.8615C27.9261 23.0065 27.7482 23.2075 27.6295 23.4646C27.5175 23.7151 27.4614 23.9985 27.4614 24.3149C27.4614 24.5522 27.5175 24.7665 27.6295 24.9576C27.7482 25.1422 27.9097 25.3103 28.114 25.4619C28.3184 25.6069 28.559 25.7487 28.8358 25.8871C29.1193 26.0255 29.4291 26.1606 29.7653 26.2925C30.4178 26.5496 30.9946 26.833 31.4956 27.1428C31.9966 27.446 32.4152 27.7888 32.7513 28.1711C33.0875 28.5469 33.3413 28.972 33.5127 29.4467C33.6841 29.9213 33.7698 30.4618 33.7698 31.0682C33.7698 31.6681 33.6643 32.2152 33.4534 32.7096C33.249 33.1974 32.9491 33.6193 32.5536 33.9752C32.1581 34.3246 31.6802 34.5948 31.1199 34.786C30.5662 34.9772 29.9465 35.0728 29.261 35.0728C28.5952 35.0728 27.9657 34.9805 27.3724 34.7959C26.7792 34.6047 26.2551 34.318 25.8003 33.9357C25.3521 33.5468 24.9994 33.0557 24.7423 32.4624C24.4852 31.8625 24.3567 31.1539 24.3567 30.3365H27.2538C27.2538 30.7716 27.2966 31.144 27.3823 31.4539C27.468 31.7571 27.5999 32.001 27.7778 32.1855C27.9558 32.3635 28.1733 32.4987 28.4304 32.5909C28.6941 32.6766 28.994 32.7195 29.3302 32.7195C29.7125 32.7195 30.0157 32.647 30.2399 32.502C30.4706 32.3569 30.6354 32.1625 30.7343 31.9186C30.8331 31.6747 30.8826 31.3978 30.8826 31.088Z",fill:"#33334E"})]})}),st("div",{class:"search-wrap",children:[st("div",{class:"search-input",children:st("input",{type:"text",name:"omnibox-search",onfocusin:this.handleInputFocusIn.bind(this),onfocusout:this.handleInputFocusOut.bind(this),onKeyUp:this.handleInputKeyUp.bind(this),onPaste:this.handleInputKeyUp.bind(this)})}),this.state.currentState!==ci.INACTIVE?st("div",{class:"search-icon",onClick:this.handleClearBtnClick.bind(this),children:st("span",{class:"material-symbols-outlined",children:"close"})}):st("div",{class:"search-icon",onClick:this.searchIconClick.bind(this),children:st("span",{class:"material-symbols-outlined",children:"search"})})]})]}),st("div",{class:"omnibox-search-dropdown",className:St({"omnibox-search-dropdown":!0,shown:this.state.currentState!==ci.INACTIVE&&this.state.currentState!==ci.ACTIVE_RESULT}),children:[this.state.currentState===ci.ERROR&&this.state.searchError?st(g,{children:st("div",{class:"search-row error",children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"warning"})}),st("div",{class:"search-row-text",children:st(gt,{children:n.state.searchError})})]})}):null,this.state.currentState===ci.RECENT?st(g,{children:[null!==n.state.geolocationError?st("div",{class:"search-row row-geolocation",onClick:n.showGeoErrorDialog.bind(n),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"warning"})}),st(di,{"data-translate-attributes":["title"],children:st("div",{class:"search-row-text",title:"geolocation.error",children:st(gt,{children:"omnibox.geoError"})})})]}):!0===n.state.geolocationInProgress?st("div",{class:"search-row row-geolocation row-geolocation-in-progress",onClick:n.handleLocateClick.bind(n),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"assistant_navigation"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.geolocation"})})]}):st("div",{class:"search-row row-geolocation",onClick:n.handleLocateClick.bind(n),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"my_location"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.geolocation"})})]}),n.state.searchResults&&n.state.searchResults.length>0?null===(i=n.state.searchResults)||void 0===i?void 0:i.map((function(e){return st("div",{class:"search-row",onClick:function(){return n.handleResultClick(e)},children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"schedule"})}),st("div",{class:"search-row-text",children:[e.title,st("span",{class:"secondary",children:e.subt
1itle})]})]})})):null]}):null,this.state.currentState===ci.RESULTS?(t=function(e){switch(e){case"term":return"location_on";case"coordinate":return"point_scan";case"unit":return"military_tech";default:return"chevron_right"}},void 0===n.state.searchResults?null:0===n.state.searchResults.length?st("div",{class:"search-row error",children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"search_off"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.notFound"})})]}):st(g,{children:n.state.searchResults.map((function(e){return st("div",{class:"search-row",onClick:function(){return n.handleResultClick(e)},children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:t(e.type)})}),st("div",{class:"search-row-text",children:[e.title,st("span",{class:"secondary",children:e.subtitle})]})]})}))})):null]})]})}}]),t}(y),gi=function(){function e(t){Z(this,e),this.featuresController=t,this.shortcuts=new Map,this.handleKeyDown=this.handleKeyDown.bind(this),this.initialize()}return Y(e,[{key:"initialize",value:function(){window.addEventListener("keydown",this.handleKeyDown)}},{key:"destroy",value:function(){window.removeEventListener("keydown",this.handleKeyDown),this.shortcuts.clear()}},{key:"registerShortCuts",value:function(e){var t=this;e.forEach((function(e){return t.registerShortcut(e.definition,(function(){e.featureId&&t.enableFeature(e.featureId),e.callback&&!e.featureId&&e.callback()}))}))}},{key:"registerShortcut",value:function(e,t){var i=this.createShortcutKey(e);this.shortcuts.set(i,t)}},{key:"unregisterShortcut",value:function(e){var t=this.createShortcutKey(e);this.shortcuts.delete(t)}},{key:"handleKeyDown",value:function(e){var t,i=this.createShortcutFromEvent(e,(function(e){return e.code}));this.shortcuts.has(i)&&(e.preventDefault(),null===(t=this.shortcuts.get(i))||void 0===t||t())}},{key:"createShortcutKey",value:function(e){var t=[];if(e.withCtrl&&!e.withCtrlOrCmd&&t.push("ctrl"),e.withCtrlOrCmd&&!e.withCtrl){var i=navigator.platform.toLowerCase().includes("mac");t.push(i?"meta":"ctrl")}return e.withShift&&t.push("shift"),e.withAlt&&t.push("alt"),e.code&&t.push(e.code.toLowerCase()),t.join("+")}},{key:"createShortcutFromEvent",value:function(e,t){var i=[];(e.ctrlKey||e.metaKey)&&i.push(e.metaKey?"meta":"ctrl"),e.shiftKey&&i.push("shift"),e.altKey&&i.push("alt");var n=t(e).toLocaleLowerCase();return n.includes(i[0])||n.startsWith("control")||i.push(n),ie(new Set(i)).join("+")}},{key:"enableFeature",value:function(e){var t;null===(t=this.featuresController)||void 0===t||t.enableFeatureById(e)}}]),e}(),yi=qe((function(){return new Date(1e3*ft.value.currentRevisionId.value)})),bi=qe((function(){return ft.value.revisions.value.findIndex((function(e){return e.id===ft.value.currentRevisionId.value}))})),ki=qe((function(){return Zt(yi.value.toString())})),wi=qe((function(){return ft.value.revisions.value.filter((function(e){return Zt(new Date(1e3*e.id).toString())===Zt(yi.value.toString())}))})),Ci=qe((function(){return wi.value.findIndex((function(e){return e.id===ft.value.currentRevisionId.value}))})),Si=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"interval",null),J($(e),"revisionsController",window.revisionsController),J($(e),"featuresController",window.featuresController),J($(e),"polygonsLayer",window.polygonsLayer),J($(e),"shortCutController",new gi),J($(e),"historyService",new ht),J($(e),"calendarRange",{minDate:new Date(2022,3,3),maxDate:new Date}),e.state={playing:!1,speed:1,comparing:!1},e.revisionsController.loadLastRevision().then((function(t){var i=new Date(1e3*t.id);e.calendarRange.maxDate=i})),e}return K(t,e),Y(t,[{key:"componentDidUpdate",value:function(e,t){t.comparing===!this.state.comparing&&this.onShowVersionChanges()}},{key:"componentDidMount",value:function(){var e=this;this.shortCutController.registerShortCuts([{definition:{withCtrlOrCmd:!0,code:"ArrowLeft"},callback:function(){return e.onSelectPage(-1)}},{definition:{withCtrlOrCmd:!0,code:"ArrowDown"},callback:function(){return e.onSelectPage(-1)}}
1,{definition:{withCtrlOrCmd:!0,code:"ArrowRight"},callback:function(){return e.onSelectPage(1)}},{definition:{withCtrlOrCmd:!0,code:"ArrowUp"},callback:function(){return e.onSelectPage(1)}}])}},{key:"componentWillUnmount",value:function(){this.shortCutController.destroy()}},{key:"onSelectPage",value:function(e){var t=this;this.revisionsController.revisions().then((function(i){var n=bi.value+1*e;t.revisionsController.selectRevision(i[n].id),t.setState({comparing:!1})}))}},{key:"openListWithUpdates",value:function(){window.featuresController.enableFeatureById("updates")}},{key:"openCalendarFeature",value:function(){this.setState({comparing:!1}),this.featuresController.enableFeatureById("history-calendar")}},{key:"toggleVersionComparing",value:function(){this.setState({comparing:!this.state.comparing})}},{key:"onShowVersionChanges",value:function(){var e=this;this.state.comparing?this.historyService.fetchDifferenceByVersions(ft.value.currentRevisionId.value).then((function(t){return e.polygonsLayer.compareVersions(t)})).catch((function(e){return console.error("messages.historyRevisionError")})):this.polygonsLayer.destroyComparingVersions()}},{key:"onSelectCalendar",value:function(e){var t=this;this.revisionsController.revisions().then((function(i){var n=Zt(e.toString()),r=i.findIndex((function(e){return Zt(new Date(1e3*e.id).toString())===n}));if(-1!==r){var a=i[r];t.revisionsController.selectRevision(a.id)}t.setState({comparing:!1})}))}},{key:"toggleHistoryPlayer",value:function(){var e=!this.state.playing;this.setState({playing:e}),e?this.toggleRevisionTicker(this.state.speed):this.stopRevisionsTicker()}},{key:"toggleSpeed",value:function(){var e=this,t=[{value:1},{value:3},{value:5}],i=t.findIndex((function(t){return t.value===e.state.speed})),n=t[(i+1)%t.length].value;!0===this.state.playing?(this.playHistory(n),this.setState({speed:n,playing:!0})):this.setState({speed:n})}},{key:"playHistory",value:function(e){var t=this,i=2e3/e;this.stopRevisionsTicker(),this.interval=setInterval((function(){ft.value.isLatestRevision.value?t.stopRevisionsTicker():t.onSelectPage(1)}),i)}},{key:"toggleRevisionTicker",value:function(e){this.interval?this.stopRevisionsTicker():this.playHistory(e)}},{key:"stopRevisionsTicker",value:function(){this.interval&&(clearInterval(this.interval),this.interval=null,this.setState({playing:!1}))}},{key:"render",value:function(e){var t=this;return st("div",{className:St({"history-pager-wrap":!0,hidden:!0===e.hidden}),children:[st("button",{class:"pager-button",onClick:function(){return t.toggleHistoryPlayer()},disabled:ft.value.isLatestRevision,children:st("span",{class:"material-symbols-outlined",children:["  ",this.state.playing?"pause":"play_arrow","   "]})}),st("button",{class:"pager-button pager-button-text",onClick:function(){return t.toggleSpeed()},children:[this.state.speed,"x"]}),st("button",{class:"pager-button",onClick:function(){return t.onSelectPage(-1)},disabled:ft.value.isFirstRevisionVersion,children:st("span",{class:"material-symbols-outlined",children:"navigate_before"})}),st("div",{class:"pager-label",children:[ki,wi.value.length>1?st("sup",{class:"version",onClick:function(){return t.openListWithUp
1dates()},children:[Ci.value+1,"/",wi.value.length]}):""]}),st("button",{class:"pager-button",onClick:function(){return t.onSelectPage(1)},disabled:ft.value.isLatestRevision,children:st("span",{class:"material-symbols-outlined",children:"  navigate_next "})}),st("button",{class:"pager-button icon-small",onClick:function(){return t.openCalendarFeature()},children:st("span",{class:"material-symbols-outlined",children:"calendar_month"})}),st("button",{class:St({"pager-button":!0,active:this.state.comparing}),onClick:function(){return t.toggleVersionComparing()},children:st("span",{class:"material-symbols-outlined",children:"compare_arrows"})})]})}}]),t}(y),_i=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t)),"translateSvc",window.translateService),i.setState({available:[],filtered:[]}),i}var i;return K(t,e),Y(t,[{key:"componentDidMount",value:(i=z(G().mark((function e(){var t,i=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(new dt).get("/arty.json");case 2:t=e.sent,this.setState({available:t,filtered:t},(function(){return i.callMobileBottomSheetRecalculateCb()}));case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"callMobileBottomSheetRecalculateCb",value:function(){this.props.mobileBottomSheetRecalculateCb&&this.props.mobileBottomSheetRecalculateCb()}},{key:"mapArtyByType",value:function(){var e,t={},i=ae(this.state.available);try{for(i.s();!(e=i.n()).done;){var n=e.value;t[n.type]||(t[n.type]=[]),t[n.type].push(n)}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"getDistinctTypes",value:function(){var e,t={},i=ae(this.state.available);try{for(i.s();!(e=i.n()).done;){var n=e.value;t[n.type]||(t[n.type]=n.meta.type[this.translateSvc.language])}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"handleFilterClick",value:function(e,t){this.setState({filtered:this.state.available.filter((function(t){return t.type===e})),filterDropdownOpen:!1,filteredTypeId:e,filteredTypeTitle:t})}},{key:"resetFilter",value:function(){this.setState({filtered:[],filterDropdownOpen:!1,filteredTypeId:void 0,filteredTypeTitle:void 0})}},{key:"resetArtyItemSelection",value:function(){var e,t=this;this.resetFilter(),this.setState({selectedItem:void 0,selectedRound:void 0},(function(){return t.callMobileBottomSheetRecalculateCb()})),null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",{arty:void 0,round:void 0})}},{key:"resetRoundSelection",value:function(){var e,t=this;this.setState({selectedRound:void 0},(function(){return t.callMobileBottomSheetRecalculateCb()})),null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",{arty:this.state.selectedItem,round:void 0})}},{key:"selectArty",value:function(e){var t,i=this,n=this.state.available.find((function(t){return t.id===e}));n&&(this.setState({selectedItem:n},(function(){return i.callMobileBottomSheetRecalculateCb()})),null===(t=this.props.eventEmitter)||void 0===t||t.emit("backend",{arty:n,round:void 0}))}},{key:"selectRound",value:function(e){var t,i,n=this,r=null===(t=this.state.selectedItem)||void 0===t?void 0:t.rounds.find((function(t){return t.id===e}));e&&(this.setState({selectedRound:r},(function(){return n.callMobileBottomSheetRecalculateCb()})),null===(i=this.props.eventEmitter)||void 0===i||i.emit("backend",{arty:this.state.selectedItem,round:r}))}},{key:"renderArtyPage",value:function(){var e=this;return st("div",{class:"sidebar-stack-item sidebar-arty",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.arty"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),0===this.state.available.length&&0===this.state.filtered.length?st("div",{class:"stack-item-section",children:["   ",st(yt,{}),"  "]}):st("div",{class:"stack-item-section",children:[st("div",{className:St({"arty-filter":!0,active:!!this.state.filterDropdownOpen}),children:[st("div",{class:"arty-filter-input",onClick:function(){return e.setState({filterDropdownOpen:!e.state.filterDropdownOpen})},children:[st("div",{class:"arty-filter-input-value",children:[this.state.filteredTypeId&&this.state.filteredTypeTitle?this.state.filteredTypeTitle:this.translateSvc.translate("artyUi.allTypes")," ",st("span",{children:this.state.filtered.length>0?this.state.filtered.length:this.state.available.length})]}),st("div",{class:"arty-filter-input-chevron",children:st("span",{class:"material-symbols-outlined",children:"expand_more"})})]}),st("div",{class:"arty-filter-dropdown",children:[st("div",{class:"arty-filter-dropdown-item",onClick:function(){return e.resetFilter()},children:[this.translateSvc.translate("artyUi.allTypes")," ",st("span",{children:this.state.available.length})]}),Object.entries(this.getDistinctTypes()).map((function(t){var i;return st("div",{class:"arty-filter-dropdown-item",onClick:function(){return e.handleFilterClick(t[0],t[1])},children:[e.translateSvc.translate(t[1])," ",st("span",{children:null===(i=e.mapArtyByType()[t[0]])||void 0===i?void 0:i.length})]})}))]})]}),st("div",{class:"arty-list",children:(this.state.filtered.length>0?this.state.filtered:this.state.available).map((function(t){return st("div",{class:"arty-item",onClick:function(){return e.selectArty(t.id)},children:[t.image?st("div",{class:"arty-item-image",children:st("div",{class:"image-wrapper",children:st("img",{alt:t.meta.title[e.translateSvc.language],src:"/images/arty/"+t.image})})}):st("div",{class:"arty-item-image",children:st("div",{class:"image-placeholder",children:st("span",{class:"material-symbols-outlined",children:"no_photography"})})}),st("div",{class:"arty-item-content",children:[st("h3",{children:[t.meta.title[e.translateSvc.language]," ",st("span",{children:t.calibre})]}),st("p",{class:"arty-type",children:t.meta.type[e.translateSvc.language]}),st("p",{class:St({"arty-capable-true":!!t.capable,"arty-capable-false":!t.capable}),children:e.translateSvc.translate(t.capable?"artyUi.capable":"artyUi.notCapable")}),t.meta.wikiLink[e.translateSvc.language]&&st("p",{class:"arty-wiki-link",children:st("a",{href:t.meta.wikiLink[e.translateSvc.language],target:"_blank",children:st(gt,{children:"artyUi.wikiBtn"})})})]}),st("div",{class:"arty-item-proceed",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})]})}))})]})]})}},{key:"renderRoundsPage",value:function(){var e,t=this;return st("div",{class:"sidebar-stack-item sidebar-arty",children:[st("div",{class:"stack-item-subheader",onClick:function(){return t.resetArtyItemSelection()},children:[st("span",{class:"material-symbols-outlined",children:"arrow_back"}
1),st(gt,{children:"artyUi.changeArty"})]}),st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"artyUi.roundDialogTitle"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return t.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section",children:st("div",{class:"arty-list",children:null===(e=this.state.selectedItem)||void 0===e?void 0:e.rounds.map((function(e){return st("div",{class:"arty-item",onClick:function(){return t.selectRound(e.id)},children:[st("div",{class:"arty-item-content",children:[st("h3",{children:["   ",e.name,"   "]}),st("p",{class:"arty-type",children:[((e.range.min||0)/1e3).toFixed(2),"-",(e.range.max/1e3).toFixed(2)," ",st(gt,{children:"artyUi.rangeUnits"})]}),st("p",{class:St({"arty-capable-true":!!e.capable,"arty-capable-false":!e.capable}),children:t.translateSvc.translate(e.capable?"artyUi.capable":"artyUi.notCapable")}),e.wikiLink[t.translateSvc.language]?st("p",{class:"arty-wiki-link",children:st("a",{href:e.wikiLink[t.translateSvc.language],target:"_blank",children:st(gt,{children:"artyUi.wikiBtn"})})}):null]}),st("div",{class:"arty-item-proceed",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})]})}))})})]})}},{key:"renderShootPage",value:function(){var e=this;return st("div",{class:"sidebar-stack-item sidebar-arty",children:[st("div",{class:"stack-item-subheader",onClick:function(){return e.resetRoundSelection()},children:[st("span",{class:"material-symbols-outlined",children:"arrow_back"}),st(gt,{children:"artyUi.changeRound"})]}),st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.arty"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section",children:st("div",{class:"arty-list",children:[this.state.selectedItem?st("div",{class:"arty-item disable-hover-effect",children:[this.state.selectedItem.image?st("div",{class:"arty-item-image",children:st("div",{class:"image-wrapper",children:st("img",{alt:this.state.selectedItem.meta.title[this.translateSvc.language],src:"/images/arty/"+this.state.selectedItem.image})})}):st("div",{class:"arty-item-image",children:st("div",{class:"image-placeholder",children:st("span",{class:"material-symbols-outlined",children:"no_photography"})})}),st("div",{class:"arty-item-content",children:[st("h3",{children:[this.state.selectedItem.meta.title[this.translateSvc.language]," ",st("span",{children:this.state.selectedItem.calibre})]}),st("p",{class:"arty-type",children:this.state.selectedItem.meta.type[this.translateSvc.language]}),st("p",{class:St({"arty-capable-true":!!this.state.selectedItem.capable,"arty-capable-false":!this.state.selectedItem.capable}),children:this.translateSvc.translate(this.state.selectedItem.capable?"artyUi.capable":"artyUi.notCapable")}),this.state.selectedItem.meta.wikiLink[this.translateSvc.language]&&st("p",{class:"arty-wiki-link",children:st("a",{href:this.state.selectedItem.meta.wikiLink[this.translateSvc.language],target:"_blank",children:st(gt,{children:"artyUi.wikiBtn"})})})]})]}):null,st("hr",{}),this.state.selectedRound&&st("div",{class:"arty-item disable-hover-effect",children:st("div",{class:"arty-item-content",children:[st("h3",{children:this.state.selectedRound.name}),st("p",{class:"arty-type",children:[((this.state.selectedRound.range.min||0)/1e3).toFixed(2),"-",(this.state.selectedRound.range.max/1e3).toFixed(2)," ",st(gt,{children:"artyUi.rangeUnits"})]}),st("p",{class:"arty-capable-"+(this.state.selectedRound.capable?"true":"false"),children:this.state.selectedRound.capable?this.translateSvc.translate("artyUi.capable"):this.translateSvc.translate("artyUi.notCapable")}),this.state.selectedRound.wikiLink[this.translateSvc.language]?st("p",{class:"arty-wiki-link",children:st("a",{href:this.state.selectedRound.wikiLink[this.translateSvc.language],target:"_blank",children:st(gt,{children:"artyUi.wikiBtn"})})}):null]})})]})})]})}},{key:"render",value:function(){return this.state.selectedItem||this.state.selectedRound?this.state.selectedItem&&!this.state.selectedRound?this.renderRoundsPage():this.state.selectedItem&&this.state.selectedRound?this.renderShootPage():this.renderArtyPage():this.renderArtyPage()}}]),t}(y),Ei=function(e){function t(e){var i,n;Z(this,t),J($(n=U(this,t)),"translateSvc",window.translateService);var r=n.getFirmsToggleState();return n.setState({oldest:r[.25],older:r[.5],newer:r[.75],newest:r[1]}),null===(i=e.eventEmitter)||void 0===i||i.addListener("ui",(function(e){n.setState({updatedAt:e.dataUpdatedAt||void 0})})),n}
1return K(t,e),Y(t,[{key:"componentWillUnmount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.removeAllListeners("ui")}},{key:"getFirmsToggleState",value:function(){var e={.25:!0,.5:!0,.75:!0,1:!0},t=localStorage.getItem("firms-toggles");return t?JSON.parse(t):(localStorage.setItem("firms-toggles",JSON.stringify(e)),e)}},{key:"saveFirmsToggleState",value:function(){var e={.25:this.state.oldest,.5:this.state.older,.75:this.state.newer,1:this.state.newest};localStorage.setItem("firms-toggles",JSON.stringify(e))}},{key:"componentDidMount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",{oldest:this.state.oldest,older:this.state.older,newer:this.state.newer,newest:this.state.newest})}},{key:"toggleState",value:function(e){var t=this,i=function(){t.saveFirmsToggleState(),t.componentDidMount()};switch(e){case"newest":this.setState({newest:!this.state.newest},i);break;case"newer":this.setState({newer:!this.state.newer},i);break;case"older":this.setState({older:!this.state.older},i);break;case"oldest":this.setState({oldest:!this.state.oldest},i)}}},{key:"render",value:function(){var e=this,t=new Intl.RelativeTimeFormat(this.translateSvc.language,{style:"short"});return st("div",{class:"sidebar-stack-item sidebar-firms",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.fires"})}),void 0!==this.props.minimizeButtonCb?st("button",{class:"drawing-action-btn",onClick:function(){return e.props.minimizeButtonCb?e.props.minimizeButtonCb():null},children:st("span",{class:"material-symbols-outlined",children:"minimize"})}):null,st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-subheader not-interactive",children:[st("span",{children:st(gt,{options:{at:this.state.updatedAt?new Date(1e3*this.state.updatedAt).toLocaleString():"..."},children:"seb.updated_at"})}),st("span",{class:"caption",children:[" ",st(gt,{children:"firms.toggle-hint"})]})]}),st("div",{class:"stack-item-section firms-legend",children:[st("div",{className:St({"firms-legend-item":!0,disabled:!1===this.state.oldest}),onClick:function(){return e.toggleState("oldest")},children:[st("div",{class:"firms-legend-item-circle circle-oldest"}),st("div",{class:"firms-legend-item-label",children:["24-48 ",t.formatToParts(48,"hours")[2].value]})]}),st("div",{className:St({"firms-legend-item":!0,disabled:!1===this.state.older}),onClick:function(){return e.toggleState("older")},children:[st("div",{class:"firms-legend-item-circle circle-older"}),st("div",{class:"firms-legend-item-label",children:["12-24 ",t.formatToParts(24,"hours")[2].value]})]}),st("div",{className:St({"firms-legend-item":!0,disabled:!1===this.state.newer}),onClick:function(){return e.toggleState("newer")},children:[st("div",{class:"firms-legend-item-circle circle-newer"}),st("div",{class:"firms-legend-item-label",children:["6-12 ",t.formatToParts(12,"hours")[2].value]})]}),st("div",{className:St({"firms-legend-item":!0,disabled:!1===this.state.newest}),onClick:function(){return e.toggleState("newest")},children:[st("div",{class:"firms-legend-item-circle circle-newest"}),st("div",{class:"firms-legend-item-label",children:["< 6 ",t.formatToParts(6,"hours")[2].value]})]})]})]})}}]),t}(y),Li=function(e){function t(e){var i,n;return Z(this,t),J($(n=U(this,t)),"translateSvc",window.translateService),null===(i=e.eventEmitter)||void 0===i||i.addListener("ui",(function(e){n.setState({updatedAt:e.dataUpdatedAt||void 0})})),n}return K(t,e),Y(t,[{key:"componentDidMount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.emit("backend",{command:"REPORT_UDATED_AT"})}},{key:"componentWillUnmount",value:function(){var e;null===(e=this.props.eventEmitter)||void 0===e||e.removeAllListeners("ui")}},{key:"render",value:function(){var e=this;return new Intl.RelativeTimeFormat(this.translateSvc.language,{style:"short"}),st("div",{class:"sidebar-stack-item sidebar-seb",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.radiation"})}
1),void 0!==this.props.minimizeButtonCb?st("button",{class:"drawing-action-btn",onClick:function(){return e.props.minimizeButtonCb?e.props.minimizeButtonCb():null},children:st("span",{class:"material-symbols-outlined",children:"minimize"})}):null,st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section seb-legend",children:[st("div",{class:"seb-legend-label",children:st(gt,{children:"seb.legendTitle"})}),st("div",{class:"seb-legend-row",children:[st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #BBBBBB;"}),st("div",{class:"seb-legend-item-label",children:st(gt,{children:"seb.noData"})})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #1EAFAF;"}),st("div",{class:"seb-legend-item-label",children:"0"})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #1D8BAF;"}),st("div",{class:"seb-legend-item-label",children:"100"})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #1C65AF;"}),st("div",{class:"seb-legend-item-label",children:"200"})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #1D41AE;"}),st("div",{class:"seb-legend-item-label",children:"300"})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #411DAF;"}),st("div",{class:"seb-legend-item-label",children:"500"})]}),st("div",{class:"seb-legend-item",children:[st("div",{class:"seb-legend-item-box",style:"background-color: #661DAF;"}),st("div",{class:"seb-legend-item-label",children:"2000"})]})]})]}),st("div",{class:"stack-item-section seb-footer",children:[st("div",{class:"seb-copyright",children:st("a",{href:"https://www.saveecobot.com/",target:"_blank",children:st("svg",{width:"685.25px",height:"203.82px","enable-background":"new 40.71 45.526 685.246 203.82",version:"1.1",viewBox:"40.71 45.526 685.25 203.82","xml:space":"preserve",xmlns:"http://www.w3.org/2000/svg",children:[st("g",{class:"seb-logo-text",children:[st("path",{d:"m276.99 183.87c-3.975-4.364-6.142-11.125-6.492-20.281l15.116-2.558c0.144 5.469 0.904 9.494 2.289 12.086 1.388 2.591 3.46 3.884 6.228 3.884 2.06 0 3.552-0.651 4.473-1.968 0.921-1.312 1.384-2.997 1.384-5.057 0-3.408-0.764-6.298-2.29-8.679-1.524-2.377-3.921-4.985-7.182-7.825l-8.947-7.773c-3.549-2.98-6.263-6.173-8.146-9.581-1.882-3.408-2.82-7.486-2.82-12.245 0-7.026 2.072-12.439 6.23-16.237 4.15-3.795 9.882-5.696 17.195-5.696 7.807 0 13.235 2.256 16.289 6.765 3.052 4.507 4.792 10.233 5.214 17.19l-15.223 2.238c-0.143-4.543-0.657-7.897-1.544-10.062-0.892-2.165-2.643-3.246-5.272-3.246-1.916 0-3.404 0.727-4.468 2.182-1.064 1.456-1.601 3.177-1.601 5.165 0 2.839 0.623 5.233 1.868 7.187 1.237 1.95 3.205 4.1 5.908 6.44l8.729 7.664c4.115 3.62 7.345 7.438 9.688 11.444 2.342 4.014 3.517 8.716 3.517 14.113 0 4.112-0.926 7.785-2.772 11.019-1.847 3.228-4.455 5.764-7.824 7.61-3.374 1.847-7.258 2.768-11.659 2.768-7.953 1e-3 -13.913-2.183-17.888-6.547"}),st("path",{d:"m330.32 188.18c-2.128-1.42-3.743-3.283-4.845-5.592-1.103-2.306-1.649-4.699-1.649-7.188 0-4.752 1.172-8.658 3.512-11.713 2.345-3.049 5.167-5.428 8.463-7.131 3.304-1.705 7.686-3.547 13.152-5.537v-5.748c0-2.2-0.303-3.869-0.906-5.005-0.604-1.133-1.685-1.704-3.248-1.704-1.559 0-2.66 0.497-3.296 1.49-0.642 0.995-1.033 2.413-1.174 4.26l-0.32 4.259-15.121-0.641c0.288-7.31 2.167-12.686 5.645-16.128 3.478-3.443 8.696-5.165 15.653-5.165 6.033 0 10.575 1.667 13.626 5.005 3.052 3.337 4.578 7.915 4.578 13.734v28.641c0 4.826 0.355 9.899 1.064 15.225h-14.368c-0.288-2.057-0.748-5.004-1.389-8.836-0.852 2.841-2.286 5.199-4.314 7.08-2.018 1.877-4.559 2.82-7.61 2.82-2.838 1e-3 -5.325-0.708-7.453-2.126m16.237-10.33c0.961-0.709 1.757-1.521 2.396-2.447v-16.93c-3.339 1.918-5.893 3.905-7.664 5.965-1.777 2.06-2.66 4.576-2.66 7.557 0 2.201 0.424 3.906 1.273 5.111 0.851 1.207 2.057 1.81 3.618 1.81 1.065-2e-3 2.077-0.357 3.037-1.066"}
1),st("polygon",{points:"370.68 127.7 386.23 127.7 391.86 169.12 397.19 127.7 412.63 127.7 400.06 189.24 383.03 189.24"}),st("path",{d:"m423.11 184.77c-3.514-3.69-5.272-9.017-5.272-15.971v-20.654c0-6.958 1.777-12.277 5.326-15.973 3.547-3.689 8.657-5.536 15.331-5.536 6.883 0 11.924 1.847 15.118 5.536 3.193 3.694 4.79 9.157 4.79 16.397v10.753h-24.593v11.924c0 2.628 0.406 4.546 1.225 5.748 0.817 1.209 2.005 1.812 3.567 1.812 3.192 0 4.791-2.306 4.791-6.92v-5.966h14.902v5.324c0 6.175-1.7 10.896-5.108 14.161-3.407 3.265-8.307 4.896-14.691 4.896-6.744 5e-3 -11.87-1.838-15.386-5.531m20.284-33.111v-5.964c0-2.695-0.392-4.631-1.173-5.803-0.781-1.17-2.023-1.758-3.726-1.758-1.635 0-2.82 0.64-3.568 1.918-0.744 1.278-1.116 3.549-1.116 6.814v4.792l9.583 1e-3z"}),st("polygon",{points:"469.16 103.01 502.59 103.01 502.59 111.95 481.19 111.95 481.19 140.48 498.54 140.48 498.54 149 481.19 149 481.19 180.62 502.8 180.62 502.8 189.24 469.16 189.24"}),st("path",{d:"m517.18 187.17c-2.629-1.95-4.42-4.684-5.376-8.195-0.96-3.515-1.439-7.968-1.439-13.363v-14.16c0-5.54 0.479-10.077 1.439-13.629 0.956-3.551 2.747-6.263 5.376-8.148 2.621-1.877 6.351-2.82 11.177-2.82 4.399 0 7.829 0.712 10.276 2.131 2.448 1.42 4.152 3.535 5.108 6.334 0.96 2.807 1.439 6.44 1.439 10.915v3.617h-10.327v-3.726c0-4.044-0.445-6.866-1.333-8.463-0.882-1.598-2.572-2.396-5.056-2.396-1.916 0-3.335 0.424-4.261 1.275-0.921 0.853-1.562 2.236-1.916 4.152-0.358 1.916-0.532 4.724-0.532 8.414v19.377c0 3.551 0.217 6.267 0.641 8.146 0.429 1.879 1.116 3.194 2.08 3.938 0.952 0.744 2.318 1.117 4.092 1.117 2.631 0 4.33-0.867 5.112-2.609 0.783-1.738 1.173-4.416 1.173-8.036v-5.004h10.328v4.258c0 6.674-1.224 11.642-3.677 14.907-2.443 3.266-6.829 4.896-13.148 4.896-4.827 2e-3 -8.555-0.973-11.176-2.928"}),st("path",{d:"m558.33 184.29c-2.733-3.867-4.101-9.489-4.101-16.873v-17.885c0-7.383 1.366-13.01 4.101-16.877 2.729-3.867 7.361-5.8 13.893-5.8 6.462 0 11.057 1.933 13.789 5.8 2.733 3.867 4.102 9.494 4.102 16.877v17.885c0 7.384-1.367 13.006-4.102 16.873-2.732 3.871-7.327 5.806-13.789 5.806-6.532 0-11.163-1.935-13.893-5.806m18.365-4.416c0.921-1.207 1.491-2.694 1.699-4.474 0.217-1.772 0.324-4.187 0.324-7.239v-19.267c0-3.057-0.107-5.486-0.324-7.295-0.208-1.812-0.778-3.317-1.699-4.526-0.921-1.204-2.413-1.81-4.474-1.81-2.059 0-3.562 0.605-4.522 1.81-0.956 1.209-1.545 2.715-1.757 4.526-0.217 1.809-0.319 4.239-0.319 7.295v19.267c0 3.054 0.104 5.467 0.319 7.239 0.212 1.779 0.801 3.267 1.757 4.474 0.96 1.207 2.465 1.81 4.522 1.81 2.061 0 3.553-0.603 4.474-1.81"}),st("path",{d:"m601.5 103.01h19.806c7.809 0 13.59 1.754 17.354 5.268 3.764 3.512 5.641 8.96 5.641 16.341 0 11.003-4.113 17.072-12.349 18.207 5.111 1.209 8.841 3.605 11.181 7.188 2.34 3.586 3.512 8.465 3.512 14.641 0 7.738-1.828 13.771-5.483 18.102-3.654 4.33-9.208 6.497-16.66 6.497h-22.998v-86.243h-4e-3zm19.161 35.983c4.975 0 8.413-1.079 10.333-3.248 1.916-2.162 2.872-5.871 2.872-11.126 0-3.832-0.584-6.652-1.756-8.46-1.172-1.812-2.93-2.965-5.27-3.462-2.344-0.496-5.82-0.746-10.437-0.746h-2.876v27.043l7.134-1e-3zm0.965 41.631c3.547 0 6.298-0.552 8.248-1.649 1.95-1.102 3.316-2.785 4.101-5.062 0.778-2.271 1.168-5.356 1.168-9.261 0-5.537-1.134-9.672-3.403-12.404-2.275-2.729-5.96-4.098-11.077-4.098h-7.132v32.474h8.095z"}),st("path",{d:"m659.36 184.29c-2.733-3.867-4.101-9.489-4.101-16.873v-17.885c0-7.383 1.366-13.01 4.101-16.877 2.733-3.867 7.365-5.8 13.896-5.8 6.457 0 11.055 1.933 13.788 5.8 2.729 3.867 4.097 9.494 4.097 16.877v17.885c0 7.384-1.366 13.006-4.097 16.873-2.732 3.871-7.331 5.806-13.788 5.806-6.529 0-11.162-1.935-13.896-5.806m18.369-4.416c0.923-1.207 1.488-2.694 1.7-4.474 0.216-1.772 0.32-4.187 0.32-7.239v-19.267c0-3.057-0.104-5.486-0.32-7.295-0.212-1.812-0.777-3.317-1.7-4.526-0.926-1.204-2.412-1.81-4.472-1.81s-3.567 0.605-4.523 1.81c-0.96 1.209-1.544 2.715-1.757 4.526-0.217 1.809-0.323 4.239-0.323 7.295v19.267c0 3.054 0.106 5.467 0.323 7.239 0.213 1.779 0.797 3.267 1.757 4.474 0.956 1.207 2.465 1.81 4.523 1.81 2.059 0 3.547-0.603 4.472-1.81"}),st("path",{d:"m704.66 175.4v-40.137h-6.492v-7.561h6.492v-17.993h11.393v17.993h9.9v7.561h-9.9v39.394c0 2.483 0.395 4.224 1.173 5.217 0.782 0.994 2.271 1.49 4.473 1.49 1.419 0 2.803-0.106 4.152-0.318v8.408c-2.839 0.429-5.468 0.642-7.882 0.642-8.871 0-13.309-4.898-13.309-14.696"})]}),st("path",{d:"m244.53 147.44c0 56.283-45.627 101.91-101.91 101.91-56.284 0-101.91-45.627-101.91-101.91s45.625-101.91 101.91-101.91c56.283 0 101.91 45.626 101.91 101.91",fill:"#00A552"}),st("polygon",{points:"118.69 160.48 98.409 160.48 100.31 110.42 116.78 110.42",fill:"#fff"}),st("polygon",{points:"184.59 216.24 184.59 165.55 159.24 154.78 159.24 165.55 132.63 144.64 132.63 165.55 96.508 165.55 96.508 216.24 92.707 216.24 92.707 219.41 188.39 219.41 188.39 216.24",fill:"#fff"}),st("path",{d:"m179.94 78.993c-1.943 0.227-3.893 0.424-5.826 0.719-6.449 0.981-12.578 3.018-18.58 5.525-3.982 1.664-7.881 4.013-10.92 7.
1102-2.447 2.486-4.67 5.126-6.457 8.138-1.921 3.231-3.366 6.731-4.379 10.347-0.842 3.003-1.388 6.088-1.664 9.193-0.12 1.373-0.179 2.75-0.185 4.127-3e-3 0.701 8e-3 1.402 0.031 2.104 0.011 0.34-0.011 0.681 9e-3 1.021 0.016 0.275 0.028 0.575 0.153 0.827 0.141 0.285 0.301 0.161 0.487-8e-3 0.22-0.197 0.442-0.39 0.671-0.576 3.087-2.524 5.766-5.348 8.829-7.962 3.104-2.647 6.273-6.211 9.127-9.125 5.676-5.797 11.797-10.316 18.586-14.848 1.547-1.033 3.158-2.033 4.789-2.911 0.164-0.089 0.336-0.164 0.518-0.216 0.201-0.06 0.41-0.084 0.621-0.065 0.105 0.011 0.68 0.068 0.51 0.247-0.129 0.132-0.301 0.208-0.441 0.32-0.189 0.15-0.367 0.323-0.549 0.484-0.371 0.329-0.74 0.657-1.111 0.986-0.742 0.656-1.482 1.314-2.227 1.972-7.455 6.606-14.713 13.431-21.73 20.51-2.254 2.275-4.486 4.575-6.695 6.896-1.105 1.16-2.205 2.327-3.295 3.499-0.529 0.566-1.064 1.129-1.582 1.704-0.247 0.276-1.348 1.218-1.348 1.515-1.62 1.736-3.469 3.259-5.485 4.513-2.738 1.702-5.755 2.899-8.753 4.084-0.842 0.334-1.554 0.48-2.054 1.251-0.147 0.226-0.241 0.495-0.208 0.763 0.205 1.726 3.202 1.02 4.208 0.732 1.515-0.433 2.985-1.008 4.404-1.688s2.787-1.459 4.113-2.304c1.351-0.858 2.646-1.788 3.932-2.737 0.035-0.025 0.067-0.05 0.102-0.074 0.208-0.152 0.421-0.309 0.67-0.373 0.333-0.088 0.674 2e-3 1.001 0.073 0.355 0.076 0.719 0.12 1.077 0.182 0.807 0.136 1.616 0.265 2.427 0.383 0.941 0.134 1.887 0.255 2.834 0.35 2.189 0.221 4.389 0.347 6.588 0.357 3.625 0.019 7.26-0.275 10.814-0.988 2.686-0.538 5.328-1.315 7.85-2.386 1.779-0.758 3.504-1.659 5.111-2.738 0.916-0.615 1.801-1.283 2.602-2.042 0.158-0.146 0.311-0.297 0.455-0.456 22.285-19.076 19.834-57.023 19.834-57.023-3.361 4.476-8.742 6.911-14.115 7.913-1.573 0.293-3.161 0.498-4.749 0.683",fill:"#fff"})]})})}),st("div",{class:"seb-updated-at",children:[st(gt,{options:{at:this.state.updatedAt?new Date(1e3*this.state.updatedAt).toLocaleString():"—"},children:"seb.updated_at"}),":",st("br",{})]})]})]})}}]),t}(y);!function(e){e.OVERPRESSURE="psi",e.IONIZING="rem",e.THERMAL="therm",e.FIREBALL="fireball"}(hi||(hi={})),function(e){e.light_damage="1",e.medium_damage="5",e.heavy_damage="20",e.extreme_damage="200",e.destroys_missile_bunkers="3000",e.other=""}(pi||(pi={})),function(e){e.rem_100="100",e.rem_500="500",e.rem_600="600",e.rem_1k="1000",e.rem_5k="5000",e.other=""}(vi||(vi={})),function(e){e.third_degree_burns_100="_3rd-100",e.third_degree_burns_50="_3rd-50",e.second_degree_burns_50="_2nd-50",e.first_degree_burns_50="_1st-50",e.minimum_radius_no_burns="_noharm-100",e.dry_wood="35",e.other=""}(fi||(fi={}));var xi=function(){function e(t){Z(this,e),J(this,"value",0),J(this,"results",[]),J(this,"airburst",!0),J(this,"psi",[pi.heavy_damage,pi.medium_damage,pi.light_damage]),J(this,"rem",[vi.rem_500]),J(this,"therm",[fi.third_degree_burns_100]),J(this,"ft2mi",189394e-9),J(this,"mi2m",1609.34),J(this,"ft2km",3048e-7),J(this,"mi2km",1.60934),J(this,"m2km",.001),J(this,"errors",[]),this.bc=t}return Y(e,[{key:"calculate",value:function(e){var t=this;if(e<0)throw new Error("Value should be bigger than 0");if(e>1e5)throw new Error("Value should be smaller than 100,000");this.value=Number(e);var i,n=0,r=0;if(this.airburst)r=1,(i=5)<1||i>1e4?(console.error("Range of psi for choosing an optimum height is 1 to 10,000."),r=0):n=Math.round(this.bc.opt_height_for_psi(e,i));else{switch(r=2,i=5,parseInt("4")){case 1:n=Math.round(3.28084*parseFloat(""));break;case 2:n=Math.round(5280*parseFloat(""));break;case 3:n=Math.round(3280.84*parseFloat(""));break;default:n=Math.round(parseFloat(""))}this.airburst=!1}return this.options={kt:e,airburst:this.airburst,hob_opt:r,hob_psi:i,hob_ft:n,fireball:!0,crater:!1,casualties:!1,humanitarian:!1,fallout:!1,fallout_wind:15,ff:100,fallout_angle:"225",erw:false,psi:this.psi,rem:this.rem,therm:this.therm,cep:!1,cep_ft:0,cloud:!1},this.calculatePSI(e,r,n),this.calculateREM(e,false,n),this.calculateTHERM(e,n),this.calculateFireball(e,n),this.results.sort((function(e,t){return t.value-e.value})),this.results=this.results.map((function(e,i){return V(V({},e),{},{styles:t.prepareCircleStyle(e,i)})})),this.results}},{key:"calculatePSI",value:function(e,t,i){var n,r=this;
1this.psi.forEach((function(a){if((n=r.airburst?t?r.bc.range_from_psi_hob(e,a,i)*r.ft2mi:r.bc.psi_distance(e,a,r.airburst):r.bc.range_from_psi_hob(e,a,0)*r.ft2mi)>0)r.results.push({type:hi.OVERPRESSURE,options:a,value:n});else{var s=[];s.push({text:"nuclear.nukemap.description.errors.overpressure",options:{value:a}}),i&&r.airburst&&t&&s.push({text:"nuclear.nukemap.description.errors.max_detonation_height_description",options:{value:(r.bc.max_height_for_psi(e,a)*r.ft2km).toFixed(2)}}),r.errors.push({type:hi.OVERPRESSURE,errs:s})}}))}},{key:"calculateREM",value:function(e,t,i){var n=this;this.rem.forEach((function(r){var a=t?10*e:e,s=n.bc.initial_nuclear_radiation_distance(a,r),o=s;if(i&&n.airburst&&(s=n.bc.ground_range_from_slant_range(s,i*n.ft2mi)),s>0)n.results.push({type:hi.IONIZING,options:r,value:s});else{var l=[];l.push({text:"nuclear.nukemap.description.errors.ionizing",options:{value:r}});"The initial nuclear radiation equation for ".concat(r," rem failed to give a result for the given yield and height settings.");i&&n.airburst&&i*n.ft2mi>o&&(l.push({text:"nuclear.nukemap.description.errors.max_detonation_height_description",options:{value:(o*n.mi2km).toFixed(2)}}),"The maximum detonation height for this effect to be felt on the ground is' ".concat(window.distance(o*n.mi2km),".")),n.errors.push({type:hi.IONIZING,errs:l})}}))}},{key:"calculateTHERM",value:function(e,t){var i=this;this.therm.forEach((function(n){var r=i.bc.thermal_distance(e,n,i.airburst);if(t&&i.airburst&&(r=i.bc.ground_range_from_slant_range(r,t*i.ft2mi)),r>0)i.results.push({type:hi.THERMAL,options:n,value:r});else{var a=[];a.push({text:"nuclear.nukemap.description.errors.thermal",options:{option:n}});"Thermal radiation (".concat(n,") equation failed to give a result for the given yield and height.");if(t&&i.airburst)t*i.ft2mi>r&&(a.push({text:"nuclear.nukemap.description.errors.max_detonation_height_description",options:{value:r*i.mi2km}}),"The maximum detonation height for this effect to be felt on the ground is ".concat(r*i.mi2km,"."));i.errors.push({type:hi.THERMAL,errs:a})}}))}},{key:"calculateFireball",value:function(e,t){var i=this.bc.fireball_radius(e,t);i>0?this.results.push({type:hi.FIREBALL,options:"",value:i}):this.errors.push({type:hi.FIREBALL,errs:[{text:"nuclear.nukemap.description.errors.fireball"}]})}},{key:"prepareCircleStyle",value:function(e,t){switch(e.type){case hi.OVERPRESSURE:var i=e.options;return{radius:e.value*this.mi2m,fill:!0,fillColor:"#".concat(Ii(i-5,20,"808080","FF0000","800000","800000")),fillOpacity:i>=5?.3:(n=.3,r=5,a=.2,s=1,o=i,((s-o)*n+(o-r)*a)/(s-r)),stroke:!0,color:"#".concat(Ii(i-5,20,"808080","FF0000","800000","800000")),opacity:0,weight:1,zIndex:10*(t+1)};case hi.THERMAL:return{radius:e.value*this.mi2m,fill:!0,fillColor:"#FFA500",fillOpacity:.3,stroke:!0,color:"#FFA500",opacity:0,weight:1,zIndex:10*(t+1)};case hi.IONIZING:return{radius:e.value*this.mi2m,fill:!0,fillColor:"#00FF00",fillOpacity:.3,stroke:!0,color:"#00FF00",opacity:0,weight:1,zIndex:10*(t+1)};case hi.FIREBALL:return{radius:e.value*this.mi2m,fill:!0,fillColor:"#FFA500",fillOpacity:this.airburst?.3:.5,stroke:!0,color:"#FFFF00",opacity:0,weight:1,zIndex:10*(t+1)};default:return{}}var n,r,a,s,o}},{key:"prepareMultiLanguageLegendVersion",value:function(){var e=this,t=[];this.results.slice().sort((function(e,t){return e.value-t.value})).forEach((function(i){switch(i.type){case hi.FIREBALL:var n=[{text:"nuclear.nukemap.description.fireball.header",options:{value:(i.value*e.mi2m/1e3).toFixed(2)}}],r=[{text:"nuclear.nukemap.description.fireball.caption",options:{}}];e.airburst&&r.push({text:"nuclear.nukemap.description.fireball.airburst",options:{value:(e.bc.minimum_height_for_negligible_fallout(e.value)*e.mi2km).toFixed(1)}}),t.push({type:i.type,header:n,content:r,styles:{"border-color":i.styles.fillColor,opacity:i.styles.fillOpacity}});break;case hi.OVERPRESSURE:var a=Number(i.options),s=[];switch(!0){case 1e4===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.10000"});break;case 7e3===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.7000"});break;case a>1e3&&a<1e4:s.push({text:"nuclear.nukemap.description.overpressure.caption.1000-10000"});break;case 200===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.200"});break;case 20===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.20"});break;case a>5&&a<20:s.push({text:"nuclear.nukemap.description.overpressure.caption.5-20"});break;case 5===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.5"});break;case a>1&&a<5:s.push({text:"nuclear.nukemap.description.overpressure.caption.1-5"});break;case 1===a:s.push({text:"nuclear.nukemap.description.overpressure.caption.1"})}e.airburst&&s.push({text:"nuclear.nukemap.description.overpressure.airburst",options:{value:(e.bc.opt_height_for_psi(e.value,i.options)*e.ft2km).toFixed(1)}});var o=[],l="".concat((i.value*e.mi2m*e.m2km).toFixed(1));switch(a){case 20:o.push({text:"nuclear.nukemap.description.overpressure.header.20",options:{radius:l}});break;case 5:o.push({text:"nuclear.nukemap.description.overpressure.header.5",options:{radius:l}});break;case 1:o.push({text:"nuclear.nukemap.description.overpressure.header.1",options:{radius:l}});break;default:o.push({text:"nuclear.nukemap.description.overpressure.header.custom",options:{value:i.options,radius:l}})}t.push({type:i.type,header:o,content:s,styles:{"border-color":i.styles.fillColor,opacity:i.styles.fillOpacity}});break;case hi.IONIZING:var c=.0303*Number(i.options)-.2065,u="";u=c<1?"less than 1%":c>100?"100%":"".concat(Math.round(c),"%");var d=[{text:"nuclear.nukemap.description.ionizing.header",options:{value:i.options}}],h=[],p=Number(i.options);p>=17e3?h.push({text:"nuclear.nukemap.description.ionizing.caption.17000"}):p>=7e3?h.push({text:"nuclear.nukemap.description.ionizing.caption.7000"}):p>=1e3?h.push({text:"nuclear.nukemap.description.ionizing.caption.1000"}):p>=500?h.push({text:"nuclear.nukemap.description.ionizing.caption.500",options:{risk:u}}):p>=250?h.push({text:"nuclear.nukemap.description.ionizing.caption.250",options:{risk:u}}):p>=100?h.push({text:"nuclear.nukemap.description.ionizing.caption.100",options:{risk:u}}):p>0&&h.push({text:"nuclear.nukemap.description.ionizing.caption.0",options:{risk:u}}),t.push({type:i.type,header:d,content:h,styles:{"border-color":i.styles.fillColor,opacity:i.styles.fillOpacity}});break;case hi.THERMAL:var v="",f=[];switch(i.options){case fi.third_degree_burns_100:v="3rd degree burns","100% probability for 3rd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q
1(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),f.push({text:"nuclear.nukemap.description.thermal.caption.".concat(i.options),options:{value:i.value.toFixed(2)}});break;case fi.third_degree_burns_50:v="3rd degree burns (50%)","50% probability for 3rd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),f.push({text:"nuclear.nukemap.description.thermal.caption.".concat(i.options),options:{value:i.value.toFixed(2)}});break;case fi.second_degree_burns_50:v="2nd degree burns (50%)","50% probability for 2nd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),f.push({text:"nuclear.nukemap.description.thermal.caption.".concat(i.options),options:{value:i.value.toFixed(2)}});break;case fi.first_degree_burns_50:v="1st degree burns (50%)","50% probability for 1st degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),f.push({text:"nuclear.nukemap.description.thermal.caption.".concat(i.options),options:{value:i.value.toFixed(2)}});break;case fi.minimum_radius_no_burns:v="no harm","100% probability of no significant thermal damage at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),f.push({text:"nuclear.nukemap.description.thermal.caption.".concat(i.options),options:{value:i.value.toFixed(2)}});break;default:v=""}var m=[{text:"nuclear.nukemap.description.thermal.header",options:{option:v,value:(i.value*e.mi2km).toFixed(2)}}];t.push({type:i.type,header:m,content:f,styles:{"border-color":i.styles.fillColor,opacity:i.styles.fillOpacity}})}}));var i={text:"nuclear.nukemap.description.header",options:{value:this.value,type:this.airburst?"nuclear.nukemap.options.burst_height.airburst":"nuclear.nukemap.options.burst_height.surface"}},n=[];return this.airburst&&(this.options.hob_ft||0===this.options.hob_ft?(n.push({text:"nuclear.nukemap.description.airburst.caption",options:{distance:(this.options.hob_ft*this.ft2km).toFixed(2)}}),1===this.options.hob_opt&&n.push({text:"nuclear.nukemap.description.airburst.caption-1",options:{value:this.options.hob_psi}})):n.push({text:"nuclear.nukemap.description.airburst.other"})),{title:i,circles:t,airburst:n,errors:this.errors}}},{key:"prepareLegend",value:function(){var e=this,t="";if(this.results.slice().sort((function(e,t){return e.value-t.value})).forEach((function(i){switch(i.type){case hi.FIREBALL:var n="Fireball radius: ".concat((i.value*e.mi2m/1e3).toFixed(2)," km."),r="Maximum size of the nuclear fireball; relevance to damage on the ground depends on the height of detonation. If it touches the ground, the amount of radioactive fallout is significantly increased. Anything inside the fireball is effectively vaporized. ";e.airburst&&(r+="Minimum burst height for negligible fallout: ".concat((e.bc.minimum_height_for_negligible_fallout(e.value)*e.mi2km).toFixed(1)," km."));var a='<div class="section"> <span class="section-header">'.concat(n,' </span> <span class="section-caption"> ').concat(r,"</span></div>");t+=a;break;case hi.OVERPRESSURE:var s=Number(i.options),o="";switch(!0){case 1e4===s:o="10,000 psi is approximately the pressure felt at 4 miles under the ocean. Not much can withstand this.";break;case 7e3===s:o="7,000 psi is supposedly the maximum amount of pressure that super-hardened American missile silos can withstand.";break;case s>1e3&&s<1e4:o="Missile silos can be blast hardened to survive many thousand psi of pressure, but not much else can.";break;case 200===s:o="200 psi is approximately the pressure felt inside of a steam boiler on a locomotive. Extreme damage to all civilian structures, some damage to even &quot;hardened&quot; structures.";break;case 20===s:o="At 20 psi overpressure, heavily built concrete buildings are severely damaged or demolished; fatalities approach 100%. Often used as a benchmark for <b>heavy</b> damage in cities.";break;case s>5&&s<20:o="Between moderate and heavy damage in cities.";break;case 5===s:o="At 5 psi overpressure, most residential buildings collapse, injuries are universal, fatalities are widespread. The chances of a fire starting in commercial and residential damage are high, and buildings s
1o damaged are at high risk of spreading fire. Often used as a benchmark for <b>moderate</b> damage in cities.";break;case s>1&&s<5:o="Between light and moderate damage in cities. Buildings damaged with between 2 and 5 psi of blast are considered a major risk for fire spread (because they are damaged but still standing).";break;case 1===s:o="At a around 1 psi overpressure, glass windows can be expected to break. This can cause many injuries in a surrounding population who comes to a window after seeing the flash of a nuclear explosion (which travels faster than the pressure wave). Often used as a benchmark for <b>light</b> damage in cities.";break;default:o=""}e.airburst&&(o+="Optimal height of burst to maximize this effect is ".concat(e.bc.opt_height_for_psi(e.value,i.options)*e.ft2km," km."));var l="";switch(s){case 20:l+="Heavy blast damage radius (20 psi):";break;case 5:l+="Moderate blast damage radius (5 psi):";break;case 1:l+="Light blast damage radius (1 psi):";break;default:l+="Air blast radius (".concat(i.options," psi):")}var c="".concat(o," ").concat(window.distance(i.value*e.mi2km,!0)),u="".concat((i.value*e.mi2m*e.m2km).toFixed(1)," km"),d='<div class="section"> <span class="section-header"> '.concat(l," ").concat(u,'</span> <span class="section-caption"> ').concat(c,"</span><div>");t+=d;break;case hi.IONIZING:var h=.0303*Number(i.options)-.2065,p="";p=h<1?"less than 1%":h>100?"100%":"".concat(Math.round(h),"%");var v="".concat(i.options," rem ionizing radiation dose;"),f="",m=Number(i.options);m>=17e3?f+="fatal, incapacitating within five minutes, death within one day.":m>=7e3?f+="fatal, incapacitating within five minutes, death within one to two days.":m>=1e3?f+="fatal, incapacitating within five minutes with recovery period, death within four to six days.":m>=1e3?f+="fatal, in two weeks or less.":m>=500?f+="likely fatal, in about 1 month; ".concat(p," of survivors will eventually die of cancer as a result of exposure."):m>=250?f+="sickness inducing, medical care would be required, some deaths in 30-60 days; ".concat(p," of survivors will eventually die of cancer as a result of exposure."):m>=100?f+="sickness inducing, less than 5% chance of death in 60 days; ".concat(p," of survivors will die of cancer as a result of exposure."):m>0&&(f+="no immediate symptoms; ".concat(p," of survivors will die of cancer as a result of exposure."));var g='<div class="section"> <span class="section-header"> '.concat(v,'</span> <span class="section-caption"> ').concat(f,"<span></div>");t+=g;break;case hi.THERMAL:var y="",b="",k="";switch(i.options){case fi.third_degree_burns_100:b="3rd degree burns",k="100% probability for 3rd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),y="Third degree burns extend throughout the layers of skin, and are often painless because they destroy the pain nerves. They can cause severe scarring or disablement, and can require amputation.";break;case fi.third_degree_burns_50:b="3rd degree burns (50%)",k="50% probability for 3rd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),y="Third degree burns extend throughout the layers of skin, and are often painless because they destroy the pain nerves. They can cause severe scarring or disablement, and can require amputation.";break;case fi.second_degree_burns_50:b="2nd degree burns (50%)",k="50% probability for 2nd degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),y="Second degree burns are deeper burns to several layers of the skin. They are very painful and require several weeks to heal. Extreme second degree burns can produce scarring or require grafting.";break;case fi.first_degree_burns_50:b="1st degree burns (50%)",k="50% probability for 1st degree burns at this yield is ".concat(e.bc.thermal_radiation_param_q(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),y="First degree burns are superficial burns to the outer layers of the skin. They are painful but heal in 5-10 days. They are more or less the same thing as a sunburn.";break;case fi.minimum_radius_no_burns:b="no harm",k="100% probability of no significant thermal damage at this yield is ".concat(e.bc.thermal_radiation_param_q
1(e.value,i.options).toFixed(1)," cal/cm<sup>2</sup>."),y="The distance at which anybody beyond would definitely suffer no damage from thermal radiation (heat).";break;default:b="",k="",y=""}var w="Thermal radiation radius (".concat(b,"): ").concat((i.value*e.mi2km).toFixed(2)," km "),C='<div class="section"> <span class="section-header"> '.concat(w,'</span> <span class="section-caption"> ').concat(y," ").concat(k,"<span></div>");t+=C}})),this.airburst){var i="";this.options.hob_ft||0===this.options.hob_ft?(i+="Detonation altitude ".concat(window.distance(this.options.hob_ft*this.ft2km,!1,!1,!0),"."),1===this.options.hob_ft&&(i+="(Chosen to maximize the' : ".concat(this.options.hob_psi," psi range)"))):i+="*Effects shown for multiple, different detonation altitudes",t+='<div class="section-caption"> '.concat(i," </div>")}var n='<h3 class="header">Effect distances for a '.concat(window.ktOrMt(this.value,!1,!0)," (").concat(this.airburst?"airburst":"surface burst","): </h3>");return"".concat(n,' <div class="nuclear-legend">').concat(t,"<div>")}}]),e}();function Ii(e,t,i,n,r,a){if(e>t)return e>=2*t?null!=a?a:n:null!=r?r:n;if(e<=0)return i;var s=parseInt(i,16),o=parseInt(n,16),l=(65280&s)>>8,c=(255&s)>>0,u=(65280&o)>>8,d=(255&o)>>0;return((Fi((16711680&s)>>16,(16711680&o)>>16,e,t)<<8|Fi(l,u,e,t))<<8|Fi(c,d,e,t)).toString(16)}function Fi(e,t,i,n){return e<t?i/n*(t-e)+e:(e-t)*(1-i/n)+t}var Mi=function(e){function t(e){var i,n;return Z(this,t),J($(n=U(this,t)),"handleInput",(function(e){var t=e.target,i=0;t.valueAsNumber>1e5?i=1e5:t.valueAsNumber>0&&(i=t.valueAsNumber),t.value="".concat(i),n.setState({value:i})})),n.translatesService=window.translateService,n.setState({point:null,value:0,content:"",circles:[]}),null===(i=e.eventEmitter)||void 0===i||i.addListener("ui-click",(function(e){n.setState({point:e})})),n}return K(t,e),Y(t,[{key:"callMobileBottomSheetRecalculateCb",value:function(){this.props.mobileBottomSheetRecalculateCb&&this.props.mobileBottomSheetRecalculateCb()}},{key:"componentWillUnmount",value:function(){var e,t;this.state.circles.forEach((function(e){return e.remove()})),null===(e=this.state.point)||void 0===e||e.remove(),null===(t=this.props.eventEmitter)||void 0===t||t.removeAllListeners()}},{key:"simulateNuclearExplosion",value:function(){var e=this;if(this.state.point){var t=window.mapController.getLeafletMap(),i=new xi(window.bc),n=i.calculate(this.state.value),r=i.prepareMultiLanguageLegendVersion();this.htmlResults='<h3 class="header">\n            '.concat(this.translatesService.translate(r.title.text,V(V({},r.title.options),{},{type:this.translatesService.translate(r.title.options.type)})),"</h3>");var a=r.circles.map((function(t){return'\n                <div class="section"> \n                <span class="section-header">\n                    <span class="section-circle" style="border-color:'.concat(t.styles["border-color"],";opacity:").concat(t.styles.opacity,'"></span>\n                      <span>\n                    ').concat(t.header.map((function(t){return e.translatesService.translate(t.text,t.options)})).join(" "),'\n                     </span>\n                    </span>\n                    <span class="section-caption">\n                            ').concat(t.content.map((function(t){return e.translatesService.translate(t.text,t.options)})).join(" "),"\n                     </span>\n                 </div>\n                 ")})).join(" ");r.airburst&&(a+='<span class="section-caption">'.concat(r.airburst.map((function(t){return e.translatesService.translate(t.text,t.options)})).join(" "),"</span>")),r.errors.length&&(a+='\n                <div class="section">\n                <span class="section-header">'.concat(this.translatesService.translate("nuclear.nukemap.description.errors.header"),"</span>\n                ").concat(r.errors.map((function(t){return'<span class="section-caption">'.concat(null==t?void 0:t.errs.map((function(t){return e.translatesService.translate(t.text,t.options)})).join(" "),"</span>")})).join(" "),"\n                </div>")),a+='<div class="section">'.concat(this.translatesService.translate("nuclear.nukemap.description.note"),"</div>"),this.htmlResults+='<div class="nuclear-legend">'.concat(a,"</div>"),this.htmlResults+='<span class="footer">\n            '.concat(this.translatesService.translate("nuclear.poweredBy"),'\n            <a class="link" href="https://nuclearsecrecy.com/nukemap/" target="_blank"> Nukemap </a>\n            </span>
1'),this.state.circles.forEach((function(e){return t.removeLayer(e)})),this.setState({circles:[]});var s=n.map((function(i){if(e.state.point){var n,r=new L.Circle(null===(n=e.state.point)||void 0===n?void 0:n.getLatLng(),null==i?void 0:i.styles),a=null==i?void 0:i.value.toFixed(2);i.type===hi.THERMAL&&(a=e.translatesService.translate("nuclear.nukemap.circle.".concat(null==i?void 0:i.type,".options.").concat(null==i?void 0:i.options)));var s=L.tooltip().setContent(e.translatesService.translate("nuclear.nukemap.circle.".concat(null==i?void 0:i.type,".title"),{value:a}));return r.bindTooltip(s),r.addTo(t),r.on("mouseover",(function(){r.setStyle({opacity:1})})),r.on("mouseout",(function(){r.setStyle({opacity:0})})),r}}));this.setState({circles:s,content:this.htmlResults},(function(){return e.callMobileBottomSheetRecalculateCb()}))}}},{key:"isCalculationDisabled",get:function(){return null===this.state.point||0===this.state.value}},{key:"render",value:function(){var e=this;return st("div",{className:"sidebar-stack-item sidebar-nuclear",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:["   ",st(gt,{children:"features.nuclear"}),"  "]}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{className:"stack-item-section",children:st("div",{class:"flex-col gap-16",children:[st("span",{className:St({"nuclear-step":!0,error:!this.state.point}),children:["  ",st(gt,{children:"nuclear.steps.1"})," "]}),st("div",{className:"flex-col gap-4",children:[st("span",{className:St({"nuclear-step":!0,error:!this.state.value}),children:st(gt,{children:"nuclear.steps.2"})}),st("input",{type:"number",min:"1",max:"100000",step:"1",class:"nuclear-input",placeholder:"400",onInput:this.handleInput})]}),st("button",{class:"btn btn-primary calculate",onClick:function(){return e.simulateNuclearExplosion()},disabled:this.isCalculationDisabled,children:st("span",{children:st(gt,{children:"nuclear.steps.3"})})})]})}),this.state.content&&st("div",{className:"stack-item-section results",children:st("div",{class:"results-content",dangerouslySetInnerHTML:{__html:this.state.content}})})]})}}]),t}(y),Ri="overlay-backdrop",Ai=function(e){var t,i=Ce(),n=te(ke({top:"50%",left:"50%"}),2),r=n[0],a=n[1],s=te(ke({top:"50%"}),2),o=s[0],l=s[1],c=te(ke(e.styleClass||""),2);c[0],c[1];we((function(){if(e.position.top){var t=function(e){var t=e.match(/(-?)(\d+)(\D+)/);if(t){var i="-"===t[1]?-1:1,n=Number(t[2])*i;return{top:n<0?0:n,unit:t[3],offset:n<0?Math.abs(n):0}}return{top:0,unit:null,offset:0}}(e.position.top);a(V(V({},e.position),{},{top:"".concat(t.top).concat(t.unit),left:e.position.left})),l({top:"calc( 10% + ".concat(t.offset).concat(t.unit," )")})}}),[e.position]),e.backdropStyleClass=null!==(t=e.backdropStyleClass)&&void 0!==t?t:Ri;return st("div",{className:e.backdropStyleClass,onClick:function(t){t.target.classList.contains(Ri)&&e.onOutsideClick&&e.onOutsideClick()},children:st("div",{className:St(J({overlay:!0},e.styleClass,!!e.styleClass)),style:r,ref:i,children:[e.showArrow&&st("div",{className:"overlay-arrow",style:o}),st("div",{class:"overlay-content",children:[" ",e.children," "]})]})})},Ti=function(e){function t(){var e;Z(this,t),J($(e=U(this,t)),"profileService",window.profile),J($(e),"position",{top:"50%",left:"50%",transform:"translate(-50%, -50%)"});var i=e.profileService.getSetting("onboarding");return void 0===i&&(e.profileService.updateSetting("onboarding",0),i=0),e.state={step:i,steps:nt.onboardingSteps,current:i>0?nt.onboardingSteps[i+1]:null},e}return K(t,e),Y(t,[{key:"close",value:function(){this.props.dismissSelf(),this.profileService.updateSetting("onboarding",this.state.steps.length)}},{key:"openNextStep",value:function(){var e=this,t=this.state.step+1,i=this.state.steps.find((function(e){return e.id===t}));if(i){var n=Et(document.querySelector(i.selector));this.position={top:"".concat(n.center.y-40,"px"),left:"".concat(n.center.x+40,"px"),transform:"unset"}}this.profileService.updateSetting("onboarding",t),this.setState({step:t,current:i},(function(){e.props.mobileBottomSheetRecalculateCb&&e.props.mobileBottomSheetRecalculateCb()}))}},{key:"openPrevious",value:function(){var e=this,t=this.state.step>0?this.state.step-1:1,i=this.state.steps.find((function(e){return e.id===t}));if(i){var n=Et(document.querySelector(i.selector));this.position={transform:"unset",left:"".concat(n.center.x+40,"px"),top:"".concat(n.center.y-40,"px")}}this.setState({step:t,current:i},(function(){e.props.mobileBottomSheetRecalculateCb&&e.props.mobileBottomSheetRecalculateCb()}))}},{key:"handleOnboardingActions",value:function(e){switch(e){case"next":this.openNextStep();break;case"previous":this.openPrevious();break;default:this.close()}}},{key:"render",value:function(){var e=this;return st(g,{children:[this.props.overlay&&st(Ai,{showArrow:!!this.state.current,styleClass:"onboarding-overlay",position:this.position,children:st(Pi,{step:this.state.current,on:function(t){return e.handleOnboardingActions(t)},stepsCount:this.state.steps.length})}),!1===this.props.overlay&&st(g,{children:st("div",{class:"onboarding-mobile",children:st(Pi,{step:this.state.current,on:function(t){return e.handleOnboardingActions(t)},stepsCount:this.state.steps.length})})})]})}}]),t}(y),Pi=function(e){var t=function(t){return e.on(t)};return st(g,{children:e.step?st(Di,{onClose:function(){return t("close")},back:function(){return t("previous")},next:function(){return t("next")},option:e.step,stepsCount:e.stepsCount}):st(Ni,{onClose:function(){return t("close")},next:function(){return t("next")}})})},Ni=function(e){return st("div",{class:"welcome",children:[st("span",{className:"hand",children:"👋"}
1),st("h3",{className:"h3",children:[" ",st(gt,{children:"onboarding.welcome.header"})," "]}),st("div",{className:"learn",children:[st("button",{className:"btn btn-primary",onClick:e.next,children:st(gt,{children:"onboarding.welcome.action"})}),st("div",{className:"caption explore-yourself",onClick:e.onClose,children:st(gt,{children:"onboarding.welcome.caption"})})]})]})},Di=function(e){var t=te(ke(!1),2),i=t[0],n=t[1],r=1===e.option.id;return we((function(){n(e.option.id===e.stepsCount)}),[e.option.id]),st("div",{class:"onboarding-step",children:[st("div",{className:"text",children:[st("div",{className:"flex-col",children:[st("span",{className:"caption",children:[e.option.id,"/",e.stepsCount]}),st("h3",{class:"h3",children:[" ",st(gt,{children:e.option.title})," "]})]}),st("span",{class:"description",children:[" ",st(gt,{children:e.option.description})," "]}),st("div",{className:"navigation",children:[!1===r&&st("button",{className:"btn btn-outline",onClick:e.back,children:[" ",st(gt,{children:"onboarding.back"})," "]}),!0===r&&st("button",{className:"btn btn-outline",onClick:e.onClose,children:[" ",st(gt,{children:"onboarding.close"})," "]}),!0===i&&st("button",{className:"btn btn-primary",onClick:e.onClose,children:[" ",st(gt,{children:"onboarding.goToMap"})," "]}),!1===i&&st("button",{className:"btn btn-primary",onClick:e.next,children:[" ",st(gt,{children:"onboarding.next"})," "]})]})]}),st("div",{className:"preview",children:st("img",{class:"preview-image",src:e.option.image,alt:e.option.name})})]})},Oi=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t)),"translateSvc",window.translateService),i.setState({loading:!0}),i}return K(t,e),Y(t,[{key:"changeLayer",value:function(e){var t;null===(t=this.props.eventEmitter)||void 0===t||t.emit("backend",{layer:e})}},{key:"componentDidMount",value:function(){var e;this.setState({loading:!0,layer:void 0}),null===(e=this.props.eventEmitter)||void 0===e||e.addListener("ui",this.handleUiEvents.bind(this))}},{key:"handleUiEvents",value:function(e){e&&void 0!==e.loading&&this.setState({loading:e.loading}),e&&"ready"===e.state&&(this.state.layer||this.changeLayer("temp")),e&&void 0!==e.layer&&this.setState({layer:e.layer}),e&&void 0!==e.palette&&this.setState({palette:e.palette})}},{key:"render",value:function(){var e,t,i,n,r,a,s,o,l,c=this;return st("div",{class:"sidebar-stack-item sidebar-weather",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.weather"})}),void 0!==this.props.minimizeButtonCb&&st("div",{class:"stack-item-minimize",onClick:function(){return c.props.minimizeButtonCb?c.props.minimizeButtonCb():null},children:st("span",{class:"material-symbols-outlined",children:"minimize"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return c.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),this.state.loading&&st(yt,{}),!this.state.loading&&st("div",{class:"stack-item-section",children:[st("p",{class:"text-secondary",style:"margin-bottom: 8px; margin-top: 8px;",children:c.state.layer?c.translateSvc.translate("weather.".concat(c.state.layer)):null}),st("div",{class:"sidebar-weather-layers",children:[st("button",{class:"weather-layer-btn"+("temp"===c.state.layer?" active":""),onClick:function(){return c.changeLayer("temp")},children:st("span",{class:"material-symbols-outlined",children:"device_thermostat"})}),st("button",{class:"weather-layer-btn"+("wind"===c.state.layer?" active":""),onClick:function(){return c.changeLayer("wind")},children:st("span",{class:"material-symbols-outlined",children:"air"})}),st("button",{class:"weather-layer-btn"+("rain"===c.state.layer?" active":""),onClick:function(){return c.changeLayer("rain")},children:st("span",{class:"material-symbols-outlined",children:"rainy"})}),st("button",{class:"weather-layer-btn"+("clouds"===c.state.layer?" active":""),onClick:function(){return c.changeLayer("clouds")},children:st("span",{class:"material-symbols-outlined",children:"cloud"})}),st("button",{class:"weather-layer-btn"+("snow"===c.state.layer?" active":""),onClick:function(){return c.changeLayer("snow")},children:st("span",{class:"material-symbols-outlined",children:"ac_unit"})})]})]}),!this.state.loading&&this.state.palette?(e=this.state.palette,st("div",{class:"weather-legend",children:st("div",{class:"weather-legend-gradient",style:"background: "+e.cssGradient,children:[st("div",{class:"weather-legend-gradient-item","data-weather-legend":"unit",children:null===(t=e.paletteValues)||void 0===t?void 0:t.unit}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"1",children:null===(i=e.paletteValues)||void 0===i?void 0:i[1]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"2",children:null===(n=e.paletteValues)||void 0===n?void 0:n[2]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"3",children:null===(r=e.paletteValues)||void 0===r?void 0:r[3]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"4",children:null===(a=e.paletteValues)||void 0===a?void 0:a[4]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"5",children:null===(s=e.paletteValues)||void 0===s?void 0:s[5]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"6",children:null===(o=e.paletteValues)||void 0===o?void 0:o[6]}),st("div",{class:"weather-legend-gradient-item","data-weather-legend":"7",children:null===(l=e.paletteValues)||void 0===l?void 0:l[7]})]})}
1)):null,st("div",{class:"stack-item-section weather-footer",children:st("div",{class:"weather-copyright",children:st("a",{href:"https://weatherlayers.com/",target:"_blank",children:st("img",{src:"/images/weatherlayers_logo.svg",alt:"WeatherLayers Logo"})})})})]})}}]),t}(y),Ui=function(){function e(){Z(this,e),J(this,"apiUrl",""),this.httpClient=new dt(this.apiUrl)}return Y(e,[{key:"fetchPeriods",value:function(){return this.httpClient.get("/api/stats/sbs/periods",void 0,{})}},{key:"fetchPeriodStats",value:function(e){return this.httpClient.get("/api/stats/sbs/period/"+e,void 0,{})}},{key:"fetchAreasByRegion",value:function(e){return this.httpClient.get("/api/history/".concat(e,"/areas-by-region"),void 0,{})}}]),e}(),Hi=function(e){var t=e.option,i=e.selected;return st("div",{className:St({"dropdown-item":!0,selected:i,disabled:!!t.disabled}),onClick:function(i){i.stopPropagation(),t.disabled||e.onSelect(t)},children:st("div",{class:"dropdown-item-label",children:[" ",e.labelTemplate," "]})})},Bi=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"overlayRef",{current:null}),e.setState({options:null,value:null,opened:!1,placeholder:"Select Item",filter:""}),e.onDocumentClick=e.onDocumentClick.bind($(e)),e.resetValue=e.resetValue.bind($(e)),e}return K(t,e),Y(t,[{key:"componentDidMount",value:function(){var e;this.setState({options:this.props.options,value:this.props.value,placeholder:null!==(e=this.props.placeholder)&&void 0!==e?e:this.state.placeholder}),document.body.addEventListener("click",this.onDocumentClick)}},{key:"componentDidUpdate",value:function(e){e.options!==this.props.options&&this.setState({options:this.props.options}),e.value!==this.props.value&&this.setState({value:this.props.value})}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onDocumentClick)}},{key:"onDocumentClick",value:function(e){var t=document.querySelector(".dropdown-overlay");(null==t?void 0:t.contains(e.target))||this.setState({opened:!1})}},{key:"onSelectOption",value:function(e){this.props.onChange(e.value),this.setState({value:e.value,opened:!1,filter:""})}},{key:"toggle",value:function(e){var t=this;e.stopPropagation();var i=!this.state.opened;this.setState({opened:i,filter:""},(function(){i&&t.scrollToSelected()}))}},{key:"scrollToSelected",value:function(){var e=this.overlayRef.current;if(e){var t=e.querySelector(".dropdown-item.selected");if(t){var i,n=null!==(i=this.props)&&void 0!==i&&i.searchable?100:0;e.scrollTop=t.offsetTop-e.offsetTop-n}}}},{key:"filteredOptions",get:function(){var e=this.state,t=e.filter,i=e.options;if(!t||!i)return null!=i?i:[];var n=t.toLowerCase();return i.filter((function(e){var t;return null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(n)}))}},{key:"selectedItem",get:function(){var e,t=this;return(null===(e=this.state.options)||void 0===e?void 0:e.find((function(e){return e.value===t.state.value})))||null}},{key:"getLabel",value:function(e){var t;return e[null!==(t=this.props.optionLabel)&&void 0!==t?t:"label"]}},{key:"resetValue",value:function(e){var t;e.stopPropagation();null!==(t=this.props)&&void 0!==t&&t.onChange&&this.props.onChange(null),this.setState({value:null,opened:!1})}},{key:"getPlaceholder",value:function(){return this.isString(this.state.placeholder)?st(g,{children:this.state.placeholder}):this.state.placeholder}},{key:"labelTemplate",value:function(e){if(this.props.labelTemplate){var t=this.props.labelTemplate(e);return this.isString(t)?st("span",{dangerouslySetInnerHTML:{__html:t}}):t}return st("span",{dangerouslySetInnerHTML:{__html:this.getLabel(e)}})}},{key:"isString",value:function(e){return"string"==typeof e}},{key:"render",value:function(){var e=this;return st("div",{id:this.props.id||Math.random().toString(36).substring(2,15),className:St(J({dropdown:!0,opened:this.state.opened},this.props.styleClass,!!this.props.styleClass)),onClick:function(t){return e.toggle(t)},children:[st(g,{children:[this.selectedItem?st("div",{class:"dropdown-label",children:this.labelTemplate(this.selectedItem)}):st("div",{class:"dropdown-label dropdown-placeholder",children:[" ",this.getPlaceholder()]}),st("div",{class:"dropdown-actions",children:[!1!==this.props.closeIcon&&this.state.value&&st("span",{class:"material-symbols-outlined dropdown-trigger-icon",onClick:this.resetValue,children:"close"}),st("span",{class:"material-symbols-outlined dropdown-trigger-icon",children:this.state.opened?"expand_less":"expand_more"})]})]}),this.state.opened&&st("div",{ref:this.overlayRef,className:St(J({"dropdown-overlay":!0},this.props.stylePanelClass,!!this.props.stylePanelClass)),children:[this.props.searchable&&st("div",{class:"dropdown-search",onClick:function(e){return e.stopPropagation()},children:st("input",{class:"dropdown-search-input",type:"text",value:this.state.filter,placeholder:"...",autoFocus:!0,onInput:function(t){return e.setState({filter:t.target.value})}})}),st("div",{className:"dropdown-list",children:this.filteredOptions.map((function(t){return st(Hi,{selected:t.value===e.state.value,option:t,onSelect:function(t){return e.onSelectOption(t)},labelTemplate:e.labelTemplate(t)}
1,t.value)}))})]})]})}}]),t}(y),Vi=[23,13,9,8,11,12,10,25,29,1,2,3,4,6,5,7,18,20,17,21,22,14,27,24,26,28],Gi=function(e){function t(){var e;return Z(this,t),(e=U(this,t)).translateService=window.translateService,e.statsService=new Ui,e.state={loading:!1},e.initialLoad().then().catch(),e}var i,n;return K(t,e),Y(t,[{key:"handlePeriodClick",value:function(e){var t=this;this.setState({selectedPeriod:e},(function(){return t.fetchPeriodStats().then().catch()}))}},{key:"getOrderedTargets",value:function(){var e=this;return this.state.selectedPeriod&&this.state.selectedPeriodStats?Vi.map((function(t){var i;return null===(i=e.state.selectedPeriodStats)||void 0===i?void 0:i.targets.find((function(e){return e.targetClassId===t}))})):[]}},{key:"initialLoad",value:(n=z(G().mark((function e(){var t,i,n=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({loading:!0,error:void 0}),e.prev=1,e.next=4,this.statsService.fetchPeriods();case 4:t=e.sent,i=t.sort((function(e,t){return e.order-t.order})),this.setState({periods:i},(function(){return n.handlePeriodClick(i[0])})),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),this.setState({error:e.t0.message});case 12:return e.prev=12,this.setState({loading:!1}),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[1,9,12,15]])}))),function(){return n.apply(this,arguments)})},{key:"fetchPeriodStats",value:(i=z(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.state.selectedPeriod){e.next=2;break}return e.abrupt("return");case 2:return this.setState({loading:!0,error:void 0}),e.prev=3,e.next=6,this.statsService.fetchPeriodStats(this.state.selectedPeriod.periodType);case 6:t=e.sent,this.setState({selectedPeriodStats:t}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),this.setState({error:e.t0.message});case 13:return e.prev=13,this.setState({loading:!1}),e.finish(13);case 16:case"end":return e.stop()}}),e,this,[[3,10,13,16]])}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,i=t.loading,n=t.error,r=t.periods,a=t.selectedPeriod,s=t.selectedPeriodStats;return st("div",{children:[i&&st("div",{class:"stack-item-section",children:st(yt,{})}),void 0!==n&&st("div",{class:"stack-item-section",children:st("div",{className:"section-error",children:["Помилка / Error: ",st("br",{}),n]})}),st("div",{class:"stack-item-section",children:r&&a&&st("div",{className:"stats-filter",children:st(Bi,{id:"sbs-period",options:r.map((function(t){return{label:"uk"===e.translateService.language?t.name:t.name_en,value:t}})),value:a,closeIcon:!1,onChange:function(t){return e.handlePeriodClick(t)}})})}),s&&st("div",{className:"stack-item-section",children:st("div",{className:"stats-summary-wrap",children:[st("div",{className:"stats-summary-row",children:[st("div",{className:"stats-summary-col",children:[st("h3",{children:s.summary.totalTargetsHit}),st("p",{children:st(gt,{children:"stats.total-targets"})})]}),st("div",{className:"stats-summary-col",children:[st("h3",{children:s.summary.totalTargetsDestroyed}),st("p",{children:st(gt,{children:"stats.total-destroyed"})})]})]}),st("div",{className:"stats-summary-row",children:[st("div",{className:"stats-summary-col",children:[st("h3",{children:s.summary.totalPersonnelCasualties}),st("p",{children:st(gt,{children:"stats.personnel"})})]}),st("div",{className:"stats-summary-col",children:[st("h3",{children:s.summary.personnelKilled}),st("p",{children:st(gt,{children:"stats.total-destroyed"})})]}),st("div",{className:"stats-summary-col",children:[st("h3",{children:s.summary.personnelWounded}),st("p",{children:st(gt,{children:"stats.total-wounded"})})]})]})]})}),st("div",{className:"stack-item-section",children:st("a",{href:"/arcade",target:"_blank",className:"deep-strike-link",children:st("img",{src:"/images/deep-strike-arcade.webp",alt:"Deep Strike Arcade"})})}),st("div",{className:"stack-item-section",children:st("div",{className:"sbs-join-jumbo",children:[st("div",{className:"jumbo-header",children:[st("div",{className:"jumbo-logo",children:st("svg",{viewBox:"0 0 201 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:st("path",{d:"M100 10L29.3525 55.0493V145.148L100 190.197L170.648 145.148V55.0493L100 10ZM149.024 149.221H117.136L100 169.35L82.8645 149.221H50.9761V50.3196L75.3273 71.222V119.996L65.2781 128.705H87.8896V39.0938L100 27.0946L112.111 39.0938V128.706H134.722L124.673 119.997V71.2231L149.024 50.3207V149.222V149.221Z"})})}),st("div",{className:"jumbo-title",style:{whiteSpace:"pre-line"},children:st(gt,{children:"stats.jumbo-title"})})]}),st("div",{className:"jumbo-cta-row",children:[st("div",{className:"jumbo-cta-text",style:{whiteSpace:"pre-line"},children:st(gt,{children:"stats.jumbo-cta"})}),st("a",{href:"https://usforces.army/?utm_source=deepstatemap",target:"_blank",className:"jumbo-cta-button",children:st(gt,{children:"stats.jumbo-cta-button"})})]})]})}),s&&st("div",{className:"stack-item-section",children:[st("div",{className:"stats-table",children:[st("div",{className:"stats-table-row stats-table-header-row",children:[st("div",{className:"stats-table-row-value-1",children:st(gt,{children:"stats.table-header-hit"})}),st("div",{className:"stats-table-row-value-2",children:st(gt,{children:"stats.table-header-destroyed"})})]}),st("div",{className:"stats-table-row",children:[st("div",{className:"stats-table-row-icon",children:st("img",{src:"/images/stats/sbs/class_0.svg",alt:""})}),st("div",{className:"stats-table-row-title",children:st(gt,{children:"stats.personnel"})}),st("div",{className:"stats-table-row-value-1",children:s.summary.totalPersonnelCasualties}),st("div",{className:"stats-table-row-value-2",children:s.summary.personnelKilled})]}),this.getOrderedTargets().map((function(t){return t&&st("div",{className:"stats-table-row",children:[st("div",{className:"stats-table-row-icon",children:st("img",{src:"/images/stats/sbs/class_".concat(t.targetClassId,".svg"),alt:""})}),st("div",{className:"stats-table-row-title",children:e.translateService.translate("stats.target-classes."+t.targetClassId)}),st("div",{className:"stats-table-row-value-1",children:t.hit}),st("div",{className:"stats-table-row-value-2",children:t.destroyed})]})}))]}),st("div",{className:"stats-copyright",children:[st(gt,{children:"stats.footer-last-updated"}
1)," ",new Date(1e3*s.updatedAt).toLocaleString(),st("br",{}),st(gt,{children:"stats.footer-source-prefix"})," ",st("a",{href:"https://sbs-group.army/?utm_source=deepstate",target:"_blank",children:st(gt,{children:"stats.footer-source-text"})})]})]})]})}}]),t}(y),ji={crimea:27e3,luhansk:8412,donetsk:8566,total:43978},Wi=[{key:"day",labelKey:"stats.territories.preset-day",getTargetTs:function(){return Date.now()/1e3-86400}},{key:"week",labelKey:"stats.territories.preset-week",getTargetTs:function(){return Date.now()/1e3-604800}},{key:"month",labelKey:"stats.territories.preset-month",getTargetTs:function(){return Date.now()/1e3-2592e3}},{key:"ytd",labelKey:"stats.territories.preset-ytd",getTargetTs:function(){return new Date((new Date).getFullYear(),0,1).getTime()/1e3}},{key:"year",labelKey:"stats.territories.preset-year",getTargetTs:function(){return Date.now()/1e3-31536e3}}];function zi(e){var t=e<0?"-":"",i=te(Math.abs(e).toFixed(2).split("."),2),n=i[0],r=i[1],a=n.replace(/\B(?=(\d{3})+(?!\d))/g," ");return"".concat(t).concat(a,".").concat(r)}var Zi=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"areaCache",new Map),e.translateService=window.translateService,e.statsService=new Ui,e.historyService=new ht,e.state={loading:!1,loaded:!1,period:"month",range:{from:null,to:null},areas:[]},e.loadRevisions().then().catch(),e}var i,n;return K(t,e),Y(t,[{key:"fetchAreaData",value:(n=z(G().mark((function e(t){var i;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.areaCache.has(t)){e.next=2;break}return e.abrupt("return",this.areaCache.get(t));case 2:return e.next=4,this.statsService.fetchAreasByRegion(t);case 4:return i=e.sent,this.areaCache.set(t,i),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"findClosestRevision",value:function(e,t){return e.reduce((function(e,i){return Math.abs(i.id-t)<Math.abs(e.id-t)?i:e}))}},{key:"loadRevisions",value:(i=z(G().mark((function e(){var t,i,n=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({loading:!0,error:void 0}),e.prev=1,e.next=4,this.historyService.fetchHistoryVersions();case 4:t=e.sent,i=t.filter((function(e){return e.status})).sort((function(e,t){return e.id-t.id})),this.setState({revisions:i,loaded:!0},(function(){n.handlePresetChange(n.state.period)})),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),this.setState({error:e.t0.message,loading:!1});case 12:case"end":return e.stop()}}),e,this,[[1,9]])}))),function(){return i.apply(this,arguments)})},{key:"loadAreas",value:function(e,t){var i=this;e&&t&&(this.setState({loading:!0}),Promise.all([this.fetchAreaData(e),this.fetchAreaData(t)]).then((function(n){for(var r=te(n,2),a=r[0],s=r[1],o=[],l=0,c=Object.keys(a);l<c.length;l++){var u,d=c[l],h=a[d],p=s[d],v=null!==(u=ji[d])&&void 0!==u?u:0,f=p.area_total>0?Number((100*v/p.area_total).toFixed(2)):0;o.push({name:d,area_occupied:p.area_occupied,percent_occupied:p.percent_occupied,diff:{area_occupied:Number((h.area_occupied-p.area_occupied).toFixed(2)),percent_occupied:Number((h.percent_occupied-p.percent_occupied).toFixed(2))},prewar:{area_occupied:v,percent_occupied:f}})}o.sort((function(e,t){var i=0!==e.diff.area_occupied,n=0!==t.diff.area_occupied;return i&&!n?-1:!i&&n?1:Math.abs(t.diff.area_occupied)-Math.abs(e.diff.area_occupied)})),i.setState({areas:o,range:{from:e,to:t},loading:!1})})).catch((function(e){i.setState({error:e.message,loading:!1})})))}},{key:"handlePresetChange",value:function(e){if(this.setState({period:e}),"custom"!==e){var t=this.state.revisions;if(t){var i,n=Wi.find((function(t){return t.key===e})),r=t[t.length-1],a=this.findClosestRevision(t,n.getTargetTs());if(a.id===r.id)a=null!==(i=t[t.length-2])&&void 0!==i?i:a;this.loadAreas(a.id,r.id)}}}},{key:"handleCustomRevisionChange",value:function(e,t){var i=V(V({},this.state.range),{},J({},e,t.id));this.setState({range:i});var n=i.from,r=i.to;n&&r&&this.loadAreas(n,r)}},{key:"formatRevisionDate",value:function(e){return Zt(new Date(1e3*e.id).toString())}},{key:"renderTotalCard",value:function(){var e=this.state.areas.find((function(e){return"total"===e.name}));if(e){var t=e.percent_occupied,i=e.area_occupied,n=e.prewar.percent_occupied,r=e.prewar.area_occupied,a=e.diff.percent_occupied,s=e.diff.area_occupied;return st("div",{class:"territory-card card-total",children:[st("div",{class:"territory-card-header",children:this.translateService.translate("stats.territories.total")}),st("div",{class:"territory-card-grid",children:[st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-total"})}),st("div",{class:"territory-col-value",children:[t,"%"]}),st("div",{class:"territory-col-km",children:[zi(i)," км²"]})]}),st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-prewar"})}),st("div",{class:"territory-col-value",children:[n,"%"]}),st("div",{class:"territory-col-km",children:[zi(r)," км²"]})]}),st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-period"})}),st("div",{class:St({"territory-col-value":!0,"territory-diff-positive":null!==a&&a>0,"territory-diff-negative":null!==a&&a<0}),children:null!==a?(a>0?"+":"")+a+"%":"—"}),st("div",{class:"territory-col-km",children:null!==s?(s>
10?"+":"")+zi(s)+" км²":"—"})]})]})]})}}},{key:"render",value:function(){var e,t,i=this,n=this.state,r=n.loading,a=n.loaded,s=n.error,o=n.revisions,l=n.period,c=n.range,u=null!==(e=null==o?void 0:o.find((function(e){return e.id===c.from})))&&void 0!==e?e:null,d=null!==(t=null==o?void 0:o.find((function(e){return e.id===c.to})))&&void 0!==t?t:null;if(r&&!a)return st("div",{class:"stack-item-section",children:st(yt,{})});if(s)return st("div",{class:"stack-item-section",children:st("div",{class:"section-error",children:["Error: ",s]})});var h=Wi.map((function(e){return{label:i.translateService.translate(e.labelKey),value:e.key}})),p=o?ie(o).reverse().filter((function(e){return!c.from||e.id>c.from})).map((function(e){return{label:i.formatRevisionDate(e),value:e}})):[],v=o?ie(o).reverse().filter((function(e){return!c.to||e.id<c.to})).map((function(e){return{label:i.formatRevisionDate(e),value:e}})):[];return st("div",{children:[st("div",{class:"stack-item-section",children:o&&st("div",{class:"territories-filter",children:[st(Bi,{id:"territories",options:h,value:l,closeIcon:!1,onChange:function(e){return i.handlePresetChange(e)}}),"custom"===l&&st("div",{class:"territories-custom-pickers",children:[st("div",{class:"territories-custom-picker",children:[st("label",{class:"territories-custom-label",children:st(gt,{children:"stats.territories.custom-from"})}),st(Bi,{id:"territories-from-custom",options:v,value:null!=u?u:null,closeIcon:!1,searchable:!0,placeholder:st(g,{children:[st("span",{class:"territories-custom-label",children:this.translateService.translate("stats.territories.custom-from")}),"—"]}),labelTemplate:function(e){return st(g,{children:e.label})},onChange:function(e){return i.handleCustomRevisionChange("from",e)}})]}),st("div",{class:"territories-custom-picker",children:[st("label",{class:"territories-custom-label",children:st(gt,{children:"stats.territories.custom-to"})}),st(Bi,{id:"territories-to-custom",options:p,value:null!=d?d:null,closeIcon:!1,searchable:!0,placeholder:st(g,{children:[st("span",{class:"territories-custom-label",children:this.translateService.translate("stats.territories.custom-to")}),"—"]}),labelTemplate:function(e){return st(g,{children:e.label})},onChange:function(e){return i.handleCustomRevisionChange("to",e)}})]})]})]})}),r&&st("div",{class:"stack-item-section",children:st(yt,{})}),this.state.areas.length>0&&st("div",{class:"stack-item-section territory-cards",children:[this.renderTotalCard(),st("div",{className:"width: 100%; height: 2px; display: flex; align-items: center; margin: 14px 0;",children:st("div",{className:"width: 30%; height: 2px; background-color: e5e7eb;"})}),this.state.areas.filter((function(e){return"total"!==e.name})).map((function(e){return st("div",{class:"territory-card",children:[st("div",{class:"territory-card-header",children:i.translateService.translate("stats.territories.".concat(e.name))}),st("div",{class:"territory-card-grid",children:[st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-total"})}),st("div",{class:"territory-col-value",children:[e.percent_occupied,"%"]}),st("div",{class:"territory-col-km",children:[zi(e.area_occupied)," км²"]})]}),st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-prewar"})}),st("div",{class:"territory-col-value",children:[e.prewar.percent_occupied,"%"]}),st("div",{class:"territory-col-km",children:[zi(e.prewar.area_occupied)," км²"]})]}),st("div",{class:"territory-col",children:[st("div",{class:"territory-col-label",children:st(gt,{children:"stats.territories.col-period"})}),st("div",{class:St({"territory-col-value":!0,"territory-diff-positive":null!==e.diff.percent_occupied&&e.diff.percent_occupied>0,"territory-diff-negative":null!==e.diff.percent_occupied&&e.diff.percent_occupied<0}),children:null!==e.diff.percent_occupied?(e.diff.percent_occupied>0?"+":"")+e.diff.percent_occupied+"%":"—"}),st("div",{class:"territory-col-km",children:null!==e.diff.area_occupied?(e.diff.area_occupied>
10?"+":"")+zi(e.diff.area_occupied)+" км²":"—"})]})]})]})}))]})]})}}]),t}(y),qi=function(e){function t(){var e;return Z(this,t),(e=U(this,t)).state={activeTab:"territories"},e}return K(t,e),Y(t,[{key:"render",value:function(){var e=this,t=this.state.activeTab;return st("div",{class:"sidebar-stack-item sidebar-stats",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"stats.title"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stats-tabs",children:[st("button",{class:St({"stats-tab":!0,active:"territories"===t}),onClick:function(){return e.setState({activeTab:"territories"})},children:st(gt,{children:"stats.tab-territories"})}),st("button",{class:St({"stats-tab":!0,active:"sbs"===t}),onClick:function(){return e.setState({activeTab:"sbs"})},children:st(gt,{children:"stats.tab-sbs"})})]}),st("div",{className:"stack-item-body",children:["sbs"===t&&st(Gi,{}),"territories"===t&&st(Zi,{}),"assault"===t&&st("div",{class:"stack-item-section stats-tab-placeholder",children:"Незабаром"})]})]})}}]),t}(y);function Yi(e,t){return e?Object.values(e):t}var Ji,Ki=function(e){var t=window.translateService,i=t.translate("calendar.days"),n=t.translate("calendar.months"),r=Yi(i,["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),a=Yi(n,["January","February","March","April","May","June","July","August","September","October","November","December"]),s=e.value,o=e.min,l=e.max,c=new Date,u=te(ke(s),2),d=u[0],h=u[1],p=te(ke(d),2),v=p[0],f=p[1],m=te(ke(!0),2),y=m[0],b=m[1];we((function(){return h(e.value)}),[e.value]);var k=function(e,t){for(var i=e.getFullYear(),n=t.getFullYear(),r=[],a=i;a<=n;a++)r.push(a);return r}(o,l),w=function(e,t){var i=e.getFullYear()===v.getFullYear(),n=e.getMonth()===v.getMonth(),r=e.getDate()===t;return!!i&&!!n&&!!r},C=function(t){var i=new Date(v.getFullYear(),v.getMonth(),t);return i>=e.min&&i<=e.max},S=new Date(v.getFullYear(),v.getMonth()+1,0).getDate(),_=function(e){var t=new Date(v.getFullYear(),v.getMonth()+e,1);f(t)},E=function(e){return function(){var t=e-v.getMonth();_(t),b(!0)}},L=function(t,i){return function(){if(!i){var n=new Date(v.getFullYear(),v.getMonth(),t);f(n),h(n),e.onSelectDay(n)}}},x=function(e){return function(){var t=new Date(e,v.getMonth(),v.getDate());f(t)}};return st("div",{class:"calendar",children:[st("div",{class:"calendar-controls",children:[st("div",{class:"header",onClick:function(){b(!y)},children:[st("span",{children:[" ",a[v.getMonth()]]}),st("span",{children:[" ",v.getFullYear()," "]}),st("span",{class:"material-symbols-outlined",children:y?"arrow_drop_down":"arrow_drop_up"})]}),st("div",{class:"navigation",children:[st("button",{onClick:function(e){e.stopPropagation(),_(-1)},class:"navigation-btn",children:st("span",{class:"material-symbols-outlined",children:"arrow_left_alt"})}),st("button",{onClick:function(e){e.stopPropagation(),_(1)},class:"navigation-btn",children:st("span",{class:"material-symbols-outlined",children:"arrow_right_alt"})})]})]}),st(g,y?{children:[st("table",{role:"grid",class:"calendar-picker",children:[st("thead",{children:st("tr",{class:"days-header",children:r.map((function(e){return st("th",{scope:"col",class:"cell day-cell",children:[" ",st("span",{children:e})]})}))})}),st("tbody",{children:[" ",function(){for(var t,i,n=[],r=[],a=0;a<(t=v.getMonth(),i=v.getFullYear(),(new Date(i,t,1).getDay()+6)%7);a++)r.push(st("td",{class:"cell"}));for(var s=1;s<=S;s++){var o=r.length+1;r.push(st("td",{class:St({cell:!0,disabled:!C(s),today:w(c,s),current:w(d,s)}),children:[st("span",{class:"cell-text",onClick:L(s,!C(s)),children:s}),w(e.max,s)?st("span",{class:"history-point"}):""]})),o%7==0&&(n.push(st("tr",{children:r})),r=[])}return r.length>0&&n.push(st("tr",{children:r})),n}()]})]}),st("div",{class:"footer",children:st("button",{type:"button",class:"btn-today",onClick:function(t){t.stopPropagation(),f(e.max),h(e.max),e.onSelectDay(e.max)},children:[t.translate("calendar.today")||"Today"," "]})})]}:{children:st("div",{class:"other-picker",children:[st("div",{class:"years",children:k.map((function(e){return st("span",{onClick:x(e),class:St({cell:!0,active:e===v.getFullYear()}),children:e})}))}),st("div",{class:"months",children:a.map((function(e,t){return st("span",{onClick:E(t),class:St({cell:!0,active:t===v.getMonth()}),children:e})}))})]})})]})},Xi=function(e){function t(){var e;return Z(this,t),(e=U(this,t)).state={minDate:new Date(2022,3,3),maxDate:qe((function(){return new Date(1e3*ft.value.latestRevisionId.value)}
1)).value,current:new Date},e}return K(t,e),Y(t,[{key:"onSelectCalendar",value:function(e){var t=window.revisionsController;t.revisions().then((function(i){var n=Zt(e.toString()),r=i.findIndex((function(e){return Zt(new Date(1e3*e.id).toString())===n}));if(-1!==r){var a=i[r];t.selectRevision(a.id)}}))}},{key:"render",value:function(){var e=this;return st("div",{class:"sidebar-stack-item sidebar-calendar",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.calendar"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section",children:st(Ki,{onSelectDay:function(t){return e.onSelectCalendar(t)},value:ft.value.currentRevisionDate.value,min:this.state.minDate,max:this.state.maxDate})})]})}}]),t}(y),Qi=function(e){function t(){return Z(this,t),U(this,t)}return K(t,e),Y(t,[{key:"render",value:function(){var e=this;return st("div",{className:"sidebar-stack-item sidebar-trenches-legend",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"defenceStructures.title"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{className:"stack-item-body",children:st("div",{class:"stack-item-section",children:st("div",{class:"sidebar-info-legend",children:[st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #56FFFF4d; border: 2px solid #56FFFF;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"defenceStructures.teeth"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #FF56014d; border: 2px solid #FF5601;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"defenceStructures.trenches"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #FFFF004d; border: 2px solid #FFFF00;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"defenceStructures.moats"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #FF56FE4d; border: 2px solid #FF56FE;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"defenceStructures.caponiers"})})]}),st("div",{class:"sidebar-info-legend-item",children:[st("div",{class:"sidebar-info-legend-box",style:"background-color: #0000004d; border: 2px solid #000000;"}),st("div",{class:"sidebar-info-legend-label",children:st(gt,{children:"defenceStructures.other"})})]})]})})})]})}}]),t}(y),$i=function(e){function t(){var e;return Z(this,t),(e=U(this,t)).translatesController=window.translatesController,e.featuresController=window.featuresController,e}return K(t,e),Y(t,[{key:"render",value:function(){var e=this;return st("div",{className:"sidebar-stack-item sidebar-mobile-tools",children:[st("div",{class:"stack-item-header",children:[st("h1",{class:"stack-item-title",children:st(gt,{children:"features.tools"})}),st("div",{class:"stack-item-dismiss",onClick:function(){return e.props.dismissSelf()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"stack-item-section sidebar-mobile-tools-items",children:[st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("stats")},children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"insert_chart"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.stats"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]}),st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("weather")},children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"cloud"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.weather"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]}),st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("nuclear")},children:[st("div",{class:"icon-toggle-icon",children:st("svg",{width:"20",height:"21",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.20007 12.0001C5.20007 11.5582 5.55825 11.2001 6.00007 11.2001H12.5001C12.9419 11.2001 13.3001 11.5582 13.3001 12.0001C13.3001 12.4419 12.9419 12.8001 12.5001 12.8001H6.00007C5.55825 12.8001 5.20007 12.4419 5.20007 12.0001Z",fill:"#33334E"}
1),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.47782 1.43162C7.12671 0.794034 8.01655 0.400024 9.00002 0.400024C9.9835 0.400024 10.8733 0.794034 11.5222 1.43162C11.6787 1.41078 11.8382 1.40002 12 1.40002C13.4517 1.40002 14.7027 2.25929 15.2722 3.49696C16.6107 3.84011 17.6 5.05453 17.6 6.50002C17.6 8.21211 16.2121 9.60002 14.5 9.60002H3.50002C1.78794 9.60002 0.400024 8.21211 0.400024 6.50002C0.400024 5.05453 1.38937 3.84011 2.72786 3.49696C3.29732 2.25929 4.54833 1.40002 6.00002 1.40002C6.16182 1.40002 6.32133 1.41078 6.47782 1.43162ZM6.17071 3.00721C6.5173 3.0365 6.83871 3.15417 7.11233 3.33761C7.22554 3.01497 7.41914 2.73013 7.6691 2.50714C8.02265 2.19172 8.48895 2.00002 9.00002 2.00002C9.5111 2.00002 9.9774 2.19172 10.3309 2.50713C10.5809 2.73013 10.7745 3.01496 10.8877 3.33761C11.1613 3.15418 11.4828 3.0365 11.8293 3.00721C11.8856 3.00245 11.9425 3.00002 12 3.00002C13.1046 3.00002 14 3.89545 14 5.00002H14.5C15.3285 5.00002 16 5.6716 16 6.50002C16 7.32845 15.3285 8.00002 14.5 8.00002H3.50002C2.6716 8.00002 2.00002 7.32845 2.00002 6.50002C2.00002 5.6716 2.6716 5.00002 3.50002 5.00002H4.00002C4.00002 3.89545 4.89545 3.00002 6.00002 3.00002C6.05752 3.00002 6.11444 3.00245 6.17071 3.00721Z",fill:"#33334E"}),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.50007 8.20007C8.9419 8.20007 9.30007 8.55825 9.30007 9.00007V14.0001C9.30007 14.7598 9.01521 15.8365 8.18714 16.731C7.33753 17.6488 5.98633 18.3001 4.00007 18.3001C3.55825 18.3001 3.20007 17.9419 3.20007 17.5001C3.20007 17.0582 3.55825 16.7001 4.00007 16.7001C5.61381 16.7001 6.51262 16.1847 7.013 15.6441C7.53493 15.0803 7.70007 14.4071 7.70007 14.0001V9.00007C7.70007 8.55825 8.05825 8.20007 8.50007 8.20007Z",fill:"#33334E"}),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 8.20007C9.55822 8.20007 9.20005 8.55825 9.20005 9.00007V14.0001C9.20005 14.7598 9.48491 15.8365 10.313 16.731C11.1626 17.6488 12.5138 18.3001 14.5 18.3001C14.9419 18.3001 15.3 17.9419 15.3 17.5001C15.3 17.0582 14.9419 16.7001 14.5 16.7001C12.8863 16.7001 11.9875 16.1847 11.4871 15.6441C10.9652 15.0803 10.8 14.4071 10.8 14.0001V9.00007C10.8 8.55825 10.4419 8.20007 10 8.20007Z",fill:"#33334E"})]})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.nuclear"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]}),st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("arty")},children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"crisis_alert"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.arty"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]}),st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("firms")},children:[st("div",{class:"icon-toggle-icon",children:st("span",{class:"material-symbols-outlined",children:"local_fire_department"})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.fires"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]}),st("div",{class:"icon-toggle-row hoverable",onClick:function(){return e.featuresController.enableFeatureById("seb")},children:[st("div",{class:"icon-toggle-icon",children:st("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:[st("path",{stroke:"none","fill-rule":"nonzero",d:"M 5.707031 1.796875 C 4.417969 2.597656 3.339844 3.582031 2.429688 4.78125 C 0.929688 6.753906 0.09375 9.117188 0.0078125 11.625 L -0.00390625 12 L 8.398438 12 L 8.398438 11.914062 C 8.398438 11.867188 8.410156 11.75 8.421875 11.648438 C 8.539062 10.554688 9.121094 9.589844 10.023438 9 L 10.199219 8.882812 L 10.144531 8.785156 C 8.785156 6.417969 6.011719 1.640625 5.996094 1.636719 C 5.984375 1.636719 5.851562 1.707031 5.707031 1.796875 Z M 5.707031 1.796875 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 17.507812 2.460938 C 16.75 3.773438 13.816406 8.859375 13.808594 8.871094 C 13.804688 8.878906 13.871094 8.925781 13.953125 8.980469 C 14.757812 9.507812 15.335938 10.355469 15.523438 11.277344 C 15.5625 11.484375 15.601562 11.78125 15.601562 11.914062 L 15.601562 12 L 24.003906 12 L 23.992188 11.628906 C 23.949219 10.410156 23.742188 9.257812 23.359375 8.148438 C 22.511719 5.664062 20.878906 3.53125 18.683594 2.050781 C 18.363281 1.835938 18.035156 1.632812 18.003906 1.632812 C 17.996094 1.632812 17.769531 2.003906 17.507812 2.460938 Z M 17.507812 2.460938 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 11.671875 9.628906 C 10.40625 9.804688 9.484375 10.96875 9.617188 12.21875 C 9.675781 12.804688 9.902344 13.277344 10.3125 13.6875 C 10.722656 14.097656 11.195312 14.324219 11.777344 14.382812 C 12.453125 14.453125 13.15625 14.207031 13.65625 13.726562 C 14.535156 12.878906 14.644531 11.535156 13.914062 10.558594 C 13.398438 9.867188 12.527344 9.507812 11.671875 9.628906 Z M 11.671875 9.628906 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 9.246094 16.769531 C 5.871094 22.613281 6.011719 22.371094 6.039062 22.398438 C 6.085938 22.4375 6.648438 22.734375 6.964844 22.878906 C 8.238281 23.472656 9.511719 23.8125 10.96875 23.957031 C 11.4375 24 12.554688 24 
113.03125 23.953125 C 14.460938 23.816406 15.746094 23.476562 17.007812 22.894531 C 17.277344 22.769531 17.875 22.457031 17.945312 22.40625 L 17.988281 22.371094 L 15.964844 18.871094 C 14.855469 16.941406 13.910156 15.308594 13.871094 15.242188 L 13.800781 15.117188 L 13.578125 15.226562 C 13.195312 15.414062 12.789062 15.53125 12.351562 15.578125 C 11.71875 15.648438 11.011719 15.519531 10.417969 15.226562 L 10.199219 15.121094 Z M 9.246094 16.769531 "})]})}),st("div",{class:"icon-toggle-label",children:st(gt,{children:"features.radiation"})}),st("div",{class:"icon-toggle-button-wrap",children:st("button",{class:"icon-toggle-button",children:st("span",{class:"material-symbols-outlined",children:"arrow_forward"})})})]})]})]})}}]),t}(y),en=function(e){function t(e){var i;return Z(this,t),(i=U(this,t)).setState({updatedAt:0,featureStackSignals:{},hideSearchPager:!1}),e.featuresController.featuresListUpdatedSignal.subscribe((function(t){i.setState({updatedAt:t,featureStackSignals:e.featuresController.getFeatureSignals()})})),i}return K(t,e),Y(t,[{key:"render",value:function(e){var t,i,n,r,a,s,o,l,c,u,d,h,p,v,f,m,g=this;if(window.matchMedia("only screen and (max-width: 639px)").matches)return st("div",{class:"sidebar__container"});var y=[nt.features.INFO,nt.features.RETICLE,nt.features.CALENDAR,nt.features.UPDATES],b=Object.entries(this.state.featureStackSignals).filter((function(e){return!1===y.includes(e[0])&&!0===e[1].value})).length>0;return st("div",{class:"sidebar__container",children:[st(mi,{slim:this.state.hideSearchPager||b,hideHistoryPager:function(e){return g.setState({hideSearchPager:e})}}),st(Si,{hidden:b}),!0===(null===(t=this.state.featureStackSignals[nt.features.LANGUAGE])||void 0===t?void 0:t.value)?st(lt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.LANGUAGE)}}):null,!0===(null===(i=this.state.featureStackSignals[nt.features.UPDATES])||void 0===i?void 0:i.value)?st(Jt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.UPDATES)}}):null,!0===(null===(n=this.state.featureStackSignals[nt.features.INFO])||void 0===n?void 0:n.value)?st(bt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.INFO)}}):null,!0===(null===(r=this.state.featureStackSignals[nt.features.SETTINGS])||void 0===r?void 0:r.value)?st(Rt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.SETTINGS)}}):null,!0===(null===(a=this.state.featureStackSignals[nt.features.ONBOARDING])||void 0===a?void 0:a.value)&&st(Ti,{overlay:!0,dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.ONBOARDING)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.ONBOARDING)}),!0===(null===(s=this.state.featureStackSignals[nt.features.MOBILE_APPS])||void 0===s?void 0:s.value)?st($i,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.MOBILE_APPS)}}):null,!0===(null===(o=this.state.featureStackSignals[nt.features.RULER])||void 0===o?void 0:o.value)?st(Pt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.RULER)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.RULER)}):null,!0===(null===(l=this.state.featureStackSignals[nt.features.DRAW])||void 0===l?void 0:l.value)?st(Bt,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.DRAW)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.DRAW)}):null,!0===(null===(c=this.state.featureStackSignals[nt.features.ARTY])||void 0===c?void 0:c.value)?st(_i,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.ARTY)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.ARTY)}):null,!0===(null===(u=this.state.featureStackSignals[nt.features.FIRMS])||void 0===u?void 0:u.value)?st(Ei,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.FIRMS)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.FIRMS)}):null,!0===(null===(d=this.state.featureStackSignals[nt.features.RADIATION])||void 0===d?void 0:d.value)?st(Li,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.RADIATION)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.RADIATION)}):null,!0===(null===(h=this.state.featureStackSignals[nt.features.NUCLEAR])||void 0===h?void 0:h.value)?st(Mi,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.NUCLEAR)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.NUCLEAR)}):null,!0===(null===(p=this.state.featureStackSignals[nt.features.WEATHER])||void 0===p?void 0:p.value)?st(Oi,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.WEATHER)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.WEATHER)}):null,(null===(v=this.state.featureStackSignals[nt.features.CALENDAR])||void 0===v?void 0:v.value)&&st(Xi,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.CALENDAR)},eventEmitter:e.featuresController.getEventEmitterByFeatureId(nt.features.CALENDAR)}),(null===(f=this.state.featureStackSignals[nt.features.TRENCHES_LEGEND])||void 0===f?void 0:f.value)&&st(Qi,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.TRENCHES_LEGEND)}}),(null===(m=this.state.featureStackSignals[nt.features.STATS])||void 0===m?void 0:m.value)&&st(qi,{dismissSelf:function(){return e.featuresController.disableFeatureById(nt.features.STATS)}})]})}}]),t}(y),tn=function(e){return st("a",{href:"/2025",className:e.styleClass,children:st("img",{class:"swing",style:e.imageStyle,src:"/images/christmas-ball.webp",alt:"Front wall"})})},nn=function(e){var t=te(ke(null),2),i=t[0],n=t[1];return we((function(){!function e(){window.featuresController?n(window.featuresController):setTimeout(e,100)}()}),[]),st(g,{children:(null==i?void 0:i.listenFeatureFlag(e.flag).value)&&st(g,{children:e.children})})},rn=function(e){function t(){var e;Z(this,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return J($(e=U(this,t,[].concat(n))),"translateService",window.translateService),J($(e),"writeOnEmail",(function(){window.open(atob("ZXZpbC5wYW1ldGF0c3BlZWRAb2ZuaTpvdGxpYW0=").split("").reverse().join(""),"_blank")})),J($(e),"enableLanguageToggle",(function(){var e;window.featuresController.enableFeatureById(nt.features.LANGUAGE),null===(e=document.querySelector(".drawer-backdrop"))||void 0===e||e.classList.toggle("shown")})),J($(e),"getLicenseLink",(function(){return"uk"===e.translateService.language?"https://deepstatemap.live/license.html":"https://deepstatemap.live/license-en.html"})),e}return K(t,e),Y(t,[{key:"render",value:function(){var e=this;return st("div",{class:"drawer",children:[st("div",{class:"drawer
1-header",children:[st("div",{class:"site-logo",children:st("svg",{width:"77",height:"36",viewBox:"0 0 77 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.4545 1.11519C10.9846 1.76884 11.9704 2.87911 12.6454 3.58285C14.2951 5.30253 16.7469 8.34013 17.2474 9.28405C17.5609 9.87519 17.5262 10.2302 17.0959 10.8378C16.5366 11.6274 15.1013 11.9382 15.1013 11.2695C15.1013 10.6564 13.0187 9.81487 11.63 9.86642C10.7887 9.89786 10.0102 9.6595 9.50712 9.21715L8.71275 8.51816L8.98148 9.96768C9.38402 12.1385 10.0727 13.2085 12.2554 15.0525C14.654 17.0793 16.1954 19.7466 16.466 22.3389C16.6394 23.9982 16.534 24.4552 15.699 25.6719C15.1671 26.4472 14.7317 27.2109 14.7317 27.3685C14.7317 27.5264 15.2351 28.0382 15.8502 28.5058C19.0635 30.9479 18.9851 30.8521 18.5416 31.8147C18.2895 32.362 18.2562 32.9151 18.4569 33.2284C18.638 33.5113 18.7889 34.116 18.7922 34.5719L18.7977 35.4006C18.7977 35.4006 18.6099 35.3988 9.46424 35.303C0.318528 35.2072 1.34494 35.303 0.0205967 35.303C-0.0400248 34.8833 0.00878906 33.75 0.491891 33.2017C1.02048 32.7677 1.01937 32.6654 0.480432 32.0761C0.0124644 31.5646 -0.0259782 31.2667 0.298938 30.666C0.525899 30.2471 0.804116 30.0414 1.00126 29.9045C1.13379 29.8125 1.98229 29.3196 2.82693 28.6045C4.43857 27.2406 4.46001 26.8073 2.99548 25.2313C2.71825 24.9334 2.52826 23.6835 2.52049 22.11C2.51347 20.6664 2.24511 18.1694 1.92426 16.5609C0.716266 10.5055 0.798326 9.00219 2.46985 6.54075C3.64753 4.80608 5.55157 3.41103 7.37428 2.94711C8.4869 2.66378 8.64585 2.47039 8.74713 1.27678C8.88833 -0.381856 9.21547 -0.412564 10.4545 1.11519Z",fill:"#33334E"}),st("path",{d:"M61.04 10.6776H58.0935V8.2749H61.04C61.4487 8.2749 61.7816 8.18262 62.0387 7.99805C62.3024 7.81348 62.4935 7.55969 62.6122 7.23669C62.7308 6.9071 62.7902 6.53796 62.7902 6.12927C62.7902 5.71399 62.7275 5.32837 62.6023 4.97241C62.4836 4.60986 62.2958 4.31653 62.0387 4.09241C61.7882 3.86829 61.4553 3.75623 61.04 3.75623H59.0229V15.75H56.1357V1.35352H61.04C62.009 1.35352 62.8429 1.55786 63.5416 1.96655C64.2404 2.37524 64.7743 2.93884 65.1434 3.65735C65.5192 4.36926 65.707 5.18665 65.707 6.1095C65.707 7.03894 65.5192 7.84644 65.1434 8.53198C64.7743 9.21094 64.2404 9.73828 63.5416 10.114C62.8429 10.4897 62.009 10.6776 61.04 10.6776Z",fill:"#33334E"}),st("path",{d:"M54.4449 13.3572V15.75H48.186V13.3572H54.4449ZM49.0858 1.35352V15.75H46.1887V1.35352H49.0858ZM53.6045 7.18726V9.51086H48.186V7.18726H53.6045ZM54.4252 1.35352V3.75623H48.186V1.35352H54.4252Z",fill:"#33334E"}),st("path",{d:"M44.4979 13.3572V15.75H38.239V13.3572H44.4979ZM39.1388 1.35352V15.75H36.2417V1.35352H39.1388ZM43.6575 7.18726V9.51086H38.239V7.18726H43.6575ZM44.4781 1.35352V3.75623H38.239V1.35352H44.4781Z",fill:"#33334E"}),st("path",{d:"M28.5491 15.75H26.0079L26.0277 13.3572H28.5491C29.2478 13.3572 29.7916 13.2319 30.1805 12.9814C30.5695 12.731 30.843 12.3354 31.0012 11.7949C31.166 11.2544 31.2484 10.5458 31.2484 9.66907V7.42456C31.2484 6.75879 31.2056 6.19519 31.1199 5.73376C31.0342 5.26575 30.8892 4.89001 30.6848 4.60657C30.4805 4.31653 30.2069 4.10229 29.8641 3.96387C29.5214 3.82544 29.0962 3.75623 28.5886 3.75623H25.9585V1.35352H28.5886C29.4192 1.35352 30.174 1.48865 30.8529 1.75891C31.5319 2.02917 32.1152 2.42468 32.603 2.94543C33.0908 3.45959 33.4666 4.0957 33.7302 4.85376C33.9939 5.61182 34.1257 6.47534 34.1257 7.44434V9.66907C34.1257 10.6447 33.9939 11.5082 33.7302 12.2596C33.4666 13.0111 33.0908 13.6472 32.603 14.168C32.1218 14.6821 31.5385 15.0743 30.8529 15.3446C30.1674 15.6149 29.3994 15.75 28.5491 15.75ZM27.6888 1.35352V15.75H24.7917V1.35352H27.6888Z",fill:"#33334E"}),st("path",{d:"M75.7035 32.4822V34.875H69.4446V32.4822H75.7035ZM70.3444 20.4785V34.875H67.4473V20.4785H70.3444ZM74.863 26.3123V28.6359H69.4446V26.3123H74.863ZM75.6837 20.4785V22.8812H69.4446V20.4785H75.6837Z",fill:"#33334E"}),st("path",{d:"M62.187 20.4785V34.875H59.3097V20.4785H62.187ZM65.7664 20.4785V22.8812H55.7996V20.4785H65.7664Z",fill:"#33334E"}),st("path",{d:"M50.7469 23.0493L47.6521 34.875H44.5968L49.0957 20.4785H51.004L50.7469 23.0493ZM53.1892 34.875L50.0746 23.0493L49.7878 20.4785H51.7258L56.2643 34.875H53.1892ZM53.298 29.506V31.9087H46.8018V29.506H53.298Z",fill:"#33334E"}
1),st("path",{d:"M41.4624 20.4785V34.875H38.5851V20.4785H41.4624ZM45.0417 20.4785V22.8812H35.075V20.4785H45.0417Z",fill:"#33334E"}),st("path",{d:"M30.8826 31.088C30.8826 30.8309 30.8595 30.5969 30.8134 30.386C30.7672 30.175 30.6683 29.9806 30.5167 29.8026C30.3717 29.6246 30.1575 29.4467 29.874 29.2687C29.5972 29.0907 29.2346 28.9061 28.7864 28.715C28.2524 28.4908 27.735 28.2535 27.234 28.0031C26.733 27.746 26.2815 27.4493 25.8794 27.1132C25.4773 26.777 25.1576 26.3815 24.9203 25.9266C24.6896 25.4652 24.5742 24.9247 24.5742 24.3051C24.5742 23.6986 24.683 23.1482 24.9005 22.6538C25.1246 22.1594 25.441 21.7375 25.8497 21.3882C26.2584 21.0322 26.7363 20.7587 27.2834 20.5675C27.8372 20.3763 28.4535 20.2808 29.1324 20.2808C30.0553 20.2808 30.8529 20.4719 31.5253 20.8542C32.2042 21.2366 32.7283 21.7606 33.0974 22.4264C33.4731 23.0922 33.661 23.8568 33.661 24.7203H30.7738C30.7738 24.3116 30.7145 23.9524 30.5958 23.6426C30.4838 23.3262 30.3025 23.079 30.052 22.901C29.8015 22.723 29.4785 22.634 29.083 22.634C28.7139 22.634 28.4073 22.7098 28.1635 22.8615C27.9261 23.0065 27.7482 23.2075 27.6295 23.4646C27.5175 23.7151 27.4614 23.9985 27.4614 24.3149C27.4614 24.5522 27.5175 24.7665 27.6295 24.9576C27.7482 25.1422 27.9097 25.3103 28.114 25.4619C28.3184 25.6069 28.559 25.7487 28.8358 25.8871C29.1193 26.0255 29.4291 26.1606 29.7653 26.2925C30.4178 26.5496 30.9946 26.833 31.4956 27.1428C31.9966 27.446 32.4152 27.7888 32.7513 28.1711C33.0875 28.5469 33.3413 28.972 33.5127 29.4467C33.6841 29.9213 33.7698 30.4618 33.7698 31.0682C33.7698 31.6681 33.6643 32.2152 33.4534 32.7096C33.249 33.1974 32.9491 33.6193 32.5536 33.9752C32.1581 34.3246 31.6802 34.5948 31.1199 34.786C30.5662 34.9772 29.9465 35.0728 29.261 35.0728C28.5952 35.0728 27.9657 34.9805 27.3724 34.7959C26.7792 34.6047 26.2551 34.318 25.8003 33.9357C25.3521 33.5468 24.9994 33.0557 24.7423 32.4624C24.4852 31.8625 24.3567 31.1539 24.3567 30.3365H27.2538C27.2538 30.7716 27.2966 31.144 27.3823 31.4539C27.468 31.7571 27.5999 32.001 27.7778 32.1855C27.9558 32.3635 28.1733 32.4987 28.4304 32.5909C28.6941 32.6766 28.994 32.7195 29.3302 32.7195C29.7125 32.7195 30.0157 32.647 30.2399 32.502C30.4706 32.3569 30.6354 32.1625 30.7343 31.9186C30.8331 31.6747 30.8826 31.3978 30.8826 31.088Z",fill:"#33334E"})]})}),st("div",{className:"flex-row gap-16",children:[st("div",{className:"language",onClick:this.enableLanguageToggle,children:st(ct,{code:this.translateService.language,radius:"20px"})}),st("div",{class:"dismiss-btn",children:st("span",{class:"material-symbols-outlined",children:" close "})})]})]}),st("div",{class:"drawer-socials",children:[st("a",{className:"social-item",href:"https://t.me/DeepStateUA",target:"_blank",children:st("img",{class:"image",src:"/images/icons/telegram.svg",alt:"DeepStateUA Telegram"})}),st("a",{className:"social-item",href:"https://www.youtube.com/@DeepStateUA",target:"_blank",children:st("img",{class:"image",src:"/images/icons/youtube.svg",alt:"DeepStateUA Youtube"})}),st("a",{className:"social-item",href:"https://www.facebook.com/deepstatemap",target:"_blank",children:st("img",{class:"image",src:"/images/icons/facebook.svg",alt:"DeepStateUA Facebook"})}),st("a",{className:"social-item",href:"https://twitter.com/Deepstate_UA",target:"_blank",children:st("img",{class:"image",src:"/images/icons/twitter.svg",alt:"DeepStateUA Twitter"})})]}),st("div",{class:"drawer-links",children:[st(nn,{flag:nt.features.CHRISTMAS,children:st("a",{class:"drawer-links-row",href:"/2025",children:[st("div",{class:"drawer-links-icon",children:st(tn,{})}),st("div",{class:"drawer-links-label",children:st(gt,{children:"features.christmas"})})]})}),st("a",{class:"drawer-links-row",href:"https://deepstateua.com",target:"_blank",children:[st("div",{class:"drawer-links-icon",children:st("span",{class:"material-symbols-outlined",children:"history_edu"})}),st("div",{class:"drawer-links-label",children:st(gt,{children:"drawer.blog"})})]}),st("a",{class:"drawer-links-row",href:"https://deepstateua.shop/",target:"_blank",children:[st("div",{class:"drawer-links-icon",children:st("span",{class:"material-symbols-outlined",children:"shopping_bag"})}
1),st("div",{class:"drawer-links-label",children:st(gt,{children:"drawer.shop"})})]}),st("a",{class:"drawer-links-row",href:"https://t.me/newsDeepStatebot",target:"blank",children:[st("div",{class:"drawer-links-icon",children:st("span",{class:"material-symbols-outlined",children:"chat_bubble"})}),st("div",{class:"drawer-links-label",children:st(gt,{children:"drawer.notify"})})]}),st("a",{class:"drawer-links-row",href:"#",onClick:function(){return e.writeOnEmail()},children:[st("div",{class:"drawer-links-icon",children:st("span",{class:"material-symbols-outlined",children:"mail"})}),st("div",{class:"drawer-links-label",children:st(gt,{children:"drawer.send-email"})})]}),st("a",{class:"drawer-links-row",href:this.getLicenseLink(),target:"_blank",children:[st("div",{class:"drawer-links-icon",children:st("span",{class:"material-symbols-outlined",children:"contract"})}),st("div",{class:"drawer-links-label",children:st(gt,{children:"drawer.license"})})]}),st("a",{class:"drawer-links-row",href:"https://t.me/evorog_bot",target:"_blank",children:[st("div",{class:"drawer-links-icon",children:st("img",{src:"/images/icons/evorog.svg"})}),st("div",{class:"drawer-links-label",children:"єВорог"})]})]}),st("div",{className:"drawer-block drawer-buttons-block",children:[st("div",{className:"block-header",children:st("div",{className:"title",children:st(gt,{children:"drawer.donate"})})}),st("div",{className:"block-content",children:st("div",{className:"drawer-buttons-row",children:[st("a",{className:"drawer-button",href:"https://base.monobank.ua/deepstateua",target:"_blank",children:[st("div",{className:"drawer-button-icon",children:st("img",{src:"/images/icons/base.svg"})}),st("div",{className:"drawer-button-content",children:"Base by mono"})]}),st("a",{className:"drawer-button",href:"https://buymeacoffee.com/deepstateua",target:"_blank",children:[st("div",{className:"drawer-button-icon",children:st("img",{src:"/images/icons/bmc.svg"})}),st("div",{className:"drawer-button-content",children:"BuyMeACoffee"})]})]})})]}),st("div",{className:"drawer-block drawer-buttons-block",children:[st("div",{className:"block-header",children:st("div",{className:"title",children:"Завантажте наші додатки"})}),st("div",{className:"block-content",children:st("div",{className:"drawer-buttons-row",children:[st("a",{className:"drawer-button",href:"https://play.google.com/store/apps/details?id=ua.com.deepstatemap",target:"_blank",children:[st("div",{className:"drawer-button-icon",children:st(di,{"data-translate-attributes":["alt"],children:st("img",{src:"/images/icons/google-play.svg",alt:"drawer.mobile-apps.android"})})}),st("div",{className:"drawer-button-content",children:st(gt,{children:"drawer.mobile-apps.android"})})]}),st("a",{className:"drawer-button",href:"https://apps.apple.com/us/app/deepstatemap/id6443851995?ign-itscg=30200&ign-itsct=apps_box_badg",target:"_blank",children:[st("div",{className:"drawer-button-icon",children:st(di,{"data-translate-attributes":["alt"],children:st("img",{src:"/images/icons/app-store.svg",alt:"drawer.mobile-apps.ios"})})}),st("div",{className:"drawer-button-content",children:st(gt,{children:"drawer.mobile-apps.ios"})})]})]})})]}),st("div",{className:"drawer-block sponsors",children:[st("div",{className:"block-header",children:[st("div",{className:"title",children:st(gt,{children:"drawer.support.header"})}),st("div",{className:"title-link",children:st("a",{href:"https://t.me/DeepStateAdsBot",target:"_blank",children:st(gt,{children:"drawer.support-link"})})})]}),st("a",{className:"block-content block-sponsor",href:"https://pleso.me/ua/l/deepstate",target:"_blank",children:[st("div",{className:"sponsor-logo",children:st("img",{src:"/images/partners/pleso_therapy.png",alt:"Pleso – психологічна допомога онлайн",title:"Pleso – психологічна допомога онлайн"})}),st("div",{className:"sponsor-title",children:["Платформа pleso – психологічна допомога онлайн",st("div",{className:"sponsor-promocode",children:[st("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.75 6.75L4.5 6H20.25L21 6.75V10.7812H20.25C19.5769 10.7812 19.0312 11.3269 19.0312 12C19.0312 12.6731 19.5769 13.2188 20.25 13.2188H21V17.25L20.25 18L4.5 18L3.75 17.25V13.2188H4.5C5.1731 13.2188 5.71875 12.6731 5.71875 12C5.71875 11.3269 5.1731 10.7812 4.5 10.7812H3.75V6.75ZM5.25 7.5V9.38602C6.38677 9.71157 7.21875 10.7586 7.21875 12C7.21875 13.2414 6.38677 14.2884 5.25 14.614V16.5L9 16.5L9 7.5H5.25ZM10.5 7.5V16.5L19.5 16.5V14.614C18.3632 14.2884 17.5312 13.2414 17.5312 12C1
17.5312 10.7586 18.3632 9.71157 19.5 9.38602V7.5H10.5Z",fill:"#080341"})}),st("div",{children:"DEEPSTATE30 -30%"})]})]})]})]}),st("div",{className:"drawer-block",children:[st("div",{className:"block-header",children:st("div",{className:"title",children:st(gt,{children:"drawer.partners.header"})})}),st("div",{className:"block-content block-partners",children:[st("a",{class:"drawer-partner",href:"https://mod.gov.ua/",target:"_blank",children:st("img",{src:"/images/partners/mod.png",alt:"Міністерство Оборони України",title:"Міністерство Оборони України"})}),st("a",{class:"drawer-partner",href:"https://thedigital.gov.ua/",target:"_blank",children:st("img",{src:"/images/partners/mintsyfra.png",alt:"Міністерство цифрової трансформації України",title:"Міністерство цифрової трансформації України"})}),st("a",{class:"drawer-partner",href:"https://brave1.gov.ua/",target:"_blank",children:st("img",{src:"/images/partners/brave1.png",alt:"Brave1",title:"Brave1"})}),st("a",{class:"drawer-partner",href:"https://dsns.gov.ua",target:"_blank",children:st(di,{"data-translate-attributes":["alt","title"],children:st("img",{src:"/images/partners/dsns.svg",alt:"drawer.partners.ses",title:"drawer.partners.ses"})})})]})]})]})}}]),t}(y),an=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"translatesService",window.translateService),J($(e),"hasUnreadRevisions",qe((function(){return ft.value.currentRevisionId.value>ft.value.lastViewedRevisionId.value}))),J($(e),"isIframe",window.self!==window.top),e.state={hidden:!1},e}return K(t,e),Y(t,[{key:"render",value:function(){return st("nav",{class:St({"site-nav":!0,hidden:this.state.hidden,"has-toggler":this.isIframe}),children:[st("div",{class:"nav-section",children:[!1===this.isIframe&&st("button",{class:"site-nav-btn","data-site-nav":"drawer",children:st("span",{class:"material-symbols-outlined",children:"menu"})}),!0===this.isIframe&&st(It,{text:"drawer.full-version",placement:"right",children:st("a",{class:"site-nav-btn",target:"_blank",href:"https://deepstatemap.live",children:st("span",{class:"material-symbols-outlined",children:"language"})})}),st(It,{text:"features.language",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"language",children:st(ct,{code:this.translatesService.language,radius:"24px"})})}),st(nn,{flag:nt.features.CHRISTMAS,children:st(It,{text:"features.christmas",placement:"right",children:st("button",{class:"site-nav-btn christmas","data-site-nav":"christmas","data-tooltip":"features.christmas",children:st(tn,{})})})}),st(It,{text:"features.updates",placement:"right",children:st("button",{className:St({"site-nav-btn":!0,unread:this.hasUnreadRevisions.value}),"data-site-nav":"updates","data-tooltip":"features.updates",children:st("span",{class:"material-symbols-outlined",children:"notifications"})})}),st(It,{text:"features.info",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"info","data-tooltip":"features.info",children:st("span",{class:"material-symbols-outlined",children:"info"})})})]}),st("div",{class:"nav-separator"}),st("div",{class:"nav-section",children:[st(It,{text:"features.settings",placement:"right",shortcut:"opt + Shift + S",children:st("button",{class:"site-nav-btn","data-site-nav":"settings",children:st("span",{class:"material-symbols-outlined",children:"tune"})})}),st(It,{text:"features.rule",placement:"right",shortcut:"opt + Shift + D",children:st("button",{class:"site-nav-btn","data-site-nav":"ruler",children:st("span",{class:"material-symbols-outlined",children:"straighten"})})}),st(It,{text:"features.drawing",placement:"right",shortcut:"opt + Shift + P",children:st("button",{class:"site-nav-btn","data-site-nav":"draw","data-tooltip":"features.drawing","data-tooltip-placement":"right",children:st("span",{class:"material-symbols-outlined",children:"draw"})})})]}),st("div",{class:"nav-separator"}),!1===this.isIframe&&st("div",{class:"nav-section",children:[st(It,{text:"features.stats",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"stats",style:{padding:"6px"},children:st("span",{class:"material-symbols-outlined",children:"insert_chart"})})}),st(It,{text:"features.weather",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"weather",children:st("span",{class:"material-symbols-outlined",children:"cloud"})})}),st(It,{text:"features.nuclear",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"nuclear",children:st("svg",{width:"20",height:"21",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.20007 12.0001C5.20007 11.5582 5.55825 11.2001 6.00007 11.2001H12.5001C12.9419 11.2001 13.3001 11.5582 13.3001 12.0001C13.3001 12.4419 12.9419 12.8001 12.5001 12.8001H6.00007C5.55825 12.8001 5.20007 12.4419 5.20007 12.0001Z",fill:"#33334E"}
1),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.47782 1.43162C7.12671 0.794034 8.01655 0.400024 9.00002 0.400024C9.9835 0.400024 10.8733 0.794034 11.5222 1.43162C11.6787 1.41078 11.8382 1.40002 12 1.40002C13.4517 1.40002 14.7027 2.25929 15.2722 3.49696C16.6107 3.84011 17.6 5.05453 17.6 6.50002C17.6 8.21211 16.2121 9.60002 14.5 9.60002H3.50002C1.78794 9.60002 0.400024 8.21211 0.400024 6.50002C0.400024 5.05453 1.38937 3.84011 2.72786 3.49696C3.29732 2.25929 4.54833 1.40002 6.00002 1.40002C6.16182 1.40002 6.32133 1.41078 6.47782 1.43162ZM6.17071 3.00721C6.5173 3.0365 6.83871 3.15417 7.11233 3.33761C7.22554 3.01497 7.41914 2.73013 7.6691 2.50714C8.02265 2.19172 8.48895 2.00002 9.00002 2.00002C9.5111 2.00002 9.9774 2.19172 10.3309 2.50713C10.5809 2.73013 10.7745 3.01496 10.8877 3.33761C11.1613 3.15418 11.4828 3.0365 11.8293 3.00721C11.8856 3.00245 11.9425 3.00002 12 3.00002C13.1046 3.00002 14 3.89545 14 5.00002H14.5C15.3285 5.00002 16 5.6716 16 6.50002C16 7.32845 15.3285 8.00002 14.5 8.00002H3.50002C2.6716 8.00002 2.00002 7.32845 2.00002 6.50002C2.00002 5.6716 2.6716 5.00002 3.50002 5.00002H4.00002C4.00002 3.89545 4.89545 3.00002 6.00002 3.00002C6.05752 3.00002 6.11444 3.00245 6.17071 3.00721Z",fill:"#33334E"}),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.50007 8.20007C8.9419 8.20007 9.30007 8.55825 9.30007 9.00007V14.0001C9.30007 14.7598 9.01521 15.8365 8.18714 16.731C7.33753 17.6488 5.98633 18.3001 4.00007 18.3001C3.55825 18.3001 3.20007 17.9419 3.20007 17.5001C3.20007 17.0582 3.55825 16.7001 4.00007 16.7001C5.61381 16.7001 6.51262 16.1847 7.013 15.6441C7.53493 15.0803 7.70007 14.4071 7.70007 14.0001V9.00007C7.70007 8.55825 8.05825 8.20007 8.50007 8.20007Z",fill:"#33334E"}),st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 8.20007C9.55822 8.20007 9.20005 8.55825 9.20005 9.00007V14.0001C9.20005 14.7598 9.48491 15.8365 10.313 16.731C11.1626 17.6488 12.5138 18.3001 14.5 18.3001C14.9419 18.3001 15.3 17.9419 15.3 17.5001C15.3 17.0582 14.9419 16.7001 14.5 16.7001C12.8863 16.7001 11.9875 16.1847 11.4871 15.6441C10.9652 15.0803 10.8 14.4071 10.8 14.0001V9.00007C10.8 8.55825 10.4419 8.20007 10 8.20007Z",fill:"#33334E"})]})})}),st(It,{text:"features.arty",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"arty","data-tooltip-placement":"right",children:st("span",{class:"material-symbols-outlined",children:"crisis_alert"})})}),st(It,{text:"features.fires",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"firms","data-tooltip-placement":"right",children:st("span",{class:"material-symbols-outlined",children:"local_fire_department"})})}),st(It,{text:"features.radiation",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"seb",children:st("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:[st("path",{stroke:"none","fill-rule":"nonzero",d:"M 5.707031 1.796875 C 4.417969 2.597656 3.339844 3.582031 2.429688 4.78125 C 0.929688 6.753906 0.09375 9.117188 0.0078125 11.625 L -0.00390625 12 L 8.398438 12 L 8.398438 11.914062 C 8.398438 11.867188 8.410156 11.75 8.421875 11.648438 C 8.539062 10.554688 9.121094 9.589844 10.023438 9 L 10.199219 8.882812 L 10.144531 8.785156 C 8.785156 6.417969 6.011719 1.640625 5.996094 1.636719 C 5.984375 1.636719 5.851562 1.707031 5.707031 1.796875 Z M 5.707031 1.796875 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 17.507812 2.460938 C 16.75 3.773438 13.816406 8.859375 13.808594 8.871094 C 13.804688 8.878906 13.871094 8.925781 13.953125 8.980469 C 14.757812 9.507812 15.335938 10.355469 15.523438 11.277344 C 15.5625 11.484375 15.601562 11.78125 15.601562 11.914062 L 15.601562 12 L 24.003906 12 L 23.992188 11.628906 C 23.949219 10.410156 23.742188 9.257812 23.359375 8.148438 C 22.511719 5.664062 20.878906 3.53125 18.683594 2.050781 C 18.363281 1.835938 18.035156 1.632812 18.003906 1.632812 C 17.996094 1.632812 17.769531 2.003906 17.507812 2.460938 Z M 17.507812 2.460938 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 11.671875 9.628906 C 10.40625 9.804688 9.484375 10.96875 9.617188 12.21875 C 9.675781 12.804688 9.902344 13.277344 10.3125 13.6875 C 10.722656 14.097656 11.195312 14.324219 11.777344 14.382812 C 12.453125 14.453125 13.15625 14.207031 13.65625 13.726562 C 14.535156 12.878906 14.644531 11.535156 13.914062 10.558594 C 13.398438 9.867188 12.527344 9.507812 11.671875 9.628906 Z M 11.671875 9.628906 "}),st("path",{stroke:"none","fill-rule":"nonzero",d:"M 9.246094 16.769531 C 5.871094 22.613281 6.011719 22.371094 6.039062 22.398438 C 6.085938 22.4375 6.648438 22.734375 6.964844 22.878906 C 8.238281 23.472656 9.511719 23.8125 10.96875 23.957031 C 11.4375 24 12.554688 24 
113.03125 23.953125 C 14.460938 23.816406 15.746094 23.476562 17.007812 22.894531 C 17.277344 22.769531 17.875 22.457031 17.945312 22.40625 L 17.988281 22.371094 L 15.964844 18.871094 C 14.855469 16.941406 13.910156 15.308594 13.871094 15.242188 L 13.800781 15.117188 L 13.578125 15.226562 C 13.195312 15.414062 12.789062 15.53125 12.351562 15.578125 C 11.71875 15.648438 11.011719 15.519531 10.417969 15.226562 L 10.199219 15.121094 Z M 9.246094 16.769531 "})]})})})]}),!0===this.isIframe&&st(It,{text:"features.tools",placement:"right",children:st("button",{class:"site-nav-btn","data-site-nav":"mobile-tools",children:st("span",{class:"material-symbols-outlined",children:"more_horiz"})})})]})}}]),t}(y),sn=function(e){function t(e){var i;return Z(this,t),(i=U(this,t,[e])).props.controller.dialogShownSignal.subscribe((function(e){i.setState({shown:e})})),i.props.controller.dialogBodySignal.subscribe((function(e){e="string"==typeof e?st("span",{dangerouslySetInnerHTML:{__html:e}}):e,i.setState({body:e})})),i.props.controller.dialogConfigSignal.subscribe((function(e){i.setState({config:e})})),i}return K(t,e),Y(t,[{key:"handleBackdropClick",value:function(e){var t;!1!==(null===(t=this.state.config)||void 0===t?void 0:t.closeOnBackdrop)&&e.target===e.currentTarget&&(e.stopPropagation(),this.props.controller.close())}},{key:"handleEscapeClick",value:function(e){var t;e.stopPropagation(),!1!==(null===(t=this.state.config)||void 0===t?void 0:t.closeOnEscape)&&"Escape"===e.key&&this.props.controller.close()}},{key:"componentDidMount",value:function(){window.addEventListener("keydown",this.handleEscapeClick.bind(this))}},{key:"componentDidCatch",value:function(){window.removeEventListener("keydown",this.handleEscapeClick)}},{key:"render",value:function(){var e,t=this;return st("div",{className:St({"dialog-backdrop":!0,shown:!!this.state.shown}),onClick:function(e){t.handleBackdropClick(e)},children:st("div",{class:"dialog",children:[(null===(e=this.state.config)||void 0===e?void 0:e.header)&&st("div",{class:"dialog-header",children:[st("div",{class:"dialog-title",children:[" ",this.state.config.header," "]}),st("div",{class:"dialog-dismiss",onClick:function(){return t.props.controller.close()},children:st("span",{class:"material-symbols-outlined",children:"close"})})]}),st("div",{class:"dialog-body",children:[" ",this.state.body," "]})]})})}}]),t}(y);!function(e){e[e.INACTIVE=0]="INACTIVE",e[e.RECENT=1]="RECENT",e[e.ERROR=2]="ERROR",e[e.RESULTS=3]="RESULTS",e[e.ACTIVE_RESULT=4]="ACTIVE_RESULT"}(Ji||(Ji={}));var on=function(e){function t(e){var i;Z(this,t),J($(i=U(this,t,[e])),"searchInputElem",null),J($(i),"searchController",window.searchController),J($(i),"cityBoundsLayer",window.cityBoundsLayer),J($(i),"translateSvc",window.translateService),J($(i),"keyUpDebounce",ui((function(){var e,t=(null===(e=i.searchInputElem)||void 0===e?void 0:e.value)||"";if((i.extController=window.extController,i.extController)&&i.extController.execSearchExtensionFunctionRegexp(t))return void i.extController.runSearchExtensionFunction(t).then((function(e){i.setState({searchResults:e||[],currentState:Ji.RESULTS})})).catch((function(e){console.log("[MobileSearch] SearchExt error",e),i.setState({currentState:Ji.ERROR,searchError:"Помилка / Error"})}));var n=/([0-9]{2}\.[0-9]{4,16}),?\s*([0-9]{2}\.[0-9]{4,16})/.exec(t);if(n){var r=parseFloat(n[1]),a=parseFloat(n[2]);i.setState({searchResults:[{geometry:{type:"Point",coordinates:[a,r]},type:"coordinate",bbox:void 0,title:r.toFixed(6)+", "+a.toFixed(6),subtitle:"WGS-84",recent:!1,handleMarkerClick:i.searchController.coordsMarkerClickHandler}],currentState:Ji.RESULTS})}else{var s=/(\d{1,3})°(\d{1,2})'(\d{1,2})\.(\d{1,2})"([NSns])\s*(\d{1,3})°(\d{1,2})'(\d{1,2})\.(\d{1,2})"([EwEw])/.exec(t);if(s){var o=function(e,t,i,n){var r=e+t/60+i/3600;return"s"!==n.toLowerCase()&&"w"!==n.toLowerCase()||(r*=-1),r},l=o(+s[1],+s[2],+(s[3]+"."+s[4]),s[5]),c=o(+s[6],+s[7],+(s[8]+"."+s[9]),s[10]);i.setState({searchResults:[{geometry:{type:"Point",coordinates:[c,l]},type:"coordinate",bbox:void 0,title:t,subtitle:"DMS",recent:!1,handleMarkerClick:i.searchController.coordsMarkerClickHandler}],currentState:Ji.RESULTS})}else{var u=t.replace(/\s\s+/g," "),d=/\s*([1-9]\d?)\s*([^IO])\s*([^IO])\s*([^IO])?\s*(\d{1,5})?\s*(\d{1,5})?\s*/gi.exec(u);if(d){for(var h=d[0].replace(/[\s]/g,""),p=0,v=Object.entries({"С":"C","Т":"T","Р":"P","А":"A","В":"B","Е":"E","К":"K","М":"M","Н":"H","Х":"X"});p<v.length;p++){var f=v[p];h=h.replace(f[0],f[1])}var m=te(ti(h),2),g=m[0],y=m[1];i.setState({searchResults:[{geometry:{type:"Point",coordinates:[g,y]},type:"coordinate",bbox:void 0,title:t,subtitle:"MGRS",recent:!1,handleMarkerClick:i.searchController.coordsMarkerClickHandler}],currentState:Ji.RESULTS})}else i.searchController.performSearch(t,"autocomplete").then((function(e){i.setState({currentState:Ji.RESULTS,searchResults:e})})).catch((function(e){i.setState({currentState:Ji.ERROR,searchError:"Помилка / Error"})}))}}}),500)),i.state={currentState:Ji.INACTIVE,geolocationError:null};var n=0,r=setInterval((function(){if(n>10)clearInterval(r);else if(n++,i.searchController||(i.searchController=window.searchController),i.searchController){clearInterval(r);var e=!0;i.searchController.controllerEnforcedState.subscribe((function(t){e?e=!1:t&&t.term?(i.searchInputElem&&(i.searchInputElem.value=t.term,i.searchInputElem.blur()),i.setState({currentState:Ji.ACTIVE_RESULT})):i.handleClearBtnClick()}))}}),1e3);return i}
1return K(t,e),Y(t,[{key:"componentDidMount",value:function(){this.searchInputElem=document.querySelector(".mobile-header .mobile-search-input input")}},{key:"handleClearBtnClick",value:function(){this.searchController.clearState(),this.searchInputElem&&(this.searchInputElem.value=""),this.setState({currentState:Ji.INACTIVE,searchResults:void 0}),this.cityBoundsLayer&&this.cityBoundsLayer.hide(),this.props.setMobileSearchActive(!1)}},{key:"handleSearchIconClick",value:function(){var e=this;this.searchController||(this.searchController=window.searchController,this.searchController.locateError.subscribe((function(t){e.setState({geolocationError:t})}))),this.cityBoundsLayer||(this.cityBoundsLayer=window.cityBoundsLayer),this.props.setMobileSearchActive(!0,(function(){e.searchInputElem&&e.searchInputElem.focus()}))}},{key:"handleInputFocusIn",value:function(e){var t;if(null===(t=this.searchInputElem)||void 0===t?void 0:t.value)this.searchController.lastResults&&this.searchController.lastResults.length>0?this.setState({searchResults:this.searchController.lastResults,currentState:Ji.RESULTS}):this.keyUpDebounce();else{var i=this.searchController.getRecentSearches();i.length>0?this.setState({searchResults:i,currentState:Ji.RECENT}):this.setState({searchResults:[],currentState:Ji.RECENT})}}},{key:"handleInputKeyUp",value:function(e){var t,i=this,n=null===(t=this.searchInputElem)||void 0===t?void 0:t.value;if(n&&n.length>3&&e instanceof KeyboardEvent&&"Enter"===e.key)this.searchController.performSearch(n,"search").then((function(e){i.setState({currentState:Ji.RESULTS,searchResults:e})})).catch((function(e){i.setState({currentState:Ji.ERROR,searchError:"Помилка / Error"})}));else{if(n&&n.length>=2){var r=this.searchController.findUnits(n);if(r.length>0)return void this.setState({currentState:Ji.RESULTS,searchResults:r.slice(0,10)})}if(n&&n.length<=3)this.setState({currentState:Ji.RECENT,searchResults:[]});else if(n&&n.startsWith("#")&&5===n.length){var a=window.extController;if(!a)return;"#0000"===n?a.clearExternal():(a.handleExternal(n.replace("#","")),this.handleClearBtnClick())}else this.keyUpDebounce()}}},{key:"handleResultClick",value:function(e){this.searchInputElem&&(this.searchInputElem.value=e.title,this.searchInputElem.blur()),this.setState({currentState:Ji.ACTIVE_RESULT}),this.searchController.handleResultClick(e)}},{key:"handleLocateClick",value:function(){this.state.geolocationInProgress?(this.setState({geolocationInProgress:!1}),this.searchController.stopLocate()):(this.setState({geolocationInProgress:!0}),this.searchController.locate())}},{key:"showGeoErrorDialog",value:function(){var e=window.dialogController;e&&e.open(st(g,{children:[st(gt,{children:"geolocation.error"}),st("br",{}),st("br",{}),st(gt,{children:"geolocation.errorText"})]}),{header:this.translateSvc.translate("omnibox.geoError"),closeOnBackdrop:!0,closeOnEscape:!0})}},{key:"render",value:function(){var e,t,i=this;return st(g,{children:[st("div",{class:"mobile-header-item mobile-search",children:[st("div",{class:"mobile-search-input",children:st("input",{type:"text",onfocusin:this.handleInputFocusIn.bind(this),onKeyUp:this.handleInputKeyUp.bind(this),onPaste:this.handleInputKeyUp.bind(this)})}),this.state.currentState!==Ji.INACTIVE?st("div",{class:"mobile-search-button",onClick:this.handleClearBtnClick.bind(this),children:st("span",{class:"material-symbols-outlined",children:"close"})}):st("div",{class:"mobile-search-button",onClick:this.handleSearchIconClick.bind(this),children:st("span",{class:"material-symbols-outlined",children:"search"})})]}),st("div",{className:St({"mobile-search-dropdown":!0,shown:this.state.currentState!==Ji.INACTIVE&&this.state.currentState!==Ji.ACTIVE_RESULT}),children:[this.state.currentState===Ji.ERROR&&this.state.searchError?st(g,{children:st("div",{class:"search-row error",children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"warning"})}),st("div",{class:"search-row-text",children:st(gt,{children:i.state.searchError})})]})}):null,this.state.currentState===Ji.RECENT?st(g,{children:[null!==i.state.geolocationError?st("div",{class:"search-row row-geolocation",onClick:i.showGeoErrorDialog.bind(i),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"warning"})}),st(di,{"data-translate-attributes":["title"],children:st("div",{class:"search-row-text",title:"geolocation.error",children:st(gt,{children:"omnibox.geoError"})})})]}):!0===i.state.geolocationInProgress?st("div",{class:"search-row row-geolocation row-geolocation-in-progress",onClick:i.handleLocateClick.bind(i),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"assistant_navigation"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.geolocation"})})]}):st("div",{class:"search-row row-geolocation",onClick:i.handleLocateClick.bind(i),children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"my_location"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.geolocation"})})]}),i.state.searchResults&&i.state.searchResults.length>0?null===(t=i.state.searchResults)||void 0===t?void 0:t.map((function(e){return st("div",{class:"search-row",onClick:function(){return i.handleResultClick(e)},children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"schedule"})}),st("div",{class:"search-row-text",children:[e.title,st("span",{class:"secondary",children:e.subt
1itle})]})]})})):null]}):null,this.state.currentState===Ji.RESULTS?(e=function(e){switch(e){case"term":return"location_on";case"coordinate":return"point_scan";case"unit":return"military_tech";default:return"chevron_right"}},void 0===i.state.searchResults?null:0===i.state.searchResults.length?st("div",{class:"search-row error",children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:"search_off"})}),st("div",{class:"search-row-text",children:st(gt,{children:"omnibox.notFound"})})]}):st(g,{children:i.state.searchResults.map((function(t){return st("div",{class:"search-row",onClick:function(){return i.handleResultClick(t)},children:[st("div",{class:"search-row-icon",children:st("span",{class:"material-symbols-outlined",children:e(t.type)})}),st("div",{class:"search-row-text",children:[t.title,st("span",{class:"secondary",children:t.subtitle})]})]})}))})):null]})]})}}]),t}(y),ln=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t,[e])),"featuresController",null),J($(i),"hasUnreadRevisions",qe((function(){return ft.value.currentRevisionId.value>ft.value.lastViewedRevisionId.value}))),i.setState({updatedAt:0,featureStackSignals:{},searchActive:!1}),i.featuresControllerPollInterval=setInterval(i.tryPollFeaturesController.bind($(i)),100),i}return K(t,e),Y(t,[{key:"tryPollFeaturesController",value:function(){var e=this;this.featuresController=window.featuresController,this.featuresController?(Ut.log("MobileToolbarComponent","FeaturesController acquired"),this.featuresController.featuresListUpdatedSignal.subscribe((function(t){var i;e.setState({updatedAt:t,featureStackSignals:null===(i=e.featuresController)||void 0===i?void 0:i.getFeatureSignals()})})),clearInterval(this.featuresControllerPollInterval)):Ut.log("MobileToolbarComponent","FeaturesController acqusition failed, retrying...")}},{key:"isFeatureActive",value:function(e){var t;return!0===(null===(t=this.state.featureStackSignals[e])||void 0===t?void 0:t.value)}},{key:"toggleFeature",value:function(e){var t;null===(t=this.featuresController)||void 0===t||t.handleToolbarClick(e)}},{key:"render",value:function(){var e=this;return st("div",{class:"mobile-header "+(this.state.searchActive?"search-active":""),children:[st("div",{class:"mobile-header-left",children:st("div",{class:"mobile-header-item site-logo-item","data-site-nav":"drawer",children:[st("span",{class:"material-symbols-outlined",children:"menu"}),st("div",{class:"site-logo",children:[st("svg",{width:"77",height:"36",viewBox:"0 0 77 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"full-size-logo",children:[st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.4545 1.11519C10.9846 1.76884 11.9704 2.87911 12.6454 3.58285C14.2951 5.30253 16.7469 8.34013 17.2474 9.28405C17.5609 9.87519 17.5262 10.2302 17.0959 10.8378C16.5366 11.6274 15.1013 11.9382 15.1013 11.2695C15.1013 10.6564 13.0187 9.81487 11.63 9.86642C10.7887 9.89786 10.0102 9.6595 9.50712 9.21715L8.71275 8.51816L8.98148 9.96768C9.38402 12.1385 10.0727 13.2085 12.2554 15.0525C14.654 17.0793 16.1954 19.7466 16.466 22.3389C16.6394 23.9982 16.534 24.4552 15.699 25.6719C15.1671 26.4472 14.7317 27.2109 14.7317 27.3685C14.7317 27.5264 15.2351 28.0382 15.8502 28.5058C19.0635 30.9479 18.9851 30.8521 18.5416 31.8147C18.2895 32.362 18.2562 32.9151 18.4569 33.2284C18.638 33.5113 18.7889 34.116 18.7922 34.5719L18.7977 35.4006C18.7977 35.4006 18.6099 35.3988 9.46424 35.303C0.318528 35.2072 1.34494 35.303 0.0205967 35.303C-0.0400248 34.8833 0.00878906 33.75 0.491891 33.2017C1.02048 32.7677 1.01937 32.6654 0.480432 32.0761C0.0124644 31.5646 -0.0259782 31.2667 0.298938 30.666C0.525899 30.2471 0.804116 30.0414 1.00126 29.9045C1.13379 29.8125 1.98229 29.3196 2.82693 28.6045C4.43857 27.2406 4.46001 26.8073 2.99548 25.2313C2.71825 24.9334 2.52826 23.6835 2.52049 22.11C2.51347 20.6664 2.24511 18.1694 1.92426 16.5609C0.716266 10.5055 0.798326 9.00219 2.46985 6.54075C3.64753 4.80608 5.55157 3.41103 7.37428 2.94711C8.4869 2.66378 8.64585 2.47039 8.74713 1.27678C8.88833 -0.381856 9.21547 -0.412564 10.4545 1.11519Z",fill:"#33334E"}
1),st("path",{d:"M61.04 10.6776H58.0935V8.2749H61.04C61.4487 8.2749 61.7816 8.18262 62.0387 7.99805C62.3024 7.81348 62.4935 7.55969 62.6122 7.23669C62.7308 6.9071 62.7902 6.53796 62.7902 6.12927C62.7902 5.71399 62.7275 5.32837 62.6023 4.97241C62.4836 4.60986 62.2958 4.31653 62.0387 4.09241C61.7882 3.86829 61.4553 3.75623 61.04 3.75623H59.0229V15.75H56.1357V1.35352H61.04C62.009 1.35352 62.8429 1.55786 63.5416 1.96655C64.2404 2.37524 64.7743 2.93884 65.1434 3.65735C65.5192 4.36926 65.707 5.18665 65.707 6.1095C65.707 7.03894 65.5192 7.84644 65.1434 8.53198C64.7743 9.21094 64.2404 9.73828 63.5416 10.114C62.8429 10.4897 62.009 10.6776 61.04 10.6776Z",fill:"#33334E"}),st("path",{d:"M54.4449 13.3572V15.75H48.186V13.3572H54.4449ZM49.0858 1.35352V15.75H46.1887V1.35352H49.0858ZM53.6045 7.18726V9.51086H48.186V7.18726H53.6045ZM54.4252 1.35352V3.75623H48.186V1.35352H54.4252Z",fill:"#33334E"}),st("path",{d:"M44.4979 13.3572V15.75H38.239V13.3572H44.4979ZM39.1388 1.35352V15.75H36.2417V1.35352H39.1388ZM43.6575 7.18726V9.51086H38.239V7.18726H43.6575ZM44.4781 1.35352V3.75623H38.239V1.35352H44.4781Z",fill:"#33334E"}),st("path",{d:"M28.5491 15.75H26.0079L26.0277 13.3572H28.5491C29.2478 13.3572 29.7916 13.2319 30.1805 12.9814C30.5695 12.731 30.843 12.3354 31.0012 11.7949C31.166 11.2544 31.2484 10.5458 31.2484 9.66907V7.42456C31.2484 6.75879 31.2056 6.19519 31.1199 5.73376C31.0342 5.26575 30.8892 4.89001 30.6848 4.60657C30.4805 4.31653 30.2069 4.10229 29.8641 3.96387C29.5214 3.82544 29.0962 3.75623 28.5886 3.75623H25.9585V1.35352H28.5886C29.4192 1.35352 30.174 1.48865 30.8529 1.75891C31.5319 2.02917 32.1152 2.42468 32.603 2.94543C33.0908 3.45959 33.4666 4.0957 33.7302 4.85376C33.9939 5.61182 34.1257 6.47534 34.1257 7.44434V9.66907C34.1257 10.6447 33.9939 11.5082 33.7302 12.2596C33.4666 13.0111 33.0908 13.6472 32.603 14.168C32.1218 14.6821 31.5385 15.0743 30.8529 15.3446C30.1674 15.6149 29.3994 15.75 28.5491 15.75ZM27.6888 1.35352V15.75H24.7917V1.35352H27.6888Z",fill:"#33334E"}),st("path",{d:"M75.7035 32.4822V34.875H69.4446V32.4822H75.7035ZM70.3444 20.4785V34.875H67.4473V20.4785H70.3444ZM74.863 26.3123V28.6359H69.4446V26.3123H74.863ZM75.6837 20.4785V22.8812H69.4446V20.4785H75.6837Z",fill:"#33334E"}),st("path",{d:"M62.187 20.4785V34.875H59.3097V20.4785H62.187ZM65.7664 20.4785V22.8812H55.7996V20.4785H65.7664Z",fill:"#33334E"}),st("path",{d:"M50.7469 23.0493L47.6521 34.875H44.5968L49.0957 20.4785H51.004L50.7469 23.0493ZM53.1892 34.875L50.0746 23.0493L49.7878 20.4785H51.7258L56.2643 34.875H53.1892ZM53.298 29.506V31.9087H46.8018V29.506H53.298Z",fill:"#33334E"}),st("path",{d:"M41.4624 20.4785V34.875H38.5851V20.4785H41.4624ZM45.0417 20.4785V22.8812H35.075V20.4785H45.0417Z",fill:"#33334E"}),st("path",{d:"M30.8826 31.088C30.8826 30.8309 30.8595 30.5969 30.8134 30.386C30.7672 30.175 30.6683 29.9806 30.5167 29.8026C30.3717 29.6246 30.1575 29.4467 29.874 29.2687C29.5972 29.0907 29.2346 28.9061 28.7864 28.715C28.2524 28.4908 27.735 28.2535 27.234 28.0031C26.733 27.746 26.2815 27.4493 25.8794 27.1132C25.4773 26.777 25.1576 26.3815 24.9203 25.9266C24.6896 25.4652 24.5742 24.9247 24.5742 24.3051C24.5742 23.6986 24.683 23.1482 24.9005 22.6538C25.1246 22.1594 25.441 21.7375 25.8497 21.3882C26.2584 21.0322 26.7363 20.7587 27.2834 20.5675C27.8372 20.3763 28.4535 20.2808 29.1324 20.2808C30.0553 20.2808 30.8529 20.4719 31.5253 20.8542C32.2042 21.2366 32.7283 21.7606 33.0974 22.4264C33.4731 23.0922 33.661 23.8568 33.661 24.7203H30.7738C30.7738 24.3116 30.7145 23.9524 30.5958 23.6426C30.4838 23.3262 30.3025 23.079 30.052 22.901C29.8015 22.723 29.4785 22.634 29.083 22.634C28.7139 22.634 28.4073 22.7098 28.1635 22.8615C27.9261 23.0065 27.7482 23.2075 27.6295 23.4646C27.5175 23.7151 27.4614 23.9985 27.4614 24.3149C27.4614 24.5522 27.5175 24.7665 27.6295 24.9576C27.7482 25.1422 27.9097 25.3103 28.114 25.4619C28.3184 25.6069 28.559 25.7487 28.8358 25.8871C29.1193 26.0255 29.4291 26.1606 29.7653 26.2925C30.4178 26.5496 30.9946 26.833 31.4956 27.1428C31.9966 27.446 32.4152 27.7888 32.7513 28.1711C33.0875 28.5469 33.3413 28.972 33.5127 29.4467C33.6841 29.9213 33.7698 30.4618 33.7698 31.0682C33.7698 31.6681 33.6643 32.2152 33.4534 32.7096C33.249 33.1974 32.9491 33.6193 32.5536 33.9752C32.1581 34.3246 31.6802 34.5948 31.1199 34.786C30.5662 34.9772 29.9465 35.0728 29.261 35.0728C28.5952 35.0728 27.9657 34.9805 27.3724 34.7959C26.7792 34.6047 26.2551 34.318 25.8003 33.9357C25.3521 33.5468 24.9994 33.0557 24.7423 32.4624C24.4852 31.8625 24.3567 31.1539 24.3567 30.3365H27.2538C27.2538 30.7716 27.2966 31.144 27.3823 31.4539C27.468 31.7571 27.5999 32.001 27.7778 32.1855C27.9558 32.3635 28.1733 32.4987 28.4304 32.5909C28.6941 32.6766 28.994 32.7195 29.3302 32.7195C29.7125 32.7195 30.0157 32.647 30.2399 32.502C30.4706 32.3569 30.6354 32.1625 30.7343 31.9186C30.8331 31.6747 30.8826 31.3978 30.8826 31.088Z",fill:"#33334E"})]}
1),st("svg",{width:"77",height:"36",viewBox:"0 0 77 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"horse-only-logo",children:st("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.4545 1.11519C10.9846 1.76884 11.9704 2.87911 12.6454 3.58285C14.2951 5.30253 16.7469 8.34013 17.2474 9.28405C17.5609 9.87519 17.5262 10.2302 17.0959 10.8378C16.5366 11.6274 15.1013 11.9382 15.1013 11.2695C15.1013 10.6564 13.0187 9.81487 11.63 9.86642C10.7887 9.89786 10.0102 9.6595 9.50712 9.21715L8.71275 8.51816L8.98148 9.96768C9.38402 12.1385 10.0727 13.2085 12.2554 15.0525C14.654 17.0793 16.1954 19.7466 16.466 22.3389C16.6394 23.9982 16.534 24.4552 15.699 25.6719C15.1671 26.4472 14.7317 27.2109 14.7317 27.3685C14.7317 27.5264 15.2351 28.0382 15.8502 28.5058C19.0635 30.9479 18.9851 30.8521 18.5416 31.8147C18.2895 32.362 18.2562 32.9151 18.4569 33.2284C18.638 33.5113 18.7889 34.116 18.7922 34.5719L18.7977 35.4006C18.7977 35.4006 18.6099 35.3988 9.46424 35.303C0.318528 35.2072 1.34494 35.303 0.0205967 35.303C-0.0400248 34.8833 0.00878906 33.75 0.491891 33.2017C1.02048 32.7677 1.01937 32.6654 0.480432 32.0761C0.0124644 31.5646 -0.0259782 31.2667 0.298938 30.666C0.525899 30.2471 0.804116 30.0414 1.00126 29.9045C1.13379 29.8125 1.98229 29.3196 2.82693 28.6045C4.43857 27.2406 4.46001 26.8073 2.99548 25.2313C2.71825 24.9334 2.52826 23.6835 2.52049 22.11C2.51347 20.6664 2.24511 18.1694 1.92426 16.5609C0.716266 10.5055 0.798326 9.00219 2.46985 6.54075C3.64753 4.80608 5.55157 3.41103 7.37428 2.94711C8.4869 2.66378 8.64585 2.47039 8.74713 1.27678C8.88833 -0.381856 9.21547 -0.412564 10.4545 1.11519Z",fill:"#33334E"})})]})]})}),st("div",{class:"mobile-header-right",children:[st(on,{setMobileSearchActive:function(t,i){return e.setState({searchActive:t},i)}}),st("div",{onClick:function(){return e.toggleFeature(nt.features.UPDATES)},className:St({"mobile-header-item":!0,active:this.isFeatureActive(nt.features.UPDATES),unread:this.hasUnreadRevisions.value,"hide-on-search":!0}),children:st("span",{class:"material-symbols-outlined",children:"notifications"})}),st("div",{className:St({"mobile-header-item":!0,active:this.isFeatureActive(nt.features.INFO),"hide-on-search":!0}),onClick:function(){return e.toggleFeature(nt.features.INFO)},children:st("span",{class:"material-symbols-outlined",children:"info"})})]})]})}}]),t}(y),cn=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t,[e])),"featuresController",null),i.setState({updatedAt:0,featureStackSignals:{}}),i.featuresControllerPollInterval=setInterval(i.tryPollFeaturesController.bind($(i)),100),i}return K(t,e),Y(t,[{key:"tryPollFeaturesController",value:function(){var e=this;this.featuresController=window.featuresController,this.featuresController?(Ut.log("MobileToolbarComponent","FeaturesController acquired"),this.featuresController.featuresListUpdatedSignal.subscribe((function(t){var i;e.setState({updatedAt:t,featureStackSignals:null===(i=e.featuresController)||void 0===i?void 0:i.getFeatureSignals()})})),clearInterval(this.featuresControllerPollInterval)):Ut.log("MobileToolbarComponent","FeaturesController acqusition failed, retrying...")}},{key:"getActiveClassName",value:function(e){var t;return!0===(null===(t=this.state.featureStackSignals[e])||void 0===t?void 0:t.value)?" active":""}},{key:"isFeatureActive",value:function(e){var t;return!0===(null===(t=this.state.featureStackSignals[e])||void 0===t?void 0:t.value)}},{key:"toggleFeature",value:function(e){var t;null===(t=this.featuresController)||void 0===t||t.handleToolbarClick(e)}},{key:"render",value:function(){var e=this;return st("div",{class:"mobile-toolbar",children:[st("div",{className:St({"mobile-toolbar-item":!0,active:this.isFeatureActive(nt.features.SETTINGS)}),onClick:function(){return e.toggleFeature(nt.features.SETTINGS)},children:st("span",{class:"material-symbols-outlined",children:" tune "})}),st("div",{className:St({"mobile-toolbar-item":!0,active:this.isFeatureActive(nt.features.RULER)}),onClick:function(){return e.toggleFeature(nt.features.RULER)},children:st("span",{class:"material-symbols-outlined",children:" straighten "})}),st("div",{className:St({"mobile-toolbar-item":!0,active:this.isFeatureActive(nt.features.DRAW)}
1),onClick:function(){return e.toggleFeature(nt.features.DRAW)},children:st("span",{class:"material-symbols-outlined",children:" draw "})}),st("div",{className:St({"mobile-toolbar-item":!0,active:this.isFeatureActive(nt.features.MOBILE_APPS)}),onClick:function(){return e.toggleFeature(nt.features.MOBILE_APPS)},children:st("span",{class:"material-symbols-outlined",children:"  apps "})}),st(nn,{flag:nt.features.CHRISTMAS,children:st(tn,{styleClass:"mobile-toolbar-item christmas",imageStyle:"width:16px"})})]})}}]),t}(y),un=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t,[e])),"elementRef",null),J($(i),"elementBodyRef",null),J($(i),"collapsedHeight",38),J($(i),"desiredHeight",0),J($(i),"translateY",0),J($(i),"isDragging",!1),J($(i),"dragStart",0),J($(i),"dragStartDesired",0),J($(i),"featuresController",null),i.screenHeight=window.innerHeight,i.screenHeight95=Math.round(.95*i.screenHeight),i.maxHeight=i.screenHeight95,i.setDesiredY(0),i.setState({updatedAt:0,featureStackSignals:{}}),i.featuresControllerPollInterval=setInterval(i.tryPollFeaturesController.bind($(i)),100),i}return K(t,e),Y(t,[{key:"tryPollFeaturesController",value:function(){var e=this;this.featuresController=window.featuresController,this.featuresController?(Ut.log("MobileBottomSheetComponent","FeaturesController acquired"),this.featuresController.featuresListUpdatedSignal.subscribe((function(t){var i;e.setState({updatedAt:t,featureStackSignals:null===(i=e.featuresController)||void 0===i?void 0:i.getFeatureSignals()})})),clearInterval(this.featuresControllerPollInterval)):Ut.log("MobileBottomSheetComponent","FeaturesController acqusition failed, retrying...")}},{key:"setDesiredY",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=e+this.collapsedHeight;(r<0||r>this.collapsedHeight+this.maxHeight)&&!n||(this.desiredHeight=e,this.translateY=r,requestAnimationFrame((function(){t.elementRef&&(i&&(t.elementRef.classList.add("apply-transition"),setTimeout((function(){var e;null===(e=t.elementRef)||void 0===e||e.classList.remove("apply-transition")}),100)),t.elementRef.style.transform="translateY(-".concat(t.translateY,"px)"))})))}},{key:"componentDidMount",value:function(){window.addEventListener("resize",this.windowResizeHandler.bind(this)),document.body.addEventListener("mousemove",this.mouseMoveEventsHandler.bind(this)),document.body.addEventListener("touchmove",this.mouseMoveEventsHandler.bind(this)),document.body.addEventListener("mouseup",this.handleClickEventsHandler.bind(this)),document.addEventListener("mouseleave",this.mouseOutEventHandler.bind(this)),this.elementRef=document.querySelector(".mobile-bottom-sheet")}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.windowResizeHandler),document.body.removeEventListener("mousemove",this.mouseMoveEventsHandler),document.body.removeEventListener("touchmove",this.mouseMoveEventsHandler),document.body.removeEventListener("mouseup",this.handleClickEventsHandler),document.removeEventListener("mouseleave",this.mouseOutEventHandler)}},{key:"windowResizeHandler",value:function(){var e=window.innerHeight;this.screenHeight=e,this.screenHeight95=Math.round(.95*e),this.setDesiredY(this.desiredHeight)}},{key:"stopDraggingAndSnapToNearest",value:function(){this.isDragging&&(this.isDragging=!1,this.dragStart=0,this.dragStartDesired=0,this.desiredHeight/this.maxHeight<.45?this.setDesiredY(0,!0):this.setDesiredY(this.maxHeight,!0))}},{key:"stopDraggingAndSnapToSpecific",value:function(e){this.isDragging&&(this.isDragging=!1,this.dragStart=0,this.dragStartDesired=0,"collapsed"===e?this.setDesiredY(0,!0):this.setDesiredY(this.maxHeight,!0))}},{key:"handleClickEventsHandler",value:function(e){var t=this;if(e instanceof MouseEvent)1===e.buttons?(this.isDragging=!0,this.dragStart=e.clientY,this.dragStartDesired=this.desiredHeight):0===e.buttons&&setTimeout((function(){return t.stopDraggingAndSnapToNearest()}));else if(e instanceof TouchEvent)if("touchstart"===e.type){var i=e.touches.item(0);if(!i)return;this.isDragging=!0,this.dragStart=i.clientY,this.dragStartDesired=this.desiredHeight}else"touchend"===e.type&&setTimeout((function(){return t.stopDraggingAndSnapToNearest()}))}},{key:"mouseOutEventHandler",value:function(e){this.isDragging&&this.stopDraggingAndSnapToNearest()}},{key:"mouseMoveEventsHandler",value:function(e){if(this.isDragging)if(e instanceof MouseEvent){if(this.isDragging){var t=this.dragStart-e.clientY;this.setDesiredY(this.dragStartDesired+t)}}else if(e instanceof TouchEvent){var i=e.touches.item(0);if(!i)return;if(this.isDragging){var n=this.dragStart-i.clientY;this.setDesiredY(this.dragStartDesired+n)}}}},{key:"checkOverflow",value:function(e){var t=e.style.overflow;t&&"visible"!==t||(e.style.overflow="hidden");var i=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight;return e.style.overflow=t,i}},{key:"getAbsoluteHeight",value:function(e){var t=window.getComputedStyle(e),i=parseFloat(t.marginTop)+parseFloat(t.marginBottom),n=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom);return Math.ceil(e.offsetHeight+i+n)}},{key:"componentDidUpdate",value:function(){this.elementBodyRef=document.querySelector(".bottom-sheet-body");var e,t,i=!1,n=Object.entries(this.state.featureStackSignals).filter((function(e){return!0===e[1].value&&-1===["reticle"].indexOf(e[0])})).length;if(n>0&&this.elementBodyRef){var r=this.getAbsoluteHeight(this.elementBodyRef);if(r<this.elementBodyRef.scrollHeight&&(i=!0),r){if(1===n){var a,s,o=null===(a=this.featuresController)||void 0===a?void 0:a.getFeatureClassByFeatureId(Object.entries(this.state.featureStackSignals).filter((function(e){return!0===e[1].value}))[0][0]);o&&(null===(s=o.modality)||void 0===s?void 0:s.mobileLayout)===l.USE_MINIMUN_HEIGHT||(r-=this.collapsedHeight)}this.maxHeight=Math.min(r,this.screenHeight95),this.setDesiredY(Math.min(r,this.screenHeight95),!1,!0)}else this.maxHeight=this.screenHeight95}else 0===n&&(this.maxHeight=this.screenHeight95);if(1===n){var c,u,d=null===(c=this.featuresController)||void 0===c?void 0:c.getFeatureClassByFeatureId(Object.entries(this.state.featureStackSignals).filter((function(e){return!0===e[1].value}))[0][0]);if(null!=d&&d.modality.mobileLayout){if((null==d?void 0:d.modality.mobileLayout)===l.USE_MINIMUN_HEIGHT){var h;
1null===(h=this.elementRef)||void 0===h||h.classList.remove("single-item-mode")}else if((null==d?void 0:d.modality.mobileLayout)===l.FULL_HEIGHT){var p;null===(p=this.elementRef)||void 0===p||p.classList.remove("single-item-mode"),i=!0,this.maxHeight=this.screenHeight95-this.collapsedHeight,this.setDesiredY(this.screenHeight95-this.collapsedHeight,!1,!0)}}else null===(u=this.elementRef)||void 0===u||u.classList.add("single-item-mode")}else{var v;null===(v=this.elementRef)||void 0===v||v.classList.remove("single-item-mode")}i?null===(e=this.elementRef)||void 0===e||e.classList.add("can-scroll"):null===(t=this.elementRef)||void 0===t||t.classList.remove("can-scroll")}},{key:"minimizeCurrentActiveFeature",value:function(){var e;1===Object.entries(this.state.featureStackSignals).filter((function(e){return!0===e[1].value&&-1===["reticle"].indexOf(e[0])})).length&&(null===(e=this.elementRef)||void 0===e||e.classList.remove("single-item-mode"),this.setDesiredY(0,!0))}},{key:"render",value:function(){var e,t,i,n,r,a,s,o,l,c,u,d,h,p,v,f,m,g,y,b,k,w,C,S,_,E=this,L=window.matchMedia("only screen and (max-width: 639px)").matches;if(!this.featuresController||!L)return st("div",{class:"mobile-bottom-sheet",children:st("div",{class:"bottom-sheet-body"})});var x,I,F=Object.entries(this.state.featureStackSignals).filter((function(e){return!0===e[1].value&&-1===["reticle"].indexOf(e[0])})).length;F>0?null===(x=document.querySelector(".mobile-history-pager-wrap"))||void 0===x||x.classList.add("hidden"):null===(I=document.querySelector(".mobile-history-pager-wrap"))||void 0===I||I.classList.remove("hidden");return st("div",{className:St({"mobile-bottom-sheet":!0,"fully-hidden":0===F}),children:[st("div",{class:"bottom-sheet-drag",onMouseDown:this.handleClickEventsHandler.bind(this),onTouchStart:this.handleClickEventsHandler.bind(this),onMouseUp:this.handleClickEventsHandler.bind(this),onTouchEnd:this.handleClickEventsHandler.bind(this),children:st("div",{class:"bottom-sheet-drag-handle"})}),st("div",{class:"bottom-sheet-body",children:[!0===(null===(e=this.state.featureStackSignals[nt.features.LANGUAGE])||void 0===e?void 0:e.value)?st(lt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.LANGUAGE)}}):null,!0===(null===(t=this.state.featureStackSignals[nt.features.UPDATES])||void 0===t?void 0:t.value)?st(Jt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.UPDATES)}}):null,!0===(null===(i=this.state.featureStackSignals[nt.features.INFO])||void 0===i?void 0:i.value)?st(bt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.INFO)}}):null,!0===(null===(n=this.state.featureStackSignals[nt.features.SETTINGS])||void 0===n?void 0:n.value)?st(Rt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.SETTINGS)}}):null,!0===(null===(r=this.state.featureStackSignals[nt.features.ONBOARDING])||void 0===r?void 0:r.value)&&st(Ti,{overlay:!1,mobileBottomSheetRecalculateCb:this.componentDidUpdate.bind(this),dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.ONBOARDING)},eventEmitter:null===(a=this.featuresController)||void 0===a?void 0:a.getEventEmitterByFeatureId(nt.features.ONBOARDING)}),!0===(null===(s=this.state.featureStackSignals[nt.features.MOBILE_APPS])||void 0===s?void 0:s.value)?st($i,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.MOBILE_APPS)}}):null,!0===(null===(o=this.state.featureStackSignals[nt.features.RULER])||void 0===o?void 0:o.value)?st(Pt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.RULER)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(l=this.featuresController)||void 0===l?void 0:l.getEventEmitterByFeatureId(nt.features.RULER)}):null,!0===(null===(c=this.state.featureStackSignals[nt.features.DRAW])||void 0===c?void 0:c.value)?st(Bt,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.DRAW)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(u=this.featuresController)||void 0===u?void 0:u.getEventEmitterByFeatureId(nt.features.DRAW)}):null,!0===(null===(d=this.state.featureStackSignals[nt.features.ARTY])||void 0===d?void 0:d.value)?st(_i,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.ARTY)},mobileBottomSheetRecalculateCb:this.componentDidUpdate.bind(this),eventEmitter:null===(h=this.featuresController)||void 0===h?void 0:h.getEventEmitterByFeatureId(nt.features.ARTY)}):null,!0===(null===(p=this.state.featureStackSignals[nt.features.FIRMS])||void 0===p?void 0:p.value)?st(Ei,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.FIRMS)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(v=this.featuresController)||void 0===v?void 0:v.getEventEmitterByFeatureId(nt.features.FIRMS)}):null,!0===(null===(f=this.state.featureStackSignals[nt.features.RADIATION])||void 0===f?void 0:f.value)?st(Li,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.RADIATION)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(m=this.featuresController)||void 0===m?void 0:m.getEventEmitterByFeatureId(nt.features.RADIATION)}):null,!0===(null===(g=this.state.featureStackSignals[nt.features.NUCLEAR])||void 0===g?void 0:g.value)?st(Mi,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.NUCLEAR)},mobileBottomSheetRecalculateCb:this.componentDidUpdate.bind(this),eventEmitter:null===(y=this.featuresController)||void 0===y?void 0:y.getEventEmitterByFeatureId(nt.features.NUCLEAR)}):null,!0===(null===(b=this.state.featureStackSignals[nt.features.WEATHER])||void 0===b?void 0:b.value)?st(Oi,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.WEATHER)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(k=this.featuresController)||void 0===k?void 0:k.getEventEmitterByFeatureId(nt.features.WEATHER)}):null,(null===(w=this.state.featureStackSignals[nt.features.CALENDAR])||void 0===w?void 0:w.value)&&st(Xi,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.CALENDAR)},minimizeButtonCb:1===F?this.minimizeCurrentActiveFeature.bind(this):void 0,eventEmitter:null===(C=this.featuresController)||void 0===C?void 0:C.getEventEmitterByFeatureId(nt.features.CALENDAR)}),(null===(S=this.state.featureStackSignals[nt.features.TRENCHES_LEGEND])||void 0===S?void 0:S.value)&&st(Qi,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.TRENCHES_LEGEND)}}),(null===(_=this.state.featureStackSignals[nt.features.STATS])||void 0===_?void 0:_.value)&&st(qi,{dismissSelf:function(){var e;return null===(e=E.featuresController)||void 0===e?void 0:e.disableFeatureById(nt.features.STATS)}})]})]})}}]),t}(y),dn=qe((function(){return new Date(1e3*ft.value.currentRevisionId.value)})),hn=qe((function(){return ft.value.revisions.value.findIndex((function(e){return e.id===ft.value.currentRevisionId.value}))})),pn=qe((function(){return Zt(dn.value.toString())})),vn=qe((function(){return ft.value.revisions.value.filter((function(e){return Zt(new Date(1e3*e.id).toString())===Zt(dn.value.toString())}))})),fn=qe((function(){return vn.value.findIndex((function(e){return e.id===ft.value.currentRevisionId.value}))})),mn=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"interval",null),J($(e),"revisionsController",null),J($(e),"polygonsLayer",null),J($(e),"historyService",new ht),J($(e),"calendarRange",{minDate:new Date(2022,3,3),maxDate:new Date}),e.state={playing:!1,speed:1,comparing:!1},e.revisionsControllerPollInterval=setInterval(e.tryPollRevisionsController.bind($(e)),100),e.polygonsLayerPollInterval=setInterval(e.tryPollPolygonsLayer.bind($(e)),100),e}return K(t,e),Y(t,[{key:"tryPollRevisionsController",value:function(){var e=this;this.revisionsController=window.revisionsController,this.revisionsController?(Ut.log("MobileHistoryPagerComponent","RevisionsController acquired"),this.revisionsController.loadLastRevision().then((function(t){var i=new Date(1e3*t.id);e.calendarRange.maxDate=i})),clearInterval(this.revisionsControllerPollInterval)):Ut.log("MobileHistoryPagerComponent","RevisionsController acqusition failed, retrying...")}},{key:"tryPollPolygonsLayer",value:function(){this.polygonsLayer=window.polygonsLayer,this.polygonsLayer?(Ut.log("MobileHistoryPagerComponent","PolygonsLayer acquired"),
1clearInterval(this.polygonsLayerPollInterval)):Ut.log("MobileHistoryPagerComponent]","PolygonsLayer acqusition failed, retrying...")}},{key:"componentDidUpdate",value:function(e,t){t.comparing===!this.state.comparing&&this.onShowVersionChanges()}},{key:"onSelectPage",value:function(e){var t=this;this.revisionsController&&this.revisionsController.revisions().then((function(i){if(t.revisionsController){var n=hn.value+1*e;t.revisionsController.selectRevision(i[n].id),t.setState({comparing:!1})}}))}},{key:"openListWithUpdates",value:function(){window.featuresController.enableFeatureById(nt.features.UPDATES)}},{key:"openCalendar",value:function(){window.featuresController.enableFeatureById(nt.features.CALENDAR)}},{key:"toggleVersionComparing",value:function(){this.setState({comparing:!this.state.comparing})}},{key:"onShowVersionChanges",value:function(){var e=this;this.state.comparing?this.historyService.fetchDifferenceByVersions(ft.value.currentRevisionId.value).then((function(t){e.polygonsLayer&&e.polygonsLayer.compareVersions(t)})).catch((function(e){return console.error("messages.historyRevisionError",e)})):this.polygonsLayer&&this.polygonsLayer.destroyComparingVersions()}},{key:"onSelectCalendar",value:function(e){var t=this;this.revisionsController&&this.revisionsController.revisions().then((function(i){if(t.revisionsController){var n=Zt(e.toString()),r=i.findIndex((function(e){return Zt(new Date(1e3*e.id).toString())===n}));if(-1!==r){var a=i[r];t.revisionsController.selectRevision(a.id)}t.setState({comparing:!1})}}))}},{key:"toggleHistoryPlayer",value:function(){var e=!this.state.playing;this.setState({playing:e}),e?this.toggleRevisionTicker(this.state.speed):this.stopRevisionsTicker()}},{key:"toggleSpeed",value:function(){var e=this,t=[{value:1},{value:3},{value:5}],i=t.findIndex((function(t){return t.value===e.state.speed})),n=t[(i+1)%t.length].value;!0===this.state.playing?(this.playHistory(n),this.setState({speed:n,playing:!0})):this.setState({speed:n})}},{key:"playHistory",value:function(e){var t=this,i=2e3/e;this.stopRevisionsTicker(),this.interval=setInterval((function(){ft.value.isLatestRevision.value?t.stopRevisionsTicker():t.onSelectPage(1)}),i)}},{key:"toggleRevisionTicker",value:function(e){this.interval?this.stopRevisionsTicker():this.playHistory(e)}},{key:"stopRevisionsTicker",value:function(){this.interval&&(clearInterval(this.interval),this.interval=null,this.setState({playing:!1,speed:1}))}},{key:"render",value:function(){var e=this;return st("div",{class:"mobile-history-pager-wrap",children:st("div",{class:"mobile-history-pager",children:[st("div",{class:"mobile-history-pager-btn-group hide-xs",children:[st("div",{class:"mobile-history-pager-btn",onClick:function(){return e.toggleSpeed()},children:[this.state.speed,"x"]}),st("div",{class:"mobile-history-pager-btn",onClick:function(){return e.toggleHistoryPlayer()},disabled:ft.value.isLatestRevision,children:st("span",{class:"material-symbols-outlined",children:this.state.playing?"pause":"play_arrow"})})]}),st("div",{class:"mobile-history-pager-btn",onClick:function(){return e.onSelectPage(-1)},disabled:ft.value.isFirstRevisionVersion,children:st("span",{class:"material-symbols-outlined",children:"navigate_before"})}),st("div",{class:"mobile-history-pager-btn",onClick:function(){return e.openCalendar()},children:[pn,vn.value.length>1&&st("sup",{class:"version",children:[fn.value+1,"/",vn.value.length]})]}),st("div",{class:"mobile-history-pager-btn",onClick:function(){return e.onSelectPage(1)},disabled:ft.value.isLatestRevision,children:st("span",{class:"material-symbols-outlined",children:"navigate_next"})}),st("div",{className:St({"mobile-history-pager-btn":!0,active:this.state.comparing}),onClick:function(){return e.toggleVersionComparing()},children:st("span",{class:"material-symbols-outlined",children:"compare_arrows"})})]})})}}]),t}(y),gn=function(){function e(){Z(this,e),J(this,"toastController",window.toastController)}return Y(e,[{key:"add",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success",n=arguments.length>
12?arguments[2]:void 0,r={id:Date.now(),type:i,message:e,close:!1,icon:!1};this.toastController.toasts.value=[].concat(ie(this.toastController.toasts.value),[r]),setTimeout((function(){return t.close(r.id)}),(null==n?void 0:n.life)||this.toastController.config.life)}},{key:"close",value:function(e){this.toastController.toasts.value=this.toastController.toasts.value.filter((function(t){return t.id!==e}))}}]),e}(),yn=function(e){var t=e.toast;return st("div",{className:St(J({toast:!0},t.type,!0)),children:st("span",{class:"toast-content",children:[t.icon&&st("span",{class:"material-symbols-outlined",children:function(){switch(t.type){case"info":return"info";case"error":return"report";default:return"check_circle"}}()}),st("span",{class:"toast-message",dangerouslySetInnerHTML:{__html:t.message},children:" "}),t.close&&st("span",{class:"toast-close-icon material-symbols-outlined",onClick:function(){(new gn).close(t.id)},children:"close"})]})})},bn=function(e){function t(e){var i;return Z(this,t),(i=U(this,t,[e])).props.controller.toasts.subscribe((function(e){i.setState({toasts:e})})),i}return K(t,e),Y(t,[{key:"render",value:function(){return st("div",{className:"toasts-stack",children:this.state.toasts.map((function(e){return st(yn,{toast:e})}))})}}]),t}(y),kn=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t,[e])),"translateSvc",window.translateService),J($(i),"toastSvc",new gn),i.setState({shown:!1,left:0,top:0}),i.coordsPickerControllerPollInterval=setInterval((function(){i.coordsPickerController||(i.coordsPickerController=window.coordsPickerController,i.coordsPickerController&&(Ut.log("CoordsPickerComponent","Controller acquired"),clearInterval(i.coordsPickerControllerPollInterval),i.bindToController()))}),250),i}return K(t,e),Y(t,[{key:"bindToController",value:function(){var e=this;this.coordsPickerController&&this.coordsPickerController.componentStateSignal.subscribe((function(t){var i;(e.setState({shown:t.shown,top:t.top,left:t.left,showMarker:t.showMarker,payload:t.payload,shareUrl:t.shareUrl,info:t.info}),!0===t.shown&&t.info&&"coords"===t.info.type)&&(null===(i=e.coordsPickerController)||void 0===i||i.doReverseGeocode())}))}},{key:"copyToClipboard",value:function(e){var t=this;navigator.clipboard.writeText(e.clipboardValue||e.value).then((function(){t.toastSvc.add(e.title+": "+t.translateSvc.translate("coordsPicker.coordsCopied"),"info")}))}},{key:"copyLinkToClipboard",value:function(){var e=this;this.state.shareUrl&&navigator.clipboard.writeText(this.state.shareUrl).then((function(){e.toastSvc.add(e.translateSvc.translate("coordsPicker.linkCopied"),"info")}))}},{key:"render",value:function(){var e,t,i,n,r,a,s,o,l,c,u,d,h,p=this;return st("div",{class:St({"coords-picker-wrap":!0,shown:this.state.shown}),style:{top:(this.state.top||-500)+"px",left:(this.state.left||-500)+"px"},children:[st("div",{class:"coords-picker-top",onMouseDown:function(){var e;return null===(e=p.coordsPickerController)||void 0===e?void 0:e.hidePicker()},onClick:function(){var e;return null===(e=p.coordsPickerController)||void 0===e?void 0:e.hidePicker()},onTouchStart:function(){var e;return null===(e=p.coordsPickerController)||void 0===e?void 0:e.hidePicker()},children:this.state.showMarker?st("div",{class:"coords-picker-marker-wrap",children:st("div",{class:"coords-picker-marker"})}):null}),st("div",{class:"coords-picker-bottom",children:st("div",{class:"coords-picker-popup",children:["settlement"===(null===(e=p.state.info)||void 0===e?void 0:e.type)?st("div",{class:"coords-picker-popup-row",children:[st("div",{class:"coords-picker-popup-row-value-wrap",children:[st(g,{children:[null!==(c=p.state.info)&&void 0!==c&&c.title&&"reverse"===(null===(u=p.state.info)||void 0===u?void 0:u.caller)?st("div",{class:"coords-picker-popup-row-title no-caps",children:st(gt,{children:"coordsPicker.pointIsIn"})}):null,null!==(d=p.state.info)&&void 0!==d&&d.title&&"search"===(null===(h=p.state.info)||void 0===h?void 0:h.caller)?st("div",{class:"coords-picker-popup-row-title no-caps",children:st(gt,{children:"coordsPicker.settlement"})}):null]}),null!==(r=p.state.info)&&void 0!==r&&r.title&&"reverse"===(null===(a=p.state.info)||void 0===a?void 0:a.caller)?st("div",{class:"coords-picker-popup-row-value no-caps clickable",onClick:function(){var e;return null===(e=p.coordsPickerController)||void 0===e?void 0:e.handleCityDeepLinkClick()},children:null===(s=p.state.info)||void 0===s?void 0:s.title}):st(g,{children:null!==(o=p.state.info)&&void 0!==o&&o.title?st("div",{class:"coords-picker-popup-row-value no-caps",children:null===(l=p.state.info)||void 0===l?void 0:l.title}):null}),null!==(i=p.state.info)&&void 0!==i&&i.subtitle?st("div",{class:"coords-picker-popup-row-title no-caps",children:null===(n=p.state.info)||void 0===n?void 0:n.subtitle}):null]}),p.state.shareUrl?st("div",{class:"coords-picker-popup-row-copy",onClick:function(){return p.copyLinkToClipboard()},children:st("span",{class:"material-symbols-outlined",children:"share"})}):null]}):"coords"===(null===(t=p.state.info)||void 0===t?void 0:t.type)?st("div",{class:"coords-picker-popup-row",children:[st("div",{class:"coords-picker-popup-row-value-wrap",children:st("div",{class:"coords-picker-popup-row-title",children:st(gt,{children:"coordsPicker.title"})})}),p.state.shareUrl?st("div",{class:"coords-picker-popup-row-copy",onClick:function(){return p.copyLinkToClipboard()},children:st("span",{class:"material-symbols-outlined",children:"share"})}):null]}):void 0,this.state.payload&&this.state.payload.map((function(e){return st("div",{class:"coords-picker-popup-row",children:[st("div",{class:"coords-picker-popup-row-value-wrap",children:[st("div",{class:"coords-picker-popup-row-title",children:e.title}),st("div",{class:"coords-picker-popup-row-value",children:e.value})]}),st("div",{class:"coords-picker-popup-row-copy",onClick:function(){return p.copyToClipboard(e)},children:st("span",{class:"material-symbols-outlined",children:"content_copy"})})]})}))]})})]})}}]),t}(y),wn=function(e){function t(){return Z(this,t),U(this,t,arguments)}
1return K(t,e),Y(t,[{key:"componentDidMount",value:function(){window.domReady||(console.log("Setting DOM Ready flag"),window.domReady=!0)}},{key:"render",value:function(){return st("div",{class:"app",children:[st("div",{class:"ext-features-wrap"}),st(sn,{controller:window.dialogController}),st(bn,{controller:window.toastController}),st(an,{}),st(ln,{}),st(cn,{}),st(mn,{}),st(un,{}),st("section",{class:"sidebar"}),st("section",{class:"main",children:[st("div",{class:"map-preloader",children:st("div",{class:"knight",children:st(yt,{})})}),st(kn,{}),st("a",{href:"https://t.me/DeepStateUA",target:"_blank",class:"drawing-deepstate-logo",children:st("img",{alt:"DeepState Logo",src:"/images/logo.png"})}),st("div",{id:"canvas-wrapper",style:"position: absolute; z-index: 590; inset: 0px; width: 100%; height: 100%; display: none;",children:st("canvas",{style:"width: 100%; height: 100%;",id:"fabric-canvas"})}),st("div",{id:"map"})]})]})}}]),t}(y),Cn=function(){function e(){var t=this;Z(this,e),J(this,"profileService",window.profile);var i="",n=this.profileService.getSetting("theme");n&&(i="dark"===n?"dark":"light"),this.listenDeviceTheme((function(e){t.setTheme(i||e)}))}return Y(e,[{key:"listenDeviceTheme",value:function(e){var t=this,i=window.matchMedia("(prefers-color-scheme: dark)");i.matches?this.replaceThemeConfig("dark"):this.replaceThemeConfig("light"),e&&e(i.matches?"dark":"light"),i.addEventListener("change",(function(e){t.replaceThemeConfig(e.matches?"dark":"light")}))}},{key:"setTheme",value:function(e){var t;(t=document.body.classList).remove.apply(t,ie(ie(document.body.classList).filter((function(e){return e.startsWith("theme-")})))),document.body.classList.add("theme-".concat(e)),this.profileService.updateSetting("theme",e),this.currentTheme=e;var i=window.mapController;i&&i.setBaseLayer(i.getBaseLayer().value,12,!0),Array.isArray(window.dataLayer)&&window.dataLayer.push({event:"theme_"+e})}},{key:"replaceThemeConfig",value:function(e){var t=document.querySelectorAll('[rel="icon"]'),i=document.querySelectorAll('[rel="manifest"]');t.forEach((function(t){t.href="/assets/favicon/".concat(e,"/favicon.ico")})),i.forEach((function(t){t.href="/assets/favicon/".concat(e,"/site.webmanifest")}))}},{key:"getTheme",value:function(){return this.currentTheme}}]),e}();function Sn(){}function _n(){_n.init.call(this)}function En(e){return void 0===e._maxListeners?_n.defaultMaxListeners:e._maxListeners}function Ln(e,t,i,n){var r,a,s;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),a=e._events),s=a[t]):(a=e._events=new Sn,e._eventsCount=0),s){if("function"==typeof s?s=a[t]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),!s.warned&&(r=En(e))&&r>0&&s.length>r){s.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=s.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(o)}}else s=a[t]=i,++e._eventsCount;return e}function xn(e,t,i){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,i.apply(e,arguments))}return r.listener=i,r}function In(e){var t=this._events;if(t){var i=t[e];if("function"==typeof i)return 1;if(i)return i.length}return 0}function Fn(e,t){for(var i=new Array(t);t--;)i[t]=e[t];return i}Sn.prototype=Object.create(null),_n.EventEmitter=_n,_n.usingDomains=!1,_n.prototype.domain=void 0,_n.prototype._events=void 0,_n.prototype._maxListeners=void 0,_n.defaultMaxListeners=10,_n.init=function(){this.domain=null,_n.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Sn,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},_n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},_n.prototype.getMaxListeners=function(){return En(this)},_n.prototype.emit=function(e){var t,i,n,r,a,s,o,l="error"===e;if(s=this._events)l=l&&null==s.error;else if(!l)return!1;if(o=this.domain,l){if(t=arguments[1],!o){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=o,t.domainThrown=!1,o.emit("error",t),!1}if(!(i=s[e]))return!1;var u="function"==typeof i;switch(n=arguments.length){case 1:!function(e,t,i){if(t)e.call(i);else for(var n=e.length,r=Fn(e,n),a=0;a<n;++a)r[a].call(i)}(i,u,this);break;case 2:!function(e,t,i,n){if(t)e.call(i,n);else for(var r=e.length,a=Fn(e,r),s=0;s<r;++s)a[s].call(i,n)}(i,u,this,arguments[1]);break;case 3:!function(e,t,i,n,r){if(t)e.call(i,n,r);else for(var a=e.length,s=Fn(e,a),o=0;o<a;++o)s[o].call(i,n,r)}(i,u,this,arguments[1],arguments[2]);break;case 4:!function(e,t,i,n,r,a){if(t)e.call(i,n,r,a);else for(var s=e.length,o=Fn(e,s),l=0;l<s;++l)o[l].call(i,n,r,a)}(i,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(n-1),a=1;a<n;a++)r[a-1]=arguments[a];!function(e,t,i,n){if(t)e.apply(i,n);else for(var r=e.length,a=Fn(e,r),s=0;s<r;++s)a[s].apply(i,n)}(i,u,this,r)}return!0},_n.prototype.addListener=function(e,t){return Ln(this,e,t,!1)},_n.prototype.on=_n.prototype.addListener,_n.prototype.prependListener=function(e,t){return Ln(this,e,t,!0)},_n.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,xn(this,e,t)),this},_n.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,xn(this,e,t)),this},_n.prototype.removeListener=function(e,t){var i,n,r,a,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(i=n[e]))return this;if(i===t||i.listener&&i.listener===t)0==--this._eventsCount?this._events=new Sn:(delete n[e],n.removeListener&&this.emit
1("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,a=i.length;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){s=i[a].listener,r=a;break}if(r<0)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new Sn,this;delete n[e]}else!function(e,t){for(var i=t,n=i+1,r=e.length;n<r;i+=1,n+=1)e[i]=e[n];e.pop()}(i,r);n.removeListener&&this.emit("removeListener",e,s||t)}return this},_n.prototype.off=function(e,t){return this.removeListener(e,t)},_n.prototype.removeAllListeners=function(e){var t,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new Sn,this._eventsCount=0):i[e]&&(0==--this._eventsCount?this._events=new Sn:delete i[e]),this;if(0===arguments.length){for(var n,r=Object.keys(i),a=0;a<r.length;++a)"removeListener"!==(n=r[a])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new Sn,this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},_n.prototype.listeners=function(e){var t,i,n=this._events;return i=n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(t):[],i},_n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):In.call(e,t)},_n.prototype.listenerCount=In,_n.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Mn=function(){function e(t){Z(this,e),J(this,"accessibilityControllerRef",window.accessibilityController),J(this,"profileService",window.profile),J(this,"translateService",window.translateService),J(this,"tileLoadErrors",new _n),J(this,"baseLayer",new Ve("")),J(this,"baseLayers",{base:null,overlay:null}),J(this,"mapReady",new Ve(!1)),this.map=L.map(t,{minZoom:6,zoomSnap:1,zoomDelta:1,maxZoom:16,zoomControl:!1,maxBounds:[[74.007053,-11.207186],[31.952162,157.5]],zoom:6,center:[49.43832,32.05268],zoomAnimation:!this.accessibilityControllerRef.getSettings().reduceMotion,fadeAnimation:!this.accessibilityControllerRef.getSettings().reduceMotion,markerZoomAnimation:!this.accessibilityControllerRef.getSettings().reduceMotion}),this.map.whenReady(this.handleMapReadyEvent.bind(this))}return Y(e,[{key:"handleMapReadyEvent",value:function(){var e=this;this.map.once("layeradd",(function(){Ut.log("MapController","Map ready"),e.mapReady.value=!0,requestAnimationFrame((function(){setTimeout((function(){var e=document.querySelector(".map-preloader");e&&e.remove()}),500)}))})),this.setBaseLayer(this.profileService.getSetting("mapLayer"))}},{key:"getLeafletMap",value:function(){return this.map}},{key:"setBaseLayer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nt.layers.DEFAULT,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t!==this.baseLayer.value||n){16!==this.map.getMaxZoom()&&this.map.setMaxZoom(16);var r=document.body.classList.contains("theme-dark"),a=this.translateService.language;if(t===nt.layers.DEFAULT)this.baseLayers.base&&(this.baseLayers.base.remove(),this.baseLayers.base=null),this.baseLayers.base=L.tileLayer("https://st1.deepstatemap.live/styles/DSUkraine".concat("uk"===a?"Uk":"En").concat(r?"Dark":"","/{z}/{x}/{y}@2x.webp"),{maxZoom:16,maxNativeZoom:14,attribution:'&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}),this.map.getContainer().style.backgroundColor=r?"#262b36":"#FFF9ED",this.map.getContainer().classList.remove("bg-satellite"),this.baseLayers.base.addTo(this.map),this.baseLayers.overlay&&(this.baseLayers.overlay.remove(),this.baseLayers.overlay=null);else if(t===nt.layers.TOPOGRAPHIC)this.setBaseLayer(nt.layers.DEFAULT),this.baseLayers.overlay&&(this.baseLayers.overlay.remove(),this.baseLayers.overlay=null),this.baseLayers.overlay||(this.baseLayers.overlay=L.tileLayer("https://st1.deepstatemap.live/data/hillshade_ukraine/{z}/{x}/{y}.png",{minNativeZoom:5,maxNativeZoom:12,maxZoom:16,tileSize:256,bounds:[[44.02738,22.10166],[52.42326,40.25842]],opacity:r?1:.75,attribution:'&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(this.map),this.map.getContainer().style.backgroundColor=r?"#262b36":"#FFF9ED",this.map.getContainer().classList.remove("bg-satellite"));else if(t===nt.layers.SATELLITE)this.baseLayers.base&&(this.baseLayers.base.remove(),this.baseLayers.base=null),this.baseLayers.overlay&&(this.baseLayers.overlay.remove(),this.baseLayers.overlay=null),this.baseLayers.base=L.tileLayer("https://st1.deepstatemap.live/data/satellite_lowres/{z}/{x}/{y}.png",{minNativeZoom:6,maxNativeZoom:13,bounds:[[44.02738,22.10166],[52.42326,40.25842]],attribution:'&copy; <a href="https://www.maptiler.com/copyright/">MapTiler</a> &copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}),this.map.getContainer().style.backgroundColor="rgb(31, 55, 31)",this.map.getContainer().classList.add("bg-satellite"),this.baseLayers.base.addTo(this.map),this.baseLayers.overlay||(this.baseLayers.overlay=L.tileLayer("https://st1.deepstatemap.live/data/dsm_labels_".concat("uk"===a?"uk":"en","/{z}/{x}/{y}.png"),{minNativeZoom:6,maxNativeZoom:13,tileSize:256,bounds:[[44.02738,22.10166],[52.42326,40.25842]],opacity:.75}).addTo(this.map));else{if(t!==nt.layers.OFFLINE)return void this.setBaseLayer(nt.layers.DEFAULT);this.baseLayers.base&&(this.baseLayers.base.remove(),this.baseLayers.base=null),this.baseLayers.overlay&&(this.baseLayers.overlay.remove(),this.baseLayers.overlay=null),this.baseLayers.base=L.tileLayer("/offline_tiles/uk/{z}/{x}/{y}.webp",{minZoom:6,maxZoom:16,maxNativeZoom:i,tms:!1,attribution:'&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'}),this.baseLayers.base.addTo(this.map),this.map.getContainer().style.backgroundColor="#FFF9ED"}this.baseLayer.value=t,t!==nt.layers.OFFLINE&&this.profileService.updateSetting("mapLayer",t),this.baseLayers.base&&(this.baseLayers.base.off("tileerror"),this.baseLayers.base.on("tileerror",(function(t){e.tileLoadErrors.emit("base",t)}))),this.baseLayers.overlay&&(this.baseLayers.overlay.off("tileerror"),this.baseLayers.overlay.on("tileerror",(function(t){e.tileLoadErrors.emit("overlay",t)})))}}},{key:"setCustomBaseLayer",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16,r=arguments.length>4?arguments[4]:void 0;if(this.baseLayers.base&&(this.baseLayers.base.remove(),this.baseLayers.base=null),this.baseLayers.overlay&&(this.baseLayers.overlay.remove(),this.baseLayers.overlay=null),this.map.setMa
1xZoom(n),this.baseLayers.base=L.tileLayer(e,{minNativeZoom:6,maxNativeZoom:n,maxZoom:n,bounds:[[44.02738,22.10166],[52.42326,40.25842]],attribution:i}),this.map.getContainer().style.backgroundColor=r||"#FFF9ED",this.map.getContainer().classList.add("bg-satellite"),this.baseLayers.base.addTo(this.map),!this.baseLayers.overlay&&t)return-1===Object.keys(this.map.getPanes()).indexOf("custom-overlay")&&this.map.createPane("custom-overlay"),this.baseLayers.overlay=L.tileLayer(t,{minNativeZoom:6,maxNativeZoom:n,tileSize:256,bounds:[[44.02738,22.10166],[52.42326,40.25842]],opacity:.75,pane:"custom-overlay"}).addTo(this.map),void(this.baseLayer.value=nt.layers.CUSTOM)}},{key:"getBaseLayer",value:function(){return this.baseLayer}}]),e}(),Rn=function(){function e(){Z(this,e),J(this,"apiUrl",""),this.httpClient=new dt(this.apiUrl)}return Y(e,[{key:"fetchFeatureFlags",value:function(){return this.httpClient.get("/api/feature-flags")}}]),e}(),An=function(){function e(){Z(this,e),J(this,"appFeatures",[]),J(this,"featureSignals",{}),J(this,"featureToolbarElements",{}),J(this,"featureChildNodes",{}),J(this,"featureEventEmitters",{}),J(this,"featuresListUpdatedSignal",Ge(0)),J(this,"disableFeatureActions",!1),J(this,"featureFlags",Ge({})),this.loadFeatureFlags()}return Y(e,[{key:"registerFeatures",value:function(e){var t=this;Ut.startGroup("Features Controller"),Ut.logGrey("Registering features...."),e.forEach((function(e){t.registerFeature(e),Ut.logGreen("Registration: ".concat(e.appFeatureId),{feature:e,features:t.appFeatures})})),Ut.logGrey("All features was registered successfully!"),Ut.endGroup()}},{key:"registerFeature",value:function(e){var t=this;if(this.appFeatures.push(e),this.featureSignals[e.appFeatureId]=Ge(e.isEnabled||!1),e.toolbarButtonSelector){var i=document.querySelector(e.toolbarButtonSelector);i&&(i.addEventListener("click",(function(){return t.handleToolbarClick(e.appFeatureId)})),this.featureToolbarElements[e.appFeatureId]=i)}e.stackNode&&(this.featureChildNodes[e.appFeatureId]=e.stackNode),this.featureEventEmitters[e.appFeatureId]=new _n,this.featuresListUpdatedSignal.value=+new Date}},{key:"getFeatureClassByFeatureId",value:function(e){return this.appFeatures.find((function(t){return t.appFeatureId===e}))}},{key:"getFeatureSignals",value:function(){return this.featureSignals}},{key:"getFeatureChildNodes",value:function(){return this.featureChildNodes}},{key:"getFeature",value:function(e){return this.appFeatures.find((function(t){return t.appFeatureId===e}))}},{key:"getEventEmitterByFeatureId",value:function(e){return this.featureEventEmitters[e]}},{key:"setDisableFeatureActions",value:function(e){this.disableFeatureActions=e}},{key:"disableFeatureById",value:function(e){var t,i;if(!this.disableFeatureActions){var n=this.getFeature(e);n&&(n.disable(),null===(t=this.featureToolbarElements[n.appFeatureId])||void 0===t||t.classList.remove("active"),this.featureSignals[n.appFeatureId].value=!1,null===(i=this.featureEventEmitters[n.appFeatureId])||void 0===i||i.removeAllListeners(),this.featuresListUpdatedSignal.value=+new Date)}}},{key:"enableFeatureById",value:function(e){this.disableFeatureActions||this.handleToolbarClick(e)}},{key:"handleToolbarClick",value:function(e){var t;if(!this.disableFeatureActions){var i=this.getFeature(e);if(i){var n,r;if(!0===this.featureSignals[i.appFeatureId].value)return i.disable(),null===(n=this.featureToolbarElements[i.appFeatureId])||void 0===n||n.classList.remove("active"),this.featureSignals[i.appFeatureId].value=!1,null===(r=this.featureEventEmitters[i.appFeatureId])||void 0===r||r.removeAllListeners(),void(this.featuresListUpdatedSignal.value=+new Date);if(!i.modality.standalone){for(var a=0,s=Object.entries(this.featureSignals);a<s.length;a++){var o=s[a];if(!0===o[1].value){var l,c,u=this.getFeature(o[0]);if(u&&!0===u.modality.exclusive)u.modality.standalone||u.disable(),null===(l=this.featureToolbarElements[o[0]])||void 0===l||l.classList.remove("active"),null===(c=this.featureEventEmitters[o[0]])||void 0===c||c.removeAllListeners(),o[1].value=!1,this.featuresListUpdatedSignal.value=+new Date}}if(!0===i.modality.exclusive)for(var d=0,h=Object.entries(this.featureSignals);d<h.length;d++){var p,v,f=h[d],m=this.getFeature(f[0]);null!=m&&m.modality.standalone||(null==m||m.disable(),f[1].value=!1),null===(p=this.featureToolbarElements[f[0]])||void 0===p||p.classList.remove("active"),null===(v=this.featureEventEmitters[f[0]])||void 0===v||v.removeAllListeners()}if(i.modality.incompatible.length>0)for(var g=0,y=Object.entries(this.featureSignals);g<y.length;g++){var b,k,w,C=y[g];if(-1!==i.modality.incompatible.indexOf(C[0]))null===(b=this.getFeature(C[0]))||void 0===b||b.disable(),null===(k=this.featureToolbarElements[C[0]])||void 0===k||k.classList.remove("active"),null===(w=this.featureEventEmitters[C[0]])||void 0===w||w.removeAllListeners(),C[1].value=!1}if(i.modality.requires.length>0)for(var S=0,_=Object.entries(this.featureSignals);S<_.length;S++){var E,L,x=_[S];
1if(-1!==i.modality.requires.indexOf(x[0]))null===(E=this.getFeature(x[0]))||void 0===E||E.enable(),null===(L=this.featureToolbarElements[x[0]])||void 0===L||L.classList.add("active"),x[1].value=!0}}i.enable(),null===(t=this.featureToolbarElements[i.appFeatureId])||void 0===t||t.classList.add("active"),this.featureSignals[i.appFeatureId].value=!0,this.featuresListUpdatedSignal.value=+new Date,Array.isArray(window.dataLayer)&&window.dataLayer.push({event:e})}}}},{key:"listenFeatureFlag",value:function(e){var t=this;return qe((function(){return t.featureFlags.value[e]}))}},{key:"loadFeatureFlags",value:function(){var e=this;(new Rn).fetchFeatureFlags().then((function(t){e.featureFlags.value=t}))}}]),e}(),Tn=function(){function e(){var t=this;Z(this,e),this.firstDay=new Date(2022,1,24),setTimeout((function(){t.updateTitleWithWarDay(t.firstDay)}),5e3)}return Y(e,[{key:"enable",value:function(){this.updateTitleWithWarDay(this.firstDay)}},{key:"calculateWarDay",value:function(e){var t=(new Date).getTime()-e.getTime();return Math.ceil(t/864e5)}},{key:"updateTitleWithWarDay",value:function(e){var t=document.head.querySelector("title");if(t){var i=t.innerHTML.split("|"),n=this.calculateWarDay(e);t.innerHTML="".concat(i[0]," | День ").concat(n," | ").concat(i[1])}}}]),e}(),Pn=function(){function e(t){Z(this,e),J(this,"loaded$",qe((function(){return Object.keys(rt.value.translates.value).length>0}))),rt.value.code.value=t}return Y(e,[{key:"translate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.loaded$.value)return e;var i,n=e.split("."),r=rt.value.translates.value,a=ae(n);try{for(a.s();!(i=a.n()).done;){var s=i.value;r=r[s]||e}}catch(e){a.e(e)}finally{a.f()}var o="string"==typeof r?r.match(/{{(.*?)}}/g):null;o&&o.map((function(e){return e.replace(/[{}]/g,"")})).forEach((function(e){var i=new RegExp("{{".concat(e,"}}"),"g");r=r.replace(i,t[e])}));return r}},{key:"language",get:function(){return rt.value.code.value}}]),e}(),Nn=function(){function e(){Z(this,e),J(this,"apiUrl",""),this.httpClient=new dt(this.apiUrl)}return Y(e,[{key:"fetchTranslates",value:function(e){return this.httpClient.get("/api/translates/public",{language:e})}}]),e}(),Dn=function(){function e(){Z(this,e),J(this,"storageKey","dsm_language"),this.profileService=window.profile;for(var t=null,i={"/en":"en"},n=0,r=Object.keys(i);n<r.length;n++){var a=r[n];if(location.pathname.startsWith(a)){t=i[a];break}}var s=t||this.getLanguageCode();this.translateService=new Pn(s),rt.value.translates.value=this.getLocalTranslations(),this.loadTranslation(s).then((function(e){rt.value.translates.value=e,rt.value.code.value=s}))}return Y(e,[{key:"setLanguage",value:function(e){return(new pt).setItem(this.storageKey,e),this.profileService.updateSetting("language",e),this.loadTranslation(e)}},{key:"getLanguageCode",value:function(){return this.profileService.getSetting("language")}},{key:"getLanguageData",value:function(){return rt.value.language.value}},{key:"getLocalTranslations",value:function(){return this.profileService.getSetting("translates")}},{key:"setTranslations",value:function(e){return this.profileService.updateSetting("translates",e)}},{key:"loadTranslation",value:function(e){var t=this;return(new Nn).fetchTranslates(e).then((function(e){return t.setTranslations(e),e})).catch((function(){return t.getLocalTranslations()}))}}]),e}(),On=6371008.8,Un={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*On,kilometers:6371.0088,kilometres:6371.0088,meters:On,metres:On,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:On/1852,radians:1,yards:6967335.223679999};function Hn(e,t,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=t||{},n.geometry=e,n}function Bn(e,t,i){void 0===i&&(i={});for(var n=0,r=e;n<r.length;n++){var a=r[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return Hn({type:"Polygon",coordinates:e}
1,t,i)}function Vn(e){return 180*(e%(2*Math.PI))/Math.PI}function Gn(e){return e%360*Math.PI/180}function jn(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Wn(e){return"Feature"===e.type?e.geometry:e}var zn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Zn(){throw new Error("setTimeout has not been defined")}function qn(){throw new Error("clearTimeout has not been defined")}var Yn=Zn,Jn=qn;function Kn(e){if(Yn===setTimeout)return setTimeout(e,0);if((Yn===Zn||!Yn)&&setTimeout)return Yn=setTimeout,setTimeout(e,0);try{return Yn(e,0)}catch(t){try{return Yn.call(null,e,0)}catch(t){return Yn.call(this,e,0)}}}"function"==typeof zn.setTimeout&&(Yn=setTimeout),"function"==typeof zn.clearTimeout&&(Jn=clearTimeout);var Xn,Qn=[],$n=!1,er=-1;function tr(){$n&&Xn&&($n=!1,Xn.length?Qn=Xn.concat(Qn):er=-1,Qn.length&&ir())}function ir(){if(!$n){var e=Kn(tr);$n=!0;for(var t=Qn.length;t;){for(Xn=Qn,Qn=[];++er<t;)Xn&&Xn[er].run();er=-1,t=Qn.length}Xn=null,$n=!1,function(e){if(Jn===clearTimeout)return clearTimeout(e);if((Jn===qn||!Jn)&&clearTimeout)return Jn=clearTimeout,clearTimeout(e);try{return Jn(e)}catch(t){try{return Jn.call(null,e)}catch(t){return Jn.call(this,e)}}}(e)}}function nr(e,t){this.fun=e,this.array=t}nr.prototype.run=function(){this.fun.apply(null,this.array)};function rr(){}var ar=rr,sr=rr,or=rr,lr=rr,cr=rr,ur=rr,dr=rr;var hr=zn.performance||{},pr=hr.now||hr.mozNow||hr.msNow||hr.oNow||hr.webkitNow||function(){return(new Date).getTime()};var vr=new Date;var fr={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];Qn.push(new nr(e,t)),1!==Qn.length||$n||Kn(ir)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ar,addListener:sr,once:or,off:lr,removeListener:cr,removeAllListeners:ur,emit:dr,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*pr.call(hr),i=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(i-=e[0],(n-=e[1])<0&&(i--,n+=1e9)),[i,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-vr)/1e3}};
2/**
3     * splaytree v3.1.2
4     * Fast Splay tree for Node and browser
5     *
6     * @author Alexander Milevski <[email protected]>
7     * @license MIT
8     * @preserve
9     */
10/*! *****************************************************************************
11    Copyright (c) Microsoft Corporation. All rights reserved.
12    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
13    this file except in compliance with the License. You may obtain a copy of the
14    License at http://www.apache.org/licenses/LICENSE-2.0
15
16    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
18    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
19    MERCHANTABLITY OR NON-INFRINGEMENT.
20
21    See the Apache Version 2.0 License for specific language governing permissions
22    and limitations under the License.
23    ***************************************************************************** */function mr(e,t){var i,n,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}var gr=function(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null};function yr(e,t){return e>t?1:e<t?-1:0}function br(e,t,i){for(var n=new gr(null,null),r=n,a=n;;){var s=i(e,t.key);if(s<0){if(null===t.left)break;if(i(e,t.left.key)<0){var o=t.left;if(t.left=o.right,o.right=t,null===(t=o).left)break}a.left=t,a=t,t=t.left}else{if(!(s>0))break;if(null===t.right)break;
23if(i(e,t.right.key)>0){o=t.right;if(t.right=o.left,o.left=t,null===(t=o).right)break}r.right=t,r=t,t=t.right}}return r.right=t.left,a.left=t.right,t.left=n.right,t.right=n.left,t}function kr(e,t,i,n){var r=new gr(e,t);if(null===i)return r.left=r.right=null,r;var a=n(e,(i=br(e,i,n)).key);return a<0?(r.left=i.left,r.right=i,i.left=null):a>=0&&(r.right=i.right,r.left=i,i.right=null),r}function wr(e,t,i){var n=null,r=null;if(t){var a=i((t=br(e,t,i)).key,e);0===a?(n=t.left,r=t.right):a<0?(r=t.right,t.right=null,n=t):(n=t.left,t.left=null,r=t)}return{left:n,right:r}}function Cr(e,t,i,n,r){if(e){n(t+(i?"└── ":"├── ")+r(e)+"\n");var a=t+(i?"    ":"│   ");e.left&&Cr(e.left,a,!1,n,r),e.right&&Cr(e.right,a,!0,n,r)}}var Sr=function(){function e(e){void 0===e&&(e=yr),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=kr(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var i=new gr(e,t);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=br(e,this._root,n),a=n(e,r.key);return 0===a?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,i){var n;return null===t?null:0===i(e,(t=br(e,t,i)).key)?(null===t.left?n=t.right:(n=br(e,t.left,i)).right=t.right,this._size--,n):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=br(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var n=i(e,t.key);if(0===n)return t;t=n<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=br(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var n=i(e,t.key);if(0===n)return!0;t=n<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),e.call(t,i),i=i.right):r=!0;return this},e.prototype.range=function(e,t,i,n){for(var r=[],a=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(a((s=r.pop()).key,t)>0)break;if(a(s.key,e)>=0&&i.call(n,s))return this;s=s.right}return this},e.prototype.keys=function(){var e=[];return this.forEach((function(t){var i=t.key;return e.push(i)})),e},e.prototype.values=function(){var e=[];return this.forEach((function(t){var i=t.data;return e.push(i)})),e},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,i=!1,n=0,r=[];!i;)if(t)r.push(t),t=t.left;else if(r.length>0){if(t=r.pop(),n===e)return t;n++,t=t.right}else i=!0;return null},e.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var n=this._comparator;t;){var r=n(e.key,t.key);if(0===r)break;r<0?(i=t,t=t.left):t=t.right}return i},e.prototype.prev=function(e){var t=this._root,i=null;if(null!==e.left){for(i=e.left;i.right;)i=i.right;return i}for(var n=this._comparator;t;){var r=n(e.key,t.key);if(0===r)break;r<0?t=t.left:(i=t,t=t.right)}return i},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return function(e){var t=e,i=[],n=!1,r=new gr(null,null),a=r;for(;!n;)t?(i.push(t),t=t.left):i.length>0?t=(t=a=a.next=i.pop()).right:n=!0;return a.next=null,r.next}(this._root)},e.prototype.load=function(e,t,i){void 0===t&&(t=[]),void 0===i&&(i=!1);var n=e.length,r=this._comparator;if(i&&Lr(e,t,0,n-1,r),null===this._root)this._root=_r(e,t,0,n),this._size=n;else{var a=function(e,t,i){var n=new gr(null,null),r=n,a=e,s=t;
23for(;null!==a&&null!==s;)i(a.key,s.key)<0?(r.next=a,a=a.next):(r.next=s,s=s.next),r=r.next;null!==a?r.next=a:null!==s&&(r.next=s);return n.next}(this.toList(),function(e,t){for(var i=new gr(null,null),n=i,r=0;r<e.length;r++)n=n.next=new gr(e[r],t[r]);return n.next=null,i.next}(e,t),r);n=this._size+n,this._root=Er({head:a},0,n)}return this},e.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return Cr(this._root,"",!0,(function(e){return t.push(e)}),e),t.join("")},e.prototype.update=function(e,t,i){var n=this._comparator,r=wr(e,this._root,n),a=r.left,s=r.right;n(e,t)<0?s=kr(t,i,s,n):a=kr(t,i,a,n),this._root=function(e,t,i){return null===t?e:(null===e||((t=br(e.key,t,i)).left=e),t)}(a,s,n)},e.prototype.split=function(e){return wr(e,this._root,this._comparator)},e.prototype[Symbol.iterator]=function(){var e,t,i;return mr(this,(function(n){switch(n.label){case 0:e=this._root,t=[],i=!1,n.label=1;case 1:return i?[3,6]:null===e?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return 0===t.length?[3,4]:[4,e=t.pop()];case 3:return n.sent(),e=e.right,[3,5];case 4:i=!0,n.label=5;case 5:return[3,1];case 6:return[2]}}
23))},e}();function _r(e,t,i,n){var r=n-i;if(r>0){var a=i+Math.floor(r/2),s=e[a],o=t[a],l=new gr(s,o);return l.left=_r(e,t,i,a),l.right=_r(e,t,a+1,n),l}return null}function Er(e,t,i){var n=i-t;if(n>0){var r=t+Math.floor(n/2),a=Er(e,t,r),s=e.head;return s.left=a,e.head=e.head.next,s.right=Er(e,r+1,i),s}return null}function Lr(e,t,i,n,r){if(!(i>=n)){for(var a=e[i+n>>1],s=i-1,o=n+1;;){do{s++}while(r(e[s],a)<0);do{o--}while(r(e[o],a)>0);if(s>=o)break;var l=e[s];e[s]=e[o],e[o]=l,l=t[s],t[s]=t[o],t[o]=l}Lr(e,t,i,o,r),Lr(e,t,o+1,n,r)}}const xr=134217729,Ir=33306690738754706e-32;function Fr(e,t,i,n,r){let a,s,o,l,c=t[0],u=n[0],d=0,h=0;u>c==u>-c?(a=c,c=t[++d]):(a=u,u=n[++h]);let p=0;if(d<e&&h<i)for(u>c==u>-c?(s=c+a,o=a-(s-c),c=t[++d]):(s=u+a,o=a-(s-u),u=n[++h]),a=s,0!==o&&(r[p++]=o);d<e&&h<i;)u>c==u>-c?(s=a+c,l=s-a,o=a-(s-l)+(c-l),c=t[++d]):(s=a+u,l=s-a,o=a-(s-l)+(u-l),u=n[++h]),a=s,0!==o&&(r[p++]=o);for(;d<e;)s=a+c,l=s-a,o=a-(s-l)+(c-l),c=t[++d],a=s,0!==o&&(r[p++]=o);for(;h<i;)s=a+u,l=s-a,o=a-(s-l)+(u-l),u=n[++h],a=s,0!==o&&(r[p++]=o);return 0===a&&0!==p||(r[p++]=a),p}function Mr(e){return new Float64Array(e)}const Rr=22204460492503146e-32,Ar=11093356479670487e-47,Tr=Mr(4),Pr=Mr(8),Nr=Mr(12),Dr=Mr(16),Or=Mr(4);function Ur(e,t,i,n,r,a){const s=(t-a)*(i-r),o=(e-r)*(n-a),l=s-o,c=Math.abs(s+o);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,i,n,r,a,s){let o,l,c,u,d,h,p,v,f,m,g,y,b,k,w,C,S,_;const E=e-r,L=i-r,x=t-a,I=n-a;k=E*I,h=xr*E,p=h-(h-E),v=E-p,h=xr*I,f=h-(h-I),m=I-f,w=v*m-(k-p*f-v*f-p*m),C=x*L,h=xr*x,p=h-(h-x),v=x-p,h=xr*L,f=h-(h-L),m=L-f,S=v*m-(C-p*f-v*f-p*m),g=w-S,d=w-g,Tr[0]=w-(g+d)+(d-S),y=k+g,d=y-k,b=k-(y-d)+(g-d),g=b-C,d=b-g,Tr[1]=b-(g+d)+(d-C),_=y+g,d=_-y,Tr[2]=y-(_-d)+(g-d),Tr[3]=_;let F=function(e,t){let i=t[0];for(let n=1;n<e;n++)i+=t[n];return i}(4,Tr),M=Rr*s;if(F>=M||-F>=M)return F;if(d=e-E,o=e-(E+d)+(d-r),d=i-L,c=i-(L+d)+(d-r),d=t-x,l=t-(x+d)+(d-a),d=n-I,u=n-(I+d)+(d-a),0===o&&0===l&&0===c&&0===u)return F;if(M=Ar*s+Ir*Math.abs(F),F+=E*u+I*o-(x*c+L*l),F>=M||-F>=M)return F;k=o*I,h=xr*o,p=h-(h-o),v=o-p,h=xr*I,f=h-(h-I),m=I-f,w=v*m-(k-p*f-v*f-p*m),C=l*L,h=xr*l,p=h-(h-l),v=l-p,h=xr*L,f=h-(h-L),m=L-f,S=v*m-(C-p*f-v*f-p*m),g=w-S,d=w-g,Or[0]=w-(g+d)+(d-S),y=k+g,d=y-k,b=k-(y-d)+(g-d),g=b-C,d=b-g,Or[1]=b-(g+d)+(d-C),_=y+g,d=_-y,Or[2]=y-(_-d)+(g-d),Or[3]=_;const R=Fr(4,Tr,4,Or,Pr);k=E*u,h=xr*E,p=h-(h-E),v=E-p,h=xr*u,f=h-(h-u),m=u-f,w=v*m-(k-p*f-v*f-p*m),C=x*c,h=xr*x,p=h-(h-x),v=x-p,h=xr*c,f=h-(h-c),m=c-f,S=v*m-(C-p*f-v*f-p*m),g=w-S,d=w-g,Or[0]=w-(g+d)+(d-S),y=k+g,d=y-k,b=k-(y-d)+(g-d),g=b-C,d=b-g,Or[1]=b-(g+d)+(d-C),_=y+g,d=_-y,Or[2]=y-(_-d)+(g-d),Or[3]=_;const A=Fr(R,Pr,4,Or,Nr);k=o*u,h=xr*o,p=h-(h-o),v=o-p,h=xr*u,f=h-(h-u),m=u-f,w=v*m-(k-p*f-v*f-p*m),C=l*c,h=xr*l,p=h-(h-l),v=l-p,h=xr*c,f=h-(h-c),m=c-f,S=v*m-(C-p*f-v*f-p*m),g=w-S,d=w-g,Or[0]=w-(g+d)+(d-S),y=k+g,d=y-k,b=k-(y-d)+(g-d),g=b-C,d=b-g,Or[1]=b-(g+d)+(d-C),_=y+g,d=_-y,Or[2]=y-(_-d)+(g-d),Or[3]=_;const T=Fr(A,Nr,4,Or,Dr);return Dr[T-1]}(e,t,i,n,r,a,c)}const Hr=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,Br=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;const i=e.ll.x<t.ll.x?t.ll.x:e.ll.x,n=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:i,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:n,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}};let Vr=Number.EPSILON;void 0===Vr&&(Vr=Math.pow(2,-52));const Gr=Vr*Vr,jr=(e,t)=>{if(-Vr<e&&e<Vr&&-Vr<t&&t<Vr)return 0;const i=e-t;return i*i<Gr*e*t?0:e<t?-1:1};class Wr{constructor(){this.tree=new Sr,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(null!==i&&0===jr(t.key,i.key))return this.tree.remove(e),i.key;const n=this.tree.next(t);return null!==n&&0===jr(t.key,n.key)?(this.tree.remove(e),n.key):e}}const zr=new class{constructor(){this.reset()}reset(){this.xRounder=new Wr,this.yRounder=new Wr}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}},Zr=(e,t)=>e.x*t.y-e.y*t.x,qr=(e,t)=>e.x*t.x+e.y*t.y,Yr=(e,t,i)=>{const n=Ur(e.x,e.y,t.x,t.y,i.x,i.y);return n>0?-1:n<0?1:0},Jr=e=>Math.sqrt(qr(e,e)),Kr=(e,t,i)=>{const n={x:t.x-e.x,y:t.y-e.y},r={x:i.x-e.x,y:i.y-e.y};return Zr(r,n)/Jr(r)/Jr(n)},Xr=(e,t,i)=>{const n={x:t.x-e.x,y:t.y-e.y},r={x:i.x-e.x,y:i.y-e.y};return qr(r,n)/Jr(r)/Jr(n)},Qr=(e,t,i)=>0===t.y?null:{x:e.x+t.x/t.y*(i-e.y),y:i},$r=(e,t,i)=>0===t.x?null:{x:i,y:e.y+t.y/t.x*(i-e.x)};class ea{static compare(e,t){const i=ea.comparePoints(e.point,t.point);return 0!==i?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ia.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let e=0,i=t.length;e<i;e++){const i=t[e];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];
23if(void 0===i.segment.consumedBy)for(let n=t+1;n<e;n++){const e=this.point.events[n];void 0===e.consumedBy&&(i.otherSE.point.events===e.otherSE.point.events&&i.segment.consume(e.segment))}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const i=this.point.events[t];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){const t=new Map,i=i=>{const n=i.otherSE;t.set(i,{sine:Kr(this.point,e.point,n.point),cosine:Xr(this.point,e.point,n.point)})};return(e,n)=>{t.has(e)||i(e),t.has(n)||i(n);const{sine:r,cosine:a}=t.get(e),{sine:s,cosine:o}=t.get(n);return r>=0&&s>=0?a<o?1:a>o?-1:0:r<0&&s<0?a<o?-1:a>o?1:0:s<r?-1:s>r?1:0}}}let ta=0;class ia{static compare(e,t){const i=e.leftSE.point.x,n=t.leftSE.point.x,r=e.rightSE.point.x,a=t.rightSE.point.x;if(a<i)return 1;if(r<n)return-1;const s=e.leftSE.point.y,o=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(i<n){if(o<s&&o<l)return 1;if(o>s&&o>l)return-1;const i=e.comparePoint(t.leftSE.point);if(i<0)return 1;if(i>0)return-1;const n=t.comparePoint(e.rightSE.point);return 0!==n?n:-1}if(i>n){if(s<o&&s<c)return-1;if(s>o&&s>c)return 1;const i=t.comparePoint(e.leftSE.point);if(0!==i)return i;const n=e.comparePoint(t.rightSE.point);return n<0?1:n>0?-1:1}if(s<o)return-1;if(s>o)return 1;if(r<a){const i=t.comparePoint(e.rightSE.point);if(0!==i)return i}if(r>a){const i=e.comparePoint(t.rightSE.point);if(i<0)return 1;if(i>0)return-1}if(r!==a){const e=l-s,t=r-i,u=c-o,d=a-n;if(e>t&&u<d)return 1;if(e<t&&u>d)return-1}return r>a?1:r<a||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,n){this.id=++ta,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=n}static fromRing(e,t,i){let n,r,a;const s=ea.comparePoints(e,t);if(s<0)n=e,r=t,a=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);n=t,r=e,a=-1}const o=new ea(n,!0),l=new ea(r,!1);return new ia(o,l,[i],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const r=(e.y-t.y)/n.y,a=t.x+r*n.x;if(e.x===a)return 0;const s=(e.x-t.x)/n.x,o=t.y+s*n.y;return e.y===o?0:e.y<o?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),n=Br(t,i);if(null===n)return null;const r=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,o=e.rightSE.point,l=Hr(t,s)&&0===this.comparePoint(s),c=Hr(i,r)&&0===e.comparePoint(r),u=Hr(t,o)&&0===this.comparePoint(o),d=Hr(i,a)&&0===e.comparePoint(a);if(c&&l)return d&&!u?a:!d&&u?o:null;if(c)return u&&r.x===o.x&&r.y===o.y?null:r;if(l)return d&&a.x===s.x&&a.y===s.y?null:s;if(d&&u)return null;if(d)return a;if(u)return o;const h=((e,t,i,n)=>{if(0===t.x)return $r(i,n,e.x);if(0===n.x)return $r(e,t,i.x);if(0===t.y)return Qr(i,n,e.y);if(0===n.y)return Qr(e,t,i.y);const r=Zr(t,n);if(0==r)return null;const a={x:i.x-e.x,y:i.y-e.y},s=Zr(a,t)/r,o=Zr(a,n)/r;return{x:(e.x+o*t.x+(i.x+s*n.x))/2,y:(e.y+o*t.y+(i.y+s*n.y))/2}})(r,this.vector(),s,e.vector());return null===h?null:Hr(n,h)?zr.round(h.x,h.y):null}split(e){const t=[],i=void 0!==e.events,n=new ea(e,!0),r=new ea(e,!1),a=this.rightSE;this.replaceRightSE(r),t.push(r),t.push(n);const s=new ia(n,a,this.rings.slice(),this.windings.slice());return ea.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ea.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(n.checkForConsuming(),r.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,t=this.windings.length;e<t;e++)this.windings[e]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const n=ia.compare(t,i);if(0!==n){if(n>0){const e=t;t=i,i=e}if(t.prev===i){const e=t;t=i,i=e}for(let e=0,n=i.rings.length;e<n;e++){const n=i.rings[e],r=i.windings[e],a=t.rings.indexOf(n);-1===a?(t.rings.push(n),t.windings.push(r)):t.windings[a]+=r}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys;for(let e=0,n=this.rings.length;e<n;e++){const n=this.rings[e],r=this.windings[e],a=t.indexOf(n);-1===a?(t.push(n),i.push(r)):i[a]+=r}const r=[],a=[];for(let e=0,n=t.length;e<n;e++){if(0===i[e])continue;const n=t[e],s=n.poly;if(-1===a.indexOf(s))if(n.isExterior)r.push(s);else{-1===a.indexOf(s)&&a.push(s);const e=r.indexOf(n.poly);-1!==e&&r.splice(e,1)}}for(let e=0,t=r.length;e<t;e++){const t=r[e].multiPoly;-1===n.indexOf(t)&&n.push(t)}return this._afterState}
23isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ha.type){case"union":{const i=0===e.length,n=0===t.length;this._isInResult=i!==n;break}case"intersection":{let i,n;e.length<t.length?(i=e.length,n=t.length):(i=t.length,n=e.length),this._isInResult=n===ha.numMultiPolys&&i<n;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2==1;break}case"difference":{const i=e=>1===e.length&&e[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${ha.type}`)}return this._isInResult}}class na{constructor(e,t,i){if(!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=zr.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let t=1,i=e.length;t<i;t++){if("number"!=typeof e[t][0]||"number"!=typeof e[t][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let i=zr.round(e[t][0],e[t][1]);i.x===r.x&&i.y===r.y||(this.segments.push(ia.fromRing(r,i,this)),i.x<this.bbox.ll.x&&(this.bbox.ll.x=i.x),i.y<this.bbox.ll.y&&(this.bbox.ll.y=i.y),i.x>this.bbox.ur.x&&(this.bbox.ur.x=i.x),i.y>this.bbox.ur.y&&(this.bbox.ur.y=i.y),r=i)}n.x===r.x&&n.y===r.y||this.segments.push(ia.fromRing(r,n,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const i=this.segments[t];e.push(i.leftSE),e.push(i.rightSE)}return e}}class ra{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new na(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let t=1,i=e.length;t<i;t++){const i=new na(e[t],this,!1);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const i=this.interiorRings[t].getSweepEvents();for(let t=0,n=i.length;t<n;t++)e.push(i[t])}return e}}class aa{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let t=0,i=e.length;t<i;t++){const i=new ra(e[t],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const i=this.polys[t].getSweepEvents();for(let t=0,n=i.length;t<n;t++)e.push(i[t])}return e}}class sa{static factory(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.isInResult()||n.ringOut)continue;let r=null,a=n.leftSE,s=n.rightSE;const o=[a],l=a.point,c=[];for(;r=a,a=s,o.push(a),a.point!==l;)for(;;){const e=a.getAvailableLinkedEvents();if(0===e.length){const e=o[0].point,t=o[o.length-1].point;throw new Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${t.x}, ${t.y}].`)}if(1===e.length){s=e[0].otherSE;break}let i=null;for(let e=0,t=c.length;e<t;e++)if(c[e].point===a.point){i=e;break}if(null!==i){const e=c.splice(i)[0],n=o.splice(e.index);n.unshift(n[0].otherSE),t.push(new sa(n.reverse()));continue}c.push({index:o.length,point:a.point});const n=a.getLeftmostComparator(r);s=e.sort(n)[0].otherSE;break}t.push(new sa(o))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let i=1,n=this.events.length-1;i<n;i++){const n=this.events[i].point,r=this.events[i+1].point;0!==Yr(n,e,r)&&(t.push(n),e=n)}if(1===t.length)return null;const i=t[0],n=t[1];0===Yr(i,e,n)&&t.shift(),t.push(t[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,o=[];for(let e=a;e!=s;e+=r)o.push([t[e].x,t[e].y]);return o}isExteriorRing(){if(void 0===this._isExteriorRing){const e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let t=1,i=this.events.length;t<i;t++){const i=this.events[t];ea.compare(e,i)>0&&(e=i)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class oa{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const i=this.interiorRings[t].getGeom();null!==i&&e.push(i)}return e}}class la{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const i=this.polys[t].getGeom();null!==i&&e.push(i)}return e}_composePolys(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.poly)if(n.isExteriorRing())t.push(new oa(n));else{const e=n.enclosingRing();
23e.poly||t.push(new oa(e)),e.poly.addInterior(n)}}return t}}class ca{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ia.compare;this.queue=e,this.tree=new Sr(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const n=e.isLeft?this.tree.add(t):this.tree.find(t);if(!n)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let r,a,s=n,o=n;for(;void 0===r;)s=this.tree.prev(s),null===s?r=null:void 0===s.key.consumedBy&&(r=s.key);for(;void 0===a;)o=this.tree.next(o),null===o?a=null:void 0===o.key.consumedBy&&(a=o.key);if(e.isLeft){let n=null;if(r){const e=r.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(n=e),!r.isAnEndpoint(e))){const t=this._splitSafely(r,e);for(let e=0,n=t.length;e<n;e++)i.push(t[e])}}let s=null;if(a){const e=a.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(s=e),!a.isAnEndpoint(e))){const t=this._splitSafely(a,e);for(let e=0,n=t.length;e<n;e++)i.push(t[e])}}if(null!==n||null!==s){let e=null;if(null===n)e=s;else if(null===s)e=n;else{e=ea.comparePoints(n,s)<=0?n:s}this.queue.remove(t.rightSE),i.push(t.rightSE);const r=t.split(e);for(let e=0,t=r.length;e<t;e++)i.push(r[e])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=r)}else{if(r&&a){const e=r.getIntersection(a);if(null!==e){if(!r.isAnEndpoint(e)){const t=this._splitSafely(r,e);for(let e=0,n=t.length;e<n;e++)i.push(t[e])}if(!a.isAnEndpoint(e)){const t=this._splitSafely(a,e);for(let e=0,n=t.length;e<n;e++)i.push(t[e])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const n=e.split(t);return n.push(i),void 0===e.consumedBy&&this.tree.add(e),n}}const ua=void 0!==fr&&fr.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,da=void 0!==fr&&fr.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;const ha=new class{run(e,t,i){ha.type=e,zr.reset();const n=[new aa(t,!0)];for(let e=0,t=i.length;e<t;e++)n.push(new aa(i[e],!1));if(ha.numMultiPolys=n.length,"difference"===ha.type){const e=n[0];let t=1;for(;t<n.length;)null!==Br(n[t].bbox,e.bbox)?t++:n.splice(t,1)}if("intersection"===ha.type)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let i=e+1,r=n.length;i<r;i++)if(null===Br(t.bbox,n[i].bbox))return[]}const r=new Sr(ea.compare);for(let e=0,t=n.length;e<t;e++){const t=n[e].getSweepEvents();for(let e=0,i=t.length;e<i;e++)if(r.insert(t[e]),r.size>ua)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new ca(r);let s=r.size,o=r.pop();for(;o;){const e=o.key;if(r.size===s){const t=e.segment;throw new Error(`Unable to pop() ${e.isLeft?"left":"right"} SweepEvent [${e.point.x}, ${e.point.y}] from segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] from queue.`)}if(r.size>ua)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>da)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const t=a.process(e);for(let e=0,i=t.length;e<i;e++){const i=t[e];void 0===i.consumedBy&&r.insert(i)}s=r.size,o=r.pop()}zr.reset();const l=sa.factory(a.segments);return new la(l).getGeom()}};var pa=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];return ha.run("intersection",e,i)};function va(e,t,i){void 0===i&&(i={});var n=Wn(e),r=Wn(t),a=pa(n.coordinates,r.coordinates);return 0===a.length?null:1===a.length?Bn(a[0],i.properties):function(e,t,i){return void 0===i&&(i={}),Hn({type:"MultiPolygon",coordinates:e},t,i)}(a,i.properties)}function fa(e,t,i,n){void 0===n&&(n={});
23var r=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),a=Gn(r[0]),s=Gn(r[1]),o=Gn(i),l=function(e,t){void 0===t&&(t="kilometers");var i=Un[t];if(!i)throw new Error(t+" units is invalid");return e/i}(t,n.units),c=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(o));return function(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!jn(e[0])||!jn(e[1]))throw new Error("coordinates must contain numbers");return Hn({type:"Point",coordinates:e},t,i)}([Vn(a+Math.atan2(Math.sin(o)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(c))),Vn(c)],n.properties)}function ma(e,t,i){void 0===i&&(i={});for(var n=i.steps||64,r=i.properties?i.properties:!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{},a=[],s=0;s<n;s++)a.push(fa(e,t,-360*s/n,i).geometry.coordinates);return a.push(a[0]),Bn([a],r)}function ga(e,t,i){var n=i;return function(e,t){var i,n,r,a,s,o,l,c,u,d,h=0,p="FeatureCollection"===e.type,v="Feature"===e.type,f=p?e.features.length:1;for(i=0;i<f;i++){for(o=p?e.features[i].geometry:v?e.geometry:e,c=p?e.features[i].properties:v?e.properties:{},u=p?e.features[i].bbox:v?e.bbox:void 0,d=p?e.features[i].id:v?e.id:void 0,s=(l=!!o&&"GeometryCollection"===o.type)?o.geometries.length:1,r=0;r<s;r++)if(null!==(a=l?o.geometries[r]:o))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(a,h,c,u,d))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===t(a.geometries[n],h,c,u,d))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,c,u,d))return!1;h++}}(e,(function(e,r,a,s,o){n=0===r&&void 0===i?e:t(n,e,r,a,s,o)})),n}var ya=6378137;function ba(e){return ga(e,(function(e,t){return e+function(e){var t,i=0;switch(e.type){case"Polygon":return ka(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)i+=ka(e.coordinates[t]);return i;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)}),0)}function ka(e){var t=0;if(e&&e.length>0){t+=Math.abs(wa(e[0]));for(var i=1;i<e.length;i++)t-=Math.abs(wa(e[i]))}return t}function wa(e){var t,i,n,r,a,s,o=0,l=e.length;if(l>2){for(s=0;s<l;s++)s===l-2?(n=l-2,r=l-1,a=0):s===l-1?(n=l-1,r=0,a=1):(n=s,r=s+1,a=s+2),t=e[n],i=e[r],o+=(Ca(e[a][0])-Ca(t[0]))*Math.sin(Ca(i[1]));o=o*ya*ya/2}return o}function Ca(e){return e*Math.PI/180}function Sa(e){function t(e){return[e[1],e[0]]}return e&&e.coordinates&&(e.coordinates=function(e){if(0===e.length)return e;if("number"==typeof e[0][0])return e.map(t);if("number"==typeof e[0][0][0])return e.map((function(e){return e.map(t)}));if("number"==typeof e[0][0][0][0])return e.map((function(e){return e.map((function(e){return e.map(t)}))}));throw new Error("Unexpected coordinate structure")}(e.coordinates)),e}var _a=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","arty"),J($(e),"toolbarButtonSelector",'[data-site-nav="arty"]'),J($(e),"stackNode",_i),J($(e),"modality",{exclusive:!1,requires:[],incompatible:["ruler"],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),J($(e),"eventEmitterListenerRef",null),J($(e),"translateSvc",window.translateService),J($(e),"mapFeatures",{}),J($(e),"dotIcon",L.icon({iconUrl:"/images/ruler-marker.png",iconSize:[18,18]})),J($(e),"waterBodiesGeoJSON",null),e}var i,n;return K(t,e),Y(t,[{key:"enable",value:function(){var e;(this.isEnabled=!0,this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),this.eventEmitterListenerRef)||(null===(e=this.eventEmitter)||void 0===e||e.addListener("backend",this.uiEventListener.bind(this)));this.mapClickListener=this.handleMapClickWrapper.bind(this),window.polygonsLayer.setInteractive(!1),this.mapController.getLeafletMap().addEventListener("click",this.mapClickListener)}},{key:"clearFeatures",value:function(){this.mapFeatures.position&&(this.mapFeatures.position.remove(),this.mapFeatures.position=void 0),this.mapFeatures.minCircle&&(this.mapFeatures.minCircle.remove(),this.mapFeatures.minCircle=void 0),this.mapFeatures.maxCircle&&(this.mapFeatures.maxCircle.remove(),this.mapFeatures.maxCircle=void 0),this.mapFeatures.maxPolygon&&(this.mapFeatures.maxPolygon.remove(),this.mapFeatures.maxPolygon=void 0),this.mapFeatures.auxPoint&&(this.mapFeatures.auxPoint.remove(),this.mapFeatures.auxPoint=void 0),this.mapFeatures.radiusPolyline&&(this.mapFeatures.radiusPolyline.remove(),this.mapFeatures.radiusPolyline=void 0)}},{key:"disable",value:function(){var e;(this.isEnabled=!1,null!==this.eventEmitterListenerRef)&&(null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners());this.clearFeatures(),window.polygonsLayer.setInteractive(!0),this.mapController.getLeafletMap().removeEventListener("click",this.mapClickListener)}},{key:"uiEventListener",value:function(e){var t=e.arty,i=e.round;this.selectedArty=t||void 0,this.selectedRound=i||void 0,this.selectedArty&&this.selectedRound||this.clearFeatures()}},{key:"addLatitude",value:function(e,t,i){return e+i/1e3/6378.137*(180/Math.PI)}},{key:"addLongitude",value:function(e,t,i){return t+i/1e3/6378.137*(180/Math.PI)/Math.cos(e*Math.PI/180)}},{key:"loadWaterBodies",value:(n=z(G().mark((function e(){var t=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){fetch("/arty-water-bodies.json").then((function(e){return e.json()})).then((function(i){t.waterBodiesGeoJSON=i,e(!0)})).catch((function(e){return i(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"handleMapClickWrapper",value:function(e){this.handleMapClick(e).then().catch((function(e){Ut.log("ArtyFeature","Map Click handler failed ".concat(e))}))}},{key:"handleMapClick",value:(i=z(G().mark((function e(t){var i,n,r,a,s,o,l,c,u,d,h,p,v,f,m,g;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.selectedArty&&this.selectedRound){e.next=2;break}return e.abrupt("return");case 2:if(this.clearFeatures(),i=this.selectedArty.meta.title[this.translateSvc.language]||"—",n=this.selectedRound.name||"—","usv"!==(r=this.selectedArty.type)||this.waterBodiesGeoJSON){e.next=9;break}return e.next=9,this.loadWaterBodies();case 9:if(this.selectedRound.range.min,a=this.selectedRound.range.max){e.next=13;break}return e.abrupt("return");case 13:if(s=[t.latlng.lat,t.latlng.lng],o=s[0],l=s[1],this.mapFeatures.position=L.marker([o,l],{icon:this.dotIcon}).addTo(this.mapController.getLeafletMap()),"usv"!==r){e.next=28;break}c=[],u=ma([l,o],a,{units:"meters"}),d=ae(this.waterBodiesGeoJSON.features);try{for(d.s();!(h=d.n()).done;)p=h.value,(v=va(p.geometry,u))&&(f=ba(v),v.area=f,c.push(v))}catch(e){d.e(e)}finally{d.f()}if(0!==c.length){e.next=23;break}return e.abrupt("return");case 23:m=c.sort((function(e,t){return t.area-e.area}))[0],this.mapFeatures.maxPolygon=L.polygon(Sa(Object.assign({},m.geometry)).coordinates,{className:"arty-circle",fillOpacity:.3}).addTo(this.mapController.getLeafletMap()),this.mapFeatures.position.bindTooltip("".concat(i),{permanent:!0,direction:"right",offset:[10,0]}),e.next=33;break;case 28:this.mapFeatures.maxCircle=L.circle([o,l],{radius:a,className:"arty-circle",fillOpacity:.3}).addTo(this.mapController.getLeafletMap()),g=[o,this.addLongitude(o,l,a)],this.mapFeatures.auxPoint=L.marker([g[0],g[1]],{icon:this.dotIcon}).addTo(this.mapController.getLeafletMap()),this.mapFeatures.auxPoint.bindTooltip("".concat(i,"<br>").concat(n),{permanent:!0,direction:"right",offset:[10,0]}),this.mapFeatures.radiusPolyline=L.polyline([[o,l],[g[0],g[1]]],{className:"ruler-polyline"}).addTo(this.mapController.getLeafletMap());case 33:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]),t}(ue),Ea=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","firms"),J($(e),"toolbarButtonSelector",'[data-site-nav="firms"]'),J($(e),"stackNode",Ei),J($(e),"modality",{exclusive:!1,requires:[],incompatible:["seb"],zIndex:10}),J($(e),"eventEmitterListenerRef",null),J($(e),"translateSvc",window.translateService),J($(e),"httpClient",new dt("")),J($(e),"copyrightString",'<a href="https://firms.modaps.eosdis.nasa.gov/map/" target="_blank">NASA FIRMS</a>'),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e,t=this;(this.isEnabled=!0,this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),this.eventEmitterListenerRef)||(null===(e=this.eventEmitter)||void 0===e||e.addListener("backend",this.uiEventListener.bind(this)));
23window.polygonsLayer.setBackgroundColorOpacity(.2),this.firmsData?this.renderPixiLayer():this.httpClient.get("/api/firms").then((function(e){var i;t.firmsData=e,null===(i=t.eventEmitter)||void 0===i||i.emit("ui",{dataUpdatedAt:e.updated_at})})).catch(console.error).finally((function(){return t.renderPixiLayer()})),this.mapController.map.attributionControl.addAttribution(this.copyrightString)}},{key:"clearFeatures",value:function(){this.pixiLayer&&(this.pixiLayer.remove(),this.pixiLayer=void 0),this.mapController.map.attributionControl.removeAttribution(this.copyrightString)}},{key:"renderPixiLayer",value:function(){var e=this;if(this.firmsData){if(this.pixiLayer){if(1===this.pixiLayer._renderer.type)try{this.pixiLayer._renderer.gl.getExtension("WEBGL_lose_context").loseContext(),Ut.log("FirmsFeature","WebGL - lost context")}catch(e){}this.pixiLayer.remove(),this.pixiLayer=this.getPixiLayer(this.firmsData.data,this.firmsToggleState).addTo(this.mapController.getLeafletMap())}else this.pixiLayer=this.getPixiLayer(this.firmsData.data,this.firmsToggleState).addTo(this.mapController.getLeafletMap());setTimeout((function(){e.eventEmitter&&e.firmsData&&e.eventEmitter.emit("ui",{dataUpdatedAt:e.firmsData.updated_at})}),500)}}},{key:"getPixiLayer",value:function(e,t){var i,n=null,r=!0,a={.25:t.oldest,.5:t.older,.75:t.newer,1:t.newest},s=(e=e.filter((function(e){return 0==+e[2]||1==a[+e[2]]}))).map((function(e){return new PIXI.Graphics})),o=new PIXI.Container;o.interactive=!1;var l,c=ae(s);try{for(c.s();!(l=c.n()).done;){var u=l.value;o.addChild(u)}}catch(e){c.e(e)}finally{c.f()}return L.pixiOverlay((function(t){n&&(cancelAnimationFrame(n),n=null);var a=t.getMap().getZoom(),o=t.getContainer(),l=t.getRenderer(),c=t.latLngToLayerPoint,u=t.getScale();if(r||i!==a){var d,h=0,p=ae(s);try{for(p.s();!(d=p.n()).done;){var v=d.value,f=c([e[h][0],e[h][1]]),m=void 0;m=1===e[h][2]?"B71C1C":.75===e[h][2]?"F44336":.5===e[h][2]?"F9A825":(e[h][2],"FFEB3B"),v.clear(),v.beginFill(parseInt(m,16),.75),v.x=f.x,v.y=f.y,v.lineStyle(1.5/u,8947848),v.drawCircle(0,0,5/u),v.endFill(),h+=1}}catch(e){p.e(e)}finally{p.f()}}var g=null;r||i===a||(g=null,n=requestAnimationFrame((function e(t){var i;null===g&&(g=t),i=t-g,l.render(o),i<100&&(n=requestAnimationFrame(e))}))),r=!1,i=a,l.render(o)}),o,{doubleBuffering:/iPad|iPhone|iPod/.test(navigator.userAgent),autoPreventDefault:!1})}},{key:"disable",value:function(){var e;(this.isEnabled=!1,null!==this.eventEmitterListenerRef)&&(null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners());this.clearFeatures(),window.polygonsLayer.setBackgroundColorOpacity(void 0)}},{key:"uiEventListener",value:function(e){var t=e.newest,i=e.newer,n=e.older,r=e.oldest,a=!1;JSON.stringify(this.firmsToggleState)!==JSON.stringify({oldest:r,older:n,newer:i,newest:t})&&(a=!0),this.firmsToggleState={oldest:r,older:n,newer:i,newest:t},a&&this.renderPixiLayer()}}]),t}(ue),La=function(){function e(t,i){Z(this,e),J(this,"profileService",window.profile),this.mapController=t,this.coordsPickerController=i,this.enabled=this.profileService.getSetting("reticle"),this.render()}return Y(e,[{key:"setState",value:function(e){this.enabled=e,this.profileService.updateSetting("reticle",this.enabled),this.render()}},{key:"getState",value:function(){return this.enabled}},{key:"reticleClickHandler",value:function(e){e.stopPropagation(),this.coordsPickerController.handleReticleClick()}},{key:"render",value:function(){var e=document.querySelector("#map .reticle");if(this.enabled&&!e){var t,i=document.createElement("img");i.src="/images/crosshair.png",i.classList.add("reticle"),i.setAttribute("style","position: absolute; width: 46px; height: 46px; left: 50%; top: 50%; margin-left: -23px; margin-top: -23px; z-index: 594; opacity: 0.3; pointer-events: painted; user-select: none;"),null===(t=document.querySelector("#map"))||void 0===t||t.prepend(i),i.addEventListener("click",this.reticleClickHandler.bind(this))}else!this.enabled&&e&&e.remove()}}]),e}(),xa=function(){function e(){Z(this,e),J(this,"lsKey","dsm__units");var t=window.localStorage.getItem(this.lsKey);this.isImperial="imperial"===t}return Y(e,[{key:"getIsImperial",value:function(){return this.isImperial}},{key:"setImperial",value:function(e){this.isImperial=e,window.localStorage.setItem(this.lsKey,this.isImperial?"imperial":"metric")}},{key:"mToImperial",value:function(e){return 3.2808*e}},{key:"kmToImperial",value:function(e){return this.isImperial?.621*e:e}},{key:"feetToMiles",value:function(e){return this.isImperial?5280*e:length}},{key:"sqKmToImperial",value:function(e){return this.isImperial?.386*e:e}}]),e}(),Ia=/[\s\n\\/='"\0<>]/,Fa=/^(xlink|xmlns|xml)([A-Z])/,Ma=/^accessK|^auto[A-Z]|^ch|^c
23ol|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/,Ra=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Aa=/["&<]/;function Ta(e){if(0===e.length||!1===Aa.test(e))return e;for(var t=0,i=0,n="",r="";i<e.length;i++){switch(e.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 60:r="&lt;";break;default:continue}i!==t&&(n+=e.slice(t,i)),n+=r,t=i+1}return i!==t&&(n+=e.slice(t,i)),n}var Pa={},Na=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),Da=/[A-Z]/g;function Oa(e){var t="";for(var i in e){var n=e[i];if(null!=n&&""!==n){var r="-"==i[0]?i:Pa[i]||(Pa[i]=i.replace(Da,"-$&").toLowerCase()),a=";";"number"!=typeof n||r.startsWith("--")||Na.has(r)||(a="px;"),t=t+r+":"+n+a}}return t||void 0}var Ua,Ha,Ba,Va,Ga=[],ja=Array.isArray,Wa=Object.assign;function za(e,i){var n=t.__s;t.__s=!0,Ua=t.__b,Ha=t.diffed,Ba=t.__r,Va=t.unmount;var r=f(g,null);r.__k=[e];try{return Ja(e,i||qa,!1,void 0,r,!1)}catch(e){if(e.then)throw new Error('Use "renderToStringAsync" for suspenseful rendering.');throw e}finally{t.__c&&t.__c(e,Ga),t.__s=n,Ga.length=0}}function Za(){this.__d=!0}var qa={};function Ya(e,t){var i,n=e.type,r=!0;return e.__c?(r=!1,(i=e.__c).state=i.__s):i=new n(e.props,t),e.__c=i,i.__v=e,i.props=e.props,i.context=t,i.__d=!0,null==i.state&&(i.state=qa),null==i.__s&&(i.__s=i.state),n.getDerivedStateFromProps?i.state=Wa({},i.state,n.getDerivedStateFromProps(i.props,i.state)):r&&i.componentWillMount?(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state):!r&&i.componentWillUpdate&&i.componentWillUpdate(),Ba&&Ba(e),i.render(i.props,i.state,t)}function Ja(e,i,n,r,a,s){if(null==e||!0===e||!1===e||""===e)return"";if("object"!=typeof e)return"function"==typeof e?"":Ta(e+"");if(ja(e)){var o,l="";a.__k=e;for(var c=0;c<e.length;c++){var u=e[c];if(null!=u&&"boolean"!=typeof u){var d,h=Ja(u,i,n,r,a,s);"string"==typeof h?l+=h:(o=o||[],l&&o.push(l),l="",Array.isArray(h)?(d=o).push.apply(d,h):o.push(h))}}return o?(l&&o.push(l),o):l}if(void 0!==e.constructor)return"";e.__=a,Ua&&Ua(e);var p,v,f,m=e.type,y=e.props,b=i;if("function"==typeof m){if(m===g){if(y.tpl){for(var k="",w=0;w<y.tpl.length;w++)if(k+=y.tpl[w],y.exprs&&w<y.exprs.length){var C=y.exprs[w];if(null==C)continue;"object"!=typeof C||void 0!==C.constructor&&!ja(C)?k+=C:k+=Ja(C,i,n,r,e,s)}return k}if(y.UNSTABLE_comment)return"\x3c!--"+Ta(y.UNSTABLE_comment||"")+"--\x3e";v=y.children}else{if(null!=(p=m.contextType)){var S=i[p.__c];b=S?S.props.value:p.__}if(m.prototype&&"function"==typeof m.prototype.render)v=Ya(e,b),f=e.__c;else{e.__c=f={__v:e,props:y,context:b,setState:Za,forceUpdate:Za,__d:!0,__h:[]};for(var _=0;f.__d&&_++<25;)f.__d=!1,Ba&&Ba(e),v=m.call(f,y,b);f.__d=!0}if(null!=f.getChildContext&&(i=Wa({},i,f.getChildContext())),(m.getDerivedStateFromError||f.componentDidCatch)&&t.errorBoundaries){var E="";v=null!=v&&v.type===g&&null==v.key?v.props.children:v;try{return E=Ja(v,i,n,r,e,s)}catch(t){return m.getDerivedStateFromError&&(f.__s=m.getDerivedStateFromError(t)),f.componentDidCatch&&f.componentDidCatch(t,{}),f.__d&&(v=Ya(e,i),null!=(f=e.__c).getChildContext&&(i=Wa({},i,f.getChildContext())),E=Ja(v=null!=v&&v.type===g&&null==v.key?v.props.children:v,i,n,r,e,s)),E}finally{Ha&&Ha(e),e.__=null,Va&&Va(e)}}}v=null!=v&&v.type===g&&null==v.key?v.props.children:v;var L=function(){return Ja(v,i,n,r,e,s)};try{var x=L();return Ha&&Ha(e),e.__=null,Va&&Va(e),x}catch(e){if(!s)throw e;if(!e||"function"!=typeof e.then)throw e;var I=function e(){try{return L()}catch(t){if(!t||"function"!=typeof t.then)throw t;return t.then((function(){return L()}),(function(){return e()}))}};return e.then((function(){return I()}))}}var F,M="<"+m,R="";for(var A in y){var T=y[A];switch(A){case"children":F=T;continue;case"key":case"ref":case"__self":case"__source":continue;case"htmlFor":if("for"in y)continue;A="for";break;case"className":if("class"in y)continue;A="class";break;case"defaultChecked":A="checked";break;case"defaultSelected":A="selected";break;case"defaultValue":case"value":switch(A="value",m){case"textarea":F=T;continue;case"select":r=T;continue;case"option":r!=T||"selected"in y||(M+=" selected")}break;case"dangerouslySetInnerHTML":R=T&&T.__html;continue;case"style":"object"==typeof T&&(T=Oa(T));break;case"acceptCharset":A="accept-charset";break;case"httpEquiv":A="http-equiv";break;default:if(Fa.test(A))A=A.replace(Fa,"$1:$2").toLowerCase();else{if(Ia.test(A))continue;"-"!==A[4]&&"draggable"!==A||null==T?n?Ra.test(A)&&(A="panose1"===A?"panose-1":A.replace(/([A-Z])/g,"-$1").toLowerCase()):Ma.test(A)&&(A=A.toLowerCase()):T+=""}}null!=T&&!1!==T&&"function"!=typeof T&&(M=!0===T||""===T?M+" "+A:M+" "+A+'="'+Ta(T+"")+'"')}if(Ia.test(m))throw new Error(m+" is not a valid HTML tag name in "+M+">");if(R||("string"==typeof F?R=Ta(F):null!=F&&!1!==F&&!0!==F&&(R=Ja(F,i,"svg"===m||"foreignObject"!==m&&n,r,e,s))),Ha&&Ha(e),e.__=null,Va&&Va(e),!R&&Ka.has(m))return M+"/>";var P="</"+m+">",N=M+">";return Array.isArray(R)?[N].concat(R,[P]):"string"!=typeof R?[N,R,P]:N+R+P}var Ka=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Xa(e,t){var i,n,r,a,s,o,l,c,u,d,h,p=null!=e&&null!==(i=e.current)&&void 0!==i&&i.updated_at?new Date(1e3*e.current.updated_at):null,v=+(null==e||null===(n=e.current)||void 0===n?void 0:n.value.toFixed(0))||0,f="#bbbbbb";1===(null==e||null===(r=e.current)||void 0===r?void 0:r.is_old)?f="#bbbbbb":v>0&&v<=100?f="#1dafaf":v>=101&&v<=200?f="#1d8baf":v>=201&&v<=300?f="#1d66af":v>=301&&v<=500?f="#1d41af":v>=501&&v<=2e3?f="#411daf":v>=2001&&(f="#661daf");return st("div",{class:"seb-tooltip",children:[st("div",{class:"seb-tooltip-header",children:[st("p",{class:"seb-station-id",children:null!=e&&e.station_id?"#"+(null==e?void 0:e.station_id):""}),st("h1",{children:(null==e||null===(a=e.details)||void 0===a?void 0:a.sensor_name)||""}),st("p",{class:"seb-station-location",children:[[null==e||null===(s=e.details)||void 0===s?void 0:s.city_type_name,null==e||null===(o=e.details)||void 0===o?void 0:o.city_name].filter((function(e){return!!e})).join(" "),null==e||null===(l=e.details)||void 0===l?void 0:l.region_name].filter((function(e){return!!e})).join(", ")})]}),st("div",{children:[st("div",{class:"seb-current",style:{backgroundColor:f},children:[st("span",{class:"current-value",children:v||"-"})," ",st("small",{class:"current-value-units",children:t.translate("seb.popupUnits")})]}),st("div",{class:"seb-tooltip-legend",children:[st("div",{style:"background-color: #bbbbbb; border-radius: 0 0 0 8px; display: none;",children:t.translate("seb.noData")}),st("div",{style:"background-color: #1dafaf; border-radius: 0 0 0 8px;",children:"0-100"}),st("div",{style:"background-color: #1d8baf;",children:"101-200"}),st("div",{style:"background-color: #1d66af;",children:"201-300"}),st("div",{style:"background-color: #1d41af;",children:"301-500"}),st("div",{style:"background-color: #411daf;",children:"501-2000"}),st("div",{style:"background-color: #661daf; border-radius: 0 0 8px 0;",children:"2000+"})]})]}),st("div",{class:"seb-tooltip-item",children:[st("div",{class:"tooltip-item-icon",children:st("span",{class:"material-symbols-outlined",children:"schedule"})}),st("div",{children:[p?p.toLocaleDateString()+" "+p.toLocaleTimeString():null,1===(null==e||null===(c=e.current)||void 0===c?void 0:c.is_old)?st("p",{style:"margin: 4px 0;",children:[t.translate("seb.outOfDate")," 😢"]}):""]})]}),st("div",{class:"seb-tooltip-item",children:[st("div",{class:"tooltip-item-icon",children:st("span",{class:"material-symbols-outlined",children:"folder"})}),st("div",{style:"",children:(null==e||null===(u=e.details)||void 0===u?void 0:u.platform_name)||"-"})]}),st("div",{class:"seb-tooltip-item",children:[st("div",{class:"tooltip-item-icon",children:st("span",{class:"material-symbols-outlined",children:"radar"})}),st("div",{style:"",children:[st("a",{target:"_blank",href:"https://www.saveecobot.com",children:"SaveEcoBot"}),st("br",{}),null!=e&&null!==(d=e.details)&&void 0!==d&&d.notes?null==e||null===(h=e.details)||void 0===h?void 0:h.notes:""]})]}),st("div",{class:"seb-tooltip-item",children:[st("div",{class:"tooltip-item-icon",children:st("span",{class:"material-symbols-outlined warn-icon",children:"warning"})}),st("div",{style:"",children:st("span",{style:"text-decoration: underline;
23 color: #eb0c0c; cursor: pointer;",id:"seb-disclaimer-link",children:t.translate("seb.disclaimer.link")})})]}),st("div",{style:"width: 100%; height: 150px; margin-top: 16px",children:[st("div",{id:"seb-chart",style:"width: 100%; height: 100%; border: 1px solid #eaeaea;"}),st("canvas",{id:"seb-canvas",style:"width: 100%; height: 100%; display: none;"})]})]})}function Qa(e,t,i){Highcharts.chart(e,{chart:{},xAxis:{type:"datetime"},yAxis:{title:{text:void 0}},title:{text:void 0},legend:{enabled:!1},plotOptions:{line:{marker:{radius:2},lineWidth:1,states:{hover:{lineWidth:1}},threshold:null}},series:[{type:"line",name:i.translate("seb.legendTitle"),data:t.historic.map((function(e,t){return[1e3*e[0],e[1]]})),zones:[{value:100,color:"#1dafaf"},{value:200,color:"#1d8baf"},{value:300,color:"#1d66af"},{value:500,color:"#411daf"},{value:2e3,color:"#411daf"},{value:99999,color:"#661daf"},{color:"#bbbbbb"}]}]})}var $a=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","seb"),J($(e),"toolbarButtonSelector",'[data-site-nav="seb"]'),J($(e),"stackNode",Li),J($(e),"modality",{exclusive:!1,requires:[],incompatible:["firms"],zIndex:10}),J($(e),"eventEmitterListenerRef",null),J($(e),"translateSvc",window.translateService),J($(e),"httpClient",new dt("")),J($(e),"enableLabels",!1),J($(e),"copyrightString",'<a href="https://www.saveecobot.com/" target="_blank">SaveEcoBot</a> | <span id="seb-disclaimer-bottom-link" style="text-decoration: underline; cursor: pointer; color: #eb0c0c;">'.concat(e.translateSvc.translate("seb.disclaimer.link"),"</span>")),e}var i;return K(t,e),Y(t,[{key:"enable",value:function(){var e,t,i=this;(this.isEnabled=!0,this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),this.eventEmitterListenerRef)||(null===(t=this.eventEmitter)||void 0===t||t.addListener("backend",this.uiEventListener.bind(this)));window.polygonsLayer.setBackgroundColorOpacity(.2),this.sebData?this.renderPixiLayer():this.httpClient.get("/api/seb").then((function(e){var t;i.sebData=e,null===(t=i.eventEmitter)||void 0===t||t.emit("ui",{dataUpdatedAt:e.updated_at})})).finally((function(){return i.renderPixiLayer()})),this.mapController.map.attributionControl.addAttribution(this.copyrightString),null===(e=document.getElementById("seb-disclaimer-bottom-link"))||void 0===e||e.addEventListener("click",this.showDisclaimer.bind(this))}},{key:"clearFeatures",value:function(){var e;this.pixiLayer&&(this.pixiLayer.remove(),this.pixiLayer=void 0),null===(e=document.querySelector(".leaflet-overlay-pane"))||void 0===e||e.classList.remove("seb-enabled"),this.mapController.map.attributionControl.removeAttribution(this.copyrightString)}},{key:"renderPixiLayer",value:function(){var e;if(this.sebData){var t=this.sebData.data.filter((function(e){return 1===e.is_old})),i=this.sebData.data.filter((function(e){return!e.is_old})),n=t.concat(i).map((function(e){return[e.lat,e.lon,e.value,e.station_id,1===e.is_old]}));if(this.pixiLayer){if(1===this.pixiLayer._renderer.type)try{this.pixiLayer._renderer.gl.getExtension("WEBGL_lose_context").loseContext(),Ut.log("[SebFeature] WebGL - lost context")}catch(e){}this.pixiLayer.remove(),this.pixiLayer=this.getPixiLayer(n).addTo(this.mapController.getLeafletMap())}else this.pixiLayer=this.getPixiLayer(n).addTo(this.mapController.getLeafletMap());null===(e=document.querySelector(".leaflet-overlay-pane"))||void 0===e||e.classList.add("seb-enabled")}}},{key:"showDisclaimer",value:function(){window.dialogController.open(this.translateSvc.translate("seb.disclaimer.text"),{header:this.translateSvc.translate("seb.disclaimer.header")})}},{key:"handleMarkerClick",value:(i=z(G().mark((function e(t,i,n){var r,a,s=this;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ut.log("[SebLayer] Clicked marker: ",t,i,n),e.next=3,this.httpClient.get("/api/seb/".concat(t));case 3:r=e.sent,(a=L.popup({closeButton:!0}).setContent(za(Xa(r,this.translateSvc)))).setLatLng([i,n]),this.mapController.getLeafletMap().openPopup(a),setTimeout((function(){var e;Qa("seb-chart",r,s.translateSvc),null===(e=document.getElementById("seb-disclaimer-link"))||void 0===e||e.addEventListener("click",
23s.showDisclaimer.bind(s))}),1e3);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getPixiLayer",value:function(e){var t,i=this,n=null,r=!0,a=new PIXI.TextStyle({fontSize:12,fontWeight:"bold",fontFamily:'"Arial Black", Gadget, sans-serif',fill:"#FFFFFF",align:"center",strokeThickness:1}),s=e.map((function(e){return new PIXI.Graphics})),o=e.map((function(e){return new PIXI.Text(e[2].toFixed(0),a)})),l=new PIXI.Container;l.interactive=!0;for(var c=0;c<e.length;c++)l.addChild(s[c]),this.enableLabels&&l.addChild(o[c]);return L.pixiOverlay((function(l){n&&(cancelAnimationFrame(n),n=null);var c=l.getMap().getZoom(),u=l.getContainer(),d=l.getRenderer(),h=l.latLngToLayerPoint,p=l.getScale();if(r&&Ut.log("[SebLayer] firstDraw",7,p,7/p),r||t!==c){var v,f=0,m=ae(s);try{var g=function(){var t,n=v.value,r=h([e[f][0],e[f][1]]),s=e[f][2];if(t=!0===e[f][4]?"bbbbbb":s>0&&s<=100?"1dafaf":s>=101&&s<=200?"1d8baf":s>=201&&s<=300?"1d66af":s>=301&&s<=500?"1d41af":s>=501&&s<=2e3?"411daf":s>=2001?"661daf":"bbbbbb",n.clear(),n.beginFill(parseInt(t,16),1),n.x=r.x,n.y=r.y,n.lineStyle(1.5/p,16777215),n.drawCircle(0,0,7*(!0===e[f][4]?.75:1)/p),n.endFill(),n.interactive=!0,n.cursor="pointer",n.sebData={stationId:e[f][3],lat:e[f][0],lon:e[f][1]},n.off("pointerup"),n.on("pointerup",(function(){i.handleMarkerClick(n.sebData.stationId,n.sebData.lat,n.sebData.lon)})),i.enableLabels){var l=o[f];l.x=r.x,l.y=r.y,l.anchor.set(.5),a.fontSize=Math.max(7*(!0===e[f][4]?.75:1)/p)+1,l.interactive=!0,l.cursor="pointer",l.sebData={stationId:e[f][3],lat:e[f][0],lon:e[f][1]},l.off("pointerup"),l.on("pointerup",(function(){i.handleMarkerClick(l.sebData.stationId,l.sebData.lat,l.sebData.lon)}))}f+=1};for(m.s();!(v=m.n()).done;)g()}catch(e){m.e(e)}finally{m.f()}}var y=null;r||t===c||(y=null,n=requestAnimationFrame((function e(t){var i;null===y&&(y=t),i=t-y,d.render(u),i<100&&(n=requestAnimationFrame(e))}))),r=!1,t=c,d.render(u)}),l,{doubleBuffering:!1,forceCanvas:!0,autoPreventDefault:!1})}},{key:"disable",value:function(){var e;(this.isEnabled=!1,Ut.log("SebFeature disable",this.isEnabled),null!==this.eventEmitterListenerRef)&&(null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners());this.clearFeatures(),window.polygonsLayer.setBackgroundColorOpacity(void 0)}},{key:"uiEventListener",value:function(e){var t,i=e.command;i&&"REPORT_UDATED_AT"===i&&this.sebData&&(null===(t=this.eventEmitter)||void 0===t||t.emit("ui",{dataUpdatedAt:this.sebData.updated_at}))}}]),t}(ue),es=function(){function e(){Z(this,e),J(this,"observeValuesEmitter",new _n),J(this,"profileService",window.profile),this.currentSettings=this.profileService.getSetting("accessibility"),this.persist(),this.setBodyClasses()}return Y(e,[{key:"getSettings",value:function(){return this.currentSettings}},{key:"getEventEmitter",value:function(){return this.observeValuesEmitter}},{key:"persist",value:function(){this.profileService.updateSetting("accessibility",this.currentSettings)}},{key:"setBodyClasses",value:function(){!0===this.currentSettings.reduceMotion&&document.body.classList.add("reduce-motion")}},{key:"setReduceMotion",value:function(e){this.currentSettings.reduceMotion=e,this.observeValuesEmitter.emit("reduceMotion",e),this.persist()}}]),e}(),ts=function(){function e(){Z(this,e),J(this,"dialogShownSignal",new Ve(!1)),J(this,"dialogTitleSignal",new Ve("")),J(this,"dialogConfigSignal",new Ve({})),J(this,"dialogBodySignal",new Ve(null)),J(this,"dialogOnClose",new Ve)}return Y(e,[{key:"open",value:function(e,t){this.dialogConfigSignal.value=t,this.dialogBodySignal.value=e,this.dialogShownSignal.value=!0}},{key:"close",value:function(e){this.dialogTitleSignal.value="",this.dialogBodySignal.value="",this.dialogShownSignal.value=!1,this.dialogOnClose.value=e||null}}]),e}(),is=function(){function e(t,i){var n=this;if(Z(this,e),J(this,"lsKey","dsm__offline_config"),J(this,"config",[]),J(this,"offlineWarnElement",document.querySelector(".offline-warn")),J(this,"mapErrorWarnElement",document.querySelector(".map-load-error")),J(this,"worker",null),J(this,"progressEmitter",new _n),J(this,"isAppOffline",new Ve(!1)),this.mapController=t,this.translateSvc=i,window.localStorage){var r=window.localStorage.getItem(this.lsKey);r?this.config=JSON.parse(r):window.localStorage.setItem(this.lsKey,JSON.stringify(this.config)),t.tileLoadErrors.once("base",(function(){n.showMapErrorWarn()})),!1===navigator.onLine&&(console.log("[OfflineMapsController] Initial state is offline"),this.onOffline())}}var t;return Y(e,[{key:"handleMapErrorDismiss",value:function(){this.mapErrorWarnElement&&(this.mapErrorWarnElement.style.display="none")}},{key:"handleMapErrorAction",value:function(){this.mapErrorWarnElement&&(this.mapErrorWarnElement.style.display="none",this.onOffline())}},{key:"handleOfflineWarnAction",value:function(){this.mapErrorWarnElement&&(this.mapErrorWarnElement.style.display="none",this.onOnline())}},{key:"showMapErrorWarn",value:function(){if(this.mapErrorWarnElement){this.mapErrorWarnElement.style.display="flex";var e=document.querySelector(".map-load-error .map-loading-issues"),t=document.querySelector(".map-load-error .map-load-error-btn");e&&t&&(e.innerHTML=this.translateSvc.translate("offline.mapNetworkIssues"),t.innerHTML=this.translateSvc.translate("offline.switchToOffline"))}}},{key:"onOffline",value:function(){if(console.log("[OfflineMapsController] Going offline"),this.isAppOffline.value=!0,this.offlineWarnElement){this.offlineWarnElement.style.display="flex";var e=document.querySelector(".offline-warn .you-are-offline"),t=document.querySelector(".offline-warn .switch-to-online");e&&t&&(e.innerHTML=this.translateSvc.translate("offline.offlineBanner"),t.innerHTML=this.translateSvc.translate("offline.offlineBannerAction"))}var i=this.getMaxMapZoomLevel();(i<6||i>16)&&(i=12),this.mapController.setBaseLayer(nt.layers.OFFLINE,i||12)}},{key:"onOnline",value:function(){var e=this;console.log("[OfflineMapsController] Going back online"),this.isAppOffline.value=!1,this.offlineWarnElement&&(this.offlineWarnElement.style.display="none"),this.mapController.setBaseLayer(nt.layers.DEFAULT),this.mapController.tileLoadErrors.once("base",(function(){e.showMapErrorWarn()}))}},{key:"getLocalConfig",value:function(){return this.config}},{key:"evaluatePossibleActions",value:function(e,t,i){var n,r=this,a=[],s=this.config.filter((function(e){return!0===e.downloaded})).map((function(e){return e.id})),o=ae(e);try{var l=function(){var e,t=n.value,o={assetId:t.id,action:wt.DO_NOTHING},l=r.config.find((function(e){return e.id===t.id}));if(l&&!0===l.downloaded)l.version<t.version?o.action=wt.CAN_UPDATE:o.action=wt.ALREADY_INSTALLED;else if((null===(e=t.requirements)||void 0===e?void 0:e.length)>0&&t.requirements.some((function(e){return-1===s.indexOf(e)})))o.action=wt.REQUIREMENTS_NOT_MET,o.missingAssetIds=t.requirements.filter((function(e){return-1===s.indexOf(e)}));else{var c=t.assets.reduce((function(e,t){return e+t.size}),0);o.action=i&&c>i?wt.NO_FREE_SPACE:wt.CAN_DOWNLOAD}a.push(o)};for(o.s();!(n=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}return a}},{key:"mapRange",value:function(e,t,i,n,r){return(e-t)*(r-n)/(i-t)+n}},{key:"downloadAndProcessAsset",value:function(e){var t=this;this.worker||(console.log("[Worker | ZipToCache] Spawning"),this.worker=new Worker("/js/zip-to-cache.worker.js")),this.progressEmitter.emit(e.assetId,{progress:0}),this.worker.addEventListener("message",(function(i){var n=i.data,r=n.type,a=n.code,s=n.message,o=n.stage,l=n.progress;if("progress"===r)"prepare"===o?t.progressEmitter.emit(e.assetId,{progress:1}):"download"===o?t.progressEmitter.emit(e.assetId,{progress:t.mapRange(l,0,1,2,49)}):"verify"===o&&0===l?t.progressEmitter.emit(e.assetId,{progress:50}):"verify"===o&&1===l?t.progressEmitter.emit(e.assetId,{progress:51}):"unzip"===o&&t.progressEmitter.emit(e.assetId,{progress:t.mapRange(l,0,1,52,99)});else if("status"===r&&"done"===a){var c;console.log("[Worker | ZipToCache] Terminating"),null===(c=t.worker)||void 0===c||c.terminate(),t.worker=null,t.progressEmitter.emit(e.assetId,{progress:100}),t.progressEmitter.emit(e.assetId,{status:"done"})}else if("error"===r){var u;console.log("[Worker | ZipToCache] Terminating"),null===(u=t.worker)||void 0===u||u.terminate(),t.worker=null,t.progressEmitter.emit(e.assetId,{status:"error",code:a,message:s})}}));var i={url:e.url,cacheName:e.cache,checksum:e.checksum};console.log("[Worker | ZipToCache] Payload:",i),this.worker.postMessage(i)}},{key:"addItemToLocalConfig",value:function(e){var t=this.config.find((function(t){return t.id===e.id})),i=t?this.config.indexOf(t):-1;t?(t=V(V({},e),{},{downloaded:!0}),this.config[i]=t):this.config.push(V(V({},e),{},{downloaded:!0})),window.localStorage.setItem(this.lsKey,JSON.stringify(this.config))}},{key:"terminateWorker",value:function(){this.worker&&(console.log("[Worker | ZipToCache] Terminating forcefully"),this.worker.terminate(),this.worker=null),this.progressEmitter.removeAllListeners()}},{key:"purgeAllCaches",value:(t=z(G().mark((function e(){var t,i,n,r,a,s,o;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],i=ae(this.config);try{for(i.s();!(n=i.n()).done;)r=n.value,t.push.apply(t,ie(r.assets.map((function(e){return e.cache}))))}catch(e){i.e(e)}finally{i.f()}a=0,s=t;case 4:if(!(a<s.length)){e.next=12;break}return o=s[a],e.next=8,caches.delete(o);case 8:console.log("[Worker | ZipToCache] Cache ".concat(o," deleted upon user request"));case 9:a++,e.next=4;break;case 12:this.config=[],window.localStorage.setItem(this.lsKey,JSON.stringify(this.config));case 14:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getMaxMapZoomLevel",value:function(){return Math.max.apply(Math,ie(this.config.map((function(e){return Math.max.apply(Math,ie(e.assets.map((function(e){return Math.max.apply(Math,ie(e.zoom))}))))}
23))))}}]),e}();var ns=function(){function e(t){Z(this,e),J(this,"layer",null),J(this,"elementId","leaflet-pattern"),J(this,"commonStripeOptions",{patternContentUnits:"userSpaceOnUse",patternUnits:"userSpaceOnUse",weight:8,spaceWeight:10,height:20,angle:45}),this.map=t}return Y(e,[{key:"initChangesBetweenRevisions",value:function(e){var t=this;this.loadLeafletPatternScript().then((function(){var i=t.createStripePatterns();t.clearLayer(),t.addPatternsToMap(i),t.layer=t.createGeoJSONLayer(e,i)}))}},{key:"destroy",value:function(){this.clearLayer(),this.removeLeafletPatternScript()}},{key:"loadLeafletPatternScript",value:function(){var e=this;return new Promise((function(t,i){if(window.L&&window.L.StripePattern)t();else{var n=document.createElement("script");n.src="https://unpkg.com/[email protected]/dist/leaflet.pattern.js",n.id=e.elementId,document.body.appendChild(n),n.onload=function(){return t()},n.onerror=function(){return i(new Error("Failed to load Leaflet.pattern script"))}}}))}},{key:"createStripePatterns",value:function(){return{"0f9d58":new L.StripePattern(V({color:"#0f9d58"},this.commonStripeOptions)),"0288d1":new L.StripePattern(V({color:"#0288d1"},this.commonStripeOptions)),"01579b":new L.StripePattern(V({color:"#01579b"},this.commonStripeOptions)),a52714:new L.StripePattern(V({color:"#a52714"},this.commonStripeOptions)),bcaaa4:new L.StripePattern(V({color:"#bcaaa4",opacity:.5},this.commonStripeOptions))}}},{key:"addPatternsToMap",value:function(e){var t=this;Object.values(e).forEach((function(e){t.map.hasPattern(e)||e.addTo(t.map)}))}},{key:"clearLayer",value:function(){this.layer&&(this.layer.remove(),this.layer=null)}},{key:"createGeoJSONLayer",value:function(e,t){return L.geoJSON(e,{style:function(e){return e?{weight:2,fillPattern:t[e.properties.fill.replace("#","")],fillOpacity:.65,color:e.properties.stroke,dashArray:"4"}:{}}}).addTo(this.map)}},{key:"removeLeafletPatternScript",value:function(){var e=document.getElementById(this.elementId);e&&e.remove()}}]),e}(),rs=function(){function e(t,i){var n=this;Z(this,e),J(this,"layer",null),J(this,"layerOverlay",null),this.map=t,(new dt).get("/railways.json").then((function(e){n.geojson=e,n.initRailwayLayer(i)}))}return Y(e,[{key:"toggleRailWay",value:function(e){this.layer&&this.layerOverlay&&!1===e?(this.map.hasLayer(this.layer)&&this.layer.remove(),this.map.hasLayer(this.layerOverlay)&&this.layerOverlay.remove()):this.layer&&this.layerOverlay&&!0===e&&(this.map.hasLayer(this.layer)||this.layer.addTo(this.map),this.map.hasLayer(this.layerOverlay)||this.layerOverlay.addTo(this.map))}},{key:"initRailwayLayer",value:function(e){-1===Object.keys(this.map.getPanes()).indexOf("railway")&&this.map.createPane("railway"),this.layer=this.prepareRailWayLayer(this.geojson),this.layerOverlay=this.prepareRailWayOverlay(this.geojson),this.toggleRailWay(e)}},{key:"prepareRailWayLayer",value:function(e){return this.layer?this.layer:L.geoJson(e,{pane:"railway",style:function(e){var t,i="construction"===(null==e||null===(t=e.properties)||void 0===t?void 0:t.type);return{weight:2,fillColor:i?"#FFBF00":"#FFFFFF",color:i?"#FFBF00":"#FFFFFF"}}})}},{key:"prepareRailWayOverlay",value:function(e){return this.layerOverlay?this.layerOverlay:L.geoJson(e,{pane:"railway",style:function(e){return{weight:2,fillColor:"#444444",color:"#444444",dashArray:"5 8"}}})}}]),e}(),as=function(){function e(t,i){var n=this;Z(this,e),J(this,"polygonLayer",null),J(this,"eventEmitter",new _n),J(this,"currentData",{}),J(this,"localStorageKey","dsm__filter"),J(this,"markersSettingsState",{isNato:!0,units:!0,headquarters:!0,airfields:!0,arrows:!0,railway:!0}),J(this,"isInteractive",!0),this.mapController=t,this.featuresController=i,this.map=t.getLeafletMap(),this.translateService=window.translateService,this.profileService=window.profile,t.mapReady.subscribe((function(e){e&&(Ut.log("PolygonsLayer","Received MapReady event, initializing"),n.initPolygons())}))}return Y(e,[{key:"initPolygons",value:function(){this.initLayer(this.map),this.comparisonLayer=new ns(this.map),this.loadMarkersSettingsState(),this.railwayLayerClass=new rs(this.map,!0===this.markersSettingsState.railway)}},{key:"refreshPolygons",value:function(){var e;this.initLayer(this.map,!0),null===(e=this.polygonLayer)||void 0===e||e.addData(this.currentData)}},{key:"compareVersions",value:function(e){var t;null===(t=this.comparisonLayer)||void 0===t||t.initChangesBetweenRevisions(e)}},{key:"destroyComparingVersions",value:function(){var e;null===(e=this.comparisonLayer)||void 0===e||e.destroy()}},{key:"loadMarkersSettingsState",value:function(){var e=this;if(new pt){var t=this.profileService.getSetting("filter");t?Object.keys(this.markersSettingsState).forEach((function(i){var n=i,r=t[n];void 0!==r&&"boolean"==typeof r&&(e.markersSettingsState[n]=t[n])})):this.saveMarkersSettingsState()}}},{key:"saveMarkersSettingsState",value:function(){var e=new pt;e&&(e.setItem(this.localStorageKey,this.markersSettingsState),this.profileService.updateSetting("filter",this.markersSettingsState))}},{key:"changeMarkersSettingsState",value:function(e,t){var i;(this.markersSettingsState[e]=t,this.saveMarkersSettingsState(),this.reEvaluateMarkerFilters(),"railway"===e)&&(null===(i=this.railwayLayerClass)||void 0===i||i.toggleRailWay(t))}},{key:"reEvaluateMarkerFilters",value:function(){var e,t;null===(e=this.polygonLayer)||void 0===e||e.clearLayers(),null===(t=this.polygonLayer)||void 0===t||t.addData(this.currentData)}},{key:"setInteractive",value:function(e){this.polygonLayer&&(this.isInteractive=e)}},{key:"refreshStyles",value:function(){this.polygonLayer&&this.polygonLayer.setStyle(this.styleFeature.bind(this))}}
23,{key:"setBackgroundColorOpacity",value:function(e,t){this.polygonLayer&&(e?this.polygonLayer.setStyle((function(i){var n,r;return{weight:void 0===t?0:t,fillColor:null==i||null===(n=i.properties)||void 0===n?void 0:n.fill,fillOpacity:e,color:null==i||null===(r=i.properties)||void 0===r?void 0:r.fill}})):this.polygonLayer.setStyle(this.styleFeature.bind(this)))}},{key:"filterFeature",value:function(e){var t;if("Point"===e.geometry.type&&(null!==(t=e.properties)&&void 0!==t&&t.iconSettings)){var i=e.properties.iconSettings,n=i.code,r=i.view,a={enemy:"units",ship:"units",iblorussia:"units",eblorussia:"units",airport:"airfields",headquarter:"headquarters",arrow_1:"arrows",arrow_2:"arrows",arrow_3:"arrows",arrow_4:"arrows",arrow_5:"arrows",arrow_6:"arrows",arrow_7:"arrows",arrow_8:"arrows",arrow_9:"arrows",arrow_10:"arrows",arrow_11:"arrows",arrow_12:"arrows",arrow_13:"arrows",arrow_14:"arrows",arrow_15:"arrows",arrow_16:"arrows"}[n];if(e.properties.iconSettings.url=this.markersSettingsState.isNato?r.nato:r.custom,a)return!!this.markersSettingsState[a]}return!0}},{key:"styleFeature",value:function(e){var t,i;return{weight:this.profileService.getSetting("polygonBorders")?1:0,fillColor:null===(t=e.properties)||void 0===t?void 0:t.fill,fillOpacity:.33,color:null===(i=e.properties)||void 0===i?void 0:i.fill}}},{key:"pointToLayer",value:function(e,t){var i,n,r=this;if(null!==(i=e.properties)&&void 0!==i&&i.iconSettings){var a=e.properties.iconSettings;n=L.icon({iconUrl:a.url,iconSize:[a.size,a.size],tooltipAnchor:[12,0]})}var s,o=this.preparePopUpContent(e.properties.description,e.properties.name);if(o){var l=L.popup({closeButton:!1}).setContent(o);s=L.marker(t,{icon:n}).bindPopup(l)}else s=L.marker(t,{icon:n});return s.on("click",(function(e){r.eventEmitter.emit("clickPoint",e);var t=r.featuresController.getFeatureClassByFeatureId("ruler");if(t&&!0===t.isEnabled)return t.handleMapClick(e),void e.target.closePopup()})),s}},{key:"initLayer",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&null!==this.polygonLayer)this.polygonLayer.remove(),this.polygonLayer=null;else if(!i&&this.polygonLayer)return;var n=window.mapUnitsController.getIsImperial();this.polygonLayer=L.geoJson(void 0,{style:this.styleFeature.bind(this),pointToLayer:this.pointToLayer.bind(this),filter:this.filterFeature.bind(this),onEachFeature:function(i,r){var a,s;if(-1!==["GeometryCollection","Polygon"].indexOf(i.geometry.type)){var o=Dt.geometry(i.geometry)/(n?2589988:1e6),l=t.preparePopUpContent(null===(a=i.properties)||void 0===a?void 0:a.description,null===(s=i.properties)||void 0===s?void 0:s.name,o?parseFloat(o.toFixed(2)):void 0);if(l){var c=L.popup({closeButton:!0}).setContent(l);r.off("click"),r.on("click",(function(i){t.eventEmitter.emit("clickLayer",i),!0===t.isInteractive?(c.setLatLng(i.latlng),e.openPopup(c)):t.map.fireEvent("click",i)}))}}}}).addTo(this.map)}},{key:"setLayerData",value:function(e){var t,i;null===(t=this.polygonLayer)||void 0===t||t.clearLayers(),e.features=this.translateFeatures(e.features),null===(i=this.polygonLayer)||void 0===i||i.addData(e),this.currentData=e,this.eventEmitter.emit("initPolygons",{features:e.features})}},{key:"getLayerData",value:function(){return this.currentData}},{key:"prepareIconSettings",value:function(e){if(e.properties.marker){var t="/images/custom_nato/".concat(e.properties.marker),i="/images/custom/".concat(e.properties.marker);return{url:this.markersSettingsState.isNato?t:i,view:{nato:t,custom:i},size:24,code:e.properties.marker.split(".")[0]}}if(e.properties.icon){var n={url:e.properties.icon,size:24,code:"",view:{nato:"",custom:""}};e.properties.description||(e.properties.description=""),"string"!=typeof e.properties.description&&(e.properties.description=e.properties.description.value);var r=/\{icon=([A-Za-z0-9_]+)(?:,size=([0-9]{1,3}))*\}/gm,a=r.exec(e.properties.description);if(e.properties.description&&null!==a){var s="/images/custom_nato/"+a[1]+".png",o="/images/custom/"+a[1]+".png";n={url:(this.markersSettingsState.isNato?s:o)||e.properties.icon,view:{nato:s,custom:o},size:+a[2]||24,code:a[1]},e.properties.description=e.properties.description.replace(r,"")}else n=V(V({},n),{},{url:e.properties.icon,view:{nato:e.properties.icon,custom:e.properties.icon}});return n}return null}},{key:"translateFeatureText",value:function(e){if(!e)return{translated:e,original:e};var t=function(e){"string"!=typeof e&&(e=e.value);var t=e.split("///");return{uk:t[0].trim(),en:t[1]?t[1].trim():t[0].trim(),i18n:t[2]?t[2].trim().replace(/<.*>/g,""):null}}(e);if(t.i18n){for(var i,n=/{{(.*?)}}/g,r={};null!==(i=n.exec(t.i18n));){var a=i[1].split(":");r[a[0]]=a[1]}return t.i18n=t.i18n.replace(/{{.*?}}/g,"").trim(),{translated:this.translateService.translate(t.i18n,r),original:e}}return{translated:t[this.translateService.language],original:e}}},{key:"translateFeatures",value:function(e){var t=this,i=e.map((function(e){if(e.properties){var i=t.translateFeatureText(e.properties.name),n=i.translated,r=i.original;if(e.properties.name=n,e.properties.original||(e.properties.original={name:r,description:""}),e.properties.iconSettings=t.prepareIconSettings(e),e.properties.description){var a=t.translateFeatureText(e.properties.description),s=a.translated,o=a.original;e.properties.original.description=o,e.properties.description=s}}return e}));return i}},{key:"preparePopUpContent",value:function(e,t,i){var n="";if(n=e?'<div class="flex-col gap-24">\n                <b class="feature-header">'.concat(t,'</b>
23\n                <span class="feature-description">').concat(e,"</span>\n            </div>"):'<b><span class="feature-header" data-translate="'.concat(t,'">').concat(t,"</span></b>"),i){var r=window.mapUnitsController.getIsImperial(),a=this.translateService.translate("ruler.area");n+='<br/><div class="flex-row">\n                <span class="area-caption">'.concat(a,": ").concat(new Intl.NumberFormat(this.translateService.language).format(i)," ").concat((!0===r?["ft","mi"]:["м","км"])[1],"<sup>2</sup></span>\n            </div>")}return n}},{key:"setLayerVisibility",value:function(e){var t,i;e?null===(t=this.polygonLayer)||void 0===t||t.remove():null===(i=this.polygonLayer)||void 0===i||i.addTo(this.map)}}]),e}(),ss=function(){function e(t){var i=this;Z(this,e),J(this,"games",[]),J(this,"gameEventEmitters",{}),J(this,"translateService",window.translateService),this.polygonsLayer=t,this.polygonsLayer.eventEmitter.addListener("clickPoint",(function(e){var t,n=e.target;switch(null===(t=n.feature)||void 0===t||null===(t=t.properties.iconSettings)||void 0===t?void 0:t.code){case"ukrainecapital":i.selectGame("bayraktar"),n.closePopup();break;case"moscow_ship":i.selectGame("grogu"),n.closePopup();break;case"kerchbridge":i.selectGame("deep-strike"),n.closePopup();break;case"russiacapital":var r,a,s,o=null===(r=n.feature)||void 0===r?void 0:r.properties.original,l=null===(a=n.feature)||void 0===a?void 0:a.properties;if(null!=o&&null!==(s=o.name)&&void 0!==s&&s.includes("geoJSON.territories.moscow")&&l){var c,u=null===(c=n.getPopup())||void 0===c?void 0:c.getElement();u&&u.classList.add("deep-strike-popup"),n.setPopupContent('<div class="flex-col">\n                            <b class="feature-header">'.concat(l.name,'</b>\n                            <span class="feature-description">').concat('<a class="deep-strike-link" href="/arcade" target="_blank" style="display: block; width: 220px;">\n                        <img src="images/deep-strike-arcade.webp" alt="Deep Strike Arcade">\n                        </a>',"</span>\n                        </div>"))}}})),this.polygonsLayer.eventEmitter.addListener("clickLayer",(function(e){var t,n=e.target;(null===(t=n.feature)||void 0===t||null===(t=t.properties.original)||void 0===t?void 0:t.name).includes("territories.tuzla")&&(i.selectGame("spider-web"),n.closePopup())}))}return Y(e,[{key:"registerGames",value:function(e){var t=this;Ut.startGroup("Easter Eggs"),Ut.logGrey("Registering games...."),e.forEach((function(e){t.registerGame(e),Ut.logGreen("Registered: ".concat(e.name),{game:e})})),Ut.logGrey("All games was registered successfully"),Ut.endGroup()}},{key:"registerGame",value:function(e){this.games.push(e),this.gameEventEmitters[e.name]=new _n}},{key:"selectGame",value:function(e){var t,i=this,n=this.games.find((function(t){return t.name===e}));n&&(this.hasAnotherActiveGame(e)||(n.enabled?n.disable():(n.enable(),null===(t=this.getGameEventEmitter(n.name))||void 0===t||t.addListener("complete",(function(){var e=new gn,t=i.translateService.translate("messages.easter-game-completed",{name:n.name});e.add(t,"info"),n.disable()})))))}},{key:"hasAnotherActiveGame",value:function(e){return this.games.find((function(t){return t.isEnabled&&e!==t.name}))}},{key:"getGameEventEmitter",value:function(e){return this.gameEventEmitters[e]}}]),e}(),os=function(){function e(){Z(this,e),J(this,"isEnabled",!1),this.polygonsLayer=window.polygonsLayer,this.gamesController=window.easterEggs}return Y(e,[{key:"enable",value:function(){}},{key:"disable",value:function(){}},{key:"enabled",get:function(){return this.isEnabled}}]),e}(),ls={changeMarkerDirection:!0,autostart:!0,loop:!0},cs=function(){function e(t,i){Z(this,e),this.original=t,this.options=V(V({},ls),i);var n=t.MovingMarker.prototype._loadLine;t.MovingMarker.include({_direction:0,_loadLine:function(e){var t,i,r=this._latlngs[e],a=this._latlngs[e+1],s=this._calculateAngle(r,a),o=(t=this._direction,(i=s-t)>180?i-=360:i<-180&&(i+=360),i);return this._direction+=o,n.call(this,e)},_animate:function(e,t){this._animRequested=!1;var i=this._updateLine(e);if(!this.isEnded()){if(null!=i){var n=window.L.interpolatePosition(this._currentLine[0],this._currentLine[1],this._currentDuration,i);this.setLatLng(n);var r=this.getElement();r&&(r.style.transform="".concat(r.style.transform," rotate(").concat(this._direction,"deg)"),r.style.transformOrigin="center center",r.style.transition="all 0.2s")}
23t||(this._animId=L.Util.requestAnimFrame(this._animate,this,!1),this._animRequested=!0)}},resetWaypoints:function(e,t){this._latlngs=[];for(var i=0;i<e.length;i++)this.addLatLng(e[i],t)},restart:function(e,i){if(this._stopAnimation(),this._direction=0,this.setLatLng(L.latLng(e[0])),this._latlngs=e.map((function(e){return L.latLng(e)})),this._durations=this._createDurations(this._latlngs,i),this._currentDuration=0,this._currentIndex=0,this._state=t.MovingMarker.prototype.notStartedState,this._startTime=0,this._startTimeStamp=0,this._pauseStartTime=0,this._animId=0,this._animRequested=!1,this._currentLine=[],this._stations={},this.options.changeMarkerDirection){var n=this._latlngs[0],r=this._latlngs[1];this._direction=this._calculateBearing(n,r)}this._loadLine(0),this.fire("restart")},_calculateAngle:function(e,t){var i=e.lat*Math.PI/180,n=e.lng*Math.PI/180,r=t.lat*Math.PI/180,a=t.lng*Math.PI/180,s=Math.sin(a-n)*Math.cos(r),o=Math.cos(i)*Math.sin(r)-Math.sin(i)*Math.cos(r)*Math.cos(a-n),l=180*Math.atan2(s,o)/Math.PI;return l=(l+360)%360}})}return Y(e,[{key:"movingMarker",value:function(e,t,i){return this.original.movingMarker(e,t,i)}}]),e}(),us=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"name","bayraktar"),J($(e),"elementId","moving-marker"),J($(e),"ignoreTargets",["ukrainecapital","bayraktar"]),J($(e),"border",[{lat:51.29196038457911,lng:30.573153927713673},{lat:51.89041359924119,lng:24.32727420522115},{lat:48.397582230123305,lng:22.105481169608172},{lat:48.5180017,lng:23.5055065},{lat:48.397582230123305,lng:22.105481169608172},{lat:47.72262449179665,lng:25.01090283156361},{lat:47.77485861190158,lng:28.864082361857502},{lat:46.34611189111612,lng:29.982747386781526},{lat:45.426864503301296,lng:28.04062060739956},{lat:44.20352415444205,lng:33.15229829073296},{lat:44.845984704705664,lng:36.539367393975176},{lat:46.29245955582152,lng:37.191921991847515},{lat:47.11287507651251,lng:38.372735073711766},{lat:49.62045979362867,lng:40.035195596862756},{lat:50.40916576329188,lng:35.529461468696525},{lat:51.23362673871385,lng:35.12549909858508},{lat:52.35781885776366,lng:33.88253795978059},{lat:52.119959329491046,lng:30.977116297825116},{lat:51.30167546199394,lng:30.51100587077343}]),J($(e),"isDischarged",!1),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e=this;this.eventEmitter||(this.eventEmitter=this.gamesController.getGameEventEmitter(this.name)),this.listeningUserInteractions(),this.loadScript().then((function(){e.bayraktar=e.useBayraktar(),e.bayraktar.addTo(e.map),e.polygonsLayer.setInteractive(!1),e.isEnabled=!0}))}},{key:"disable",value:function(){var e;this.destroy(),this.polygonsLayer.reEvaluateMarkerFilters(),this.polygonsLayer.setInteractive(!0),this.isEnabled=!1,null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners()}},{key:"destroy",value:function(){this.bayraktar&&(this.bayraktar.remove(),this.bayraktar=null)}},{key:"restart",value:function(){this.isEnabled&&(this.isDischarged=!1)}},{key:"attack",value:function(e){var t=this;if(!this.isDischarged&&this.bayraktar&&this.bayraktar.isStarted()){var i=e.getLatLng();this.bayraktar.moveTo(i,2e3),this.bayraktar.once("end",(function(){t.isDischarged=!0,t.makeExplosion(i),e.remove(),t.backToBase()}))}}},{key:"listeningUserInteractions",value:function(){var e=this;this.polygonsLayer.eventEmitter.on("clickPoint",(function(t){var i,n,r=t.target;"Point"!==(null===(i=r.feature)||void 0===i?void 0:i.geometry.type)||e.ignoreTargets.includes((null===(n=r.feature)||void 0===n||null===(n=n.properties.iconSettings)||void 0===n?void 0:n.code)||"")||e.attack(r)}))}},{key:"calculateAvailableTargets",value:function(){var e=this,t=0;return this.map.eachLayer((function(i){if(i instanceof L.Marker){var n,r=null===(n=i.feature)||void 0===n||null===(n=n.properties.iconSettings)||void 0===n?void 0:n.code;r&&!e.ignoreTargets.includes(r)&&(t+=1)}})),t}},{key:"initBayraktar",value:function(e){var t=new cs(window.L.Marker),i=L.icon({iconUrl:"/images/easter-eggs/bayraktar.webp",iconSize:[100,50]});return t.movingMarker(e,5e4,{autostart:!0,loop:!0,icon:i})}},{key:"useBayraktar",value:function(){return this.bayraktar||(this.bayraktar=this.initBayraktar(this.border)),this.bayraktar}},{key:"makeExplosion",value:function(e){var t,i=L.icon({iconUrl:"/images/easter-eggs/cotton.gif",iconSize:[50,50],iconAnchor:[25,25]}),n=e||(null===(t=this.bayraktar)||void 0===t?void 0:t.getLatLng()),r=L.marker(n,{icon:i});r.addTo(this.map),qt(1500).then((function(){r.remove()}))}},{key:"backToBase",value:function(){var e,t,i=this;null===(e=this.bayraktar)||void 0===e||e.moveTo(this.border[0],2e3),null===(t=this.bayraktar)||void 0===t||t.on("end",(function(){var e,t=i.calculateAvailableTargets();if(i.isDischarged=!1,0===t)return null===(e=i.eventEmitter)||void 0===e||e.emit("complete"),void i.destroy();qt(1e3).then((function(){var e,t,n;null!==(e=i.bayraktar)&&void 0!==e&&e.isRunning()||(null===(t=i.bayraktar)||void 0===t||t.restart(i.border,5e4),null===(n=i.bayraktar)||void 0===n||n.start())}))}))}},{key:"loadScript",value:function(){var e=this;return new Promise((function(t,i){if(window.L.Marker.MovingMarker)t();else{var n=document.createElement("script");n.src="https://cdn.jsdelivr.net/npm/[email protected]/MovingMarker.min.js",n.id=e.elementId,document.body.appendChild(n),n.onload=function(){return t()},n.onerror=function(){return i(new Error("Failed to load MovingMarker.pattern script"))}}}))}},{key:"map",get:function(){return this.polygonsLayer.map}}]),t}(os),ds=function(){function e(t){Z(this,e),this.config=t,this.init()}return Y(e,[{key:"init",value:function(){this.div=document.createElement("div"),this.picture=document.createElement("img"),this.picture.classList.add(this.config.styleClass),this.picture.src=this.config.picture,this.div.classList.add("grogu-easter-egg"),this.div.appendChild(this.picture),document.body.appendChild(this.div)}},{key:"doMagic",value:function(){this.picture.src=this.config.activation.picture,this.picture.classList.toggle(this.config.activation.styleClass)}},{key:"stabilize",value:function(){this.picture.src=this.config.picture,this.picture.classList.toggle(this.config.styleClass)}},{key:"remove",value:function(){this.listener&&this.div.removeEventListener("click",this.listener),this.div.remove()}},{key:"on",value:function(e,t){this.div?this.div.addEventListener(e,t):console.error("Container element not found.")}}]),e}(),hs=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"name","grogu"),J($(e),"availableObjectsForAttack",[]),J($(e),"attackObjects",["enemy","airport","headquarter","blorussia","russiacapital","moscow_ship","arrow","clown","kerchbridge"]),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e=this;this.eventEmitter||(this.eventEmitter=this.gamesController.getGameEventEmitter(this.name)),this.availableObjectsForAttack=this.prepareAvailableTargetTypesForAttack(),this.grogu=new ds({picture:"/images/easter-eggs/grogu.gif",styleClass:"grogu",activation:{picture:"/images/easter-eggs/grogu-active.gif",styleClass:"grogu-active"}}),this.grogu.on("click",(function(){var t=e.selectTargetForAttack();e.attack(t)})),this.isEnabled=!0,this.polygonsLayer.setInteractive(!1)}},{key:"disable",value:function(){var e;this.destroy(),this.polygonsLayer.reEvaluateMarkerFilters(),this.polygonsLayer.setInteractive(!0),this.isEnabled=!1,null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners()}},{key:"destroy",value:function(){this.grogu&&(this.grogu.remove(),this.grogu=null)}},{key:"restart",value:function(){this.isEnabled&&(this.destroy(),this.enable())}},{key:"attack",value:function(e){var t=this;if(this.isEnabled){var i;null===(i=this.grogu)||void 0===i||i.doMagic();var n=this.identifyTargetsForAttack(e);this.makeExplosion(n).then((function(){var e,i;(null===(e=t.grogu)||void 0===e||e.stabilize(),t.availableObjectsForAttack.length)||(null===(i=t.eventEmitter)||void 0===i||i.emit("complete"))}))}}},{key:"selectTargetForAttack",value:function(){var e=Math.floor(Math.random()*this.availableObjectsForAttack.length),t=this.availableObjectsForAttack[e];return this.availableObjectsForAttack.splice(e,1),t}},{key:"prepareAvailableTargetTypesForAttack",value:function(){var e=[],t=["ukrainecapital"];return this.map.eachLayer((function(i){if(i instanceof L.Marker){var n,r=null===(n=i.feature)||void 0===n||null===(n=n.properties.iconSettings)||void 0===n?void 0:n.code;t.includes(r)||e.push(r)}})),this.attackObjects.filter((function(t){return e.some((function(e){return e.includes(t)}))}))}},{key:"identifyTargetsForAttack",value:function(e){var t=[];return this.map.eachLayer((function(i){if(i instanceof L.Marker){var n,r=i;null!==(n=r.options.icon)&&void 0!==n&&null!==(n=n.options.iconUrl)&&void 0!==n&&n.includes(e)&&t.push(r)}})),t}}
23,{key:"makeExplosion",value:function(e){var t=[];return e.forEach((function(e){var i=e.getElement();i.style.transition="all 1s",i.style.transform="".concat(i.style.transform," scale(1.5)");var n=new Promise((function(t){qt(1e3).then((function(){i.src="/images/easter-eggs/cotton.gif",qt(500).then((function(){e.remove(),t()}))}))}));t.push(n)})),Promise.all(t)}},{key:"map",get:function(){return this.polygonsLayer.map}}]),t}(os),ps=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","mobile-tools"),J($(e),"toolbarButtonSelector",'[data-site-nav="mobile-tools"]'),J($(e),"stackNode",$i),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0,Ut.log("MobileToolsFeature enable",this.isEnabled)}},{key:"disable",value:function(){this.isEnabled=!1,Ut.log("MobileToolsFeature disable",this.isEnabled)}}]),t}(ue),vs=function(){function e(t,i){Z(this,e),J(this,"options",{fraction:4,zoomForUnit:10}),this.layer=t,this.map=t.map,this.options=V(V({},this.options),i),this.coordsPicker=window.coordsPickerController,this.cityBounds=window.cityBoundsLayer,this.init()}return Y(e,[{key:"init",value:function(){var e=this;this.layer.eventEmitter.once("initPolygons",(function(){return e.updateMapFromHash()})),this.map.on("moveend",(function(){return e.handleHashFromMapPosition()})),window.addEventListener("hashchange",(function(){return e.updateMapFromHash()}))}},{key:"handleHashFromMapPosition",value:function(){var e=this.map.getCenter(),t=this.map.getZoom();window.location.hash="#".concat(t,"/").concat(e.lat.toFixed(this.options.fraction),"/").concat(e.lng.toFixed(this.options.fraction))}},{key:"updateMapFromHash",value:function(){var e=this.parts[0];if(""!==e){var t=null==e?void 0:e.startsWith("dl!"),i=isNaN(parseInt(e));return t?(console.log("[HashMapController] Deeplink detected"),void this.handleDeeplinkLocation()):i?(console.log("[HashMapController] GeoJSON entry detected"),void this.handleGeoJSONLocation()):void this.map.setView([Number(this.parts[1]),Number(this.parts[2])],Number(this.parts[0]),{animate:!1})}this.handleHashFromMapPosition()}},{key:"parts",get:function(){return window.location.hash.replace("#","").split("/").filter((function(e){return e}))}},{key:"handleDeeplinkLocation",value:function(){this.searchController=window.searchController;var e=this.parts[0].split("!");if(console.log("[HashMapController] Deeplink:",e),"dl"===e[0]&&3===e.length)if("city"===e[1]){console.log("[HashMapController] Deeplink: city");var t=e[2];this.cityBounds.loadAndShow(t,!0)}else if("coords"===e[1]){if(!this.searchController)return;console.log("[HashMapController] Deeplink: coords");var i=e[2].split(",").map(Number);if(i.filter((function(e){return!0===isNaN(e)})).length>0)return;this.searchController.handleResultClick({geometry:{type:"Point",coordinates:[i[1],i[0]]},type:"coordinate",title:"Deeplink Coordinate",recent:!1},!1)}}},{key:"handleGeoJSONLocation",value:function(){var e=this,t=this.layer.currentData.features;if(this.parts.length){var i=t.find((function(t){return t.properties.original.name.includes(e.parts.join("."))}));if(i){var n=i.geometry.coordinates,r=n[1],a=n[0],s=L.popup({closeButton:!1}).setContent('<b class="feature-header">'.concat(i.properties.name,"</b>
23")).setLatLng([r,a]);this.map.openPopup(s),this.map.setView([r,a],this.options.zoomForUnit)}else this.map.setView([Number(this.parts[1]),Number(this.parts[2])],Number(this.parts[0]),{animate:!1})}else this.handleHashFromMapPosition()}}]),e}(),fs=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","nuclear"),J($(e),"toolbarButtonSelector",'[data-site-nav="nuclear"]'),J($(e),"stackNode",Mi),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e=this;this.load().then((function(){e.isEnabled=!0,window.polygonsLayer.setInteractive(!1),e.eventEmitter||(e.eventEmitter=e.featuresController.getEventEmitterByFeatureId(e.appFeatureId)),e.mapClickListener=e.handleMapClick.bind(e),e.mapController.getLeafletMap().addEventListener("click",e.mapClickListener)}))}},{key:"disable",value:function(){this.isEnabled=!1,window.polygonsLayer.setInteractive(!0);var e=this.mapController.getLeafletMap();e.removeEventListener("click",this.mapClickListener),this.marker&&(e.removeLayer(this.marker),this.marker=null)}},{key:"handleMapClick",value:function(e){if(this.isEnabled){var t,i=e.latlng,n=L.icon({iconUrl:"/images/nuclear.webp",iconSize:[50,50],iconAnchor:[25,25],className:"leaflet-custom-pin"});this.marker?this.marker.setLatLng(i):this.marker=L.marker(i,{icon:n}).addTo(this.mapController.getLeafletMap()),null===(t=this.eventEmitter)||void 0===t||t.emit("ui-click",this.marker)}}},{key:"load",value:function(){return Promise.all([_t("https://nukemapshared.s3.us-west-2.amazonaws.com/scripts/nukeeffects.js",{}),_t("https://nukemapshared.s3.us-west-2.amazonaws.com/scripts/shared.js",{})])}}]),t}(ue),ms=function(e){function t(){var e;Z(this,t),J($(e=U(this,t)),"appFeatureId","onboarding"),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),J($(e),"stackNode",Ti),J($(e),"isOpened",!1);var i=window.profile.getSetting("onboarding");return e.isOnboard=i>=nt.onboardingSteps.length,window.self!==window.top?(e.isEnabled=!1,ee(e)):(e.isOnboard||(e.isEnabled=!0),e)}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue),gs={language:"dsm_language",filter:"dsm__filter",translates:"dsm_translates",lastViewedRevision:"dsm-latest-ver",offline:"dsm__offline_config",theme:"theme",onboarding:"dsm__onboarding",reticle:"dsm__reticle",mapLayer:"base-layer",accessibility:"dsm__accessibility",polygonBorders:"dsm__polygon-borders"},ys=function(){function e(){Z(this,e),J(this,"settings",{theme:"",language:"uk",lastViewedRevision:0,offline:[],translates:{},onboarding:0,filter:{},reticle:!1,mapLayer:nt.layers.DEFAULT,accessibility:{reduceMotion:!1},polygonBorders:!1}),J(this,"localStorage",new pt),J(this,"storageKey","dsm__profile"),this.settings=this.fetchDataFromLocalStorage()}return Y(e,[{key:"getSetting",value:function(e){return this.settings[e]}},{key:"fetchDataFromLocalStorage",value:function(){var e=this.localStorage.getItem(this.storageKey);for(var t in this.settings){var i=t;e?void 0===e[i]||null===e[i]?(this.settings[i]=this.localStorage.getItem(gs[i])||this.settings[i],this.localStorage.clear(gs[i])):this.settings[i]=e[i]:(this.settings[i]=this.localStorage.getItem(gs[i])||this.settings[i],this.localStorage.clear(gs[i]))}return this.settings}},{key:"updateSetting",value:function(e,t){switch(e){case"onboarding":(void 0===this.settings.onboarding||Number(this.settings.onboarding)<Number(t))&&(this.settings.onboarding=Number(t));break;case"lastViewedRevision":this.settings.lastViewedRevision=t;break;case"reticle":this.settings.reticle=t;break;case"polygonBorders":this.settings.polygonBorders=t;break;default:this.settings[e]=t}this.localStorage.setItem(this.storageKey,this.settings)}}]),e}(),bs=function(){function e(t,i,n,r){var a=this;Z(this,e),J(this,"apiRoot","https://search.deepstatemap.live/search"),J(this,"translateSvc",window.translateService),J(this,"cityBoundsLayer",window.cityBoundsLayer),J(this,"unitsCache",[]),J(this,"unitsLatestRevisionId",null),J(this,"lastResults",[]),J(this,"resultsMarker",null),J(this,"customMarkerIcon",L.icon({iconUrl:"/images/pin.png",iconSize:[32,39],iconAnchor:[16,39],className:"leaflet-custom-pin"})),J(this,"getCustomMarkerItem",(function(e){return L.icon({iconUrl:"/images/pin-".concat({hamlet:"village",village:"village",town:"town",city:"city"}[e],".png"),iconSize:[32,39],iconAnchor:[16,39],className:"leaflet-custom-pin"})})),J(this,"locateError",new Ve(null)),J(this,"controllerEnforcedState",new Ve(null)),this.mapController=t,this.revisionsController=i,this.polygonsLayer=n,this.featuresController=r,this.locateControl=L.control.locate({position:"bottomright",id:"geolocation-control",strings:{title:this.translateSvc.translate("features.geolocation")},locateOptions:{timeout:1e4,frequency:1e3,enableHighAccuracy:!0,maximumAge:1/0}
23,showPopup:!1,onLocationError:function(e,t){console.log("[SearchController] Location error",e),a.locateError.value=e}}).addTo(t.getLeafletMap())}var t;return Y(e,[{key:"getApiRoot",value:function(){return this.apiRoot}},{key:"locate",value:function(){this.locateControl&&this.locateControl.start()}},{key:"stopLocate",value:function(){this.locateControl&&(this.locateError.value=null,this.locateControl.stop())}},{key:"getUnits",value:function(){var e;if(null!==this.unitsCache&&this.unitsLatestRevisionId===this.revisionsController.state.currentRevisionId)return this.unitsCache;console.log("[SearchController] Rebuilding units cache due to revision change");var t=["iblorussia","enemy","headquarter"];return this.unitsLatestRevisionId=this.revisionsController.state.currentRevisionId,this.unitsCache=null===(e=this.polygonsLayer.getLayerData())||void 0===e||null===(e=e.features)||void 0===e?void 0:e.filter((function(e){return e.geometry&&"Point"===e.geometry.type&&e.properties&&e.properties.iconSettings&&-1!==t.indexOf(e.properties.iconSettings.code)})).map((function(e){return{name:e.properties&&e.properties.name,coordinates:e.geometry&&e.geometry.coordinates}})),this.unitsCache}},{key:"findUnits",value:function(e){var t,i=this,n=null===(t=this.getUnits())||void 0===t?void 0:t.filter((function(t){return-1!==t.name.toLowerCase().indexOf(e.toLowerCase())}));if(!n)return[];return n.map((function(e){return{type:"unit",geometry:{type:"Point",coordinates:e.coordinates},title:(t=e.name,t.trim()),subtitle:i.translateSvc.translate("info.unit").toLocal,recent:!1};var t}))}},{key:"clearState",value:function(){this.lastResults=[],this.resultsMarker&&(this.resultsMarker.remove(),this.resultsMarker=null);var e=window.coordsPickerController;e&&e.hidePicker(),this.controllerEnforcedState.value&&(this.controllerEnforcedState.value=null)}},{key:"getRecentSearches",value:function(){var e="dsm-search-history-".concat(this.translateSvc.language),t=window.localStorage.getItem(e);if(!t)return[];try{return JSON.parse(t)}catch(e){return console.warn("[SearchCtrl] Error parsing recent searches for lang ".concat(this.translateSvc.language,": ").concat(e.message)),[]}}},{key:"addRecentSearch",value:function(e){var t="dsm-search-history-".concat(this.translateSvc.language),i=window.localStorage.getItem(t);i||(i="[]");try{var n=JSON.parse(i);if(e.recent=!0,n.find((function(t){return t.l_gid===e.l_gid})))return;(n=[e].concat(ie(n))).length>5&&(n=n.slice(0,5)),window.localStorage.setItem(t,JSON.stringify(n))}catch(e){return console.warn("[SearchCtrl] Error parsing recent searches for lang ".concat(this.translateSvc.language,": ").concat(e.message)),[]}}},{key:"performSearch",value:(t=z(G().mark((function e(t){var i,n,r,a,s,o=arguments;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.length>1&&void 0!==o[1]?o[1]:"autocomplete",0!==t.length){e.next=3;break}return e.abrupt("return",[]);case 3:return"uk"==(n="uk"===this.translateSvc.language?"uk":"en")&&/[a-zA-Z]+/.test(t)&&(n="en"),r=new URLSearchParams({lang:n,text:t}),this.mapController.getLeafletMap().getZoom()>=9&&(r.append("focus_lat",this.mapController.getLeafletMap().getCenter().lat.toFixed(6)),r.append("focus_lon",this.mapController.getLeafletMap().getCenter().lng.toFixed(6))),e.next=9,fetch("".concat(this.apiRoot,"/").concat(i,"?").concat(r));case 9:return a=e.sent,e.next=12,a.json();case 12:if(!(s=e.sent).results||!s.results.length){e.next=18;break}return this.lastResults=s.results,e.abrupt("return",s.results);case 18:return e.abrupt("return",[]);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"handleResultClick",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];e.bbox?this.mapController.getLeafletMap().fitBounds([[e.bbox[1],e.bbox[0]],[e.bbox[3],e.bbox[2]]]):this.mapController.getLeafletMap().setView([e.geometry.coordinates[1],e.geometry.coordinates[0]],this.mapController.getLeafletMap().getZoom(),{animate:!1}),this.resultsMarker?this.resultsMarker.setLatLng([e.geometry.coordinates[1],e.geometry.coordinates[0]]).setIcon(e.l_subtype?this.getCustomMarkerItem(e.l_subtype):this.customMarkerIcon).addTo(this.mapController.getLeafletMap()):this.resultsMarker=L.marker([e.geometry.coordinates[1],e.geometry.coordinates[0]],{icon:e.l_subtype?this.getCustomMarkerItem(e.l_subtype):this.customMarkerIcon}).addTo(this.mapController.getLeafletMap()),e.handleMarkerClick&&"function"==typeof e.handleMarkerClick?this.resultsMarker.on("click",e.handleMarkerClick.bind(this)):"coordinate"===e.type?this.resultsMarker.on("click",(function(i){return t.coordsMarkerClickHandler(i,e)})):"locality"===e.l_type&&(e.type="term",this.resultsMarker.on("click",(function(i){return t.coordsMarkerClickHandler(i,e)}))),e.l_gid&&this.cityBoundsLayer.loadAndShow(e.l_gid,!0),i&&this.addRecentSearch(e),n&&(this.controllerEnforcedState.value={term:e.title})}},{key:"coordsMarkerClickHandler",value:function(e,t){var i=this.featuresController.getFeatureClassByFeatureId("ruler");if(i&&!0===i.isEnabled)i.handleMapClick(e);else{var n=window.coordsPickerController;
23n&&n.handleClickFromSearchResults(e.latlng.lat,e.latlng.lng,t)}}}]),e}(),ks=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","weather"),J($(e),"toolbarButtonSelector",'[data-site-nav="weather"]'),J($(e),"stackNode",Oi),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],zIndex:10}),J($(e),"eventEmitterListenerRef",null),J($(e),"libsLoaded",!1),J($(e),"client",null),J($(e),"currentLayer",""),J($(e),"attribution",null),J($(e),"deckGlLayer",null),J($(e),"tooltipElement",null),J($(e),"tooltipUnits",{temp:"°C",wind:"m/s",rain:"mm",clouds:"%",snow:"cm"}),e}var i,n,r,a,s,o;return K(t,e),Y(t,[{key:"enable",value:function(){var e,t=this;(this.eventEmitter||(this.eventEmitter=this.featuresController.getEventEmitterByFeatureId(this.appFeatureId)),this.eventEmitterListenerRef)||(null===(e=this.eventEmitter)||void 0===e||e.addListener("backend",this.uiEventListener.bind(this)));this.libsLoaded?this.loadClient():this.loadLibs().then((function(){return t.loadClient()})),this.mapController.getLeafletMap().addEventListener("zoom",this.mapPanZoomListener.bind(this)),this.mapController.getLeafletMap().addEventListener("move",this.mapPanZoomListener.bind(this)),this.isEnabled=!0}},{key:"mapPanZoomListener",value:function(e){this.isEnabled&&this.tooltipElement&&this.renderTooltip("",0,-100,-100)}},{key:"loadLibs",value:(o=z(G().mark((function e(){var t,i,n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,i=["https://cdn.jsdelivr.net/npm/geotiff","https://unpkg.com/[email protected]/dist.min.js","https://unpkg.com/[email protected]/dist/deck.gl-leaflet.min.js","https://www.unpkg.com/[email protected]/dist/weatherlayers-deck.umd.min.js","https://www.unpkg.com/[email protected]/dist/weatherlayers-client.umd.min.js"];case 2:if(!(t<i.length)){e.next=15;break}return n=i[t],Ut.log("[WeatherFeature] Loading dependency: "+n),e.prev=5,e.next=8,_t(n,{});case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(5);case 12:t++,e.next=2;break;case 15:this.libsLoaded=!0,Ut.log("[WeatherFeature] Dependencies loaded");case 17:case"end":return e.stop()}}),e,this,[[5,10]])}))),function(){return o.apply(this,arguments)})},{key:"loadClient",value:function(){var e;this.client||(WeatherLayers.setLicense({content:{id:"c0cf40e9-1c53-43e9-8617-8728d97c97ad",type:"noncommercial",name:"DeepStateMap",domains:["deepstatemap.live"],created:"2023-04-27T21:08:00.590Z"},signature:"q9utuxEGOtGSn1zco3usuJ0lszy2j2yLjQmyYYW0jGupGR1EVFfpLjZa3BrP2L4B1GpC9Lo4gshIJlYBtNVPcel3L/WS2rd97RM7fVff6qWp5d+a6MPxhz043/9vTKrf"}),this.client=new WeatherLayersClient.Client({accessToken:"w8kQDitjj9YO7MBqa1iE",datetimeInterpolate:!0}),Ut.log("[WeatherFeature] WL client init done")),null===(e=this.eventEmitter)||void 0===e||e.emit("ui",{loading:!1,state:"ready"})}},{key:"disable",value:function(){var e;null!==this.eventEmitterListenerRef&&(null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners());this.deckGlLayer&&(this.deckGlLayer.removeFrom(this.mapController.getLeafletMap()),this.deckGlLayer=null),this.attribution&&(this.mapController.getLeafletMap().attributionControl.removeAttribution(this.attribution),this.attribution=null),this.tooltipElement&&(this.tooltipElement.remove(),this.tooltipElement=null),this.mapController.getLeafletMap().removeEventListener("zoom",this.mapPanZoomListener),this.mapController.getLeafletMap().removeEventListener("move",this.mapPanZoomListener),this.isEnabled=!1}},{key:"uiEventListener",value:function(e){var t=e.layer;if(t){if(t===this.currentLayer)return;this.libsLoaded&&null!==this.client&&this.changeLayer(t)}}},{key:"changeLayer",value:function(e){var t,i=this,n=null;("temp"===e?n=this.renderTemperature.bind(this):"wind"===e?n=this.renderWind.bind(this):"rain"===e?n=this.renderPrecipitation.bind(this):"snow"===e?n=this.renderSnowCoverage.bind(this):"clouds"===e&&(n=this.renderCloudCoverage.bind(this)),n)&&(null===(t=this.eventEmitter)||void 0===t||t.emit("ui",{loading:!0}),n().then((function(){var t;i.currentLayer=e,null===(t=i.eventEmitter)||void 0===t||t.emit("ui",{loading:!1,layer:i.currentLayer})})).catch())}},{key:"renderTooltip",value:function(e,t,i,n,r){this.tooltipElement||(this.tooltipElement=document.createElement("div"),this.tooltipElement.classList.add("weather-tooltip"),this.tooltipElement.innerText="- -",document.body.appendChild(this.tooltipElement));this.tooltipElement.style.top=n+8+"px",this.tooltipElement.style.left=i+8+"px";var a=r?r(t):t.toFixed(1);this.tooltipElement.innerText="".concat(a," ").concat(e)}},{key:"renderPalette",value:function(e,t,i){var n,r=[],a=t.length;if(0===a)throw new Error("Palette is empty");for(var s=t[0][0],o=(t[a-1][0]-s)/6,l=0;l<7;l++){var c=s+l*o;r.push(c)}for(var u="linear-gradient(to right, ".concat(t.map((function(e){var t=e[1];return"rgb(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")})).join(", "),")"),d={cssGradient:u,paletteValues:{unit:e}},h=1;h<=7;h++){if(!d.paletteValues)return d;d.paletteValues[h]=i?Math.round(i(r[h-1])).toFixed(0):Math.round(r[h-1]).toFixed(0)}null===(n=this.eventEmitter)||void 0===n||n.emit("ui",{palette:d})}},{key:"deckGlChangeLayers",value:function(e){var t=this;this.deckGlLayer?this.deckGlLayer._deck.setProps({layers:e}):(this.deckGlLayer=new window.DeckGlLeaflet.LeafletLayer({views:[new window.deck.MapView({repeat:!0})],layers:e,onHover:function(e,i){if(e.raster&&e.raster.value){var n=e.raster.value,r=i.center.x,a=i.center.y,s=function(e){return(e-273.15).toFixed(1)};requestAnimationFrame((function(){return t.renderTooltip(t.tooltipUnits[t.currentLayer],n,r,a,"temp"===t.currentLayer?s:void 0)}))}},onClick:function(e,i){if(e.raster&&e.raster.value){var n=e.raster.value,r=i.center.x,a=i.center.y,s=function(e){return(e-273.15).toFixed(1)};requestAnimationFrame((function(){return t.renderTooltip(t.tooltipUnits[t.currentLayer],n,r,a,"temp"===t.currentLayer?s:void 0)}))}}}),this.deckGlLayer.addTo(this.mapController.getLeafletMap()));var i=document.querySelector("canvas#deckgl-overlay");i&&i.parentElement&&(i.parentElement.style.zIndex="200")}},{key:"renderTemperature",value:(s=z(G().mark((function e(){var t,i,n,r,a,s,o,l,c,u,d,h;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.client.loadDataset("gfs/temperature_2m_above_ground"),this.client.loadDataset("gfs/wind_10m_above_ground")]);case 2:return t=e.sent,i=te(t,2),n=i[0],i[1],null!=n&&n.attribution&&(r=n.attribution,this.attribution!==r&&(this.mapController.getLeafletMap().attributionControl.addAttribution(r),this.attribution=r)),a=[[233.14999999999998,[238,238,238]],[243.14999999999998,[255,170,255]],[253.14999999999998,[145,9,145]],[258.1515,[36,24,106]],[263.151,[85,78,177]],[268.155,[62,121,198]],[273.15,[75,182,152]],[278.15,[89,208,73]],[283.15,[190,228,61]],[288.15,[235,215,53]],[293.15,[234,164,62]],[298.15,[229,109,83]],[303.15,[190,48,102]],[313.15,[107,21,39]],[323.15,[43,0,1]]],this.renderPalette("°C",a,(function(e){return Math.round(e-273.15)})),e.next=11,Promise.all([this.client.loadDatasetData("gfs/temperature_2m_above_ground",(new Date).toISOString()),this.client.loadDatasetData("gfs/wind_10m_above_ground",(new Date).toISOString())]);case 11:s=e.sent,o=te(s,2),l=o[0],c=o[1],u=window.screen.width,d=250,u>=480&&(d=500),u>=720&&(d=1e3),u>=1280&&(d=1500),u>=1536&&(d=2e3),u>=1920&&(d=2500),h=[new WeatherLayers.RasterLayer({id:"raster",opacity:.5,image:l.image,boun
23ds:l.bounds,colorFormat:"RGBA",imageType:"SCALAR",imageInterpolation:"CUBIC",imageUnscale:l.imageUnscale,palette:a,extensions:[],pickable:!0}),new WeatherLayers.ParticleLayer({id:"particle",animate:!0,imageUnscale:c.imageUnscale,image:c.image,opacity:1,bounds:c.bounds,visible:!0,width:2,color:[200,200,200],speedFactor:6,numParticles:d,maxAge:70,pickable:!0})],this.currentLayer="temp",this.deckGlChangeLayers(h);case 25:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"renderWind",value:(a=z(G().mark((function e(){var t,i,n,r,a,s,o,l,c,u;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.client.loadDataset("gfs/wind_10m_above_ground")]);case 2:return t=e.sent,i=te(t,1),null!=(n=i[0])&&n.attribution&&(r=n.attribution,this.attribution!==r&&(this.mapController.getLeafletMap().attributionControl.addAttribution(r),this.attribution=r)),this.renderPalette("m/s",n.palette),e.next=9,Promise.all([this.client.loadDatasetData("gfs/wind_10m_above_ground",(new Date).toISOString())]);case 9:a=e.sent,s=te(a,1),o=s[0],l=window.screen.width,c=250,l>=480&&(c=500),l>=720&&(c=1e3),l>=1280&&(c=1500),l>=1536&&(c=2e3),l>=1920&&(c=2500),u=[new WeatherLayers.RasterLayer({id:"raster",opacity:.5,image:o.image,bounds:o.bounds,colorFormat:"RGBA",imageType:"VECTOR",imageInterpolation:"CUBIC",imageUnscale:o.imageUnscale,palette:n.palette,extensions:[],pickable:!0}),new WeatherLayers.ParticleLayer({id:"particle",animate:!0,imageUnscale:o.imageUnscale,image:o.image,opacity:1,bounds:o.bounds,visible:!0,width:2,color:[100,100,100],speedFactor:6,numParticles:c,maxAge:70})],this.deckGlChangeLayers(u);case 21:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"renderPrecipitation",value:(r=z(G().mark((function e(){var t,i,n,r,a,s,o,l;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.client.loadDataset("gfs/precipitation_3h_accumulation_surface")]);case 2:return t=e.sent,i=te(t,1),null!=(n=i[0])&&n.attribution&&(r=n.attribution,this.attribution!==r&&(this.mapController.getLeafletMap().attributionControl.addAttribution(r),this.attribution=r)),this.renderPalette("mm",n.palette),e.next=9,Promise.all([this.client.loadDatasetData("gfs/precipitation_3h_accumulation_surface",(new Date).toISOString())]);case 9:a=e.sent,s=te(a,1),o=s[0],l=[new WeatherLayers.RasterLayer({id:"raster",opacity:.5,image:o.image,bounds:o.bounds,colorFormat:"RGBA",imageType:"SCALAR",imageInterpolation:"CUBIC",imageUnscale:o.imageUnscale,palette:n.palette,extensions:[],pickable:!0})],this.deckGlChangeLayers(l);case 14:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"renderSnowCoverage",value:(n=z(G().mark((function e(){var t,i,n,r,a,s,o,l;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.client.loadDataset("gfs/snow_depth_surface")]);case 2:return t=e.sent,i=te(t,1),null!=(n=i[0])&&n.attribution&&(r=n.attribution,this.attribution!==r&&(this.mapController.getLeafletMap().attributionControl.addAttribution(r),this.attribution=r)),this.renderPalette("mm",n.palette),e.next=9,Promise.all([this.client.loadDatasetData("gfs/snow_depth_surface",(new Date).toISOString())]);case 9:a=e.sent,s=te(a,1),o=s[0],l=[new WeatherLayers.RasterLayer({id:"raster",opacity:.5,image:o.image,bounds:o.bounds,colorFormat:"RGBA",imageType:"SCALAR",imageInterpolation:"LINEAR",imageSmoothins:0,imageUnscale:o.imageUnscale,palette:n.palette,extensions:[],pickable:!0})],this.deckGlChangeLayers(l);case 14:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"renderCloudCoverage",value:(i=z(G().mark((function e(){var t,i,n,r,a,s,o,l;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.client.loadDataset("gfs/cloud_cover_entire_atmosphere")]);case 2:return t=e.sent,i=te(t,1),null!=(n=i[0])&&n.attribution&&(r=n.attribution,this.attribution!==r&&(this.mapController.getLeafletMap().attributionControl.addAttribution(r),this.attribution=r)),this.renderPalette("%",n.palette),e.next=9,Promise.all([this.client.loadDatasetData("gfs/cloud_cover_entire_atmosphere",(new Date).toISOString())]);case 9:a=e.sent,s=te(a,1),o=s[0],l=[new WeatherLayers.RasterLayer({id:"raster",opacity:.5,image:o.image,boun
23ds:o.bounds,colorFormat:"RGBA",imageType:"SCALAR",imageInterpolation:"CUBIC",imageUnscale:o.imageUnscale,palette:n.palette,extensions:[],pickable:!0})],this.deckGlChangeLayers(l);case 14:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]),t}(ue),ws=function(e){function t(e){var i;return Z(this,t),J($(i=U(this,t)),"appFeatureId","reticle"),J($(i),"toolbarButtonSelector",""),J($(i),"stackNode",null),J($(i),"modality",{exclusive:!1,standalone:!0,requires:[],incompatible:[]}),i.layer=e,i.isEnabled=i.layer.getState(),i}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0,this.layer.setState(this.isEnabled)}},{key:"disable",value:function(){this.isEnabled=!1,this.layer.setState(this.isEnabled)}}]),t}(ue),Cs=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","history-calendar"),J($(e),"toolbarButtonSelector",""),J($(e),"stackNode",Xi),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],mobileLayout:l.USE_MINIMUN_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue),Ss=function(){var e=window.translateService;return we((function(){return function(){window.featuresController.disableFeatureById(nt.features.SHORTCUTS)}}),[]),st("div",{class:"shortcuts",children:[{header:"shortcuts.sections.anywhere",shortcuts:[{label:"shortcuts.move.left",combination:[],icon:"arrow_back"},{label:"shortcuts.move.right",combination:[],icon:"arrow_forward"},{label:"shortcuts.move.down",combination:[],icon:"arrow_downward"},{label:"shortcuts.move.up",combination:[],icon:"arrow_upward"},{label:"shortcuts.zoom.in",combination:[],icon:"add"},{label:"shortcuts.zoom.out",combination:[],icon:"remove"}]},{header:"shortcuts.sections.features",shortcuts:[{label:"features.rule",combination:[Lt.controlKey(),"Shift","D"],icon:""},{label:"features.drawing",combination:[Lt.controlKey(),"Shift","P"],icon:""},{label:"features.settings",combination:[Lt.controlKey(),"Shift","S"],icon:""},{label:"features.radiation",combination:[Lt.controlKey(),"U"],icon:""},{label:"shortcuts.header",combination:[Lt.controlKey(),"/"],icon:""},{label:"shortcuts.history.next",combination:[Lt.controlKey(),["→","↑"]],icon:""},{label:"shortcuts.history.prev",combination:[Lt.controlKey(),["←","↓"]],icon:""}]},{header:"shortcuts.sections.map",shortcuts:[{label:"settings.map-center-marker",combination:["Alt","S"],icon:""},{label:e.translate("shortcuts.map-view",{name:e.translate("settings.map-view.standard")}),combination:["Ctrl","Shift","1"],icon:""},{label:e.translate("shortcuts.map-view",{name:e.translate("settings.map-view.topographic")}),combination:["Ctrl","Shift","2"],icon:""},{label:e.translate("shortcuts.map-view",{name:e.translate("settings.map-view.topographic")}),combination:["Ctrl","Shift","3"],icon:""}]}].map((function(e){return st("div",{className:"shortcuts-col",children:[st("div",{className:"shortcuts-title",children:["  ",st(gt,{children:e.header})]}),e.shortcuts.map((function(e){return st("div",{class:"shortcuts-combination",children:[st("div",{class:"keystrokes",children:[e.icon&&st("span",{class:"keystroke material-symbols-outlined",children:[" ",e.icon," "]}),e.combination.length>0&&e.combination.map((function(e,t){return st(g,{children:[t>0&&st("span",{children:"+"}),st(_s,{keys:e})]})}))]}),st("span",{class:"shortcuts-description",children:[" ",st(gt,{children:e.label})," "]})]})}))]})}))})},_s=function(e){return Array.isArray(e.keys)?st("div",{class:"flex-row gap-4",children:["( ",e.keys.map((function(e,t){return st(g,{children:[t>0&&st("span",{children:","}),st("span",{class:"keystroke",children:[" ",e]})]})}))," )"]}):st("span",{class:"keystroke",children:e.keys})},Es=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","shortcuts"),J($(e),"toolbarButtonSelector",""),J($(e),"stackNode",null),J($(e),"dialogController",window.dialogController),J($(e),"translateService",window.translateService),J($(e),"modality",{exclusive:!1,standalone:!0,requires:[],incompatible:[]}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0,this.dialogController.open(st(Ss,{}),{header:this.translateService.translate("shortcuts.header")})}},{key:"disable",value:function(){this.isEnabled=!1,this.dialogController.close(!0)}}]),t}(ue),Ls=function(){function e(t){Z(this,e),J(this,"apiRoot","https://search.deepstatemap.live/bounds"),J(this,"boundsLayer",null),this.map=t,t.addEventListener("click",this.handleMapClick.bind(this))}var t;return Y(e,[{key:"handleMapClick",value:function(){var e=window.featuresController,t=null==e?void 0:e.getFeatureSignals();e&&t&&!0===t.ruler.value||null!==this.boundsLayer&&this.hide()}},{key:"loadAndShow",value:(t=z(G().mark((function e(t){var i,n,r,a,s=arguments;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>1&&void 0!==s[1]&&s[1],e.prev=1,e.next=4,fetch(this.apiRoot+"/"+t);case 4:return n=e.sent,e.next=7,n.json();case 7:(r=e.sent)&&r.type&&"FeatureCollection"===r.type?(a=r,this.show(a),i&&Array.isArray(r.bbox)&&this.map.fitBounds([[r.bbox[1],r.bbox[0]],[r.bbox[3],r.bbox[2]]],{maxZoom:13})):console.log("[CityBounds] Not found for GID: "+t),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),console.log("[CityBounds] Query errorr for GID: "+e.t0.message);case 14:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return t.apply(this,arguments)})},{key:"show",value:function(e){null===this.boundsLayer?(this.boundsLayer=L.geoJSON(e,{style:{fillColor:"#000",weight:2,color:"#eb0c0c",dashArray:"4",fillOpacity:.1}}),this.boundsLayer.addTo(this.map),this.boundsLayer.bringToFront()):(this.boundsLayer.remove(),this.boundsLayer=null,this.show(e))}},{key:"hide",value:function(){null!==this.boundsLayer&&(this.boundsLayer.remove(),this.boundsLayer=null)}}]),e}(),xs=Y((function e(t){Z(this,e),J(this,"toasts",new Ve([])),this.config=t}));class Is{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){const t=Is.hexChars,i=Is.hexOut;let n,r,a,s;for(s=0;s<4;s+=1)for(r=8*s,n=e[s],a=0;a<8;a+=2)i[r+1+a]=t.charAt(15&n),n>>>=4,i[r+0+a]=t.charAt(15&n),n>>>=4;return i.join("")}static _md5cycle(e,t){let i=e[0],n=e[1],r=e[2],a=e[3];i+=(n&r|~n&a)+t[0]-680876936|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&r)+t[1]-389564586|0,a=(a<<12|a>>>20)+i|0,r+=(a&i|~a&n)+t[2]+606105819|0,r=(r<<17|r>>>15)+a|0,n+=(r&a|~r&i)+t[3]-1044525330|0,n=(n<<22|n>>>10)+r|0,i+=(n&r|~n&a)+t[4]-176418897|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&r)+t[5]+1200080426|0,a=(a<<12|a>>>20)+i|0,r+=(a&i|~a&n)+t[6]-1473231341|0,r=(r<<17|r>>>15)+a|0,n+=(r&a|~r&i)+t[7]-45705983|0,n=(n<<22|n>>>10)+r|0,i+=(n&r|~n&a)+t[8]+1770035416|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&r)+t[9]-1958414417|0,a=(a<<12|a>>>
2320)+i|0,r+=(a&i|~a&n)+t[10]-42063|0,r=(r<<17|r>>>15)+a|0,n+=(r&a|~r&i)+t[11]-1990404162|0,n=(n<<22|n>>>10)+r|0,i+=(n&r|~n&a)+t[12]+1804603682|0,i=(i<<7|i>>>25)+n|0,a+=(i&n|~i&r)+t[13]-40341101|0,a=(a<<12|a>>>20)+i|0,r+=(a&i|~a&n)+t[14]-1502002290|0,r=(r<<17|r>>>15)+a|0,n+=(r&a|~r&i)+t[15]+1236535329|0,n=(n<<22|n>>>10)+r|0,i+=(n&a|r&~a)+t[1]-165796510|0,i=(i<<5|i>>>27)+n|0,a+=(i&r|n&~r)+t[6]-1069501632|0,a=(a<<9|a>>>23)+i|0,r+=(a&n|i&~n)+t[11]+643717713|0,r=(r<<14|r>>>18)+a|0,n+=(r&i|a&~i)+t[0]-373897302|0,n=(n<<20|n>>>12)+r|0,i+=(n&a|r&~a)+t[5]-701558691|0,i=(i<<5|i>>>27)+n|0,a+=(i&r|n&~r)+t[10]+38016083|0,a=(a<<9|a>>>23)+i|0,r+=(a&n|i&~n)+t[15]-660478335|0,r=(r<<14|r>>>18)+a|0,n+=(r&i|a&~i)+t[4]-405537848|0,n=(n<<20|n>>>12)+r|0,i+=(n&a|r&~a)+t[9]+568446438|0,i=(i<<5|i>>>27)+n|0,a+=(i&r|n&~r)+t[14]-1019803690|0,a=(a<<9|a>>>23)+i|0,r+=(a&n|i&~n)+t[3]-187363961|0,r=(r<<14|r>>>18)+a|0,n+=(r&i|a&~i)+t[8]+1163531501|0,n=(n<<20|n>>>12)+r|0,i+=(n&a|r&~a)+t[13]-1444681467|0,i=(i<<5|i>>>27)+n|0,a+=(i&r|n&~r)+t[2]-51403784|0,a=(a<<9|a>>>23)+i|0,r+=(a&n|i&~n)+t[7]+1735328473|0,r=(r<<14|r>>>18)+a|0,n+=(r&i|a&~i)+t[12]-1926607734|0,n=(n<<20|n>>>12)+r|0,i+=(n^r^a)+t[5]-378558|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^r)+t[8]-2022574463|0,a=(a<<11|a>>>21)+i|0,r+=(a^i^n)+t[11]+1839030562|0,r=(r<<16|r>>>16)+a|0,n+=(r^a^i)+t[14]-35309556|0,n=(n<<23|n>>>9)+r|0,i+=(n^r^a)+t[1]-1530992060|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^r)+t[4]+1272893353|0,a=(a<<11|a>>>21)+i|0,r+=(a^i^n)+t[7]-155497632|0,r=(r<<16|r>>>16)+a|0,n+=(r^a^i)+t[10]-1094730640|0,n=(n<<23|n>>>9)+r|0,i+=(n^r^a)+t[13]+681279174|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^r)+t[0]-358537222|0,a=(a<<11|a>>>21)+i|0,r+=(a^i^n)+t[3]-722521979|0,r=(r<<16|r>>>16)+a|0,n+=(r^a^i)+t[6]+76029189|0,n=(n<<23|n>>>9)+r|0,i+=(n^r^a)+t[9]-640364487|0,i=(i<<4|i>>>28)+n|0,a+=(i^n^r)+t[12]-421815835|0,a=(a<<11|a>>>21)+i|0,r+=(a^i^n)+t[15]+530742520|0,r=(r<<16|r>>>16)+a|0,n+=(r^a^i)+t[2]-995338651|0,n=(n<<23|n>>>9)+r|0,i+=(r^(n|~a))+t[0]-198630844|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~r))+t[7]+1126891415|0,a=(a<<10|a>>>22)+i|0,r+=(i^(a|~n))+t[14]-1416354905|0,r=(r<<15|r>>>17)+a|0,n+=(a^(r|~i))+t[5]-57434055|0,n=(n<<21|n>>>11)+r|0,i+=(r^(n|~a))+t[12]+1700485571|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~r))+t[3]-1894986606|0,a=(a<<10|a>>>22)+i|0,r+=(i^(a|~n))+t[10]-1051523|0,r=(r<<15|r>>>17)+a|0,n+=(a^(r|~i))+t[1]-2054922799|0,n=(n<<21|n>>>11)+r|0,i+=(r^(n|~a))+t[8]+1873313359|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~r))+t[15]-30611744|0,a=(a<<10|a>>>22)+i|0,r+=(i^(a|~n))+t[6]-1560198380|0,r=(r<<15|r>>>17)+a|0,n+=(a^(r|~i))+t[13]+1309151649|0,n=(n<<21|n>>>11)+r|0,i+=(r^(n|~a))+t[4]-145523070|0,i=(i<<6|i>>>26)+n|0,a+=(n^(i|~r))+t[11]-1120210379|0,a=(a<<10|a>>>22)+i|0,r+=(i^(a|~n))+t[2]+718787259|0,r=(r<<15|r>>>17)+a|0,n+=(a^(r|~i))+t[9]-343485551|0,n=(n<<21|n>>>11)+r|0,e[0]=i+e[0]|0,e[1]=n+e[1]|0,e[2]=r+e[2]|0,e[3]=a+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Is.stateIdentity),this}appendStr(e){const t=this._buffer8,i=this._buffer32;let n,r,a=this._bufferLength;for(r=0;r<e.length;r+=1){if(n=e.charCodeAt(r),n<128)t[a++]=n;else if(n<2048)t[a++]=192+(n>>>6),t[a++]=63&n|128;else if(n<55296||n>56319)t[a++]=224+(n>>>12),t[a++]=n>>>6&63|128,t[a++]=63&n|128;else{if(n=1024*(n-55296)+(e.charCodeAt(++r)-56320)+65536,n>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[a++]=240+(n>>>18),t[a++]=n>>>12&63|128,t[a++]=n>>>6&63|128,t[a++]=63&n|128}a>=64&&(this._dataLength+=64,Is._md5cycle(this._state,i),a-=64,i[0]=i[16])}return this._bufferLength=a,this}appendAsciiStr(e){const t=this._buffer8,i=this._buffer32;let n,r=this._bufferLength,a=0;for(;;){for(n=Math.min(e.length-a,64-r);n--;)t[r++]=e.charCodeAt(a++);if(r<64)break;this._dataLength+=64,Is._md5cycle(this._state,i),r=0}return this._bufferLength=r,this}appendByteArray(e){const t=this._buffer8,i=this._buffer32;let n,r=this._bufferLength,a=0;for(;;){for(n=Math.min(e.length-a,64-r);n--;)t[r++]=e[a++];if(r<64)break;this._dataLength+=64,Is._md5cycle(this._state,i),r=0}return this._bufferLength=r,this}getState(){const e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){const t=e.buffer,i=e.state,n=this._state;let r;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],r=0;r<t.length;r+=1)this._buffer8[r]=t.charCodeAt(r)}end(e=!1){const t=this._bufferLength,i=this._buffer8,n=this._buffer32,r=1+(t>>2);this._dataLength+=t;const a=8*this._dataLength;if(i[t]=128,i[t+1]=i[t+2]=i[t+3]=0,n.set(Is.buffer32Identity.subarray(r),r),t>55&&(Is._md5cycle(this._state,n),n.set(Is.buffer32Identity)),a<=4294967295)n[14]=a;else{const e=a.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;const t=parseInt(e[2],16),i=parseInt(e[1],16)||0;n[14]=t,n[15]=i}return Is._md5cycle(this._state,n),e?this._state:Is._hex(this._state)}}if(Is.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),Is.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Is.hexChars="0123456789abcdef",Is.hexOut=[],Is.onePassHasher=new Is,"5d41402abc4b2a76b9719d911017c592"!==Is.hashStr("hello"))throw new Error("Md5 self test failed.");var Fs,Ms=function(){function e(t){Z(this,e),J(this,"extFeatures",[]),J(this,"wrapComponent",document.querySelector(".ext-features-wrap")),J(this,"extScale",{show:!1,cssGradient:"",gradientRotation:"90deg",lowValue:"-1",highValue:"1"}
23),this.mapController=t,this.initExternalLoader()}return Y(e,[{key:"registerExtFeature",value:function(e){this.extFeatures.find((function(t){return t.id===e.id}))?Ut.log("ExtensionController",'ExtFeature "'.concat(e.id,'" exists, skipping')):(void 0===e.state&&(e.state=!1),e.init(this.mapController),Ut.log("ExtensionController",'ExtFeature "'.concat(e.id,'" initialized')),this.extFeatures.push(e),Ut.log("ExtensionController",'ExtFeature "'.concat(e.id,'" registered')),this.render())}},{key:"registerRulerExtensionFunction",value:function(e){this.rulerExtensionFunc||(this.rulerExtensionFunc=e)}},{key:"runRulerExtensionFunction",value:function(e){return this.rulerExtensionFunc?this.rulerExtensionFunc(e):void 0}},{key:"registerSearchExtensionFunction",value:function(e){this.searchExtensionFunc||(this.searchExtensionFunc=e)}},{key:"registerSearchExtensionFunctionRegexp",value:function(e){this.searchExtensionFuncRegexp||(this.searchExtensionFuncRegexp=e)}},{key:"execSearchExtensionFunctionRegexp",value:function(e){return!!this.searchExtensionFuncRegexp&&this.searchExtensionFuncRegexp.test(e)}},{key:"runSearchExtensionFunction",value:function(e){return this.searchExtensionFunc?this.searchExtensionFunc(e):Promise.resolve(void 0)}},{key:"toggleExtFeaturesWrap",value:function(){this.wrapComponent&&this.wrapComponent.classList.toggle("expanded")}},{key:"showExtFeaturesScale",value:function(e,t,i){this.wrapComponent&&this.extScale&&(this.wrapComponent.classList.add("has-scale"),this.extScale.show=!0,this.extScale.lowValue=t.toFixed(0),this.extScale.highValue=i.toFixed(0),this.extScale.cssGradient=e,window.matchMedia("(min-width: 768px)").matches?this.extScale.gradientRotation="90deg":this.extScale.gradientRotation="0deg",this.render())}},{key:"hideExtFeaturesScale",value:function(){this.wrapComponent&&this.extScale&&(this.wrapComponent.classList.remove("has-scale"),this.extScale.show=!1,this.extScale.cssGradient="",this.render())}},{key:"ext__mgrsToPoint",value:function(e){var t=e.replace(/\s\s+/g," "),i=/\s*([1-9]\d?)\s*([^IO])\s*([^IO])\s*([^IO])?\s*(\d{1,5})?\s*(\d{1,5})?\s*/gi.exec(t);if(!i)return null;for(var n=i[0].replace(/[\s]/g,""),r=0,a=Object.entries({"С":"C","Т":"T","Р":"P","А":"A","В":"B","Е":"E","К":"K","М":"M","Н":"H","Х":"X"});r<a.length;r++){var s=a[r];n=n.replace(s[0],s[1])}try{var o=te(ti(n),2);return[o[0],o[1]]}catch(e){return console.error("[ext__mgrsToPoint] Error:",e.message),console.error(e),null}}},{key:"handleExtFeatureButtonClick",value:function(e){var t=this.extFeatures.find((function(t){return t.id===e}));if(t){var i,n,r=this.extFeatures.indexOf(t),a=this.extFeatures[r];if(!0===a.togglable){var s=a.handler(a.state);a.state=!!s}else a.handler();if(!0===a.state)null===(i=document.querySelector('[data-ext-feature-id="'.concat(a.id,'"]')))||void 0===i||i.classList.add("active");else null===(n=document.querySelector('[data-ext-feature-id="'.concat(a.id,'"]')))||void 0===n||n.classList.remove("active");this.extFeatures[r]=a}}},{key:"render",value:function(){this.wrapComponent&&0!==this.extFeatures.length&&(this.wrapComponent.innerHTML='<div class="ext-features-button trigger-btn" onClick="window.extController.toggleExtFeaturesWrap();">\n            <span class="material-symbols-filled">\n                shield_lock\n            </span>\n        </div>\n        <div class="ext-features-button" onClick="window.extController.toggleExtFeaturesWrap();">\n            <span class="material-symbols-outlined">\n                close\n            </span>\n        </div>\n        '.concat(this.extFeatures.map((function(e){return'<div class="ext-features-button '.concat(e.togglable&&!0===e.state?"active":"",'" title="').concat(e.title,'" data-ext-feature-id="').concat(e.id,'" onClick="window.extController.handleExtFeatureButtonClick(\'').concat(e.id,'\');">\n            <span class="material-symbols-').concat(e.materialIconFilled?"filled":"outlined",'">\n                ').concat(e.materialIcon,"\n            </span>\n        </div>")})).join(""),"\n        \n        ").concat(this.extScale&&!0===this.extScale.show?'\n            <div class="ext-features-scale" style="background: linear-gradient('.concat(this.extScale.gradientRotation,", ").concat(this.extScale.cssGradient,')">\n                <div>').concat(this.extScale.lowValue,"</div>\n                <div>").concat(this.extScale.highValue,"</div>\n            </div>"):""))}}
23,{key:"initExternalLoader",value:function(){var e=JSON.parse(window.localStorage.getItem("scf-list")||"{}");if(Array.isArray(e)){for(var t=!1,i=0;i<e.length;i++)-1===e[i].indexOf("scf_v2_")&&(e[i]=e[i].replace("scf_","scf_v2_"),t=!0);t&&localStorage.setItem("scf-list",JSON.stringify(e));var n,r=ae(e);try{var a=function(){var t=n.value;console.log("ScFl: loading ",e.indexOf(t));var i=document.createElement("script");i.onload=function(){console.log("ScFl: onload ",e.indexOf(t))},i.onerror=function(){console.log("ScFl: onerror ",e.indexOf(t))},-1===t.indexOf("scf_v2_")?i.src=t.replace("scf_","scf_v2_"):i.src=t,document.body.appendChild(i)};for(r.s();!(n=r.n()).done;)a()}catch(e){r.e(e)}finally{r.f()}}}},{key:"handleExternal",value:function(e){var t=JSON.parse(localStorage.getItem("scf-list")||"{}");Array.isArray(t)||(t=[]);var i="/js/scf_v2_"+Is.hashStr(e)+".js",n=document.createElement("script");n.onload=function(){console.log("ScFl: onload text",e),-1===t.indexOf(i)&&t.push(i),alert("ScFl: 4.5.0"),localStorage.setItem("scf-list",JSON.stringify(t))},n.onerror=function(){console.log("ScFl: onerror text",e),alert("ScFl: дещо не вдалось, повторіть спробу")},n.src=i,document.body.appendChild(n)}},{key:"clearExternal",value:function(){localStorage.setItem("scf-list",JSON.stringify([])),alert("ScFl: дечого більше не буде, доведеться повторити дії"),location.reload()}}]),e}(),Rs=function(){function e(t,i){var n=this;Z(this,e),J(this,"componentStateSignal",new Ve({shown:!1})),J(this,"tooltipWidth",320),J(this,"reverseGeocodeApiRoot","https://search.deepstatemap.live/reverse"),J(this,"reverseGeocodeDebounce",ui((function(){n.currentLat&&n.currentLng&&n.reverseGeocodeQuery(n.currentLat,n.currentLng,n.translateSvc.language).then((function(e){0===e.length||e.length>1||n.componentStateSignal.value.shown&&(n.componentStateSignal.value=V(V({},n.componentStateSignal.value),{},{info:V(V({},n.componentStateSignal.value.info),{},{type:"settlement",caller:"reverse",searchResult:e[0],title:e[0].title,subtitle:e[0].subtitle})}))})).catch((function(e){console.log("[CoordsPicker] Reverse geocode query error",e)}))}),500)),this.mapController=t,this.translateSvc=i,this.bindEvents()}var t,i;return Y(e,[{key:"bindEvents",value:function(){var e=this;this.mapController.getLeafletMap().on("contextmenu",this.handleRightClickEvent.bind(this)),this.mapController.getLeafletMap().on("click",(function(){e.componentStateSignal.value.shown&&(e.componentStateSignal.value=V(V({},e.componentStateSignal.value),{},{shown:!1}))}))}},{key:"hidePicker",value:function(){this.componentStateSignal.value=V(V({},this.componentStateSignal.value),{},{shown:!1}),this.currentLat=void 0,this.currentLng=void 0}},{key:"calculatePayload",value:function(e,t){return[{title:"WGS-84",value:"".concat(e.toFixed(5),", ").concat(t.toFixed(5)),clipboardValue:"".concat(e,", ").concat(t)},{title:"MGRS",value:ei([t,e]),clipboardValue:ei([t,e])}]}},{key:"handleReticleClick",value:function(){var e=this.mapController.getLeafletMap().getCenter();this.click(e.lat,e.lng,!1,{type:"coordinate"})}},{key:"handleClickFromSearchResults",value:function(e,t,i){this.click(e,t,!1,i)}},{key:"handleRightClickEvent",value:function(e){this.click(e.latlng.lat,e.latlng.lng,!0,{type:"coordinate"})}},{key:"reverseGeocodeQuery",value:(i=z(G().mark((function e(t,i,n){var r,a,s;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new URLSearchParams({lat:t.toFixed(6),lon:i.toFixed(6),lang:n}),e.next=3,fetch("".concat(this.reverseGeocodeApiRoot,"?").concat(r));case 3:return a=e.sent,e.next=6,a.json();case 6:if(!(s=e.sent).results||!s.results.length){e.next=11;break}return e.abrupt("return",s.results);case 11:return e.abrupt("return",[]);case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"doReverseGeocode",value:(t=z(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.reverseGeocodeDebounce();case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"handleCityDeepLinkClick",value:function(){var e,t;this.searchController||(this.searchController=window.searchController),this.searchController||console.log(this.searchController),this.componentStateSignal.value&&"reverse"===(null===(e=this.componentStateSignal.value.info)||void 0===e?void 0:e.caller)&&null!==(t=this.componentStateSignal.value.info)&&void 0!==t&&t.searchResult&&this.searchController.handleResultClick(this.componentStateSignal.value.info.searchResult,!1,!0)}},{key:"click",value:function(e,t,i,n){var r,a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];!0===this.componentStateSignal.value.shown&&(null===(r=document.querySelector(".coords-picker-wrap"))||void 0===r||r.classList.remove("shown"),requestAnimationFrame((function(){var e;return null===(e=document.querySelector(".coords-picker-wrap"))||void 0===e?void 0:e.classList.add("shown")})));var o=this.mapController.getLeafletMap().latLngToContainerPoint([e,t]),l=this.mapController.getLeafletMap().getContainer().clientWidth,c=Math.min(this.tooltipWidth,l)/2+20,u=this.mapController.getLeafletMap().getContainer().clientHeight,d=145,h={x:0,y:0},p={x:0,y:0};if(o.x<c){var v=c-o.x;h.x=-v,p.x=v}else if(l-o.x<c){var f=l-o.x-c;h.x=-f,p.x=f}if(o.y<d){var m=d-o.y;h.y=-m,p.y=m}else if(u-o.y<d){var g=u-o.y-d;h.y=-g,p.y=g}0===h.x&&0===h.y||this.mapController.getLeafletMap().panBy([h.x,h.y],{animate:!0,noMoveStart:!0});this.componentStateSignal.value={shown:!0,left:o.x+p.x,top:o.y+p.y,showMarker:i,info:function(){if(n)return{type:n?"term"===n.type?"settlement":"coordinate"===n.type?"coords":"generic":"generic",caller:"search",title:n.title,subtitle:n.subtitle}}(),payload:this.calculatePayload(e,t),shareUrl:function(){if(n&&n.l_gid){var i=new URL(location.href);return i.hash="#dl!city!"+n.l_gid,i.toString()}
23var r=new URL(location.href);return r.hash="#dl!coords!"+[e,t].join(","),r.toString()}()},this.currentLat=e,this.currentLng=t,s||this.mapController.getLeafletMap().once("movestart",(function(){return a.hidePicker()}))}}]),e}(),As=Y((function e(t){Z(this,e),this.mapController=t;var i=document.createElement("a");i.href="https://www.maptiler.com",i.target="_blank",i.classList.add("maptiler-copyright"),i.innerHTML='<img src="https://api.maptiler.com/resources/logo.svg" alt="Cartographic data provided by MapTiler" style="width: 86px;">',this.mapController.getLeafletMap().getContainer().prepend(i)})),Ts=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","trenches-legend"),J($(e),"toolbarButtonSelector",'[data-site-nav="trenches-legend"]'),J($(e),"stackNode",Qi),J($(e),"modality",{exclusive:!1,requires:[],incompatible:[],zIndex:10,mobileLayout:l.USE_MINIMUN_HEIGHT}),J($(e),"eventEmitterListenerRef",null),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue),Ps=Y((function e(t){Z(this,e),J(this,"scaleControl",L.control.scale()),this.mapController=t,this.scaleControl.addTo(this.mapController.getLeafletMap())})),Ns=function(){function e(){Z(this,e),J(this,"apiUrl",""),this.httpClient=new dt(this.apiUrl)}return Y(e,[{key:"fetchRouteCoordinates",value:function(e,t,i){var n={start:e.join(","),end:t.join(","),count:i};return this.httpClient.get("/api/routes",n)}},{key:"fetchAirportsCoordinates",value:function(e,t){return this.httpClient.get("/api/routes/".concat(e,"/").concat(t))}}]),e}(),Ds=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"name","spider-web"),J($(e),"routingService",new Ns),J($(e),"dialogController",window.dialogController),J($(e),"elementId","moving-marker"),J($(e),"home",{lat:50.450063,lng:30.524239}),J($(e),"border",[e.home,{lat:50.98264080879975,lng:28.558959960937504},{lat:51.98318857213821,lng:29.264831542968754}]),J($(e),"attackCounter",0),J($(e),"attackTargets",["airport","russiacapital","kerchbridge"]),e}return K(t,e),Y(t,[{key:"enable",value:function(){var e=this;this.eventEmitter||(this.eventEmitter=this.gamesController.getGameEventEmitter(this.name)),this.listeningUserInteractions(),this.loadDependencies().then((function(){e.spider=e.useSpider(),e.spider.addTo(e.map),e.polygonsLayer.setInteractive(!1),e.isEnabled=!0}))}},{key:"disable",value:function(){var e;this.destroy(),this.polygonsLayer.reEvaluateMarkerFilters(),this.polygonsLayer.setInteractive(!0),this.isEnabled=!1,null===(e=this.eventEmitter)||void 0===e||e.removeAllListeners()}},{key:"destroy",value:function(){this.spider&&(this.spider.remove(),this.spider=null)}},{key:"restart",value:function(){this.isEnabled&&(this.destroy(),this.enable())}},{key:"attackAirport",value:function(e){var t=this;if(this.spider){var i=e.getLatLng();this.getRouteCoordinates(i).then((function(n){var r,a,s;null===(r=t.spider)||void 0===r||r.resetWaypoints(n,1e3),null===(a=t.spider)||void 0===a||a.start(),null===(s=t.spider)||void 0===s||s.once("end",(function(){var n;(t.makeExplosion(i),e.remove(),t.calculateAvailableTargets()>0)?(t.attackCounter++,t.restart(),t.attackCounter>2&&t.showDialog()):null===(n=t.eventEmitter)||void 0===n||n.emit("complete")}))})).catch((function(e){console.error("Failed to fetch route:",e),t.restart()}))}}},{key:"listeningUserInteractions",value:function(){var e=this;this.polygonsLayer.eventEmitter.once("clickPoint",(function(t){var i,n=t.target,r=e.attackTargets.some((function(e){var t;return null===(t=n.feature)||void 0===t||null===(t=t.properties.iconSettings)||void 0===t?void 0:t.url.includes(e)}));!r||null!==(i=e.spider)&&void 0!==i&&i.isRunning()||e.attackAirport(n)}))}},{key:"calculateAvailableTargets",value:function(){var e=this,t=0;return this.map.eachLayer((function(i){if(i instanceof L.Marker){var n,r=null===(n=i.feature)||void 0===n||null===(n=n.properties.iconSettings)||void 0===n?void 0:n.code;r&&e.attackTargets.some((function(e){return e.includes(r)}))&&(t+=1)}})),t}},{key:"initSpider",value:function(e){var t=new cs(window.L.Marker),i=L.icon({iconUrl:"/images/easter-eggs/truck.webp",iconSize:[50,50]});return t.movingMarker(e,5e3,{autostart:!1,loop:!1,icon:i})}}
23,{key:"useSpider",value:function(){var e;return null!==(e=this.spider)&&void 0!==e?e:this.initSpider(this.border)}},{key:"makeExplosion",value:function(e){var t,i=L.icon({iconUrl:"/images/easter-eggs/cotton.gif",iconSize:[50,50],iconAnchor:[25,25]}),n=e||(null===(t=this.spider)||void 0===t?void 0:t.getLatLng()),r=L.marker(n,{icon:i});r.addTo(this.map),qt(1500).then((function(){r.remove()}))}},{key:"loadDependencies",value:function(){return Promise.all([_t("https://cdn.jsdelivr.net/npm/[email protected]/MovingMarker.min.js",{id:this.elementId},document.head)])}},{key:"showDialog",value:function(){this.dialogController.open('<div class="fundraising-dialog">\n            <div class="fundraising-dialog-content">\n                <img class="fundraising-dialog-image" src="/images/easter-eggs/fura.jpg" alt="spider-web" />\n                <a class="connect-button" href="https://t.me/DeepStateUA/22300" target="_blank">\n                    <span>Долучитися</span>\n                </a>\n            </div>\n        </div>',{})}},{key:"getRouteCoordinates",value:function(e){return this.routingService.fetchAirportsCoordinates(parseFloat(e.lat.toFixed(4)),parseFloat(e.lng.toFixed(4)))}},{key:"map",get:function(){return this.polygonsLayer.map}}]),t}(os),Os="/deep-strike.js",Us=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"name","deep-strike"),J($(e),"gameContainer",null),J($(e),"mountElement",null),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.eventEmitter||(this.eventEmitter=this.gamesController.getGameEventEmitter(this.name)),this.createModal(),this.setupKeyListeners(),this.isEnabled=!0,this.polygonsLayer.setInteractive(!1)}},{key:"disable",value:function(){var e,t;this.handleKeyPress&&(window.removeEventListener("keydown",this.handleKeyPress),this.handleKeyPress=void 0),null===(e=window.DeepStrike)||void 0===e||e.destroy(),this.gameContainer&&(this.gameContainer.remove(),this.gameContainer=null,this.mountElement=null),this.polygonsLayer.reEvaluateMarkerFilters(),this.polygonsLayer.setInteractive(!0),this.isEnabled=!1,null===(t=this.eventEmitter)||void 0===t||t.removeAllListeners()}},{key:"createModal",value:function(){var e=this;this.gameContainer=document.createElement("div"),this.gameContainer.id="deep-strike-game",this.gameContainer.className="deep-strike-modal";var t=document.createElement("button");t.className="deep-strike-close-button",t.innerHTML="×",t.setAttribute("aria-label","Close game"),t.addEventListener("click",(function(){return e.disable()})),this.gameContainer.appendChild(t),this.mountElement=document.createElement("div"),this.mountElement.className="deep-strike-mount",this.gameContainer.appendChild(this.mountElement),document.body.appendChild(this.gameContainer),this.loadScript()}},{key:"loadScript",value:function(){var e=this;if(document.querySelector('script[src="'.concat(Os,'"]')))this.runGame();else{var t=document.createElement("script");t.src=Os,t.async=!1,t.onload=function(){return e.runGame()},t.onerror=function(){console.error("Failed to load Deep Strike game script:",Os),e.disable()},document.head.appendChild(t)}}},{key:"runGame",value:function(){this.mountElement&&window.DeepStrike&&window.DeepStrike.init(this.mountElement,{assetsBase:"/images/easter-eggs/deep-strike"})}},{key:"setupKeyListeners",value:function(){var e=this;this.handleKeyPress=function(t){"Escape"===t.key&&(t.preventDefault(),e.disable())},window.addEventListener("keydown",this.handleKeyPress)}}]),t}(os),Hs=function(e){function t(){var e;return Z(this,t),J($(e=U(this,t)),"appFeatureId","stats"),J($(e),"toolbarButtonSelector",'[data-site-nav="stats"]'),J($(e),"stackNode",qi),J($(e),"modality",{exclusive:!0,requires:[],incompatible:[],mobileLayout:l.FULL_HEIGHT}),e}return K(t,e),Y(t,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}}]),t}(ue);Ut.setOptions({collapsed:!0,logger:console,enabled:!1}),null===(Fs=document.getElementById("js-disabled-alert"))||void 0===Fs||Fs.remove();var Bs=new ys;window.profile=Bs;var Vs=new es;window.accessibilityController=Vs;var Gs=new Dn;window.translatesController=Gs,window.translateService=Gs.translateService;var js=new ts;window.dialogController=js;var Ws=new xs({life:3e3});window.toastController=Ws;var zs,Zs=document.getElementById("root");Zs&&D(st(wn,{}),Zs),zs=setInterval((function(){var e;if(!window.domReady)return;clearInterval(zs);var t=new Cn;window.themeController=t;var i=new Mn("map");window.mapController=i;var n=new xa;window.mapUnitsController=n;var r=new is(i,Gs.translateService);window.offlineMapsController=r;var a=new An;window.featuresController=a;var s=new Tn;window.warDayController=s;var o=new Rs(i,Gs.translateService);window.coordsPickerController=o;var l=new La(i,o);window.reticleLayer=l,a.registerFeatures([new ut,new Cs,new kt,new Tt,new Ht,new zt,new _a,new Ea,new $a,new fs,new ks,new Kt,new ms,new ps,new ws(l),new Es,new Ts,new Hs]);var c=new as(i,a);window.polygonsLayer=c;var u=new Ct(i.getLeafletMap(),a,Gs.translateService);window.trenchesLayer=u;var d=new Ls(i.getLeafletMap());window.cityBoundsLayer=d,new As(i),new Ps(i),new vs(c,{fraction:7,zoomForUnit:14});var h=new mt;window.revisionsController=h;var p=new bs(i,h,c,a);window.searchController=p;var v=new gi(a);v.registerShortCuts([{definition:{withCtrlOrCmd:!0,withShift:!0,code:"keyD"},featureId:nt.features.RULER},{definition:{withCtrlOrCmd:!0,withShift:!0,code:"keyP"},featureId:nt.features.DRAW},{definition:{withCtrlOrCmd:!0,withShift:!0,code:"keyS"},featureId:nt.features.SETTINGS}
23,{definition:{withCtrlOrCmd:!0,code:"keyU"},featureId:nt.features.RADIATION},{definition:{withCtrlOrCmd:!0,code:"slash"},featureId:nt.features.SHORTCUTS},{definition:{withAlt:!0,code:"keyS"},featureId:nt.features.RETICLE},{definition:{withCtrl:!0,withShift:!0,code:"Digit1"},callback:function(){return i.setBaseLayer(nt.layers.DEFAULT)}},{definition:{withCtrl:!0,withShift:!0,code:"Digit2"},callback:function(){return i.setBaseLayer(nt.layers.TOPOGRAPHIC)}},{definition:{withCtrl:!0,withShift:!0,code:"Digit3"},callback:function(){return i.setBaseLayer(nt.layers.SATELLITE)}},{definition:{code:"Escape"},callback:function(){var e;null===(e=document.querySelector(".drawer-backdrop"))||void 0===e||e.classList.toggle("shown")}},{definition:{withCtrlOrCmd:!0},callback:function(){(new gn).add(Gs.translateService.translate("messages.shortcut-help",{ctrl:Lt.controlKey()}),"info"),v.unregisterShortcut({withCtrlOrCmd:!0})}}]);var f=new ss(c);window.easterEggs=f,f.registerGames([new us,new hs,new Ds,new Us]),"true"===new URLSearchParams(window.location.search).get("deep-strike")&&f.selectGame("deep-strike");var m=new Ms(i);window.extController=m;var g=document.querySelector(".sidebar");g&&D(st(en,{featuresController:a}),g);var y=document.querySelector(".drawer-backdrop");y&&D(st(rn,{}),y);null===(e=document.querySelector(".drawer .dismiss-btn"))||void 0===e||e.addEventListener("click",(function(e){var t;return e.stopPropagation(),null===(t=document.querySelector(".drawer-backdrop"))||void 0===t||t.classList.toggle("shown"),!1})),Array.from(document.querySelectorAll('[data-site-nav="drawer"]')).map((function(e){return e.addEventListener("click",(function(e){var t;return e.stopPropagation(),null===(t=document.querySelector(".drawer-backdrop"))||void 0===t||t.classList.toggle("shown"),!1}))}))}),100)}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.