@nyaruka/temba-components 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/{0887303b.js → 041a136a.js} +161 -309
- package/dist/index.js +161 -309
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/templates/components-body.html +1 -1
- package/dist/templates/components-head.html +1 -1
- package/out-tsc/src/button/Button.js +10 -0
- package/out-tsc/src/button/Button.js.map +1 -1
- package/out-tsc/src/completion/Completion.js +3 -0
- package/out-tsc/src/completion/Completion.js.map +1 -1
- package/out-tsc/src/completion/helpers.js +3 -0
- package/out-tsc/src/completion/helpers.js.map +1 -1
- package/out-tsc/src/contacts/ContactChat.js +8 -201
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/contacts/ContactHistory.js +5 -111
- package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
- package/out-tsc/src/contacts/ContactTickets.js +99 -17
- package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
- package/out-tsc/src/contacts/events.js +28 -46
- package/out-tsc/src/contacts/events.js.map +1 -1
- package/out-tsc/src/date/TembaDate.js +4 -1
- package/out-tsc/src/date/TembaDate.js.map +1 -1
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/list/TembaList.js +0 -1
- package/out-tsc/src/list/TembaList.js.map +1 -1
- package/out-tsc/src/options/Options.js +6 -2
- package/out-tsc/src/options/Options.js.map +1 -1
- package/out-tsc/src/store/StoreElement.js +8 -1
- package/out-tsc/src/store/StoreElement.js.map +1 -1
- package/out-tsc/src/utils/index.js +16 -6
- package/out-tsc/src/utils/index.js.map +1 -1
- package/out-tsc/src/vectoricon/index.js +1 -1
- package/out-tsc/src/vectoricon/index.js.map +1 -1
- package/out-tsc/test/temba-contact-chat.test.js +0 -105
- package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/contacts/badges.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
- package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
- package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
- package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
- package/screenshots/truth/contacts/contact-active-default.png +0 -0
- package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-blocked-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-stopped-hide-chatbox.png +0 -0
- package/screenshots/truth/contacts/history.png +0 -0
- package/src/button/Button.ts +10 -0
- package/src/completion/Completion.ts +3 -0
- package/src/completion/helpers.ts +4 -0
- package/src/contacts/ContactChat.ts +8 -214
- package/src/contacts/ContactHistory.ts +7 -129
- package/src/contacts/ContactTickets.ts +99 -19
- package/src/contacts/events.ts +28 -47
- package/src/date/TembaDate.ts +7 -1
- package/src/interfaces.ts +1 -1
- package/src/list/TembaList.ts +0 -2
- package/src/options/Options.ts +8 -2
- package/src/store/StoreElement.ts +7 -1
- package/src/utils/index.ts +14 -6
- package/src/vectoricon/index.ts +1 -1
- package/test/temba-contact-chat.test.ts +0 -141
- package/screenshots/truth/contacts/contact-active-ticket-closed-show-reopen-button.png +0 -0
- package/screenshots/truth/contacts/contact-active-ticket-open-show-chatbox.png +0 -0
- package/screenshots/truth/contacts/contact-archived-ticket-closed-hide-chatbox.png +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=f){var n;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,o=n._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=o,this[o]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,C=(t="")=>S.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),Z=(t,e)=>{const i=t.length-1,n=[];let o,s=2===e?"<svg>":"",r=$;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===$?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=o?o:$,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=$:(r=O,o=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===$?i+k:h>=0?(n.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(n.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,n]};class F{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,s=0;const r=t.length-1,a=this.parts,[l,h]=Z(t,e);if(this.el=F.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=q.nextNode())&&a.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(I.test(n.tagName)){const t=n.textContent.split(x),e=t.length-1;if(e>0){n.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],C()),q.nextNode(),a.push({type:2,index:++o});n.append(t[e],C())}}}else if(8===n.nodeType)if(n.data===w)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(x,t+1));)a.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function U(t,e,i=t,n){var o,s,r,a;if(e===N)return e;let l=void 0!==n?null===(o=i._$Co)||void 0===o?void 0:o[n]:i._$Cl;const h=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,n)),void 0!==n?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[n]=l:i._$Cl=l),void 0!==l&&(e=U(t,l._$AS(t,e.values),l,n)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=o;let s=q.nextNode(),r=0,a=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=n[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return o}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,n){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cm=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),E(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=F.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new V(o,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new F(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new j(this.O(C()),this.O(C()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,n,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let s=!1;if(void 0===o)t=U(this,t,e,0),s=!E(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const n=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=U(this,n[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!E(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[r+1]),this._$AH[r]=a}s&&!n&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=U(this,t,e,0))&&void 0!==i?i:R)===N)return;const n=this._$AH,o=t===R&&n!==R||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==R&&(n===R||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(F,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=s._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;s._$litPart$=r=new j(e.insertBefore(C(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2");class nt extends et{constructor(){super(...arguments),this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}fireEvent(t){return this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const ot=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function st(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):ot(t,e)}var rt,at;null===(rt=window.HTMLSlotElement)||void 0===rt||rt.prototype.assignedElements;class lt extends nt{constructor(){super(...arguments),this.hiddenInputs=[],this.name="",this.values=[],this.value="",this.inputRoot=this,this.disabled=!1}setValue(t){t?this.setValues([t]):this.setValues([]),this.value=t}setValues(t){this.values=t,this.requestUpdate("values")}addValue(t){this.values.push(t),this.requestUpdate("values")}removeValue(t){this.values=this.values.filter((e=>e!==t)),this.requestUpdate("values")}popValue(){this.values.pop(),this.requestUpdate("values")}clear(){this.values=[],this.requestUpdate("values")}serializeValue(t){return JSON.stringify(t)}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();for(const t of this.values){const e=this.getAttribute("name");if(e){const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",e),i.setAttribute("value",this.serializeValue(t)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)}}}updated(t){super.updated(t),t.has("values")&&this.updateInputs()}}t([st({type:String})],lt.prototype,"name",void 0),t([st({type:String,attribute:"help_text"})],lt.prototype,"helpText",void 0),t([st({type:Boolean,attribute:"help_always"})],lt.prototype,"helpAlways",void 0),t([st({type:Boolean,attribute:"widget_only"})],lt.prototype,"widgetOnly",void 0),t([st({type:Boolean,attribute:"hide_label"})],lt.prototype,"hideLabel",void 0),t([st({type:String})],lt.prototype,"label",void 0),t([st({type:Array})],lt.prototype,"errors",void 0),t([st({type:Array})],lt.prototype,"values",void 0),t([st({type:String})],lt.prototype,"value",void 0),t([st({attribute:!1})],lt.prototype,"inputRoot",void 0),t([st({type:Boolean})],lt.prototype,"disabled",void 0),function(t){t.analytics="bar-chart-01",t.account="user-01",t.active="play",t.add_note="file-02",t.airtime="bank-note-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.email="mail-01",t.error="alert-circle",t.event="zap",t.fields="user-edit",t.flow="flow",t.flow_interrupted="x-close",t.flow_ivr="phone-call-01",t.flow_message="message-square-02",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.group="users-01",t.group_smart="atom-01",t.help="help-circle",t.home="home-01",t.inbox="inbox-01",t.label="tag-01",t.language="globe-01",t.link="link-external-01",t.log="file-02",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.messages="message-square-02",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.featured="star-01",t.resthooks="share-07",t.restore="play",t.retry="refresh-cw-05",t.runs="rows-03",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.service="magic-wand-01",t.settings="settings-02",t.sort="chevron-selector-vertical",t.staff="hard-drive",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_unassigned="inbox-01",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.workspace="folder",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01"}(at||(at={}));class ht extends lt{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
1
|
+
function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=f){var n;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,o=n._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=o,this[o]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,C=(t="")=>S.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),Z=(t,e)=>{const i=t.length-1,n=[];let o,s=2===e?"<svg>":"",r=$;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===$?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=o?o:$,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=$:(r=O,o=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===$?i+k:h>=0?(n.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(n.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,n]};class F{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,s=0;const r=t.length-1,a=this.parts,[l,h]=Z(t,e);if(this.el=F.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=q.nextNode())&&a.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(I.test(n.tagName)){const t=n.textContent.split(x),e=t.length-1;if(e>0){n.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],C()),q.nextNode(),a.push({type:2,index:++o});n.append(t[e],C())}}}else if(8===n.nodeType)if(n.data===w)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(x,t+1));)a.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function U(t,e,i=t,n){var o,s,r,a;if(e===N)return e;let l=void 0!==n?null===(o=i._$Co)||void 0===o?void 0:o[n]:i._$Cl;const h=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,n)),void 0!==n?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[n]=l:i._$Cl=l),void 0!==l&&(e=U(t,l._$AS(t,e.values),l,n)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=o;let s=q.nextNode(),r=0,a=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=n[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return o}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,n){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cm=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),E(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&E(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=F.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new V(o,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new F(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new j(this.O(C()),this.O(C()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,n,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let s=!1;if(void 0===o)t=U(this,t,e,0),s=!E(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const n=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=U(this,n[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!E(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[r+1]),this._$AH[r]=a}s&&!n&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=U(this,t,e,0))&&void 0!==i?i:R)===N)return;const n=this._$AH,o=t===R&&n!==R||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==R&&(n===R||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(F,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=s._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;s._$litPart$=r=new j(e.insertBefore(C(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2");class nt extends et{constructor(){super(...arguments),this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}fireEvent(t){return this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const ot=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function st(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):ot(t,e)}var rt,at;null===(rt=window.HTMLSlotElement)||void 0===rt||rt.prototype.assignedElements;class lt extends nt{constructor(){super(...arguments),this.hiddenInputs=[],this.name="",this.values=[],this.value="",this.inputRoot=this,this.disabled=!1}setValue(t){t?this.setValues([t]):this.setValues([]),this.value=t}setValues(t){this.values=t,this.requestUpdate("values")}addValue(t){this.values.push(t),this.requestUpdate("values")}removeValue(t){this.values=this.values.filter((e=>e!==t)),this.requestUpdate("values")}popValue(){this.values.pop(),this.requestUpdate("values")}clear(){this.values=[],this.requestUpdate("values")}serializeValue(t){return JSON.stringify(t)}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();for(const t of this.values){const e=this.getAttribute("name");if(e){const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",e),i.setAttribute("value",this.serializeValue(t)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)}}}updated(t){super.updated(t),t.has("values")&&this.updateInputs()}}t([st({type:String})],lt.prototype,"name",void 0),t([st({type:String,attribute:"help_text"})],lt.prototype,"helpText",void 0),t([st({type:Boolean,attribute:"help_always"})],lt.prototype,"helpAlways",void 0),t([st({type:Boolean,attribute:"widget_only"})],lt.prototype,"widgetOnly",void 0),t([st({type:Boolean,attribute:"hide_label"})],lt.prototype,"hideLabel",void 0),t([st({type:String})],lt.prototype,"label",void 0),t([st({type:Array})],lt.prototype,"errors",void 0),t([st({type:Array})],lt.prototype,"values",void 0),t([st({type:String})],lt.prototype,"value",void 0),t([st({attribute:!1})],lt.prototype,"inputRoot",void 0),t([st({type:Boolean})],lt.prototype,"disabled",void 0),function(t){t.analytics="bar-chart-01",t.account="user-01",t.active="play",t.add_note="file-02",t.airtime="bank-note-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.email="mail-01",t.error="alert-circle",t.event="zap",t.fields="user-edit",t.flow="flow",t.flow_interrupted="x-close",t.flow_ivr="phone-call-01",t.flow_message="message-square-02",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.group="users-01",t.group_smart="atom-01",t.help="help-circle",t.home="settings-02",t.inbox="inbox-01",t.label="tag-01",t.language="globe-01",t.link="link-external-01",t.log="file-02",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.messages="message-square-02",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.featured="star-01",t.resthooks="share-07",t.restore="play",t.retry="refresh-cw-05",t.runs="rows-03",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.service="magic-wand-01",t.settings="settings-02",t.sort="chevron-selector-vertical",t.staff="hard-drive",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_unassigned="inbox-01",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.workspace="folder",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01"}(at||(at={}));class ht extends lt{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
2
2
|
:host {
|
|
3
3
|
color: var(--color-text);
|
|
4
4
|
display: inline-block;
|
|
@@ -477,7 +477,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
477
477
|
name=${this.buttonName}
|
|
478
478
|
@click=${this.handleSendClick}
|
|
479
479
|
?disabled=${this.buttonDisabled}
|
|
480
|
-
></temba-button>`}}t([st({type:Boolean})],wt.prototype,"chatbox",void 0),t([st({type:Boolean})],wt.prototype,"attachments",void 0),t([st({type:Boolean})],wt.prototype,"counter",void 0),t([st({type:Boolean})],wt.prototype,"pendingDrop",void 0),t([st({type:Boolean})],wt.prototype,"button",void 0),t([st({type:String})],wt.prototype,"currentText",void 0),t([st({type:String})],wt.prototype,"accept",void 0),t([st({type:String,attribute:!1})],wt.prototype,"endpoint",void 0),t([st({type:Boolean,attribute:!1})],wt.prototype,"uploading",void 0),t([st({type:Array})],wt.prototype,"currentAttachments",void 0),t([st({type:Array,attribute:!1})],wt.prototype,"failedAttachments",void 0),t([st({type:String})],wt.prototype,"buttonName",void 0),t([st({type:Boolean,attribute:!1})],wt.prototype,"buttonDisabled",void 0),t([st({type:String,attribute:!1})],wt.prototype,"buttonError",void 0),t([st({type:Boolean,attribute:"widget_only"})],wt.prototype,"widgetOnly",void 0),t([st({type:Array})],wt.prototype,"errors",void 0),t([st({type:String})],wt.prototype,"value",void 0);var kt,St,Ct,Et,Tt,$t,At,Lt,Mt,Ot,zt,Pt,It,Dt,Nt,Rt,Bt,qt,Zt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},Ft=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ut=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let n=0;n<t.length;n++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(n);return e},Vt="0123456789abcdef".split(""),jt=[-2147483648,8388608,32768,128],Ht=[24,16,8,0],Wt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Gt=[];class Kt{constructor(t=!1,e=!1){kt.set(this,void 0),St.set(this,void 0),Ct.set(this,void 0),Et.set(this,void 0),Tt.set(this,void 0),$t.set(this,void 0),At.set(this,void 0),Lt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),zt.set(this,void 0),Pt.set(this,void 0),It.set(this,void 0),Dt.set(this,void 0),Nt.set(this,void 0),Rt.set(this,void 0),Bt.set(this,0),qt.set(this,void 0),this.init(t,e)}init(t,e){e?(Gt[0]=Gt[16]=Gt[1]=Gt[2]=Gt[3]=Gt[4]=Gt[5]=Gt[6]=Gt[7]=Gt[8]=Gt[9]=Gt[10]=Gt[11]=Gt[12]=Gt[13]=Gt[14]=Gt[15]=0,Zt(this,St,Gt)):Zt(this,St,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Zt(this,$t,3238371032),Zt(this,At,914150663),Zt(this,Lt,812702999),Zt(this,Mt,4144912697),Zt(this,Ot,4290775857),Zt(this,zt,1750603025),Zt(this,Pt,1694076839),Zt(this,It,3204075428)):(Zt(this,$t,1779033703),Zt(this,At,3144134277),Zt(this,Lt,1013904242),Zt(this,Mt,2773480762),Zt(this,Ot,1359893119),Zt(this,zt,2600822924),Zt(this,Pt,528734635),Zt(this,It,1541459225)),Zt(this,kt,Zt(this,qt,Zt(this,Ct,Zt(this,Nt,0)))),Zt(this,Et,Zt(this,Dt,!1)),Zt(this,Tt,!0),Zt(this,Rt,t)}update(t){if(Ft(this,Et))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const n=e.length,o=Ft(this,St);for(;i<n;){let t;if(Ft(this,Dt)&&(Zt(this,Dt,!1),o[0]=Ft(this,kt),o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),"string"!=typeof e)for(t=Ft(this,qt);i<n&&t<64;++i)o[t>>2]|=e[i]<<Ht[3&t++];else for(t=Ft(this,qt);i<n&&t<64;++i){let n=e.charCodeAt(i);n<128?o[t>>2]|=n<<Ht[3&t++]:n<2048?(o[t>>2]|=(192|n>>6)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++]):n<55296||n>=57344?(o[t>>2]|=(224|n>>12)<<Ht[3&t++],o[t>>2]|=(128|n>>6&63)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[t>>2]|=(240|n>>18)<<Ht[3&t++],o[t>>2]|=(128|n>>12&63)<<Ht[3&t++],o[t>>2]|=(128|n>>6&63)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++])}Zt(this,Bt,t),Zt(this,Ct,Ft(this,Ct)+(t-Ft(this,qt))),t>=64?(Zt(this,kt,o[16]),Zt(this,qt,t-64),this.hash(),Zt(this,Dt,!0)):Zt(this,qt,t)}return Ft(this,Ct)>4294967295&&(Zt(this,Nt,Ft(this,Nt)+(Ft(this,Ct)/4294967296<<0)),Zt(this,Ct,Ft(this,Ct)%4294967296)),this}finalize(){if(Ft(this,Et))return;Zt(this,Et,!0);const t=Ft(this,St),e=Ft(this,Bt);t[16]=Ft(this,kt),t[e>>2]|=jt[3&e],Zt(this,kt,t[16]),e>=56&&(Ft(this,Dt)||this.hash(),t[0]=Ft(this,kt),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=Ft(this,Nt)<<3|Ft(this,Ct)>>>29,t[15]=Ft(this,Ct)<<3,this.hash()}hash(){let t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It);const l=Ft(this,St);let h,c,d,u,p,m,f,g,v,y;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c<<0;y=e&i;for(let b=0;b<64;b+=4)Ft(this,Tt)?(Ft(this,Rt)?(f=300032,u=l[0]-1413257819,a=u-150054599<<0,n=u+24177077<<0):(f=704751109,u=l[0]-210244248,a=u-1521486534<<0,n=u+143694565<<0),Zt(this,Tt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),f=t&e,d=f^t&i^y,m=o&s^~o&r,u=a+c+m+Wt[b]+l[b],p=h+d,a=n+u<<0,n=u+p<<0),h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),g=n&t,d=g^n&e^f,m=a&o^~a&s,u=r+c+m+Wt[b+1]+l[b+1],p=h+d,r=i+u<<0,i=u+p<<0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&n,d=v^i&t^g,m=r&a^~r&o,u=s+c+m+Wt[b+2]+l[b+2],p=h+d,s=e+u<<0,e=u+p<<0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=e&i,d=y^e&n^v,m=s&r^~s&a,u=o+c+m+Wt[b+3]+l[b+3],p=h+d,o=t+u<<0,t=u+p<<0;Zt(this,$t,Ft(this,$t)+t<<0),Zt(this,At,Ft(this,At)+e<<0),Zt(this,Lt,Ft(this,Lt)+i<<0),Zt(this,Mt,Ft(this,Mt)+n<<0),Zt(this,Ot,Ft(this,Ot)+o<<0),Zt(this,zt,Ft(this,zt)+s<<0),Zt(this,Pt,Ft(this,Pt)+r<<0),Zt(this,It,Ft(this,It)+a<<0)}hex(){this.finalize();const t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It);let l=Vt[t>>28&15]+Vt[t>>24&15]+Vt[t>>20&15]+Vt[t>>16&15]+Vt[t>>12&15]+Vt[t>>8&15]+Vt[t>>4&15]+Vt[15&t]+Vt[e>>28&15]+Vt[e>>24&15]+Vt[e>>20&15]+Vt[e>>16&15]+Vt[e>>12&15]+Vt[e>>8&15]+Vt[e>>4&15]+Vt[15&e]+Vt[i>>28&15]+Vt[i>>24&15]+Vt[i>>20&15]+Vt[i>>16&15]+Vt[i>>12&15]+Vt[i>>8&15]+Vt[i>>4&15]+Vt[15&i]+Vt[n>>28&15]+Vt[n>>24&15]+Vt[n>>20&15]+Vt[n>>16&15]+Vt[n>>12&15]+Vt[n>>8&15]+Vt[n>>4&15]+Vt[15&n]+Vt[o>>28&15]+Vt[o>>24&15]+Vt[o>>20&15]+Vt[o>>16&15]+Vt[o>>12&15]+Vt[o>>8&15]+Vt[o>>4&15]+Vt[15&o]+Vt[s>>28&15]+Vt[s>>24&15]+Vt[s>>20&15]+Vt[s>>16&15]+Vt[s>>12&15]+Vt[s>>8&15]+Vt[s>>4&15]+Vt[15&s]+Vt[r>>28&15]+Vt[r>>24&15]+Vt[r>>20&15]+Vt[r>>16&15]+Vt[r>>12&15]+Vt[r>>8&15]+Vt[r>>4&15]+Vt[15&r];return Ft(this,Rt)||(l+=Vt[a>>28&15]+Vt[a>>24&15]+Vt[a>>20&15]+Vt[a>>16&15]+Vt[a>>12&15]+Vt[a>>8&15]+Vt[a>>4&15]+Vt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Ft(this,Rt)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer(Ft(this,Rt)?28:32),e=new DataView(t);return e.setUint32(0,Ft(this,$t)),e.setUint32(4,Ft(this,At)),e.setUint32(8,Ft(this,Lt)),e.setUint32(12,Ft(this,Mt)),e.setUint32(16,Ft(this,Ot)),e.setUint32(20,Ft(this,zt)),e.setUint32(24,Ft(this,Pt)),Ft(this,Rt)||e.setUint32(28,Ft(this,It)),t}}function Yt(t){const e=new Kt;return e.update(t),parseInt(e.hex().substring(0,8),16)}kt=new WeakMap,St=new WeakMap,Ct=new WeakMap,Et=new WeakMap,Tt=new WeakMap,$t=new WeakMap,At=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Pt=new WeakMap,It=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,qt=new WeakMap;const Jt=function(t,e,i){var n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?o+6*(n-o)*t:t<.5?n:t<2/3?o+6*(n-o)*(2/3-t):o,Math.round(255*t)}))};const Xt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Yt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ut)}hsl(t){var e,i,n=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[n%this.hueRanges.length];e=n/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=n%359;return n=Math.ceil(n/360),i=this.S[n%this.S.length],n=Math.ceil(n/this.S.length),[e,i,this.L[n%this.L.length]]}rgb(t){var e=this.hsl(t);return Jt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}},Qt=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,te=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},ee=(t,e=null,i={})=>new Promise(((n,o)=>{const s={method:"GET",headers:te(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),ie=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},ne=(t,e=null)=>new Promise(((i,n)=>{ee(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),oe=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ne(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},se=t=>new Promise(((e,i)=>{ee(t).then((t=>{e({assets:t.json.results,next:t.json.next})})).catch((t=>i(t)))})),re=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await se(i);e=e.concat(t.assets),i=t.next}return e},ae=(t,e,i={},n=null)=>{const o=te(i);n&&(o["Content-Type"]=n);const s={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},le=(t,e)=>ae(t,JSON.stringify(e),!1,"application/json"),he=(t,e)=>new Promise(((i,n)=>{ae(t,e,!0).then((e=>{e.status>=200&&e.status<300?i(e):n(t===xt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),ce=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:ce(e):null}return null},de=3600,ue=86400,pe=30*ue;const me=new class{getCurrentDate(){return new Date}},fe=(t,e={suffix:""})=>{const{compareDate:i,hideRecentText:n,suffix:o}=e,s=i||me.getCurrentDate(),r=Math.floor((s.getTime()-t.getTime())/1e3);if(r<60)return i?r+"s"+o:!n&&o?o:"just now";if(r<de)return Math.round(r/60)+"m"+o;if(r<=ue)return Math.round(r/de)+"h"+o;if(r<=pe)return Math.round(r/ue)+"d"+o;if(r<6*pe)return Math.round(r/pe)+"mth"+o;return t.getDate()+" "+t.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ","")+(t.getFullYear()==s.getFullYear()?"":" "+t.getFullYear())},ge=(t,e,i=!1)=>{let n;return function(...o){const s=this,r=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(s,o)}),e),r&&t.apply(s,o)}},ve=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},ye=(t,e)=>t.length>e?t.substring(0,e)+"...":t,be=(t,e="and")=>1===t.length?t[0]:2===t.length?"html"===t[0].type?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"html"===t[0].type?t.map(((i,n)=>n<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],_e=(t,e,i="and")=>be(t.map(e),i),xe=t=>"true"===((t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e})(t)||"");var we;!function(t){t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(we||(we={}));const ke=t=>t.split("/")[1],Se=(t,e)=>{if(0==t)return"0 KB";const i=e||2,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(i))+" "+["B","KB","MB","GB"][n]},Ce=t=>{if(t.position||(t.position="right"),t.image)return D`<img src="${t.image}">`;let e=t.name;if(t.user&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;const i=Xt.hex(e);let n=e.indexOf(" ")+1;n<1&&(n=e.length>1?1:0);let o=e.substring(0,1)+e.substring(n,n+1);return o=o.toUpperCase(),D` <temba-tip text="${e}" position="${t.position}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center"> <div class="avatar-circle" style="display:flex;height:2em;width:2em;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;border:.3em solid rgba(0,0,0,.05);background:${i}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${o}</div> </div> </div> </div> </temba-tip> `};class Ee{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function Te(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new Ee(t,e)}class $e extends Error{}class Ae extends $e{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Le extends $e{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Me extends $e{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Oe extends $e{}class ze extends $e{constructor(t){super(`Invalid unit ${t}`)}}class Pe extends $e{}class Ie extends $e{constructor(){super("Zone is an abstract class")}}const De="numeric",Ne="short",Re="long",Be={year:De,month:De,day:De},qe={year:De,month:Ne,day:De},Ze={year:De,month:Ne,day:De,weekday:Ne},Fe={year:De,month:Re,day:De},Ue={year:De,month:Re,day:De,weekday:Re},Ve={hour:De,minute:De},je={hour:De,minute:De,second:De},He={hour:De,minute:De,second:De,timeZoneName:Ne},We={hour:De,minute:De,second:De,timeZoneName:Re},Ge={hour:De,minute:De,hourCycle:"h23"},Ke={hour:De,minute:De,second:De,hourCycle:"h23"},Ye={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Ne},Je={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Re},Xe={year:De,month:De,day:De,hour:De,minute:De},Qe={year:De,month:De,day:De,hour:De,minute:De,second:De},ti={year:De,month:Ne,day:De,hour:De,minute:De},ei={year:De,month:Ne,day:De,hour:De,minute:De,second:De},ii={year:De,month:Ne,day:De,weekday:Ne,hour:De,minute:De},ni={year:De,month:Re,day:De,hour:De,minute:De,timeZoneName:Ne},oi={year:De,month:Re,day:De,hour:De,minute:De,second:De,timeZoneName:Ne},si={year:De,month:Re,day:De,weekday:Re,hour:De,minute:De,timeZoneName:Re},ri={year:De,month:Re,day:De,weekday:Re,hour:De,minute:De,second:De,timeZoneName:Re};function ai(t){return void 0===t}function li(t){return"number"==typeof t}function hi(t){return"number"==typeof t&&t%1==0}function ci(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function di(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function ui(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pi(t,e,i){return hi(t)&&t>=e&&t<=i}function mi(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function fi(t){return ai(t)||null===t||""===t?void 0:parseInt(t,10)}function gi(t){return ai(t)||null===t||""===t?void 0:parseFloat(t)}function vi(t){if(!ai(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function yi(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function bi(t){return t%4==0&&(t%100!=0||t%400==0)}function _i(t){return bi(t)?366:365}function xi(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?bi(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function wi(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ki(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function Si(t){return t>99?t:t>60?1900+t:2e3+t}function Ci(t,e,i,n=null){const o=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Ei(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function Ti(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Pe(`Invalid unit value ${t}`);return e}function $i(t,e){const i={};for(const n in t)if(ui(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=Ti(o)}return i}function Ai(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${mi(i,2)}:${mi(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${mi(i,2)}${mi(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Li(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Mi=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Oi=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Pi=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ii(t){switch(t){case"narrow":return[...Pi];case"short":return[...zi];case"long":return[...Oi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Di=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ni=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ri=["M","T","W","T","F","S","S"];function Bi(t){switch(t){case"narrow":return[...Ri];case"short":return[...Ni];case"long":return[...Di];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qi=["AM","PM"],Zi=["Before Christ","Anno Domini"],Fi=["BC","AD"],Ui=["B","A"];function Vi(t){switch(t){case"narrow":return[...Ui];case"short":return[...Fi];case"long":return[...Zi];default:return null}}function ji(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const Hi={D:Be,DD:qe,DDD:Fe,DDDD:Ue,t:Ve,tt:je,ttt:He,tttt:We,T:Ge,TT:Ke,TTT:Ye,TTTT:Je,f:Xe,ff:ti,fff:ni,ffff:si,F:Qe,FF:ei,FFF:oi,FFFF:ri};class Wi{static create(t,e={}){return new Wi(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&o.push({literal:!1,val:i}),i=r,e=r)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return Hi[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return mi(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),s=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return qi[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return Ii(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Bi(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=Wi.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Vi(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return ji(Wi.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Wi.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...o.map(i).filter((t=>t)));return ji(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(s))}}class Gi{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ki{get type(){throw new Ie}get name(){throw new Ie}get ianaName(){return this.name}get isUniversal(){throw new Ie}offsetName(t,e){throw new Ie}formatOffset(t,e){throw new Ie}offset(t){throw new Ie}equals(t){throw new Ie}get isValid(){throw new Ie}}let Yi=null;class Ji extends Ki{static get instance(){return null===Yi&&(Yi=new Ji),Yi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Ci(t,e,i)}formatOffset(t,e){return Ai(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let Xi={};const Qi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let tn={};class en extends Ki{static create(t){return tn[t]||(tn[t]=new en(t)),tn[t]}static resetCache(){tn={},Xi={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=en.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Ci(t,e,i,this.name)}formatOffset(t,e){return Ai(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,Xi[n]||(Xi[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Xi[n]);var n;let[o,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],s=Qi[e];"era"===e?n[s]=o:ai(s)||(n[s]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,s,r,a,l,h,c]=n;return[r,o,s,a,l,h,c]}(i,e);"BC"===a&&(o=1-Math.abs(o));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,(wi({year:o,month:s,day:r,hour:24===l?0:l,minute:h,second:c,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let nn=null;class on extends Ki{static get utcInstance(){return null===nn&&(nn=new on(0)),nn}static instance(t){return 0===t?on.utcInstance:new on(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new on(Ei(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Ai(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${Ai(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Ai(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class sn extends Ki{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function rn(t,e){if(ai(t)||null===t)return e;if(t instanceof Ki)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?on.utcInstance:on.parseSpecifier(i)||en.create(t)}return li(t)?on.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new sn(t)}let an,ln=()=>Date.now(),hn="system",cn=null,dn=null,un=null;class pn{static get now(){return ln}static set now(t){ln=t}static set defaultZone(t){hn=t}static get defaultZone(){return rn(hn,Ji.instance)}static get defaultLocale(){return cn}static set defaultLocale(t){cn=t}static get defaultNumberingSystem(){return dn}static set defaultNumberingSystem(t){dn=t}static get defaultOutputCalendar(){return un}static set defaultOutputCalendar(t){un=t}static get throwOnInvalid(){return an}static set throwOnInvalid(t){an=t}static resetCaches(){Sn.resetCache(),en.resetCache()}}let mn={};let fn={};function gn(t,e={}){const i=JSON.stringify([t,e]);let n=fn[i];return n||(n=new Intl.DateTimeFormat(t,e),fn[i]=n),n}let vn={};let yn={};let bn=null;function _n(t,e,i,n,o){const s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):o(e)}class xn{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...s}=i;if(!e||Object.keys(s).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=vn[i];return n||(n=new Intl.NumberFormat(t,e),vn[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return mi(this.floor?Math.floor(t):yi(t,3),this.padTo)}}class wn{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&en.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:Ss.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=gn(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class kn{constructor(t,e,i){this.opts={style:"long",...i},!e&&ci()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let s=yn[o];return s||(s=new Intl.RelativeTimeFormat(t,e),yn[o]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=o[t],c=n?l?h[1]:h[2]||h[1]:l?o[t][0]:t;return r?`${a} ${c} ago`:`in ${a} ${c}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class Sn{static fromOpts(t){return Sn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||pn.defaultLocale,s=o||(n?"en-US":bn||(bn=(new Intl.DateTimeFormat).resolvedOptions().locale,bn)),r=e||pn.defaultNumberingSystem,a=i||pn.defaultOutputCalendar;return new Sn(s,r,a,o)}static resetCache(){bn=null,fn={},vn={},yn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return Sn.create(t,e,i)}constructor(t,e,i,n){const[o,s,r]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=gn(t).resolvedOptions()}catch(t){i=gn(n).resolvedOptions()}const{numberingSystem:o,calendar:s}=i;return[n,o,s]}}(t);this.locale=o,this.numberingSystem=e||s||null,this.outputCalendar=i||r||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?Sn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return _n(this,t,i,Ii,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=Ss.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return _n(this,t,i,Bi,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=Ss.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return _n(this,void 0,t,(()=>qi),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ss.utc(2016,11,13,9),Ss.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return _n(this,t,e,Vi,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ss.utc(-40,1,1),Ss.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new xn(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new wn(t,this.intl,e)}relFormatter(t={}){return new kn(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=mn[i];return n||(n=new Intl.ListFormat(t,e),mn[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Cn(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function En(...t){return e=>t.reduce((([t,i,n],o)=>{const[s,r,a]=o(e,n);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function Tn(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function $n(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=fi(e[i+o]);return[n,null,i+o]}}const An=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ln=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Mn=RegExp(`${Ln.source}${`(?:${An.source}?(?:\\[(${Mi.source})\\])?)?`}`),On=RegExp(`(?:T${Mn.source})?`),zn=$n("weekYear","weekNumber","weekDay"),Pn=$n("year","ordinal"),In=RegExp(`${Ln.source} ?(?:${An.source}|(${Mi.source}))?`),Dn=RegExp(`(?: ${In.source})?`);function Nn(t,e,i){const n=t[e];return ai(n)?i:fi(n)}function Rn(t,e){return[{hours:Nn(t,e,0),minutes:Nn(t,e+1,0),seconds:Nn(t,e+2,0),milliseconds:vi(t[e+3])},null,e+4]}function Bn(t,e){const i=!t[e]&&!t[e+1],n=Ei(t[e+1],t[e+2]);return[{},i?null:on.instance(n),e+3]}function qn(t,e){return[{},t[e]?en.create(t[e]):null,e+1]}const Zn=RegExp(`^T?${Ln.source}$`),Fn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Un(t){const[e,i,n,o,s,r,a,l,h]=t,c="-"===e[0],d=l&&"-"===l[0],u=(t,e=!1)=>void 0!==t&&(e||t&&c)?-t:t;return[{years:u(gi(i)),months:u(gi(n)),weeks:u(gi(o)),days:u(gi(s)),hours:u(gi(r)),minutes:u(gi(a)),seconds:u(gi(l),"-0"===l),milliseconds:u(vi(h),d)}]}const Vn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function jn(t,e,i,n,o,s,r){const a={year:2===e.length?Si(fi(e)):fi(e),month:zi.indexOf(i)+1,day:fi(n),hour:fi(o),minute:fi(s)};return r&&(a.second=fi(r)),t&&(a.weekday=t.length>3?Di.indexOf(t)+1:Ni.indexOf(t)+1),a}const Hn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Wn(t){const[,e,i,n,o,s,r,a,l,h,c,d]=t,u=jn(e,o,n,i,s,r,a);let p;return p=l?Vn[l]:h?0:Ei(c,d),[u,new on(p)]}const Gn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Kn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Jn(t){const[,e,i,n,o,s,r,a]=t;return[jn(e,o,n,i,s,r,a),on.utcInstance]}function Xn(t){const[,e,i,n,o,s,r,a]=t;return[jn(e,a,i,n,o,s,r),on.utcInstance]}const Qn=Cn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,On),to=Cn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,On),eo=Cn(/(\d{4})-?(\d{3})/,On),io=Cn(Mn),no=En((function(t,e){return[{year:Nn(t,e),month:Nn(t,e+1,1),day:Nn(t,e+2,1)},null,e+3]}),Rn,Bn,qn),oo=En(zn,Rn,Bn,qn),so=En(Pn,Rn,Bn,qn),ro=En(Rn,Bn,qn);const ao=En(Rn);const lo=Cn(/(\d{4})-(\d\d)-(\d\d)/,Dn),ho=Cn(In),co=En(Rn,Bn,qn);const uo={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},po={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...uo},mo=365.2425,fo=30.436875,go={years:{quarters:4,months:12,weeks:52.1775,days:mo,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:fo,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...uo},vo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],yo=vo.slice(0).reverse();function bo(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new xo(n)}function _o(t,e,i,n,o){const s=t[o][i],r=e[i]/s,a=!(Math.sign(r)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(r)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(r):Math.trunc(r);n[o]+=a,e[i]-=a*s}class xo{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||Sn.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?go:po,this.isLuxonDuration=!0}static fromMillis(t,e){return xo.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Pe("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new xo({values:$i(t,xo.normalizeUnit),loc:Sn.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(li(t))return xo.fromMillis(t);if(xo.isDuration(t))return t;if("object"==typeof t)return xo.fromObject(t);throw new Pe(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return Tn(t,[Fn,Un])}(t);return i?xo.fromObject(i,e):xo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return Tn(t,[Zn,ao])}(t);return i?xo.fromObject(i,e):xo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the Duration is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Me(i);return new xo({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new ze(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?Wi.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=vo.map((e=>{const i=this.values[e];return ai(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=yi(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=xo.fromDurationLike(t),i={};for(const t of vo)(ui(e.values,t)||ui(this.values,t))&&(i[t]=e.get(t)+this.get(t));return bo(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=xo.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=Ti(t(this.values[i],i));return bo(this,{values:e},!0)}get(t){return this[xo.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return bo(this,{values:{...this.values,...$i(t,xo.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),bo(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){yo.reduce(((i,n)=>ai(e[n])?i:(i&&_o(t,e,i,e,n),n)),null)}(this.matrix,t),bo(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>xo.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const s of vo)if(t.indexOf(s)>=0){o=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;li(n[s])&&(t+=n[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3;for(const t in n)vo.indexOf(t)>vo.indexOf(s)&&_o(this.matrix,n,t,e,s)}else li(n[s])&&(i[s]=n[s]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return bo(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return bo(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of vo)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const wo="Invalid Interval";class ko{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the Interval is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Le(i);return new ko({invalid:i})}static fromDateTimes(t,e){const i=Cs(t),n=Cs(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?ko.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:ko.invalid("missing or invalid end"):ko.invalid("missing or invalid start")}(i,n);return null==o?new ko({start:i,end:n}):o}static after(t,e){const i=xo.fromDurationLike(e),n=Cs(t);return ko.fromDateTimes(n,n.plus(i))}static before(t,e){const i=xo.fromDurationLike(e),n=Cs(t);return ko.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,s,r;try{t=Ss.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{s=Ss.fromISO(n,e),r=s.isValid}catch(n){r=!1}if(o&&r)return ko.fromDateTimes(t,s);if(o){const i=xo.fromISO(n,e);if(i.isValid)return ko.after(t,i)}else if(r){const t=xo.fromISO(i,e);if(t.isValid)return ko.before(s,t)}}return ko.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?ko.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Cs).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,s=+t>+this.e?this.e:t;i.push(ko.fromDateTimes(n,s)),n=s,o+=1}return i}splitBy(t){const e=xo.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const s=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,s.push(ko.fromDateTimes(n,i)),n=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:ko.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return ko.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of s)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(ko.fromDateTimes(e,t.time)),e=null);return ko.merge(n)}difference(...t){return ko.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:wo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:wo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:wo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:wo}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:wo}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):xo.invalid(this.invalidReason)}mapEndpoints(t){return ko.fromDateTimes(t(this.s),t(this.e))}}class So{static hasDST(t=pn.defaultZone){const e=Ss.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return en.isValidZone(t)}static normalizeZone(t){return rn(t,pn.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||Sn.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||Sn.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Sn.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Sn.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Sn.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return Sn.create(e,null,"gregory").eras(t)}static features(){return{relative:ci()}}}function Co(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(xo.fromMillis(n).as("days"))}function Eo(t,e,i,n){let[o,s,r,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=Co(t,e);return(i-i%7)/7}],["days",Co]],o={};let s,r;for(const[a,l]of n)if(i.indexOf(a)>=0){s=a;let i=l(t,e);r=t.plus({[a]:i}),r>e?(t=t.plus({[a]:i-1}),i-=1):t=r,o[a]=i}return[t,o,r,s]}(t,e,i);const l=e-o,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=o.plus({[a]:1})),r!==o&&(s[a]=(s[a]||0)+l/(r-o)));const c=xo.fromObject(s,n);return h.length>0?xo.fromMillis(l,n).shiftTo(...h).plus(c):c}const To={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$o={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ao=To.hanidec.replace(/[\[|\]]/g,"").split("");function Lo({numberingSystem:t},e=""){return new RegExp(`${To[t||"latn"]}${e}`)}function Mo(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search(To.hanidec))e+=Ao.indexOf(t[i]);else for(const t in $o){const[i,o]=$o[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const Oo=`[ ${String.fromCharCode(160)}]`,zo=new RegExp(Oo,"g");function Po(t){return t.replace(/\./g,"\\.?").replace(zo,Oo)}function Io(t){return t.replace(/\./g,"").replace(zo," ").toLowerCase()}function Do(t,e){return null===t?null:{regex:RegExp(t.map(Po).join("|")),deser:([i])=>t.findIndex((t=>Io(i)===Io(t)))+e}}function No(t,e){return{regex:t,deser:([,t,e])=>Ei(t,e),groups:e}}function Ro(t){return{regex:t,deser:([t])=>t}}const Bo={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let qo=null;function Zo(t,e){if(t.literal)return t;const i=Wi.macroTokenToFormatOpts(t.val);if(!i)return t;const n=Wi.create(e,i).formatDateTimeParts((qo||(qo=Ss.fromMillis(1555555555555)),qo)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const s=i[n];let r=Bo[n];return"object"==typeof r&&(r=r[s]),r?{literal:!1,val:r}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function Fo(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>Zo(t,e))))}(Wi.parseFormat(i),t),o=n.map((e=>function(t,e){const i=Lo(e),n=Lo(e,"{2}"),o=Lo(e,"{3}"),s=Lo(e,"{4}"),r=Lo(e,"{6}"),a=Lo(e,"{1,2}"),l=Lo(e,"{1,3}"),h=Lo(e,"{1,6}"),c=Lo(e,"{1,9}"),d=Lo(e,"{2,4}"),u=Lo(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return Do(e.eras("short",!1),0);case"GG":return Do(e.eras("long",!1),0);case"y":return Mo(h);case"yy":case"kk":return Mo(d,Si);case"yyyy":case"kkkk":return Mo(s);case"yyyyy":return Mo(u);case"yyyyyy":return Mo(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Mo(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Mo(n);case"MMM":return Do(e.months("short",!0,!1),1);case"MMMM":return Do(e.months("long",!0,!1),1);case"LLL":return Do(e.months("short",!1,!1),1);case"LLLL":return Do(e.months("long",!1,!1),1);case"o":case"S":return Mo(l);case"ooo":case"SSS":return Mo(o);case"u":return Ro(c);case"uu":return Ro(a);case"uuu":case"E":case"c":return Mo(i);case"a":return Do(e.meridiems(),0);case"EEE":return Do(e.weekdays("short",!1,!1),1);case"EEEE":return Do(e.weekdays("long",!1,!1),1);case"ccc":return Do(e.weekdays("short",!0,!1),1);case"cccc":return Do(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return No(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return No(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Ro(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),s=o.find((t=>t.invalidReason));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),s=RegExp(t,"i"),[r,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(ui(i,o)){const s=i[o],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(e,s,i),[l,h,c]=a?function(t){let e,i=null;ai(t.z)||(i=en.create(t.z)),ai(t.Z)||(i||(i=new on(t.Z)),e=t.Z),ai(t.q)||(t.M=3*(t.q-1)+1),ai(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),ai(t.u)||(t.S=vi(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(ui(a,"a")&&ui(a,"H"))throw new Oe("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:s,rawMatches:r,matches:a,result:l,zone:h,specificOffset:c}}}const Uo=[0,31,59,90,120,151,181,212,243,273,304,334],Vo=[0,31,60,91,121,152,182,213,244,274,305,335];function jo(t,e){return new Gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Ho(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function Wo(t,e,i){return i+(bi(t)?Vo:Uo)[e-1]}function Go(t,e){const i=bi(t)?Vo:Uo,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function Ko(t){const{year:e,month:i,day:n}=t,o=Wo(e,i,n),s=Ho(e,i,n);let r,a=Math.floor((o-s+10)/7);return a<1?(r=e-1,a=ki(r)):a>ki(e)?(r=e+1,a=1):r=e,{weekYear:r,weekNumber:a,weekday:s,...Li(t)}}function Yo(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=Ho(e,1,4),s=_i(e);let r,a=7*i+n-o-3;a<1?(r=e-1,a+=_i(r)):a>s?(r=e+1,a-=_i(e)):r=e;const{month:l,day:h}=Go(r,a);return{year:r,month:l,day:h,...Li(t)}}function Jo(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:Wo(e,i,n),...Li(t)}}function Xo(t){const{year:e,ordinal:i}=t,{month:n,day:o}=Go(e,i);return{year:e,month:n,day:o,...Li(t)}}function Qo(t){const e=hi(t.year),i=pi(t.month,1,12),n=pi(t.day,1,xi(t.year,t.month));return e?i?!n&&jo("day",t.day):jo("month",t.month):jo("year",t.year)}function ts(t){const{hour:e,minute:i,second:n,millisecond:o}=t,s=pi(e,0,23)||24===e&&0===i&&0===n&&0===o,r=pi(i,0,59),a=pi(n,0,59),l=pi(o,0,999);return s?r?a?!l&&jo("millisecond",o):jo("second",n):jo("minute",i):jo("hour",e)}const es="Invalid DateTime",is=864e13;function ns(t){return new Gi("unsupported zone",`the zone "${t.name}" is not supported`)}function os(t){return null===t.weekData&&(t.weekData=Ko(t.c)),t.weekData}function ss(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Ss({...i,...e,old:i})}function rs(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const s=i.offset(n);return o===s?[n,o]:[t-60*Math.min(o,s)*1e3,Math.max(o,s)]}function as(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function ls(t,e,i){return rs(wi(t),e,i)}function hs(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:n,month:o,day:Math.min(t.c.day,xi(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=xo.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=wi(s);let[l,h]=rs(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function cs(t,e,i,n,o,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=Ss.fromObject(t,{...i,zone:n,specificOffset:s});return r?o:o.setZone(a)}return Ss.invalid(new Gi("unparsable",`the input "${o}" can't be parsed as ${n}`))}function ds(t,e,i=!0){return t.isValid?Wi.create(Sn.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function us(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=mi(t.c.year,i?6:4),e?(n+="-",n+=mi(t.c.month),n+="-",n+=mi(t.c.day)):(n+=mi(t.c.month),n+=mi(t.c.day)),n}function ps(t,e,i,n,o,s){let r=mi(t.c.hour);return e?(r+=":",r+=mi(t.c.minute),0===t.c.second&&i||(r+=":")):r+=mi(t.c.minute),0===t.c.second&&i||(r+=mi(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=mi(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=mi(Math.trunc(-t.o/60)),r+=":",r+=mi(Math.trunc(-t.o%60))):(r+="+",r+=mi(Math.trunc(t.o/60)),r+=":",r+=mi(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const ms={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},fs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},gs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},vs=["year","month","day","hour","minute","second","millisecond"],ys=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bs=["year","ordinal","hour","minute","second","millisecond"];function _s(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new ze(t);return e}function xs(t,e){const i=rn(e.zone,pn.defaultZone),n=Sn.fromObject(e),o=pn.now();let s,r;if(ai(t.year))s=o;else{for(const e of vs)ai(t[e])&&(t[e]=ms[e]);const e=Qo(t)||ts(t);if(e)return Ss.invalid(e);const n=i.offset(o);[s,r]=ls(t,n,i)}return new Ss({ts:s,zone:i,loc:n,o:r})}function ws(t,e,i){const n=!!ai(i.round)||i.round,o=(t,o)=>{t=yi(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},s=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function ks(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class Ss{constructor(t){const e=t.zone||pn.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Gi("invalid input"):null)||(e.isValid?null:ns(e));this.ts=ai(t.ts)?pn.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=as(this.ts,t),i=Number.isNaN(n.year)?new Gi("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||Sn.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new Ss({})}static local(){const[t,e]=ks(arguments),[i,n,o,s,r,a,l]=e;return xs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=ks(arguments),[i,n,o,s,r,a,l]=e;return t.zone=on.utcInstance,xs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return Ss.invalid("invalid input");const n=rn(e.zone,pn.defaultZone);return n.isValid?new Ss({ts:i,zone:n,loc:Sn.fromObject(e)}):Ss.invalid(ns(n))}static fromMillis(t,e={}){if(li(t))return t<-is||t>is?Ss.invalid("Timestamp out of range"):new Ss({ts:t,zone:rn(e.zone,pn.defaultZone),loc:Sn.fromObject(e)});throw new Pe(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(li(t))return new Ss({ts:1e3*t,zone:rn(e.zone,pn.defaultZone),loc:Sn.fromObject(e)});throw new Pe("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=rn(e.zone,pn.defaultZone);if(!i.isValid)return Ss.invalid(ns(i));const n=pn.now(),o=ai(e.specificOffset)?i.offset(n):e.specificOffset,s=$i(t,_s),r=!ai(s.ordinal),a=!ai(s.year),l=!ai(s.month)||!ai(s.day),h=a||l,c=s.weekYear||s.weekNumber,d=Sn.fromObject(e);if((h||r)&&c)throw new Oe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new Oe("Can't mix ordinal dates with month/day");const u=c||s.weekday&&!h;let p,m,f=as(n,o);u?(p=ys,m=fs,f=Ko(f)):r?(p=bs,m=gs,f=Jo(f)):(p=vs,m=ms);let g=!1;for(const t of p){ai(s[t])?s[t]=g?m[t]:f[t]:g=!0}const v=u?function(t){const e=hi(t.weekYear),i=pi(t.weekNumber,1,ki(t.weekYear)),n=pi(t.weekday,1,7);return e?i?!n&&jo("weekday",t.weekday):jo("week",t.week):jo("weekYear",t.weekYear)}(s):r?function(t){const e=hi(t.year),i=pi(t.ordinal,1,_i(t.year));return e?!i&&jo("ordinal",t.ordinal):jo("year",t.year)}(s):Qo(s),y=v||ts(s);if(y)return Ss.invalid(y);const b=u?Yo(s):r?Xo(s):s,[_,x]=ls(b,o,i),w=new Ss({ts:_,zone:i,o:x,loc:d});return s.weekday&&h&&t.weekday!==w.weekday?Ss.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return Tn(t,[Qn,no],[to,oo],[eo,so],[io,ro])}(t);return cs(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return Tn(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Hn,Wn])}(t);return cs(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return Tn(t,[Gn,Jn],[Kn,Jn],[Yn,Xn])}(t);return cs(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(ai(t)||ai(e))throw new Pe("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,s=Sn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:n,zone:o,specificOffset:s,invalidReason:r}=Fo(t,e,i);return[n,o,s,r]}(s,t,e);return h?Ss.invalid(h):cs(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return Ss.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return Tn(t,[lo,no],[ho,co])}(t);return cs(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the DateTime is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Ae(i);return new Ss({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?os(this).weekYear:NaN}get weekNumber(){return this.isValid?os(this).weekNumber:NaN}get weekday(){return this.isValid?os(this).weekday:NaN}get ordinal(){return this.isValid?Jo(this.c).ordinal:NaN}get monthShort(){return this.isValid?So.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?So.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?So.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?So.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return bi(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?_i(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=Wi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(on.instance(t),e)}toLocal(){return this.setZone(pn.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=rn(t,pn.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=ls(i,e,t)}return ss(this,{ts:n,zone:t})}return Ss.invalid(ns(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return ss(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=$i(t,_s),i=!ai(e.weekYear)||!ai(e.weekNumber)||!ai(e.weekday),n=!ai(e.ordinal),o=!ai(e.year),s=!ai(e.month)||!ai(e.day),r=o||s,a=e.weekYear||e.weekNumber;if((r||n)&&a)throw new Oe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new Oe("Can't mix ordinal dates with month/day");let l;i?l=Yo({...Ko(this.c),...e}):ai(e.ordinal)?(l={...this.toObject(),...e},ai(e.day)&&(l.day=Math.min(xi(l.year,l.month),l.day))):l=Xo({...Jo(this.c),...e});const[h,c]=ls(l,this.o,this.zone);return ss(this,{ts:h,o:c})}plus(t){if(!this.isValid)return this;return ss(this,hs(this,xo.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return ss(this,hs(this,xo.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=xo.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?Wi.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):es}toLocaleString(t=Be,e={}){return this.isValid?Wi.create(this.loc.clone(e),t).formatDateTime(this):es}toLocaleParts(t={}){return this.isValid?Wi.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=us(this,s);return r+="T",r+=ps(this,s,e,i,n,o),r}toISODate({format:t="extended"}={}){return this.isValid?us(this,"extended"===t):null}toISOWeekDate(){return ds(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+ps(this,"extended"===s,e,t,i,o)}toRFC2822(){return ds(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ds(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?us(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),ds(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():es}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return xo.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(xo.normalizeUnit),s=t.valueOf()>this.valueOf(),r=Eo(s?this:t,s?t:this,o,n);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(Ss.now(),t,e)}until(t){return this.isValid?ko.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||Ss.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),ws(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?ws(t.base||Ss.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ss.isDateTime))throw new Pe("min requires all arguments be DateTimes");return di(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Ss.isDateTime))throw new Pe("max requires all arguments be DateTimes");return di(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return Fo(Sn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return Ss.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Be}static get DATE_MED(){return qe}static get DATE_MED_WITH_WEEKDAY(){return Ze}static get DATE_FULL(){return Fe}static get DATE_HUGE(){return Ue}static get TIME_SIMPLE(){return Ve}static get TIME_WITH_SECONDS(){return je}static get TIME_WITH_SHORT_OFFSET(){return He}static get TIME_WITH_LONG_OFFSET(){return We}static get TIME_24_SIMPLE(){return Ge}static get TIME_24_WITH_SECONDS(){return Ke}static get TIME_24_WITH_SHORT_OFFSET(){return Ye}static get TIME_24_WITH_LONG_OFFSET(){return Je}static get DATETIME_SHORT(){return Xe}static get DATETIME_SHORT_WITH_SECONDS(){return Qe}static get DATETIME_MED(){return ti}static get DATETIME_MED_WITH_SECONDS(){return ei}static get DATETIME_MED_WITH_WEEKDAY(){return ii}static get DATETIME_FULL(){return ni}static get DATETIME_FULL_WITH_SECONDS(){return oi}static get DATETIME_HUGE(){return si}static get DATETIME_HUGE_WITH_SECONDS(){return ri}}function Cs(t){if(Ss.isDateTime(t))return t;if(t&&t.valueOf&&li(t.valueOf()))return Ss.fromJSDate(t);if(t&&"object"==typeof t)return Ss.fromObject(t);throw new Pe(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class Es extends nt{constructor(){super(...arguments),this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.featuredFields=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
|
|
480
|
+
></temba-button>`}}t([st({type:Boolean})],wt.prototype,"chatbox",void 0),t([st({type:Boolean})],wt.prototype,"attachments",void 0),t([st({type:Boolean})],wt.prototype,"counter",void 0),t([st({type:Boolean})],wt.prototype,"pendingDrop",void 0),t([st({type:Boolean})],wt.prototype,"button",void 0),t([st({type:String})],wt.prototype,"currentText",void 0),t([st({type:String})],wt.prototype,"accept",void 0),t([st({type:String,attribute:!1})],wt.prototype,"endpoint",void 0),t([st({type:Boolean,attribute:!1})],wt.prototype,"uploading",void 0),t([st({type:Array})],wt.prototype,"currentAttachments",void 0),t([st({type:Array,attribute:!1})],wt.prototype,"failedAttachments",void 0),t([st({type:String})],wt.prototype,"buttonName",void 0),t([st({type:Boolean,attribute:!1})],wt.prototype,"buttonDisabled",void 0),t([st({type:String,attribute:!1})],wt.prototype,"buttonError",void 0),t([st({type:Boolean,attribute:"widget_only"})],wt.prototype,"widgetOnly",void 0),t([st({type:Array})],wt.prototype,"errors",void 0),t([st({type:String})],wt.prototype,"value",void 0);var kt,St,Ct,Et,Tt,$t,At,Lt,Mt,Ot,zt,Pt,It,Dt,Nt,Rt,Bt,qt,Zt=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,i),i},Ft=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ut=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let n=0;n<t.length;n++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(n);return e},Vt="0123456789abcdef".split(""),jt=[-2147483648,8388608,32768,128],Ht=[24,16,8,0],Wt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Gt=[];class Kt{constructor(t=!1,e=!1){kt.set(this,void 0),St.set(this,void 0),Ct.set(this,void 0),Et.set(this,void 0),Tt.set(this,void 0),$t.set(this,void 0),At.set(this,void 0),Lt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),zt.set(this,void 0),Pt.set(this,void 0),It.set(this,void 0),Dt.set(this,void 0),Nt.set(this,void 0),Rt.set(this,void 0),Bt.set(this,0),qt.set(this,void 0),this.init(t,e)}init(t,e){e?(Gt[0]=Gt[16]=Gt[1]=Gt[2]=Gt[3]=Gt[4]=Gt[5]=Gt[6]=Gt[7]=Gt[8]=Gt[9]=Gt[10]=Gt[11]=Gt[12]=Gt[13]=Gt[14]=Gt[15]=0,Zt(this,St,Gt)):Zt(this,St,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Zt(this,$t,3238371032),Zt(this,At,914150663),Zt(this,Lt,812702999),Zt(this,Mt,4144912697),Zt(this,Ot,4290775857),Zt(this,zt,1750603025),Zt(this,Pt,1694076839),Zt(this,It,3204075428)):(Zt(this,$t,1779033703),Zt(this,At,3144134277),Zt(this,Lt,1013904242),Zt(this,Mt,2773480762),Zt(this,Ot,1359893119),Zt(this,zt,2600822924),Zt(this,Pt,528734635),Zt(this,It,1541459225)),Zt(this,kt,Zt(this,qt,Zt(this,Ct,Zt(this,Nt,0)))),Zt(this,Et,Zt(this,Dt,!1)),Zt(this,Tt,!0),Zt(this,Rt,t)}update(t){if(Ft(this,Et))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const n=e.length,o=Ft(this,St);for(;i<n;){let t;if(Ft(this,Dt)&&(Zt(this,Dt,!1),o[0]=Ft(this,kt),o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),"string"!=typeof e)for(t=Ft(this,qt);i<n&&t<64;++i)o[t>>2]|=e[i]<<Ht[3&t++];else for(t=Ft(this,qt);i<n&&t<64;++i){let n=e.charCodeAt(i);n<128?o[t>>2]|=n<<Ht[3&t++]:n<2048?(o[t>>2]|=(192|n>>6)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++]):n<55296||n>=57344?(o[t>>2]|=(224|n>>12)<<Ht[3&t++],o[t>>2]|=(128|n>>6&63)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[t>>2]|=(240|n>>18)<<Ht[3&t++],o[t>>2]|=(128|n>>12&63)<<Ht[3&t++],o[t>>2]|=(128|n>>6&63)<<Ht[3&t++],o[t>>2]|=(128|63&n)<<Ht[3&t++])}Zt(this,Bt,t),Zt(this,Ct,Ft(this,Ct)+(t-Ft(this,qt))),t>=64?(Zt(this,kt,o[16]),Zt(this,qt,t-64),this.hash(),Zt(this,Dt,!0)):Zt(this,qt,t)}return Ft(this,Ct)>4294967295&&(Zt(this,Nt,Ft(this,Nt)+(Ft(this,Ct)/4294967296<<0)),Zt(this,Ct,Ft(this,Ct)%4294967296)),this}finalize(){if(Ft(this,Et))return;Zt(this,Et,!0);const t=Ft(this,St),e=Ft(this,Bt);t[16]=Ft(this,kt),t[e>>2]|=jt[3&e],Zt(this,kt,t[16]),e>=56&&(Ft(this,Dt)||this.hash(),t[0]=Ft(this,kt),t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=Ft(this,Nt)<<3|Ft(this,Ct)>>>29,t[15]=Ft(this,Ct)<<3,this.hash()}hash(){let t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It);const l=Ft(this,St);let h,c,d,u,p,m,f,g,v,y;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c<<0;y=e&i;for(let b=0;b<64;b+=4)Ft(this,Tt)?(Ft(this,Rt)?(f=300032,u=l[0]-1413257819,a=u-150054599<<0,n=u+24177077<<0):(f=704751109,u=l[0]-210244248,a=u-1521486534<<0,n=u+143694565<<0),Zt(this,Tt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),f=t&e,d=f^t&i^y,m=o&s^~o&r,u=a+c+m+Wt[b]+l[b],p=h+d,a=n+u<<0,n=u+p<<0),h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),g=n&t,d=g^n&e^f,m=a&o^~a&s,u=r+c+m+Wt[b+1]+l[b+1],p=h+d,r=i+u<<0,i=u+p<<0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&n,d=v^i&t^g,m=r&a^~r&o,u=s+c+m+Wt[b+2]+l[b+2],p=h+d,s=e+u<<0,e=u+p<<0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=e&i,d=y^e&n^v,m=s&r^~s&a,u=o+c+m+Wt[b+3]+l[b+3],p=h+d,o=t+u<<0,t=u+p<<0;Zt(this,$t,Ft(this,$t)+t<<0),Zt(this,At,Ft(this,At)+e<<0),Zt(this,Lt,Ft(this,Lt)+i<<0),Zt(this,Mt,Ft(this,Mt)+n<<0),Zt(this,Ot,Ft(this,Ot)+o<<0),Zt(this,zt,Ft(this,zt)+s<<0),Zt(this,Pt,Ft(this,Pt)+r<<0),Zt(this,It,Ft(this,It)+a<<0)}hex(){this.finalize();const t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It);let l=Vt[t>>28&15]+Vt[t>>24&15]+Vt[t>>20&15]+Vt[t>>16&15]+Vt[t>>12&15]+Vt[t>>8&15]+Vt[t>>4&15]+Vt[15&t]+Vt[e>>28&15]+Vt[e>>24&15]+Vt[e>>20&15]+Vt[e>>16&15]+Vt[e>>12&15]+Vt[e>>8&15]+Vt[e>>4&15]+Vt[15&e]+Vt[i>>28&15]+Vt[i>>24&15]+Vt[i>>20&15]+Vt[i>>16&15]+Vt[i>>12&15]+Vt[i>>8&15]+Vt[i>>4&15]+Vt[15&i]+Vt[n>>28&15]+Vt[n>>24&15]+Vt[n>>20&15]+Vt[n>>16&15]+Vt[n>>12&15]+Vt[n>>8&15]+Vt[n>>4&15]+Vt[15&n]+Vt[o>>28&15]+Vt[o>>24&15]+Vt[o>>20&15]+Vt[o>>16&15]+Vt[o>>12&15]+Vt[o>>8&15]+Vt[o>>4&15]+Vt[15&o]+Vt[s>>28&15]+Vt[s>>24&15]+Vt[s>>20&15]+Vt[s>>16&15]+Vt[s>>12&15]+Vt[s>>8&15]+Vt[s>>4&15]+Vt[15&s]+Vt[r>>28&15]+Vt[r>>24&15]+Vt[r>>20&15]+Vt[r>>16&15]+Vt[r>>12&15]+Vt[r>>8&15]+Vt[r>>4&15]+Vt[15&r];return Ft(this,Rt)||(l+=Vt[a>>28&15]+Vt[a>>24&15]+Vt[a>>20&15]+Vt[a>>16&15]+Vt[a>>12&15]+Vt[a>>8&15]+Vt[a>>4&15]+Vt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Ft(this,$t),e=Ft(this,At),i=Ft(this,Lt),n=Ft(this,Mt),o=Ft(this,Ot),s=Ft(this,zt),r=Ft(this,Pt),a=Ft(this,It),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Ft(this,Rt)||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l}array(){return this.digest()}arrayBuffer(){this.finalize();const t=new ArrayBuffer(Ft(this,Rt)?28:32),e=new DataView(t);return e.setUint32(0,Ft(this,$t)),e.setUint32(4,Ft(this,At)),e.setUint32(8,Ft(this,Lt)),e.setUint32(12,Ft(this,Mt)),e.setUint32(16,Ft(this,Ot)),e.setUint32(20,Ft(this,zt)),e.setUint32(24,Ft(this,Pt)),Ft(this,Rt)||e.setUint32(28,Ft(this,It)),t}}function Yt(t){const e=new Kt;return e.update(t),parseInt(e.hex().substring(0,8),16)}kt=new WeakMap,St=new WeakMap,Ct=new WeakMap,Et=new WeakMap,Tt=new WeakMap,$t=new WeakMap,At=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Pt=new WeakMap,It=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,qt=new WeakMap;const Jt=function(t,e,i){var n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?o+6*(n-o)*t:t<.5?n:t<2/3?o+6*(n-o)*(2/3-t):o,Math.round(255*t)}))};const Xt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Yt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ut)}hsl(t){var e,i,n=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[n%this.hueRanges.length];e=n/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=n%359;return n=Math.ceil(n/360),i=this.S[n%this.S.length],n=Math.ceil(n/this.S.length),[e,i,this.L[n%this.L.length]]}rgb(t){var e=this.hsl(t);return Jt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}},Qt=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,te=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},ee=(t,e=null,i={})=>new Promise(((n,o)=>{const s={method:"GET",headers:te(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),ie=t=>{const e=[];Object.keys(t).forEach((i=>{t[i]&&e.push(i)}));let i=e.join(" ");return i.trim().length>0&&(i=" "+i),i.trim()},ne=(t,e=null)=>new Promise(((i,n)=>{ee(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),oe=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ne(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},se=t=>new Promise(((e,i)=>{ee(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),re=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await se(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},ae=(t,e,i={},n=null)=>{const o=te(i);n&&(o["Content-Type"]=n);const s={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},le=(t,e)=>ae(t,JSON.stringify(e),!1,"application/json"),he=(t,e)=>new Promise(((i,n)=>{ae(t,e,!0).then((e=>{e.status>=200&&e.status<300?i(e):n(t===xt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),ce=t=>{const e=t.parentNode||t.host;if(e){const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY,i=t&&!(t.includes("hidden")||t.includes("visible"));return e?i&&e.scrollHeight>=e.clientHeight?e:ce(e):null}return null},de=3600,ue=86400,pe=30*ue;const me=new class{getCurrentDate(){return new Date}},fe=(t,e={suffix:""})=>{const{compareDate:i,hideRecentText:n,suffix:o}=e,s=i||me.getCurrentDate(),r=Math.floor((s.getTime()-t.getTime())/1e3);if(r<60)return i?r+"s"+o:!n&&o?o:"just now";if(r<de)return Math.round(r/60)+"m"+o;if(r<=ue)return Math.round(r/de)+"h"+o;if(r<=pe)return Math.round(r/ue)+"d"+o;if(r<6*pe)return Math.round(r/pe)+"mth"+o;return t.getDate()+" "+t.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ","")+(t.getFullYear()==s.getFullYear()?"":" "+t.getFullYear())},ge=(t,e,i=!1)=>{let n;return function(...o){const s=this,r=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(s,o)}),e),r&&t.apply(s,o)}},ve=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},ye=(t,e)=>t.length>e?t.substring(0,e)+"...":t,be=(t,e="and")=>1===t.length?t[0]:2===t.length?"html"===t[0].type?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"html"===t[0].type?t.map(((i,n)=>n<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],_e=(t,e,i="and")=>be(t.map(e),i),xe=t=>"true"===((t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e})(t)||"");var we;!function(t){t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(we||(we={}));const ke=t=>t.split("/")[1],Se=(t,e)=>{if(0==t)return"0 KB";const i=e||2,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(i))+" "+["B","KB","MB","GB"][n]},Ce=t=>{if(t.position||(t.position="right"),t.image)return D`<img src="${t.image}">`;let e=t.name;if(t.user&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;const i=Xt.hex(e);let n=e.indexOf(" ")+1;n<1&&(n=e.length>1?1:0);let o=e.substring(0,1)+e.substring(n,n+1);return o=o.toUpperCase(),D` <temba-tip text="${e}" position="${t.position}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center"> <div class="avatar-circle" style="display:flex;height:2em;width:2em;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;border:.3em solid rgba(0,0,0,.05);background:${i}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${o}</div> </div> </div> </div> </temba-tip> `};class Ee{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function Te(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new Ee(t,e)}class $e extends Error{}class Ae extends $e{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Le extends $e{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Me extends $e{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Oe extends $e{}class ze extends $e{constructor(t){super(`Invalid unit ${t}`)}}class Pe extends $e{}class Ie extends $e{constructor(){super("Zone is an abstract class")}}const De="numeric",Ne="short",Re="long",Be={year:De,month:De,day:De},qe={year:De,month:Ne,day:De},Ze={year:De,month:Ne,day:De,weekday:Ne},Fe={year:De,month:Re,day:De},Ue={year:De,month:Re,day:De,weekday:Re},Ve={hour:De,minute:De},je={hour:De,minute:De,second:De},He={hour:De,minute:De,second:De,timeZoneName:Ne},We={hour:De,minute:De,second:De,timeZoneName:Re},Ge={hour:De,minute:De,hourCycle:"h23"},Ke={hour:De,minute:De,second:De,hourCycle:"h23"},Ye={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Ne},Je={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Re},Xe={year:De,month:De,day:De,hour:De,minute:De},Qe={year:De,month:De,day:De,hour:De,minute:De,second:De},ti={year:De,month:Ne,day:De,hour:De,minute:De},ei={year:De,month:Ne,day:De,hour:De,minute:De,second:De},ii={year:De,month:Ne,day:De,weekday:Ne,hour:De,minute:De},ni={year:De,month:Re,day:De,hour:De,minute:De,timeZoneName:Ne},oi={year:De,month:Re,day:De,hour:De,minute:De,second:De,timeZoneName:Ne},si={year:De,month:Re,day:De,weekday:Re,hour:De,minute:De,timeZoneName:Re},ri={year:De,month:Re,day:De,weekday:Re,hour:De,minute:De,second:De,timeZoneName:Re};function ai(t){return void 0===t}function li(t){return"number"==typeof t}function hi(t){return"number"==typeof t&&t%1==0}function ci(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function di(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function ui(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pi(t,e,i){return hi(t)&&t>=e&&t<=i}function mi(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function fi(t){return ai(t)||null===t||""===t?void 0:parseInt(t,10)}function gi(t){return ai(t)||null===t||""===t?void 0:parseFloat(t)}function vi(t){if(!ai(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function yi(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function bi(t){return t%4==0&&(t%100!=0||t%400==0)}function _i(t){return bi(t)?366:365}function xi(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?bi(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function wi(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function ki(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function Si(t){return t>99?t:t>60?1900+t:2e3+t}function Ci(t,e,i,n=null){const o=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Ei(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function Ti(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Pe(`Invalid unit value ${t}`);return e}function $i(t,e){const i={};for(const n in t)if(ui(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=Ti(o)}return i}function Ai(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${mi(i,2)}:${mi(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${mi(i,2)}${mi(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Li(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Mi=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Oi=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Pi=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ii(t){switch(t){case"narrow":return[...Pi];case"short":return[...zi];case"long":return[...Oi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Di=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ni=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ri=["M","T","W","T","F","S","S"];function Bi(t){switch(t){case"narrow":return[...Ri];case"short":return[...Ni];case"long":return[...Di];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qi=["AM","PM"],Zi=["Before Christ","Anno Domini"],Fi=["BC","AD"],Ui=["B","A"];function Vi(t){switch(t){case"narrow":return[...Ui];case"short":return[...Fi];case"long":return[...Zi];default:return null}}function ji(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const Hi={D:Be,DD:qe,DDD:Fe,DDDD:Ue,t:Ve,tt:je,ttt:He,tttt:We,T:Ge,TT:Ke,TTT:Ye,TTTT:Je,f:Xe,ff:ti,fff:ni,ffff:si,F:Qe,FF:ei,FFF:oi,FFFF:ri};class Wi{static create(t,e={}){return new Wi(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&o.push({literal:!1,val:i}),i=r,e=r)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return Hi[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return mi(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),s=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return qi[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return Ii(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Bi(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=Wi.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Vi(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return ji(Wi.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Wi.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...o.map(i).filter((t=>t)));return ji(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(s))}}class Gi{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ki{get type(){throw new Ie}get name(){throw new Ie}get ianaName(){return this.name}get isUniversal(){throw new Ie}offsetName(t,e){throw new Ie}formatOffset(t,e){throw new Ie}offset(t){throw new Ie}equals(t){throw new Ie}get isValid(){throw new Ie}}let Yi=null;class Ji extends Ki{static get instance(){return null===Yi&&(Yi=new Ji),Yi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Ci(t,e,i)}formatOffset(t,e){return Ai(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let Xi={};const Qi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let tn={};class en extends Ki{static create(t){return tn[t]||(tn[t]=new en(t)),tn[t]}static resetCache(){tn={},Xi={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=en.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Ci(t,e,i,this.name)}formatOffset(t,e){return Ai(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,Xi[n]||(Xi[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Xi[n]);var n;let[o,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],s=Qi[e];"era"===e?n[s]=o:ai(s)||(n[s]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,s,r,a,l,h,c]=n;return[r,o,s,a,l,h,c]}(i,e);"BC"===a&&(o=1-Math.abs(o));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,(wi({year:o,month:s,day:r,hour:24===l?0:l,minute:h,second:c,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let nn=null;class on extends Ki{static get utcInstance(){return null===nn&&(nn=new on(0)),nn}static instance(t){return 0===t?on.utcInstance:new on(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new on(Ei(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Ai(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${Ai(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Ai(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class sn extends Ki{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function rn(t,e){if(ai(t)||null===t)return e;if(t instanceof Ki)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?on.utcInstance:on.parseSpecifier(i)||en.create(t)}return li(t)?on.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new sn(t)}let an,ln=()=>Date.now(),hn="system",cn=null,dn=null,un=null;class pn{static get now(){return ln}static set now(t){ln=t}static set defaultZone(t){hn=t}static get defaultZone(){return rn(hn,Ji.instance)}static get defaultLocale(){return cn}static set defaultLocale(t){cn=t}static get defaultNumberingSystem(){return dn}static set defaultNumberingSystem(t){dn=t}static get defaultOutputCalendar(){return un}static set defaultOutputCalendar(t){un=t}static get throwOnInvalid(){return an}static set throwOnInvalid(t){an=t}static resetCaches(){Sn.resetCache(),en.resetCache()}}let mn={};let fn={};function gn(t,e={}){const i=JSON.stringify([t,e]);let n=fn[i];return n||(n=new Intl.DateTimeFormat(t,e),fn[i]=n),n}let vn={};let yn={};let bn=null;function _n(t,e,i,n,o){const s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):o(e)}class xn{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...s}=i;if(!e||Object.keys(s).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=vn[i];return n||(n=new Intl.NumberFormat(t,e),vn[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return mi(this.floor?Math.floor(t):yi(t,3),this.padTo)}}class wn{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&en.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:Ss.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=gn(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class kn{constructor(t,e,i){this.opts={style:"long",...i},!e&&ci()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let s=yn[o];return s||(s=new Intl.RelativeTimeFormat(t,e),yn[o]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=o[t],c=n?l?h[1]:h[2]||h[1]:l?o[t][0]:t;return r?`${a} ${c} ago`:`in ${a} ${c}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class Sn{static fromOpts(t){return Sn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||pn.defaultLocale,s=o||(n?"en-US":bn||(bn=(new Intl.DateTimeFormat).resolvedOptions().locale,bn)),r=e||pn.defaultNumberingSystem,a=i||pn.defaultOutputCalendar;return new Sn(s,r,a,o)}static resetCache(){bn=null,fn={},vn={},yn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return Sn.create(t,e,i)}constructor(t,e,i,n){const[o,s,r]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=gn(t).resolvedOptions()}catch(t){i=gn(n).resolvedOptions()}const{numberingSystem:o,calendar:s}=i;return[n,o,s]}}(t);this.locale=o,this.numberingSystem=e||s||null,this.outputCalendar=i||r||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?Sn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return _n(this,t,i,Ii,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=Ss.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return _n(this,t,i,Bi,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=Ss.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return _n(this,void 0,t,(()=>qi),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ss.utc(2016,11,13,9),Ss.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return _n(this,t,e,Vi,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ss.utc(-40,1,1),Ss.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new xn(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new wn(t,this.intl,e)}relFormatter(t={}){return new kn(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=mn[i];return n||(n=new Intl.ListFormat(t,e),mn[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Cn(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function En(...t){return e=>t.reduce((([t,i,n],o)=>{const[s,r,a]=o(e,n);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function Tn(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function $n(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=fi(e[i+o]);return[n,null,i+o]}}const An=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ln=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Mn=RegExp(`${Ln.source}${`(?:${An.source}?(?:\\[(${Mi.source})\\])?)?`}`),On=RegExp(`(?:T${Mn.source})?`),zn=$n("weekYear","weekNumber","weekDay"),Pn=$n("year","ordinal"),In=RegExp(`${Ln.source} ?(?:${An.source}|(${Mi.source}))?`),Dn=RegExp(`(?: ${In.source})?`);function Nn(t,e,i){const n=t[e];return ai(n)?i:fi(n)}function Rn(t,e){return[{hours:Nn(t,e,0),minutes:Nn(t,e+1,0),seconds:Nn(t,e+2,0),milliseconds:vi(t[e+3])},null,e+4]}function Bn(t,e){const i=!t[e]&&!t[e+1],n=Ei(t[e+1],t[e+2]);return[{},i?null:on.instance(n),e+3]}function qn(t,e){return[{},t[e]?en.create(t[e]):null,e+1]}const Zn=RegExp(`^T?${Ln.source}$`),Fn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Un(t){const[e,i,n,o,s,r,a,l,h]=t,c="-"===e[0],d=l&&"-"===l[0],u=(t,e=!1)=>void 0!==t&&(e||t&&c)?-t:t;return[{years:u(gi(i)),months:u(gi(n)),weeks:u(gi(o)),days:u(gi(s)),hours:u(gi(r)),minutes:u(gi(a)),seconds:u(gi(l),"-0"===l),milliseconds:u(vi(h),d)}]}const Vn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function jn(t,e,i,n,o,s,r){const a={year:2===e.length?Si(fi(e)):fi(e),month:zi.indexOf(i)+1,day:fi(n),hour:fi(o),minute:fi(s)};return r&&(a.second=fi(r)),t&&(a.weekday=t.length>3?Di.indexOf(t)+1:Ni.indexOf(t)+1),a}const Hn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Wn(t){const[,e,i,n,o,s,r,a,l,h,c,d]=t,u=jn(e,o,n,i,s,r,a);let p;return p=l?Vn[l]:h?0:Ei(c,d),[u,new on(p)]}const Gn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Kn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Jn(t){const[,e,i,n,o,s,r,a]=t;return[jn(e,o,n,i,s,r,a),on.utcInstance]}function Xn(t){const[,e,i,n,o,s,r,a]=t;return[jn(e,a,i,n,o,s,r),on.utcInstance]}const Qn=Cn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,On),to=Cn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,On),eo=Cn(/(\d{4})-?(\d{3})/,On),io=Cn(Mn),no=En((function(t,e){return[{year:Nn(t,e),month:Nn(t,e+1,1),day:Nn(t,e+2,1)},null,e+3]}),Rn,Bn,qn),oo=En(zn,Rn,Bn,qn),so=En(Pn,Rn,Bn,qn),ro=En(Rn,Bn,qn);const ao=En(Rn);const lo=Cn(/(\d{4})-(\d\d)-(\d\d)/,Dn),ho=Cn(In),co=En(Rn,Bn,qn);const uo={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},po={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...uo},mo=365.2425,fo=30.436875,go={years:{quarters:4,months:12,weeks:52.1775,days:mo,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:fo,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...uo},vo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],yo=vo.slice(0).reverse();function bo(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new xo(n)}function _o(t,e,i,n,o){const s=t[o][i],r=e[i]/s,a=!(Math.sign(r)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(r)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(r):Math.trunc(r);n[o]+=a,e[i]-=a*s}class xo{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||Sn.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?go:po,this.isLuxonDuration=!0}static fromMillis(t,e){return xo.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Pe("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new xo({values:$i(t,xo.normalizeUnit),loc:Sn.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(li(t))return xo.fromMillis(t);if(xo.isDuration(t))return t;if("object"==typeof t)return xo.fromObject(t);throw new Pe(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return Tn(t,[Fn,Un])}(t);return i?xo.fromObject(i,e):xo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return Tn(t,[Zn,ao])}(t);return i?xo.fromObject(i,e):xo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the Duration is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Me(i);return new xo({invalid:i})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new ze(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const i={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?Wi.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=vo.map((e=>{const i=this.values[e];return ai(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(i)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=yi(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=xo.fromDurationLike(t),i={};for(const t of vo)(ui(e.values,t)||ui(this.values,t))&&(i[t]=e.get(t)+this.get(t));return bo(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=xo.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=Ti(t(this.values[i],i));return bo(this,{values:e},!0)}get(t){return this[xo.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return bo(this,{values:{...this.values,...$i(t,xo.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),bo(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){yo.reduce(((i,n)=>ai(e[n])?i:(i&&_o(t,e,i,e,n),n)),null)}(this.matrix,t),bo(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>xo.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const s of vo)if(t.indexOf(s)>=0){o=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;li(n[s])&&(t+=n[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3;for(const t in n)vo.indexOf(t)>vo.indexOf(s)&&_o(this.matrix,n,t,e,s)}else li(n[s])&&(i[s]=n[s]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return bo(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return bo(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of vo)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const wo="Invalid Interval";class ko{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the Interval is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Le(i);return new ko({invalid:i})}static fromDateTimes(t,e){const i=Cs(t),n=Cs(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?ko.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:ko.invalid("missing or invalid end"):ko.invalid("missing or invalid start")}(i,n);return null==o?new ko({start:i,end:n}):o}static after(t,e){const i=xo.fromDurationLike(e),n=Cs(t);return ko.fromDateTimes(n,n.plus(i))}static before(t,e){const i=xo.fromDurationLike(e),n=Cs(t);return ko.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,s,r;try{t=Ss.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{s=Ss.fromISO(n,e),r=s.isValid}catch(n){r=!1}if(o&&r)return ko.fromDateTimes(t,s);if(o){const i=xo.fromISO(n,e);if(i.isValid)return ko.after(t,i)}else if(r){const t=xo.fromISO(i,e);if(t.isValid)return ko.before(s,t)}}return ko.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?ko.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Cs).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,s=+t>+this.e?this.e:t;i.push(ko.fromDateTimes(n,s)),n=s,o+=1}return i}splitBy(t){const e=xo.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const s=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,s.push(ko.fromDateTimes(n,i)),n=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:ko.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,i=this.e>t.e?this.e:t.e;return ko.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of s)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(ko.fromDateTimes(e,t.time)),e=null);return ko.merge(n)}difference(...t){return ko.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:wo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:wo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:wo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:wo}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:wo}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):xo.invalid(this.invalidReason)}mapEndpoints(t){return ko.fromDateTimes(t(this.s),t(this.e))}}class So{static hasDST(t=pn.defaultZone){const e=Ss.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return en.isValidZone(t)}static normalizeZone(t){return rn(t,pn.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||Sn.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||Sn.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Sn.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||Sn.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Sn.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return Sn.create(e,null,"gregory").eras(t)}static features(){return{relative:ci()}}}function Co(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(xo.fromMillis(n).as("days"))}function Eo(t,e,i,n){let[o,s,r,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=Co(t,e);return(i-i%7)/7}],["days",Co]],o={};let s,r;for(const[a,l]of n)if(i.indexOf(a)>=0){s=a;let i=l(t,e);r=t.plus({[a]:i}),r>e?(t=t.plus({[a]:i-1}),i-=1):t=r,o[a]=i}return[t,o,r,s]}(t,e,i);const l=e-o,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=o.plus({[a]:1})),r!==o&&(s[a]=(s[a]||0)+l/(r-o)));const c=xo.fromObject(s,n);return h.length>0?xo.fromMillis(l,n).shiftTo(...h).plus(c):c}const To={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$o={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ao=To.hanidec.replace(/[\[|\]]/g,"").split("");function Lo({numberingSystem:t},e=""){return new RegExp(`${To[t||"latn"]}${e}`)}function Mo(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search(To.hanidec))e+=Ao.indexOf(t[i]);else for(const t in $o){const[i,o]=$o[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const Oo=`[ ${String.fromCharCode(160)}]`,zo=new RegExp(Oo,"g");function Po(t){return t.replace(/\./g,"\\.?").replace(zo,Oo)}function Io(t){return t.replace(/\./g,"").replace(zo," ").toLowerCase()}function Do(t,e){return null===t?null:{regex:RegExp(t.map(Po).join("|")),deser:([i])=>t.findIndex((t=>Io(i)===Io(t)))+e}}function No(t,e){return{regex:t,deser:([,t,e])=>Ei(t,e),groups:e}}function Ro(t){return{regex:t,deser:([t])=>t}}const Bo={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let qo=null;function Zo(t,e){if(t.literal)return t;const i=Wi.macroTokenToFormatOpts(t.val);if(!i)return t;const n=Wi.create(e,i).formatDateTimeParts((qo||(qo=Ss.fromMillis(1555555555555)),qo)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const s=i[n];let r=Bo[n];return"object"==typeof r&&(r=r[s]),r?{literal:!1,val:r}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function Fo(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>Zo(t,e))))}(Wi.parseFormat(i),t),o=n.map((e=>function(t,e){const i=Lo(e),n=Lo(e,"{2}"),o=Lo(e,"{3}"),s=Lo(e,"{4}"),r=Lo(e,"{6}"),a=Lo(e,"{1,2}"),l=Lo(e,"{1,3}"),h=Lo(e,"{1,6}"),c=Lo(e,"{1,9}"),d=Lo(e,"{2,4}"),u=Lo(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return Do(e.eras("short",!1),0);case"GG":return Do(e.eras("long",!1),0);case"y":return Mo(h);case"yy":case"kk":return Mo(d,Si);case"yyyy":case"kkkk":return Mo(s);case"yyyyy":return Mo(u);case"yyyyyy":return Mo(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Mo(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Mo(n);case"MMM":return Do(e.months("short",!0,!1),1);case"MMMM":return Do(e.months("long",!0,!1),1);case"LLL":return Do(e.months("short",!1,!1),1);case"LLLL":return Do(e.months("long",!1,!1),1);case"o":case"S":return Mo(l);case"ooo":case"SSS":return Mo(o);case"u":return Ro(c);case"uu":return Ro(a);case"uuu":case"E":case"c":return Mo(i);case"a":return Do(e.meridiems(),0);case"EEE":return Do(e.weekdays("short",!1,!1),1);case"EEEE":return Do(e.weekdays("long",!1,!1),1);case"ccc":return Do(e.weekdays("short",!0,!1),1);case"cccc":return Do(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return No(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return No(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Ro(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),s=o.find((t=>t.invalidReason));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),s=RegExp(t,"i"),[r,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(ui(i,o)){const s=i[o],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(e,s,i),[l,h,c]=a?function(t){let e,i=null;ai(t.z)||(i=en.create(t.z)),ai(t.Z)||(i||(i=new on(t.Z)),e=t.Z),ai(t.q)||(t.M=3*(t.q-1)+1),ai(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),ai(t.u)||(t.S=vi(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(ui(a,"a")&&ui(a,"H"))throw new Oe("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:s,rawMatches:r,matches:a,result:l,zone:h,specificOffset:c}}}const Uo=[0,31,59,90,120,151,181,212,243,273,304,334],Vo=[0,31,60,91,121,152,182,213,244,274,305,335];function jo(t,e){return new Gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Ho(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function Wo(t,e,i){return i+(bi(t)?Vo:Uo)[e-1]}function Go(t,e){const i=bi(t)?Vo:Uo,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function Ko(t){const{year:e,month:i,day:n}=t,o=Wo(e,i,n),s=Ho(e,i,n);let r,a=Math.floor((o-s+10)/7);return a<1?(r=e-1,a=ki(r)):a>ki(e)?(r=e+1,a=1):r=e,{weekYear:r,weekNumber:a,weekday:s,...Li(t)}}function Yo(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=Ho(e,1,4),s=_i(e);let r,a=7*i+n-o-3;a<1?(r=e-1,a+=_i(r)):a>s?(r=e+1,a-=_i(e)):r=e;const{month:l,day:h}=Go(r,a);return{year:r,month:l,day:h,...Li(t)}}function Jo(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:Wo(e,i,n),...Li(t)}}function Xo(t){const{year:e,ordinal:i}=t,{month:n,day:o}=Go(e,i);return{year:e,month:n,day:o,...Li(t)}}function Qo(t){const e=hi(t.year),i=pi(t.month,1,12),n=pi(t.day,1,xi(t.year,t.month));return e?i?!n&&jo("day",t.day):jo("month",t.month):jo("year",t.year)}function ts(t){const{hour:e,minute:i,second:n,millisecond:o}=t,s=pi(e,0,23)||24===e&&0===i&&0===n&&0===o,r=pi(i,0,59),a=pi(n,0,59),l=pi(o,0,999);return s?r?a?!l&&jo("millisecond",o):jo("second",n):jo("minute",i):jo("hour",e)}const es="Invalid DateTime",is=864e13;function ns(t){return new Gi("unsupported zone",`the zone "${t.name}" is not supported`)}function os(t){return null===t.weekData&&(t.weekData=Ko(t.c)),t.weekData}function ss(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Ss({...i,...e,old:i})}function rs(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const s=i.offset(n);return o===s?[n,o]:[t-60*Math.min(o,s)*1e3,Math.max(o,s)]}function as(t,e){const i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function ls(t,e,i){return rs(wi(t),e,i)}function hs(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:n,month:o,day:Math.min(t.c.day,xi(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=xo.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=wi(s);let[l,h]=rs(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function cs(t,e,i,n,o,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=Ss.fromObject(t,{...i,zone:n,specificOffset:s});return r?o:o.setZone(a)}return Ss.invalid(new Gi("unparsable",`the input "${o}" can't be parsed as ${n}`))}function ds(t,e,i=!0){return t.isValid?Wi.create(Sn.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function us(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=mi(t.c.year,i?6:4),e?(n+="-",n+=mi(t.c.month),n+="-",n+=mi(t.c.day)):(n+=mi(t.c.month),n+=mi(t.c.day)),n}function ps(t,e,i,n,o,s){let r=mi(t.c.hour);return e?(r+=":",r+=mi(t.c.minute),0===t.c.second&&i||(r+=":")):r+=mi(t.c.minute),0===t.c.second&&i||(r+=mi(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=mi(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=mi(Math.trunc(-t.o/60)),r+=":",r+=mi(Math.trunc(-t.o%60))):(r+="+",r+=mi(Math.trunc(t.o/60)),r+=":",r+=mi(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const ms={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},fs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},gs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},vs=["year","month","day","hour","minute","second","millisecond"],ys=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bs=["year","ordinal","hour","minute","second","millisecond"];function _s(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new ze(t);return e}function xs(t,e){const i=rn(e.zone,pn.defaultZone),n=Sn.fromObject(e),o=pn.now();let s,r;if(ai(t.year))s=o;else{for(const e of vs)ai(t[e])&&(t[e]=ms[e]);const e=Qo(t)||ts(t);if(e)return Ss.invalid(e);const n=i.offset(o);[s,r]=ls(t,n,i)}return new Ss({ts:s,zone:i,loc:n,o:r})}function ws(t,e,i){const n=!!ai(i.round)||i.round,o=(t,o)=>{t=yi(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},s=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function ks(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class Ss{constructor(t){const e=t.zone||pn.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Gi("invalid input"):null)||(e.isValid?null:ns(e));this.ts=ai(t.ts)?pn.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=as(this.ts,t),i=Number.isNaN(n.year)?new Gi("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||Sn.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new Ss({})}static local(){const[t,e]=ks(arguments),[i,n,o,s,r,a,l]=e;return xs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=ks(arguments),[i,n,o,s,r,a,l]=e;return t.zone=on.utcInstance,xs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return Ss.invalid("invalid input");const n=rn(e.zone,pn.defaultZone);return n.isValid?new Ss({ts:i,zone:n,loc:Sn.fromObject(e)}):Ss.invalid(ns(n))}static fromMillis(t,e={}){if(li(t))return t<-is||t>is?Ss.invalid("Timestamp out of range"):new Ss({ts:t,zone:rn(e.zone,pn.defaultZone),loc:Sn.fromObject(e)});throw new Pe(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(li(t))return new Ss({ts:1e3*t,zone:rn(e.zone,pn.defaultZone),loc:Sn.fromObject(e)});throw new Pe("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=rn(e.zone,pn.defaultZone);if(!i.isValid)return Ss.invalid(ns(i));const n=pn.now(),o=ai(e.specificOffset)?i.offset(n):e.specificOffset,s=$i(t,_s),r=!ai(s.ordinal),a=!ai(s.year),l=!ai(s.month)||!ai(s.day),h=a||l,c=s.weekYear||s.weekNumber,d=Sn.fromObject(e);if((h||r)&&c)throw new Oe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new Oe("Can't mix ordinal dates with month/day");const u=c||s.weekday&&!h;let p,m,f=as(n,o);u?(p=ys,m=fs,f=Ko(f)):r?(p=bs,m=gs,f=Jo(f)):(p=vs,m=ms);let g=!1;for(const t of p){ai(s[t])?s[t]=g?m[t]:f[t]:g=!0}const v=u?function(t){const e=hi(t.weekYear),i=pi(t.weekNumber,1,ki(t.weekYear)),n=pi(t.weekday,1,7);return e?i?!n&&jo("weekday",t.weekday):jo("week",t.week):jo("weekYear",t.weekYear)}(s):r?function(t){const e=hi(t.year),i=pi(t.ordinal,1,_i(t.year));return e?!i&&jo("ordinal",t.ordinal):jo("year",t.year)}(s):Qo(s),y=v||ts(s);if(y)return Ss.invalid(y);const b=u?Yo(s):r?Xo(s):s,[_,x]=ls(b,o,i),w=new Ss({ts:_,zone:i,o:x,loc:d});return s.weekday&&h&&t.weekday!==w.weekday?Ss.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return Tn(t,[Qn,no],[to,oo],[eo,so],[io,ro])}(t);return cs(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return Tn(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Hn,Wn])}(t);return cs(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return Tn(t,[Gn,Jn],[Kn,Jn],[Yn,Xn])}(t);return cs(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(ai(t)||ai(e))throw new Pe("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,s=Sn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:n,zone:o,specificOffset:s,invalidReason:r}=Fo(t,e,i);return[n,o,s,r]}(s,t,e);return h?Ss.invalid(h):cs(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return Ss.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return Tn(t,[lo,no],[ho,co])}(t);return cs(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Pe("need to specify a reason the DateTime is invalid");const i=t instanceof Gi?t:new Gi(t,e);if(pn.throwOnInvalid)throw new Ae(i);return new Ss({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?os(this).weekYear:NaN}get weekNumber(){return this.isValid?os(this).weekNumber:NaN}get weekday(){return this.isValid?os(this).weekday:NaN}get ordinal(){return this.isValid?Jo(this.c).ordinal:NaN}get monthShort(){return this.isValid?So.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?So.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?So.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?So.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return bi(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?_i(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=Wi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(on.instance(t),e)}toLocal(){return this.setZone(pn.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=rn(t,pn.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=ls(i,e,t)}return ss(this,{ts:n,zone:t})}return Ss.invalid(ns(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return ss(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=$i(t,_s),i=!ai(e.weekYear)||!ai(e.weekNumber)||!ai(e.weekday),n=!ai(e.ordinal),o=!ai(e.year),s=!ai(e.month)||!ai(e.day),r=o||s,a=e.weekYear||e.weekNumber;if((r||n)&&a)throw new Oe("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new Oe("Can't mix ordinal dates with month/day");let l;i?l=Yo({...Ko(this.c),...e}):ai(e.ordinal)?(l={...this.toObject(),...e},ai(e.day)&&(l.day=Math.min(xi(l.year,l.month),l.day))):l=Xo({...Jo(this.c),...e});const[h,c]=ls(l,this.o,this.zone);return ss(this,{ts:h,o:c})}plus(t){if(!this.isValid)return this;return ss(this,hs(this,xo.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return ss(this,hs(this,xo.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=xo.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?Wi.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):es}toLocaleString(t=Be,e={}){return this.isValid?Wi.create(this.loc.clone(e),t).formatDateTime(this):es}toLocaleParts(t={}){return this.isValid?Wi.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=us(this,s);return r+="T",r+=ps(this,s,e,i,n,o),r}toISODate({format:t="extended"}={}){return this.isValid?us(this,"extended"===t):null}toISOWeekDate(){return ds(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+ps(this,"extended"===s,e,t,i,o)}toRFC2822(){return ds(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ds(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?us(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),ds(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():es}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",i={}){if(!this.isValid||!t.isValid)return xo.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(xo.normalizeUnit),s=t.valueOf()>this.valueOf(),r=Eo(s?this:t,s?t:this,o,n);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(Ss.now(),t,e)}until(t){return this.isValid?ko.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||Ss.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),ws(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?ws(t.base||Ss.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ss.isDateTime))throw new Pe("min requires all arguments be DateTimes");return di(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Ss.isDateTime))throw new Pe("max requires all arguments be DateTimes");return di(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return Fo(Sn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return Ss.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Be}static get DATE_MED(){return qe}static get DATE_MED_WITH_WEEKDAY(){return Ze}static get DATE_FULL(){return Fe}static get DATE_HUGE(){return Ue}static get TIME_SIMPLE(){return Ve}static get TIME_WITH_SECONDS(){return je}static get TIME_WITH_SHORT_OFFSET(){return He}static get TIME_WITH_LONG_OFFSET(){return We}static get TIME_24_SIMPLE(){return Ge}static get TIME_24_WITH_SECONDS(){return Ke}static get TIME_24_WITH_SHORT_OFFSET(){return Ye}static get TIME_24_WITH_LONG_OFFSET(){return Je}static get DATETIME_SHORT(){return Xe}static get DATETIME_SHORT_WITH_SECONDS(){return Qe}static get DATETIME_MED(){return ti}static get DATETIME_MED_WITH_SECONDS(){return ei}static get DATETIME_MED_WITH_WEEKDAY(){return ii}static get DATETIME_FULL(){return ni}static get DATETIME_FULL_WITH_SECONDS(){return oi}static get DATETIME_HUGE(){return si}static get DATETIME_HUGE_WITH_SECONDS(){return ri}}function Cs(t){if(Ss.isDateTime(t))return t;if(t&&t.valueOf&&li(t.valueOf()))return Ss.fromJSDate(t);if(t&&"object"==typeof t)return Ss.fromObject(t);throw new Pe(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class Es extends nt{constructor(){super(...arguments),this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.languages={},this.featuredFields=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
|
|
481
481
|
:host {
|
|
482
482
|
position: fixed;
|
|
483
483
|
z-index: 1000;
|
|
@@ -661,7 +661,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
661
661
|
style="margin-right:0.5em; fill: var(--color-text-dark);"
|
|
662
662
|
></temba-icon>`:null}
|
|
663
663
|
<div style="flex-grow:1">${t.prefix}${this.getName(t)}</div>
|
|
664
|
-
</div>`}renderOptionDetailDefault(t){return D` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(_t.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(_t.Canceled))}handleInnerScroll(t){const e=t.target;if(e.scrollHeight>this.scrollHeight&&(this.scrollHeight=e.scrollHeight,this.triggerScroll=!0),this.triggerScroll){100*(e.scrollTop/(e.scrollHeight-e.clientHeight))>this.scrollPct&&(this.fireCustomEvent(_t.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={
|
|
664
|
+
</div>`}renderOptionDetailDefault(t){return D` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(_t.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(_t.Canceled))}handleInnerScroll(t){const e=t.target;if(e.scrollHeight>this.scrollHeight&&(this.scrollHeight=e.scrollHeight,this.triggerScroll=!0),this.triggerScroll){100*(e.scrollTop/(e.scrollHeight-e.clientHeight))>this.scrollPct&&(this.fireCustomEvent(_t.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={"margin-left":`${this.marginHorizontal}px`,"margin-top":`${t}px`};this.top&&(e.top=`${this.top}px`),this.left&&(e.left=`${this.left}px`);const i={};this.width&&(i.width=`${this.width}px`);const n=ie({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),o=ie({options:!0});let s=this.options||[];return 0==s.length&&this.tempOptions&&this.tempOptions.length>0&&(s=this.tempOptions),D`
|
|
665
665
|
<div class=${n} style=${ft(e)}>
|
|
666
666
|
<div
|
|
667
667
|
class="options-scroll"
|
|
@@ -705,7 +705,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
705
705
|
<div style="${e?"font-weight: 400":""}">${t.name}</div>
|
|
706
706
|
${e?D` <div style="font-size: 85%">${t.summary}</div> `:null}
|
|
707
707
|
</div>
|
|
708
|
-
`},ca=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,da=(t,e,i={},n)=>{const o=(e||"").split(".");let s=n?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)s=n.properties,r+=a+".";else{if(!n||!n.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=n.property_template;s=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return s.map((t=>({name:"__default__"===t.key?r.substr(0,r.length-1):r+t.key,summary:t.help})))},ua=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),s=getComputedStyle(t);for(const t of s)o.style[t]=s[t];o.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:h,offsetTop:c}=l;return document.body.removeChild(o),{left:i+h,top:n+c}},pa=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,s=t.substr(0,i),r=t.substr(i+o),a=s.length+n.length;e.value=s+n+r,e.setSelectionRange(a,a);const l=ua(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},ma=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!e)return n;const o=t.selectionStart,s=t.value.substring(0,o),r=i?aa:ra,a=r.findExpressions(s).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=r.functionContext(a.text);if(t){const i=ca(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let s=a.text.length;s>=0;s--){const r=a.text[s];if("@"===r||"("===r||" "===r||","===r||")"===r||0===s){"("!==r&&" "!==r&&","!==r&&")"!==r&&"@"!==r||s++;const l=ua(t,a.start+s);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(s,a.text.length-s),n.options=[...da(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?ca(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class fa extends lt{constructor(){super(...arguments),this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.getName=t=>t[this.nameKey||"name"],this.isMatch=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>D``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=Te(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return r`
|
|
708
|
+
`},ca=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,da=(t,e,i={},n)=>{const o=(e||"").split(".");let s=n?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)s=n.properties,r+=a+".";else{if(!n||!n.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=n.property_template;s=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return s.map((t=>({name:"__default__"===t.key?r.substr(0,r.length-1):r+t.key,summary:t.help})))},ua=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),s=getComputedStyle(t);for(const t of s)o.style[t]=s[t];o.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:h,offsetTop:c}=l;return document.body.removeChild(o),{left:i+h,top:n+c}},pa=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,s=t.substr(0,i),r=t.substr(i+o),a=s.length+n.length;e.value=s+n+r,e.setSelectionRange(a,a);const l=ua(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},ma=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!t)return;if(!e)return n;const o=t.selectionStart,s=t.value.substring(0,o),r=i?aa:ra,a=r.findExpressions(s).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=r.functionContext(a.text);if(t){const i=ca(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let s=a.text.length;s>=0;s--){const r=a.text[s];if("@"===r||"("===r||" "===r||","===r||")"===r||0===s){"("!==r&&" "!==r&&","!==r&&")"!==r&&"@"!==r||s++;const l=ua(t,a.start+s);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(s,a.text.length-s),n.options=[...da(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?ca(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class fa extends lt{constructor(){super(...arguments),this.multi=!1,this.searchOnFocus=!1,this.placeholder="",this.name="",this.nameKey="name",this.valueKey="value",this.queryParam=null,this.input="",this.visibleOptions=[],this.completionOptions=[],this.quietMillis=0,this.searchable=!1,this.cache=!0,this.cacheKey="",this.focused=!1,this.disabled=!1,this.selectedIndex=-1,this.anchorPosition={left:0,top:0},this.tags=!1,this.flavor="default",this.infoText="",this.getName=t=>t[this.nameKey||"name"],this.isMatch=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>D``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=Te(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return r`
|
|
709
709
|
:host {
|
|
710
710
|
font-family: var(--font-family);
|
|
711
711
|
transition: all ease-in-out var(--transition-speed);
|
|
@@ -1194,7 +1194,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1194
1194
|
padding: 1px 5px;
|
|
1195
1195
|
border-radius: var(--curvature);
|
|
1196
1196
|
}
|
|
1197
|
-
`}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store")
|
|
1197
|
+
`}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store");if(!t.inputElement)return;const i=ma(t.inputElement,e,this.session);this.query=i.query,this.options=i.options,this.anchorPosition=i.anchorPosition}handleClick(t){this.executeQuery(t.currentTarget)}updated(t){super.updated(t),t.has("value")&&this.hiddenElement.setAttribute("value",this.value)}handleInput(t){const e=t.currentTarget;this.executeQuery(e),this.value=e.inputElement.value,this.fireEvent("change")}handleOptionCanceled(){window.setTimeout((()=>{this.options=[],this.query=""}),100)}handleOptionSelection(t){const e=t.detail.selected,i=t.detail.tabbed;pa(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}render(){const t=this.anchorPosition?{top:`${this.anchorPosition.top}px`,left:`${this.anchorPosition.left}px`}:{};return D`
|
|
1198
1198
|
<temba-field
|
|
1199
1199
|
name=${this.name}
|
|
1200
1200
|
.label=${this.label}
|
|
@@ -1512,6 +1512,12 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1512
1512
|
font-weight: 400;
|
|
1513
1513
|
}
|
|
1514
1514
|
|
|
1515
|
+
.small {
|
|
1516
|
+
font-size: 0.8em;
|
|
1517
|
+
--button-y: 0px;
|
|
1518
|
+
--button-x: 0.5em;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1515
1521
|
.v-2.button-container {
|
|
1516
1522
|
background: var(--button-bg);
|
|
1517
1523
|
background-image: var(--button-bg-img);
|
|
@@ -1645,7 +1651,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1645
1651
|
<div
|
|
1646
1652
|
class="button-container
|
|
1647
1653
|
v-${this.v}
|
|
1648
|
-
${ie({"primary-button":this.primary||!this.primary&&!this.secondary&&!this.attention&&1==this.v,"secondary-button":this.secondary,"disabled-button":this.disabled,"active-button":this.active,"attention-button":this.attention,"destructive-button":this.destructive,"light-button":this.light})}"
|
|
1654
|
+
${ie({"primary-button":this.primary||!this.primary&&!this.secondary&&!this.attention&&1==this.v,"secondary-button":this.secondary,"disabled-button":this.disabled,"active-button":this.active,"attention-button":this.attention,"destructive-button":this.destructive,"light-button":this.light,small:this.small})}"
|
|
1649
1655
|
tabindex="0"
|
|
1650
1656
|
@mousedown=${this.handleMouseDown}
|
|
1651
1657
|
@mouseup=${this.handleMouseUp}
|
|
@@ -1657,7 +1663,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1657
1663
|
<div class="button-name">${t}</div>
|
|
1658
1664
|
</div>
|
|
1659
1665
|
</div>
|
|
1660
|
-
`}}t([st({type:Boolean})],ba.prototype,"primary",void 0),t([st({type:Boolean})],ba.prototype,"secondary",void 0),t([st({type:Boolean})],ba.prototype,"attention",void 0),t([st({type:Number})],ba.prototype,"v",void 0),t([st({type:Boolean})],ba.prototype,"destructive",void 0),t([st({type:Boolean})],ba.prototype,"light",void 0),t([st()],ba.prototype,"name",void 0),t([st({type:Boolean})],ba.prototype,"disabled",void 0),t([st({type:Boolean})],ba.prototype,"submitting",void 0),t([st({type:Boolean})],ba.prototype,"active",void 0),t([st({type:String})],ba.prototype,"href",void 0);class _a extends et{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return r`
|
|
1666
|
+
`}}t([st({type:Boolean})],ba.prototype,"primary",void 0),t([st({type:Boolean})],ba.prototype,"secondary",void 0),t([st({type:Boolean})],ba.prototype,"attention",void 0),t([st({type:Number})],ba.prototype,"v",void 0),t([st({type:Boolean})],ba.prototype,"destructive",void 0),t([st({type:Boolean})],ba.prototype,"light",void 0),t([st()],ba.prototype,"name",void 0),t([st({type:Boolean})],ba.prototype,"disabled",void 0),t([st({type:Boolean})],ba.prototype,"submitting",void 0),t([st({type:Boolean})],ba.prototype,"active",void 0),t([st({type:Boolean})],ba.prototype,"small",void 0),t([st({type:String})],ba.prototype,"href",void 0);class _a extends et{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return r`
|
|
1661
1667
|
:host {
|
|
1662
1668
|
font-family: var(--font-family);
|
|
1663
1669
|
}
|
|
@@ -1890,7 +1896,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1890
1896
|
</div>`:null;return D`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?D`<div class="segments">
|
|
1891
1897
|
/ ${this.segments}${t?D`+`:null}
|
|
1892
1898
|
<div></div>
|
|
1893
|
-
</div>`:null}</div> ${n}</div></div>`}}t([st({type:String})],La.prototype,"text",void 0),t([st({type:Number})],La.prototype,"count",void 0),t([st({type:Number,attribute:!1})],La.prototype,"segments",void 0),t([st({type:Object,attribute:!1})],La.prototype,"extended",void 0);class Ma extends nt{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{t.detail.url===this.url
|
|
1899
|
+
</div>`:null}</div> ${n}</div></div>`}}t([st({type:String})],La.prototype,"text",void 0),t([st({type:Number})],La.prototype,"count",void 0),t([st({type:Number,attribute:!1})],La.prototype,"segments",void 0),t([st({type:Object,attribute:!1})],La.prototype,"extended",void 0);class Ma extends nt{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent(_t.Refreshed,{data:t.detail.data,previous:e})}}))}updated(t){super.updated(t),t.has("url")&&(this.url?this.store.makeRequest(this.url,{prepareData:this.prepareData}):this.data=null)}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.prepareData=this.prepareData.bind(this),this.store&&this.store.addEventListener(_t.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(_t.StoreUpdated,this.handleStoreUpdated)}render(){if(!this.store.ready&&this.showLoading)return D`<temba-loading></temba-loading>`}}t([st({type:String})],Ma.prototype,"url",void 0),t([st({type:Boolean})],Ma.prototype,"showLoading",void 0),t([st({type:Object,attribute:!1})],Ma.prototype,"data",void 0);class Oa extends Ma{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}setContact(t){this.data=this.prepareData([t]),this.store.updateCache(`${this.endpoint}${this.contact}`,this.data)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([st({type:String})],Oa.prototype,"contact",void 0),t([st({type:Object,attribute:!1})],Oa.prototype,"data",void 0),t([st({type:String})],Oa.prototype,"endpoint",void 0);class za extends Oa{static get styles(){return r`
|
|
1894
1900
|
.left-pane {
|
|
1895
1901
|
box-shadow: -13px 10px 7px 14px rgba(0, 0, 0, 0);
|
|
1896
1902
|
transition: box-shadow 600ms linear;
|
|
@@ -1914,6 +1920,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1914
1920
|
flex-direction: column;
|
|
1915
1921
|
overflow: hidden;
|
|
1916
1922
|
min-height: 0;
|
|
1923
|
+
border-radius: var(--curvature);
|
|
1917
1924
|
}
|
|
1918
1925
|
|
|
1919
1926
|
temba-contact-history {
|
|
@@ -1961,73 +1968,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
1961
1968
|
--button-x: 12px;
|
|
1962
1969
|
}
|
|
1963
1970
|
|
|
1964
|
-
.toolbar {
|
|
1965
|
-
position: relative;
|
|
1966
|
-
width: 2.5em;
|
|
1967
|
-
background: #e6e6e6;
|
|
1968
|
-
transition: all 600ms ease-in;
|
|
1969
|
-
z-index: 10;
|
|
1970
|
-
flex-shrink: 0;
|
|
1971
|
-
border-top-right-radius: var(--curvature);
|
|
1972
|
-
border-bottom-right-radius: var(--curvature);
|
|
1973
|
-
padding: 0.5em 0;
|
|
1974
|
-
display: flex;
|
|
1975
|
-
flex-direction: column;
|
|
1976
|
-
align-items: center;
|
|
1977
|
-
overflow: hidden;
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
.toolbar temba-icon {
|
|
1981
|
-
fill: rgb(60, 60, 60);
|
|
1982
|
-
margin-bottom: 0.5em;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
.toolbar.closed {
|
|
1986
|
-
box-shadow: inset 10px 0px 10px -11px rgb(0 0 0 / 15%);
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
temba-contact-details {
|
|
1990
|
-
flex-basis: 16em;
|
|
1991
|
-
flex-grow: 0;
|
|
1992
|
-
flex-shrink: 0;
|
|
1993
|
-
transition: margin 600ms cubic-bezier(0.68, -0.55, 0.265, 1.05),
|
|
1994
|
-
opacity 600ms ease-in-out 200ms;
|
|
1995
|
-
z-index: 5;
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
temba-contact-details.hidden {
|
|
1999
|
-
margin-right: -16em;
|
|
2000
|
-
opacity: 0;
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
@media only screen and (max-width: 768px) {
|
|
2004
|
-
temba-contact-details {
|
|
2005
|
-
flex-basis: 12em;
|
|
2006
|
-
flex-shrink: 0;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
temba-contact-details.hidden {
|
|
2010
|
-
margin-right: -12em;
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
#close-button,
|
|
2015
|
-
#open-button {
|
|
2016
|
-
margin-top: 1em;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
#details-button {
|
|
2020
|
-
margin-top: 0.25em;
|
|
2021
|
-
transform: rotate(180deg);
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
#note-dialog,
|
|
2025
|
-
#assign-dialog {
|
|
2026
|
-
--header-bg: rgb(255, 249, 194);
|
|
2027
|
-
--header-text: #555;
|
|
2028
|
-
--textarea-height: 5em;
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
1971
|
temba-completion {
|
|
2032
1972
|
--widget-box-shadow: none;
|
|
2033
1973
|
--color-widget-border: transparent;
|
|
@@ -2035,29 +1975,19 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2035
1975
|
--color-focus: transparent;
|
|
2036
1976
|
--color-widget-bg-focused: transparent;
|
|
2037
1977
|
}
|
|
2038
|
-
`}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.
|
|
1978
|
+
`}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.monitor=!1,this.currentTicket=null,this.currentContact=null,this.agent="",this.refreshInterval=null,this.showDetails=xe(we.TICKET_SHOW_DETAILS)}connectedCallback(){super.connectedCallback(),this.monitor&&(this.refreshInterval=setInterval((()=>{this.currentTicket&&this.currentTicket.closed_on||this.refresh()}),1e4))}disconnectedCallback(){this.refreshInterval&&clearInterval(this.refreshInterval)}getContactHistory(){return this.shadowRoot.querySelector("temba-contact-history")}refresh(t=!1){const e=this.getContactHistory();e&&(t&&e.scrollToBottom(),e.refresh())}updated(t){super.updated(t),(t.has("data")||t.has("currentContact"))&&(this.currentContact=this.data)}handleSend(t){const e=t.detail.name;if("Send"===e){const i={contact:this.currentContact.uuid},n=t.currentTarget;if(n){const t=n.currentText;t&&t.length>0&&(i.text=t);const e=n.currentAttachments;if(e&&e.length>0){const t=e.map((t=>t.uuid));i.attachments=t}}this.currentTicket&&(i.ticket=this.currentTicket.uuid);const o=e+" failed, please try again.";le("/api/v2/messages.json",i).then((t=>{t.status<400?(n.reset(),this.refresh(!0)):t.status<500?t.json.text&&t.json.text.eng&&t.json.text.eng.length>0?n.buttonError="Text must have no more than 640 characters.":t.json.attachments&&t.json.attachments.eng&&t.json.attachments.eng.length>0?n.buttonError="Attachments must have no more than 10 files.":n.buttonError=o:n.buttonError=o})).catch((t=>{console.error(t),n.buttonError=o}))}}render(){const t=this.currentContact?this.getTembaContactHistory():null,e=this.currentContact?this.getTembaChatbox():null,i=D`<div
|
|
2039
1979
|
style="flex-grow: 1; margin-right: 0em; display:flex; flex-direction:row; min-height: 0;"
|
|
2040
1980
|
class="left-pane ${this.showDetails?"open":""}"
|
|
2041
1981
|
>
|
|
2042
1982
|
<div class="chat-wrapper">${t} ${e}</div>
|
|
2043
|
-
</div>`;
|
|
2044
|
-
<div class="toolbar ${this.showDetails?"":"closed"}">
|
|
2045
|
-
${e} ${n}
|
|
2046
|
-
</div>
|
|
2047
|
-
${o}`;return D`${i} ${s}`}return D`${i}`}getTembaContactHistory(){return D` <temba-contact-history
|
|
1983
|
+
</div>`;return D`${i}`}getTembaContactHistory(){return D` <temba-contact-history
|
|
2048
1984
|
.uuid=${this.currentContact.uuid}
|
|
2049
1985
|
.contact=${this.currentContact}
|
|
2050
1986
|
.ticket=${this.currentTicket?this.currentTicket.uuid:null}
|
|
2051
1987
|
.endDate=${this.currentTicket?this.currentTicket.closed_on:null}
|
|
2052
1988
|
.agent=${this.agent}
|
|
2053
1989
|
>
|
|
2054
|
-
</temba-contact-history>`}getTembaChatbox(){return this.currentTicket?this.currentContact&&"active"!==this.currentContact.status?null:this.
|
|
2055
|
-
<temba-button
|
|
2056
|
-
id="reopen-button"
|
|
2057
|
-
name="Reopen"
|
|
2058
|
-
@click=${this.handleTicketReopen}
|
|
2059
|
-
></temba-button>
|
|
2060
|
-
</div>`:this.getChatbox():this.currentContact&&"active"!==this.currentContact.status?null:this.getChatbox()}getChatbox(){return D` <div class="chatbox ${this.toolbar?"full":""}">
|
|
1990
|
+
</temba-contact-history>`}getTembaChatbox(){return this.currentTicket?this.currentContact&&"active"!==this.currentContact.status||this.currentTicket.closed_on?null:this.getChatbox():this.currentContact&&"active"!==this.currentContact.status?null:this.getChatbox()}getChatbox(){return D`<div class="chatbox">
|
|
2061
1991
|
<temba-compose
|
|
2062
1992
|
chatbox
|
|
2063
1993
|
attachments
|
|
@@ -2066,60 +1996,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2066
1996
|
@temba-button-clicked=${this.handleSend.bind(this)}
|
|
2067
1997
|
>
|
|
2068
1998
|
</temba-compose>
|
|
2069
|
-
</div>`}
|
|
2070
|
-
style="z-index: 10"
|
|
2071
|
-
class="${this.showDetails?"":"hidden"}"
|
|
2072
|
-
showGroups="true"
|
|
2073
|
-
.visible=${this.showDetails}
|
|
2074
|
-
.ticket=${this.currentTicket}
|
|
2075
|
-
.contact=${this.currentContact}
|
|
2076
|
-
>
|
|
2077
|
-
</temba-contact-details>`}getToggleDetailsTembaTip(){return D` <temba-tip
|
|
2078
|
-
style="margin-top:5px"
|
|
2079
|
-
text="${this.showDetails?"Hide Details":"Show Details"}"
|
|
2080
|
-
position="left"
|
|
2081
|
-
hideOnChange
|
|
2082
|
-
>
|
|
2083
|
-
<temba-icon
|
|
2084
|
-
id="details-button"
|
|
2085
|
-
name="${this.showDetails?at.menu_collapse:"layout-left"}"
|
|
2086
|
-
@click="${this.handleDetailSlider}"
|
|
2087
|
-
clickable
|
|
2088
|
-
animatechange="spin"
|
|
2089
|
-
></temba-icon>
|
|
2090
|
-
</temba-tip>`}getAddNoteAndAssignTicketTembaTips(){return D` <temba-tip
|
|
2091
|
-
style="margin-top:5px"
|
|
2092
|
-
text="Assign"
|
|
2093
|
-
position="left"
|
|
2094
|
-
>
|
|
2095
|
-
<temba-icon
|
|
2096
|
-
id="assign-button"
|
|
2097
|
-
name="${at.users}"
|
|
2098
|
-
@click="${()=>{this.shadowRoot.getElementById("assign-dialog").open=!0}}"
|
|
2099
|
-
clickable
|
|
2100
|
-
></temba-icon>
|
|
2101
|
-
</temba-tip>
|
|
2102
|
-
<temba-tip style="margin-top:5px" text="Add Note" position="left">
|
|
2103
|
-
<temba-icon
|
|
2104
|
-
id="add-note-button"
|
|
2105
|
-
name="${at.add_note}"
|
|
2106
|
-
@click="${()=>{this.shadowRoot.getElementById("note-dialog").open=!0}}"
|
|
2107
|
-
clickable
|
|
2108
|
-
></temba-icon>
|
|
2109
|
-
</temba-tip>`}getAddNoteAndAssignTicketTembaModaxes(){return D` <temba-modax
|
|
2110
|
-
header="Add Note"
|
|
2111
|
-
id="note-dialog"
|
|
2112
|
-
@temba-submitted=${this.refresh}
|
|
2113
|
-
endpoint="/ticket/note/${this.currentTicket.uuid}/"
|
|
2114
|
-
>
|
|
2115
|
-
</temba-modax>
|
|
2116
|
-
<temba-modax
|
|
2117
|
-
header="Assign Ticket"
|
|
2118
|
-
id="assign-dialog"
|
|
2119
|
-
@temba-submitted=${this.handleTicketAssigned}
|
|
2120
|
-
endpoint="/ticket/assign/${this.currentTicket.uuid}/"
|
|
2121
|
-
>
|
|
2122
|
-
</temba-modax>`}}t([st({type:String,attribute:"ticket"})],za.prototype,"ticketUUID",void 0),t([st({type:String})],za.prototype,"contactsEndpoint",void 0),t([st({type:String})],za.prototype,"currentNote",void 0),t([st({type:Boolean})],za.prototype,"showDetails",void 0),t([st({type:Boolean})],za.prototype,"toolbar",void 0),t([st({type:Boolean})],za.prototype,"monitor",void 0),t([st({type:Object})],za.prototype,"currentTicket",void 0),t([st({type:Object})],za.prototype,"currentContact",void 0),t([st({type:String})],za.prototype,"agent",void 0);let Pa=[];const Ia=(t,e,i,n,o)=>(t&&(Pa.forEach((t=>{t.abort()})),Pa=[]),new Promise((t=>{const s=new AbortController;Pa.push(s);let r=e;n&&(r+=`&before=${n}`),o&&(r+=`&after=${o}`),i&&(r+=`&ticket=${i}`),ee(r,s).then((e=>{Pa=Pa.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),Da=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var Na;!function(t){t.MESSAGE_CREATED="msg_created",t.MESSAGE_RECEIVED="msg_received",t.BROADCAST_CREATED="broadcast_created",t.IVR_CREATED="ivr_created",t.FLOW_ENTERED="flow_entered",t.FLOW_EXITED="flow_exited",t.RUN_RESULT_CHANGED="run_result_changed",t.CONTACT_FIELD_CHANGED="contact_field_changed",t.CONTACT_GROUPS_CHANGED="contact_groups_changed",t.CONTACT_NAME_CHANGED="contact_name_changed",t.CONTACT_URNS_CHANGED="contact_urns_changed",t.CAMPAIGN_FIRED="campaign_fired",t.CHANNEL_EVENT="channel_event",t.CONTACT_LANGUAGE_CHANGED="contact_language_changed",t.WEBHOOK_CALLED="webhook_called",t.AIRTIME_TRANSFERRED="airtime_transferred",t.CALL_STARTED="call_started",t.EMAIL_SENT="email_sent",t.INPUT_LABELS_ADDED="input_labels_added",t.NOTE_CREATED="note_created",t.TICKET_ASSIGNED="ticket_assigned",t.TICKET_NOTE_ADDED="ticket_note_added",t.TICKET_CLOSED="ticket_closed",t.TICKET_OPENED="ticket_opened",t.TICKET_REOPENED="ticket_reopened",t.ERROR="error",t.FAILURE="failure"}(Na||(Na={}));const Ra=(t,e)=>{if(!t)return"messages";switch(t.type){case Na.TICKET_ASSIGNED:case Na.TICKET_NOTE_ADDED:case Na.TICKET_OPENED:case Na.TICKET_CLOSED:case Na.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case Na.FLOW_ENTERED:case Na.FLOW_EXITED:return"flows";case Na.BROADCAST_CREATED:case Na.MESSAGE_CREATED:case Na.MESSAGE_RECEIVED:case Na.IVR_CREATED:return"messages"}return"verbose"},Ba=t=>D`<div style="width:3.5em;font-size:0.8em">
|
|
1999
|
+
</div>`}}t([st({type:String,attribute:"ticket"})],za.prototype,"ticketUUID",void 0),t([st({type:String})],za.prototype,"contactsEndpoint",void 0),t([st({type:String})],za.prototype,"currentNote",void 0),t([st({type:Boolean})],za.prototype,"showDetails",void 0),t([st({type:Boolean})],za.prototype,"monitor",void 0),t([st({type:Object})],za.prototype,"currentTicket",void 0),t([st({type:Object})],za.prototype,"currentContact",void 0),t([st({type:String})],za.prototype,"agent",void 0);let Pa=[];const Ia=(t,e,i,n,o)=>(t&&(Pa.forEach((t=>{t.abort()})),Pa=[]),new Promise((t=>{const s=new AbortController;Pa.push(s);let r=e;n&&(r+=`&before=${n}`),o&&(r+=`&after=${o}`),i&&(r+=`&ticket=${i}`),ee(r,s).then((e=>{Pa=Pa.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),Da=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var Na;!function(t){t.MESSAGE_CREATED="msg_created",t.MESSAGE_RECEIVED="msg_received",t.BROADCAST_CREATED="broadcast_created",t.IVR_CREATED="ivr_created",t.FLOW_ENTERED="flow_entered",t.FLOW_EXITED="flow_exited",t.RUN_RESULT_CHANGED="run_result_changed",t.CONTACT_FIELD_CHANGED="contact_field_changed",t.CONTACT_GROUPS_CHANGED="contact_groups_changed",t.CONTACT_NAME_CHANGED="contact_name_changed",t.CONTACT_URNS_CHANGED="contact_urns_changed",t.CAMPAIGN_FIRED="campaign_fired",t.CHANNEL_EVENT="channel_event",t.CONTACT_LANGUAGE_CHANGED="contact_language_changed",t.WEBHOOK_CALLED="webhook_called",t.AIRTIME_TRANSFERRED="airtime_transferred",t.CALL_STARTED="call_started",t.EMAIL_SENT="email_sent",t.INPUT_LABELS_ADDED="input_labels_added",t.NOTE_CREATED="note_created",t.TICKET_ASSIGNED="ticket_assigned",t.TICKET_NOTE_ADDED="ticket_note_added",t.TICKET_CLOSED="ticket_closed",t.TICKET_OPENED="ticket_opened",t.TICKET_REOPENED="ticket_reopened",t.ERROR="error",t.FAILURE="failure"}(Na||(Na={}));const Ra=(t,e)=>{if(!t)return"messages";switch(t.type){case Na.TICKET_ASSIGNED:case Na.TICKET_OPENED:case Na.TICKET_CLOSED:case Na.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case Na.FLOW_ENTERED:case Na.FLOW_EXITED:return"flows";case Na.BROADCAST_CREATED:case Na.MESSAGE_CREATED:case Na.MESSAGE_RECEIVED:case Na.IVR_CREATED:case Na.TICKET_NOTE_ADDED:case Na.NOTE_CREATED:return"messages"}return"verbose"},Ba=t=>D`<div style="width:3.5em;font-size:0.8em">
|
|
2123
2000
|
${Ce({user:t,position:"left"})}
|
|
2124
2001
|
</div>`,qa=(t,e)=>{const i=t.type===Na.MESSAGE_RECEIVED,n="E"===t.status,o="F"===t.status,s=[];return t.logs_url?s.push(D` <div class="icon-link">
|
|
2125
2002
|
<temba-icon
|
|
@@ -2198,23 +2075,23 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2198
2075
|
</div>
|
|
2199
2076
|
</div>
|
|
2200
2077
|
|
|
2201
|
-
${i?
|
|
2202
|
-
${
|
|
2203
|
-
</div
|
|
2078
|
+
${!i&&t.msg.created_by?D`<div style="margin-left:0.8em;margin-top:0.3em;font-size:0.9em">
|
|
2079
|
+
${Ba(t.msg.created_by)}
|
|
2080
|
+
</div>`:null}
|
|
2204
2081
|
</div>`},Za=t=>D`
|
|
2205
2082
|
<temba-icon name="${at.label}"></temba-icon>
|
|
2206
2083
|
<div class="description">
|
|
2207
2084
|
Message labeled with
|
|
2208
2085
|
<div class="attn">${((t,e="and")=>_e(t,(t=>t.name),e))(t.labels,"and")}</div>
|
|
2209
2086
|
</div>
|
|
2210
|
-
`,Fa=t=>{let e=at.inbox;return t.ticket.ticketer.name.indexOf("Email")>-1?e=at.email:t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e=at.zendesk),e},Ua=(t,e,i)=>{
|
|
2211
|
-
<temba-icon name="${
|
|
2087
|
+
`,Fa=t=>{let e=at.inbox;return t.ticket.ticketer.name.indexOf("Email")>-1?e=at.email:t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e=at.zendesk),e},Ua=(t,e,i)=>{new Date(t.created_on);const n=Fa(t);return i?D`<div class="" style="display: flex">
|
|
2088
|
+
<temba-icon name="${n}"></temba-icon>
|
|
2212
2089
|
<div class="description">
|
|
2213
2090
|
${Da(t.created_by)} ${e} a
|
|
2214
2091
|
<span
|
|
2215
2092
|
onclick="goto(event)"
|
|
2216
2093
|
class="linked"
|
|
2217
|
-
href="/ticket/all/open/${t.ticket.uuid}"
|
|
2094
|
+
href="/ticket/all/open/${t.ticket.uuid}/"
|
|
2218
2095
|
>
|
|
2219
2096
|
ticket
|
|
2220
2097
|
</span>
|
|
@@ -2222,50 +2099,17 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2222
2099
|
</div>`:D`
|
|
2223
2100
|
<div class="assigned active">
|
|
2224
2101
|
<div style="text-align:center">
|
|
2225
|
-
${Da(t.created_by)} ${e} this ticket
|
|
2102
|
+
${t.created_by?D` ${Da(t.created_by)} ${e} this ticket `:D` This ticket was ${e} `}
|
|
2226
2103
|
</div>
|
|
2227
2104
|
<div class="subtext" style="justify-content:center">
|
|
2228
2105
|
<temba-date
|
|
2229
2106
|
class="time"
|
|
2230
|
-
value="${
|
|
2107
|
+
value="${t.created_on}"
|
|
2231
2108
|
display="duration"
|
|
2232
2109
|
></temba-date>
|
|
2233
2110
|
</div>
|
|
2234
2111
|
</div>
|
|
2235
|
-
`},Va=(t
|
|
2236
|
-
<temba-icon name="${n}"></temba-icon>
|
|
2237
|
-
<div class="description">
|
|
2238
|
-
${t.ticket.topic.name}
|
|
2239
|
-
<span
|
|
2240
|
-
class="linked"
|
|
2241
|
-
onclick="goto(event)"
|
|
2242
|
-
href="/ticket/all/open/${t.ticket.uuid}"
|
|
2243
|
-
>ticket</span
|
|
2244
|
-
>
|
|
2245
|
-
was opened
|
|
2246
|
-
</div>
|
|
2247
|
-
</div>`:D`
|
|
2248
|
-
<temba-icon size="1.5" name="${n}"></temba-icon>
|
|
2249
|
-
|
|
2250
|
-
<div class="active" style="flex-grow:1;">
|
|
2251
|
-
Opened
|
|
2252
|
-
<div class="attn">
|
|
2253
|
-
${t.ticket.topic?t.ticket.topic.name:"General"}
|
|
2254
|
-
</div>
|
|
2255
|
-
<div class="subtext">${fe(new Date(t.created_on))}</div>
|
|
2256
|
-
</div>
|
|
2257
|
-
${e?D`
|
|
2258
|
-
<temba-tip text="Resolve" position="left" style="width:1.5em">
|
|
2259
|
-
<temba-icon
|
|
2260
|
-
class="clickable"
|
|
2261
|
-
size="1.5"
|
|
2262
|
-
name="${at.check}"
|
|
2263
|
-
@click=${()=>{e(t.ticket.uuid)}}
|
|
2264
|
-
?clickable=${open}
|
|
2265
|
-
/>
|
|
2266
|
-
</temba-tip>
|
|
2267
|
-
`:null}
|
|
2268
|
-
`},ja=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class Ha extends nt{constructor(){super(),this.getStickyId=t=>{if(t.type===Na.TICKET_OPENED){const e=this.getTicketForEvent(t);if(e&&"open"===e.status)return e.uuid}},this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",ja,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",ja,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return r`
|
|
2112
|
+
`},Va=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class ja extends nt{constructor(){super(),this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",Va,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",Va,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return r`
|
|
2269
2113
|
${r`
|
|
2270
2114
|
.grouping {
|
|
2271
2115
|
margin-top: 1em;
|
|
@@ -2449,7 +2293,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2449
2293
|
.event.msg_created,
|
|
2450
2294
|
.event.broadcast_created,
|
|
2451
2295
|
.event.ivr_created,
|
|
2452
|
-
.
|
|
2296
|
+
.event.ticket_note_added {
|
|
2453
2297
|
align-self: flex-end;
|
|
2454
2298
|
}
|
|
2455
2299
|
|
|
@@ -2509,11 +2353,11 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2509
2353
|
background: rgba(10, 10, 10, 0.02);
|
|
2510
2354
|
}
|
|
2511
2355
|
|
|
2512
|
-
.
|
|
2356
|
+
.ticket_note_added {
|
|
2513
2357
|
max-width: 300px;
|
|
2514
2358
|
}
|
|
2515
2359
|
|
|
2516
|
-
.
|
|
2360
|
+
.note-summary {
|
|
2517
2361
|
display: flex;
|
|
2518
2362
|
flex-direction: row;
|
|
2519
2363
|
font-size: 85%;
|
|
@@ -2522,11 +2366,13 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2522
2366
|
padding: 8px 3px;
|
|
2523
2367
|
}
|
|
2524
2368
|
|
|
2525
|
-
.
|
|
2369
|
+
.ticket_note_added .description {
|
|
2526
2370
|
border: 2px solid rgba(100, 100, 100, 0.1);
|
|
2527
2371
|
background: rgb(255, 249, 194);
|
|
2528
2372
|
padding: var(--event-padding);
|
|
2529
|
-
|
|
2373
|
+
font-weight: 400;
|
|
2374
|
+
color: rgba(0, 0, 0, 0.6);
|
|
2375
|
+
border-radius: calc(var(--curvature) * 2.5);
|
|
2530
2376
|
}
|
|
2531
2377
|
|
|
2532
2378
|
.channel_event {
|
|
@@ -2548,14 +2394,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2548
2394
|
padding: 0em 1em;
|
|
2549
2395
|
}
|
|
2550
2396
|
|
|
2551
|
-
.ticket_opened temba-icon.clickable[name='check'] {
|
|
2552
|
-
--icon-color: rgba(100, 100, 100, 1);
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
.ticket_opened .active {
|
|
2556
|
-
color: var(--color-text);
|
|
2557
|
-
}
|
|
2558
|
-
|
|
2559
2397
|
.ticket_closed .inactive .subtext {
|
|
2560
2398
|
display: none;
|
|
2561
2399
|
}
|
|
@@ -2801,52 +2639,10 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2801
2639
|
font-weight: 400;
|
|
2802
2640
|
}
|
|
2803
2641
|
|
|
2804
|
-
.sticky-bin {
|
|
2805
|
-
border-top-left-radius: var(--curvature);
|
|
2806
|
-
z-index: 2;
|
|
2807
|
-
box-shadow: rgb(0 0 0 / 15%) 0px 3px 3px 0px;
|
|
2808
|
-
background: rgb(240, 240, 240);
|
|
2809
|
-
}
|
|
2810
|
-
|
|
2811
|
-
.sticky-bin temba-icon {
|
|
2812
|
-
margin-right: 0.75em;
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
.sticky-bin temba-icon[name='check'] {
|
|
2816
|
-
margin-right: 0;
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
.sticky {
|
|
2820
|
-
display: flex;
|
|
2821
|
-
margin: 1em -2em;
|
|
2822
|
-
padding: 1em 2em;
|
|
2823
|
-
background: rgba(240, 240, 240, 0.95);
|
|
2824
|
-
border-bottom: 1px solid rgba(220, 220, 220, 1);
|
|
2825
|
-
}
|
|
2826
|
-
|
|
2827
|
-
.sticky.featured {
|
|
2828
|
-
visibility: hidden;
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
.sticky-bin .event {
|
|
2832
|
-
margin: 0;
|
|
2833
|
-
padding: 1em 2em;
|
|
2834
|
-
border-radius: 0px;
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
.sticky .event {
|
|
2838
|
-
margin-bottom: 0;
|
|
2839
|
-
}
|
|
2840
|
-
|
|
2841
|
-
.sticky .attn,
|
|
2842
|
-
.sticky-bin .attn {
|
|
2843
|
-
color: var(--color-text);
|
|
2844
|
-
}
|
|
2845
|
-
|
|
2846
2642
|
.attachment img {
|
|
2847
2643
|
cursor: pointer;
|
|
2848
2644
|
}
|
|
2849
|
-
`}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&this.fireCustomEvent(_t.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;Ia(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===Na.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=Ia(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===Na.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events?t.events.reverse():[];if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}
|
|
2645
|
+
`}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&t.get("mostRecentEvent")&&this.mostRecentEvent&&this.fireCustomEvent(_t.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;Ia(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===Na.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=Ia(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===Na.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events?t.events.reverse():[];if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}t.has("endpoint")&&this.endpoint&&(this.fetching=!0,this.empty=!0)}refreshTickets(){if(this.ticket){let t=`/api/v2/tickets.json?contact=${this.uuid}`;this.ticket&&(t=`${t}&ticket=${this.ticket}`),re(t).then((t=>{this.tickets=t.reverse()}))}}getEventsPane(){return this.getDiv(".events")}scrollToBottom(t=!1){const e=this.getEventsPane();e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"}),this.showMessageAlert=!1,window.setTimeout((()=>{e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})}),0)}refresh(){this.scheduleRefresh(500)}getEventGroups(t){const e=[];let i;for(const n of t){const t=Ra(n,this.ticket);i&&i.type===t?i.events.push(n):(i&&e.push(i),i={open:!1,events:[n],type:t})}return i&&i.events.length>0&&e.push(i),e}scheduleRefresh(t=-1){if(this.endDate)return;let e=t;if(-1===t){const t=this.getLastEventTime();e=Math.max(Math.min(((new Date).getTime()-t)/2,1e4),500)}t>-1&&this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshing?(this.scheduleRefresh(),this.refreshing=!1):this.refreshing=!0}),e)}reset(){this.endpoint=null,this.tickets=null,this.ticketEvents={},this.eventGroups=[],this.fetching=!1,this.complete=!1,this.nextBefore=null,this.nextAfter=null,this.lastHeight=0}handleEventGroupShow(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!0,this.requestUpdate("eventGroups")}handleEventGroupHide(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!1,this.requestUpdate("eventGroups")}handleScroll(){this.getEventsPane().scrollTop<=100&&this.eventGroups.length>0&&!this.fetching&&!this.complete&&(this.fetching=!0)}updateMostRecent(t){this.mostRecentEvent&&this.mostRecentEvent.type===t.type&&this.mostRecentEvent.created_on===t.created_on||(this.mostRecentEvent=t)}getLastEventTime(){const t=this.eventGroups[this.eventGroups.length-1];if(t){const e=t.events[t.events.length-1];return new Date(e.created_on).getTime()}return 0}renderEvent(t){switch(t.type){case Na.IVR_CREATED:case Na.MESSAGE_CREATED:case Na.MESSAGE_RECEIVED:case Na.BROADCAST_CREATED:return qa(t,this.agent);case Na.FLOW_ENTERED:case Na.FLOW_EXITED:return(t=>{let e="Interrupted",i=at.flow_interrupted;return"I"!==t.status&&(t.type===Na.FLOW_ENTERED?(e="Started",i=at.flow):(e="Completed",i=at.flow)),D`
|
|
2850
2646
|
<temba-icon name="${i}"></temba-icon>
|
|
2851
2647
|
<div class="description">
|
|
2852
2648
|
${e}
|
|
@@ -2902,7 +2698,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2902
2698
|
with subject
|
|
2903
2699
|
<div class="attn">${t.subject}</div>
|
|
2904
2700
|
</div>
|
|
2905
|
-
`)(t);case Na.INPUT_LABELS_ADDED:return Za(t);case Na.TICKET_OPENED:
|
|
2701
|
+
`)(t);case Na.INPUT_LABELS_ADDED:return Za(t);case Na.TICKET_OPENED:return Ua(t,"opened",!this.ticket);case Na.TICKET_NOTE_ADDED:return(t=>D` <div style="display:flex;align-items:flex-start">
|
|
2906
2702
|
<div style="display:flex;flex-direction:column">
|
|
2907
2703
|
<div class="description">${t.note}</div>
|
|
2908
2704
|
<div class="note-summary">
|
|
@@ -2997,13 +2793,38 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
2997
2793
|
<div class="description">${e}</div>`})(t);case Na.CONTACT_LANGUAGE_CHANGED:return(t=>D`<temba-icon name="${at.contact_updated}"></temba-icon>
|
|
2998
2794
|
<div class="description">
|
|
2999
2795
|
Language updated to <span class="attn">${t.language}</span>
|
|
3000
|
-
</div>`)(t)}return D`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=le("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=re(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:ve(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}handleEventClicked(t){const e=t.target;if("IMG"==e.tagName){const t=document.querySelector("temba-lightbox");t&&t.showElement(e)}}renderEventContainer(t){
|
|
2796
|
+
</div>`)(t)}return D`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=le("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=re(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(_t.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:ve(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}handleEventClicked(t){const e=t.target;if("IMG"==e.tagName){const t=document.querySelector("temba-lightbox");t&&t.showElement(e)}}renderEventContainer(t){return D` <div @click="${this.handleEventClicked}" class="${this.ticket?"active-ticket":""} event ${t.type}"> ${this.renderEvent(t)} </div> ${this.debug?D`<pre>${JSON.stringify(t,null,2)}</pre>`:null} `}render(){return this.eventGroups.length>0&&this.tickets&&this.tickets.map((t=>{if(t&&"open"===t.status){if(1e3*new Date(t.opened_on).getTime()<this.nextBefore||this.isPurged(t)){const e=((t,e,i)=>{const n=Fa(t);return i?D`<div class="" style="display: flex">
|
|
2797
|
+
<temba-icon name="${n}"></temba-icon>
|
|
2798
|
+
<div class="description">
|
|
2799
|
+
${t.ticket.topic.name}
|
|
2800
|
+
<span
|
|
2801
|
+
class="linked"
|
|
2802
|
+
onclick="goto(event)"
|
|
2803
|
+
href="/ticket/all/open/${t.ticket.uuid}"
|
|
2804
|
+
>ticket</span
|
|
2805
|
+
>
|
|
2806
|
+
was opened
|
|
2807
|
+
</div>
|
|
2808
|
+
</div>`:D`
|
|
2809
|
+
<div>
|
|
2810
|
+
<div style="text-align:center">
|
|
2811
|
+
${Da(t.created_by)} opened this ticket
|
|
2812
|
+
</div>
|
|
2813
|
+
<div class="subtext" style="justify-content:center">
|
|
2814
|
+
<temba-date
|
|
2815
|
+
class="time"
|
|
2816
|
+
value="${t.created_on}"
|
|
2817
|
+
display="duration"
|
|
2818
|
+
></temba-date>
|
|
2819
|
+
</div>
|
|
2820
|
+
</div>
|
|
2821
|
+
`})({type:Na.TICKET_OPENED,ticket:{uuid:t.uuid,topic:t.topic,body:t.body,ticketer:t.ticketer},created_on:t.opened_on},this.handleClose,!this.ticket);return D`<div class="event ticket_opened"> ${e} </div>`}}})),D` ${this.fetching?D`<temba-loading units="5" size="10"></temba-loading>`:D`<div style="height:0"></div>`} <div class="events" @scroll="${this.handleScroll}"> ${this.eventGroups.map(((t,e)=>{const i=Ra(t.events[0],this.ticket),n=this.eventGroups.length-e-1,o=ie({grouping:!0,[i]:!0,expanded:t.open});return D`<div class="${o}"> ${"verbose"===i?D`<div class="event-count" @click="${this.handleEventGroupShow}" data-group-index="${n}"> ${t.open?D`<temba-icon @click="${this.handleEventGroupHide}" data-group-index="${n}" name="x" clickable></temba-icon>`:D`${t.events.length} ${1===t.events.length?D`event`:D`events`} `} </div>`:null} <div class="items"> ${t.events.map((t=>{if(t.type===Na.TICKET_ASSIGNED&&t.note){const e={...t};return e.type=Na.TICKET_NOTE_ADDED,D`${this.renderEventContainer(e)}${this.renderEventContainer(t)}`}return this.renderEventContainer(t)}))} </div> </div>`}))} </div> <div class="new-messages-container"> <div @click="${()=>{this.scrollToBottom(!0)}}" class="new-messages ${ie({expanded:this.showMessageAlert})}"> New Messages </div> </div> `}}t([st({type:Object})],ja.prototype,"contact",void 0),t([st({type:String})],ja.prototype,"uuid",void 0),t([st({type:String})],ja.prototype,"agent",void 0),t([st({type:Array})],ja.prototype,"eventGroups",void 0),t([st({type:Boolean})],ja.prototype,"refreshing",void 0),t([st({type:Boolean})],ja.prototype,"fetching",void 0),t([st({type:Boolean})],ja.prototype,"complete",void 0),t([st({type:String})],ja.prototype,"endpoint",void 0),t([st({type:Boolean})],ja.prototype,"debug",void 0),t([st({type:Boolean})],ja.prototype,"showMessageAlert",void 0),t([st({attribute:!1,type:Object})],ja.prototype,"mostRecentEvent",void 0),t([st({type:String})],ja.prototype,"ticket",void 0),t([st({type:String})],ja.prototype,"endDate",void 0),t([st({type:Array})],ja.prototype,"tickets",void 0);class Ha extends nt{static get styles(){return r`
|
|
3001
2822
|
temba-options {
|
|
3002
2823
|
display: block;
|
|
3003
2824
|
width: 100%;
|
|
3004
2825
|
flex-grow: 1;
|
|
3005
2826
|
}
|
|
3006
|
-
`}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.reset(),this.loading=!0,this.fetchItems()),t.has("loading")&&(this.loading||this.fireCustomEvent(_t.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.fireCustomEvent(_t.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await ne(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],s=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await ne(t,s);this.sanitizeOption&&r.results.forEach(this.sanitizeOption),r.results&&(o=o.concat(r.results)),n=r.next,t=n,e--,i++}catch(t){return this.reset(),
|
|
2827
|
+
`}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.reset(),this.loading=!0,this.fetchItems()),t.has("loading")&&(this.loading||this.fireCustomEvent(_t.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.fireCustomEvent(_t.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await ne(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],s=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await ne(t,s);this.sanitizeOption&&r.results.forEach(this.sanitizeOption),r.results&&(o=o.concat(r.results)),n=r.next,t=n,e--,i++}catch(t){return this.reset(),void console.log(t)}this.nextPage=n}this.pages=i;const s=o[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s);const r=o[this.cursorIndex];if(!this.nextSelection&&this.selected&&r&&this.getValue(r)!==this.getValue(this.selected)){const t=o.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}return this.items=o,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1===this.cursorIndex&&(this.cursorIndex=0),this.value&&(this.setSelection(this.value),this.value=null),Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,ne(this.nextPage).then((t=>{this.sanitizeOption&&t.results.forEach(this.sanitizeOption),this.items=[...this.items,...t.results],this.nextPage=t.next,this.pages++,this.loading=!1})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){const{selected:e,index:i}=t.detail;this.selected=e,this.cursorIndex=i,t.stopPropagation(),t.preventDefault()}render(){return D`
|
|
3007
2828
|
${this.renderHeader()}
|
|
3008
2829
|
<temba-options
|
|
3009
2830
|
style="${this.getListStyle()}"
|
|
@@ -3022,7 +2843,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3022
2843
|
<slot></slot>
|
|
3023
2844
|
</temba-options>
|
|
3024
2845
|
${this.renderFooter()}
|
|
3025
|
-
`}}t([st({type:Array,attribute:!1})],
|
|
2846
|
+
`}}t([st({type:Array,attribute:!1})],Ha.prototype,"items",void 0),t([st({type:Object,attribute:!1})],Ha.prototype,"selected",void 0),t([st({type:Number})],Ha.prototype,"cursorIndex",void 0),t([st({type:String})],Ha.prototype,"endpoint",void 0),t([st({type:String})],Ha.prototype,"nextSelection",void 0),t([st({type:Number})],Ha.prototype,"tabIndex",void 0),t([st({type:String})],Ha.prototype,"valueKey",void 0),t([st({type:String})],Ha.prototype,"value",void 0),t([st({type:Boolean})],Ha.prototype,"loading",void 0),t([st({type:Boolean})],Ha.prototype,"collapsed",void 0),t([st({type:Boolean})],Ha.prototype,"hideShadow",void 0),t([st({type:Boolean})],Ha.prototype,"paused",void 0),t([st({attribute:!1})],Ha.prototype,"getNextRefresh",void 0),t([st({attribute:!1})],Ha.prototype,"sanitizeOption",void 0),t([st({attribute:!1})],Ha.prototype,"renderOption",void 0),t([st({attribute:!1})],Ha.prototype,"renderOptionDetail",void 0),t([st({attribute:!1,type:Object})],Ha.prototype,"mostRecentItem",void 0),t([st({type:String})],Ha.prototype,"refreshKey",void 0);class Wa extends Ha{getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].ticket.last_activity_on;return this.endpoint+"?after="+1e3*new Date(t).getTime()}return this.endpoint}constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>D`
|
|
3026
2847
|
<div
|
|
3027
2848
|
style="align-items:center; margin-top: 0.1em; margin-bottom: 0.1em"
|
|
3028
2849
|
>
|
|
@@ -3067,7 +2888,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3067
2888
|
</div>
|
|
3068
2889
|
</div>
|
|
3069
2890
|
</div>
|
|
3070
|
-
`}}t([st({type:String})],
|
|
2891
|
+
`}}t([st({type:String})],Wa.prototype,"agent",void 0);class Ga extends nt{constructor(){super(...arguments),this.flow=null,this.fields=[],this.expandFields=!1,this.expandBody=!1,this.showGroups=!1,this.showFlows=!1,this.ticket=null}static get styles(){return r`
|
|
3071
2892
|
:host {
|
|
3072
2893
|
background: #f9f9f9;
|
|
3073
2894
|
display: block;
|
|
@@ -3267,7 +3088,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3267
3088
|
</div>`:null}
|
|
3268
3089
|
<div style="flex-grow:1"></div>
|
|
3269
3090
|
</div>
|
|
3270
|
-
</div>`}}t([st({type:String})],
|
|
3091
|
+
</div>`}}t([st({type:String})],Ga.prototype,"name",void 0),t([st({type:String})],Ga.prototype,"uuid",void 0),t([st({type:Object})],Ga.prototype,"contact",void 0),t([st({attribute:!1})],Ga.prototype,"flow",void 0),t([st({type:Array})],Ga.prototype,"fields",void 0),t([st({type:String})],Ga.prototype,"endpoint",void 0),t([st({type:Boolean})],Ga.prototype,"expandFields",void 0),t([st({type:Boolean})],Ga.prototype,"expandBody",void 0),t([st({type:Boolean})],Ga.prototype,"showGroups",void 0),t([st({type:Boolean})],Ga.prototype,"showFlows",void 0),t([st({type:Object})],Ga.prototype,"ticket",void 0);class Ka extends et{constructor(){super(...arguments),this.level="info"}static get styles(){return r`
|
|
3271
3092
|
:host {
|
|
3272
3093
|
display: block;
|
|
3273
3094
|
}
|
|
@@ -3299,7 +3120,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3299
3120
|
}
|
|
3300
3121
|
`}render(){return D`
|
|
3301
3122
|
<div class="temba-alert temba-${this.level}"><slot></slot></div>
|
|
3302
|
-
`}}t([st({type:String})],
|
|
3123
|
+
`}}t([st({type:String})],Ka.prototype,"level",void 0);class Ya extends lt{constructor(){super(...arguments),this.placeholder="",this.name="",this.query="",this.inactiveThreshold=1e3,this.inactiveDays=90,this.initialized=!1,this.exclusions={}}static get styles(){return r`
|
|
3303
3124
|
:host {
|
|
3304
3125
|
color: var(--color-text);
|
|
3305
3126
|
}
|
|
@@ -3504,7 +3325,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3504
3325
|
<temba-loading units="6" size="8"></temba-loading>
|
|
3505
3326
|
<div class="summary ${this.expanded?"expanded":""}">${t}</div>
|
|
3506
3327
|
</div>
|
|
3507
|
-
`}}t([st({type:Boolean})],
|
|
3328
|
+
`}}t([st({type:Boolean})],Ya.prototype,"fetching",void 0),t([st({type:Boolean})],Ya.prototype,"expanded",void 0),t([st({type:String})],Ya.prototype,"endpoint",void 0),t([st({type:String})],Ya.prototype,"placeholder",void 0),t([st({type:String})],Ya.prototype,"name",void 0),t([st({type:String})],Ya.prototype,"query",void 0),t([st({type:Number})],Ya.prototype,"inactiveThreshold",void 0),t([st({type:Number})],Ya.prototype,"inactiveDays",void 0),t([st({type:Object,attribute:!1})],Ya.prototype,"summary",void 0),t([st({type:Object,attribute:!1})],Ya.prototype,"flow",void 0);class Ja extends et{static get styles(){return r`
|
|
3508
3329
|
:host {
|
|
3509
3330
|
margin: auto;
|
|
3510
3331
|
}
|
|
@@ -3594,7 +3415,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3594
3415
|
/>
|
|
3595
3416
|
</svg>
|
|
3596
3417
|
</div>
|
|
3597
|
-
`}}var
|
|
3418
|
+
`}}var Xa;t([st({type:String})],Ja.prototype,"name",void 0),t([st({type:String})],Ja.prototype,"prefix",void 0),t([st({type:String})],Ja.prototype,"id",void 0),t([st({type:Number})],Ja.prototype,"size",void 0),t([st({type:Boolean})],Ja.prototype,"clickable",void 0),t([st({type:Boolean})],Ja.prototype,"circled",void 0),t([st({type:String})],Ja.prototype,"animateChange",void 0),t([st({type:String})],Ja.prototype,"animateClick",void 0),t([st({type:Number})],Ja.prototype,"animationDuration",void 0),t([st({type:String})],Ja.prototype,"src",void 0),t([st({type:Number,attribute:!1})],Ja.prototype,"steps",void 0),t([st({type:Number,attribute:!1})],Ja.prototype,"animationStep",void 0),t([st({type:String})],Ja.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact"}(Xa||(Xa={}));const Qa={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class tl extends nt{constructor(){super(...arguments),this.groups=!1,this.contacts=!1,this.value=[],this.placeholder="Select recipients",this.disabled=!1}static get styles(){return r`
|
|
3598
3419
|
temba-select:focus {
|
|
3599
3420
|
outline: none;
|
|
3600
3421
|
box-shadow: none;
|
|
@@ -3612,7 +3433,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3612
3433
|
${this.getPostName(t)}
|
|
3613
3434
|
</div>
|
|
3614
3435
|
</div>
|
|
3615
|
-
`}getPostName(t){const e={...
|
|
3436
|
+
`}getPostName(t){const e={...Qa};return t.urn&&t.type===Xa.Contact&&t.urn!==t.name?D` <div style=${ft(e)}>${t.urn}</div> `:t.type===Xa.Group?D`
|
|
3616
3437
|
<div style=${ft(e)}>${t.count.toLocaleString()}</div>
|
|
3617
3438
|
`:null}renderSelection(t){return D`
|
|
3618
3439
|
<div
|
|
@@ -3633,7 +3454,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3633
3454
|
${this.getPostName(t)}
|
|
3634
3455
|
</div>
|
|
3635
3456
|
</div>
|
|
3636
|
-
`}getIcon(t){return t.type===
|
|
3457
|
+
`}getIcon(t){return t.type===Xa.Group?D` <temba-icon name="${at.group}" /> `:t.type===Xa.Contact?D` <temba-icon name="${at.contact}" /> `:void 0}getEndpoint(){const t=this.endpoint;let e="&types=";return this.groups&&(e+="g"),this.contacts&&(e+="c"),t+e}getValues(){return this.shadowRoot.querySelector("temba-select").values}isMatch(){return!0}render(){return D`
|
|
3637
3458
|
<temba-select
|
|
3638
3459
|
name=${this.name}
|
|
3639
3460
|
endpoint=${this.getEndpoint()}
|
|
@@ -3653,7 +3474,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3653
3474
|
searchOnFocus
|
|
3654
3475
|
multi
|
|
3655
3476
|
></temba-select>
|
|
3656
|
-
`}}t([st()],
|
|
3477
|
+
`}}t([st()],tl.prototype,"endpoint",void 0),t([st()],tl.prototype,"name",void 0),t([st({type:Boolean})],tl.prototype,"groups",void 0),t([st({type:Boolean})],tl.prototype,"contacts",void 0),t([st({type:Array})],tl.prototype,"value",void 0),t([st({type:Array})],tl.prototype,"errors",void 0),t([st()],tl.prototype,"placeholder",void 0),t([st({type:Boolean})],tl.prototype,"disabled",void 0),t([st({type:String,attribute:"help_text"})],tl.prototype,"helpText",void 0),t([st({type:Boolean,attribute:"help_always"})],tl.prototype,"helpAlways",void 0),t([st({type:Boolean,attribute:"widget_only"})],tl.prototype,"widgetOnly",void 0),t([st({type:Boolean,attribute:"hide_label"})],tl.prototype,"hideLabel",void 0),t([st({type:String})],tl.prototype,"label",void 0);const el=(t,e)=>t.top+t.height/2-e.height/2,il=(t,e)=>t.left+t.width/2-e.width/2;class nl extends nt{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return r`
|
|
3657
3478
|
.tip {
|
|
3658
3479
|
transition: opacity 200ms ease-in-out;
|
|
3659
3480
|
margin: 0px;
|
|
@@ -3705,7 +3526,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3705
3526
|
.▲ {
|
|
3706
3527
|
text-shadow: 0px -1px 1px rgba(0, 0, 0, 0.1);
|
|
3707
3528
|
}
|
|
3708
|
-
`}updated(t){(t.has("visible")||t.has("text"))&&this.visible&&this.calculatePosition(),t.has("text")&&this.hideOnChange&&(this.visible=!1)}calculatePosition(){if(this.visible){const t=this.getDiv(".tip").getBoundingClientRect(),e=this.getDiv(".slot").getBoundingClientRect();let i=this.position;"auto"===i&&(i="left"),this.arrowLeft=0,this.arrowTop=0,"left"===i?(this.left=e.left-t.width-16,this.top=
|
|
3529
|
+
`}updated(t){(t.has("visible")||t.has("text"))&&this.visible&&this.calculatePosition(),t.has("text")&&this.hideOnChange&&(this.visible=!1)}calculatePosition(){if(this.visible){const t=this.getDiv(".tip").getBoundingClientRect(),e=this.getDiv(".slot").getBoundingClientRect();let i=this.position;"auto"===i&&(i="left"),this.arrowLeft=0,this.arrowTop=0,"left"===i?(this.left=e.left-t.width-16,this.top=el(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=el(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=il(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=il(e,t),this.arrowTop=-2,this.arrowLeft=t.width/2-3,this.arrow="▲")}}handleMouseEnter(){this.lastEnter=window.setTimeout((()=>{this.visible=!0,this.failSafe=window.setTimeout((()=>{this.visible=!1}),2e3)}),600)}handleMouseLeave(){window.clearTimeout(this.lastEnter),window.clearTimeout(this.failSafe),this.visible=!1}render(){const t={top:this.top?`${this.top}px`:"0px",left:this.left?`${this.left}px`:"0px"},e={top:this.arrowTop?`${this.arrowTop}px`:"0px",left:this.arrowLeft?`${this.arrowLeft}px`:"0px"};this.width&&(t.width=`${this.width}px`);const i=ie({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return D`
|
|
3709
3530
|
<div
|
|
3710
3531
|
class="slot"
|
|
3711
3532
|
@click=${this.handleMouseLeave}
|
|
@@ -3720,7 +3541,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
3720
3541
|
${this.arrow}
|
|
3721
3542
|
</div>
|
|
3722
3543
|
</div>
|
|
3723
|
-
`}}t([st({type:String})],
|
|
3544
|
+
`}}t([st({type:String})],nl.prototype,"text",void 0),t([st({type:Boolean})],nl.prototype,"visible",void 0),t([st({type:String})],nl.prototype,"position",void 0),t([st({type:Boolean})],nl.prototype,"hideOnChange",void 0),t([st({type:Number,attribute:!1})],nl.prototype,"top",void 0),t([st({type:Number,attribute:!1})],nl.prototype,"left",void 0),t([st({type:Number,attribute:!1})],nl.prototype,"width",void 0),t([st({type:Boolean,attribute:!1})],nl.prototype,"poppedTop",void 0);const ol=(t,e)=>{const i=t||[],n=i.findIndex((t=>t.id==e||t.vanity_id==e));if(n>-1){return{item:i[n],index:n}}return{item:null,index:-1}};class sl extends nt{static get styles(){return r`
|
|
3724
3545
|
:host {
|
|
3725
3546
|
width: 100%;
|
|
3726
3547
|
display: block;
|
|
@@ -4223,7 +4044,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4223
4044
|
</div>
|
|
4224
4045
|
</div>
|
|
4225
4046
|
</temba-dropdown>
|
|
4226
|
-
`:a},this.doRefresh=this.doRefresh.bind(this)}setBubble(t,e){const i=
|
|
4047
|
+
`:a},this.doRefresh=this.doRefresh.bind(this)}setBubble(t,e){const i=ol(this.root.items,t);return!(!i||!i.item)&&(i.item.bubble=e,this.requestUpdate("root"),!0)}getMenuItemState(t){let e={};return t&&(e=this.state[t],e||(e={},this.state[t]=e)),e}updated(t){t.has("endpoint")&&(this.root={level:-1,endpoint:this.endpoint},this.wait?this.fireCustomEvent(_t.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e)}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=oe(t.endpoint).then((i=>{if(i.forEach((e=>{if(!e.items){const i=(t.items||[]).find((t=>t.id==e.id));i&&i.items&&(e.items=i.items)}})),i.forEach((e=>{e.level=t.level+1,e.items&&e.items.forEach((e=>{e.level=t.level+2}))})),t.items=i,t.loading=!1,this.submenu&&0==this.selection.length){const t=this.getMenuItemForSelection([this.submenu]);this.handleItemClicked(e,t)}this.wait||(this.fireCustomEvent(_t.Ready),this.wait=!0),e&&t.items.length>0&&this.handleItemClicked(e,t.items[0]),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup)t&&this.fireCustomEvent(_t.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(e.popup)t&&this.fireCustomEvent(_t.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(t&&(t.preventDefault(),t.stopPropagation(),t.metaKey&&e.href))window.open(e.href,"_blank");else if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&(this.collapsed=!1),e.trigger)this.fireCustomEvent(_t.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else{if(e.level>=this.selection.length?this.selection.push(e.vanity_id||e.id):this.selection.splice(e.level,this.selection.length-e.level,e.vanity_id||e.id),e.endpoint){if(this.loadItems(e,t),!e.href)return}else this.requestUpdate();e.href&&this.dispatchEvent(new Event("change")),this.fireCustomEvent(_t.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,n=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(n=ol(i,t).item,!n)break;i=n.items}return n}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!ol(this.root.items,e[0]).item)return}const i=[];let n=this.root;for(;e.length>0;){const t=e.shift();t&&(n.items||(this.loadItems(n),await this.httpComplete),n=ol(n.items,t).item,n?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[];e.push(D`<div class="level level-0 ${this.submenu?"hidden":""}">
|
|
4227
4048
|
<div class="top">
|
|
4228
4049
|
<div class="expand-icon" @click=${this.handleExpand}>
|
|
4229
4050
|
<temba-icon
|
|
@@ -4240,7 +4061,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4240
4061
|
<div class="empty"></div>
|
|
4241
4062
|
${t.filter((t=>!!t.bottom)).map((t=>this.renderMenuItem(t)))}
|
|
4242
4063
|
<div class="bottom"></div>
|
|
4243
|
-
</div>`),this.selection.forEach(((i,n)=>{const o=
|
|
4064
|
+
</div>`),this.selection.forEach(((i,n)=>{const o=ol(t,i).item;let s=!1;if(o){t=o.items;const e=this.getMenuItemState(o.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>o.level+2&&(s=!1)}else t=null;t&&t.length>0&&!o.inline&&e.push(D`<div
|
|
4244
4065
|
class="${ie({level:!0,["level-"+(n+1)]:!0,collapsed:s})}"
|
|
4245
4066
|
>
|
|
4246
4067
|
${this.submenu?null:D`
|
|
@@ -4266,7 +4087,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4266
4087
|
class="${ie({root:!0,"fully-collapsed":this.collapsed})}"
|
|
4267
4088
|
>
|
|
4268
4089
|
${e}
|
|
4269
|
-
</div>`;return D`${i}`}}t([st({type:Boolean})],
|
|
4090
|
+
</div>`;return D`${i}`}}t([st({type:Boolean})],sl.prototype,"wraps",void 0),t([st({type:Boolean})],sl.prototype,"wait",void 0),t([st({type:String})],sl.prototype,"endpoint",void 0),t([st({type:String})],sl.prototype,"expanding",void 0),t([st({type:String})],sl.prototype,"value",void 0),t([st({type:String})],sl.prototype,"submenu",void 0),t([st({type:Boolean})],sl.prototype,"collapsed",void 0),t([st({type:Object})],sl.prototype,"pressedItem",void 0);class rl extends et{static get styles(){return r`
|
|
4270
4091
|
:host {
|
|
4271
4092
|
color: var(--color-link-primary);
|
|
4272
4093
|
display: inline-block;
|
|
@@ -4276,7 +4097,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4276
4097
|
cursor: pointer;
|
|
4277
4098
|
text-decoration: underline;
|
|
4278
4099
|
}
|
|
4279
|
-
`}handleClick(t){window.goto(t)}render(){return D`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([st({type:String})],
|
|
4100
|
+
`}handleClick(t){window.goto(t)}render(){return D`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([st({type:String})],rl.prototype,"href",void 0);class al extends nt{constructor(){super(...arguments),this.open=!1,this.dropAlign="left",this.arrowSize=6,this.arrowOffset=2*this.arrowSize,this.offsetX=0,this.offsetY=0,this.mask=!1}static get styles(){return r`
|
|
4280
4101
|
.wrapper {
|
|
4281
4102
|
position: relative;
|
|
4282
4103
|
}
|
|
@@ -4364,7 +4185,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4364
4185
|
</div>
|
|
4365
4186
|
</div>
|
|
4366
4187
|
</div>
|
|
4367
|
-
`}}t([st({type:Boolean})],
|
|
4188
|
+
`}}t([st({type:Boolean})],al.prototype,"open",void 0),t([st({type:String,attribute:"drop_align"})],al.prototype,"dropAlign",void 0),t([st({type:Number})],al.prototype,"arrowSize",void 0),t([st({type:Number})],al.prototype,"arrowOffset",void 0),t([st({type:Number})],al.prototype,"offsetX",void 0),t([st({type:Number})],al.prototype,"offsetY",void 0),t([st({type:Boolean})],al.prototype,"mask",void 0);class ll extends nt{constructor(){super(...arguments),this.collapses=!1,this.index=0}static get styles(){return r`
|
|
4368
4189
|
:host {
|
|
4369
4190
|
display: flex;
|
|
4370
4191
|
flex-direction: column;
|
|
@@ -4512,7 +4333,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4512
4333
|
<div class="pane ${0===this.index?"first":null}">
|
|
4513
4334
|
<slot></slot>
|
|
4514
4335
|
</div>
|
|
4515
|
-
`}}t([st({type:Boolean})],
|
|
4336
|
+
`}}t([st({type:Boolean})],ll.prototype,"collapses",void 0),t([st({type:Number})],ll.prototype,"index",void 0);class hl extends nt{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0}static get styles(){return r`
|
|
4516
4337
|
:host {
|
|
4517
4338
|
display: flex;
|
|
4518
4339
|
flex-direction: column;
|
|
@@ -4531,7 +4352,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4531
4352
|
}
|
|
4532
4353
|
`}hasBadge(){return this.count>0}render(){return D`<slot
|
|
4533
4354
|
class="${ie({selected:this.selected})}"
|
|
4534
|
-
></slot> `}}t([st({type:String})],
|
|
4355
|
+
></slot> `}}t([st({type:String})],hl.prototype,"name",void 0),t([st({type:String})],hl.prototype,"icon",void 0),t([st({type:String})],hl.prototype,"selectionColor",void 0),t([st({type:String})],hl.prototype,"selectionBackground",void 0),t([st({type:Boolean})],hl.prototype,"selected",void 0),t([st({type:Boolean})],hl.prototype,"notify",void 0),t([st({type:Boolean})],hl.prototype,"hidden",void 0),t([st({type:Number})],hl.prototype,"count",void 0);class cl extends et{static get styles(){return r`
|
|
4535
4356
|
:host {
|
|
4536
4357
|
display: inline-block;
|
|
4537
4358
|
}
|
|
@@ -4614,7 +4435,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4614
4435
|
<slot></slot>
|
|
4615
4436
|
</div>
|
|
4616
4437
|
</div>
|
|
4617
|
-
`}}t([st({type:Boolean})],
|
|
4438
|
+
`}}t([st({type:Boolean})],cl.prototype,"clickable",void 0),t([st({type:Boolean})],cl.prototype,"primary",void 0),t([st({type:Boolean})],cl.prototype,"secondary",void 0),t([st({type:Boolean})],cl.prototype,"tertiary",void 0),t([st({type:Boolean})],cl.prototype,"danger",void 0),t([st({type:Boolean})],cl.prototype,"dark",void 0),t([st({type:Boolean})],cl.prototype,"shadow",void 0),t([st({type:String})],cl.prototype,"icon",void 0),t([st()],cl.prototype,"backgroundColor",void 0),t([st()],cl.prototype,"textColor",void 0);class dl extends nt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
|
|
4618
4439
|
:host {
|
|
4619
4440
|
display: flex;
|
|
4620
4441
|
align-items: center;
|
|
@@ -4629,7 +4450,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4629
4450
|
${this.name?this.name:this.urn?this.urn.split(":")[1]:""}
|
|
4630
4451
|
</div>
|
|
4631
4452
|
<slot></slot>
|
|
4632
|
-
`}}t([st({type:String})],
|
|
4453
|
+
`}}t([st({type:String})],dl.prototype,"name",void 0),t([st({type:String})],dl.prototype,"urn",void 0),t([st({type:Number,attribute:"icon-size"})],dl.prototype,"size",void 0);class ul extends nt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
|
|
4633
4454
|
:host {
|
|
4634
4455
|
display: flex;
|
|
4635
4456
|
align-items: center;
|
|
@@ -4656,7 +4477,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4656
4477
|
height="${this.size}em"
|
|
4657
4478
|
src="${this.prefix||window.static_url||"/static/"}img/schemes/${t}.svg"
|
|
4658
4479
|
/>
|
|
4659
|
-
`}}t([st({type:String})],
|
|
4480
|
+
`}}t([st({type:String})],ul.prototype,"urn",void 0),t([st({type:String})],ul.prototype,"scheme",void 0),t([st({type:Number})],ul.prototype,"size",void 0);class pl extends Oa{static get styles(){return r`
|
|
4660
4481
|
:host {
|
|
4661
4482
|
--curvature-widget: 0px;
|
|
4662
4483
|
}
|
|
@@ -4743,7 +4564,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4743
4564
|
/>
|
|
4744
4565
|
</div>
|
|
4745
4566
|
</div>`:null}
|
|
4746
|
-
`}return super.render()}}t([st({type:Boolean})],
|
|
4567
|
+
`}return super.render()}}t([st({type:Boolean})],pl.prototype,"featured",void 0),t([st({type:Boolean})],pl.prototype,"system",void 0),t([st({type:Boolean})],pl.prototype,"dirty",void 0),t([st({type:Boolean})],pl.prototype,"showAll",void 0),t([st({type:String})],pl.prototype,"timezone",void 0);class ml extends nt{constructor(){super(...arguments),this.icon=navigator.clipboard?at.copy:"",this.iconClass=""}static get styles(){return r`
|
|
4747
4568
|
.wrapper {
|
|
4748
4569
|
--widget-box-shadow: none;
|
|
4749
4570
|
}
|
|
@@ -4888,7 +4709,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4888
4709
|
</temba-textinput>
|
|
4889
4710
|
`}
|
|
4890
4711
|
</div>
|
|
4891
|
-
`}}t([st({type:String})],
|
|
4712
|
+
`}}t([st({type:String})],ml.prototype,"key",void 0),t([st({type:String})],ml.prototype,"value",void 0),t([st({type:String})],ml.prototype,"name",void 0),t([st({type:String})],ml.prototype,"type",void 0),t([st({type:String})],ml.prototype,"timezone",void 0),t([st({type:String})],ml.prototype,"icon",void 0),t([st({type:String})],ml.prototype,"iconClass",void 0);const fl={stopped:{name:"Stopped"},blocked:{name:"Blocked"},archived:{name:"Archived"}};class gl extends Oa{constructor(){super(...arguments),this.hasMore=!1,this.expanded=!1}static get styles(){return r`
|
|
4892
4713
|
.wrapper {
|
|
4893
4714
|
display: flex;
|
|
4894
4715
|
flex-direction: column;
|
|
@@ -4957,7 +4778,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
4957
4778
|
.show-button temba-icon {
|
|
4958
4779
|
border-radius: 9999px;
|
|
4959
4780
|
}
|
|
4960
|
-
`}handleResized(){if(this.shadowRoot){const t=this.shadowRoot.querySelector(".badges");t&&(this.hasMore=t.scrollHeight>t.clientHeight)}}updated(t){if(super.updated(t),t.has("data")&&!t.get("data")){const t=this.shadowRoot.querySelector(".badges");new ResizeObserver(ge(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=
|
|
4781
|
+
`}handleResized(){if(this.shadowRoot){const t=this.shadowRoot.querySelector(".badges");t&&(this.hasMore=t.scrollHeight>t.clientHeight)}}updated(t){if(super.updated(t),t.has("data")&&!t.get("data")){const t=this.shadowRoot.querySelector(".badges");new ResizeObserver(ge(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=fl[this.data.status];return D`
|
|
4961
4782
|
<div
|
|
4962
4783
|
class=${ie({wrapper:!0,"has-more":this.hasMore,expanded:this.expanded})}
|
|
4963
4784
|
>
|
|
@@ -5022,7 +4843,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5022
4843
|
></temba-icon>
|
|
5023
4844
|
</div>
|
|
5024
4845
|
</div>
|
|
5025
|
-
`}return null}}t([st({type:Boolean})],
|
|
4846
|
+
`}return null}}t([st({type:Boolean})],gl.prototype,"hasMore",void 0),t([st({type:Boolean})],gl.prototype,"expanded",void 0);const vl={[yt.CampaignEvent]:at.campaign,[yt.ScheduledBroadcast]:at.message,[yt.ScheduledTrigger]:at.trigger};class yl extends Ma{static get styles(){return r`
|
|
5026
4847
|
:host {
|
|
5027
4848
|
}
|
|
5028
4849
|
|
|
@@ -5150,7 +4971,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5150
4971
|
<div class="name">${t.campaign.name}</div>
|
|
5151
4972
|
</div>`:D`
|
|
5152
4973
|
${t.type===yt.ScheduledTrigger?D`<temba-icon
|
|
5153
|
-
name="${
|
|
4974
|
+
name="${vl[t.type]}"
|
|
5154
4975
|
></temba-icon>`:null}
|
|
5155
4976
|
<div class="name">
|
|
5156
4977
|
${this.REPEAT_PERIOD[t.repeat_period]}
|
|
@@ -5172,15 +4993,14 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5172
4993
|
</div>
|
|
5173
4994
|
`}render(){if(this.data)return this.data.length>0?D`
|
|
5174
4995
|
${this.data.map((t=>this.renderEvent(t)))}
|
|
5175
|
-
`:D`<slot name="empty"></slot>`}}t([st({type:String})],
|
|
4996
|
+
`:D`<slot name="empty"></slot>`}}t([st({type:String})],yl.prototype,"contact",void 0),t([st({type:Object,attribute:!1})],yl.prototype,"data",void 0),t([st({type:String})],yl.prototype,"lang_weekly",void 0),t([st({type:String})],yl.prototype,"lang_daily",void 0),t([st({type:String})],yl.prototype,"lang_once",void 0);class bl extends Ma{constructor(){super(...arguments),this.clickable=!1}static get styles(){return r`
|
|
5176
4997
|
:host {
|
|
5177
|
-
padding: 1em;
|
|
5178
4998
|
}
|
|
5179
4999
|
|
|
5180
5000
|
:hover {
|
|
5181
5001
|
}
|
|
5182
5002
|
|
|
5183
|
-
.ticket:hover {
|
|
5003
|
+
.ticket.clickable:hover {
|
|
5184
5004
|
cursor: pointer;
|
|
5185
5005
|
box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.055),
|
|
5186
5006
|
0 0 0px 2px var(--color-link-primary);
|
|
@@ -5196,6 +5016,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5196
5016
|
}
|
|
5197
5017
|
|
|
5198
5018
|
.ticket {
|
|
5019
|
+
background: #fff;
|
|
5199
5020
|
display: flex;
|
|
5200
5021
|
margin-bottom: 0.5em;
|
|
5201
5022
|
border-radius: var(--curvature);
|
|
@@ -5209,7 +5030,15 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5209
5030
|
.ticket .body {
|
|
5210
5031
|
flex-grow: 1;
|
|
5211
5032
|
display: -webkit-box;
|
|
5212
|
-
-webkit-line-clamp:
|
|
5033
|
+
-webkit-line-clamp: 1;
|
|
5034
|
+
-webkit-box-orient: vertical;
|
|
5035
|
+
overflow: hidden;
|
|
5036
|
+
padding: 0.1em;
|
|
5037
|
+
}
|
|
5038
|
+
|
|
5039
|
+
.date {
|
|
5040
|
+
display: -webkit-box;
|
|
5041
|
+
-webkit-line-clamp: 1;
|
|
5213
5042
|
-webkit-box-orient: vertical;
|
|
5214
5043
|
overflow: hidden;
|
|
5215
5044
|
padding: 0.1em;
|
|
@@ -5217,7 +5046,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5217
5046
|
|
|
5218
5047
|
.ticket > div {
|
|
5219
5048
|
padding: 0.5em 1em;
|
|
5220
|
-
pointer-events: none;
|
|
5221
5049
|
}
|
|
5222
5050
|
|
|
5223
5051
|
.status {
|
|
@@ -5228,26 +5056,50 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5228
5056
|
background: #f9f9f9;
|
|
5229
5057
|
color: #888;
|
|
5230
5058
|
}
|
|
5231
|
-
|
|
5059
|
+
|
|
5060
|
+
.resolve {
|
|
5061
|
+
margin-right: 1em;
|
|
5062
|
+
color: var(--color-primary-dark);
|
|
5063
|
+
}
|
|
5064
|
+
`}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==bt.Open&&e.status==bt.Closed?-1:e.status==bt.Open&&t.status==bt.Closed?1:t.status==bt.Closed&&e.status==bt.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}handleClose(t){le("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleReopen(t){le("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}renderTicket(t){const e=t.opened_on;return D`
|
|
5232
5065
|
<div
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
onclick="goto(event)"
|
|
5066
|
+
@click=${()=>{this.clickable&&this.fireCustomEvent(_t.ButtonClicked,{ticket:t})}}
|
|
5067
|
+
class="ticket ${t.status} ${ie({clickable:this.clickable})}"
|
|
5236
5068
|
>
|
|
5237
5069
|
<div class="topic">${t.topic.name}</div>
|
|
5238
5070
|
<div class="body">${t.body}</div>
|
|
5239
5071
|
|
|
5240
5072
|
<div class="date">
|
|
5241
|
-
<temba-
|
|
5242
|
-
${this.store.getShortDurationFromIso(e)}
|
|
5243
|
-
</temba-tip>
|
|
5073
|
+
<temba-date value="${e}" display="duration"></temba-date>
|
|
5244
5074
|
</div>
|
|
5245
5075
|
|
|
5246
|
-
${t.status===bt.Closed?D`<div class="
|
|
5247
|
-
<temba-
|
|
5248
|
-
|
|
5076
|
+
${t.status===bt.Closed?D`<div class="reopen">
|
|
5077
|
+
<temba-button
|
|
5078
|
+
primary
|
|
5079
|
+
small
|
|
5080
|
+
name="Reopen"
|
|
5081
|
+
@click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleReopen(t.uuid)}}
|
|
5082
|
+
></temba-button>
|
|
5083
|
+
</div>`:D`
|
|
5084
|
+
<div style="font-size:.5em">
|
|
5085
|
+
${t.assignee?Ce({name:t.assignee.name}):null}
|
|
5086
|
+
</div>
|
|
5087
|
+
<temba-tip
|
|
5088
|
+
text="Resolve"
|
|
5089
|
+
position="left"
|
|
5090
|
+
style="width:1.5em"
|
|
5091
|
+
class="resolve"
|
|
5092
|
+
>
|
|
5093
|
+
<temba-icon
|
|
5094
|
+
size="1.25"
|
|
5095
|
+
name="${at.check}"
|
|
5096
|
+
@click=${e=>{e.preventDefault(),e.stopPropagation(),this.handleClose(t.uuid)}}
|
|
5097
|
+
?clickable=${open}
|
|
5098
|
+
/>
|
|
5099
|
+
</temba-tip>
|
|
5100
|
+
`}
|
|
5249
5101
|
</div>
|
|
5250
|
-
`}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return D`${t}`}return D`<slot name="empty"></slot>`}}t([st({type:String})],
|
|
5102
|
+
`}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return D`${t}`}return D`<slot name="empty"></slot>`}}t([st({type:String})],bl.prototype,"contact",void 0),t([st({type:String})],bl.prototype,"ticket",void 0),t([st({type:Boolean})],bl.prototype,"clickable",void 0),t([st({type:Object,attribute:!1})],bl.prototype,"data",void 0);class _l extends lt{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
|
|
5251
5103
|
:host {
|
|
5252
5104
|
display: block;
|
|
5253
5105
|
}
|
|
@@ -5313,7 +5165,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5313
5165
|
<div class="track" @mousedown=${this.handleTrackDown}></div>
|
|
5314
5166
|
${this.range?D`<div class="post">${this.max}</div>`:null}
|
|
5315
5167
|
</div>
|
|
5316
|
-
</div>`}}t([st({type:Boolean})],
|
|
5168
|
+
</div>`}}t([st({type:Boolean})],_l.prototype,"range",void 0),t([st({type:Number})],_l.prototype,"min",void 0),t([st({type:Number})],_l.prototype,"max",void 0);const xl="rgb(223, 65, 159)";class wl extends Ha{static get styles(){return r`
|
|
5317
5169
|
:host {
|
|
5318
5170
|
overflow-y: auto !important;
|
|
5319
5171
|
}
|
|
@@ -5334,10 +5186,10 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5334
5186
|
style="--icon-color:#666;margin-left:0.5em"
|
|
5335
5187
|
/>`:"interrupted"==t.exit_type?e=D`<temba-icon
|
|
5336
5188
|
name="x-octagon"
|
|
5337
|
-
style="--icon-color:${
|
|
5189
|
+
style="--icon-color:${xl};margin-left:0.5em"
|
|
5338
5190
|
/>`:"expired"==t.exit_type?e=D`<temba-icon
|
|
5339
5191
|
name="clock"
|
|
5340
|
-
style="--icon-color:${
|
|
5192
|
+
style="--icon-color:${xl};margin-left:0.5em"
|
|
5341
5193
|
/>`:t.exit_type||(e=t.responded?D`<temba-icon
|
|
5342
5194
|
name="activity"
|
|
5343
5195
|
style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
|
|
@@ -5489,7 +5341,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5489
5341
|
</div>
|
|
5490
5342
|
`:null}
|
|
5491
5343
|
</div>
|
|
5492
|
-
</div>`}constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([st({type:String})],
|
|
5344
|
+
</div>`}constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([st({type:String})],wl.prototype,"flow",void 0),t([st({type:Object,attribute:!1})],wl.prototype,"results",void 0),t([st({type:Boolean})],wl.prototype,"responses",void 0),t([st({type:Object})],wl.prototype,"resultPreview",void 0),t([st({type:Object})],wl.prototype,"selectedRun",void 0);class kl extends Ma{constructor(){super(...arguments),this.endpoint="/api/v2/flows.json?uuid="}prepareData(t){return t&&t.length>0&&(t=t[0]),t}updated(t){super.updated(t),t.has("flow")&&(this.flow?this.url=`${this.endpoint}${this.flow}`:this.url=null)}render(){if(this.data)return D`<div></div>`}}t([st({type:String})],kl.prototype,"flow",void 0),t([st({type:Object,attribute:!1})],kl.prototype,"data",void 0),t([st({type:String})],kl.prototype,"endpoint",void 0);class Sl extends Oa{constructor(){super(...arguments),this.size=20}static get styles(){return r`
|
|
5493
5345
|
:host {
|
|
5494
5346
|
display: flex;
|
|
5495
5347
|
}
|
|
@@ -5502,7 +5354,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5502
5354
|
name=${this.data.name||this.data.anon_display}
|
|
5503
5355
|
urn=${this.data.urns.length>0?this.data.urns[0]:null}
|
|
5504
5356
|
></temba-contact-name>
|
|
5505
|
-
<slot></slot>`:super.render()}}t([st({type:Number,attribute:"icon-size"})],
|
|
5357
|
+
<slot></slot>`:super.render()}}t([st({type:Number,attribute:"icon-size"})],Sl.prototype,"size",void 0);class Cl extends lt{static get styles(){return r`
|
|
5506
5358
|
:host {
|
|
5507
5359
|
display: block;
|
|
5508
5360
|
}
|
|
@@ -5632,7 +5484,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5632
5484
|
`:null}
|
|
5633
5485
|
</div>
|
|
5634
5486
|
</temba-field>
|
|
5635
|
-
`}}t([st({type:String})],
|
|
5487
|
+
`}}t([st({type:String})],Cl.prototype,"timezone",void 0),t([st({type:String})],Cl.prototype,"timezoneFriendly",void 0),t([st({type:Object})],Cl.prototype,"datetime",void 0),t([st({type:Boolean})],Cl.prototype,"time",void 0);const El={text:"Text",numeric:"Number",number:"Number",datetime:"Date & Time",state:"State",ward:"Ward",district:"District"},Tl=(t,e)=>{if(!e)return!0;return(t.label+t.key+El[t.value_type]).toLowerCase().toLowerCase().indexOf(e)>-1};class $l extends Ma{constructor(){super(...arguments),this.otherFieldKeys=[],this.query=""}static get styles(){return r`
|
|
5636
5488
|
:host {
|
|
5637
5489
|
display: flex;
|
|
5638
5490
|
flex-grow: 1;
|
|
@@ -5724,7 +5576,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5724
5576
|
border-color: #e6e6e6;
|
|
5725
5577
|
background: #fcfcfc;
|
|
5726
5578
|
}
|
|
5727
|
-
`}firstUpdated(t){super.firstUpdated(t),this.url=this.store.fieldsEndpoint}filterFields(){const t=this.store.getFieldKeys().filter((t=>{const e=this.store.getContactField(t);return!e.featured
|
|
5579
|
+
`}firstUpdated(t){super.firstUpdated(t),this.url=this.store.fieldsEndpoint}filterFields(){const t=this.store.getFieldKeys().filter((t=>{const e=this.store.getContactField(t);return!e.featured&&Tl(e,this.query)}));t.sort(((t,e)=>this.store.getContactField(t).label.localeCompare(this.store.getContactField(e).label)));const e=[];this.store.getFeaturedFields().forEach((t=>{Tl(t,this.query)&&e.push(t)})),this.otherFieldKeys=t,this.featuredFields=e}updated(t){super.update(t),(t.has("data")||t.has("query"))&&this.filterFields()}handleSaveOrder(t){const e=t.currentTarget;le(this.priorityEndpoint,e.getIds().reverse().reduce(((t,e,i)=>(t[e]=i,t)),{})).then((()=>{this.store.refreshFields()}))}handleOrderChanged(t){const e=t.detail,i=this.featuredFields[e.fromIdx];this.featuredFields[e.fromIdx]=this.featuredFields[e.toIdx],this.featuredFields[e.toIdx]=i,this.requestUpdate("featuredFields")}handleDragStart(t){this.draggingId=t.detail.id}handleDragStop(){this.draggingId=null}handleFieldAction(t){const e=t.target,i=e.dataset.key,n=e.dataset.action;this.fireCustomEvent(_t.Selection,{key:i,action:n})}handleSearch(t){this.query=(t.target.value||"").trim()}hasUsages(t){return t.usages.campaign_events+t.usages.flows+t.usages.groups>0}renderField(t){return D`
|
|
5728
5580
|
<div
|
|
5729
5581
|
class="field sortable"
|
|
5730
5582
|
id="${t.key}"
|
|
@@ -5762,7 +5614,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5762
5614
|
<div style="flex-grow:1; font-family: monospace; font-size:0.8em;">
|
|
5763
5615
|
@fields.${t.key}
|
|
5764
5616
|
</div>
|
|
5765
|
-
<div>${
|
|
5617
|
+
<div>${El[t.value_type]}</div>
|
|
5766
5618
|
<temba-icon
|
|
5767
5619
|
style="pointer-events:none;color:#ccc;margin-left:0.3em;margin-right:-0.5em;opacity:0"
|
|
5768
5620
|
name="delete_small"
|
|
@@ -5811,7 +5663,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5811
5663
|
${this.otherFieldKeys.map((t=>this.renderField(this.store.getContactField(t))))}
|
|
5812
5664
|
</div>
|
|
5813
5665
|
</div>
|
|
5814
|
-
`:null}}t([st({type:String,attribute:"priority-endpoint"})]
|
|
5666
|
+
`:null}}t([st({type:String,attribute:"priority-endpoint"})],$l.prototype,"priorityEndpoint",void 0),t([st({type:Object,attribute:!1})],$l.prototype,"featuredFields",void 0),t([st({type:Object,attribute:!1})],$l.prototype,"otherFieldKeys",void 0),t([st({type:String})],$l.prototype,"draggingId",void 0),t([st({type:String})],$l.prototype,"query",void 0);class Al extends nt{static get styles(){return r`
|
|
5815
5667
|
:host {
|
|
5816
5668
|
margin: auto;
|
|
5817
5669
|
}
|
|
@@ -5858,7 +5710,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5858
5710
|
<div class="container">
|
|
5859
5711
|
<slot @mousedown=${this.handleMouseDown}></slot>
|
|
5860
5712
|
</div>
|
|
5861
|
-
`}}t([st({type:String})],
|
|
5713
|
+
`}}t([st({type:String})],Al.prototype,"draggingId",void 0);const Ll={"Temba-Content-Menu":"1","Temba-Spa":"1"};var Ml;!function(t){t.LINK="link",t.JS="js",t.URL_POST="url_post",t.MODAX="modax",t.DIVIDER="divider"}(Ml||(Ml={}));class Ol extends nt{constructor(){super(...arguments),this.buttons=[],this.items=[]}static get styles(){return r`
|
|
5862
5714
|
.container {
|
|
5863
5715
|
--button-y: 0.4em;
|
|
5864
5716
|
--button-x: 1em;
|
|
@@ -5905,7 +5757,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5905
5757
|
.item:hover {
|
|
5906
5758
|
color: rgb(var(--primary-rgb));
|
|
5907
5759
|
}
|
|
5908
|
-
`}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=
|
|
5760
|
+
`}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=Ll;e&&delete i["Temba-Spa"],ee(t,null,i).then((t=>{const e=t.json.items;e?(this.buttons=e.filter((t=>t.as_button)),this.items=e.filter((t=>!t.as_button))):(this.buttons=[],this.items=[]),this.fireCustomEvent(_t.Loaded,{buttons:this.buttons,items:this.items})})).catch((t=>{console.error(t)}))}}refresh(){this.fetchContentMenu()}updated(t){super.updated(t),(t.has("endpoint")||t.has("legacy"))&&this.fetchContentMenu()}handleItemClicked(t,e){this.fireCustomEvent(_t.Selection,{item:t,event:e})}render(){return D`
|
|
5909
5761
|
<div class="container">
|
|
5910
5762
|
${this.buttons.map((t=>D`<temba-button
|
|
5911
5763
|
class="${t.primary?"primary_button_item":"button_item"}"
|
|
@@ -5924,7 +5776,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5924
5776
|
<temba-icon name="menu" size="1.5"></temba-icon>
|
|
5925
5777
|
</div>
|
|
5926
5778
|
<div slot="dropdown" class="dropdown">
|
|
5927
|
-
${this.items.map((t=>t.type===
|
|
5779
|
+
${this.items.map((t=>t.type===Ml.DIVIDER?D` <div class="divider"></div>`:D` <div
|
|
5928
5780
|
class="item"
|
|
5929
5781
|
name=${t.label}
|
|
5930
5782
|
@click=${e=>this.handleItemClicked(t,e)}
|
|
@@ -5934,29 +5786,29 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5934
5786
|
</div>
|
|
5935
5787
|
</temba-dropdown>`:null}
|
|
5936
5788
|
</div>
|
|
5937
|
-
`}}t([st({type:String})],
|
|
5789
|
+
`}}t([st({type:String})],Ol.prototype,"endpoint",void 0),t([st({type:Number})],Ol.prototype,"legacy",void 0),t([st({type:Array,attribute:!1})],Ol.prototype,"buttons",void 0),t([st({type:Array,attribute:!1})],Ol.prototype,"items",void 0);const zl={date:Ss.DATE_SHORT,datetime:Ss.DATETIME_SHORT,time:Ss.TIME_SIMPLE,timedate:"timedate",duration:"duration",relative:"relative",day:"LLL d"};class Pl extends nt{constructor(){super(...arguments),this.display="date"}static get styles(){return r`
|
|
5938
5790
|
.date {
|
|
5939
5791
|
display: block;
|
|
5940
5792
|
overflow: hidden;
|
|
5941
5793
|
text-overflow: ellipsis;
|
|
5942
5794
|
white-space: nowrap;
|
|
5943
5795
|
}
|
|
5944
|
-
`}firstUpdated(t){super.firstUpdated(t),t.has("value")&&(this.datetime=Ss.fromISO(this.value)
|
|
5796
|
+
`}firstUpdated(t){super.firstUpdated(t),this.store=document.querySelector("temba-store")}updated(t){super.updated(t),t.has("value")&&(this.datetime=Ss.fromISO(this.value))}connectedCallback(){super.connectedCallback()}render(){if(this.datetime&&this.store){this.datetime.setLocale(this.store.getLocale());let t="";if(this.display===zl.timedate){const e=Math.abs(this.datetime.diffNow().milliseconds/1e3/60/60);t=e<24?this.datetime.toLocaleString(zl.time):e<8760?this.datetime.toFormat(zl.day):this.datetime.toLocaleString(zl.date)}else if(this.display===zl.relative){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
|
|
5945
5797
|
class="date"
|
|
5946
|
-
title="${this.datetime.toLocaleString(
|
|
5798
|
+
title="${this.datetime.toLocaleString(zl.datetime)}"
|
|
5947
5799
|
>
|
|
5948
5800
|
just now
|
|
5949
|
-
</div>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===
|
|
5801
|
+
</div>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===zl.duration){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
|
|
5950
5802
|
class="date"
|
|
5951
|
-
title="${this.datetime.toLocaleString(
|
|
5803
|
+
title="${this.datetime.toLocaleString(zl.datetime)}"
|
|
5952
5804
|
>
|
|
5953
5805
|
just now
|
|
5954
|
-
</div>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===
|
|
5806
|
+
</div>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===zl.day?this.datetime.toLocaleString(zl.day):this.datetime.toLocaleString(zl[this.display]);return D`<div
|
|
5955
5807
|
class="date"
|
|
5956
|
-
title="${this.datetime.toLocaleString(
|
|
5808
|
+
title="${this.datetime.toLocaleString(zl.datetime)}"
|
|
5957
5809
|
>
|
|
5958
5810
|
${t}
|
|
5959
|
-
</div>`}}}t([st({type:String})],
|
|
5811
|
+
</div>`}}}t([st({type:String})],Pl.prototype,"value",void 0),t([st({type:String})],Pl.prototype,"display",void 0),t([st({type:Object,attribute:!1})],Pl.prototype,"datetime",void 0);let Il=class extends nt{constructor(){super(...arguments),this.body=D`<temba-loading></temba-loading>`}static get styles(){return r``}updated(t){super.updated(t),t.has("endpoint")&&ee(this.endpoint).then((t=>{console.log(t),this.body=As(t.body)}))}render(){return D`${this.body}`}};t([st({type:String})],Il.prototype,"endpoint",void 0),t([st({attribute:!1})],Il.prototype,"body",void 0),Il=t([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("temba-remote")],Il);var Dl=Il;class Nl extends nt{constructor(){super(...arguments),this.animationTime=300,this.show=!1,this.zoom=!1,this.zoomPct=.9,this.scale=1,this.xTrans="0px",this.yTrans="0px"}static get styles(){return r`
|
|
5960
5812
|
:host {
|
|
5961
5813
|
position: absolute;
|
|
5962
5814
|
}
|
|
@@ -5996,7 +5848,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
5996
5848
|
${this.show?this.ele:null}
|
|
5997
5849
|
</div>
|
|
5998
5850
|
</div>
|
|
5999
|
-
`}}function
|
|
5851
|
+
`}}function Rl(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([st({type:Number})],Nl.prototype,"animationTime",void 0),t([st({type:Boolean})],Nl.prototype,"show",void 0),t([st({type:Boolean})],Nl.prototype,"zoom",void 0),t([st({type:Number})],Nl.prototype,"zoomPct",void 0),Rl("temba-anchor",rl),Rl("temba-alert",Ka),Rl("temba-store",Es),Rl("temba-textinput",gt),Rl("temba-datepicker",Cl),Rl("temba-date",Pl),Rl("temba-completion",ga),Rl("temba-checkbox",ht),Rl("temba-select",fa),Rl("temba-options",Ts),Rl("temba-loading",xa),Rl("temba-lightbox",Nl),Rl("temba-button",ba),Rl("temba-omnibox",tl),Rl("temba-tip",nl),Rl("temba-contact-name",dl),Rl("temba-contact-name-fetch",Sl),Rl("temba-contact-field",ml),Rl("temba-contact-fields",pl),Rl("temba-field-manager",$l),Rl("temba-urn",ul),Rl("temba-content-menu",Ol),Rl("temba-field",_a),Rl("temba-dialog",ya),Rl("temba-modax",va),Rl("temba-charcount",La),Rl("temba-contact-history",ja),Rl("temba-contact-chat",za),Rl("temba-contact-details",Ga),Rl("temba-ticket-list",Wa),Rl("temba-list",Ha),Rl("temba-sortable-list",Al),Rl("temba-run-list",wl),Rl("temba-flow-details",kl),Rl("temba-label",cl),Rl("temba-menu",sl),Rl("temba-remote",Dl),Rl("temba-contact-search",Ya),Rl("temba-icon",Ja),Rl("temba-dropdown",al),Rl("temba-tabs",ll),Rl("temba-tab",hl),Rl("temba-contact-badges",gl),Rl("temba-contact-pending",yl),Rl("temba-contact-tickets",bl),Rl("temba-slider",_l),Rl("temba-content-menu",Ol),Rl("temba-compose",wt);class Bl extends et{static get styles(){return r`
|
|
6000
5852
|
:host {
|
|
6001
5853
|
line-height: normal;
|
|
6002
5854
|
}
|
|
@@ -6204,7 +6056,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
6204
6056
|
></temba-textinput>
|
|
6205
6057
|
</div>
|
|
6206
6058
|
</temba-dialog>
|
|
6207
|
-
`}}t([st({type:Array,attribute:!1})],ql.prototype,"path",void 0),t([st()],ql.prototype,"endpoint",void 0),t([st()],ql.prototype,"osmId",void 0),t([st({type:Object})],ql.prototype,"hovered",void 0),t([st({type:Object})],ql.prototype,"editFeature",void 0),t([st({type:String,attribute:!1})],ql.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Zl={};!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function h(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||x("RequestAnimationFrame")||k,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function E(t,e,i){if(!i||S!==k)return S.call(window,s(t,e));t.call(e)}function T(t){t&&C.call(window,t)}var $=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:S,cancelFn:C,requestAnimFrame:E,cancelAnimFrame:T});function A(){}function M(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(M(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},A.include=function(t){return n(this.prototype,t),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=A.extend(O);function P(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof P?t:y(t)?new P(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new P(t.x,t.y):new P(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function q(t,e){return t instanceof B?t:new B(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof Z?t:y(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new P(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new P(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new P((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new P(this.min.x,this.max.y)},getTopRight:function(){return new P(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof P?D(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(F(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?F(t):q(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,F(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return q([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};var U={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new Z(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new B(new Z(s.lat-n,s.lng-o),new Z(r.lat-n,r.lng-o))}},V=n({},U,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),j=6378137,H={R:j,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new P(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=j*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function G(t,e,i,n){return new W(t,e,i,n)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new P((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,s,r,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,s=(r=t[i]).length;n<s;n++)l+=(n?"L":"M")+(a=r[n]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Mt("webkit"),ot=Mt("android"),st=Mt("android 2")||Mt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&Mt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Mt("chrome"),ct=Mt("gecko")&&!nt&&!lt&&!tt,dt=!ht&&Mt("safari"),ut=Mt("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!ut,bt="undefined"!=typeof orientation||Mt("mobile"),_t=bt&&nt,xt=bt&>,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),St=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=bt&<,Et=bt&&ct,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,$t=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!J("svg").createSVGRect),Lt=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ot=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:St,mobileOpera:Ct,mobileGecko:Et,retina:Tt,canvas:$t,svg:At,vml:Lt}),zt=wt?"MSPointerDown":"pointerdown",Pt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,qt=0;function Zt(t,e,i,n){return"touchstart"===e?Ut(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Kt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,n,!1):"touchmove"===e?t.removeEventListener(Pt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(Dt,n,!1)),this}function Ut(t,e,i){var n=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ue(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(zt,n,!1),Bt||(document.documentElement.addEventListener(zt,Vt,!0),document.documentElement.addEventListener(Pt,jt,!0),document.documentElement.addEventListener(It,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Bt=!0)}function Vt(t){Rt[t.pointerId]=t,qt++}function jt(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Pt,n,!1)}function Kt(t,e,i){var n=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(Dt,n,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function l(t){if(s&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Yt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Yt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function de(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var s=_e(t);be(t,(s?s+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new P(0,0);t.style[re]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ce(t,e){t._leaflet_pos=e,yt?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ee(t){return t._leaflet_pos||new P(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Ue)},ie=function(){Ne(window,"selectstart",Ue)};else{var Te=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Te){var t=document.documentElement.style;ne=t[Te],t[Te]="none"}},ie=function(){Te&&(document.documentElement.style[Te]=ne,ne=void 0)}}function $e(){Ie(window,"dragstart",Ue)}function Ae(){Ne(window,"dragstart",Ue)}function Le(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Me(),oe=t,se=t.style.outline,t.style.outline="none",Ie(window,"keydown",Me))}function Me(){oe&&(oe.style.outline=se,oe=void 0,se=void 0,Ne(window,"keydown",Me))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Pe=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Se,setPosition:Ce,getPosition:Ee,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:$e,enableImageDrag:Ae,preventOutline:Le,restoreOutline:Me,getSizedParentNode:Oe,getScale:ze});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,n);return this}var De="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,n);else{for(var a in t[De])Be(t,a,t[De][a]);delete t[De]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[De]&&t[De][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Zt(t,e,s,o):!St||"dblclick"!==e||!Qt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Xe(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&ot&&(s=function(t){Qe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Qt(t,s,o),t[De]=t[De]||{},t[De][o]=s}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[De]&&t[De][o];if(!s)return this;kt&&0===e.indexOf("touch")?Ft(t,e,o):!St||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,o),t[De][o]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function Ze(t){return Re(t,"mousewheel",qe),this}function Fe(t){return Ie(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function Ue(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return Ue(t),qe(t),this}function je(t,e){if(!e)return new P(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new P((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ge,Ke={};function Ye(t){Ke[t.type]=!0}function Je(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ge&&i-Ge;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?Ve(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:qe,disableScrollPropagation:Ze,disableClickPropagation:Fe,preventDefault:Ue,stop:Ve,getMousePosition:je,getWheelDelta:We,fakeStop:Ye,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ee(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ce(this._el,i),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=(t instanceof P?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=o.distanceTo(n)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=u(0);function v(t){return a*(m(g)/m(g+c*t))}function y(t){return a*(m(g)*f(g+c*t)-p(g))/d}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-g)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=b(i)*x;i<=1?(this._flyToFrame=E(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-n.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-n.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new Z(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(r,n)).getSize(),c=yt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(St?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(dt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new P(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=E((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Xe(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Le(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ue(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ee(this._mapPane)||new P(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new N(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new P(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(E((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),E((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),si=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=de("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=de("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Fe(e),Ze(e);var n=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=de("a",t+"-toggle",e);o.href="#",o.title="Layers",St?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",n),this._separator=de("div",t+"-separator",n),this._overlaysList=de("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=de("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Fe(s),Ie(s,"click",Ve),Ie(s,"click",o,this),Ie(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=de("div",e,i)),t.imperial&&(this._iScale=de("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Fe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=li,oi.Scale=ci,oi.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:O},vi=St?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Le(this._element),$e(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new P(e.clientX,e.clientY),this._parentScale=ze(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new P(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ue(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ee(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=E(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);Ae(),ie(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Si(t=Ei(t,i),i)}function wi(t,e,i){return Math.sqrt(Mi(t,e,i,!0))}function ki(t,e,i){return Mi(t,e,i)}function Si(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ci(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}function Ci(t,e,i,n,o){var s,r,a,l=0;for(r=n+1;r<=o-1;r++)(a=Mi(t[r],t[n],t[o],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ci(t,e,i,n,s),Ci(t,e,i,s,o))}function Ei(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)Li(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}function Ti(t,e,i,n,o){var s,r,a,l=n?fi:Ai(t,i),h=Ai(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Ai(r=$i(t,e,s=l||h,i,o),i),s===l?(t=r,l=a):(e=r,h=a)}}function $i(t,e,i,n,o){var s,r,a=e.x-t.x,l=e.y-t.y,h=n.min,c=n.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new P(s,r,o)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Li(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Mi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((o=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new P(s,r)}function Oi(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var Pi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ti,_getEdgeIntersection:$i,_getBitCode:Ai,_sqClosestPointOnSegment:Mi,isFlat:Oi,_flat:zi});function Ii(t,e,i){var n,o,s,r,a,l,h,c,d,u=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Ai(t[o],e);for(r=0;r<4;r++){for(c=u[r],n=[],o=0,s=(h=t.length)-1;o<h;s=o++)a=t[o],l=t[s],a._code&c?l._code&c||((d=$i(l,a,c,e,i))._code=Ai(d,e),n.push(d)):(l._code&c&&((d=$i(l,a,c,e,i))._code=Ai(d,e),n.push(d)),n.push(a));t=n}return t}var Di=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new P(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new Z(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:H}),qi=n({},V,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return G(t,.5,-t,.5)}()}),Zi=n({},V,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Fi=n({},U,{projection:Ni,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});U.Earth=V,U.EPSG3395=qi,U.EPSG3857=K,U.EPSG900913=Y,U.EPSG4326=Zi,U.Simple=Fi;var Ui=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Vi=Ui.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),ji=function(t,e){return new Vi(t,e)},Hi=Vi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Vi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=D(n),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Tt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ki(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Ee(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=E(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=E(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ee(e._icon),o=e._map.layerPointToLatLng(n);i&&Ce(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Ui.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=F(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,s=this._mRadius/V.R/o,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function sn(t,e,i){return new on(t,e,i)}var rn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,s=Mi,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<n&&(n=d,o=s(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],s=a[t+1],(n+=i=o.distanceTo(s))>e)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),n=0,o=t.length;n<o;n++)i?(e[n]=F(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new P(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof Z,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,s,r,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ti(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new rn(t,e)}rn._flat=zi;var ln=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],n=h[e],o=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*o,a+=(i.y+n.y)*o,s+=3*o;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof Z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new P(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(l=(e=this._parts[o]).length)-1;s<l;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function hn(t,e){return new ln(t,e)}var cn=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=dn(t,s);return r?(r.feature=vn(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function dn(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||un;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Xi(i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=c(a[o]),l.push(h?h(t,i):new Xi(i));return new Hi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===r.type?0:1,c),new rn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===r.type?1:2,c),new ln(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var d=dn({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function un(t){return new Z(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?pn(t[s],e-1,i):(i||un)(t[s]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function fn(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?fn(t[s],e-1,i,n):mn(t[s],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new cn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),rn.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=vn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ce(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Sn(t,e,i){return new kn(t,e,i)}var Cn=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function En(t,e,i){return new Cn(t,e,i)}var Tn=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(s(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Hi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),$n=Tn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Tn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",qe))},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",qe))},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=de("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=de("div",t+"-content-wrapper",e);if(this._contentNode=de("div",t+"-content",i),Fe(i),Ze(this._contentNode),Ie(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=de("a",t+"-close-button",e);n.href="#close",n.innerHTML="×",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,s)):ye(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ce(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add(Ee(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+n+l.x>h.x&&(c=s.x+n-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new $n(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof $n||(t=new $n(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof $n?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new $n(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ln=Tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Tn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return St&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ce(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Mn=function(t,e){return new Ln(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Ln||(t=new Ln(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Ln?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ln(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),St&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var On=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zn(t){return new On(t)}Gi.Default=Yi;var Pn=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof P?t:new P(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);xe(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new P(+o,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new P(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Se(t.el,o,n):Ce(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*n);return new N(o.subtract(s),o.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new P(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new P(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&E(s(this._tileReady,this,t,null,o)),Ce(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new P(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new Pn(t)}var Dn=Pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Tt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",s(this._tileOnLoad,this,e,i)),Ie(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Tt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Pn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Pn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new Dn(t,e)}var Rn=Dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var s=(e=m(this,e)).detectRetina&&Tt?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Zi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Dn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}Dn.WMS=Rn,Nn.wms=Bn;var qn=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Ee(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=o.multiplyBy(-i).add(n).add(o).subtract(r);yt?Se(this._container,a,i):Ce(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ue(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Tt?2:1;Ce(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Tt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||E(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],l[n?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fn(t){return $t?new Zn(t):null}var Un=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Vn={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Un("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Un("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Un("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Un("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},jn=Lt?Un:J,Hn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ce(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=jn("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Wn(t){return At||Lt?new Hn(t):null}Lt&&Hn.include(Vn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Fn(t)||Wn(t)}});var Gn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Gn(t,e)}Hn.create=jn,Hn.pointsToPath=X,cn.geometryToLayer=dn,cn.coordsToLatLng=un,cn.coordsToLatLngs=pn,cn.latLngToCoords=mn,cn.latLngsToCoords=fn,cn.getFeature=gn,cn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Yn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),$e(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ce(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ie(),Ae(),Ne(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Yn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=o.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),E((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ue(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new P(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new P(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});St&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:St&&!st,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Ue(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=E(a,this,!0),Ue(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Yn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=si,t.Browser=Ot,t.Evented=z,t.Mixin=gi,t.Util=$,t.Class=A,t.Handler=mi,t.extend=n,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Pe,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Pi,t.PolyUtil=Di,t.Point=P,t.point=D,t.Bounds=N,t.bounds=R,t.Transformation=W,t.transformation=G,t.Projection=Bi,t.LatLng=Z,t.latLng=F,t.LatLngBounds=B,t.latLngBounds=q,t.CRS=U,t.GeoJSON=cn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Ui,t.LayerGroup=Vi,t.layerGroup=ji,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Sn,t.SVGOverlay=Cn,t.svgOverlay=En,t.DivOverlay=Tn,t.Popup=$n,t.popup=An,t.Tooltip=Ln,t.tooltip=Mn,t.Icon=Gi,t.icon=Ki,t.DivIcon=On,t.divIcon=zn,t.Marker=Xi,t.marker=Qi,t.TileLayer=Dn,t.tileLayer=Nn,t.GridLayer=Pn,t.gridLayer=In,t.SVG=Hn,t.svg=Wn,t.Renderer=qn,t.Canvas=Zn,t.canvas=Fn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=sn,t.Polyline=rn,t.polyline=an,t.Polygon=ln,t.polygon=hn,t.Rectangle=Gn,t.rectangle=Kn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(Zl);const Fl={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},Ul={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},Vl=()=>Fl;class jl extends et{static get styles(){return r`
|
|
6059
|
+
`}}t([st({type:Array,attribute:!1})],Bl.prototype,"path",void 0),t([st()],Bl.prototype,"endpoint",void 0),t([st()],Bl.prototype,"osmId",void 0),t([st({type:Object})],Bl.prototype,"hovered",void 0),t([st({type:Object})],Bl.prototype,"editFeature",void 0),t([st({type:String,attribute:!1})],Bl.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ql={};!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function h(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||x("RequestAnimationFrame")||k,C=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function E(t,e,i){if(!i||S!==k)return S.call(window,s(t,e));t.call(e)}function T(t){t&&C.call(window,t)}var $=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:S,cancelFn:C,requestAnimFrame:E,cancelAnimFrame:T});function A(){}function M(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(M(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},A.include=function(t){return n(this.prototype,t),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=A.extend(O);function P(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof P?t:y(t)?new P(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new P(t.x,t.y):new P(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function q(t,e){return t instanceof B?t:new B(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof Z?t:y(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new P(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new P(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new P((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new P(this.min.x,this.max.y)},getTopRight:function(){return new P(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof P?D(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(F(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?F(t):q(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+d(this.lat,t)+", "+d(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,F(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return q([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};var U={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new Z(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new B(new Z(s.lat-n,s.lng-o),new Z(r.lat-n,r.lng-o))}},V=n({},U,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),j=6378137,H={R:j,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new P(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=j*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function G(t,e,i,n){return new W(t,e,i,n)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new P((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,s,r,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,s=(r=t[i]).length;n<s;n++)l+=(n?"L":"M")+(a=r[n]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Mt("webkit"),ot=Mt("android"),st=Mt("android 2")||Mt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&Mt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Mt("chrome"),ct=Mt("gecko")&&!nt&&!lt&&!tt,dt=!ht&&Mt("safari"),ut=Mt("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!ut,bt="undefined"!=typeof orientation||Mt("mobile"),_t=bt&&nt,xt=bt&>,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),St=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=bt&<,Et=bt&&ct,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,$t=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!J("svg").createSVGRect),Lt=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ot=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:St,mobileOpera:Ct,mobileGecko:Et,retina:Tt,canvas:$t,svg:At,vml:Lt}),zt=wt?"MSPointerDown":"pointerdown",Pt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,qt=0;function Zt(t,e,i,n){return"touchstart"===e?Ut(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Kt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,n,!1):"touchmove"===e?t.removeEventListener(Pt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(Dt,n,!1)),this}function Ut(t,e,i){var n=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Ue(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(zt,n,!1),Bt||(document.documentElement.addEventListener(zt,Vt,!0),document.documentElement.addEventListener(Pt,jt,!0),document.documentElement.addEventListener(It,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Bt=!0)}function Vt(t){Rt[t.pointerId]=t,qt++}function jt(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Pt,n,!1)}function Kt(t,e,i){var n=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(Dt,n,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function l(t){if(s&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Yt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Yt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function de(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var s=_e(t);be(t,(s?s+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new P(0,0);t.style[re]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ce(t,e){t._leaflet_pos=e,yt?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ee(t){return t._leaflet_pos||new P(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Ue)},ie=function(){Ne(window,"selectstart",Ue)};else{var Te=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Te){var t=document.documentElement.style;ne=t[Te],t[Te]="none"}},ie=function(){Te&&(document.documentElement.style[Te]=ne,ne=void 0)}}function $e(){Ie(window,"dragstart",Ue)}function Ae(){Ne(window,"dragstart",Ue)}function Le(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Me(),oe=t,se=t.style.outline,t.style.outline="none",Ie(window,"keydown",Me))}function Me(){oe&&(oe.style.outline=se,oe=void 0,se=void 0,Ne(window,"keydown",Me))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Pe=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Se,setPosition:Ce,getPosition:Ee,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:$e,enableImageDrag:Ae,preventOutline:Le,restoreOutline:Me,getSizedParentNode:Oe,getScale:ze});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,n);return this}var De="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,n);else{for(var a in t[De])Be(t,a,t[De][a]);delete t[De]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[De]&&t[De][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Zt(t,e,s,o):!St||"dblclick"!==e||!Qt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Xe(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&ot&&(s=function(t){Qe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Qt(t,s,o),t[De]=t[De]||{},t[De][o]=s}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[De]&&t[De][o];if(!s)return this;kt&&0===e.indexOf("touch")?Ft(t,e,o):!St||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,o),t[De][o]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function Ze(t){return Re(t,"mousewheel",qe),this}function Fe(t){return Ie(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function Ue(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return Ue(t),qe(t),this}function je(t,e){if(!e)return new P(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new P((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ge,Ke={};function Ye(t){Ke[t.type]=!0}function Je(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ge&&i-Ge;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?Ve(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:qe,disableScrollPropagation:Ze,disableClickPropagation:Fe,preventDefault:Ue,stop:Ve,getMousePosition:je,getWheelDelta:We,fakeStop:Ye,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ee(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=E(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ce(this._el,i),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=(t instanceof P?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=o.distanceTo(n)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=u(0);function v(t){return a*(m(g)/m(g+c*t))}function y(t){return a*(m(g)*f(g+c*t)-p(g))/d}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-g)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=b(i)*x;i<=1?(this._flyToFrame=E(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-n.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-n.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new Z(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(r,n)).getSize(),c=yt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(St?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(dt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ce(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ce(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ce(this._mapPane,new P(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ce(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=E((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Xe(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Le(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ue(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ee(this._mapPane)||new P(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new N(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new P(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(E((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),E((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),si=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=de("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=de("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Fe(e),Ze(e);var n=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=de("a",t+"-toggle",e);o.href="#",o.title="Layers",St?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",n),this._separator=de("div",t+"-separator",n),this._overlaysList=de("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=de("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Fe(s),Ie(s,"click",Ve),Ie(s,"click",o,this),Ie(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=de("div",e,i)),t.imperial&&(this._iScale=de("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Fe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=li,oi.Scale=ci,oi.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:O},vi=St?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Le(this._element),$e(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new P(e.clientX,e.clientY),this._parentScale=ze(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new P(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ue(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ee(this._element).subtract(i),ve(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ve(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=E(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ce(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);Ae(),ie(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Si(t=Ei(t,i),i)}function wi(t,e,i){return Math.sqrt(Mi(t,e,i,!0))}function ki(t,e,i){return Mi(t,e,i)}function Si(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ci(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}function Ci(t,e,i,n,o){var s,r,a,l=0;for(r=n+1;r<=o-1;r++)(a=Mi(t[r],t[n],t[o],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ci(t,e,i,n,s),Ci(t,e,i,s,o))}function Ei(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)Li(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}function Ti(t,e,i,n,o){var s,r,a,l=n?fi:Ai(t,i),h=Ai(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Ai(r=$i(t,e,s=l||h,i,o),i),s===l?(t=r,l=a):(e=r,h=a)}}function $i(t,e,i,n,o){var s,r,a=e.x-t.x,l=e.y-t.y,h=n.min,c=n.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new P(s,r,o)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Li(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Mi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((o=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new P(s,r)}function Oi(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var Pi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ti,_getEdgeIntersection:$i,_getBitCode:Ai,_sqClosestPointOnSegment:Mi,isFlat:Oi,_flat:zi});function Ii(t,e,i){var n,o,s,r,a,l,h,c,d,u=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Ai(t[o],e);for(r=0;r<4;r++){for(c=u[r],n=[],o=0,s=(h=t.length)-1;o<h;s=o++)a=t[o],l=t[s],a._code&c?l._code&c||((d=$i(l,a,c,e,i))._code=Ai(d,e),n.push(d)):(l._code&c&&((d=$i(l,a,c,e,i))._code=Ai(d,e),n.push(d)),n.push(a));t=n}return t}var Di=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new P(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new Z(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:H}),qi=n({},V,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return G(t,.5,-t,.5)}()}),Zi=n({},V,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Fi=n({},U,{projection:Ni,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});U.Earth=V,U.EPSG3395=qi,U.EPSG3857=K,U.EPSG900913=Y,U.EPSG4326=Zi,U.Simple=Fi;var Ui=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Vi=Ui.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),ji=function(t,e){return new Vi(t,e)},Hi=Vi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Vi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=D(n),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Tt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ki(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Ee(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ce(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=E(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup().fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=E(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ee(e._icon),o=e._map.layerPointToLatLng(n);i&&Ce(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Ui.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ce(this._icon,t),this._shadow&&Ce(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=F(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,s=this._mRadius/V.R/o,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function sn(t,e,i){return new on(t,e,i)}var rn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,s=Mi,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<n&&(n=d,o=s(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],s=a[t+1],(n+=i=o.distanceTo(s))>e)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),n=0,o=t.length;n<o;n++)i?(e[n]=F(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new P(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof Z,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,s,r,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ti(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new rn(t,e)}rn._flat=zi;var ln=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],n=h[e],o=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*o,a+=(i.y+n.y)*o,s+=3*o;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof Z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new P(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(l=(e=this._parts[o]).length)-1;s<l;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function hn(t,e){return new ln(t,e)}var cn=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=dn(t,s);return r?(r.feature=vn(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function dn(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||un;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Xi(i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=c(a[o]),l.push(h?h(t,i):new Xi(i));return new Hi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===r.type?0:1,c),new rn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===r.type?1:2,c),new ln(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var d=dn({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function un(t){return new Z(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?pn(t[s],e-1,i):(i||un)(t[s]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function fn(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?fn(t[s],e-1,i,n):mn(t[s],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new cn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),rn.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=vn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ce(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Sn(t,e,i){return new kn(t,e,i)}var Cn=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function En(t,e,i){return new Cn(t,e,i)}var Tn=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){m(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&xe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&xe(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(xe(this._container,0),this._removeTimeout=setTimeout(s(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Hi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ce(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),$n=Tn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Tn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",qe))},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",qe))},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=de("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=de("div",t+"-content-wrapper",e);if(this._contentNode=de("div",t+"-content",i),Fe(i),Ze(this._contentNode),Ie(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=de("a",t+"-close-button",e);n.href="#close",n.innerHTML="×",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,s)):ye(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ce(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add(Ee(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+n+l.x>h.x&&(c=s.x+n-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new $n(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof $n||(t=new $n(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof $n?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new $n(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ln=Tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Tn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return St&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ce(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Mn=function(t,e){return new Ln(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Ln||(t=new Ln(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Ln?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ln(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),St&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var On=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zn(t){return new On(t)}Gi.Default=Yi;var Pn=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof P?t:new P(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);xe(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new P(+o,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new P(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Se(t.el,o,n):Ce(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*n);return new N(o.subtract(s),o.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new P(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new P(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&E(s(this._tileReady,this,t,null,o)),Ce(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),T(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(ve(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new P(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new Pn(t)}var Dn=Pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Tt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",s(this._tileOnLoad,this,e,i)),Ie(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Tt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Pn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Pn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new Dn(t,e)}var Rn=Dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var s=(e=m(this,e)).detectRetina&&Tt?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Zi?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Dn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}Dn.WMS=Rn,Nn.wms=Bn;var qn=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Ee(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=o.multiplyBy(-i).add(n).add(o).subtract(r);yt?Se(this._container,a,i):Ce(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new N(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Zn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ue(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Tt?2:1;Ce(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Tt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||E(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],l[n?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Fn(t){return $t?new Zn(t):null}var Un=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Vn={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Un("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Un("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Un("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Un("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},jn=Lt?Un:J,Hn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ce(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=jn("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Wn(t){return At||Lt?new Hn(t):null}Lt&&Hn.include(Vn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Fn(t)||Wn(t)}});var Gn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Gn(t,e)}Hn.create=jn,Hn.pointsToPath=X,cn.geometryToLayer=dn,cn.coordsToLatLng=un,cn.coordsToLatLngs=pn,cn.latLngToCoords=mn,cn.latLngsToCoords=fn,cn.getFeature=gn,cn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Yn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),$e(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ce(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ie(),Ae(),Ne(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Yn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=o.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),E((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ue(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new P(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new P(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});St&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:St&&!st,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Ue(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=E(a,this,!0),Ue(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Yn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=si,t.Browser=Ot,t.Evented=z,t.Mixin=gi,t.Util=$,t.Class=A,t.Handler=mi,t.extend=n,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Pe,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Pi,t.PolyUtil=Di,t.Point=P,t.point=D,t.Bounds=N,t.bounds=R,t.Transformation=W,t.transformation=G,t.Projection=Bi,t.LatLng=Z,t.latLng=F,t.LatLngBounds=B,t.latLngBounds=q,t.CRS=U,t.GeoJSON=cn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Ui,t.LayerGroup=Vi,t.layerGroup=ji,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Sn,t.SVGOverlay=Cn,t.svgOverlay=En,t.DivOverlay=Tn,t.Popup=$n,t.popup=An,t.Tooltip=Ln,t.tooltip=Mn,t.Icon=Gi,t.icon=Ki,t.DivIcon=On,t.divIcon=zn,t.Marker=Xi,t.marker=Qi,t.TileLayer=Dn,t.tileLayer=Nn,t.GridLayer=Pn,t.gridLayer=In,t.SVG=Hn,t.svg=Wn,t.Renderer=qn,t.Canvas=Zn,t.canvas=Fn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=sn,t.Polyline=rn,t.polyline=an,t.Polygon=ln,t.polygon=hn,t.Rectangle=Gn,t.rectangle=Kn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(ql);const Zl={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},Fl={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},Ul=()=>Zl;class Vl extends et{static get styles(){return r`
|
|
6208
6060
|
:host {
|
|
6209
6061
|
display: block;
|
|
6210
6062
|
padding: 0px;
|
|
@@ -6239,10 +6091,10 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
|
|
|
6239
6091
|
color: var(--color-link-primary);
|
|
6240
6092
|
cursor: pointer;
|
|
6241
6093
|
}
|
|
6242
|
-
`}constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(
|
|
6094
|
+
`}constructor(){super(),this.osmId="",this.endpoint="",this.hovered=null,this.path=[],this.renderedMap=null,this.states=null,this.paths={},this.lastHovered=null}getRenderRoot(){return this.renderRoot}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}refreshMap(){const t=(t,e)=>{this.paths[t.properties.osm_id]=e,e.on({click:t=>{const e=t.target.feature.properties;if(e.osm_id!==this.path[this.path.length-1].osm_id){const i=t.originalEvent;i.stopPropagation(),i.preventDefault(),this.onFeatureClicked&&this.onFeatureClicked(e),this.hovered=null,this.path.push(e),this.osmId=e.osm_id,this.refreshMap()}},mouseover:t=>{const e=t.target.feature.properties;e.osm_id!==this.path[this.path.length-1].osm_id&&(t.target.setStyle(Fl),this.hovered=e)},mouseout:t=>{t.target.setStyle(Zl),this.hovered=null}})};ee(this.getEndpoint()+"geometry/"+this.osmId+"/").then((e=>{this.states&&this.renderedMap.removeLayer(this.states);const i=e.json;0===this.path.length&&(this.path=[{name:i.name,osm_id:this.osmId,level:0}]),this.states=ql.geoJSON(i.geometry,{style:Ul,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(Zl),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(Fl)}if(t.has("feature")&&this.feature&&(this.hovered=null,0!==this.path.length&&this.path[this.path.length-1].osm_id===this.feature.osm_id||this.path.push(this.feature)),t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(e);break}this.path=t,this.refreshMap()}}firstUpdated(t){const e=this.getRenderRoot().getElementById("alias-map");this.renderedMap=ql.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?D`
|
|
6243
6095
|
<link
|
|
6244
6096
|
rel="stylesheet"
|
|
6245
6097
|
href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
|
|
6246
6098
|
/>
|
|
6247
6099
|
<div id="alias-map"></div>
|
|
6248
|
-
`:D`<div>No osm map id</div>`}}t([st()],
|
|
6100
|
+
`:D`<div>No osm map id</div>`}}t([st()],Vl.prototype,"feature",void 0),t([st()],Vl.prototype,"osmId",void 0),t([st()],Vl.prototype,"endpoint",void 0),t([st()],Vl.prototype,"onFeatureClicked",void 0),t([st()],Vl.prototype,"hovered",void 0),t([st()],Vl.prototype,"path",void 0),Rl("leaflet-map",Vl),Rl("alias-editor",Bl);
|