@nyaruka/temba-components 0.114.1 → 0.117.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 +14 -0
- package/dist/temba-components.js +329 -311
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/button/Button.js +5 -0
- package/out-tsc/src/button/Button.js.map +1 -1
- package/out-tsc/src/chat/Chat.js +5 -1
- package/out-tsc/src/chat/Chat.js.map +1 -1
- package/out-tsc/src/contacts/ContactChat.js +27 -16
- package/out-tsc/src/contacts/ContactChat.js.map +1 -1
- package/out-tsc/src/dropdown/Dropdown.js +1 -1
- package/out-tsc/src/dropdown/Dropdown.js.map +1 -1
- package/out-tsc/src/list/TembaList.js +3 -2
- package/out-tsc/src/list/TembaList.js.map +1 -1
- package/out-tsc/src/list/TembaMenu.js +17 -5
- package/out-tsc/src/list/TembaMenu.js.map +1 -1
- package/out-tsc/src/options/Options.js +17 -17
- package/out-tsc/src/options/Options.js.map +1 -1
- package/out-tsc/src/select/Select.js +6 -2
- package/out-tsc/src/select/Select.js.map +1 -1
- package/out-tsc/src/select/UserSelect.js +0 -1
- package/out-tsc/src/select/UserSelect.js.map +1 -1
- package/out-tsc/src/select/WorkspaceSelect.js +65 -0
- package/out-tsc/src/select/WorkspaceSelect.js.map +1 -0
- package/out-tsc/src/store/Store.js +3 -1
- package/out-tsc/src/store/Store.js.map +1 -1
- package/out-tsc/src/user/TembaUser.js +27 -11
- package/out-tsc/src/user/TembaUser.js.map +1 -1
- package/out-tsc/temba-modules.js +2 -0
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/temba-contact-chat.test.js +1 -0
- package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/contacts/chat-for-archived-contact.png +0 -0
- package/screenshots/truth/contacts/chat-for-blocked-contact.png +0 -0
- package/screenshots/truth/contacts/chat-for-stopped-contact.png +0 -0
- package/screenshots/truth/select/expressions.png +0 -0
- package/screenshots/truth/select/functions.png +0 -0
- package/src/button/Button.ts +5 -0
- package/src/chat/Chat.ts +5 -1
- package/src/contacts/ContactChat.ts +30 -20
- package/src/dropdown/Dropdown.ts +1 -1
- package/src/list/TembaList.ts +3 -6
- package/src/list/TembaMenu.ts +20 -5
- package/src/options/Options.ts +18 -18
- package/src/select/Select.ts +5 -2
- package/src/select/UserSelect.ts +0 -1
- package/src/select/WorkspaceSelect.ts +71 -0
- package/src/store/Store.ts +3 -1
- package/src/user/TembaUser.ts +23 -10
- package/temba-modules.ts +2 -0
- package/test/temba-contact-chat.test.ts +5 -0
package/dist/temba-components.js
CHANGED
|
@@ -15,13 +15,13 @@ const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow
|
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const k=globalThis,A=k.trustedTypes,S=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${(Math.random()+"").slice(9)}$`,E="?"+T,$=`<${E}>`,O=document,z=()=>O.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,D=t=>I(t)||"function"==typeof t?.[Symbol.iterator],P="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,R=/>/g,q=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,U=/"/g,
|
|
18
|
+
const k=globalThis,A=k.trustedTypes,S=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${(Math.random()+"").slice(9)}$`,E="?"+T,$=`<${E}>`,O=document,z=()=>O.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,D=t=>I(t)||"function"==typeof t?.[Symbol.iterator],P="[ \t\n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,R=/>/g,q=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,U=/"/g,j=/^(?:script|style|textarea|title)$/i,V=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Z=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),W=new WeakMap,G=O.createTreeWalker(O,129);function Y(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const K=(t,e)=>{const i=t.length-1,o=[];let n,s=2===e?"<svg>":"",r=N;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===N?"!--"===l[1]?r=B:void 0!==l[1]?r=R:void 0!==l[2]?(j.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=q):void 0!==l[3]&&(r=q):r===q?">"===l[0]?(r=n??N,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?q:'"'===l[3]?U:F):r===U||r===F?r=q:r===B||r===R?r=N:(r=q,n=void 0);const d=r===q&&t[e+1].startsWith("/>")?" ":"";s+=r===N?i+$:h>=0?(o.push(a),i.slice(0,h)+C+i.slice(h)+T+d):i+T+(-2===h?e:d)}return[Y(t,s+(t[i]||"<?>")+(2===e?"</svg>":"")),o]};class Q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,s=0;const r=t.length-1,a=this.parts,[l,h]=K(t,e);if(this.el=Q.createElement(l,i),G.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=G.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(C)){const e=h[s++],i=o.getAttribute(t).split(T),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?it:"?"===r[1]?ot:"@"===r[1]?nt:et}),o.removeAttribute(t)}else t.startsWith(T)&&(a.push({type:6,index:n}),o.removeAttribute(t));if(j.test(o.tagName)){const t=o.textContent.split(T),e=t.length-1;if(e>0){o.textContent=A?A.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],z()),G.nextNode(),a.push({type:2,index:++n});o.append(t[e],z())}}}else if(8===o.nodeType)if(o.data===E)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(T,t+1));)a.push({type:7,index:n}),t+=T.length-1}n++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}}function J(t,e,i=t,o){if(e===Z)return e;let n=void 0!==o?i._$Co?.[o]:i._$Cl;const s=M(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(t),n._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=n:i._$Cl=n),void 0!==n&&(e=J(t,n._$AS(t,e.values),n,o)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??O).importNode(e,!0);G.currentNode=o;let n=G.nextNode(),s=0,r=0,a=i[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new tt(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new st(n,this,t)),this._$AV.push(e),a=i[++r]}s!==a?.index&&(n=G.nextNode(),s++)}return G.currentNode=O,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}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=J(this,t,e),M(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==Z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):D(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==H&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Q.createElement(Y(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new X(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Q(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const n of t)o===e.length?e.push(i=new tt(this.S(z()),this.S(z()),this,this.options)):i=e[o],i._$AI(n),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,n){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=H}_$AI(t,e=this,i,o){const n=this.strings;let s=!1;if(void 0===n)t=J(this,t,e,0),s=!M(t)||t!==this._$AH&&t!==Z,s&&(this._$AH=t);else{const o=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=J(this,o[i+r],e,r),a===Z&&(a=this._$AH[r]),s||=!M(a)||a!==this._$AH[r],a===H?t=H:t!==H&&(t+=(a??"")+n[r+1]),this._$AH[r]=a}s&&!o&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}}class ot extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==H)}}class nt extends et{constructor(t,e,i,o,n){super(t,e,i,o,n),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??H)===Z)return;const i=this._$AH,o=t===H&&i!==H||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==H&&(i===H||o);o&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}let st=class{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){J(this,t)}};const rt={P:C,A:T,C:E,M:1,L:K,R:X,D:D,V:J,I:tt,H:et,N:ot,U:nt,B:it,F:st},at=k.litHtmlPolyfillSupport;at?.(Q,tt),(k.litHtmlVersions??=[]).push("3.1.2");
|
|
19
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
23
|
*/
|
|
24
|
-
let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(z(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,St,Ct,Tt,Et=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},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ot=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},zt="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],Mt=[24,16,8,0],It=[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],Dt=[];class Pt{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),St.set(this,void 0),Ct.set(this,0),Tt.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Et(this,dt,Dt)):Et(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Et(this,gt,3238371032),Et(this,ft,914150663),Et(this,vt,812702999),Et(this,bt,4144912697),Et(this,yt,4290775857),Et(this,_t,1750603025),Et(this,xt,1694076839),Et(this,wt,3204075428)):(Et(this,gt,1779033703),Et(this,ft,3144134277),Et(this,vt,1013904242),Et(this,bt,2773480762),Et(this,yt,1359893119),Et(this,_t,2600822924),Et(this,xt,528734635),Et(this,wt,1541459225)),Et(this,ct,Et(this,Tt,Et(this,ut,Et(this,At,0)))),Et(this,pt,Et(this,kt,!1)),Et(this,mt,!0),Et(this,St,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Et(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Tt);i<o&&t<64;++i)n[t>>2]|=e[i]<<Mt[3&t++];else for(t=$t(this,Tt);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Mt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Mt[3&t++],n[t>>2]|=(128|o>>12&63)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++])}Et(this,Ct,t),Et(this,ut,$t(this,ut)+(t-$t(this,Tt))),t>=64?(Et(this,ct,n[16]),Et(this,Tt,t-64),this.hash(),Et(this,kt,!0)):Et(this,Tt,t)}return $t(this,ut)>4294967295&&(Et(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Et(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Et(this,pt,!0);const t=$t(this,dt),e=$t(this,Ct);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Et(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),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]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;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;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,St)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),Et(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+It[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+It[y+1]+l[y+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&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+It[y+2]+l[y+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),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+It[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Et(this,gt,$t(this,gt)+t|0),Et(this,ft,$t(this,ft)+e|0),Et(this,vt,$t(this,vt)+i|0),Et(this,bt,$t(this,bt)+o|0),Et(this,yt,$t(this,yt)+n|0),Et(this,_t,$t(this,_t)+s|0),Et(this,xt,$t(this,xt)+r|0),Et(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=zt[t>>28&15]+zt[t>>24&15]+zt[t>>20&15]+zt[t>>16&15]+zt[t>>12&15]+zt[t>>8&15]+zt[t>>4&15]+zt[15&t]+zt[e>>28&15]+zt[e>>24&15]+zt[e>>20&15]+zt[e>>16&15]+zt[e>>12&15]+zt[e>>8&15]+zt[e>>4&15]+zt[15&e]+zt[i>>28&15]+zt[i>>24&15]+zt[i>>20&15]+zt[i>>16&15]+zt[i>>12&15]+zt[i>>8&15]+zt[i>>4&15]+zt[15&i]+zt[o>>28&15]+zt[o>>24&15]+zt[o>>20&15]+zt[o>>16&15]+zt[o>>12&15]+zt[o>>8&15]+zt[o>>4&15]+zt[15&o]+zt[n>>28&15]+zt[n>>24&15]+zt[n>>20&15]+zt[n>>16&15]+zt[n>>12&15]+zt[n>>8&15]+zt[n>>4&15]+zt[15&n]+zt[s>>28&15]+zt[s>>24&15]+zt[s>>20&15]+zt[s>>16&15]+zt[s>>12&15]+zt[s>>8&15]+zt[s>>4&15]+zt[15&s]+zt[r>>28&15]+zt[r>>24&15]+zt[r>>20&15]+zt[r>>16&15]+zt[r>>12&15]+zt[r>>8&15]+zt[r>>4&15]+zt[15&r];return $t(this,St)||(l+=zt[a>>28&15]+zt[a>>24&15]+zt[a>>20&15]+zt[a>>16&15]+zt[a>>12&15]+zt[a>>8&15]+zt[a>>4&15]+zt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),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,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,St)||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($t(this,St)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,St)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new Pt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,St=new WeakMap,Ct=new WeakMap,Tt=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=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=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ot)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.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}};var Ft;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ft||(Ft={}));const Ut=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},Vt=(t={})=>{let e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!e){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(e=t.value)}const i=e?{"X-CSRFToken":e}:{},o=window.org_id;return o&&(i["X-Temba-Org"]=o),i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete i["X-Temba-Org"],i[e]=t[e]})),i},jt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:Vt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(t):t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),Zt=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()},Ht=(t,e=null,i={})=>new Promise(((o,n)=>{jt(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),Wt=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await Ht(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},Gt=t=>new Promise(((e,i)=>{jt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Yt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Kt=(t,e,i={},o=null)=>{const n=Vt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Qt=(t,e)=>Kt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Kt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{n(t)}))})),Xt=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:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?j`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?j`${i}, `:j`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var ne;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(ne||(ne={}));const se=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),re=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},ae=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},le={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},he=(t=le,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function ce(t){return(e,i)=>"object"==typeof i?he(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ut(t.tagName,Ft.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ut(t.tagName,Ft.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.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):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,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 o=i.closest(t);return o||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)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([ce({type:String})],pe.prototype,"service",void 0);class me extends pe{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}me.formAssociated=!0,t([ce({type:String})],me.prototype,"name",void 0),t([ce({type:String,attribute:"help_text"})],me.prototype,"helpText",void 0),t([ce({type:Boolean,attribute:"help_always"})],me.prototype,"helpAlways",void 0),t([ce({type:Boolean,attribute:"widget_only"})],me.prototype,"widgetOnly",void 0),t([ce({type:Boolean,attribute:"hide_label"})],me.prototype,"hideLabel",void 0),t([ce({type:String})],me.prototype,"label",void 0),t([ce({type:Array})],me.prototype,"errors",void 0),t([ce({type:String})],me.prototype,"value",void 0),t([ce({attribute:!1})],me.prototype,"inputRoot",void 0),t([ce({type:Boolean})],me.prototype,"disabled",void 0);var ge;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-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.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.definitions_export="download-cloud-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.export="download-cloud-01",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.info="user-square",t.integrations="layers-three-01",t.invitations="user-plus-01",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notes="edit-03",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",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.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.shortcut="zap-fast",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_mine_done="coffee-empty",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.user_beta="shield-zap",t.user_token="key-01",t.users="users-01",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ge||(ge={}));class fe extends me{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
24
|
+
let lt=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let n=o._$litPart$;if(void 0===n){const t=i?.renderBefore??null;o._$litPart$=n=new tt(e.insertBefore(z(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};lt._$litElement$=!0,lt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:lt});const ht=globalThis.litElementPolyfillSupport;ht?.({LitElement:lt}),(globalThis.litElementVersions??=[]).push("4.0.4");var ct,dt,ut,pt,mt,gt,ft,vt,bt,yt,_t,xt,wt,kt,At,St,Ct,Tt,Et=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},$t=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Ot=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let o=0;o<t.length;o++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(o);return e},zt="0123456789abcdef".split(""),Lt=[-2147483648,8388608,32768,128],Mt=[24,16,8,0],It=[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],Dt=[];class Pt{constructor(t=!1,e=!1){ct.set(this,void 0),dt.set(this,void 0),ut.set(this,void 0),pt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),yt.set(this,void 0),_t.set(this,void 0),xt.set(this,void 0),wt.set(this,void 0),kt.set(this,void 0),At.set(this,void 0),St.set(this,void 0),Ct.set(this,0),Tt.set(this,void 0),this.init(t,e)}init(t,e){e?(Dt[0]=Dt[16]=Dt[1]=Dt[2]=Dt[3]=Dt[4]=Dt[5]=Dt[6]=Dt[7]=Dt[8]=Dt[9]=Dt[10]=Dt[11]=Dt[12]=Dt[13]=Dt[14]=Dt[15]=0,Et(this,dt,Dt)):Et(this,dt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(Et(this,gt,3238371032),Et(this,ft,914150663),Et(this,vt,812702999),Et(this,bt,4144912697),Et(this,yt,4290775857),Et(this,_t,1750603025),Et(this,xt,1694076839),Et(this,wt,3204075428)):(Et(this,gt,1779033703),Et(this,ft,3144134277),Et(this,vt,1013904242),Et(this,bt,2773480762),Et(this,yt,1359893119),Et(this,_t,2600822924),Et(this,xt,528734635),Et(this,wt,1541459225)),Et(this,ct,Et(this,Tt,Et(this,ut,Et(this,At,0)))),Et(this,pt,Et(this,kt,!1)),Et(this,mt,!0),Et(this,St,t)}update(t){if($t(this,pt))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const o=e.length,n=$t(this,dt);for(;i<o;){let t;if($t(this,kt)&&(Et(this,kt,!1),n[0]=$t(this,ct),n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0),"string"!=typeof e)for(t=$t(this,Tt);i<o&&t<64;++i)n[t>>2]|=e[i]<<Mt[3&t++];else for(t=$t(this,Tt);i<o&&t<64;++i){let o=e.charCodeAt(i);o<128?n[t>>2]|=o<<Mt[3&t++]:o<2048?(n[t>>2]|=(192|o>>6)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):o<55296||o>=57344?(n[t>>2]|=(224|o>>12)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n[t>>2]|=(240|o>>18)<<Mt[3&t++],n[t>>2]|=(128|o>>12&63)<<Mt[3&t++],n[t>>2]|=(128|o>>6&63)<<Mt[3&t++],n[t>>2]|=(128|63&o)<<Mt[3&t++])}Et(this,Ct,t),Et(this,ut,$t(this,ut)+(t-$t(this,Tt))),t>=64?(Et(this,ct,n[16]),Et(this,Tt,t-64),this.hash(),Et(this,kt,!0)):Et(this,Tt,t)}return $t(this,ut)>4294967295&&(Et(this,At,$t(this,At)+($t(this,ut)/4294967296|0)),Et(this,ut,$t(this,ut)%4294967296)),this}finalize(){if($t(this,pt))return;Et(this,pt,!0);const t=$t(this,dt),e=$t(this,Ct);t[16]=$t(this,ct),t[e>>2]|=Lt[3&e],Et(this,ct,t[16]),e>=56&&($t(this,kt)||this.hash(),t[0]=$t(this,ct),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]=$t(this,At)<<3|$t(this,ut)>>>29,t[15]=$t(this,ut)<<3,this.hash()}hash(){let t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);const l=$t(this,dt);let h,c,d,u,p,m,g,f,v,b;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;b=e&i;for(let y=0;y<64;y+=4)$t(this,mt)?($t(this,St)?(g=300032,u=l[0]-1413257819,a=u-150054599|0,o=u+24177077|0):(g=704751109,u=l[0]-210244248,a=u-1521486534|0,o=u+143694565|0),Et(this,mt,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),g=t&e,d=g^t&i^b,m=n&s^~n&r,u=a+c+m+It[y]+l[y],p=h+d,a=o+u|0,o=u+p|0),h=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),f=o&t,d=f^o&e^g,m=a&n^~a&s,u=r+c+m+It[y+1]+l[y+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&o,d=v^i&t^f,m=r&a^~r&n,u=s+c+m+It[y+2]+l[y+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),b=e&i,d=b^e&o^v,m=s&r^~s&a,u=n+c+m+It[y+3]+l[y+3],p=h+d,n=t+u|0,t=u+p|0;Et(this,gt,$t(this,gt)+t|0),Et(this,ft,$t(this,ft)+e|0),Et(this,vt,$t(this,vt)+i|0),Et(this,bt,$t(this,bt)+o|0),Et(this,yt,$t(this,yt)+n|0),Et(this,_t,$t(this,_t)+s|0),Et(this,xt,$t(this,xt)+r|0),Et(this,wt,$t(this,wt)+a|0)}hex(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt);let l=zt[t>>28&15]+zt[t>>24&15]+zt[t>>20&15]+zt[t>>16&15]+zt[t>>12&15]+zt[t>>8&15]+zt[t>>4&15]+zt[15&t]+zt[e>>28&15]+zt[e>>24&15]+zt[e>>20&15]+zt[e>>16&15]+zt[e>>12&15]+zt[e>>8&15]+zt[e>>4&15]+zt[15&e]+zt[i>>28&15]+zt[i>>24&15]+zt[i>>20&15]+zt[i>>16&15]+zt[i>>12&15]+zt[i>>8&15]+zt[i>>4&15]+zt[15&i]+zt[o>>28&15]+zt[o>>24&15]+zt[o>>20&15]+zt[o>>16&15]+zt[o>>12&15]+zt[o>>8&15]+zt[o>>4&15]+zt[15&o]+zt[n>>28&15]+zt[n>>24&15]+zt[n>>20&15]+zt[n>>16&15]+zt[n>>12&15]+zt[n>>8&15]+zt[n>>4&15]+zt[15&n]+zt[s>>28&15]+zt[s>>24&15]+zt[s>>20&15]+zt[s>>16&15]+zt[s>>12&15]+zt[s>>8&15]+zt[s>>4&15]+zt[15&s]+zt[r>>28&15]+zt[r>>24&15]+zt[r>>20&15]+zt[r>>16&15]+zt[r>>12&15]+zt[r>>8&15]+zt[r>>4&15]+zt[15&r];return $t(this,St)||(l+=zt[a>>28&15]+zt[a>>24&15]+zt[a>>20&15]+zt[a>>16&15]+zt[a>>12&15]+zt[a>>8&15]+zt[a>>4&15]+zt[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=$t(this,gt),e=$t(this,ft),i=$t(this,vt),o=$t(this,bt),n=$t(this,yt),s=$t(this,_t),r=$t(this,xt),a=$t(this,wt),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,o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return $t(this,St)||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($t(this,St)?28:32),e=new DataView(t);return e.setUint32(0,$t(this,gt)),e.setUint32(4,$t(this,ft)),e.setUint32(8,$t(this,vt)),e.setUint32(12,$t(this,bt)),e.setUint32(16,$t(this,yt)),e.setUint32(20,$t(this,_t)),e.setUint32(24,$t(this,xt)),$t(this,St)||e.setUint32(28,$t(this,wt)),t}}function Nt(t){const e=new Pt;return e.update(t),parseInt(e.hex().substring(0,8),16)}ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,vt=new WeakMap,bt=new WeakMap,yt=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,kt=new WeakMap,At=new WeakMap,St=new WeakMap,Ct=new WeakMap,Tt=new WeakMap;const Bt=function(t,e,i){var o=i<.5?i*(1+e):i+e-i*e,n=2*i-o;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?n+6*(o-n)*t:t<.5?o:t<2/3?n+6*(o-n)*(2/3-t):n,Math.round(255*t)}))};const Rt="/api/v2/media.json",qt=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=Nt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Ot)}hsl(t){var e,i,o=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[o%this.hueRanges.length];e=o/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=o%359;return o=Math.ceil(o/360),i=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),[e,i,this.L[o%this.L.length]]}rgb(t){var e=this.hsl(t);return Bt.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}};var Ft;!function(t){t.BLUE="color:#5078b5;",t.GREEN="color:#62bd6a;",t.RED="color:#e36049;",t.PURPLE="color:#a626a4;"}(Ft||(Ft={}));const Ut=(t,e="",i=[])=>{""!==e?"object"!=typeof t?console.log("%c"+t,e,...i):console.log("%c"+JSON.stringify(t,null,2),e):console.log(t)},jt=(t={})=>{let e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let o=e.substr(0,i),n=e.substr(i+1);if(o=o.trim(),n=n.trim(),o===t)return n}return null})("csrftoken");if(!e){const t=document.querySelector("[name=csrfmiddlewaretoken]");t&&(e=t.value)}const i=e?{"X-CSRFToken":e}:{},o=window.org_id;return o&&(i["X-Temba-Org"]=o),i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{"X-Temba-Service-Org"===e&&delete i["X-Temba-Org"],i[e]=t[e]})),i},Vt=(t,e=null,i={})=>new Promise(((o,n)=>{const s={method:"GET",headers:jt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.status<200||t.status>=300?n(t):t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}o({controller:e,body:i,json:n,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{n(t)}))})),Zt=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()},Ht=(t,e=null,i={})=>new Promise(((o,n)=>{Vt(t,e,i).then((t=>{o({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),Wt=async(t,e={})=>{if(!t)return new Promise((t=>t([])));let i=[],o=t;for(;o;){const t=await Ht(o,null,e);t.results&&(i=i.concat(t.results)),o=t.next}return i},Gt=t=>new Promise(((e,i)=>{Vt(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),Yt=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await Gt(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},Kt=(t,e,i={},o=null)=>{const n=jt(i);o&&(n["Content-Type"]=o);const s={method:"POST",headers:n,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{if(t.status>=500)return void i(t);const o=t.headers.get("X-Temba-Toasts");if(o){const t=document.querySelector("temba-toast");t&&t.addMessages(JSON.parse(o))}t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}e({body:i,json:o,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},Qt=(t,e)=>Kt(t,JSON.stringify(e),!1,"application/json"),Jt=(t,e,i={})=>new Promise(((o,n)=>{Kt(t,e,i).then((e=>{e.status>=200&&e.status<400?o(e):n(t===Rt?e:"Server failure")})).catch((t=>{n(t)}))})),Xt=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:Xt(e):null}return null},te=(t,e,i=!1)=>{let o;return function(...n){const s=this,r=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),r&&t.apply(s,n)}},ee=(t,e)=>{let i=!0;return function(...o){i&&(i=!1,t.apply(this,o),setTimeout((()=>{i=!0}),e))}},ie=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?V`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,o)=>o<t.length-1?V`${i}, `:V`${e} ${i}`)):t.join(", ")+e+t[t.length-1],oe=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let o=0;o<i.length;o++){const n=i[o].trim();if(n.substring(0,t.length+1)==t+"="){e=decodeURIComponent(n.substring(t.length+1));break}}}return e};var ne;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(ne||(ne={}));const se=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),re=t=>{let e=(t=t.trim()).match(/(([\p{L}\p{N}]+-[\p{L}\p{N}]+)|([\p{L}\p{N}]+))/gu)||[];if(1==e.length&&(e=t.match(/[\p{L}\p{N}]+/gu)),0==e.length)return"?";if(1==e.length)return e[0].substring(0,2).toUpperCase();const i=e.map((t=>t.substring(0,1))),o=i.filter(((t,e)=>t==t.toUpperCase()||0==e));return o.length>=2?(o[0]+o[1]).toUpperCase():(i[0]+i[1]).toUpperCase()},ae=(t,e,i)=>{i/=100;const o=e*Math.min(i,1-i)/100,n=e=>{const n=(e+t/30)%12,s=i-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`},le={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},he=(t=le,e,i)=>{const{kind:o,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===o){const{name:o}=i;return function(i){const n=this[o];e.call(this,i),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+o)};function ce(t){return(e,i)=>"object"==typeof i?he(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,o?{...t,wrapped:!0}:t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}const de=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){const o={};for(const i of e.keys())o[i]=[e[i],t[i]];Ut(t.tagName,Ft.PURPLE,[i?"<first-updated>":"<updated>",o])}},ue=(t,e,i=void 0)=>{(t.DEBUG_EVENTS||t.DEBUG)&&Ut(t.tagName,Ft.GREEN,void 0!==i?[e,i]:[e])};class pe extends lt{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):t.isWindow?window.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):t.isWindow?window.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),de(this,t,!0)}updated(t){super.updated(t),de(this,t,!1)}getHeaders(){return this.service?{"X-Temba-Service-Org":this.service}:{}}fireEvent(t){return ue(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}swallowEvent(t){t.stopPropagation(),t.preventDefault()}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&ue(this,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 o=i.closest(t);return o||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)}stopEvent(t){t&&(t.stopPropagation(),t.preventDefault())}isMobile(){const t=window;return!!t.isMobile&&t.isMobile()}}t([ce({type:String})],pe.prototype,"service",void 0);class me extends pe{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}me.formAssociated=!0,t([ce({type:String})],me.prototype,"name",void 0),t([ce({type:String,attribute:"help_text"})],me.prototype,"helpText",void 0),t([ce({type:Boolean,attribute:"help_always"})],me.prototype,"helpAlways",void 0),t([ce({type:Boolean,attribute:"widget_only"})],me.prototype,"widgetOnly",void 0),t([ce({type:Boolean,attribute:"hide_label"})],me.prototype,"hideLabel",void 0),t([ce({type:String})],me.prototype,"label",void 0),t([ce({type:Array})],me.prototype,"errors",void 0),t([ce({type:String})],me.prototype,"value",void 0),t([ce({attribute:!1})],me.prototype,"inputRoot",void 0),t([ce({type:Boolean})],me.prototype,"disabled",void 0);var ge;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add="plus",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-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.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.branding="brush-02",t.branding_hostname="server-05",t.branding_notifications="mail-01",t.branding_styling="palette",t.branding_raw="pencil-01",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.close="x",t.compose="send-01",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_export="download-cloud-01",t.contact_import="upload-cloud-01",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.copy="copy-04",t.dashboard="pie-chart-01",t.definitions_export="download-cloud-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.export="download-cloud-01",t.expressions="at-sign",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_exclude="users-x",t.group_include="users-check",t.group_smart="atom-01",t.help="help-circle",t.hide="eye-off",t.home="settings-02",t.image="image-01",t.import="upload-cloud-01",t.inbox="inbox-01",t.incidents="alert-square",t.incoming_call="phone-incoming-01",t.info="user-square",t.integrations="layers-three-01",t.invitations="user-plus-01",t.issue="alert-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.message_export="download-cloud-01",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notes="edit-03",t.notification="bell-01",t.number="hash-01",t.optin_requested="message-notification-circle",t.optin="message-check-circle",t.optout="message-x-circle",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.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.quick_replies="dotpoints-01",t.recording="microphone-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.results_export="download-cloud-01",t.retry="refresh-cw-05",t.revisions="clock-rewind",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.send="send-03",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.shortcut="zap-fast",t.show="eye",t.simulator="phone-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.submit="check",t.success="check",t.template_approved="check-circle",t.template_pending="hourglass-01",t.template_rejected="alert-circle",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_mine_done="coffee-empty",t.tickets_open="inbox-01",t.tickets_export="download-cloud-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.trigger_keyword="message-check-square",t.trigger_catch_all="message-question-square",t.trigger_inbound_call="phone-incoming-01",t.trigger_missed_call="phone-hang-up",t.trigger_schedule="calendar",t.trigger_new_conversation="message-chat-square",t.trigger_referral="user-right-01",t.trigger_closed_ticket="agent",t.trigger_opt_in="message-check-circle",t.trigger_opt_out="message-x-circle",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.upload_image="camera-01",t.usages="link-04",t.user="users-01",t.user_beta="shield-zap",t.user_token="key-01",t.users="users-01",t.video="video-recorder",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.channel_a="channel-android",t.channel_ac="zap",t.channel_at="zap",t.channel_bs="zap",t.channel_bw="zap",t.channel_cs="zap",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_d3c="channel-whatsapp",t.channel_da="zap",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_hm="zap",t.channel_ib="zap",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mt="channel-mtarget",t.channel_mtn="zap",t.channel_nx="channel-vonage",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sq="zap",t.channel_st="zap",t.channel_sw="channel-signalwire",t.channel_t="channel-twilio",t.channel_tg="channel-telegram",t.channel_tms="channel-twilio",t.channel_tq="channel-thinq",t.channel_tw="zap",t.channel_twa="channel-whatsapp",t.channel_twc="zap",t.channel_twt="channel-twitter",t.channel_vk="channel-vk",t.channel_vp="channel-viber",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_wc="channel-wechat",t.channel_yo="zap",t.channel_zvw="channel-whatsapp",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(ge||(ge={}));class fe extends me{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
|
|
25
25
|
:host {
|
|
26
26
|
color: var(--color-text);
|
|
27
27
|
display: inline-block;
|
|
@@ -70,11 +70,11 @@ let lt=class extends w{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
70
70
|
cursor: not-allowed;
|
|
71
71
|
--icon-color: #ccc;
|
|
72
72
|
}
|
|
73
|
-
`}updated(t){super.updated(t),(t.has("checked")||t.has("value"))&&(this.checked||this.partial?this.internals.setFormValue(this.value||"1"):this.internals.setFormValue(void 0),this.fireEvent("change"))}serializeValue(t){return t}handleClick(){this.disabled||(this.checked=!this.checked)}click(){this.handleClick(),super.click()}render(){const t=
|
|
73
|
+
`}updated(t){super.updated(t),(t.has("checked")||t.has("value"))&&(this.checked||this.partial?this.internals.setFormValue(this.value||"1"):this.internals.setFormValue(void 0),this.fireEvent("change"))}serializeValue(t){return t}handleClick(){this.disabled||(this.checked=!this.checked)}click(){this.handleClick(),super.click()}render(){const t=V`<temba-icon
|
|
74
74
|
name="${this.checked?ge.checkbox_checked:this.partial?ge.checkbox_partial:ge.checkbox}"
|
|
75
75
|
size="${this.size}"
|
|
76
76
|
animatechange="${this.animateChange}"
|
|
77
|
-
/>`;return this.label=this.label?this.label.trim():null,
|
|
77
|
+
/>`;return this.label=this.label?this.label.trim():null,V`
|
|
78
78
|
<div class="wrapper ${this.label?"label":""}">
|
|
79
79
|
<temba-field
|
|
80
80
|
name=${this.name}
|
|
@@ -87,7 +87,7 @@ let lt=class extends w{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
87
87
|
>
|
|
88
88
|
<div class="checkbox-container ${this.disabled?"disabled":""}">
|
|
89
89
|
${t}
|
|
90
|
-
${this.label?
|
|
90
|
+
${this.label?V`<div class="checkbox-label">${this.label}</div>`:null}
|
|
91
91
|
</div>
|
|
92
92
|
</temba-field>
|
|
93
93
|
</div>
|
|
@@ -225,11 +225,11 @@ const ve=t=>t??H
|
|
|
225
225
|
.type-icon {
|
|
226
226
|
color: #e3e3e3;
|
|
227
227
|
}
|
|
228
|
-
`}constructor(){super(),this.placeholder="",this.loading=!0,this.submitOnEnter=!0,this.autogrow=!1,this.type=Se.Text,this.counterElement=null,this.cursorStart=-1,this.cursorEnd=-1}firstUpdated(t){if(super.firstUpdated(t),this.inputElement=this.shadowRoot.querySelector(".textinput"),t.has("counter")){let t=this.getParentModax();t&&(t=t.shadowRoot),t||(t=document),this.counterElement=t.querySelector(this.counter),this.counterElement.text=this.value}}updated(t){if(super.updated(t),t.has("value")){if(void 0!==t.get("value")&&this.fireEvent("change"),this.textarea&&this.autogrow){this.shadowRoot.querySelector(".grow-wrap > div").innerText=this.value+String.fromCharCode(10)}this.cursorStart>-1&&this.cursorEnd>-1&&(this.inputElement.setSelectionRange(this.cursorStart,this.cursorEnd),this.cursorStart=-1,this.cursorEnd=-1)}}getDisplayValue(){return this.inputElement.value}handleClear(t){t.stopPropagation(),t.preventDefault(),this.value=null}getTextInput(){return this}updateValue(t){const e=this.inputElement.selectionStart,i=this.inputElement.selectionEnd,o=this.sanitizeGSM(t);o!==t&&(this.cursorStart=e,this.cursorEnd=i),this.value=o,this.textarea&&(this.inputElement.value=this.value),this.counterElement&&(this.counterElement.text=t)}sanitizeGSM(t){return this.gsm?(t=>t?t.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/\u2002/g," "):t)(t):t}handleChange(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("change"))}handleContainerClick(){this.disabled||this.inputElement&&this.inputElement.click()}handleContainerFocus(){this.disabled||this.inputElement&&this.inputElement.focus()}handleInput(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("input"))}serializeValue(t){return t}getParentModax(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("TEMBA-MODAX"==t.tagName)return t}}getParentForm(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("FORM"===t.tagName)return t}}click(){super.click(),this.handleContainerClick()}focus(){super.focus(),this.handleContainerFocus()}render(){const t={height:""+(this.textarea?"100%":"auto")},e=this.clearable&&this.inputElement&&this.inputElement.value?
|
|
228
|
+
`}constructor(){super(),this.placeholder="",this.loading=!0,this.submitOnEnter=!0,this.autogrow=!1,this.type=Se.Text,this.counterElement=null,this.cursorStart=-1,this.cursorEnd=-1}firstUpdated(t){if(super.firstUpdated(t),this.inputElement=this.shadowRoot.querySelector(".textinput"),t.has("counter")){let t=this.getParentModax();t&&(t=t.shadowRoot),t||(t=document),this.counterElement=t.querySelector(this.counter),this.counterElement.text=this.value}}updated(t){if(super.updated(t),t.has("value")){if(void 0!==t.get("value")&&this.fireEvent("change"),this.textarea&&this.autogrow){this.shadowRoot.querySelector(".grow-wrap > div").innerText=this.value+String.fromCharCode(10)}this.cursorStart>-1&&this.cursorEnd>-1&&(this.inputElement.setSelectionRange(this.cursorStart,this.cursorEnd),this.cursorStart=-1,this.cursorEnd=-1)}}getDisplayValue(){return this.inputElement.value}handleClear(t){t.stopPropagation(),t.preventDefault(),this.value=null}getTextInput(){return this}updateValue(t){const e=this.inputElement.selectionStart,i=this.inputElement.selectionEnd,o=this.sanitizeGSM(t);o!==t&&(this.cursorStart=e,this.cursorEnd=i),this.value=o,this.textarea&&(this.inputElement.value=this.value),this.counterElement&&(this.counterElement.text=t)}sanitizeGSM(t){return this.gsm?(t=>t?t.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/\u2002/g," "):t)(t):t}handleChange(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("change"))}handleContainerClick(){this.disabled||this.inputElement&&this.inputElement.click()}handleContainerFocus(){this.disabled||this.inputElement&&this.inputElement.focus()}handleInput(t){this.disabled||(this.updateValue(t.target.value),this.fireEvent("input"))}serializeValue(t){return t}getParentModax(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("TEMBA-MODAX"==t.tagName)return t}}getParentForm(){let t=this;for(;t;){if(t=t.parentElement?t.parentElement:t.getRootNode().host,!t)return null;if("FORM"===t.tagName)return t}}click(){super.click(),this.handleContainerClick()}focus(){super.focus(),this.handleContainerFocus()}render(){const t={height:""+(this.textarea?"100%":"auto")},e=this.clearable&&this.inputElement&&this.inputElement.value?V`<temba-icon
|
|
229
229
|
name="x"
|
|
230
230
|
class="clear-icon"
|
|
231
231
|
@click=${this.handleClear}
|
|
232
|
-
/>`:null;let i=
|
|
232
|
+
/>`:null;let i=V`
|
|
233
233
|
<input
|
|
234
234
|
autofocus
|
|
235
235
|
class="textinput"
|
|
@@ -245,7 +245,7 @@ const ve=t=>t??H
|
|
|
245
245
|
.value=${this.value}
|
|
246
246
|
.disabled=${this.disabled}
|
|
247
247
|
/>
|
|
248
|
-
`;return this.textarea&&(i=
|
|
248
|
+
`;return this.textarea&&(i=V`
|
|
249
249
|
<textarea
|
|
250
250
|
class="textinput"
|
|
251
251
|
name=${this.name}
|
|
@@ -257,10 +257,10 @@ const ve=t=>t??H
|
|
|
257
257
|
.value=${this.value}
|
|
258
258
|
.disabled=${this.disabled}
|
|
259
259
|
></textarea>
|
|
260
|
-
`,this.autogrow&&(i=
|
|
260
|
+
`,this.autogrow&&(i=V` <div class="grow-wrap">
|
|
261
261
|
<div></div>
|
|
262
262
|
${i}
|
|
263
|
-
</div>`)),
|
|
263
|
+
</div>`)),V`
|
|
264
264
|
<temba-field
|
|
265
265
|
name=${this.name}
|
|
266
266
|
.label="${this.label}"
|
|
@@ -279,7 +279,7 @@ const ve=t=>t??H
|
|
|
279
279
|
|
|
280
280
|
${i} ${e}
|
|
281
281
|
<slot name="type" class="type-icon"
|
|
282
|
-
>${this.type===Se.Number?
|
|
282
|
+
>${this.type===Se.Number?V`<temba-icon name="number"></temba-icon>`:null}</slot
|
|
283
283
|
>
|
|
284
284
|
<slot></slot>
|
|
285
285
|
</div>
|
|
@@ -292,7 +292,7 @@ const ve=t=>t??H
|
|
|
292
292
|
* @license BSD-3-Clause
|
|
293
293
|
* @version 11.2.5
|
|
294
294
|
*/
|
|
295
|
-
class ze{constructor(t=0,e=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=i,this.size=0,this.ttl=e}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}entries(t=this.keys()){return t.map((t=>[t,this.get(t)]))}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0==--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=Date.now()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}has(t){return t in this.items}keys(){const t=[];let e=this.first;for(;null!==e;)t.push(e.key),e=e.next;return t}set(t,e,i=!1,o=this.resetTtl){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,!1===i&&o&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),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?Date.now()+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}values(t=this.keys()){return t.map((t=>this.get(t)))}}function Le(t=1e3,e=0,i=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof i)throw new TypeError("Invalid resetTtl value");return new ze(t,e,i)}class Me extends Error{}class Ie extends Me{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class De extends Me{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Pe extends Me{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Ne extends Me{}class Be extends Me{constructor(t){super(`Invalid unit ${t}`)}}class Re extends Me{}class qe extends Me{constructor(){super("Zone is an abstract class")}}const Fe="numeric",Ue="short",Ve="long",je={year:Fe,month:Fe,day:Fe},Ze={year:Fe,month:Ue,day:Fe},He={year:Fe,month:Ue,day:Fe,weekday:Ue},We={year:Fe,month:Ve,day:Fe},Ge={year:Fe,month:Ve,day:Fe,weekday:Ve},Ye={hour:Fe,minute:Fe},Ke={hour:Fe,minute:Fe,second:Fe},Qe={hour:Fe,minute:Fe,second:Fe,timeZoneName:Ue},Je={hour:Fe,minute:Fe,second:Fe,timeZoneName:Ve},Xe={hour:Fe,minute:Fe,hourCycle:"h23"},ti={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23"},ei={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23",timeZoneName:Ue},ii={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23",timeZoneName:Ve},oi={year:Fe,month:Fe,day:Fe,hour:Fe,minute:Fe},ni={year:Fe,month:Fe,day:Fe,hour:Fe,minute:Fe,second:Fe},si={year:Fe,month:Ue,day:Fe,hour:Fe,minute:Fe},ri={year:Fe,month:Ue,day:Fe,hour:Fe,minute:Fe,second:Fe},ai={year:Fe,month:Ue,day:Fe,weekday:Ue,hour:Fe,minute:Fe},li={year:Fe,month:Ve,day:Fe,hour:Fe,minute:Fe,timeZoneName:Ue},hi={year:Fe,month:Ve,day:Fe,hour:Fe,minute:Fe,second:Fe,timeZoneName:Ue},ci={year:Fe,month:Ve,day:Fe,weekday:Ve,hour:Fe,minute:Fe,timeZoneName:Ve},di={year:Fe,month:Ve,day:Fe,weekday:Ve,hour:Fe,minute:Fe,second:Fe,timeZoneName:Ve};class ui{get type(){throw new qe}get name(){throw new qe}get ianaName(){return this.name}get isUniversal(){throw new qe}offsetName(t,e){throw new qe}formatOffset(t,e){throw new qe}offset(t){throw new qe}equals(t){throw new qe}get isValid(){throw new qe}}let pi=null;class mi extends ui{static get instance(){return null===pi&&(pi=new mi),pi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Mo(t,e,i)}formatOffset(t,e){return No(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let gi={};const fi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let vi={};class bi extends ui{static create(t){return vi[t]||(vi[t]=new bi(t)),vi[t]}static resetCache(){vi={},gi={}}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=bi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Mo(t,e,i,this.name)}formatOffset(t,e){return No(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(o=this.name,gi[o]||(gi[o]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:o,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),gi[o]);var o;let[n,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),o=[];for(let t=0;t<i.length;t++){const{type:e,value:n}=i[t],s=fi[e];"era"===e?o[s]=n:uo(s)||(o[s]=parseInt(n,10))}return o}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,n,s,r,a,l,h,c]=o;return[r,n,s,a,l,h,c]}(i,e);"BC"===a&&(n=1-Math.abs(n));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,($o({year:n,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 yi={};let _i={};function xi(t,e={}){const i=JSON.stringify([t,e]);let o=_i[i];return o||(o=new Intl.DateTimeFormat(t,e),_i[i]=o),o}let wi={};let ki={};let Ai=null;let Si={};function Ci(t,e,i,o){const n=t.listingMode();return"error"===n?null:"en"===n?i(e):o(e)}class Ti{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:o,floor:n,...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 o=wi[i];return o||(o=new Intl.NumberFormat(t,e),wi[i]=o),o}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return xo(this.floor?Math.floor(t):So(t,3),this.padTo)}}class Ei{constructor(t,e,i){let o;if(this.opts=i,this.originalZone=void 0,this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){const e=t.offset/60*-1,i=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&bi.create(i).valid?(o=i,this.dt=t):(o="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const n={...this.opts};n.timeZone=n.timeZone||o,this.dtf=xi(e,n)}format(){return this.originalZone?this.formatToParts().map((({value:t})=>t)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((t=>{if("timeZoneName"===t.type){const e=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:e}}return t})):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class $i{constructor(t,e,i){this.opts={style:"long",...i},!e&&go()&&(this.rtf=function(t,e={}){const{base:i,...o}=e,n=JSON.stringify([t,o]);let s=ki[n];return s||(s=new Intl.RelativeTimeFormat(t,e),ki[n]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",o=!1){const n={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 ${n[t][0]}`;case-1:return i?"yesterday":`last ${n[t][0]}`;case 0:return i?"today":`this ${n[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=n[t],c=o?l?h[1]:h[2]||h[1]:l?n[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):[]}}const Oi={firstDay:1,minimalDays:4,weekend:[6,7]};class zi{static fromOpts(t){return zi.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,o,n=!1){const s=t||Yi.defaultLocale,r=s||(n?"en-US":Ai||(Ai=(new Intl.DateTimeFormat).resolvedOptions().locale,Ai)),a=e||Yi.defaultNumberingSystem,l=i||Yi.defaultOutputCalendar,h=yo(o)||Yi.defaultWeekSettings;return new zi(r,a,l,h,s)}static resetCache(){Ai=null,_i={},wi={},ki={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i,weekSettings:o}={}){return zi.create(t,e,i,o)}constructor(t,e,i,o,n){const[s,r,a]=function(t){const e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(-1===i)return[t];{let e,o;try{e=xi(t).resolvedOptions(),o=t}catch(n){const s=t.substring(0,i);e=xi(s).resolvedOptions(),o=s}const{numberingSystem:n,calendar:s}=e;return[o,n,s]}}(t);this.locale=s,this.numberingSystem=e||r||null,this.outputCalendar=i||a||null,this.weekSettings=o,this.intl=function(t,e,i){return i||e?(t.includes("-u-")||(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?zi.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,yo(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return Ci(this,t,Uo,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},o=e?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=function(t){const e=[];for(let i=1;i<=12;i++){const o=Hs.utc(2009,i,1);e.push(t(o))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[o][t]}))}weekdays(t,e=!1){return Ci(this,t,Ho,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=e?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=function(t){const e=[];for(let i=1;i<=7;i++){const o=Hs.utc(2016,11,13+i);e.push(t(o))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[o][t]}))}meridiems(){return Ci(this,void 0,(()=>Wo),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Hs.utc(2016,11,13,9),Hs.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return Ci(this,t,Qo,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Hs.utc(-40,1,1),Hs.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const o=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return o?o.value:null}numberFormatter(t={}){return new Ti(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Ei(t,this.intl,e)}relFormatter(t={}){return new $i(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let o=yi[i];return o||(o=new Intl.ListFormat(t,e),yi[i]=o),o}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:fo()?function(t){let e=Si[t];if(!e){const i=new Intl.Locale(t);e="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,Si[t]=e}return e}(this.locale):Oi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Li=null;class Mi extends ui{static get utcInstance(){return null===Li&&(Li=new Mi(0)),Li}static instance(t){return 0===t?Mi.utcInstance:new Mi(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new Mi(Io(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${No(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${No(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return No(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 Ii extends ui{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 Di(t,e){if(uo(t)||null===t)return e;if(t instanceof ui)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"default"===i?e:"local"===i||"system"===i?mi.instance:"utc"===i||"gmt"===i?Mi.utcInstance:Mi.parseSpecifier(i)||bi.create(t)}return po(t)?Mi.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new Ii(t)}const Pi={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ni={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]},Bi=Pi.hanidec.replace(/[\[|\]]/g,"").split("");let Ri={};function qi({numberingSystem:t},e=""){const i=t||"latn";return Ri[i]||(Ri[i]={}),Ri[i][e]||(Ri[i][e]=new RegExp(`${Pi[i]}${e}`)),Ri[i][e]}let Fi,Ui=()=>Date.now(),Vi="system",ji=null,Zi=null,Hi=null,Wi=60,Gi=null;class Yi{static get now(){return Ui}static set now(t){Ui=t}static set defaultZone(t){Vi=t}static get defaultZone(){return Di(Vi,mi.instance)}static get defaultLocale(){return ji}static set defaultLocale(t){ji=t}static get defaultNumberingSystem(){return Zi}static set defaultNumberingSystem(t){Zi=t}static get defaultOutputCalendar(){return Hi}static set defaultOutputCalendar(t){Hi=t}static get defaultWeekSettings(){return Gi}static set defaultWeekSettings(t){Gi=yo(t)}static get twoDigitCutoffYear(){return Wi}static set twoDigitCutoffYear(t){Wi=t%100}static get throwOnInvalid(){return Fi}static set throwOnInvalid(t){Fi=t}static resetCaches(){zi.resetCache(),bi.resetCache(),Hs.resetCache(),Ri={}}}class Ki{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Qi=[0,31,59,90,120,151,181,212,243,273,304,334],Ji=[0,31,60,91,121,152,182,213,244,274,305,335];function Xi(t,e){return new Ki("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function to(t,e,i){const o=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&o.setUTCFullYear(o.getUTCFullYear()-1900);const n=o.getUTCDay();return 0===n?7:n}function eo(t,e,i){return i+(Co(t)?Ji:Qi)[e-1]}function io(t,e){const i=Co(t)?Ji:Qi,o=i.findIndex((t=>t<e));return{month:o+1,day:e-i[o]}}function oo(t,e){return(t-e+7)%7+1}function no(t,e=4,i=1){const{year:o,month:n,day:s}=t,r=eo(o,n,s),a=oo(to(o,n,s),i);let l,h=Math.floor((r-a+14-e)/7);return h<1?(l=o-1,h=zo(l,e,i)):h>zo(o,e,i)?(l=o+1,h=1):l=o,{weekYear:l,weekNumber:h,weekday:a,...Bo(t)}}function so(t,e=4,i=1){const{weekYear:o,weekNumber:n,weekday:s}=t,r=oo(to(o,1,e),i),a=To(o);let l,h=7*n+s-r-7+e;h<1?(l=o-1,h+=To(l)):h>a?(l=o+1,h-=To(o)):l=o;const{month:c,day:d}=io(l,h);return{year:l,month:c,day:d,...Bo(t)}}function ro(t){const{year:e,month:i,day:o}=t;return{year:e,ordinal:eo(e,i,o),...Bo(t)}}function ao(t){const{year:e,ordinal:i}=t,{month:o,day:n}=io(e,i);return{year:e,month:o,day:n,...Bo(t)}}function lo(t,e){if(!uo(t.localWeekday)||!uo(t.localWeekNumber)||!uo(t.localWeekYear)){if(!uo(t.weekday)||!uo(t.weekNumber)||!uo(t.weekYear))throw new Ne("Cannot mix locale-based week fields with ISO-based week fields");return uo(t.localWeekday)||(t.weekday=t.localWeekday),uo(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),uo(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function ho(t){const e=mo(t.year),i=_o(t.month,1,12),o=_o(t.day,1,Eo(t.year,t.month));return e?i?!o&&Xi("day",t.day):Xi("month",t.month):Xi("year",t.year)}function co(t){const{hour:e,minute:i,second:o,millisecond:n}=t,s=_o(e,0,23)||24===e&&0===i&&0===o&&0===n,r=_o(i,0,59),a=_o(o,0,59),l=_o(n,0,999);return s?r?a?!l&&Xi("millisecond",n):Xi("second",o):Xi("minute",i):Xi("hour",e)}function uo(t){return void 0===t}function po(t){return"number"==typeof t}function mo(t){return"number"==typeof t&&t%1==0}function go(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function fo(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function vo(t,e,i){if(0!==t.length)return t.reduce(((t,o)=>{const n=[e(o),o];return t&&i(t[0],n[0])===t[0]?t:n}),null)[1]}function bo(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yo(t){if(null==t)return null;if("object"!=typeof t)throw new Re("Week settings must be an object");if(!_o(t.firstDay,1,7)||!_o(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!_o(t,1,7))))throw new Re("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function _o(t,e,i){return mo(t)&&t>=e&&t<=i}function xo(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function wo(t){return uo(t)||null===t||""===t?void 0:parseInt(t,10)}function ko(t){return uo(t)||null===t||""===t?void 0:parseFloat(t)}function Ao(t){if(!uo(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function So(t,e,i=!1){const o=10**e;return(i?Math.trunc:Math.round)(t*o)/o}function Co(t){return t%4==0&&(t%100!=0||t%400==0)}function To(t){return Co(t)?366:365}function Eo(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?Co(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function $o(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(t.year,t.month-1,t.day)),+e}function Oo(t,e,i){return-oo(to(t,1,e),i)+e-1}function zo(t,e=4,i=1){const o=Oo(t,e,i),n=Oo(t+1,e,i);return(To(t)-o+n)/7}function Lo(t){return t>99?t:t>Yi.twoDigitCutoffYear?1900+t:2e3+t}function Mo(t,e,i,o=null){const n=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(s.timeZone=o);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(n).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Io(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const o=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-o:o)}function Do(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Re(`Invalid unit value ${t}`);return e}function Po(t,e){const i={};for(const o in t)if(bo(t,o)){const n=t[o];if(null==n)continue;i[e(o)]=Do(n)}return i}function No(t,e){const i=Math.trunc(Math.abs(t/60)),o=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${xo(i,2)}:${xo(o,2)}`;case"narrow":return`${n}${i}${o>0?`:${o}`:""}`;case"techie":return`${n}${xo(i,2)}${xo(o,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Ro=["January","February","March","April","May","June","July","August","September","October","November","December"],qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fo=["J","F","M","A","M","J","J","A","S","O","N","D"];function Uo(t){switch(t){case"narrow":return[...Fo];case"short":return[...qo];case"long":return[...Ro];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 Vo=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Zo=["M","T","W","T","F","S","S"];function Ho(t){switch(t){case"narrow":return[...Zo];case"short":return[...jo];case"long":return[...Vo];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wo=["AM","PM"],Go=["Before Christ","Anno Domini"],Yo=["BC","AD"],Ko=["B","A"];function Qo(t){switch(t){case"narrow":return[...Ko];case"short":return[...Yo];case"long":return[...Go];default:return null}}function Jo(t,e){let i="";for(const o of t)o.literal?i+=o.val:i+=e(o.val);return i}const Xo={D:je,DD:Ze,DDD:We,DDDD:Ge,t:Ye,tt:Ke,ttt:Qe,tttt:Je,T:Xe,TT:ti,TTT:ei,TTTT:ii,f:oi,ff:si,fff:li,ffff:ci,F:ni,FF:ri,FFF:hi,FFFF:di};class tn{static create(t,e={}){return new tn(t,e)}static parseFormat(t){let e=null,i="",o=!1;const n=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&n.push({literal:o||/^\s+$/.test(i),val:i}),e=null,i="",o=!o):o||r===e?i+=r:(i.length>0&&n.push({literal:/^\s+$/.test(i),val:i}),i=r,e=r)}return i.length>0&&n.push({literal:o||/^\s+$/.test(i),val:i}),n}static macroTokenToFormatOpts(t){return Xo[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()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return xo(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(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(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 Wo[t.hour<12?0:1]}(t):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,o)=>i?function(t,e){return Uo(e)[t.month-1]}(t,e):n(o?{month:e}:{month:e,day:"numeric"},"month"),l=(e,o)=>i?function(t,e){return Ho(e)[t.weekday-1]}(t,e):n(o?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=tn.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Qo(e)[t.year<0?0:1]}(t,e):n({era:e},"era");return Jo(tn.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 o?n({day:"numeric"},"day"):this.num(t.day);case"dd":return o?n({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 o?n({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?n({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 o?n({month:"numeric"},"month"):this.num(t.month);case"MM":return o?n({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 o?n({year:"numeric"},"year"):this.num(t.year);case"yy":return o?n({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?n({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?n({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"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);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}},o=tn.parseFormat(e),n=o.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...n.map(i).filter((t=>t)));return Jo(o,(t=>e=>{const o=i(e);return o?this.num(t.get(o),e.length):e})(s))}}const en=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function on(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function nn(...t){return e=>t.reduce((([t,i,o],n)=>{const[s,r,a]=n(e,o);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function sn(t,...e){if(null==t)return[null,null];for(const[i,o]of e){const e=i.exec(t);if(e)return o(e)}return[null,null]}function rn(...t){return(e,i)=>{const o={};let n;for(n=0;n<t.length;n++)o[t[n]]=wo(e[i+n]);return[o,null,i+n]}}const an=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ln=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hn=RegExp(`${ln.source}${`(?:${an.source}?(?:\\[(${en.source})\\])?)?`}`),cn=RegExp(`(?:T${hn.source})?`),dn=rn("weekYear","weekNumber","weekDay"),un=rn("year","ordinal"),pn=RegExp(`${ln.source} ?(?:${an.source}|(${en.source}))?`),mn=RegExp(`(?: ${pn.source})?`);function gn(t,e,i){const o=t[e];return uo(o)?i:wo(o)}function fn(t,e){return[{hours:gn(t,e,0),minutes:gn(t,e+1,0),seconds:gn(t,e+2,0),milliseconds:Ao(t[e+3])},null,e+4]}function vn(t,e){const i=!t[e]&&!t[e+1],o=Io(t[e+1],t[e+2]);return[{},i?null:Mi.instance(o),e+3]}function bn(t,e){return[{},t[e]?bi.create(t[e]):null,e+1]}const yn=RegExp(`^T?${ln.source}$`),_n=/^-?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 xn(t){const[e,i,o,n,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(ko(i)),months:u(ko(o)),weeks:u(ko(n)),days:u(ko(s)),hours:u(ko(r)),minutes:u(ko(a)),seconds:u(ko(l),"-0"===l),milliseconds:u(Ao(h),d)}]}const wn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function kn(t,e,i,o,n,s,r){const a={year:2===e.length?Lo(wo(e)):wo(e),month:qo.indexOf(i)+1,day:wo(o),hour:wo(n),minute:wo(s)};return r&&(a.second=wo(r)),t&&(a.weekday=t.length>3?Vo.indexOf(t)+1:jo.indexOf(t)+1),a}const An=/^(?:(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 Sn(t){const[,e,i,o,n,s,r,a,l,h,c,d]=t,u=kn(e,n,o,i,s,r,a);let p;return p=l?wn[l]:h?0:Io(c,d),[u,new Mi(p)]}const Cn=/^(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$/,Tn=/^(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$/,En=/^(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 $n(t){const[,e,i,o,n,s,r,a]=t;return[kn(e,n,o,i,s,r,a),Mi.utcInstance]}function On(t){const[,e,i,o,n,s,r,a]=t;return[kn(e,a,i,o,n,s,r),Mi.utcInstance]}const zn=on(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,cn),Ln=on(/(\d{4})-?W(\d\d)(?:-?(\d))?/,cn),Mn=on(/(\d{4})-?(\d{3})/,cn),In=on(hn),Dn=nn((function(t,e){return[{year:gn(t,e),month:gn(t,e+1,1),day:gn(t,e+2,1)},null,e+3]}),fn,vn,bn),Pn=nn(dn,fn,vn,bn),Nn=nn(un,fn,vn,bn),Bn=nn(fn,vn,bn);const Rn=nn(fn);const qn=on(/(\d{4})-(\d\d)-(\d\d)/,mn),Fn=on(pn),Un=nn(fn,vn,bn);const Vn="Invalid Duration",jn={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}},Zn={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},...jn},Hn=365.2425,Wn=30.436875,Gn={years:{quarters:4,months:12,weeks:52.1775,days:Hn,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:Wn,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...jn},Yn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Kn=Yn.slice(0).reverse();function Qn(t,e,i=!1){const o={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ts(o)}function Jn(t,e){let i=e.milliseconds??0;for(const o of Kn.slice(1))e[o]&&(i+=e[o]*t[o].milliseconds);return i}function Xn(t,e){const i=Jn(t,e)<0?-1:1;Yn.reduceRight(((o,n)=>{if(uo(e[n]))return o;if(o){const s=e[o]*i,r=t[n][o],a=Math.floor(s/r);e[n]+=a*i,e[o]-=a*r*i}return n}),null),Yn.reduce(((i,o)=>{if(uo(e[o]))return i;if(i){const n=e[i]%1;e[i]-=n,e[o]+=n*t[i][o]}return o}),null)}class ts{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let i=e?Gn:Zn;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||zi.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return ts.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Re("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new ts({values:Po(t,ts.normalizeUnit),loc:zi.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(po(t))return ts.fromMillis(t);if(ts.isDuration(t))return t;if("object"==typeof t)return ts.fromObject(t);throw new Re(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return sn(t,[_n,xn])}(t);return i?ts.fromObject(i,e):ts.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return sn(t,[yn,Rn])}(t);return i?ts.fromObject(i,e):ts.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Re("need to specify a reason the Duration is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new Pe(i);return new ts({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 Be(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?tn.create(this.loc,i).formatDurationFromString(this,t):Vn}toHuman(t={}){if(!this.isValid)return Vn;const e=Yn.map((e=>{const i=this.values[e];return uo(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+=So(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,includeOffset:!1};return Hs.fromMillis(e,{zone:"UTC"}).toISOTime(t)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Jn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=ts.fromDurationLike(t),i={};for(const t of Yn)(bo(e.values,t)||bo(this.values,t))&&(i[t]=e.get(t)+this.get(t));return Qn(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=ts.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]=Do(t(this.values[i],i));return Qn(this,{values:e},!0)}get(t){return this[ts.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return Qn(this,{values:{...this.values,...Po(t,ts.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:o}={}){return Qn(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:o,conversionAccuracy:i})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Xn(this.matrix,t),Qn(this,{values:t},!0)}rescale(){if(!this.isValid)return this;return Qn(this,{values:function(t){const e={};for(const[i,o]of Object.entries(t))0!==o&&(e[i]=o);return e}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>ts.normalizeUnit(t)));const e={},i={},o=this.toObject();let n;for(const s of Yn)if(t.indexOf(s)>=0){n=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;po(o[s])&&(t+=o[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3}else po(o[s])&&(i[s]=o[s]);for(const t in i)0!==i[t]&&(e[n]+=t===n?i[t]:i[t]/this.matrix[n][t]);return Xn(this.matrix,e),Qn(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}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 Qn(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 o of Yn)if(e=this.values[o],i=t.values[o],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const es="Invalid Interval";class is{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 Re("need to specify a reason the Interval is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new De(i);return new is({invalid:i})}static fromDateTimes(t,e){const i=Ws(t),o=Ws(e),n=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?is.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:is.invalid("missing or invalid end"):is.invalid("missing or invalid start")}(i,o);return null==n?new is({start:i,end:o}):n}static after(t,e){const i=ts.fromDurationLike(e),o=Ws(t);return is.fromDateTimes(o,o.plus(i))}static before(t,e){const i=ts.fromDurationLike(e),o=Ws(t);return is.fromDateTimes(o.minus(i),o)}static fromISO(t,e){const[i,o]=(t||"").split("/",2);if(i&&o){let t,n,s,r;try{t=Hs.fromISO(i,e),n=t.isValid}catch(o){n=!1}try{s=Hs.fromISO(o,e),r=s.isValid}catch(o){r=!1}if(n&&r)return is.fromDateTimes(t,s);if(n){const i=ts.fromISO(o,e);if(i.isValid)return is.after(t,i)}else if(r){const t=ts.fromISO(i,e);if(t.isValid)return is.before(s,t)}}return is.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",e){if(!this.isValid)return NaN;const i=this.start.startOf(t,e);let o;return o=e?.useLocaleWeeks?this.end.reconfigure({locale:i.locale}):this.end,o=o.startOf(t,e),Math.floor(o.diff(i,t).get(t))+(o.valueOf()!==this.end.valueOf())}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?is.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Ws).filter((t=>this.contains(t))).sort(((t,e)=>t.toMillis()-e.toMillis())),i=[];let{s:o}=this,n=0;for(;o<this.e;){const t=e[n]||this.e,s=+t>+this.e?this.e:t;i.push(is.fromDateTimes(o,s)),o=s,n+=1}return i}splitBy(t){const e=ts.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:o}=this,n=1;const s=[];for(;o<this.e;){const t=this.start.plus(e.mapUnits((t=>t*n)));i=+t>+this.e?this.e:t,s.push(is.fromDateTimes(o,i)),o=i,n+=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:is.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 is.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 o=[],n=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...n).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&&o.push(is.fromDateTimes(e,t.time)),e=null);return is.merge(o)}difference(...t){return is.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:es}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=je,e={}){return this.isValid?tn.create(this.s.loc.clone(e),t).formatInterval(this):es}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:es}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:es}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:es}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:es}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):ts.invalid(this.invalidReason)}mapEndpoints(t){return is.fromDateTimes(t(this.s),t(this.e))}}class os{static hasDST(t=Yi.defaultZone){const e=Hs.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return bi.isValidZone(t)}static normalizeZone(t){return Di(t,Yi.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null,outputCalendar:n="gregory"}={}){return(o||zi.create(e,i,n)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null,outputCalendar:n="gregory"}={}){return(o||zi.create(e,i,n)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null}={}){return(o||zi.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null}={}){return(o||zi.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return zi.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return zi.create(e,null,"gregory").eras(t)}static features(){return{relative:go(),localeWeek:fo()}}}function ns(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),o=i(e)-i(t);return Math.floor(ts.fromMillis(o).as("days"))}function ss(t,e,i,o){let[n,s,r,a]=function(t,e,i){const o=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter+4*(e.year-t.year)],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=ns(t,e);return(i-i%7)/7}],["days",ns]],n={},s=t;let r,a;for(const[l,h]of o)i.indexOf(l)>=0&&(r=l,n[l]=h(t,e),a=s.plus(n),a>e?(n[l]--,(t=s.plus(n))>e&&(a=t,n[l]--,t=s.plus(n))):t=a);return[t,n,a,r]}(t,e,i);const l=e-n,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=n.plus({[a]:1})),r!==n&&(s[a]=(s[a]||0)+l/(r-n)));const c=ts.fromObject(s,o);return h.length>0?ts.fromMillis(l,o).shiftTo(...h).plus(c):c}function rs(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 o=t.charCodeAt(i);if(-1!==t[i].search(Pi.hanidec))e+=Bi.indexOf(t[i]);else for(const t in Ni){const[i,n]=Ni[t];o>=i&&o<=n&&(e+=o-i)}}return parseInt(e,10)}return e}(t))}}const as=`[ ${String.fromCharCode(160)}]`,ls=new RegExp(as,"g");function hs(t){return t.replace(/\./g,"\\.?").replace(ls,as)}function cs(t){return t.replace(/\./g,"").replace(ls," ").toLowerCase()}function ds(t,e){return null===t?null:{regex:RegExp(t.map(hs).join("|")),deser:([i])=>t.findIndex((t=>cs(i)===cs(t)))+e}}function us(t,e){return{regex:t,deser:([,t,e])=>Io(t,e),groups:e}}function ps(t){return{regex:t,deser:([t])=>t}}const ms={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",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let gs=null;function fs(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const i=ys(tn.macroTokenToFormatOpts(t.val),e);return null==i||i.includes(void 0)?t:i}(t,e))))}class vs{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=fs(tn.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const i=qi(e),o=qi(e,"{2}"),n=qi(e,"{3}"),s=qi(e,"{4}"),r=qi(e,"{6}"),a=qi(e,"{1,2}"),l=qi(e,"{1,3}"),h=qi(e,"{1,6}"),c=qi(e,"{1,9}"),d=qi(e,"{2,4}"),u=qi(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 ds(e.eras("short"),0);case"GG":return ds(e.eras("long"),0);case"y":return rs(h);case"yy":case"kk":return rs(d,Lo);case"yyyy":case"kkkk":return rs(s);case"yyyyy":return rs(u);case"yyyyyy":return rs(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return rs(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return rs(o);case"MMM":return ds(e.months("short",!0),1);case"MMMM":return ds(e.months("long",!0),1);case"LLL":return ds(e.months("short",!1),1);case"LLLL":return ds(e.months("long",!1),1);case"o":case"S":return rs(l);case"ooo":case"SSS":return rs(n);case"u":return ps(c);case"uu":return ps(a);case"uuu":case"E":case"c":return rs(i);case"a":return ds(e.meridiems(),0);case"EEE":return ds(e.weekdays("short",!1),1);case"EEEE":return ds(e.weekdays("long",!1),1);case"ccc":return ds(e.weekdays("short",!0),1);case"cccc":return ds(e.weekdays("long",!0),1);case"Z":case"ZZ":return us(new RegExp(`([+-]${a.source})(?::(${o.source}))?`),2);case"ZZZ":return us(new RegExp(`([+-]${a.source})(${o.source})?`),2);case"z":return ps(/[a-z_+-/]{1,256}?/i);case" ":return ps(/[^\S\n\r]/);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),this.disqualifyingUnit=this.units.find((t=>t.invalidReason)),!this.disqualifyingUnit){const[t,e]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(this.units);this.regex=RegExp(t,"i"),this.handlers=e}}explainFromTokens(t){if(this.isValid){const[e,i]=function(t,e,i){const o=t.match(e);if(o){const t={};let e=1;for(const n in i)if(bo(i,n)){const s=i[n],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(o.slice(e,e+r))),e+=r}return[o,t]}return[o,{}]}(t,this.regex,this.handlers),[o,n,s]=i?function(t){let e,i=null;uo(t.z)||(i=bi.create(t.z)),uo(t.Z)||(i||(i=new Mi(t.Z)),e=t.Z),uo(t.q)||(t.M=3*(t.q-1)+1),uo(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),uo(t.u)||(t.S=Ao(t.u));const o=Object.keys(t).reduce(((e,i)=>{const o=(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 o&&(e[o]=t[i]),e}),{});return[o,i,e]}(i):[null,null,void 0];if(bo(i,"a")&&bo(i,"H"))throw new Ne("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:i,result:o,zone:n,specificOffset:s}}return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function bs(t,e,i){return new vs(t,i).explainFromTokens(e)}function ys(t,e){if(!t)return null;const i=tn.create(e,t).dtFormatter((gs||(gs=Hs.fromMillis(1555555555555)),gs)),o=i.formatToParts(),n=i.resolvedOptions();return o.map((e=>function(t,e,i){const{type:o,value:n}=t;if("literal"===o){const t=/^\s+$/.test(n);return{literal:!t,val:t?" ":n}}const s=e[o];let r=o;"hour"===o&&(r=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":i.hour12?"hour12":"hour24");let a=ms[r];if("object"==typeof a&&(a=a[s]),a)return{literal:!1,val:a}}(e,t,n)))}const _s="Invalid DateTime",xs=864e13;function ws(t){return new Ki("unsupported zone",`the zone "${t.name}" is not supported`)}function ks(t){return null===t.weekData&&(t.weekData=no(t.c)),t.weekData}function As(t){return null===t.localWeekData&&(t.localWeekData=no(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}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 Hs({...i,...e,old:i})}function Cs(t,e,i){let o=t-60*e*1e3;const n=i.offset(o);if(e===n)return[o,e];o-=60*(n-e)*1e3;const s=i.offset(o);return n===s?[o,n]:[t-60*Math.min(n,s)*1e3,Math.max(n,s)]}function Ts(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 Es(t,e,i){return Cs($o(t),e,i)}function $s(t,e){const i=t.o,o=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:o,month:n,day:Math.min(t.c.day,Eo(o,n))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=ts.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=$o(s);let[l,h]=Cs(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function Os(t,e,i,o,n,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length||e){const o=e||a,n=Hs.fromObject(t,{...i,zone:o,specificOffset:s});return r?n:n.setZone(a)}return Hs.invalid(new Ki("unparsable",`the input "${n}" can't be parsed as ${o}`))}function zs(t,e,i=!0){return t.isValid?tn.create(zi.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Ls(t,e){const i=t.c.year>9999||t.c.year<0;let o="";return i&&t.c.year>=0&&(o+="+"),o+=xo(t.c.year,i?6:4),e?(o+="-",o+=xo(t.c.month),o+="-",o+=xo(t.c.day)):(o+=xo(t.c.month),o+=xo(t.c.day)),o}function Ms(t,e,i,o,n,s){let r=xo(t.c.hour);return e?(r+=":",r+=xo(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=":")):r+=xo(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=xo(t.c.second),0===t.c.millisecond&&o||(r+=".",r+=xo(t.c.millisecond,3))),n&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=xo(Math.trunc(-t.o/60)),r+=":",r+=xo(Math.trunc(-t.o%60))):(r+="+",r+=xo(Math.trunc(t.o/60)),r+=":",r+=xo(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const Is={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ds={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ps={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ns=["year","month","day","hour","minute","second","millisecond"],Bs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Rs=["year","ordinal","hour","minute","second","millisecond"];function qs(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(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 Be(t);return e}(t)}}function Fs(t,e){const i=Di(e.zone,Yi.defaultZone);if(!i.isValid)return Hs.invalid(ws(i));const o=zi.fromObject(e);let n,s;if(uo(t.year))n=Yi.now();else{for(const e of Ns)uo(t[e])&&(t[e]=Is[e]);const e=ho(t)||co(t);if(e)return Hs.invalid(e);const o=function(t){return Zs[t]||(void 0===js&&(js=Yi.now()),Zs[t]=t.offset(js)),Zs[t]}(i);[n,s]=Es(t,o,i)}return new Hs({ts:n,zone:i,loc:o,o:s})}function Us(t,e,i){const o=!!uo(i.round)||i.round,n=(t,n)=>{t=So(t,o||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,n)},s=o=>i.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(i.unit)return n(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return n(e,t)}return n(t>e?-0:0,i.units[i.units.length-1])}function Vs(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]}let js,Zs={};class Hs{constructor(t){const e=t.zone||Yi.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Ki("invalid input"):null)||(e.isValid?null:ws(e));this.ts=uo(t.ts)?Yi.now():t.ts;let o=null,n=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[o,n]=[t.old.c,t.old.o];else{const s=po(t.o)&&!t.old?t.o:e.offset(this.ts);o=Ts(this.ts,s),i=Number.isNaN(o.year)?new Ki("invalid input"):null,o=i?null:o,n=i?null:s}}this._zone=e,this.loc=t.loc||zi.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=o,this.o=n,this.isLuxonDateTime=!0}static now(){return new Hs({})}static local(){const[t,e]=Vs(arguments),[i,o,n,s,r,a,l]=e;return Fs({year:i,month:o,day:n,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=Vs(arguments),[i,o,n,s,r,a,l]=e;return t.zone=Mi.utcInstance,Fs({year:i,month:o,day:n,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 Hs.invalid("invalid input");const o=Di(e.zone,Yi.defaultZone);return o.isValid?new Hs({ts:i,zone:o,loc:zi.fromObject(e)}):Hs.invalid(ws(o))}static fromMillis(t,e={}){if(po(t))return t<-xs||t>xs?Hs.invalid("Timestamp out of range"):new Hs({ts:t,zone:Di(e.zone,Yi.defaultZone),loc:zi.fromObject(e)});throw new Re(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(po(t))return new Hs({ts:1e3*t,zone:Di(e.zone,Yi.defaultZone),loc:zi.fromObject(e)});throw new Re("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=Di(e.zone,Yi.defaultZone);if(!i.isValid)return Hs.invalid(ws(i));const o=zi.fromObject(e),n=Po(t,qs),{minDaysInFirstWeek:s,startOfWeek:r}=lo(n,o),a=Yi.now(),l=uo(e.specificOffset)?i.offset(a):e.specificOffset,h=!uo(n.ordinal),c=!uo(n.year),d=!uo(n.month)||!uo(n.day),u=c||d,p=n.weekYear||n.weekNumber;if((u||h)&&p)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new Ne("Can't mix ordinal dates with month/day");const m=p||n.weekday&&!u;let g,f,v=Ts(a,l);m?(g=Bs,f=Ds,v=no(v,s,r)):h?(g=Rs,f=Ps,v=ro(v)):(g=Ns,f=Is);let b=!1;for(const t of g){uo(n[t])?n[t]=b?f[t]:v[t]:b=!0}const y=m?function(t,e=4,i=1){const o=mo(t.weekYear),n=_o(t.weekNumber,1,zo(t.weekYear,e,i)),s=_o(t.weekday,1,7);return o?n?!s&&Xi("weekday",t.weekday):Xi("week",t.weekNumber):Xi("weekYear",t.weekYear)}(n,s,r):h?function(t){const e=mo(t.year),i=_o(t.ordinal,1,To(t.year));return e?!i&&Xi("ordinal",t.ordinal):Xi("year",t.year)}(n):ho(n),_=y||co(n);if(_)return Hs.invalid(_);const x=m?so(n,s,r):h?ao(n):n,[w,k]=Es(x,l,i),A=new Hs({ts:w,zone:i,o:k,loc:o});return n.weekday&&u&&t.weekday!==A.weekday?Hs.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${A.toISO()}`):A.isValid?A:Hs.invalid(A.invalid)}static fromISO(t,e={}){const[i,o]=function(t){return sn(t,[zn,Dn],[Ln,Pn],[Mn,Nn],[In,Bn])}(t);return Os(i,o,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,o]=function(t){return sn(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[An,Sn])}(t);return Os(i,o,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,o]=function(t){return sn(t,[Cn,$n],[Tn,$n],[En,On])}(t);return Os(i,o,e,"HTTP",e)}static fromFormat(t,e,i={}){if(uo(t)||uo(e))throw new Re("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:n=null}=i,s=zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:o,zone:n,specificOffset:s,invalidReason:r}=bs(t,e,i);return[o,n,s,r]}(s,t,e);return h?Hs.invalid(h):Os(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return Hs.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,o]=function(t){return sn(t,[qn,Dn],[Fn,Un])}(t);return Os(i,o,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Re("need to specify a reason the DateTime is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new Ie(i);return new Hs({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const i=ys(t,zi.fromObject(e));return i?i.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return fs(tn.parseFormat(t),zi.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){js=void 0,Zs={}}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?ks(this).weekYear:NaN}get weekNumber(){return this.isValid?ks(this).weekNumber:NaN}get weekday(){return this.isValid?ks(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?As(this).weekday:NaN}get localWeekNumber(){return this.isValid?As(this).weekNumber:NaN}get localWeekYear(){return this.isValid?As(this).weekYear:NaN}get ordinal(){return this.isValid?ro(this.c).ordinal:NaN}get monthShort(){return this.isValid?os.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?os.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?os.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?os.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)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,i=$o(this.c),o=this.zone.offset(i-t),n=this.zone.offset(i+t),s=this.zone.offset(i-o*e),r=this.zone.offset(i-n*e);if(s===r)return[this];const a=i-s*e,l=i-r*e,h=Ts(a,s),c=Ts(l,r);return h.hour===c.hour&&h.minute===c.minute&&h.second===c.second&&h.millisecond===c.millisecond?[Ss(this,{ts:a}),Ss(this,{ts:l})]:[this]}get isInLeapYear(){return Co(this.year)}get daysInMonth(){return Eo(this.year,this.month)}get daysInYear(){return this.isValid?To(this.year):NaN}get weeksInWeekYear(){return this.isValid?zo(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?zo(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:o}=tn.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:o}}toUTC(t=0,e={}){return this.setZone(Mi.instance(t),e)}toLocal(){return this.setZone(Yi.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=Di(t,Yi.defaultZone)).equals(this.zone))return this;if(t.isValid){let o=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[o]=Es(i,e,t)}return Ss(this,{ts:o,zone:t})}return Hs.invalid(ws(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=Po(t,qs),{minDaysInFirstWeek:i,startOfWeek:o}=lo(e,this.loc),n=!uo(e.weekYear)||!uo(e.weekNumber)||!uo(e.weekday),s=!uo(e.ordinal),r=!uo(e.year),a=!uo(e.month)||!uo(e.day),l=r||a,h=e.weekYear||e.weekNumber;if((l||s)&&h)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new Ne("Can't mix ordinal dates with month/day");let c;n?c=so({...no(this.c,i,o),...e},i,o):uo(e.ordinal)?(c={...this.toObject(),...e},uo(e.day)&&(c.day=Math.min(Eo(c.year,c.month),c.day))):c=ao({...ro(this.c),...e});const[d,u]=Es(c,this.o,this.zone);return Ss(this,{ts:d,o:u})}plus(t){if(!this.isValid)return this;return Ss(this,$s(this,ts.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Ss(this,$s(this,ts.fromDurationLike(t).negate()))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const i={},o=ts.normalizeUnit(t);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(e){const t=this.loc.getStartOfWeek(),{weekday:e}=this;e<t&&(i.weekNumber=this.weekNumber-1),i.weekday=t}else i.weekday=1;if("quarters"===o){const t=Math.ceil(this.month/3);i.month=3*(t-1)+1}return this.set(i)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?tn.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):_s}toLocaleString(t=je,e={}){return this.isValid?tn.create(this.loc.clone(e),t).formatDateTime(this):_s}toLocaleParts(t={}){return this.isValid?tn.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:o=!0,extendedZone:n=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=Ls(this,s);return r+="T",r+=Ms(this,s,e,i,o,n),r}toISODate({format:t="extended"}={}){return this.isValid?Ls(this,"extended"===t):null}toISOWeekDate(){return zs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:o=!1,extendedZone:n=!1,format:s="extended"}={}){if(!this.isValid)return null;return(o?"T":"")+Ms(this,"extended"===s,e,t,i,n)}toRFC2822(){return zs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ls(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let o="HH:mm:ss.SSS";return(e||t)&&(i&&(o+=" "),e?o+="z":t&&(o+="ZZ")),zs(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():_s}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}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 ts.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...i},n=(a=e,Array.isArray(a)?a:[a]).map(ts.normalizeUnit),s=t.valueOf()>this.valueOf(),r=ss(s?this:t,s?t:this,n,o);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(Hs.now(),t,e)}until(t){return this.isValid?is.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;const o=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e,i)<=o&&o<=n.endOf(e,i)}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||Hs.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],n=t.unit;return Array.isArray(t.unit)&&(o=t.unit,n=void 0),Us(e,this.plus(i),{...t,numeric:"always",units:o,unit:n})}toRelativeCalendar(t={}){return this.isValid?Us(t.base||Hs.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Hs.isDateTime))throw new Re("min requires all arguments be DateTimes");return vo(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Hs.isDateTime))throw new Re("max requires all arguments be DateTimes");return vo(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:o=null,numberingSystem:n=null}=i;return bs(zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return Hs.fromFormatExplain(t,e,i)}static buildFormatParser(t,e={}){const{locale:i=null,numberingSystem:o=null}=e,n=zi.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return new vs(n,t)}static fromFormatParser(t,e,i={}){if(uo(t)||uo(e))throw new Re("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:n=null}=i,s=zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0});if(!s.equals(e.locale))throw new Re(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${e.locale}`);const{result:r,zone:a,specificOffset:l,invalidReason:h}=e.explainFromTokens(t);return h?Hs.invalid(h):Os(r,a,i,`format ${e.format}`,t,l)}static get DATE_SHORT(){return je}static get DATE_MED(){return Ze}static get DATE_MED_WITH_WEEKDAY(){return He}static get DATE_FULL(){return We}static get DATE_HUGE(){return Ge}static get TIME_SIMPLE(){return Ye}static get TIME_WITH_SECONDS(){return Ke}static get TIME_WITH_SHORT_OFFSET(){return Qe}static get TIME_WITH_LONG_OFFSET(){return Je}static get TIME_24_SIMPLE(){return Xe}static get TIME_24_WITH_SECONDS(){return ti}static get TIME_24_WITH_SHORT_OFFSET(){return ei}static get TIME_24_WITH_LONG_OFFSET(){return ii}static get DATETIME_SHORT(){return oi}static get DATETIME_SHORT_WITH_SECONDS(){return ni}static get DATETIME_MED(){return si}static get DATETIME_MED_WITH_SECONDS(){return ri}static get DATETIME_MED_WITH_WEEKDAY(){return ai}static get DATETIME_FULL(){return li}static get DATETIME_FULL_WITH_SECONDS(){return hi}static get DATETIME_HUGE(){return ci}static get DATETIME_HUGE_WITH_SECONDS(){return di}}function Ws(t){if(Hs.isDateTime(t))return t;if(t&&t.valueOf&&po(t.valueOf()))return Hs.fromJSDate(t);if(t&&"object"==typeof t)return Hs.fromObject(t);throw new Re(`Unknown datetime argument: ${t}, of type ${typeof t}`)}
|
|
295
|
+
class ze{constructor(t=0,e=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=i,this.size=0,this.ttl=e}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}entries(t=this.keys()){return t.map((t=>[t,this.get(t)]))}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0==--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=Date.now()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}has(t){return t in this.items}keys(){const t=[];let e=this.first;for(;null!==e;)t.push(e.key),e=e.next;return t}set(t,e,i=!1,o=this.resetTtl){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,!1===i&&o&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),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?Date.now()+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}values(t=this.keys()){return t.map((t=>this.get(t)))}}function Le(t=1e3,e=0,i=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof i)throw new TypeError("Invalid resetTtl value");return new ze(t,e,i)}class Me extends Error{}class Ie extends Me{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class De extends Me{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Pe extends Me{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Ne extends Me{}class Be extends Me{constructor(t){super(`Invalid unit ${t}`)}}class Re extends Me{}class qe extends Me{constructor(){super("Zone is an abstract class")}}const Fe="numeric",Ue="short",je="long",Ve={year:Fe,month:Fe,day:Fe},Ze={year:Fe,month:Ue,day:Fe},He={year:Fe,month:Ue,day:Fe,weekday:Ue},We={year:Fe,month:je,day:Fe},Ge={year:Fe,month:je,day:Fe,weekday:je},Ye={hour:Fe,minute:Fe},Ke={hour:Fe,minute:Fe,second:Fe},Qe={hour:Fe,minute:Fe,second:Fe,timeZoneName:Ue},Je={hour:Fe,minute:Fe,second:Fe,timeZoneName:je},Xe={hour:Fe,minute:Fe,hourCycle:"h23"},ti={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23"},ei={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23",timeZoneName:Ue},ii={hour:Fe,minute:Fe,second:Fe,hourCycle:"h23",timeZoneName:je},oi={year:Fe,month:Fe,day:Fe,hour:Fe,minute:Fe},ni={year:Fe,month:Fe,day:Fe,hour:Fe,minute:Fe,second:Fe},si={year:Fe,month:Ue,day:Fe,hour:Fe,minute:Fe},ri={year:Fe,month:Ue,day:Fe,hour:Fe,minute:Fe,second:Fe},ai={year:Fe,month:Ue,day:Fe,weekday:Ue,hour:Fe,minute:Fe},li={year:Fe,month:je,day:Fe,hour:Fe,minute:Fe,timeZoneName:Ue},hi={year:Fe,month:je,day:Fe,hour:Fe,minute:Fe,second:Fe,timeZoneName:Ue},ci={year:Fe,month:je,day:Fe,weekday:je,hour:Fe,minute:Fe,timeZoneName:je},di={year:Fe,month:je,day:Fe,weekday:je,hour:Fe,minute:Fe,second:Fe,timeZoneName:je};class ui{get type(){throw new qe}get name(){throw new qe}get ianaName(){return this.name}get isUniversal(){throw new qe}offsetName(t,e){throw new qe}formatOffset(t,e){throw new qe}offset(t){throw new qe}equals(t){throw new qe}get isValid(){throw new qe}}let pi=null;class mi extends ui{static get instance(){return null===pi&&(pi=new mi),pi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Mo(t,e,i)}formatOffset(t,e){return No(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let gi={};const fi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let vi={};class bi extends ui{static create(t){return vi[t]||(vi[t]=new bi(t)),vi[t]}static resetCache(){vi={},gi={}}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=bi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Mo(t,e,i,this.name)}formatOffset(t,e){return No(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(o=this.name,gi[o]||(gi[o]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:o,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),gi[o]);var o;let[n,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),o=[];for(let t=0;t<i.length;t++){const{type:e,value:n}=i[t],s=fi[e];"era"===e?o[s]=n:uo(s)||(o[s]=parseInt(n,10))}return o}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,n,s,r,a,l,h,c]=o;return[r,n,s,a,l,h,c]}(i,e);"BC"===a&&(n=1-Math.abs(n));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,($o({year:n,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 yi={};let _i={};function xi(t,e={}){const i=JSON.stringify([t,e]);let o=_i[i];return o||(o=new Intl.DateTimeFormat(t,e),_i[i]=o),o}let wi={};let ki={};let Ai=null;let Si={};function Ci(t,e,i,o){const n=t.listingMode();return"error"===n?null:"en"===n?i(e):o(e)}class Ti{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:o,floor:n,...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 o=wi[i];return o||(o=new Intl.NumberFormat(t,e),wi[i]=o),o}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return xo(this.floor?Math.floor(t):So(t,3),this.padTo)}}class Ei{constructor(t,e,i){let o;if(this.opts=i,this.originalZone=void 0,this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){const e=t.offset/60*-1,i=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&bi.create(i).valid?(o=i,this.dt=t):(o="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,o=t.zone.name):(o="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const n={...this.opts};n.timeZone=n.timeZone||o,this.dtf=xi(e,n)}format(){return this.originalZone?this.formatToParts().map((({value:t})=>t)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((t=>{if("timeZoneName"===t.type){const e=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:e}}return t})):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class $i{constructor(t,e,i){this.opts={style:"long",...i},!e&&go()&&(this.rtf=function(t,e={}){const{base:i,...o}=e,n=JSON.stringify([t,o]);let s=ki[n];return s||(s=new Intl.RelativeTimeFormat(t,e),ki[n]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",o=!1){const n={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 ${n[t][0]}`;case-1:return i?"yesterday":`last ${n[t][0]}`;case 0:return i?"today":`this ${n[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=n[t],c=o?l?h[1]:h[2]||h[1]:l?n[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):[]}}const Oi={firstDay:1,minimalDays:4,weekend:[6,7]};class zi{static fromOpts(t){return zi.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,o,n=!1){const s=t||Yi.defaultLocale,r=s||(n?"en-US":Ai||(Ai=(new Intl.DateTimeFormat).resolvedOptions().locale,Ai)),a=e||Yi.defaultNumberingSystem,l=i||Yi.defaultOutputCalendar,h=yo(o)||Yi.defaultWeekSettings;return new zi(r,a,l,h,s)}static resetCache(){Ai=null,_i={},wi={},ki={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i,weekSettings:o}={}){return zi.create(t,e,i,o)}constructor(t,e,i,o,n){const[s,r,a]=function(t){const e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(-1===i)return[t];{let e,o;try{e=xi(t).resolvedOptions(),o=t}catch(n){const s=t.substring(0,i);e=xi(s).resolvedOptions(),o=s}const{numberingSystem:n,calendar:s}=e;return[o,n,s]}}(t);this.locale=s,this.numberingSystem=e||r||null,this.outputCalendar=i||a||null,this.weekSettings=o,this.intl=function(t,e,i){return i||e?(t.includes("-u-")||(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?zi.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,yo(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return Ci(this,t,Uo,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},o=e?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=function(t){const e=[];for(let i=1;i<=12;i++){const o=Hs.utc(2009,i,1);e.push(t(o))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[o][t]}))}weekdays(t,e=!1){return Ci(this,t,Ho,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=e?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=function(t){const e=[];for(let i=1;i<=7;i++){const o=Hs.utc(2016,11,13+i);e.push(t(o))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[o][t]}))}meridiems(){return Ci(this,void 0,(()=>Wo),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Hs.utc(2016,11,13,9),Hs.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return Ci(this,t,Qo,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[Hs.utc(-40,1,1),Hs.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const o=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return o?o.value:null}numberFormatter(t={}){return new Ti(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Ei(t,this.intl,e)}relFormatter(t={}){return new $i(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let o=yi[i];return o||(o=new Intl.ListFormat(t,e),yi[i]=o),o}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:fo()?function(t){let e=Si[t];if(!e){const i=new Intl.Locale(t);e="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,Si[t]=e}return e}(this.locale):Oi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Li=null;class Mi extends ui{static get utcInstance(){return null===Li&&(Li=new Mi(0)),Li}static instance(t){return 0===t?Mi.utcInstance:new Mi(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new Mi(Io(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${No(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${No(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return No(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 Ii extends ui{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 Di(t,e){if(uo(t)||null===t)return e;if(t instanceof ui)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"default"===i?e:"local"===i||"system"===i?mi.instance:"utc"===i||"gmt"===i?Mi.utcInstance:Mi.parseSpecifier(i)||bi.create(t)}return po(t)?Mi.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new Ii(t)}const Pi={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ni={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]},Bi=Pi.hanidec.replace(/[\[|\]]/g,"").split("");let Ri={};function qi({numberingSystem:t},e=""){const i=t||"latn";return Ri[i]||(Ri[i]={}),Ri[i][e]||(Ri[i][e]=new RegExp(`${Pi[i]}${e}`)),Ri[i][e]}let Fi,Ui=()=>Date.now(),ji="system",Vi=null,Zi=null,Hi=null,Wi=60,Gi=null;class Yi{static get now(){return Ui}static set now(t){Ui=t}static set defaultZone(t){ji=t}static get defaultZone(){return Di(ji,mi.instance)}static get defaultLocale(){return Vi}static set defaultLocale(t){Vi=t}static get defaultNumberingSystem(){return Zi}static set defaultNumberingSystem(t){Zi=t}static get defaultOutputCalendar(){return Hi}static set defaultOutputCalendar(t){Hi=t}static get defaultWeekSettings(){return Gi}static set defaultWeekSettings(t){Gi=yo(t)}static get twoDigitCutoffYear(){return Wi}static set twoDigitCutoffYear(t){Wi=t%100}static get throwOnInvalid(){return Fi}static set throwOnInvalid(t){Fi=t}static resetCaches(){zi.resetCache(),bi.resetCache(),Hs.resetCache(),Ri={}}}class Ki{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Qi=[0,31,59,90,120,151,181,212,243,273,304,334],Ji=[0,31,60,91,121,152,182,213,244,274,305,335];function Xi(t,e){return new Ki("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function to(t,e,i){const o=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&o.setUTCFullYear(o.getUTCFullYear()-1900);const n=o.getUTCDay();return 0===n?7:n}function eo(t,e,i){return i+(Co(t)?Ji:Qi)[e-1]}function io(t,e){const i=Co(t)?Ji:Qi,o=i.findIndex((t=>t<e));return{month:o+1,day:e-i[o]}}function oo(t,e){return(t-e+7)%7+1}function no(t,e=4,i=1){const{year:o,month:n,day:s}=t,r=eo(o,n,s),a=oo(to(o,n,s),i);let l,h=Math.floor((r-a+14-e)/7);return h<1?(l=o-1,h=zo(l,e,i)):h>zo(o,e,i)?(l=o+1,h=1):l=o,{weekYear:l,weekNumber:h,weekday:a,...Bo(t)}}function so(t,e=4,i=1){const{weekYear:o,weekNumber:n,weekday:s}=t,r=oo(to(o,1,e),i),a=To(o);let l,h=7*n+s-r-7+e;h<1?(l=o-1,h+=To(l)):h>a?(l=o+1,h-=To(o)):l=o;const{month:c,day:d}=io(l,h);return{year:l,month:c,day:d,...Bo(t)}}function ro(t){const{year:e,month:i,day:o}=t;return{year:e,ordinal:eo(e,i,o),...Bo(t)}}function ao(t){const{year:e,ordinal:i}=t,{month:o,day:n}=io(e,i);return{year:e,month:o,day:n,...Bo(t)}}function lo(t,e){if(!uo(t.localWeekday)||!uo(t.localWeekNumber)||!uo(t.localWeekYear)){if(!uo(t.weekday)||!uo(t.weekNumber)||!uo(t.weekYear))throw new Ne("Cannot mix locale-based week fields with ISO-based week fields");return uo(t.localWeekday)||(t.weekday=t.localWeekday),uo(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),uo(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function ho(t){const e=mo(t.year),i=_o(t.month,1,12),o=_o(t.day,1,Eo(t.year,t.month));return e?i?!o&&Xi("day",t.day):Xi("month",t.month):Xi("year",t.year)}function co(t){const{hour:e,minute:i,second:o,millisecond:n}=t,s=_o(e,0,23)||24===e&&0===i&&0===o&&0===n,r=_o(i,0,59),a=_o(o,0,59),l=_o(n,0,999);return s?r?a?!l&&Xi("millisecond",n):Xi("second",o):Xi("minute",i):Xi("hour",e)}function uo(t){return void 0===t}function po(t){return"number"==typeof t}function mo(t){return"number"==typeof t&&t%1==0}function go(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function fo(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function vo(t,e,i){if(0!==t.length)return t.reduce(((t,o)=>{const n=[e(o),o];return t&&i(t[0],n[0])===t[0]?t:n}),null)[1]}function bo(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yo(t){if(null==t)return null;if("object"!=typeof t)throw new Re("Week settings must be an object");if(!_o(t.firstDay,1,7)||!_o(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!_o(t,1,7))))throw new Re("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function _o(t,e,i){return mo(t)&&t>=e&&t<=i}function xo(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function wo(t){return uo(t)||null===t||""===t?void 0:parseInt(t,10)}function ko(t){return uo(t)||null===t||""===t?void 0:parseFloat(t)}function Ao(t){if(!uo(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function So(t,e,i=!1){const o=10**e;return(i?Math.trunc:Math.round)(t*o)/o}function Co(t){return t%4==0&&(t%100!=0||t%400==0)}function To(t){return Co(t)?366:365}function Eo(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?Co(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function $o(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(t.year,t.month-1,t.day)),+e}function Oo(t,e,i){return-oo(to(t,1,e),i)+e-1}function zo(t,e=4,i=1){const o=Oo(t,e,i),n=Oo(t+1,e,i);return(To(t)-o+n)/7}function Lo(t){return t>99?t:t>Yi.twoDigitCutoffYear?1900+t:2e3+t}function Mo(t,e,i,o=null){const n=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(s.timeZone=o);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(n).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Io(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const o=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-o:o)}function Do(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Re(`Invalid unit value ${t}`);return e}function Po(t,e){const i={};for(const o in t)if(bo(t,o)){const n=t[o];if(null==n)continue;i[e(o)]=Do(n)}return i}function No(t,e){const i=Math.trunc(Math.abs(t/60)),o=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${xo(i,2)}:${xo(o,2)}`;case"narrow":return`${n}${i}${o>0?`:${o}`:""}`;case"techie":return`${n}${xo(i,2)}${xo(o,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Ro=["January","February","March","April","May","June","July","August","September","October","November","December"],qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fo=["J","F","M","A","M","J","J","A","S","O","N","D"];function Uo(t){switch(t){case"narrow":return[...Fo];case"short":return[...qo];case"long":return[...Ro];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 jo=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Vo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Zo=["M","T","W","T","F","S","S"];function Ho(t){switch(t){case"narrow":return[...Zo];case"short":return[...Vo];case"long":return[...jo];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wo=["AM","PM"],Go=["Before Christ","Anno Domini"],Yo=["BC","AD"],Ko=["B","A"];function Qo(t){switch(t){case"narrow":return[...Ko];case"short":return[...Yo];case"long":return[...Go];default:return null}}function Jo(t,e){let i="";for(const o of t)o.literal?i+=o.val:i+=e(o.val);return i}const Xo={D:Ve,DD:Ze,DDD:We,DDDD:Ge,t:Ye,tt:Ke,ttt:Qe,tttt:Je,T:Xe,TT:ti,TTT:ei,TTTT:ii,f:oi,ff:si,fff:li,ffff:ci,F:ni,FF:ri,FFF:hi,FFFF:di};class tn{static create(t,e={}){return new tn(t,e)}static parseFormat(t){let e=null,i="",o=!1;const n=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&n.push({literal:o||/^\s+$/.test(i),val:i}),e=null,i="",o=!o):o||r===e?i+=r:(i.length>0&&n.push({literal:/^\s+$/.test(i),val:i}),i=r,e=r)}return i.length>0&&n.push({literal:o||/^\s+$/.test(i),val:i}),n}static macroTokenToFormatOpts(t){return Xo[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()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return xo(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(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(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 Wo[t.hour<12?0:1]}(t):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,o)=>i?function(t,e){return Uo(e)[t.month-1]}(t,e):n(o?{month:e}:{month:e,day:"numeric"},"month"),l=(e,o)=>i?function(t,e){return Ho(e)[t.weekday-1]}(t,e):n(o?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=tn.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Qo(e)[t.year<0?0:1]}(t,e):n({era:e},"era");return Jo(tn.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 o?n({day:"numeric"},"day"):this.num(t.day);case"dd":return o?n({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 o?n({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?n({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 o?n({month:"numeric"},"month"):this.num(t.month);case"MM":return o?n({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 o?n({year:"numeric"},"year"):this.num(t.year);case"yy":return o?n({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?n({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?n({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"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);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}},o=tn.parseFormat(e),n=o.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...n.map(i).filter((t=>t)));return Jo(o,(t=>e=>{const o=i(e);return o?this.num(t.get(o),e.length):e})(s))}}const en=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function on(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function nn(...t){return e=>t.reduce((([t,i,o],n)=>{const[s,r,a]=n(e,o);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function sn(t,...e){if(null==t)return[null,null];for(const[i,o]of e){const e=i.exec(t);if(e)return o(e)}return[null,null]}function rn(...t){return(e,i)=>{const o={};let n;for(n=0;n<t.length;n++)o[t[n]]=wo(e[i+n]);return[o,null,i+n]}}const an=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ln=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hn=RegExp(`${ln.source}${`(?:${an.source}?(?:\\[(${en.source})\\])?)?`}`),cn=RegExp(`(?:T${hn.source})?`),dn=rn("weekYear","weekNumber","weekDay"),un=rn("year","ordinal"),pn=RegExp(`${ln.source} ?(?:${an.source}|(${en.source}))?`),mn=RegExp(`(?: ${pn.source})?`);function gn(t,e,i){const o=t[e];return uo(o)?i:wo(o)}function fn(t,e){return[{hours:gn(t,e,0),minutes:gn(t,e+1,0),seconds:gn(t,e+2,0),milliseconds:Ao(t[e+3])},null,e+4]}function vn(t,e){const i=!t[e]&&!t[e+1],o=Io(t[e+1],t[e+2]);return[{},i?null:Mi.instance(o),e+3]}function bn(t,e){return[{},t[e]?bi.create(t[e]):null,e+1]}const yn=RegExp(`^T?${ln.source}$`),_n=/^-?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 xn(t){const[e,i,o,n,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(ko(i)),months:u(ko(o)),weeks:u(ko(n)),days:u(ko(s)),hours:u(ko(r)),minutes:u(ko(a)),seconds:u(ko(l),"-0"===l),milliseconds:u(Ao(h),d)}]}const wn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function kn(t,e,i,o,n,s,r){const a={year:2===e.length?Lo(wo(e)):wo(e),month:qo.indexOf(i)+1,day:wo(o),hour:wo(n),minute:wo(s)};return r&&(a.second=wo(r)),t&&(a.weekday=t.length>3?jo.indexOf(t)+1:Vo.indexOf(t)+1),a}const An=/^(?:(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 Sn(t){const[,e,i,o,n,s,r,a,l,h,c,d]=t,u=kn(e,n,o,i,s,r,a);let p;return p=l?wn[l]:h?0:Io(c,d),[u,new Mi(p)]}const Cn=/^(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$/,Tn=/^(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$/,En=/^(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 $n(t){const[,e,i,o,n,s,r,a]=t;return[kn(e,n,o,i,s,r,a),Mi.utcInstance]}function On(t){const[,e,i,o,n,s,r,a]=t;return[kn(e,a,i,o,n,s,r),Mi.utcInstance]}const zn=on(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,cn),Ln=on(/(\d{4})-?W(\d\d)(?:-?(\d))?/,cn),Mn=on(/(\d{4})-?(\d{3})/,cn),In=on(hn),Dn=nn((function(t,e){return[{year:gn(t,e),month:gn(t,e+1,1),day:gn(t,e+2,1)},null,e+3]}),fn,vn,bn),Pn=nn(dn,fn,vn,bn),Nn=nn(un,fn,vn,bn),Bn=nn(fn,vn,bn);const Rn=nn(fn);const qn=on(/(\d{4})-(\d\d)-(\d\d)/,mn),Fn=on(pn),Un=nn(fn,vn,bn);const jn="Invalid Duration",Vn={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}},Zn={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},...Vn},Hn=365.2425,Wn=30.436875,Gn={years:{quarters:4,months:12,weeks:52.1775,days:Hn,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:Wn,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Vn},Yn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Kn=Yn.slice(0).reverse();function Qn(t,e,i=!1){const o={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ts(o)}function Jn(t,e){let i=e.milliseconds??0;for(const o of Kn.slice(1))e[o]&&(i+=e[o]*t[o].milliseconds);return i}function Xn(t,e){const i=Jn(t,e)<0?-1:1;Yn.reduceRight(((o,n)=>{if(uo(e[n]))return o;if(o){const s=e[o]*i,r=t[n][o],a=Math.floor(s/r);e[n]+=a*i,e[o]-=a*r*i}return n}),null),Yn.reduce(((i,o)=>{if(uo(e[o]))return i;if(i){const n=e[i]%1;e[i]-=n,e[o]+=n*t[i][o]}return o}),null)}class ts{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let i=e?Gn:Zn;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||zi.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return ts.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Re("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new ts({values:Po(t,ts.normalizeUnit),loc:zi.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(po(t))return ts.fromMillis(t);if(ts.isDuration(t))return t;if("object"==typeof t)return ts.fromObject(t);throw new Re(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return sn(t,[_n,xn])}(t);return i?ts.fromObject(i,e):ts.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return sn(t,[yn,Rn])}(t);return i?ts.fromObject(i,e):ts.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Re("need to specify a reason the Duration is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new Pe(i);return new ts({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 Be(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?tn.create(this.loc,i).formatDurationFromString(this,t):jn}toHuman(t={}){if(!this.isValid)return jn;const e=Yn.map((e=>{const i=this.values[e];return uo(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+=So(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,includeOffset:!1};return Hs.fromMillis(e,{zone:"UTC"}).toISOTime(t)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Jn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=ts.fromDurationLike(t),i={};for(const t of Yn)(bo(e.values,t)||bo(this.values,t))&&(i[t]=e.get(t)+this.get(t));return Qn(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=ts.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]=Do(t(this.values[i],i));return Qn(this,{values:e},!0)}get(t){return this[ts.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return Qn(this,{values:{...this.values,...Po(t,ts.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:o}={}){return Qn(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:o,conversionAccuracy:i})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Xn(this.matrix,t),Qn(this,{values:t},!0)}rescale(){if(!this.isValid)return this;return Qn(this,{values:function(t){const e={};for(const[i,o]of Object.entries(t))0!==o&&(e[i]=o);return e}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>ts.normalizeUnit(t)));const e={},i={},o=this.toObject();let n;for(const s of Yn)if(t.indexOf(s)>=0){n=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;po(o[s])&&(t+=o[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3}else po(o[s])&&(i[s]=o[s]);for(const t in i)0!==i[t]&&(e[n]+=t===n?i[t]:i[t]/this.matrix[n][t]);return Xn(this.matrix,e),Qn(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}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 Qn(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 o of Yn)if(e=this.values[o],i=t.values[o],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const es="Invalid Interval";class is{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 Re("need to specify a reason the Interval is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new De(i);return new is({invalid:i})}static fromDateTimes(t,e){const i=Ws(t),o=Ws(e),n=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?is.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:is.invalid("missing or invalid end"):is.invalid("missing or invalid start")}(i,o);return null==n?new is({start:i,end:o}):n}static after(t,e){const i=ts.fromDurationLike(e),o=Ws(t);return is.fromDateTimes(o,o.plus(i))}static before(t,e){const i=ts.fromDurationLike(e),o=Ws(t);return is.fromDateTimes(o.minus(i),o)}static fromISO(t,e){const[i,o]=(t||"").split("/",2);if(i&&o){let t,n,s,r;try{t=Hs.fromISO(i,e),n=t.isValid}catch(o){n=!1}try{s=Hs.fromISO(o,e),r=s.isValid}catch(o){r=!1}if(n&&r)return is.fromDateTimes(t,s);if(n){const i=ts.fromISO(o,e);if(i.isValid)return is.after(t,i)}else if(r){const t=ts.fromISO(i,e);if(t.isValid)return is.before(s,t)}}return is.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",e){if(!this.isValid)return NaN;const i=this.start.startOf(t,e);let o;return o=e?.useLocaleWeeks?this.end.reconfigure({locale:i.locale}):this.end,o=o.startOf(t,e),Math.floor(o.diff(i,t).get(t))+(o.valueOf()!==this.end.valueOf())}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?is.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Ws).filter((t=>this.contains(t))).sort(((t,e)=>t.toMillis()-e.toMillis())),i=[];let{s:o}=this,n=0;for(;o<this.e;){const t=e[n]||this.e,s=+t>+this.e?this.e:t;i.push(is.fromDateTimes(o,s)),o=s,n+=1}return i}splitBy(t){const e=ts.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:o}=this,n=1;const s=[];for(;o<this.e;){const t=this.start.plus(e.mapUnits((t=>t*n)));i=+t>+this.e?this.e:t,s.push(is.fromDateTimes(o,i)),o=i,n+=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:is.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 is.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 o=[],n=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...n).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&&o.push(is.fromDateTimes(e,t.time)),e=null);return is.merge(o)}difference(...t){return is.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:es}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Ve,e={}){return this.isValid?tn.create(this.s.loc.clone(e),t).formatInterval(this):es}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:es}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:es}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:es}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:es}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):ts.invalid(this.invalidReason)}mapEndpoints(t){return is.fromDateTimes(t(this.s),t(this.e))}}class os{static hasDST(t=Yi.defaultZone){const e=Hs.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return bi.isValidZone(t)}static normalizeZone(t){return Di(t,Yi.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||zi.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null,outputCalendar:n="gregory"}={}){return(o||zi.create(e,i,n)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null,outputCalendar:n="gregory"}={}){return(o||zi.create(e,i,n)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null}={}){return(o||zi.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:o=null}={}){return(o||zi.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return zi.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return zi.create(e,null,"gregory").eras(t)}static features(){return{relative:go(),localeWeek:fo()}}}function ns(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),o=i(e)-i(t);return Math.floor(ts.fromMillis(o).as("days"))}function ss(t,e,i,o){let[n,s,r,a]=function(t,e,i){const o=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter+4*(e.year-t.year)],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=ns(t,e);return(i-i%7)/7}],["days",ns]],n={},s=t;let r,a;for(const[l,h]of o)i.indexOf(l)>=0&&(r=l,n[l]=h(t,e),a=s.plus(n),a>e?(n[l]--,(t=s.plus(n))>e&&(a=t,n[l]--,t=s.plus(n))):t=a);return[t,n,a,r]}(t,e,i);const l=e-n,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=n.plus({[a]:1})),r!==n&&(s[a]=(s[a]||0)+l/(r-n)));const c=ts.fromObject(s,o);return h.length>0?ts.fromMillis(l,o).shiftTo(...h).plus(c):c}function rs(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 o=t.charCodeAt(i);if(-1!==t[i].search(Pi.hanidec))e+=Bi.indexOf(t[i]);else for(const t in Ni){const[i,n]=Ni[t];o>=i&&o<=n&&(e+=o-i)}}return parseInt(e,10)}return e}(t))}}const as=`[ ${String.fromCharCode(160)}]`,ls=new RegExp(as,"g");function hs(t){return t.replace(/\./g,"\\.?").replace(ls,as)}function cs(t){return t.replace(/\./g,"").replace(ls," ").toLowerCase()}function ds(t,e){return null===t?null:{regex:RegExp(t.map(hs).join("|")),deser:([i])=>t.findIndex((t=>cs(i)===cs(t)))+e}}function us(t,e){return{regex:t,deser:([,t,e])=>Io(t,e),groups:e}}function ps(t){return{regex:t,deser:([t])=>t}}const ms={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",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let gs=null;function fs(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const i=ys(tn.macroTokenToFormatOpts(t.val),e);return null==i||i.includes(void 0)?t:i}(t,e))))}class vs{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=fs(tn.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const i=qi(e),o=qi(e,"{2}"),n=qi(e,"{3}"),s=qi(e,"{4}"),r=qi(e,"{6}"),a=qi(e,"{1,2}"),l=qi(e,"{1,3}"),h=qi(e,"{1,6}"),c=qi(e,"{1,9}"),d=qi(e,"{2,4}"),u=qi(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 ds(e.eras("short"),0);case"GG":return ds(e.eras("long"),0);case"y":return rs(h);case"yy":case"kk":return rs(d,Lo);case"yyyy":case"kkkk":return rs(s);case"yyyyy":return rs(u);case"yyyyyy":return rs(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return rs(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return rs(o);case"MMM":return ds(e.months("short",!0),1);case"MMMM":return ds(e.months("long",!0),1);case"LLL":return ds(e.months("short",!1),1);case"LLLL":return ds(e.months("long",!1),1);case"o":case"S":return rs(l);case"ooo":case"SSS":return rs(n);case"u":return ps(c);case"uu":return ps(a);case"uuu":case"E":case"c":return rs(i);case"a":return ds(e.meridiems(),0);case"EEE":return ds(e.weekdays("short",!1),1);case"EEEE":return ds(e.weekdays("long",!1),1);case"ccc":return ds(e.weekdays("short",!0),1);case"cccc":return ds(e.weekdays("long",!0),1);case"Z":case"ZZ":return us(new RegExp(`([+-]${a.source})(?::(${o.source}))?`),2);case"ZZZ":return us(new RegExp(`([+-]${a.source})(${o.source})?`),2);case"z":return ps(/[a-z_+-/]{1,256}?/i);case" ":return ps(/[^\S\n\r]/);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),this.disqualifyingUnit=this.units.find((t=>t.invalidReason)),!this.disqualifyingUnit){const[t,e]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(this.units);this.regex=RegExp(t,"i"),this.handlers=e}}explainFromTokens(t){if(this.isValid){const[e,i]=function(t,e,i){const o=t.match(e);if(o){const t={};let e=1;for(const n in i)if(bo(i,n)){const s=i[n],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(o.slice(e,e+r))),e+=r}return[o,t]}return[o,{}]}(t,this.regex,this.handlers),[o,n,s]=i?function(t){let e,i=null;uo(t.z)||(i=bi.create(t.z)),uo(t.Z)||(i||(i=new Mi(t.Z)),e=t.Z),uo(t.q)||(t.M=3*(t.q-1)+1),uo(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),uo(t.u)||(t.S=Ao(t.u));const o=Object.keys(t).reduce(((e,i)=>{const o=(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 o&&(e[o]=t[i]),e}),{});return[o,i,e]}(i):[null,null,void 0];if(bo(i,"a")&&bo(i,"H"))throw new Ne("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:i,result:o,zone:n,specificOffset:s}}return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function bs(t,e,i){return new vs(t,i).explainFromTokens(e)}function ys(t,e){if(!t)return null;const i=tn.create(e,t).dtFormatter((gs||(gs=Hs.fromMillis(1555555555555)),gs)),o=i.formatToParts(),n=i.resolvedOptions();return o.map((e=>function(t,e,i){const{type:o,value:n}=t;if("literal"===o){const t=/^\s+$/.test(n);return{literal:!t,val:t?" ":n}}const s=e[o];let r=o;"hour"===o&&(r=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":i.hour12?"hour12":"hour24");let a=ms[r];if("object"==typeof a&&(a=a[s]),a)return{literal:!1,val:a}}(e,t,n)))}const _s="Invalid DateTime",xs=864e13;function ws(t){return new Ki("unsupported zone",`the zone "${t.name}" is not supported`)}function ks(t){return null===t.weekData&&(t.weekData=no(t.c)),t.weekData}function As(t){return null===t.localWeekData&&(t.localWeekData=no(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}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 Hs({...i,...e,old:i})}function Cs(t,e,i){let o=t-60*e*1e3;const n=i.offset(o);if(e===n)return[o,e];o-=60*(n-e)*1e3;const s=i.offset(o);return n===s?[o,n]:[t-60*Math.min(n,s)*1e3,Math.max(n,s)]}function Ts(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 Es(t,e,i){return Cs($o(t),e,i)}function $s(t,e){const i=t.o,o=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:o,month:n,day:Math.min(t.c.day,Eo(o,n))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=ts.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=$o(s);let[l,h]=Cs(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function Os(t,e,i,o,n,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length||e){const o=e||a,n=Hs.fromObject(t,{...i,zone:o,specificOffset:s});return r?n:n.setZone(a)}return Hs.invalid(new Ki("unparsable",`the input "${n}" can't be parsed as ${o}`))}function zs(t,e,i=!0){return t.isValid?tn.create(zi.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Ls(t,e){const i=t.c.year>9999||t.c.year<0;let o="";return i&&t.c.year>=0&&(o+="+"),o+=xo(t.c.year,i?6:4),e?(o+="-",o+=xo(t.c.month),o+="-",o+=xo(t.c.day)):(o+=xo(t.c.month),o+=xo(t.c.day)),o}function Ms(t,e,i,o,n,s){let r=xo(t.c.hour);return e?(r+=":",r+=xo(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=":")):r+=xo(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=xo(t.c.second),0===t.c.millisecond&&o||(r+=".",r+=xo(t.c.millisecond,3))),n&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=xo(Math.trunc(-t.o/60)),r+=":",r+=xo(Math.trunc(-t.o%60))):(r+="+",r+=xo(Math.trunc(t.o/60)),r+=":",r+=xo(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const Is={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ds={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ps={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ns=["year","month","day","hour","minute","second","millisecond"],Bs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Rs=["year","ordinal","hour","minute","second","millisecond"];function qs(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(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 Be(t);return e}(t)}}function Fs(t,e){const i=Di(e.zone,Yi.defaultZone);if(!i.isValid)return Hs.invalid(ws(i));const o=zi.fromObject(e);let n,s;if(uo(t.year))n=Yi.now();else{for(const e of Ns)uo(t[e])&&(t[e]=Is[e]);const e=ho(t)||co(t);if(e)return Hs.invalid(e);const o=function(t){return Zs[t]||(void 0===Vs&&(Vs=Yi.now()),Zs[t]=t.offset(Vs)),Zs[t]}(i);[n,s]=Es(t,o,i)}return new Hs({ts:n,zone:i,loc:o,o:s})}function Us(t,e,i){const o=!!uo(i.round)||i.round,n=(t,n)=>{t=So(t,o||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,n)},s=o=>i.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(i.unit)return n(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return n(e,t)}return n(t>e?-0:0,i.units[i.units.length-1])}function js(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]}let Vs,Zs={};class Hs{constructor(t){const e=t.zone||Yi.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Ki("invalid input"):null)||(e.isValid?null:ws(e));this.ts=uo(t.ts)?Yi.now():t.ts;let o=null,n=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[o,n]=[t.old.c,t.old.o];else{const s=po(t.o)&&!t.old?t.o:e.offset(this.ts);o=Ts(this.ts,s),i=Number.isNaN(o.year)?new Ki("invalid input"):null,o=i?null:o,n=i?null:s}}this._zone=e,this.loc=t.loc||zi.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=o,this.o=n,this.isLuxonDateTime=!0}static now(){return new Hs({})}static local(){const[t,e]=js(arguments),[i,o,n,s,r,a,l]=e;return Fs({year:i,month:o,day:n,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=js(arguments),[i,o,n,s,r,a,l]=e;return t.zone=Mi.utcInstance,Fs({year:i,month:o,day:n,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 Hs.invalid("invalid input");const o=Di(e.zone,Yi.defaultZone);return o.isValid?new Hs({ts:i,zone:o,loc:zi.fromObject(e)}):Hs.invalid(ws(o))}static fromMillis(t,e={}){if(po(t))return t<-xs||t>xs?Hs.invalid("Timestamp out of range"):new Hs({ts:t,zone:Di(e.zone,Yi.defaultZone),loc:zi.fromObject(e)});throw new Re(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(po(t))return new Hs({ts:1e3*t,zone:Di(e.zone,Yi.defaultZone),loc:zi.fromObject(e)});throw new Re("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=Di(e.zone,Yi.defaultZone);if(!i.isValid)return Hs.invalid(ws(i));const o=zi.fromObject(e),n=Po(t,qs),{minDaysInFirstWeek:s,startOfWeek:r}=lo(n,o),a=Yi.now(),l=uo(e.specificOffset)?i.offset(a):e.specificOffset,h=!uo(n.ordinal),c=!uo(n.year),d=!uo(n.month)||!uo(n.day),u=c||d,p=n.weekYear||n.weekNumber;if((u||h)&&p)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new Ne("Can't mix ordinal dates with month/day");const m=p||n.weekday&&!u;let g,f,v=Ts(a,l);m?(g=Bs,f=Ds,v=no(v,s,r)):h?(g=Rs,f=Ps,v=ro(v)):(g=Ns,f=Is);let b=!1;for(const t of g){uo(n[t])?n[t]=b?f[t]:v[t]:b=!0}const y=m?function(t,e=4,i=1){const o=mo(t.weekYear),n=_o(t.weekNumber,1,zo(t.weekYear,e,i)),s=_o(t.weekday,1,7);return o?n?!s&&Xi("weekday",t.weekday):Xi("week",t.weekNumber):Xi("weekYear",t.weekYear)}(n,s,r):h?function(t){const e=mo(t.year),i=_o(t.ordinal,1,To(t.year));return e?!i&&Xi("ordinal",t.ordinal):Xi("year",t.year)}(n):ho(n),_=y||co(n);if(_)return Hs.invalid(_);const x=m?so(n,s,r):h?ao(n):n,[w,k]=Es(x,l,i),A=new Hs({ts:w,zone:i,o:k,loc:o});return n.weekday&&u&&t.weekday!==A.weekday?Hs.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${A.toISO()}`):A.isValid?A:Hs.invalid(A.invalid)}static fromISO(t,e={}){const[i,o]=function(t){return sn(t,[zn,Dn],[Ln,Pn],[Mn,Nn],[In,Bn])}(t);return Os(i,o,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,o]=function(t){return sn(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[An,Sn])}(t);return Os(i,o,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,o]=function(t){return sn(t,[Cn,$n],[Tn,$n],[En,On])}(t);return Os(i,o,e,"HTTP",e)}static fromFormat(t,e,i={}){if(uo(t)||uo(e))throw new Re("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:n=null}=i,s=zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:o,zone:n,specificOffset:s,invalidReason:r}=bs(t,e,i);return[o,n,s,r]}(s,t,e);return h?Hs.invalid(h):Os(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return Hs.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,o]=function(t){return sn(t,[qn,Dn],[Fn,Un])}(t);return Os(i,o,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Re("need to specify a reason the DateTime is invalid");const i=t instanceof Ki?t:new Ki(t,e);if(Yi.throwOnInvalid)throw new Ie(i);return new Hs({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const i=ys(t,zi.fromObject(e));return i?i.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return fs(tn.parseFormat(t),zi.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){Vs=void 0,Zs={}}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?ks(this).weekYear:NaN}get weekNumber(){return this.isValid?ks(this).weekNumber:NaN}get weekday(){return this.isValid?ks(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?As(this).weekday:NaN}get localWeekNumber(){return this.isValid?As(this).weekNumber:NaN}get localWeekYear(){return this.isValid?As(this).weekYear:NaN}get ordinal(){return this.isValid?ro(this.c).ordinal:NaN}get monthShort(){return this.isValid?os.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?os.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?os.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?os.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)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,i=$o(this.c),o=this.zone.offset(i-t),n=this.zone.offset(i+t),s=this.zone.offset(i-o*e),r=this.zone.offset(i-n*e);if(s===r)return[this];const a=i-s*e,l=i-r*e,h=Ts(a,s),c=Ts(l,r);return h.hour===c.hour&&h.minute===c.minute&&h.second===c.second&&h.millisecond===c.millisecond?[Ss(this,{ts:a}),Ss(this,{ts:l})]:[this]}get isInLeapYear(){return Co(this.year)}get daysInMonth(){return Eo(this.year,this.month)}get daysInYear(){return this.isValid?To(this.year):NaN}get weeksInWeekYear(){return this.isValid?zo(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?zo(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:o}=tn.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:o}}toUTC(t=0,e={}){return this.setZone(Mi.instance(t),e)}toLocal(){return this.setZone(Yi.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=Di(t,Yi.defaultZone)).equals(this.zone))return this;if(t.isValid){let o=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[o]=Es(i,e,t)}return Ss(this,{ts:o,zone:t})}return Hs.invalid(ws(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=Po(t,qs),{minDaysInFirstWeek:i,startOfWeek:o}=lo(e,this.loc),n=!uo(e.weekYear)||!uo(e.weekNumber)||!uo(e.weekday),s=!uo(e.ordinal),r=!uo(e.year),a=!uo(e.month)||!uo(e.day),l=r||a,h=e.weekYear||e.weekNumber;if((l||s)&&h)throw new Ne("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new Ne("Can't mix ordinal dates with month/day");let c;n?c=so({...no(this.c,i,o),...e},i,o):uo(e.ordinal)?(c={...this.toObject(),...e},uo(e.day)&&(c.day=Math.min(Eo(c.year,c.month),c.day))):c=ao({...ro(this.c),...e});const[d,u]=Es(c,this.o,this.zone);return Ss(this,{ts:d,o:u})}plus(t){if(!this.isValid)return this;return Ss(this,$s(this,ts.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Ss(this,$s(this,ts.fromDurationLike(t).negate()))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const i={},o=ts.normalizeUnit(t);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(e){const t=this.loc.getStartOfWeek(),{weekday:e}=this;e<t&&(i.weekNumber=this.weekNumber-1),i.weekday=t}else i.weekday=1;if("quarters"===o){const t=Math.ceil(this.month/3);i.month=3*(t-1)+1}return this.set(i)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?tn.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):_s}toLocaleString(t=Ve,e={}){return this.isValid?tn.create(this.loc.clone(e),t).formatDateTime(this):_s}toLocaleParts(t={}){return this.isValid?tn.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:o=!0,extendedZone:n=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=Ls(this,s);return r+="T",r+=Ms(this,s,e,i,o,n),r}toISODate({format:t="extended"}={}){return this.isValid?Ls(this,"extended"===t):null}toISOWeekDate(){return zs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:o=!1,extendedZone:n=!1,format:s="extended"}={}){if(!this.isValid)return null;return(o?"T":"")+Ms(this,"extended"===s,e,t,i,n)}toRFC2822(){return zs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return zs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ls(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let o="HH:mm:ss.SSS";return(e||t)&&(i&&(o+=" "),e?o+="z":t&&(o+="ZZ")),zs(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():_s}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}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 ts.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...i},n=(a=e,Array.isArray(a)?a:[a]).map(ts.normalizeUnit),s=t.valueOf()>this.valueOf(),r=ss(s?this:t,s?t:this,n,o);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(Hs.now(),t,e)}until(t){return this.isValid?is.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;const o=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e,i)<=o&&o<=n.endOf(e,i)}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||Hs.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],n=t.unit;return Array.isArray(t.unit)&&(o=t.unit,n=void 0),Us(e,this.plus(i),{...t,numeric:"always",units:o,unit:n})}toRelativeCalendar(t={}){return this.isValid?Us(t.base||Hs.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Hs.isDateTime))throw new Re("min requires all arguments be DateTimes");return vo(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(Hs.isDateTime))throw new Re("max requires all arguments be DateTimes");return vo(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:o=null,numberingSystem:n=null}=i;return bs(zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return Hs.fromFormatExplain(t,e,i)}static buildFormatParser(t,e={}){const{locale:i=null,numberingSystem:o=null}=e,n=zi.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return new vs(n,t)}static fromFormatParser(t,e,i={}){if(uo(t)||uo(e))throw new Re("fromFormatParser requires an input string and a format parser");const{locale:o=null,numberingSystem:n=null}=i,s=zi.fromOpts({locale:o,numberingSystem:n,defaultToEN:!0});if(!s.equals(e.locale))throw new Re(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${e.locale}`);const{result:r,zone:a,specificOffset:l,invalidReason:h}=e.explainFromTokens(t);return h?Hs.invalid(h):Os(r,a,i,`format ${e.format}`,t,l)}static get DATE_SHORT(){return Ve}static get DATE_MED(){return Ze}static get DATE_MED_WITH_WEEKDAY(){return He}static get DATE_FULL(){return We}static get DATE_HUGE(){return Ge}static get TIME_SIMPLE(){return Ye}static get TIME_WITH_SECONDS(){return Ke}static get TIME_WITH_SHORT_OFFSET(){return Qe}static get TIME_WITH_LONG_OFFSET(){return Je}static get TIME_24_SIMPLE(){return Xe}static get TIME_24_WITH_SECONDS(){return ti}static get TIME_24_WITH_SHORT_OFFSET(){return ei}static get TIME_24_WITH_LONG_OFFSET(){return ii}static get DATETIME_SHORT(){return oi}static get DATETIME_SHORT_WITH_SECONDS(){return ni}static get DATETIME_MED(){return si}static get DATETIME_MED_WITH_SECONDS(){return ri}static get DATETIME_MED_WITH_WEEKDAY(){return ai}static get DATETIME_FULL(){return li}static get DATETIME_FULL_WITH_SECONDS(){return hi}static get DATETIME_HUGE(){return ci}static get DATETIME_HUGE_WITH_SECONDS(){return di}}function Ws(t){if(Hs.isDateTime(t))return t;if(t&&t.valueOf&&po(t.valueOf()))return Hs.fromJSDate(t);if(t&&"object"==typeof t)return Hs.fromObject(t);throw new Re(`Unknown datetime argument: ${t}, of type ${typeof t}`)}
|
|
296
296
|
/**
|
|
297
297
|
* @license
|
|
298
298
|
* Copyright 2021 Google LLC
|
|
@@ -330,7 +330,7 @@ const Js="",Xs="h",tr="s";function er(t,e){return(e?Xs:tr)+function(t){let e=0,
|
|
|
330
330
|
* Copyright 2020 Google LLC
|
|
331
331
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
332
332
|
*/
|
|
333
|
-
let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/k5XI5LPpLinJqUxeNgCLZ/4sGXFt6aIiW5paW1oamhmZflGo/7r4NyXu7SK9CvjcM4jW94ftr/xS6gBgzIpqs+sPW8x+ADq2AiB3/w+b5iEAJEV9a7/xxXlo4nmJFwhSbYyNMzMzjbgclpG4oL/rfzr8DX3xPSPxdr+Xh+7KiWUKkwR0cd1YKUkpQj49PZXJ4tAN/zzE/zjwr/NYGsiJ5fA5PFFEqGjKuLw4Ubt5bK6Am8Kjc3n/qYn/MOxPWpxrkSj1nwA1yghI3aAC5Oc+gKIQARJ5UNz13/vmgw8F4psXpjqxOPefBf37rnCJ+JHOjfsc5xIYTGcJ+RmLa+JrCdCAACQBFcgDFaABdIEhMANWwBY4AjewAviBYBAO1gIWiAfJgA8yQS7YDApAEdgF9oJKUAPqQSNoASdABzgNLoDL4Dq4Ce6AB2AEjIPnYAa8AfMQBGEhMkSB5CFVSAsygMwgBmQPuUE+UCAUDkVDcRAPEkK50BaoCCqFKqFaqBH6FjoFXYCuQgPQPWgUmoJ+hd7DCEyCqbAyrA0bwwzYCfaGg+E1cBycBufA+fBOuAKug4/B7fAF+Dp8Bx6Bn8OzCECICA1RQwwRBuKC+CERSCzCRzYghUg5Uoe0IF1IL3ILGUGmkXcoDIqCoqMMUbYoT1QIioVKQ21AFaMqUUdR7age1C3UKGoG9QlNRiuhDdA2aC/0KnQcOhNdgC5HN6Db0JfQd9Dj6DcYDIaG0cFYYTwx4ZgEzDpMMeYAphVzHjOAGcPMYrFYeawB1g7rh2ViBdgC7H7sMew57CB2HPsWR8Sp4sxw7rgIHA+XhyvHNeHO4gZxE7h5vBReC2+D98Oz8dn4Enw9vgt/Az+OnydIE3QIdoRgQgJhM6GC0EK4RHhIeEUkEtWJ1sQAIpe4iVhBPE68QhwlviPJkPRJLqRIkpC0k3SEdJ50j/SKTCZrkx3JEWQBeSe5kXyR/Jj8VoIiYSThJcGW2ChRJdEuMSjxQhIvqSXpJLlWMkeyXPKk5A3JaSm8lLaUixRTaoNUldQpqWGpWWmKtKm0n3SydLF0k/RV6UkZrIy2jJsMWyZf5rDMRZkxCkLRoLhQWJQtlHrKJco4FUPVoXpRE6hF1G+o/dQZWRnZZbKhslmyVbJnZEdoCE2b5kVLopXQTtCGaO+XKC9xWsJZsmNJy5LBJXNyinKOchy5QrlWuTty7+Xp8m7yifK75TvkHymgFPQVAhQyFQ4qXFKYVqQq2iqyFAsVTyjeV4KV9JUCldYpHVbqU5pVVlH2UE5V3q98UXlahabiqJKgUqZyVmVKlaJqr8pVLVM9p/qMLkt3oifRK+g99Bk1JTVPNaFarVq/2ry6jnqIep56q/ojDYIGQyNWo0yjW2NGU1XTVzNXs1nzvhZei6EVr7VPq1drTltHO0x7m3aH9qSOnI6XTo5Os85DXbKug26abp3ubT2MHkMvUe+A3k19WN9CP16/Sv+GAWxgacA1OGAwsBS91Hopb2nd0mFDkqGTYYZhs+GoEc3IxyjPqMPohbGmcYTxbuNe408mFiZJJvUmD0xlTFeY5pl2mf5qpm/GMqsyu21ONnc332jeaf5ymcEyzrKDy+5aUCx8LbZZdFt8tLSy5Fu2WE5ZaVpFW1VbDTOoDH9GMeOKNdra2Xqj9WnrdzaWNgKbEza/2BraJto22U4u11nOWV6/fMxO3Y5pV2s3Yk+3j7Y/ZD/ioObAdKhzeOKo4ch2bHCccNJzSnA65vTC2cSZ79zmPOdi47Le5bwr4urhWuja7ybjFuJW6fbYXd09zr3ZfcbDwmOdx3lPtKe3527PYS9lL5ZXo9fMCqsV61f0eJO8g7wrvZ/46Pvwfbp8Yd8Vvnt8H67UWslb2eEH/Lz89vg98tfxT/P/PgAT4B9QFfA00DQwN7A3iBIUFdQU9CbYObgk+EGIbogwpDtUMjQytDF0Lsw1rDRsZJXxqvWrrocrhHPDOyOwEaERDRGzq91W7109HmkRWRA5tEZnTdaaq2sV1iatPRMlGcWMOhmNjg6Lbor+wPRj1jFnY7xiqmNmWC6sfaznbEd2GXuKY8cp5UzE2sWWxk7G2cXtiZuKd4gvj5/munAruS8TPBNqEuYS/RKPJC4khSW1JuOSo5NP8WR4ibyeFJWUrJSBVIPUgtSRNJu0vWkzfG9+QzqUvia9U0AV/Uz1CXWFW4WjGfYZVRlvM0MzT2ZJZ/Gy+rL1s3dkT+S453y9DrWOta47Vy13c+7oeqf1tRugDTEbujdqbMzfOL7JY9PRzYTNiZt/yDPJK817vSVsS1e+cv6m/LGtHlubCyQK+AXD22y31WxHbedu799hvmP/jk+F7MJrRSZF5UUfilnF174y/ariq4WdsTv7SyxLDu7C7OLtGtrtsPtoqXRpTunYHt897WX0ssKy13uj9l4tX1Zes4+wT7hvpMKnonO/5v5d+z9UxlfeqXKuaq1Wqt5RPXeAfWDwoOPBlhrlmqKa94e4h+7WetS212nXlR/GHM44/LQ+tL73a8bXjQ0KDUUNH4/wjowcDTza02jV2Nik1FTSDDcLm6eORR67+Y3rN50thi21rbTWouPguPD4s2+jvx064X2i+yTjZMt3Wt9Vt1HaCtuh9uz2mY74jpHO8M6BUytOdXfZdrV9b/T9kdNqp6vOyJ4pOUs4m3924VzOudnzqeenL8RdGOuO6n5wcdXF2z0BPf2XvC9duex++WKvU++5K3ZXTl+1uXrqGuNax3XL6+19Fn1tP1j80NZv2d9+w+pG503rm10DywfODjoMXrjleuvyba/b1++svDMwFDJ0dzhyeOQu++7kvaR7L+9n3J9/sOkh+mHhI6lH5Y+VHtf9qPdj64jlyJlR19G+J0FPHoyxxp7/lP7Th/H8p+Sn5ROqE42TZpOnp9ynbj5b/Wz8eerz+emCn6V/rn6h++K7Xxx/6ZtZNTP+kv9y4dfiV/Kvjrxe9rp71n/28ZvkN/NzhW/l3x59x3jX+z7s/cR85gfsh4qPeh+7Pnl/eriQvLDwG/eE8/s3BCkeAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAIXRFWHRDcmVhdGlvbiBUaW1lADIwMjI6MDg6MTEgMDE6MjY6MTB2N148AAAbLUlEQVR4Xu3dC7RddX3g8f8lLyCQlBAeAgJxWlbAKlMWrUCV1IoOaHFcUysya8YWZkpBIgW0dRzn6VotzlTBKWkt2EGWUx8I+EB5g0OqlqACgyhPTQLm/SIJeT/und//nJ14k9wk996cc+/Z//P5rPVb+5GFJhHzzX+fvffp6evrSwxsxqx5Y2NzYszrYk6OmRZzbMzUfjMpZny/GRfTEwPA3uX4bI3ZErOp2q6LWdFvlsTMi5kfMzfm5dkzp22LLQMQ9ErEe0ps3hRzeswbYn49ZnpMjjQAoy9H/7mYn8Q8HfNUzGMR+VWx7XpdG/QIeF5pnxfzlpg3x5waY2UNUC85Ys/GfC/muzEPReDzyr7rdE3QI+AHxeasmAtizo85IyafA6AcvTFPxNwXc2/MnAh8Ple8ooMeEc8r7nwZ/aKYP4g5PgaA7rEw5vaY22Ly5flio1dk0CPkJ8Tm0pg/isk3sgHAvJhbY26JsC9onClIMUGvLqnny+mXxbwzJt+hDgC7y3fK3xNzU8y9pazaax/0CPnBsflAzDUx+a50ABisfNf8DTFfiLDnx+dqq7ZBj5BPjM2VMdfGHJPPAcAwLY25PmZWhH1D40zN1C7o1Yo8X1b/WEx+9AwAWiU/8nZdzM11W7HXJugR8nzH+r+N+YuYfNMbALRLvmnu4zH/py6fsdci6BHz/Pz4Z2LyI2gAMFLmxFwdUX+sedi5OjroEfL8OtZPxeTHz7zFDYDRkEOZH3f7SIS9Y18z27FBj5i/LzZ/HeOGNwA6Qb5x7qqI+lebh52l44IeIc8Bvznm3Y0TANBZ7oq5LMKeA98xOiroEfP8QphbYqzKAehkOeaXRNTz++I7QkcEPUKeH0X7q5j8XLnPygGogxzQG2M+GmEf9UfcRj3oEfOTYnNHzJmNEwBQLz+KeW9E/aXm4egY1a8PjZi/IzaPx4g5AHWVG/Z41bRRM2pBj1/4h2OTX45/ZOMEANRXbtk9VdtGxYhfco9fbP4WtPw42hWNEwBQls/G5Mfb8re6jZgRDXrE/LDYfCXmXY0TAFCmu2PeH1Ff1zxsvxELesT8iNjk2/u9vhWAbpBfF3tBRP2V5mF7jUjQI+ZHx+aBmNMbJwCgOzwV846I+rLmYfu0PegR8+Nj81DM9MYJAOguz8WcF1Ff2Dxsj7YGvVqZz44RcwC6WY76jHau1Nv22Fr1mXm+zC7mAHS73MIHqja2RVuCHj/hfDd7vgHOZ+YA0JSbeG/VyJZredDjJzomNvnRNHezA8Cuchu/XLWypdqxQs8vqvecOQAM7Pdi8gvWWqqlQY+/ceRX3nkDHADs2werZrZMy+5yj5/Y22OTPzdv+WUEACjQ9pj84pkHm4cHpiVBj5ifHJv89XG+aAUABm9lzJkR9fnNw+E74EvuEfNDYnNnjJgDwNDkdt5ZtfSAtOIz9E/FnNHcBQCGKDf0r5q7w3dAl9zjbxT5Tr27YnoaJwCA4cgxvnD2zGn5W9qGZdhBj5gfG5v80vn8elcA4MDk18K+MaK+tHk4NAdyyf3mGDEHgNbITf1cc3fohhX0WJ2/PzYXNo8AgBa5sGrskA35knv8F+U78p6JsToHgNbLl95Pmz1zWn6kbdCGs0L/dIyYA0B75Mbm1g7JkFbosTo/Kzb/FOOudgBonxznc2KVPqd5uH+DDnrEPEc8/wf/VuMEANBOP4g5K6I+qFAP5ZL7v4kRcwAYGbm5ub2DMqgVeqzOD47NizEnNE4AACNhQcyvxSp9U/Nw7wa7Qv+TGDEHgJGV25sbvF/7XaHH6nxibH4ec0zjBAAwkvKb4/5ZrNLXNw8HNpgV+pUxYg4AoyM3OLd4n/a5Qq8+O58Xk9/bDgCMjiUx0/b1Wfr+Vuj57joxB4DRlVu8zzve97pCr547/2nMqY0TAMBoejbm9Xt7Ln1fK/R3xog5AHSG3OTc5gHtK+iXV1sAoDPstc0DXnKfMWtefu5tfsyYxgkAoBNsjzl59sxp+YUzu9jbCv3SGDEHgM6S23xJc3dXe6zQq5vh5sac3DgBAHSSfAX9dbvfHDfQCj1/RaqYA0Bnyo3Ord7FQEG/qNoCAJ3pfdV2p10uuc+YNS8H/uWY4xsnAIBOtDDmxNkzp/U2D/dcoZ8dI+YA0Nlyq3Ozd9o96BdUWwCgs+3SbEEHgHrapdk7P0OfMWtefvH7onyucQIA6GQ54MfNnjktfxPbLiv0t8eIOQDUQ252bndD/6C/udoCAPWws939g/7b1RYAqIed7W58hj5j1rwjYn9FzO43yQEAnSs/hz519sxpr+wIeH6FnJgDQL3kdjdeA7sj4qdXWwCgXhoN3xH0N1ZbAKBeGg0XdACot0bDe869ce742K6PGZtPAAC1sjXmsLxCPzFGzAGgnsbFnJiDPq1xCADU1ck56Cc39wGAmppmhQ4A9ddYoR/T3AcAaurYHPSpzX0AoKaOzEE/srkPANTUVCt0AKi/xgp9UnMfAKipSTno+U1xAEB9TchBn9DcBwBqarwVOgDUX2OFnt8BCwDU17gc9J7mPgBQUz056ABAzQk6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0AChAz7k3zu2r9mGffuWQMemUoyek4yaNTYeMOygd1FP9AHSZ7b19ad2W3rRg9bb0/LLNaePW3upHYPQIOvs0YexB6YJTD4s5PE0/enx1Fthhe7T8iYUb07d/+mqa/fMNqa/PH6mMDkFnr952ymHpyt+eko6cOKY6A+zL3JVb0/WzV6SnF22qzsDIEXT2MG5MT/rIW6em86cfVp0BBqs3/kT9+zmvpC8+vro6AyPDTXHsIsf8k793rJjDMOV7Sy47+4j0obccWZ2BkSHo7OKjbzsqnfnag6sjYLjee/qkdNFvTK6OoP0EnZ3On354evspE6sj4ED9ydlT0ilHTaiOoL0EnYZDxx+UPvjmKdUR0Apj4k/Yq2e49M7IEHQaLnz94Wnywf51gFZ7/bET0hknHFIdQfv4E5yGd512eLUHtNo7/f+LESDopNdMGpdOOmJcdQS02lknHZJ6erxakfYSdNL0Y9y0A+10+ISD0vGTx1ZH0B6CTuPd7EB7HTfJVTDaS9BJE8f71wDa7dDxLrnTXv4kx7emwQgY4zN02kzQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABes69cW5ftU+XuvycKeniMyZXR0A7fOL+5enhF9dVR790xgmHpD8++4jq6Jc2be1Ly9ZtS88u3Zwee2ljWrx2a/UjMDArdIBRNOngg9Jpx0zYY8444eB0/vTD0jUzjkxf+cAJ6Yb3vCa94biDq38K9iToADWQAz/rX70mXfs7U9P4Mb6KlT0JOkCN/MtfPzxdH6v1ieP98c2u/BsBUDNveM2E9JfvOiaNPchKnV8SdIAa+ufHH5wuedOeN9PRvQQdoKbe/xuT0/GTx1VHdDtBB6ipsfEnuEdO2UHQAWrsd3/tsDTWXe8EQQeosYnjexrPrYOgA9Tc644cX+3RzQQdoOamHDqm2qObCTpAzY3zGTpB0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHKNSxk8alOy45cY/56h++Nn3uouPTR946Nf3miYeknh5fv1oCQQcoVP6a9KMmjtljjjl8bDrlqPHpwtcfnj717mPT3190XDr1mAnVP0VdCTpAl/vVqePT3/z+cem8Uw6rzlBHgg5AGhM1+Pjbj0q/ddKh1RnqRtABaDioJ6WPvW1qmjheGurI/2oA7DTl0DHp90+fVB1RJ4IOwC7+xfTDqz3qRNAB2MUJk8emIyeOrY6oC0EHYA/50TbqRdAB2MP4/BA7tSLoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHYA9bNneV+1RF4IOwB6WrN1a7VEXgg7ALhas2ZZWbdheHVEXgg7ALu5/7tVqjzoRdAB2emVjb7rzqbXVEXUi6AA09Pal9MmHl6f1W3qrM9SJoAOQtkfDr3toeZozf0N1hroRdIAu97MVW9KVdy5KDzy/rjpDHQk6QKHyo+T5bvXdZ8X67enFiPjdz6xLf/atpenf37YoPbt0c/VPUVc9594419sDutzl50xJF58xuToC2uET9y9PD7+45wr4d351Yvrv5x9dHQ3Pl55Yk276p1XVEd3KCh0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0gJrbmr/4nK4n6AA1t2rD9mqPbiboADU3d+WWao9uJugANbZ+S196Zunm6ohuJugANfadF9elbT5DJwg6QE1t603py0+sqY7odoIOUFNfenx1Wrhma3VEtxN0gBp6cuGmdOsPV1dHIOgAtfP04s3p43cvTdt7fXbOLwk6QI188yevpmu/sTit39JbnYEmQQeogScWbEozv7Y4Xf/IirTFXe0MQNABRtHaTb2N58h3nxzw+55bl26YvTK9/wsL0jWxKn960abqn4I99Zx741x/1etyl58zJV18xuTqCGiHT9y/PD384rrqCFrPCh0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAUbA9j7fg0V7CTrACNiwRdBpL0EHGAGL1m6t9qA9BB2gzV7d3JsWrtlWHUF7CDpAm815aWPq8xk6bSboAG12zzOvVnvQPoIO0EY/XbI5PbFgY3UE7SPoAG2yvTelz8xeWR1Bewk6QJvc9Oiq9MLyzdURtJegA7TBHU+tTbc9uaY6gvYTdIAW6u1L6eZHX0k3fteldkaWoAO0yNyVW9NVX1+cvvj46uoMjBxBBzgA+ca3H/5iY/qv9y1Ll35lYXp60abqR2Bk9Zx741xvO+hyl58zJV18xuTqqJ4e+dn69MLyLdURtNf23r60bktvWrB6W3p+2ea0cWtUHUaZoFP7oN/6w9Xp1h+s9iYuoKu55E5t5Uudn3x4Rfr8Y6+IOdD1BJ1a2rC1L/35t5ake5/1Sk2ATNCpneXrt6eZdy5KP/qF12kC7CDo1Ep+LOiK2xeln69wAxxAf4JObTy+YFO6Mlbmy9f5XmmA3Qk6tXDfc+vSn9+1JG3Y4vEggIEIOh3vCz9a3bibfVt+pyYAAxJ0Otb26Pf//M6K9L/neCwNYH8EnY60cWtf+g/fXprufsZjaQCDIeh0nJXrt6cPfW1x+sFLG6ozAOyPoNNR5q/amq64Y1F6cfnm6gwAgyHodIwnFzYfS1v6qsfSAIZK0OkIDz6/Pn3kriVp3WaPpQEMh6Az6v7h8TXpLx5anrbl29oBGBZBZ9Tkfn/6kZXpc4+u8lgawAESdEZFfizt43cvTXf9ZG11BoADIeiMuFUbtqervr44PTrfY2kArSLojKiXXsmPpS1OLyzzWBpAKwk6I+apRZvSlRHzJWu3VmcAaBVBZ0R858X16cPfXJJe3by9OgNAKwk6bffFx9ekTzywPG31WBpA2wg6bZO/7fT6R1ammz2WBtB2gk5bbNrWl/7TPcvSNz2WBjAiBJ2WW72xN1399cXp+/PWV2cAaDdBp6V+sbr5bWnPLvVYGsBIEnRa5unFm9MH71icFq3xWBrASBN0WuKRn61P135jcVq7yWNpAKNB0DlgX3lyTfpv9y9PWzyWBjBqBJ1hy4+l/a9/XJk++32PpQGMNkFnWDZv60v/+d5l6Ws/9lgaQCcQdNJQ19ZrNvWmq7+xJH1vrsfSADqFoJPWRqAHa8GabemK2xelZ5Zsqs4A0AkEnfTEgo3V3r79dEl+LG1RWuixNICOI+ik55dtTv84d0N1NLD849d8Y0las9FjaQCdSNBp+MsHl6c5Lw28Uv/yE2vSf7l3Wdq8bfCX5gEYWT3n3jjX80bs9JsnHpLOPvnQdMQhY9KSV7elh19Yn362wmtcATqdoANAAVxyB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUIAc9L7mLgBQU3056Fub+wBATW3NQd/S3AcAampzDvrm5j4AUFNbrNABoP4aK/S1zX0AoKbW5qCvaO4DADW1Mgd9ZXMfAKipFVboAFB/jRX60uY+AFBTS3LQ5zX3AYCamp+DPr+5DwDU1DwrdACov8YK/eWYbY1DAKBu8neyvHzQ7JnT8pvinm+cAgDq5oXc8rxCz35cbQGAemk0XNABoN52CfpT1RYAqJdGw3cEfU5Mb3MXAKiJ3O7c8GbQZ8+c9kpsns37AEBtPFs1fOcKPft+tQUA6mFnu/sH/XvVFgCoh53t7h/0B2P6mrsAQIfLzc7tbtgZ9Nkzpy2JzZPNIwCgwz1Ztbuh/wo9u7faAgCdbZdmCzoA1NM+g/5ozMLmLgDQoXKrc7N32iXos2dOyw+o39E8AgA61O1Vs3fafYWe3VZtAYDO9NVqu9NAQc+vkJvf3AUAOkxudON1r/3tEfRYwufn2j7fPAIAOswtVat3MdAKPbslZntzFwDoELnNAy66Bwx6lH9BbDzCBgCd5d6q0XvY2wo9+7tqCwB0hr22eV9BvyfGV6oCQGfITc5tHtBeg1594H598wgAGGXXD3Qz3A77WqFn/xCz88XvAMCoyC3OTd6rfQY9/iawKTY3NI8AgFFyQ9XkvdrfCj37m5ilzV0AYITlBucW79N+gx5/I1gfm+uaRwDACLuuavE+DWaFnt0UM+BzbwBA2+T25gbv16CCXl23/4/NIwBghHxsf5+d7zDYFXqW767b42XwAEBb5OZ+sbm7fz19fXt9pG0PM2bNe1Ns8heq9zROAADtkON8VqzOf9A83L+hrNDzpffHYnNr8wgAaJPPDyXm2ZCCXvlIjMfYAKA9cmP/rLk7eEMOevyNYVVs/rR5BAC02J9WrR2SIX2G3t+MWfPuis2FzSMAoAW+FTF/d7U/JMO55L7DZTHLmrsAwAHKTf3j5u7QDTvo8TeI/KL4fxczvCU+ALBDbuml0dZh36N2ICv0HPVvx+azzSMAYJj+Npp6d7U/LAcU9Eq+6/2J5i4AMES5oUO+q313w74prr8Zs+adHJsfxRzZOAEADMbKmDNjdT6/eTh8rVih50vv+Sdyccz2xgkAYH9yMy9uRcyzlgQ9i5/Qg7H5aPMIANiPj1btbImWXHLvb8aseX8bmyuaRwDAAPJNcFdW+y3RshV6Px+KOaA79QCgYPkJsauau63T8hV6Fqv0w2LzUEz+djYAoCl/ydl5sTpf1zxsnbYEPYuoHxGb/xtzeuMEAHS3p2LeGjF/pXnYWm0LehZRPzo2s2OmN04AQHd6LmZGxLxtr0xvx2foO1U/8fNi8i8EALpRbmC+zN7W7z9pa9Cz+AUsjM2MmHypAQC6SW5fXpnnFrZV24OeVX8reWtMvhkAALpBbl7+zLytK/MdRiToWfyC8k0A+fK7R9oAKF1uXb7M3pYb4AYyYkHP4heWb9N/T4xvaAOgVLlx76maN2Laepf7vsyYNe/DsfkfMWMaJwCg3vK72fPrXD/dPBxZoxb0LKL+jth8Kca3tAFQZ/lb0/51xPyB5uHIG9WgZxH1k2JzR8yZjRMAUC/568PfGzF/qXk4Okb0M/SBVL8Bb4mZFTO6f7sAgMHLzfrrmLeMdsyzUV+h9xer9XfG5paYYxonAKAzLY25JEJ+b/Nw9I36Cr2/+I25Jzb53e93NU4AQOfJjTq9k2KeddQKvb9Yrb8vNvlShtU6AJ0gr8qvipB/tXnYWTpqhd5f9Rt2WsznY3y2DsBoyQ3KLTqtU2OedewKvb9YrZ8Vm8/E+H51AEbSnJirI+Qd/+ryjl2h9xe/kfk39OyYP4xZkM8BQBvl1uTmnFOHmGe1WKH3F6v1g2NzWczHYo7N5wCgRZbEXBdzc4R8U+NMTdQu6DtE2CfG5sqYa2PcOAfAgcg3vF0fMytCvqFxpmZqG/QdqhX7B2KuiZmezwHAID0Xc0PMF+q2It9d7YO+Q4Q93w9wQUy+HJ9fUDM2BgB2ty0mv/fkpph7I+RFhLCYoPcXcT8hNpfG/FHMtHwOgK43L+bWmFsi4sXdYF1k0HeIsPfEJj/qdlHMH8QcHwNA91gYc3vMbTGPlbIaH0jRQe+vuiSfn2fPl+XPjzkjphaP7QEwaL0xT8TcF5NfzTonIp7PFa9rgr67CHx+5O28mPxNb2+OOTUmr+gBqI8csWdjvhfz3ZiHIuD50bOu07VB310Efkps8str8pfDvCHmjTGnxLi5DqAz5JvZXoj5cczTMf8vJq/AV8W26wn6PkTkJ8TmtTGvq+bEmPzM+9R+MylmfL8ZF2OlD7BvOT5bY7bE5MfF8nZdzIp+k58NfzlmbjW/iHhvji17SOn/A6bddTBuigQoAAAAAElFTkSuQmCC",_r=t=>t.name||[t.first_name,t.last_name].join(" ");class xr extends pe{constructor(){super(...arguments),this.background="#e6e6e6",this.initials=""}updated(t){super.updated(t),t.has("system")&&this.system&&(this.background=`url('${yr}') center / contain no-repeat`),t.has("name")&&this.name&&(this.background=qt.hex(this.name),this.initials=re(this.name)),t.has("avatar")&&this.avatar&&(this.background=`url('${this.avatar}') center / contain no-repeat`)}render(){return j`<div class="wrapper">
|
|
333
|
+
let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL2lDQ1BJQ0MgUHJvZmlsZQAASMedlndUVNcWh8+9d3qhzTDSGXqTLjCA9C4gHQRRGGYGGMoAwwxNbIioQEQREQFFkKCAAaOhSKyIYiEoqGAPSBBQYjCKqKhkRtZKfHl57+Xl98e939pn73P32XuftS4AJE8fLi8FlgIgmSfgB3o401eFR9Cx/QAGeIABpgAwWempvkHuwUAkLzcXerrICfyL3gwBSPy+ZejpT6eD/0/SrFS+AADIX8TmbE46S8T5Ik7KFKSK7TMipsYkihlGiZkvSlDEcmKOW+Sln30W2VHM7GQeW8TinFPZyWwx94h4e4aQI2LER8QFGVxOpohvi1gzSZjMFfFbcWwyh5kOAIoktgs4rHgRm4iYxA8OdBHxcgBwpLgvOOYLFnCyBOJDuaSkZvO5cfECui5Lj25qbc2ge3IykzgCgaE/k5XI5LPpLinJqUxeNgCLZ/4sGXFt6aIiW5paW1oamhmZflGo/7r4NyXu7SK9CvjcM4jW94ftr/xS6gBgzIpqs+sPW8x+ADq2AiB3/w+b5iEAJEV9a7/xxXlo4nmJFwhSbYyNMzMzjbgclpG4oL/rfzr8DX3xPSPxdr+Xh+7KiWUKkwR0cd1YKUkpQj49PZXJ4tAN/zzE/zjwr/NYGsiJ5fA5PFFEqGjKuLw4Ubt5bK6Am8Kjc3n/qYn/MOxPWpxrkSj1nwA1yghI3aAC5Oc+gKIQARJ5UNz13/vmgw8F4psXpjqxOPefBf37rnCJ+JHOjfsc5xIYTGcJ+RmLa+JrCdCAACQBFcgDFaABdIEhMANWwBY4AjewAviBYBAO1gIWiAfJgA8yQS7YDApAEdgF9oJKUAPqQSNoASdABzgNLoDL4Dq4Ce6AB2AEjIPnYAa8AfMQBGEhMkSB5CFVSAsygMwgBmQPuUE+UCAUDkVDcRAPEkK50BaoCCqFKqFaqBH6FjoFXYCuQgPQPWgUmoJ+hd7DCEyCqbAyrA0bwwzYCfaGg+E1cBycBufA+fBOuAKug4/B7fAF+Dp8Bx6Bn8OzCECICA1RQwwRBuKC+CERSCzCRzYghUg5Uoe0IF1IL3ILGUGmkXcoDIqCoqMMUbYoT1QIioVKQ21AFaMqUUdR7age1C3UKGoG9QlNRiuhDdA2aC/0KnQcOhNdgC5HN6Db0JfQd9Dj6DcYDIaG0cFYYTwx4ZgEzDpMMeYAphVzHjOAGcPMYrFYeawB1g7rh2ViBdgC7H7sMew57CB2HPsWR8Sp4sxw7rgIHA+XhyvHNeHO4gZxE7h5vBReC2+D98Oz8dn4Enw9vgt/Az+OnydIE3QIdoRgQgJhM6GC0EK4RHhIeEUkEtWJ1sQAIpe4iVhBPE68QhwlviPJkPRJLqRIkpC0k3SEdJ50j/SKTCZrkx3JEWQBeSe5kXyR/Jj8VoIiYSThJcGW2ChRJdEuMSjxQhIvqSXpJLlWMkeyXPKk5A3JaSm8lLaUixRTaoNUldQpqWGpWWmKtKm0n3SydLF0k/RV6UkZrIy2jJsMWyZf5rDMRZkxCkLRoLhQWJQtlHrKJco4FUPVoXpRE6hF1G+o/dQZWRnZZbKhslmyVbJnZEdoCE2b5kVLopXQTtCGaO+XKC9xWsJZsmNJy5LBJXNyinKOchy5QrlWuTty7+Xp8m7yifK75TvkHymgFPQVAhQyFQ4qXFKYVqQq2iqyFAsVTyjeV4KV9JUCldYpHVbqU5pVVlH2UE5V3q98UXlahabiqJKgUqZyVmVKlaJqr8pVLVM9p/qMLkt3oifRK+g99Bk1JTVPNaFarVq/2ry6jnqIep56q/ojDYIGQyNWo0yjW2NGU1XTVzNXs1nzvhZei6EVr7VPq1drTltHO0x7m3aH9qSOnI6XTo5Os85DXbKug26abp3ubT2MHkMvUe+A3k19WN9CP16/Sv+GAWxgacA1OGAwsBS91Hopb2nd0mFDkqGTYYZhs+GoEc3IxyjPqMPohbGmcYTxbuNe408mFiZJJvUmD0xlTFeY5pl2mf5qpm/GMqsyu21ONnc332jeaf5ymcEyzrKDy+5aUCx8LbZZdFt8tLSy5Fu2WE5ZaVpFW1VbDTOoDH9GMeOKNdra2Xqj9WnrdzaWNgKbEza/2BraJto22U4u11nOWV6/fMxO3Y5pV2s3Yk+3j7Y/ZD/ioObAdKhzeOKo4ch2bHCccNJzSnA65vTC2cSZ79zmPOdi47Le5bwr4urhWuja7ybjFuJW6fbYXd09zr3ZfcbDwmOdx3lPtKe3527PYS9lL5ZXo9fMCqsV61f0eJO8g7wrvZ/46Pvwfbp8Yd8Vvnt8H67UWslb2eEH/Lz89vg98tfxT/P/PgAT4B9QFfA00DQwN7A3iBIUFdQU9CbYObgk+EGIbogwpDtUMjQytDF0Lsw1rDRsZJXxqvWrrocrhHPDOyOwEaERDRGzq91W7109HmkRWRA5tEZnTdaaq2sV1iatPRMlGcWMOhmNjg6Lbor+wPRj1jFnY7xiqmNmWC6sfaznbEd2GXuKY8cp5UzE2sWWxk7G2cXtiZuKd4gvj5/munAruS8TPBNqEuYS/RKPJC4khSW1JuOSo5NP8WR4ibyeFJWUrJSBVIPUgtSRNJu0vWkzfG9+QzqUvia9U0AV/Uz1CXWFW4WjGfYZVRlvM0MzT2ZJZ/Gy+rL1s3dkT+S453y9DrWOta47Vy13c+7oeqf1tRugDTEbujdqbMzfOL7JY9PRzYTNiZt/yDPJK817vSVsS1e+cv6m/LGtHlubCyQK+AXD22y31WxHbedu799hvmP/jk+F7MJrRSZF5UUfilnF174y/ariq4WdsTv7SyxLDu7C7OLtGtrtsPtoqXRpTunYHt897WX0ssKy13uj9l4tX1Zes4+wT7hvpMKnonO/5v5d+z9UxlfeqXKuaq1Wqt5RPXeAfWDwoOPBlhrlmqKa94e4h+7WetS212nXlR/GHM44/LQ+tL73a8bXjQ0KDUUNH4/wjowcDTza02jV2Nik1FTSDDcLm6eORR67+Y3rN50thi21rbTWouPguPD4s2+jvx064X2i+yTjZMt3Wt9Vt1HaCtuh9uz2mY74jpHO8M6BUytOdXfZdrV9b/T9kdNqp6vOyJ4pOUs4m3924VzOudnzqeenL8RdGOuO6n5wcdXF2z0BPf2XvC9duex++WKvU++5K3ZXTl+1uXrqGuNax3XL6+19Fn1tP1j80NZv2d9+w+pG503rm10DywfODjoMXrjleuvyba/b1++svDMwFDJ0dzhyeOQu++7kvaR7L+9n3J9/sOkh+mHhI6lH5Y+VHtf9qPdj64jlyJlR19G+J0FPHoyxxp7/lP7Th/H8p+Sn5ROqE42TZpOnp9ynbj5b/Wz8eerz+emCn6V/rn6h++K7Xxx/6ZtZNTP+kv9y4dfiV/Kvjrxe9rp71n/28ZvkN/NzhW/l3x59x3jX+z7s/cR85gfsh4qPeh+7Pnl/eriQvLDwG/eE8/s3BCkeAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAIXRFWHRDcmVhdGlvbiBUaW1lADIwMjI6MDg6MTEgMDE6MjY6MTB2N148AAAbLUlEQVR4Xu3dC7RddX3g8f8lLyCQlBAeAgJxWlbAKlMWrUCV1IoOaHFcUysya8YWZkpBIgW0dRzn6VotzlTBKWkt2EGWUx8I+EB5g0OqlqACgyhPTQLm/SIJeT/und//nJ14k9wk996cc+/Z//P5rPVb+5GFJhHzzX+fvffp6evrSwxsxqx5Y2NzYszrYk6OmRZzbMzUfjMpZny/GRfTEwPA3uX4bI3ZErOp2q6LWdFvlsTMi5kfMzfm5dkzp22LLQMQ9ErEe0ps3hRzeswbYn49ZnpMjjQAoy9H/7mYn8Q8HfNUzGMR+VWx7XpdG/QIeF5pnxfzlpg3x5waY2UNUC85Ys/GfC/muzEPReDzyr7rdE3QI+AHxeasmAtizo85IyafA6AcvTFPxNwXc2/MnAh8Ple8ooMeEc8r7nwZ/aKYP4g5PgaA7rEw5vaY22Ly5flio1dk0CPkJ8Tm0pg/isk3sgHAvJhbY26JsC9onClIMUGvLqnny+mXxbwzJt+hDgC7y3fK3xNzU8y9pazaax/0CPnBsflAzDUx+a50ABisfNf8DTFfiLDnx+dqq7ZBj5BPjM2VMdfGHJPPAcAwLY25PmZWhH1D40zN1C7o1Yo8X1b/WEx+9AwAWiU/8nZdzM11W7HXJugR8nzH+r+N+YuYfNMbALRLvmnu4zH/py6fsdci6BHz/Pz4Z2LyI2gAMFLmxFwdUX+sedi5OjroEfL8OtZPxeTHz7zFDYDRkEOZH3f7SIS9Y18z27FBj5i/LzZ/HeOGNwA6Qb5x7qqI+lebh52l44IeIc8Bvznm3Y0TANBZ7oq5LMKeA98xOiroEfP8QphbYqzKAehkOeaXRNTz++I7QkcEPUKeH0X7q5j8XLnPygGogxzQG2M+GmEf9UfcRj3oEfOTYnNHzJmNEwBQLz+KeW9E/aXm4egY1a8PjZi/IzaPx4g5AHWVG/Z41bRRM2pBj1/4h2OTX45/ZOMEANRXbtk9VdtGxYhfco9fbP4WtPw42hWNEwBQls/G5Mfb8re6jZgRDXrE/LDYfCXmXY0TAFCmu2PeH1Ff1zxsvxELesT8iNjk2/u9vhWAbpBfF3tBRP2V5mF7jUjQI+ZHx+aBmNMbJwCgOzwV846I+rLmYfu0PegR8+Nj81DM9MYJAOguz8WcF1Ff2Dxsj7YGvVqZz44RcwC6WY76jHau1Nv22Fr1mXm+zC7mAHS73MIHqja2RVuCHj/hfDd7vgHOZ+YA0JSbeG/VyJZredDjJzomNvnRNHezA8Cuchu/XLWypdqxQs8vqvecOQAM7Pdi8gvWWqqlQY+/ceRX3nkDHADs2werZrZMy+5yj5/Y22OTPzdv+WUEACjQ9pj84pkHm4cHpiVBj5ifHJv89XG+aAUABm9lzJkR9fnNw+E74EvuEfNDYnNnjJgDwNDkdt5ZtfSAtOIz9E/FnNHcBQCGKDf0r5q7w3dAl9zjbxT5Tr27YnoaJwCA4cgxvnD2zGn5W9qGZdhBj5gfG5v80vn8elcA4MDk18K+MaK+tHk4NAdyyf3mGDEHgNbITf1cc3fohhX0WJ2/PzYXNo8AgBa5sGrskA35knv8F+U78p6JsToHgNbLl95Pmz1zWn6kbdCGs0L/dIyYA0B75Mbm1g7JkFbosTo/Kzb/FOOudgBonxznc2KVPqd5uH+DDnrEPEc8/wf/VuMEANBOP4g5K6I+qFAP5ZL7v4kRcwAYGbm5ub2DMqgVeqzOD47NizEnNE4AACNhQcyvxSp9U/Nw7wa7Qv+TGDEHgJGV25sbvF/7XaHH6nxibH4ec0zjBAAwkvKb4/5ZrNLXNw8HNpgV+pUxYg4AoyM3OLd4n/a5Qq8+O58Xk9/bDgCMjiUx0/b1Wfr+Vuj57joxB4DRlVu8zzve97pCr547/2nMqY0TAMBoejbm9Xt7Ln1fK/R3xog5AHSG3OTc5gHtK+iXV1sAoDPstc0DXnKfMWtefu5tfsyYxgkAoBNsjzl59sxp+YUzu9jbCv3SGDEHgM6S23xJc3dXe6zQq5vh5sac3DgBAHSSfAX9dbvfHDfQCj1/RaqYA0Bnyo3Ord7FQEG/qNoCAJ3pfdV2p10uuc+YNS8H/uWY4xsnAIBOtDDmxNkzp/U2D/dcoZ8dI+YA0Nlyq3Ozd9o96BdUWwCgs+3SbEEHgHrapdk7P0OfMWtefvH7onyucQIA6GQ54MfNnjktfxPbLiv0t8eIOQDUQ252bndD/6C/udoCAPWws939g/7b1RYAqIed7W58hj5j1rwjYn9FzO43yQEAnSs/hz519sxpr+wIeH6FnJgDQL3kdjdeA7sj4qdXWwCgXhoN3xH0N1ZbAKBeGg0XdACot0bDe869ce742K6PGZtPAAC1sjXmsLxCPzFGzAGgnsbFnJiDPq1xCADU1ck56Cc39wGAmppmhQ4A9ddYoR/T3AcAaurYHPSpzX0AoKaOzEE/srkPANTUVCt0AKi/xgp9UnMfAKipSTno+U1xAEB9TchBn9DcBwBqarwVOgDUX2OFnt8BCwDU17gc9J7mPgBQUz056ABAzQk6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0AChAz7k3zu2r9mGffuWQMemUoyek4yaNTYeMOygd1FP9AHSZ7b19ad2W3rRg9bb0/LLNaePW3upHYPQIOvs0YexB6YJTD4s5PE0/enx1Fthhe7T8iYUb07d/+mqa/fMNqa/PH6mMDkFnr952ymHpyt+eko6cOKY6A+zL3JVb0/WzV6SnF22qzsDIEXT2MG5MT/rIW6em86cfVp0BBqs3/kT9+zmvpC8+vro6AyPDTXHsIsf8k793rJjDMOV7Sy47+4j0obccWZ2BkSHo7OKjbzsqnfnag6sjYLjee/qkdNFvTK6OoP0EnZ3On354evspE6sj4ED9ydlT0ilHTaiOoL0EnYZDxx+UPvjmKdUR0Apj4k/Yq2e49M7IEHQaLnz94Wnywf51gFZ7/bET0hknHFIdQfv4E5yGd512eLUHtNo7/f+LESDopNdMGpdOOmJcdQS02lknHZJ6erxakfYSdNL0Y9y0A+10+ISD0vGTx1ZH0B6CTuPd7EB7HTfJVTDaS9BJE8f71wDa7dDxLrnTXv4kx7emwQgY4zN02kzQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABes69cW5ftU+XuvycKeniMyZXR0A7fOL+5enhF9dVR790xgmHpD8++4jq6Jc2be1Ly9ZtS88u3Zwee2ljWrx2a/UjMDArdIBRNOngg9Jpx0zYY8444eB0/vTD0jUzjkxf+cAJ6Yb3vCa94biDq38K9iToADWQAz/rX70mXfs7U9P4Mb6KlT0JOkCN/MtfPzxdH6v1ieP98c2u/BsBUDNveM2E9JfvOiaNPchKnV8SdIAa+ufHH5wuedOeN9PRvQQdoKbe/xuT0/GTx1VHdDtBB6ipsfEnuEdO2UHQAWrsd3/tsDTWXe8EQQeosYnjexrPrYOgA9Tc644cX+3RzQQdoOamHDqm2qObCTpAzY3zGTpB0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHKNSxk8alOy45cY/56h++Nn3uouPTR946Nf3miYeknh5fv1oCQQcoVP6a9KMmjtljjjl8bDrlqPHpwtcfnj717mPT3190XDr1mAnVP0VdCTpAl/vVqePT3/z+cem8Uw6rzlBHgg5AGhM1+Pjbj0q/ddKh1RnqRtABaDioJ6WPvW1qmjheGurI/2oA7DTl0DHp90+fVB1RJ4IOwC7+xfTDqz3qRNAB2MUJk8emIyeOrY6oC0EHYA/50TbqRdAB2MP4/BA7tSLoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHYA9bNneV+1RF4IOwB6WrN1a7VEXgg7ALhas2ZZWbdheHVEXgg7ALu5/7tVqjzoRdAB2emVjb7rzqbXVEXUi6AA09Pal9MmHl6f1W3qrM9SJoAOQtkfDr3toeZozf0N1hroRdIAu97MVW9KVdy5KDzy/rjpDHQk6QKHyo+T5bvXdZ8X67enFiPjdz6xLf/atpenf37YoPbt0c/VPUVc9594419sDutzl50xJF58xuToC2uET9y9PD7+45wr4d351Yvrv5x9dHQ3Pl55Yk276p1XVEd3KCh0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAaAAgg4ABRB0gJrbmr/4nK4n6AA1t2rD9mqPbiboADU3d+WWao9uJugANbZ+S196Zunm6ohuJugANfadF9elbT5DJwg6QE1t603py0+sqY7odoIOUFNfenx1Wrhma3VEtxN0gBp6cuGmdOsPV1dHIOgAtfP04s3p43cvTdt7fXbOLwk6QI188yevpmu/sTit39JbnYEmQQeogScWbEozv7Y4Xf/IirTFXe0MQNABRtHaTb2N58h3nxzw+55bl26YvTK9/wsL0jWxKn960abqn4I99Zx741x/1etyl58zJV18xuTqCGiHT9y/PD384rrqCFrPCh0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUABBB4ACCDoAFEDQAUbA9j7fg0V7CTrACNiwRdBpL0EHGAGL1m6t9qA9BB2gzV7d3JsWrtlWHUF7CDpAm815aWPq8xk6bSboAG12zzOvVnvQPoIO0EY/XbI5PbFgY3UE7SPoAG2yvTelz8xeWR1Bewk6QJvc9Oiq9MLyzdURtJegA7TBHU+tTbc9uaY6gvYTdIAW6u1L6eZHX0k3fteldkaWoAO0yNyVW9NVX1+cvvj46uoMjBxBBzgA+ca3H/5iY/qv9y1Ll35lYXp60abqR2Bk9Zx741xvO+hyl58zJV18xuTqqJ4e+dn69MLyLdURtNf23r60bktvWrB6W3p+2ea0cWtUHUaZoFP7oN/6w9Xp1h+s9iYuoKu55E5t5Uudn3x4Rfr8Y6+IOdD1BJ1a2rC1L/35t5ake5/1Sk2ATNCpneXrt6eZdy5KP/qF12kC7CDo1Ep+LOiK2xeln69wAxxAf4JObTy+YFO6Mlbmy9f5XmmA3Qk6tXDfc+vSn9+1JG3Y4vEggIEIOh3vCz9a3bibfVt+pyYAAxJ0Otb26Pf//M6K9L/neCwNYH8EnY60cWtf+g/fXprufsZjaQCDIeh0nJXrt6cPfW1x+sFLG6ozAOyPoNNR5q/amq64Y1F6cfnm6gwAgyHodIwnFzYfS1v6qsfSAIZK0OkIDz6/Pn3kriVp3WaPpQEMh6Az6v7h8TXpLx5anrbl29oBGBZBZ9Tkfn/6kZXpc4+u8lgawAESdEZFfizt43cvTXf9ZG11BoADIeiMuFUbtqervr44PTrfY2kArSLojKiXXsmPpS1OLyzzWBpAKwk6I+apRZvSlRHzJWu3VmcAaBVBZ0R858X16cPfXJJe3by9OgNAKwk6bffFx9ekTzywPG31WBpA2wg6bZO/7fT6R1ammz2WBtB2gk5bbNrWl/7TPcvSNz2WBjAiBJ2WW72xN1399cXp+/PWV2cAaDdBp6V+sbr5bWnPLvVYGsBIEnRa5unFm9MH71icFq3xWBrASBN0WuKRn61P135jcVq7yWNpAKNB0DlgX3lyTfpv9y9PWzyWBjBqBJ1hy4+l/a9/XJk++32PpQGMNkFnWDZv60v/+d5l6Ws/9lgaQCcQdNJQ19ZrNvWmq7+xJH1vrsfSADqFoJPWRqAHa8GabemK2xelZ5Zsqs4A0AkEnfTEgo3V3r79dEl+LG1RWuixNICOI+ik55dtTv84d0N1NLD849d8Y0las9FjaQCdSNBp+MsHl6c5Lw28Uv/yE2vSf7l3Wdq8bfCX5gEYWT3n3jjX80bs9JsnHpLOPvnQdMQhY9KSV7elh19Yn362wmtcATqdoANAAVxyB4ACCDoAFEDQAaAAgg4ABRB0ACiAoANAAQQdAAog6ABQAEEHgAIIOgAUQNABoACCDgAFEHQAKICgA0ABBB0ACiDoAFAAQQeAAgg6ABRA0AGgAIIOAAUQdAAogKADQAEEHQAKIOgAUIAc9L7mLgBQU3056Fub+wBATW3NQd/S3AcAampzDvrm5j4AUFNbrNABoP4aK/S1zX0AoKbW5qCvaO4DADW1Mgd9ZXMfAKipFVboAFB/jRX60uY+AFBTS3LQ5zX3AYCamp+DPr+5DwDU1DwrdACov8YK/eWYbY1DAKBu8neyvHzQ7JnT8pvinm+cAgDq5oXc8rxCz35cbQGAemk0XNABoN52CfpT1RYAqJdGw3cEfU5Mb3MXAKiJ3O7c8GbQZ8+c9kpsns37AEBtPFs1fOcKPft+tQUA6mFnu/sH/XvVFgCoh53t7h/0B2P6mrsAQIfLzc7tbtgZ9Nkzpy2JzZPNIwCgwz1Ztbuh/wo9u7faAgCdbZdmCzoA1NM+g/5ozMLmLgDQoXKrc7N32iXos2dOyw+o39E8AgA61O1Vs3fafYWe3VZtAYDO9NVqu9NAQc+vkJvf3AUAOkxudON1r/3tEfRYwufn2j7fPAIAOswtVat3MdAKPbslZntzFwDoELnNAy66Bwx6lH9BbDzCBgCd5d6q0XvY2wo9+7tqCwB0hr22eV9BvyfGV6oCQGfITc5tHtBeg1594H598wgAGGXXD3Qz3A77WqFn/xCz88XvAMCoyC3OTd6rfQY9/iawKTY3NI8AgFFyQ9XkvdrfCj37m5ilzV0AYITlBucW79N+gx5/I1gfm+uaRwDACLuuavE+DWaFnt0UM+BzbwBA2+T25gbv16CCXl23/4/NIwBghHxsf5+d7zDYFXqW767b42XwAEBb5OZ+sbm7fz19fXt9pG0PM2bNe1Ns8heq9zROAADtkON8VqzOf9A83L+hrNDzpffHYnNr8wgAaJPPDyXm2ZCCXvlIjMfYAKA9cmP/rLk7eEMOevyNYVVs/rR5BAC02J9WrR2SIX2G3t+MWfPuis2FzSMAoAW+FTF/d7U/JMO55L7DZTHLmrsAwAHKTf3j5u7QDTvo8TeI/KL4fxczvCU+ALBDbuml0dZh36N2ICv0HPVvx+azzSMAYJj+Npp6d7U/LAcU9Eq+6/2J5i4AMES5oUO+q313w74prr8Zs+adHJsfxRzZOAEADMbKmDNjdT6/eTh8rVih50vv+Sdyccz2xgkAYH9yMy9uRcyzlgQ9i5/Qg7H5aPMIANiPj1btbImWXHLvb8aseX8bmyuaRwDAAPJNcFdW+y3RshV6Px+KOaA79QCgYPkJsauau63T8hV6Fqv0w2LzUEz+djYAoCl/ydl5sTpf1zxsnbYEPYuoHxGb/xtzeuMEAHS3p2LeGjF/pXnYWm0LehZRPzo2s2OmN04AQHd6LmZGxLxtr0xvx2foO1U/8fNi8i8EALpRbmC+zN7W7z9pa9Cz+AUsjM2MmHypAQC6SW5fXpnnFrZV24OeVX8reWtMvhkAALpBbl7+zLytK/MdRiToWfyC8k0A+fK7R9oAKF1uXb7M3pYb4AYyYkHP4heWb9N/T4xvaAOgVLlx76maN2Laepf7vsyYNe/DsfkfMWMaJwCg3vK72fPrXD/dPBxZoxb0LKL+jth8Kca3tAFQZ/lb0/51xPyB5uHIG9WgZxH1k2JzR8yZjRMAUC/568PfGzF/qXk4Okb0M/SBVL8Bb4mZFTO6f7sAgMHLzfrrmLeMdsyzUV+h9xer9XfG5paYYxonAKAzLY25JEJ+b/Nw9I36Cr2/+I25Jzb53e93NU4AQOfJjTq9k2KeddQKvb9Yrb8vNvlShtU6AJ0gr8qvipB/tXnYWTpqhd5f9Rt2WsznY3y2DsBoyQ3KLTqtU2OedewKvb9YrZ8Vm8/E+H51AEbSnJirI+Qd/+ryjl2h9xe/kfk39OyYP4xZkM8BQBvl1uTmnFOHmGe1WKH3F6v1g2NzWczHYo7N5wCgRZbEXBdzc4R8U+NMTdQu6DtE2CfG5sqYa2PcOAfAgcg3vF0fMytCvqFxpmZqG/QdqhX7B2KuiZmezwHAID0Xc0PMF+q2It9d7YO+Q4Q93w9wQUy+HJ9fUDM2BgB2ty0mv/fkpph7I+RFhLCYoPcXcT8hNpfG/FHMtHwOgK43L+bWmFsi4sXdYF1k0HeIsPfEJj/qdlHMH8QcHwNA91gYc3vMbTGPlbIaH0jRQe+vuiSfn2fPl+XPjzkjphaP7QEwaL0xT8TcF5NfzTonIp7PFa9rgr67CHx+5O28mPxNb2+OOTUmr+gBqI8csWdjvhfz3ZiHIuD50bOu07VB310Efkps8str8pfDvCHmjTGnxLi5DqAz5JvZXoj5cczTMf8vJq/AV8W26wn6PkTkJ8TmtTGvq+bEmPzM+9R+MylmfL8ZF2OlD7BvOT5bY7bE5MfF8nZdzIp+k58NfzlmbjW/iHhvji17SOn/A6bddTBuigQoAAAAAElFTkSuQmCC",_r=t=>t.name||[t.first_name,t.last_name].join(" ");class xr extends pe{constructor(){super(...arguments),this.bgimage=null,this.bgcolor="#e6e6e6",this.initials=""}updated(t){super.updated(t),t.has("system")&&this.system&&(this.bgimage=`url('${yr}') center / contain no-repeat`),t.has("name")&&(this.name?(this.bgcolor=qt.hex(this.name),this.initials=re(this.name)):(this.bgcolor="#e6e6e6",this.initials="")),t.has("avatar")&&(this.avatar?this.bgimage=`url('${this.avatar}') center / contain no-repeat`:this.system||(this.bgimage=null))}render(){return V`<div class="wrapper">
|
|
334
334
|
<div
|
|
335
335
|
class="avatar-circle"
|
|
336
336
|
style="
|
|
@@ -344,17 +344,18 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
344
344
|
border-radius: 100%;
|
|
345
345
|
font-weight: 400;
|
|
346
346
|
overflow: hidden;
|
|
347
|
-
font-size:
|
|
347
|
+
font-size: 0.8em;
|
|
348
|
+
margin-right: 0.75em;
|
|
348
349
|
box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.1);
|
|
349
|
-
background:${this.
|
|
350
|
+
background:${this.bgimage||this.bgcolor};"
|
|
350
351
|
>
|
|
351
|
-
${this.initials&&!this.
|
|
352
|
+
${this.initials&&!this.bgimage?V` <div
|
|
352
353
|
style="border: 0px solid red; display:flex; flex-direction: column; align-items:center;flex-grow:1"
|
|
353
354
|
>
|
|
354
355
|
<div style="border:0px solid blue;">${this.initials}</div>
|
|
355
356
|
</div>`:null}
|
|
356
357
|
</div>
|
|
357
|
-
${this.showName?
|
|
358
|
+
${this.showName?V`<div
|
|
358
359
|
class="name"
|
|
359
360
|
style="margin: 0px ${this.scale-.5}em;font-size:${this.scale+.2}em"
|
|
360
361
|
>
|
|
@@ -381,7 +382,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
381
382
|
-webkit-box-orient: vertical;
|
|
382
383
|
overflow: hidden;
|
|
383
384
|
}
|
|
384
|
-
`,t([ce({type:Number})],xr.prototype,"scale",void 0),t([ce({type:Boolean})],xr.prototype,"showName",void 0),t([ce({type:Boolean})],xr.prototype,"system",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"
|
|
385
|
+
`,t([ce({type:Number})],xr.prototype,"scale",void 0),t([ce({type:Boolean})],xr.prototype,"showName",void 0),t([ce({type:Boolean})],xr.prototype,"system",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgimage",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"bgcolor",void 0),t([ce({type:String,attribute:!1})],xr.prototype,"initials",void 0),t([ce({type:String})],xr.prototype,"name",void 0),t([ce({type:String})],xr.prototype,"email",void 0),t([ce({type:String})],xr.prototype,"avatar",void 0);const{setLocale:wr}=(t=>(function(t){if(vr)throw new Error("lit-localize can only be configured once");fr=t,vr=!0}(((t,e)=>nr(cr,t,e))),dr=ar=t.sourceLocale,lr=new Set(t.targetLocales),lr.add(t.sourceLocale),hr=t.loadLocale,{getLocale:mr,setLocale:gr}))({sourceLocale:"en",targetLocales:br,loadLocale:t=>import(`./locales/${t}.js`)});class kr extends pe{constructor(){super(...arguments),this.settings={},this.ttl=6e4,this.max=20,this.ready=!1,this.loader=!1,this.keyedAssets={},this.locale=[...navigator.languages],this.fields={},this.groups={},this.shortcuts=[],this.languages={},this.users=[],this.featuredFields=[],this.dirtyElements=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
|
|
385
386
|
:host {
|
|
386
387
|
position: fixed;
|
|
387
388
|
z-index: 1000;
|
|
@@ -392,7 +393,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
392
393
|
width: 100%;
|
|
393
394
|
top: 0.5em;
|
|
394
395
|
}
|
|
395
|
-
`}markDirty(t){this.dirtyElements.includes(t)||this.dirtyElements.push(t)}cleanAll(){this.dirtyElements.forEach((t=>t.markClean())),this.dirtyElements=[]}markClean(t){this.dirtyElements=this.dirtyElements.filter((e=>e!==t))}getDirtyMessage(){if(this.dirtyElements.length>0)return this.dirtyElements[0].dirtyMessage||"You have unsaved changes, are you sure you want to continue?"}getLocale(){return this.locale[0]}clearCache(){this.cache=Le(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(oe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(
|
|
396
|
+
`}markDirty(t){this.dirtyElements.includes(t)||this.dirtyElements.push(t)}cleanAll(){this.dirtyElements.forEach((t=>t.markClean())),this.dirtyElements=[]}markClean(t){this.dirtyElements=this.dirtyElements.filter((e=>e!==t))}getDirtyMessage(){if(this.dirtyElements.length>0)return this.dirtyElements[0].dirtyMessage||"You have unsaved changes, are you sure you want to continue?"}getLocale(){return this.locale[0]}clearCache(){this.cache=Le(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(oe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(Vt(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(Yt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(Yt(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(Yt(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(Vt(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.shortcutsEndpoint&&t.push(this.refreshShortcuts()),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getShortcuts(){return this.shortcuts||[]}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}async refreshGlobals(){return Yt(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}async refreshShortcuts(){return Yt(this.shortcutsEndpoint).then((t=>{this.shortcuts=t}))}async refreshFields(){return Yt(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent($e.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}shiftAndRound(t,e,i){const o=Math.round(t.shiftTo(e).get(e));return 1==o?`1 ${i}`:`${o} ${e}`}getCountdown(t){const e=t.diff(Hs.now()).rescale();return e.months>0?"> 1 month":e.days>1?`~ ${this.shiftAndRound(e,"days","day")}`:e.hours>0?`~ ${this.shiftAndRound(e,"hours","hour")}`:`~ ${this.shiftAndRound(e,"minutes","minute")}`}getShortDuration(t,e=null){const i=e||Hs.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=Hs.fromISO(t),o=e?Hs.fromISO(e):Hs.now();return this.getShortDuration(i,o)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=br.find((e=>e===t));e&&wr(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return Hs.fromISO(t).setLocale(this.getLocale()).toLocaleString(Hs.DATETIME_SHORT)}postJSON(t,e=""){return Qt(t,e)}postForm(t,e,i={}){return((t,e,i={})=>{const o=new FormData;return Object.keys(e).forEach((t=>{o.append(t,e[t])})),Jt(t,o,i)})(t,e,i)}postUrl(t,e="",i={},o=null){return Kt(t,e,i,o)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):Vt(t,e.controller,e.headers||{}).then((e=>new Promise(((i,o)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):o("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,o=this.cache.get(i);return!e.force&&o?new Promise((t=>{t(o)})):new Promise((e=>{const o=this.pendingResolves[t]||[];o.push(e),this.pendingResolves[t]=o,o.length<=1&&Wt(t).then((e=>{this.cache.set(i,e);const o=this.pendingResolves[t]||[];for(;o.length>0;){o.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent($e.StoreUpdated,{url:t,data:e})}removeFromCache(t){this.cache.delete(t)}resolveUsers(t,e){return new Promise((i=>{const o=new Set;t.forEach((t=>{e.forEach((e=>{const i=e.split(".");let n=t;for(let t=0;t<i.length&&(n=n[i[t]],n);t++);n&&n.email&&o.add(n.email)}))}));const n=[];o.forEach((t=>{n.push(this.getUrl(`/api/v2/users.json?email=${encodeURIComponent(t)}`,{force:!0}))})),Promise.all(n).then((o=>{o.forEach((i=>{if(i&&i.json){const o=i.json.results;if(o&&1===o.length){const i=o[0];t.forEach((t=>{e.forEach((e=>{const o=e.split(".");let n=t,s=n;for(let t=0;t<o.length&&(s=n,n=n[o[t]],n);t++);if(n&&n.email===i.email){const t=s[o[o.length-1]];t.avatar=i.avatar,t.name=_r(i),s[o[o.length-1]].avatar=i.avatar}}))}))}}})),i()}))}))}makeRequest(t,e){const i=this.fetching[t],o=(new Date).getTime();if(i)return void setTimeout((()=>{this.makeRequest(t,e)}),500);let n=this.cache.get(t);n&&!e.force?(n=e.prepareData?e.prepareData(n):n,this.fireCustomEvent($e.StoreUpdated,{url:t,data:n})):(e=e||{},this.fetching[t]=o,Wt(t).then((i=>{i?(this.cache.set(t,i),delete this.fetching[t],i=e.prepareData?e.prepareData(i):i,this.fireCustomEvent($e.StoreUpdated,{url:t,data:i})):delete this.fetching[t]})))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return V`<temba-loading size="10" units="8"></temba-loading>`}}t([ce({type:Number})],kr.prototype,"ttl",void 0),t([ce({type:Number})],kr.prototype,"max",void 0),t([ce({type:Boolean})],kr.prototype,"ready",void 0),t([ce({type:Boolean})],kr.prototype,"loader",void 0),t([ce({type:String,attribute:"completion"})],kr.prototype,"completionEndpoint",void 0),t([ce({type:String,attribute:"fields"})],kr.prototype,"fieldsEndpoint",void 0),t([ce({type:String,attribute:"groups"})],kr.prototype,"groupsEndpoint",void 0),t([ce({type:String,attribute:"globals"})],kr.prototype,"globalsEndpoint",void 0),t([ce({type:String,attribute:"languages"})],kr.prototype,"languagesEndpoint",void 0),t([ce({type:String,attribute:"workspace"})],kr.prototype,"workspaceEndpoint",void 0),t([ce({type:String,attribute:"shortcuts"})],kr.prototype,"shortcutsEndpoint",void 0),t([ce({type:Object,attribute:!1})],kr.prototype,"schema",void 0),t([ce({type:Object,attribute:!1})],kr.prototype,"fnOptions",void 0),t([ce({type:Object,attribute:!1})],kr.prototype,"keyedAssets",void 0);class Ar extends pe{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.internalFocusDisabled=!1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=ee((function(t){this.internalFocusDisabled||t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
|
|
396
397
|
:host {
|
|
397
398
|
--transition-speed: 0;
|
|
398
399
|
}
|
|
@@ -402,16 +403,14 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
402
403
|
user-select: none;
|
|
403
404
|
border-radius: var(--curvature-widget);
|
|
404
405
|
overflow: hidden;
|
|
405
|
-
margin-top: var(--options-margin-top);
|
|
406
406
|
display: flex;
|
|
407
407
|
flex-direction: column;
|
|
408
|
-
// transform: scaleY(0.5) translateY(-5em);
|
|
409
408
|
transition: transform var(--transition-speed)
|
|
410
409
|
cubic-bezier(0.71, 0.18, 0.61, 1.33),
|
|
411
410
|
opacity var(--transition-speed) cubic-bezier(0.71, 0.18, 0.61, 1.33);
|
|
412
411
|
opacity: 0;
|
|
413
|
-
border: 1px transparent;
|
|
414
412
|
z-index: 1000;
|
|
413
|
+
pointer-events: none;
|
|
415
414
|
}
|
|
416
415
|
|
|
417
416
|
.shadow {
|
|
@@ -482,10 +481,11 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
482
481
|
}
|
|
483
482
|
|
|
484
483
|
.show {
|
|
485
|
-
// transform: scaleY(1) translateY(0);
|
|
486
484
|
border: 1px solid var(--color-widget-border);
|
|
487
485
|
opacity: 1;
|
|
488
486
|
z-index: 1;
|
|
487
|
+
pointer-events: auto;
|
|
488
|
+
margin-top: var(--options-margin-top);
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
.option {
|
|
@@ -562,22 +562,22 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
562
562
|
background: var(--color-selection);
|
|
563
563
|
color: var(--color-text-dark);
|
|
564
564
|
}
|
|
565
|
-
`}firstUpdated(t){super.firstUpdated(t),this.block||(this.scrollParent=Xt(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition)),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition),this.resizeObserver&&this.resizeObserver.disconnect()}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("anchorTo")&&this.anchorTo){const t=this.shadowRoot.querySelector(".options-container");this.resizeObserver||(this.resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&(this.calculatePosition(),this.adjustWidth())}))})),this.resizeObserver.observe(t))}if(!this.internalFocusDisabled&&t.has("cursorIndex")&&this.fireCustomEvent($e.CursorChanged,{index:this.cursorIndex}),t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),
|
|
565
|
+
`}firstUpdated(t){super.firstUpdated(t),this.block||(this.scrollParent=Xt(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition)),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition),this.resizeObserver&&this.resizeObserver.disconnect()}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("anchorTo")&&this.anchorTo){const t=this.shadowRoot.querySelector(".options-container");this.resizeObserver||(this.resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&(this.calculatePosition(),this.adjustWidth())}))})),this.resizeObserver.observe(t))}if(!this.internalFocusDisabled&&t.has("cursorIndex")&&this.fireCustomEvent($e.CursorChanged,{index:this.cursorIndex}),t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),200))),t.has("options")){this.adjustWidth(),this.calculatePosition(),this.triggerScroll=!0;const e=t.get("options"),i=e?e.length:0,o=this.options?this.options.length:0;(-1===this.cursorIndex||o<i||0===i&&o>0&&!t.has("cursorIndex"))&&(this.internalFocusDisabled||(this.block?this.cursorIndex>=o&&(this.cursorIndex=o-1):this.cursorIndex=0,this.cursorSelection&&this.handleSelection(!1)));const n=this.shadowRoot.querySelector(".options");n&&n.scrollHeight==n.clientHeight&&this.fireCustomEvent($e.ScrollThreshold)}}renderOptionDefault(t,e){const i=(this.renderOptionName||this.renderOptionNameDefault).bind(this),o=(this.renderOptionDetail||this.renderOptionDetailDefault).bind(this);return e?V`
|
|
566
566
|
<div class="name">${i(t,e)}</div>
|
|
567
567
|
<div class="detail">${o(t,e)}</div>
|
|
568
|
-
`:
|
|
568
|
+
`:V`
|
|
569
569
|
<div class="name">${i(t,e)}</div>
|
|
570
|
-
`}renderOptionNameDefault(t){return
|
|
571
|
-
${t.icon?
|
|
570
|
+
`}renderOptionNameDefault(t){return V`<div style="display:flex; align-items:flex-start">
|
|
571
|
+
${t.icon?V`<temba-icon
|
|
572
572
|
name="${t.icon}"
|
|
573
573
|
style="margin-right:0.5em; fill: var(--color-text-dark);"
|
|
574
574
|
></temba-icon>`:null}
|
|
575
575
|
<div style="flex-grow:1">${t.prefix}${this.getName(t)}</div>
|
|
576
|
-
</div>`}renderOptionDetailDefault(t){return
|
|
576
|
+
</div>`}renderOptionDetailDefault(t){return V` ${t.detail} `}getSelection(){return this.options[this.cursorIndex]}handleSelection(t=!1,e=-1){if(this.internalFocusDisabled||-1===e&&(e=this.cursorIndex),-1===e)return;const i=this.options[e];this.fireCustomEvent($e.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){if(!this.internalFocusDisabled){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}}scrollToTop(){this.shadowRoot.querySelector(".options-scroll").scrollTop=0}ensureOptionVisible(){const t=this.shadowRoot.querySelector(`div[data-option-index="${this.cursorIndex}"]`);t&&t.scrollIntoView({block:"nearest",inline:"start"})}handleKeyDown(t){this.internalFocusDisabled||this.block&&!this.isFocused()||null!==this.offsetParent&&this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.cursorSelection&&this.handleSelection(!1),this.ensureOptionVisible()):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.cursorSelection&&this.handleSelection(!1),this.ensureOptionVisible()):"Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key?(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)):"Escape"===t.key&&this.fireCustomEvent($e.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($e.ScrollThreshold),this.triggerScroll=!1)}}adjustWidth(){if(this.anchorTo){const t=this.anchorTo.getBoundingClientRect();this.width=this.staticWidth>0?this.staticWidth:t.width-2-2*this.marginHorizontal}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect();this.top=e.bottom,e.bottom+t.height>window.innerHeight&&(this.top=-(t.height+e.height+20)),this.left=e.left}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if((!this.block||this.cursorHover)&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleOptionClick(t){const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){if(!this.resolvedRenderOption)return null;let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e=this.visible?{"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 o=Zt({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block&&!!this.anchorTo,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),n=Zt({options:!0});let s=this.options||[];return 0==s.length&&this.tempOptions&&this.tempOptions.length>0&&(s=this.tempOptions),V`
|
|
577
577
|
<div class=${o} style=${Ae(e)}>
|
|
578
578
|
<div class="options-scroll" @scroll=${this.handleInnerScroll}>
|
|
579
579
|
<div class="${n}" style=${Ae(i)}>
|
|
580
|
-
${s.map(((t,e)=>
|
|
580
|
+
${s.map(((t,e)=>V`<div
|
|
581
581
|
data-option-index="${e}"
|
|
582
582
|
@mousemove=${this.handleMouseMove}
|
|
583
583
|
@mousedown=${this.handleOptionClick}
|
|
@@ -585,7 +585,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
585
585
|
>
|
|
586
586
|
${this.resolvedRenderOption(t,e===this.cursorIndex)}
|
|
587
587
|
</div>`))}
|
|
588
|
-
${this.block?
|
|
588
|
+
${this.block?V`<div style="height:0.1em"></div>`:null}
|
|
589
589
|
</div>
|
|
590
590
|
<slot></slot>
|
|
591
591
|
</div>
|
|
@@ -599,11 +599,11 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
599
599
|
* @license
|
|
600
600
|
* Copyright 2017 Google LLC
|
|
601
601
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
602
|
-
*/class $r extends xe{constructor(t){if(super(t),this.it=H,t.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===H||null==t)return this._t=void 0,this.it=t;if(t===Z)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}$r.directiveName="unsafeHTML",$r.resultType=1;const Or=_e($r);var zr={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""},Lr=Object.prototype.hasOwnProperty;function Mr(t){return i=t,(e=zr)&&Lr.call(e,i)?zr[t]:t;var e,i}var Ir=Object.prototype.hasOwnProperty;function Dr(t){return[].slice.call(arguments,1).forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(i){t[i]=e[i]}))}})),t}var Pr=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function Nr(t){return t.indexOf("\\")<0?t:t.replace(Pr,"$1")}function Br(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(!!(65535&~t&&65534!=(65535&t))&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function Rr(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var qr=/&([a-z#][a-z0-9]{1,31});/gi,Fr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function Ur(t,e){var i=0,o=Mr(e);return e!==o?o:35===e.charCodeAt(0)&&Fr.test(e)&&Br(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?Rr(i):t}function Vr(t){return t.indexOf("&")<0?t:t.replace(qr,Ur)}var jr=/[&<>"]/,Zr=/[&<>"]/g,Hr={"&":"&","<":"<",">":">",'"':"""};function Wr(t){return Hr[t]}function Gr(t){return jr.test(t)?t.replace(Zr,Wr):t}var Yr={};function Kr(t,e){return++e>=t.length-2?e:"paragraph_open"===t[e].type&&t[e].tight&&"inline"===t[e+1].type&&0===t[e+1].content.length&&"paragraph_close"===t[e+2].type&&t[e+2].tight?Kr(t,e+2):e}Yr.blockquote_open=function(){return"<blockquote>\n"},Yr.blockquote_close=function(t,e){return"</blockquote>"+Qr(t,e)},Yr.code=function(t,e){return t[e].block?"<pre><code>"+Gr(t[e].content)+"</code></pre>"+Qr(t,e):"<code>"+Gr(t[e].content)+"</code>"},Yr.fence=function(t,e,i,o,n){var s,r,a,l,h=t[e],c="",d=i.langPrefix;if(h.params){if(r=(s=h.params.split(/\s+/g)).join(" "),a=n.rules.fence_custom,l=s[0],a&&Ir.call(a,l))return n.rules.fence_custom[s[0]](t,e,i,o,n);c=' class="'+d+Gr(Vr(Nr(r)))+'"'}return"<pre><code"+c+">"+(i.highlight&&i.highlight.apply(i.highlight,[h.content].concat(s))||Gr(h.content))+"</code></pre>"+Qr(t,e)},Yr.fence_custom={},Yr.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},Yr.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},Yr.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+Qr(t,e)},Yr.bullet_list_open=function(){return"<ul>\n"},Yr.bullet_list_close=function(t,e){return"</ul>"+Qr(t,e)},Yr.list_item_open=function(){return"<li>"},Yr.list_item_close=function(){return"</li>\n"},Yr.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},Yr.ordered_list_close=function(t,e){return"</ol>"+Qr(t,e)},Yr.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},Yr.paragraph_close=function(t,e){var i=!(t[e].tight&&e&&"inline"===t[e-1].type&&!t[e-1].content);return(t[e].tight?"":"</p>")+(i?Qr(t,e):"")},Yr.link_open=function(t,e,i){var o=t[e].title?' title="'+Gr(Vr(t[e].title))+'"':"",n=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+Gr(t[e].href)+'"'+o+n+">"},Yr.link_close=function(){return"</a>"},Yr.image=function(t,e,i){var o=' src="'+Gr(t[e].src)+'"',n=t[e].title?' title="'+Gr(Vr(t[e].title))+'"':"";return"<img"+o+(' alt="'+(t[e].alt?Gr(Vr(Nr(t[e].alt))):"")+'"')+n+(i.xhtmlOut?" /":"")+">"},Yr.table_open=function(){return"<table>\n"},Yr.table_close=function(){return"</table>\n"},Yr.thead_open=function(){return"<thead>\n"},Yr.thead_close=function(){return"</thead>\n"},Yr.tbody_open=function(){return"<tbody>\n"},Yr.tbody_close=function(){return"</tbody>\n"},Yr.tr_open=function(){return"<tr>"},Yr.tr_close=function(){return"</tr>\n"},Yr.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Yr.th_close=function(){return"</th>"},Yr.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Yr.td_close=function(){return"</td>"},Yr.strong_open=function(){return"<strong>"},Yr.strong_close=function(){return"</strong>"},Yr.em_open=function(){return"<em>"},Yr.em_close=function(){return"</em>"},Yr.del_open=function(){return"<del>"},Yr.del_close=function(){return"</del>"},Yr.ins_open=function(){return"<ins>"},Yr.ins_close=function(){return"</ins>"},Yr.mark_open=function(){return"<mark>"},Yr.mark_close=function(){return"</mark>"},Yr.sub=function(t,e){return"<sub>"+Gr(t[e].content)+"</sub>"},Yr.sup=function(t,e){return"<sup>"+Gr(t[e].content)+"</sup>"},Yr.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},Yr.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},Yr.text=function(t,e){return Gr(t[e].content)},Yr.htmlblock=function(t,e){return t[e].content},Yr.htmltag=function(t,e){return t[e].content},Yr.abbr_open=function(t,e){return'<abbr title="'+Gr(Vr(t[e].title))+'">'},Yr.abbr_close=function(){return"</abbr>"},Yr.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),o="fnref"+i;return t[e].subId>0&&(o+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+o+'">['+i+"]</a></sup>"},Yr.footnote_block_open=function(t,e,i){return(i.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},Yr.footnote_block_close=function(){return"</ol>\n</section>\n"},Yr.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},Yr.footnote_close=function(){return"</li>\n"},Yr.footnote_anchor=function(t,e){var i="fnref"+Number(t[e].id+1).toString();return t[e].subId>0&&(i+=":"+t[e].subId),' <a href="#'+i+'" class="footnote-backref">↩</a>'},Yr.dl_open=function(){return"<dl>\n"},Yr.dt_open=function(){return"<dt>"},Yr.dd_open=function(){return"<dd>"},Yr.dl_close=function(){return"</dl>\n"},Yr.dt_close=function(){return"</dt>\n"},Yr.dd_close=function(){return"</dd>\n"};var Qr=Yr.getBreak=function(t,e){return(e=Kr(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function Jr(){this.rules=Dr({},Yr),this.getBreak=Yr.getBreak}function Xr(){this.__rules__=[],this.__cache__=null}function ta(t,e,i,o,n){this.src=t,this.env=o,this.options=i,this.parser=e,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function ea(t,e){var i,o,n,s=-1,r=t.posMax,a=t.pos,l=t.isInLabel;if(t.isInLabel)return-1;if(t.labelUnmatchedScopes)return t.labelUnmatchedScopes--,-1;for(t.pos=e+1,t.isInLabel=!0,i=1;t.pos<r;){if(91===(n=t.src.charCodeAt(t.pos)))i++;else if(93===n&&0===--i){o=!0;break}t.parser.skipToken(t)}return o?(s=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,s}function ia(t,e,i,o){var n,s,r,a,l,h;if(42!==t.charCodeAt(0))return-1;if(91!==t.charCodeAt(1))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ea(n=new ta(t,e,i,o,[]),1))<0||58!==t.charCodeAt(s+1))return-1;for(a=n.posMax,r=s+2;r<a&&10!==n.src.charCodeAt(r);r++);return l=t.slice(2,s),0===(h=t.slice(s+2,r).trim()).length?-1:(o.abbreviations||(o.abbreviations={}),void 0===o.abbreviations[":"+l]&&(o.abbreviations[":"+l]=h),r)}function oa(t){var e=Vr(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function na(t,e){var i,o,n,s=e,r=t.posMax;if(60===t.src.charCodeAt(e)){for(e++;e<r;){if(10===(i=t.src.charCodeAt(e)))return!1;if(62===i)return n=oa(Nr(t.src.slice(s+1,e))),!!t.parser.validateLink(n)&&(t.pos=e+1,t.linkContent=n,!0);92===i&&e+1<r?e+=2:e++}return!1}for(o=0;e<r&&32!==(i=t.src.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<r)e+=2;else{if(40===i&&++o>1)break;if(41===i&&--o<0)break;e++}return s!==e&&(n=Nr(t.src.slice(s,e)),!!t.parser.validateLink(n)&&(t.linkContent=n,t.pos=e,!0))}function sa(t,e){var i,o=e,n=t.posMax,s=t.src.charCodeAt(e);if(34!==s&&39!==s&&40!==s)return!1;for(e++,40===s&&(s=41);e<n;){if((i=t.src.charCodeAt(e))===s)return t.pos=e+1,t.linkContent=Nr(t.src.slice(o+1,e)),!0;92===i&&e+1<n?e+=2:e++}return!1}function ra(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function aa(t,e,i,o){var n,s,r,a,l,h,c,d,u;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ea(n=new ta(t,e,i,o,[]),0))<0||58!==t.charCodeAt(s+1))return-1;for(a=n.posMax,r=s+2;r<a&&(32===(l=n.src.charCodeAt(r))||10===l);r++);if(!na(n,r))return-1;for(c=n.linkContent,h=r=n.pos,r+=1;r<a&&(32===(l=n.src.charCodeAt(r))||10===l);r++);for(r<a&&h!==r&&sa(n,r)?(d=n.linkContent,r=n.pos):(d="",r=h);r<a&&32===n.src.charCodeAt(r);)r++;return r<a&&10!==n.src.charCodeAt(r)?-1:(u=ra(t.slice(1,s)),void 0===o.references[u]&&(o.references[u]={title:d,href:c}),r)}Jr.prototype.renderInline=function(t,e,i){for(var o=this.rules,n=t.length,s=0,r="";n--;)r+=o[t[s].type](t,s++,e,i,this);return r},Jr.prototype.render=function(t,e,i){for(var o=this.rules,n=t.length,s=-1,r="";++s<n;)"inline"===t[s].type?r+=this.renderInline(t[s].children,e,i):r+=o[t[s].type](t,s,e,i,this);return r},Xr.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},Xr.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(i){i.enabled&&(e&&i.alt.indexOf(e)<0||t.__cache__[e].push(i.fn))}))}))},Xr.prototype.at=function(t,e,i){var o=this.__find__(t),n=i||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=e,this.__rules__[o].alt=n.alt||[],this.__cache__=null},Xr.prototype.before=function(t,e,i,o){var n=this.__find__(t),s=o||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__.splice(n,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Xr.prototype.after=function(t,e,i,o){var n=this.__find__(t),s=o||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__.splice(n+1,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Xr.prototype.push=function(t,e,i){var o=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null},Xr.prototype.enable=function(t,e){t=Array.isArray(t)?t:[t],e&&this.__rules__.forEach((function(t){t.enabled=!1})),t.forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!0}),this),this.__cache__=null},Xr.prototype.disable=function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!1}),this),this.__cache__=null},Xr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},ta.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},ta.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},ta.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},ta.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};var la=" \n()[]'\".,!?-";function ha(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var ca=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,da=/\((c|tm|r|p)\)/gi,ua={c:"©",r:"®",p:"§",tm:"™"};var pa=/['"]/,ma=/['"]/g,ga=/[-\s()\[\]]/;function fa(t,e){return!(e<0||e>=t.length)&&!ga.test(t[e])}function va(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var ba=[["block",function(t){t.inlineMode?t.tokens.push({type:"inline",content:t.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):t.block.parse(t.src,t.options,t.env,t.tokens)}],["abbr",function(t){var e,i,o,n,s=t.tokens;if(!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("paragraph_open"===s[e-1].type&&"inline"===s[e].type&&"paragraph_close"===s[e+1].type){for(o=s[e].content;o.length&&!((n=ia(o,t.inline,t.options,t.env))<0);)o=o.slice(n).trim();s[e].content=o,o.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["references",function(t){var e,i,o,n,s=t.tokens;if(t.env.references=t.env.references||{},!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("inline"===s[e].type&&"paragraph_open"===s[e-1].type&&"paragraph_close"===s[e+1].type){for(o=s[e].content;o.length&&!((n=aa(o,t.inline,t.options,t.env))<0);)o=o.slice(n).trim();s[e].content=o,o.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["inline",function(t){var e,i,o,n=t.tokens;for(i=0,o=n.length;i<o;i++)"inline"===(e=n[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,o,n,s,r,a,l,h,c=0,d=!1,u={};if(t.env.footnotes&&(t.tokens=t.tokens.filter((function(t){return"footnote_reference_open"===t.type?(d=!0,l=[],h=t.label,!1):"footnote_reference_close"===t.type?(d=!1,u[":"+h]=l,!1):(d&&l.push(t),!d)})),t.env.footnotes.list)){for(r=t.env.footnotes.list,t.tokens.push({type:"footnote_block_open",level:c++}),e=0,i=r.length;e<i;e++){for(t.tokens.push({type:"footnote_open",id:e,level:c++}),r[e].tokens?((a=[]).push({type:"paragraph_open",tight:!1,level:c++}),a.push({type:"inline",content:"",level:c,children:r[e].tokens}),a.push({type:"paragraph_close",tight:!1,level:--c})):r[e].label&&(a=u[":"+r[e].label]),t.tokens=t.tokens.concat(a),s="paragraph_close"===t.tokens[t.tokens.length-1].type?t.tokens.pop():null,n=r[e].count>0?r[e].count:1,o=0;o<n;o++)t.tokens.push({type:"footnote_anchor",id:e,subId:o,level:c});s&&t.tokens.push(s),t.tokens.push({type:"footnote_close",level:--c})}t.tokens.push({type:"footnote_block_close",level:--c})}}],["abbr2",function(t){var e,i,o,n,s,r,a,l,h,c,d,u,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(u="(^|["+la.split("").map(ha).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(ha).join("|")+")($|["+la.split("").map(ha).join("")+"])",t.env.abbrRegExp=new RegExp(u,"g")),c=t.env.abbrRegExp,i=0,o=p.length;i<o;i++)if("inline"===p[i].type)for(e=(n=p[i].children).length-1;e>=0;e--)if("text"===(s=n[e]).type){for(l=0,r=s.content,c.lastIndex=0,h=s.level,a=[];d=c.exec(r);)c.lastIndex>l&&a.push({type:"text",content:r.slice(l,d.index+d[1].length),level:h}),a.push({type:"abbr_open",title:t.env.abbreviations[":"+d[2]],level:h++}),a.push({type:"text",content:d[2],level:h}),a.push({type:"abbr_close",level:--h}),l=c.lastIndex-d[3].length;a.length&&(l<r.length&&a.push({type:"text",content:r.slice(l),level:h}),p[i].children=n=[].concat(n.slice(0,e),a,n.slice(e+1)))}}],["replacements",function(t){var e,i,o,n,s,r;if(t.options.typographer)for(s=t.tokens.length-1;s>=0;s--)if("inline"===t.tokens[s].type)for(e=(n=t.tokens[s].children).length-1;e>=0;e--)"text"===(i=n[e]).type&&(o=i.content,o=(r=o).indexOf("(")<0?r:r.replace(da,(function(t,e){return ua[e.toLowerCase()]})),ca.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),i.content=o)}],["smartquotes",function(t){var e,i,o,n,s,r,a,l,h,c,d,u,p,m,g,f,v;if(t.options.typographer)for(v=[],g=t.tokens.length-1;g>=0;g--)if("inline"===t.tokens[g].type)for(f=t.tokens[g].children,v.length=0,e=0;e<f.length;e++)if("text"===(i=f[e]).type&&!pa.test(i.text)){for(a=f[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,s=0,r=(o=i.content).length;t:for(;s<r&&(ma.lastIndex=s,n=ma.exec(o));)if(l=!fa(o,n.index-1),s=n.index+1,m="'"===n[0],(h=!fa(o,s))||l){if(d=!h,u=!l)for(p=v.length-1;p>=0&&(c=v[p],!(v[p].level<a));p--)if(c.single===m&&v[p].level===a){c=v[p],m?(f[c.token].content=va(f[c.token].content,c.pos,t.options.quotes[2]),i.content=va(i.content,n.index,t.options.quotes[3])):(f[c.token].content=va(f[c.token].content,c.pos,t.options.quotes[0]),i.content=va(i.content,n.index,t.options.quotes[1])),v.length=p;continue t}d?v.push({token:e,pos:n.index,single:m,level:a}):u&&m&&(i.content=va(i.content,n.index,"’"))}else m&&(i.content=va(i.content,n.index,"’"))}}]];function ya(){this.options={},this.ruler=new Xr;for(var t=0;t<ba.length;t++)this.ruler.push(ba[t][0],ba[t][1])}function _a(t,e,i,o,n){var s,r,a,l,h,c,d;for(this.src=t,this.parser=e,this.options=i,this.env=o,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",c=0,d=!1,a=l=c=0,h=(r=this.src).length;l<h;l++){if(s=r.charCodeAt(l),!d){if(32===s){c++;continue}d=!0}10!==s&&l!==h-1||(10!==s&&l++,this.bMarks.push(a),this.eMarks.push(l),this.tShift.push(c),d=!1,c=0,a=l+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function xa(t,e){var i,o,n;return(o=t.bMarks[e]+t.tShift[e])>=(n=t.eMarks[e])||42!==(i=t.src.charCodeAt(o++))&&45!==i&&43!==i||o<n&&32!==t.src.charCodeAt(o)?-1:o}function wa(t,e){var i,o=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];if(o+1>=n)return-1;if((i=t.src.charCodeAt(o++))<48||i>57)return-1;for(;;){if(o>=n)return-1;if(!((i=t.src.charCodeAt(o++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return o<n&&32!==t.src.charCodeAt(o)?-1:o}ya.prototype.process=function(t){var e,i,o;for(e=0,i=(o=this.ruler.getRules("")).length;e<i;e++)o[e](t)},_a.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},_a.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},_a.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},_a.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},_a.prototype.skipCharsBack=function(t,e,i){if(t<=i)return t;for(;t>i;)if(e!==this.src.charCodeAt(--t))return t+1;return t},_a.prototype.getLines=function(t,e,i,o){var n,s,r,a,l,h=t;if(t>=e)return"";if(h+1===e)return s=this.bMarks[h]+Math.min(this.tShift[h],i),r=o?this.eMarks[h]+1:this.eMarks[h],this.src.slice(s,r);for(a=new Array(e-t),n=0;h<e;h++,n++)(l=this.tShift[h])>i&&(l=i),l<0&&(l=0),s=this.bMarks[h]+l,r=h+1<e||o?this.eMarks[h]+1:this.eMarks[h],a[n]=this.src.slice(s,r);return a.join("")};var ka={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(t){ka[t]=!0}));var Aa=/^<([a-zA-Z]{1,15})[\s\/>]/,Sa=/^<\/([a-zA-Z]{1,15})[\s>]/;function Ca(t,e){var i=t.bMarks[e]+t.blkIndent,o=t.eMarks[e];return t.src.substr(i,o-i)}function Ta(t,e){var i,o,n=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];return n>=s||126!==(o=t.src.charCodeAt(n++))&&58!==o||n===(i=t.skipSpaces(n))||i>=s?-1:i}var Ea=[["code",function(t,e,i){var o,n;if(t.tShift[e]-t.blkIndent<4)return!1;for(n=o=e+1;o<i;)if(t.isEmpty(o))o++;else{if(!(t.tShift[o]-t.blkIndent>=4))break;n=++o}return t.line=o,t.tokens.push({type:"code",content:t.getLines(e,n,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,o){var n,s,r,a,l,h=!1,c=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(c+3>d)return!1;if(126!==(n=t.src.charCodeAt(c))&&96!==n)return!1;if(l=c,(s=(c=t.skipChars(c,n))-l)<3)return!1;if((r=t.src.slice(c,d).trim()).indexOf("`")>=0)return!1;if(o)return!0;for(a=e;!(++a>=i)&&!((c=l=t.bMarks[a]+t.tShift[a])<(d=t.eMarks[a])&&t.tShift[a]<t.blkIndent);)if(t.src.charCodeAt(c)===n&&!(t.tShift[a]-t.blkIndent>=4||(c=t.skipChars(c,n))-l<s||(c=t.skipSpaces(c))<d)){h=!0;break}return s=t.tShift[e],t.line=a+(h?1:0),t.tokens.push({type:"fence",params:r,content:t.getLines(e+1,a,s,!0),lines:[e,t.line],level:t.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(g>f)return!1;if(62!==t.src.charCodeAt(g++))return!1;if(t.level>=t.options.maxNesting)return!1;if(o)return!0;for(32===t.src.charCodeAt(g)&&g++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=g,s=(g=g<f?t.skipSpaces(g):g)>=f,r=[t.tShift[e]],t.tShift[e]=g-t.bMarks[e],d=t.parser.ruler.getRules("blockquote"),n=e+1;n<i&&!((g=t.bMarks[n]+t.tShift[n])>=(f=t.eMarks[n]));n++)if(62!==t.src.charCodeAt(g++)){if(s)break;for(m=!1,u=0,p=d.length;u<p;u++)if(d[u](t,n,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[n]),r.push(t.tShift[n]),t.tShift[n]=-1337}else 32===t.src.charCodeAt(g)&&g++,a.push(t.bMarks[n]),t.bMarks[n]=g,s=(g=g<f?t.skipSpaces(g):g)>=f,r.push(t.tShift[n]),t.tShift[n]=g-t.bMarks[n];for(h=t.parentType,t.parentType="blockquote",t.tokens.push({type:"blockquote_open",lines:c=[e,0],level:t.level++}),t.parser.tokenize(t,e,n),t.tokens.push({type:"blockquote_close",level:--t.level}),t.parentType=h,c[1]=t.line,u=0;u<r.length;u++)t.bMarks[u+e]=a[u],t.tShift[u+e]=r[u];return t.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(t,e,i,o){var n,s,r,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(n=t.src.charCodeAt(a++))&&45!==n&&95!==n)return!1;for(s=1;a<l;){if((r=t.src.charCodeAt(a++))!==n&&32!==r)return!1;r===n&&s++}return!(s<3)&&(o||(t.line=e+1,t.tokens.push({type:"hr",lines:[e,t.line],level:t.level})),!0)},["paragraph","blockquote","list"]],["list",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g,f,v,b,y,_,x,w,k,A,S=!0;if((d=wa(t,e))>=0)g=!0;else{if(!((d=xa(t,e))>=0))return!1;g=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(d-1),o)return!0;for(v=t.tokens.length,g?(c=t.bMarks[e]+t.tShift[e],p=Number(t.src.substr(c,d-c-1)),t.tokens.push({type:"ordered_list_open",order:p,lines:y=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:y=[e,0],level:t.level++}),n=e,b=!1,x=t.parser.ruler.getRules("list");!(!(n<i)||((u=(f=t.skipSpaces(d))>=t.eMarks[n]?1:f-d)>4&&(u=1),u<1&&(u=1),s=d-t.bMarks[n]+u,t.tokens.push({type:"list_item_open",lines:_=[e,0],level:t.level++}),a=t.blkIndent,l=t.tight,r=t.tShift[e],h=t.parentType,t.tShift[e]=f-t.bMarks[e],t.blkIndent=s,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!b||(S=!1),b=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=a,t.tShift[e]=r,t.tight=l,t.parentType=h,t.tokens.push({type:"list_item_close",level:--t.level}),n=e=t.line,_[1]=n,f=t.bMarks[e],n>=i)||t.isEmpty(n)||t.tShift[n]<t.blkIndent);){for(A=!1,w=0,k=x.length;w<k;w++)if(x[w](t,n,i,!0)){A=!0;break}if(A)break;if(g){if((d=wa(t,n))<0)break}else if((d=xa(t,n))<0)break;if(m!==t.src.charCodeAt(d-1))break}return t.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--t.level}),y[1]=n,t.line=n,S&&function(t,e){var i,o,n=t.level+2;for(i=e+2,o=t.tokens.length-2;i<o;i++)t.tokens[i].level===n&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,v),!0},["paragraph","blockquote"]],["footnote",function(t,e,i,o){var n,s,r,a,l,h=t.bMarks[e]+t.tShift[e],c=t.eMarks[e];if(h+4>c)return!1;if(91!==t.src.charCodeAt(h))return!1;if(94!==t.src.charCodeAt(h+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(a=h+2;a<c;a++){if(32===t.src.charCodeAt(a))return!1;if(93===t.src.charCodeAt(a))break}return a!==h+2&&(!(a+1>=c||58!==t.src.charCodeAt(++a))&&(o||(a++,t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.refs||(t.env.footnotes.refs={}),l=t.src.slice(h+2,a-2),t.env.footnotes.refs[":"+l]=-1,t.tokens.push({type:"footnote_reference_open",label:l,level:t.level++}),n=t.bMarks[e],s=t.tShift[e],r=t.parentType,t.tShift[e]=t.skipSpaces(a)-a,t.bMarks[e]=a,t.blkIndent+=4,t.parentType="footnote",t.tShift[e]<t.blkIndent&&(t.tShift[e]+=t.blkIndent,t.bMarks[e]-=t.blkIndent),t.parser.tokenize(t,e,i,!0),t.parentType=r,t.blkIndent-=4,t.tShift[e]=s,t.bMarks[e]=n,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,o){var n,s,r,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(n=t.src.charCodeAt(a))||a>=l)return!1;for(s=1,n=t.src.charCodeAt(++a);35===n&&a<l&&s<=6;)s++,n=t.src.charCodeAt(++a);return!(s>6||a<l&&32!==n)&&(o||(l=t.skipCharsBack(l,32,a),(r=t.skipCharsBack(l,35,a))>a&&32===t.src.charCodeAt(r-1)&&(l=r),t.line=e+1,t.tokens.push({type:"heading_open",hLevel:s,lines:[e,t.line],level:t.level}),a<l&&t.tokens.push({type:"inline",content:t.src.slice(a,l).trim(),level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"heading_close",hLevel:s,level:t.level})),!0)},["paragraph","blockquote"]],["lheading",function(t,e,i){var o,n,s,r=e+1;return!(r>=i)&&(!(t.tShift[r]<t.blkIndent)&&(!(t.tShift[r]-t.blkIndent>3)&&(!((n=t.bMarks[r]+t.tShift[r])>=(s=t.eMarks[r]))&&((45===(o=t.src.charCodeAt(n))||61===o)&&(n=t.skipChars(n,o),!((n=t.skipSpaces(n))<s)&&(n=t.bMarks[e]+t.tShift[e],t.line=r+1,t.tokens.push({type:"heading_open",hLevel:61===o?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(n,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===o?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,o){var n,s,r,a=t.bMarks[e],l=t.eMarks[e],h=t.tShift[e];if(a+=h,!t.options.html)return!1;if(h>3||a+2>=l)return!1;if(60!==t.src.charCodeAt(a))return!1;if(33===(n=t.src.charCodeAt(a+1))||63===n){if(o)return!0}else{if(47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))return!1;if(47===n){if(!(s=t.src.slice(a,l).match(Sa)))return!1}else if(!(s=t.src.slice(a,l).match(Aa)))return!1;if(!0!==ka[s[1].toLowerCase()])return!1;if(o)return!0}for(r=e+1;r<t.lineMax&&!t.isEmpty(r);)r++;return t.line=r,t.tokens.push({type:"htmlblock",level:t.level,lines:[e,t.line],content:t.getLines(e,r,0,!0)}),!0},["paragraph","blockquote"]],["table",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m;if(e+2>i)return!1;if(l=e+1,t.tShift[l]<t.blkIndent)return!1;if((r=t.bMarks[l]+t.tShift[l])>=t.eMarks[l])return!1;if(124!==(n=t.src.charCodeAt(r))&&45!==n&&58!==n)return!1;if(s=Ca(t,e+1),!/^[-:| ]+$/.test(s))return!1;if((h=s.split("|"))<=2)return!1;for(d=[],a=0;a<h.length;a++){if(!(u=h[a].trim())){if(0===a||a===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(u))return!1;58===u.charCodeAt(u.length-1)?d.push(58===u.charCodeAt(0)?"center":"right"):58===u.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(s=Ca(t,e).trim()).indexOf("|"))return!1;if(h=s.replace(/^\||\|$/g,"").split("|"),d.length!==h.length)return!1;if(o)return!0;for(t.tokens.push({type:"table_open",lines:p=[e,0],level:t.level++}),t.tokens.push({type:"thead_open",lines:[e,e+1],level:t.level++}),t.tokens.push({type:"tr_open",lines:[e,e+1],level:t.level++}),a=0;a<h.length;a++)t.tokens.push({type:"th_open",align:d[a],lines:[e,e+1],level:t.level++}),t.tokens.push({type:"inline",content:h[a].trim(),lines:[e,e+1],level:t.level,children:[]}),t.tokens.push({type:"th_close",level:--t.level});for(t.tokens.push({type:"tr_close",level:--t.level}),t.tokens.push({type:"thead_close",level:--t.level}),t.tokens.push({type:"tbody_open",lines:m=[e+2,0],level:t.level++}),l=e+2;l<i&&!(t.tShift[l]<t.blkIndent)&&-1!==(s=Ca(t,l).trim()).indexOf("|");l++){for(h=s.replace(/^\||\|$/g,"").split("|"),t.tokens.push({type:"tr_open",level:t.level++}),a=0;a<h.length;a++)t.tokens.push({type:"td_open",align:d[a],level:t.level++}),c=h[a].substring(124===h[a].charCodeAt(0)?1:0,124===h[a].charCodeAt(h[a].length-1)?h[a].length-1:h[a].length).trim(),t.tokens.push({type:"inline",content:c,level:t.level,children:[]}),t.tokens.push({type:"td_close",level:--t.level});t.tokens.push({type:"tr_close",level:--t.level})}return t.tokens.push({type:"tbody_close",level:--t.level}),t.tokens.push({type:"table_close",level:--t.level}),p[1]=m[1]=l,t.line=l,!0},["paragraph"]],["deflist",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g,f,v;if(o)return!(t.ddIndent<0)&&Ta(t,e)>=0;if(c=e+1,t.isEmpty(c)&&++c>i)return!1;if(t.tShift[c]<t.blkIndent)return!1;if((n=Ta(t,c))<0)return!1;if(t.level>=t.options.maxNesting)return!1;h=t.tokens.length,t.tokens.push({type:"dl_open",lines:l=[e,0],level:t.level++}),r=e,s=c;t:for(;;){for(v=!0,f=!1,t.tokens.push({type:"dt_open",lines:[r,r],level:t.level++}),t.tokens.push({type:"inline",content:t.getLines(r,r+1,t.blkIndent,!1).trim(),level:t.level+1,lines:[r,r],children:[]}),t.tokens.push({type:"dt_close",level:--t.level});;){if(t.tokens.push({type:"dd_open",lines:a=[c,0],level:t.level++}),g=t.tight,u=t.ddIndent,d=t.blkIndent,m=t.tShift[s],p=t.parentType,t.blkIndent=t.ddIndent=t.tShift[s]+2,t.tShift[s]=n-t.bMarks[s],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,s,i,!0),t.tight&&!f||(v=!1),f=t.line-s>1&&t.isEmpty(t.line-1),t.tShift[s]=m,t.tight=g,t.parentType=p,t.blkIndent=d,t.ddIndent=u,t.tokens.push({type:"dd_close",level:--t.level}),a[1]=c=t.line,c>=i)break t;if(t.tShift[c]<t.blkIndent)break t;if((n=Ta(t,c))<0)break;s=c}if(c>=i)break;if(r=c,t.isEmpty(r))break;if(t.tShift[r]<t.blkIndent)break;if((s=r+1)>=i)break;if(t.isEmpty(s)&&s++,s>=i)break;if(t.tShift[s]<t.blkIndent)break;if((n=Ta(t,s))<0)break}return t.tokens.push({type:"dl_close",level:--t.level}),l[1]=c,t.line=c,v&&function(t,e){var i,o,n=t.level+2;for(i=e+2,o=t.tokens.length-2;i<o;i++)t.tokens[i].level===n&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,h),!0},["paragraph"]],["paragraph",function(t,e){var i,o,n,s,r,a,l=e+1;if(l<(i=t.lineMax)&&!t.isEmpty(l))for(a=t.parser.ruler.getRules("paragraph");l<i&&!t.isEmpty(l);l++)if(!(t.tShift[l]-t.blkIndent>3)){for(n=!1,s=0,r=a.length;s<r;s++)if(a[s](t,l,i,!0)){n=!0;break}if(n)break}return o=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,o.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:o,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function $a(){this.ruler=new Xr;for(var t=0;t<Ea.length;t++)this.ruler.push(Ea[t][0],Ea[t][1],{alt:(Ea[t][2]||[]).slice()})}$a.prototype.tokenize=function(t,e,i){for(var o,n=this.ruler.getRules(""),s=n.length,r=e,a=!1;r<i&&(t.line=r=t.skipEmptyLines(r),!(r>=i))&&!(t.tShift[r]<t.blkIndent);){for(o=0;o<s&&!n[o](t,r,i,!1);o++);if(t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(r=t.line)<i&&t.isEmpty(r)){if(a=!0,++r<i&&"list"===t.parentType&&t.isEmpty(r))break;t.line=r}}};var Oa=/[\n\t]/g,za=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,La=/\u00a0/g;function Ma(t){switch(t){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}$a.prototype.parse=function(t,e,i,o){var n,s=0,r=0;if(!t)return[];(t=(t=t.replace(La," ")).replace(za,"\n")).indexOf("\t")>=0&&(t=t.replace(Oa,(function(e,i){var o;return 10===t.charCodeAt(i)?(s=i+1,r=0,e):(o=" ".slice((i-s-r)%4),r=i-s+1,o)}))),n=new _a(t,this,e,i,o),this.tokenize(n,n.line,n.lineMax)};for(var Ia=[],Da=0;Da<256;Da++)Ia.push(0);function Pa(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function Na(t,e){var i,o,n,s=e,r=!0,a=!0,l=t.posMax,h=t.src.charCodeAt(e);for(i=e>0?t.src.charCodeAt(e-1):-1;s<l&&t.src.charCodeAt(s)===h;)s++;return s>=l&&(r=!1),(n=s-e)>=4?r=a=!1:(32!==(o=s<l?t.src.charCodeAt(s):-1)&&10!==o||(r=!1),32!==i&&10!==i||(a=!1),95===h&&(Pa(i)&&(r=!1),Pa(o)&&(a=!1))),{can_open:r,can_close:a,delims:n}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){Ia[t.charCodeAt(0)]=1}));var Ba=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ra=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var qa=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],Fa=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Ua=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function Va(t,e){return t=t.source,e=e||"",function i(o,n){return o?(n=n.source||n,t=t.replace(o,n),i):new RegExp(t,e)}}var ja=Va(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),Za=Va(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",ja)(),Ha=Va(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",Za)(),Wa=Va(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",Ha)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var Ga=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,Ya=/^&([a-z][a-z0-9]{1,31});/i;var Ka=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!Ma(t.src.charCodeAt(i));)i++;return i!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,i)),t.pos=i,!0)}],["newline",function(t,e){var i,o,n=t.pos;if(10!==t.src.charCodeAt(n))return!1;if(i=t.pending.length-1,o=t.posMax,!e)if(i>=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){for(var s=i-2;s>=0;s--)if(32!==t.pending.charCodeAt(s)){t.pending=t.pending.substring(0,s+1);break}t.push({type:"hardbreak",level:t.level})}else t.pending=t.pending.slice(0,-1),t.push({type:"softbreak",level:t.level});else t.push({type:"softbreak",level:t.level});for(n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}],["escape",function(t,e){var i,o=t.pos,n=t.posMax;if(92!==t.src.charCodeAt(o))return!1;if(++o<n){if((i=t.src.charCodeAt(o))<256&&0!==Ia[i])return e||(t.pending+=t.src[o]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,o,n,s,r,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,o=t.posMax;a<o&&96===t.src.charCodeAt(a);)a++;for(n=t.src.slice(i,a),s=r=a;-1!==(s=t.src.indexOf("`",r));){for(r=s+1;r<o&&96===t.src.charCodeAt(r);)r++;if(r-s===n.length)return e||t.push({type:"code",content:t.src.slice(a,s).replace(/[ \n]+/g," ").trim(),block:!1,level:t.level}),t.pos=r,!0}return e||(t.pending+=n),t.pos+=n.length,!0}],["del",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(126!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(126!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),126===s)return!1;if(126===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&126===t.src.charCodeAt(o);)o++;if(o>l+3)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(126===t.src.charCodeAt(t.pos)&&126===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),126!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&126!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"del_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"del_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["ins",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(43!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(43!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),43===s)return!1;if(43===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&43===t.src.charCodeAt(o);)o++;if(o!==l+2)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(43===t.src.charCodeAt(t.pos)&&43===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),43!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&43!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"ins_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"ins_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["mark",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(61!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(61!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),61===s)return!1;if(61===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&61===t.src.charCodeAt(o);)o++;if(o!==l+2)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(61===t.src.charCodeAt(t.pos)&&61===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),61!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&61!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"mark_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"mark_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["emphasis",function(t,e){var i,o,n,s,r,a,l,h=t.posMax,c=t.pos,d=t.src.charCodeAt(c);if(95!==d&&42!==d)return!1;if(e)return!1;if(i=(l=Na(t,c)).delims,!l.can_open)return t.pos+=i,e||(t.pending+=t.src.slice(c,t.pos)),!0;if(t.level>=t.options.maxNesting)return!1;for(t.pos=c+i,a=[i];t.pos<h;)if(t.src.charCodeAt(t.pos)!==d)t.parser.skipToken(t);else{if(o=(l=Na(t,t.pos)).delims,l.can_close){for(s=a.pop(),r=o;s!==r;){if(r<s){a.push(s-r);break}if(r-=s,0===a.length)break;t.pos+=s,s=a.pop()}if(0===a.length){i=s,n=!0;break}t.pos+=o;continue}l.can_open&&a.push(o),t.pos+=o}return n?(t.posMax=t.pos,t.pos=c+i,e||(2!==i&&3!==i||t.push({type:"strong_open",level:t.level++}),1!==i&&3!==i||t.push({type:"em_open",level:t.level++}),t.parser.tokenize(t),1!==i&&3!==i||t.push({type:"em_close",level:--t.level}),2!==i&&3!==i||t.push({type:"strong_close",level:--t.level})),t.pos=t.posMax+i,t.posMax=h,!0):(t.pos=c,!1)}],["sub",function(t,e){var i,o,n=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=n)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<n;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(o=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sub",level:t.level,content:o.replace(Ba,"$1")}),t.pos=t.posMax+1,t.posMax=n,!0):(t.pos=s,!1)}],["sup",function(t,e){var i,o,n=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=n)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<n;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(o=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sup",level:t.level,content:o.replace(Ra,"$1")}),t.pos=t.posMax+1,t.posMax=n,!0):(t.pos=s,!1)}],["links",function(t,e){var i,o,n,s,r,a,l,h,c=!1,d=t.pos,u=t.posMax,p=t.pos,m=t.src.charCodeAt(p);if(33===m&&(c=!0,m=t.src.charCodeAt(++p)),91!==m)return!1;if(t.level>=t.options.maxNesting)return!1;if(i=p+1,(o=ea(t,p))<0)return!1;if((a=o+1)<u&&40===t.src.charCodeAt(a)){for(a++;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a>=u)return!1;for(p=a,na(t,a)?(s=t.linkContent,a=t.pos):s="",p=a;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a<u&&p!==a&&sa(t,a))for(r=t.linkContent,a=t.pos;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);else r="";if(a>=u||41!==t.src.charCodeAt(a))return t.pos=d,!1;a++}else{if(t.linkLevel>0)return!1;for(;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a<u&&91===t.src.charCodeAt(a)&&(p=a+1,(a=ea(t,a))>=0?n=t.src.slice(p,a++):a=p-1),n||(void 0===n&&(a=o+1),n=t.src.slice(i,o)),!(l=t.env.references[ra(n)]))return t.pos=d,!1;s=l.href,r=l.title}return e||(t.pos=i,t.posMax=o,c?t.push({type:"image",src:s,title:r,alt:t.src.substr(i,o-i),level:t.level}):(t.push({type:"link_open",href:s,title:r,level:t.level++}),t.linkLevel++,t.parser.tokenize(t),t.linkLevel--,t.push({type:"link_close",level:--t.level}))),t.pos=a,t.posMax=u,!0}],["footnote_inline",function(t,e){var i,o,n,s,r=t.posMax,a=t.pos;return!(a+2>=r)&&(94===t.src.charCodeAt(a)&&(91===t.src.charCodeAt(a+1)&&(!(t.level>=t.options.maxNesting)&&(i=a+2,!((o=ea(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),n=t.env.footnotes.list.length,t.pos=i,t.posMax=o,t.push({type:"footnote_ref",id:n,level:t.level}),t.linkLevel++,s=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[n]={tokens:t.tokens.splice(s)},t.linkLevel--),t.pos=o+1,t.posMax=r,!0)))))}],["footnote_ref",function(t,e){var i,o,n,s,r=t.posMax,a=t.pos;if(a+3>r)return!1;if(!t.env.footnotes||!t.env.footnotes.refs)return!1;if(91!==t.src.charCodeAt(a))return!1;if(94!==t.src.charCodeAt(a+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(o=a+2;o<r;o++){if(32===t.src.charCodeAt(o))return!1;if(10===t.src.charCodeAt(o))return!1;if(93===t.src.charCodeAt(o))break}return o!==a+2&&(!(o>=r)&&(o++,i=t.src.slice(a+2,o-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(n=t.env.footnotes.list.length,t.env.footnotes.list[n]={label:i,count:0},t.env.footnotes.refs[":"+i]=n):n=t.env.footnotes.refs[":"+i],s=t.env.footnotes.list[n].count,t.env.footnotes.list[n].count++,t.push({type:"footnote_ref",id:n,subId:s,level:t.level})),t.pos=o,t.posMax=r,!0)))}],["autolink",function(t,e){var i,o,n,s,r,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((o=i.match(Ua))?!(qa.indexOf(o[1].toLowerCase())<0)&&(r=oa(s=o[0].slice(1,-1)),!!t.parser.validateLink(s)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=o[0].length,!0)):!!(n=i.match(Fa))&&(r=oa("mailto:"+(s=n[0].slice(1,-1))),!!t.parser.validateLink(r)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=n[0].length,!0))))}],["htmltag",function(t,e){var i,o,n,s=t.pos;return!!t.options.html&&(n=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=n)&&(!(33!==(i=t.src.charCodeAt(s+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(o=t.src.slice(s).match(Wa))&&(e||t.push({type:"htmltag",content:t.src.slice(s,s+o[0].length),level:t.level}),t.pos+=o[0].length,!0))))}],["entity",function(t,e){var i,o,n=t.pos,s=t.posMax;if(38!==t.src.charCodeAt(n))return!1;if(n+1<s)if(35===t.src.charCodeAt(n+1)){if(o=t.src.slice(n).match(Ga))return e||(i="x"===o[1][0].toLowerCase()?parseInt(o[1].slice(1),16):parseInt(o[1],10),t.pending+=Br(i)?Rr(i):Rr(65533)),t.pos+=o[0].length,!0}else if(o=t.src.slice(n).match(Ya)){var r=Mr(o[1]);if(o[1]!==r)return e||(t.pending+=r),t.pos+=o[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function Qa(){this.ruler=new Xr;for(var t=0;t<Ka.length;t++)this.ruler.push(Ka[t][0],Ka[t][1]);this.validateLink=Ja}function Ja(t){var e=t.trim().toLowerCase();return-1===(e=Vr(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}Qa.prototype.skipToken=function(t){var e,i,o=this.ruler.getRules(""),n=o.length,s=t.pos;if((i=t.cacheGet(s))>0)t.pos=i;else{for(e=0;e<n;e++)if(o[e](t,!0))return void t.cacheSet(s,t.pos);t.pos++,t.cacheSet(s,t.pos)}},Qa.prototype.tokenize=function(t){for(var e,i,o=this.ruler.getRules(""),n=o.length,s=t.posMax;t.pos<s;){for(i=0;i<n&&!(e=o[i](t,!1));i++);if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Qa.prototype.parse=function(t,e,i,o){var n=new ta(t,this,e,i,o);this.tokenize(n)};var Xa={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function tl(t,e,i){this.src=e,this.env=i,this.options=t.options,this.tokens=[],this.inlineMode=!1,this.inline=t.inline,this.block=t.block,this.renderer=t.renderer,this.typographer=t.typographer}function el(t,e){"string"!=typeof t&&(e=t,t="default"),e&&null!=e.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Qa,this.block=new $a,this.core=new ya,this.renderer=new Jr,this.ruler=new Xr,this.options={},this.configure(Xa[t]),this.set(e||{})}el.prototype.set=function(t){Dr(this.options,t)},el.prototype.configure=function(t){var e=this;if(!t)throw new Error("Wrong `remarkable` preset, check name/content");t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach((function(i){t.components[i].rules&&e[i].ruler.enable(t.components[i].rules,!0)}))},el.prototype.use=function(t,e){return t(this,e),this},el.prototype.parse=function(t,e){var i=new tl(this,t,e);return this.core.process(i),i.tokens},el.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},el.prototype.parseInline=function(t,e){var i=new tl(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},el.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const il=new el;const ol=_e(class extends xe{constructor(t){if(super(t),t.type!==ye)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return j`${Or(il.render(t))}`}}),nl=new Er("@",["contact","fields","globals","urns"]),sl=new Er("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]),rl=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),o=t.signature.substr(0,i),n=t.signature.substr(i);return j`
|
|
602
|
+
*/class $r extends xe{constructor(t){if(super(t),this.it=H,t.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===H||null==t)return this._t=void 0,this.it=t;if(t===Z)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}$r.directiveName="unsafeHTML",$r.resultType=1;const Or=_e($r);var zr={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",GT:">",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""},Lr=Object.prototype.hasOwnProperty;function Mr(t){return i=t,(e=zr)&&Lr.call(e,i)?zr[t]:t;var e,i}var Ir=Object.prototype.hasOwnProperty;function Dr(t){return[].slice.call(arguments,1).forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(i){t[i]=e[i]}))}})),t}var Pr=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function Nr(t){return t.indexOf("\\")<0?t:t.replace(Pr,"$1")}function Br(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(!!(65535&~t&&65534!=(65535&t))&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function Rr(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var qr=/&([a-z#][a-z0-9]{1,31});/gi,Fr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function Ur(t,e){var i=0,o=Mr(e);return e!==o?o:35===e.charCodeAt(0)&&Fr.test(e)&&Br(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?Rr(i):t}function jr(t){return t.indexOf("&")<0?t:t.replace(qr,Ur)}var Vr=/[&<>"]/,Zr=/[&<>"]/g,Hr={"&":"&","<":"<",">":">",'"':"""};function Wr(t){return Hr[t]}function Gr(t){return Vr.test(t)?t.replace(Zr,Wr):t}var Yr={};function Kr(t,e){return++e>=t.length-2?e:"paragraph_open"===t[e].type&&t[e].tight&&"inline"===t[e+1].type&&0===t[e+1].content.length&&"paragraph_close"===t[e+2].type&&t[e+2].tight?Kr(t,e+2):e}Yr.blockquote_open=function(){return"<blockquote>\n"},Yr.blockquote_close=function(t,e){return"</blockquote>"+Qr(t,e)},Yr.code=function(t,e){return t[e].block?"<pre><code>"+Gr(t[e].content)+"</code></pre>"+Qr(t,e):"<code>"+Gr(t[e].content)+"</code>"},Yr.fence=function(t,e,i,o,n){var s,r,a,l,h=t[e],c="",d=i.langPrefix;if(h.params){if(r=(s=h.params.split(/\s+/g)).join(" "),a=n.rules.fence_custom,l=s[0],a&&Ir.call(a,l))return n.rules.fence_custom[s[0]](t,e,i,o,n);c=' class="'+d+Gr(jr(Nr(r)))+'"'}return"<pre><code"+c+">"+(i.highlight&&i.highlight.apply(i.highlight,[h.content].concat(s))||Gr(h.content))+"</code></pre>"+Qr(t,e)},Yr.fence_custom={},Yr.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},Yr.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},Yr.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+Qr(t,e)},Yr.bullet_list_open=function(){return"<ul>\n"},Yr.bullet_list_close=function(t,e){return"</ul>"+Qr(t,e)},Yr.list_item_open=function(){return"<li>"},Yr.list_item_close=function(){return"</li>\n"},Yr.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},Yr.ordered_list_close=function(t,e){return"</ol>"+Qr(t,e)},Yr.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},Yr.paragraph_close=function(t,e){var i=!(t[e].tight&&e&&"inline"===t[e-1].type&&!t[e-1].content);return(t[e].tight?"":"</p>")+(i?Qr(t,e):"")},Yr.link_open=function(t,e,i){var o=t[e].title?' title="'+Gr(jr(t[e].title))+'"':"",n=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+Gr(t[e].href)+'"'+o+n+">"},Yr.link_close=function(){return"</a>"},Yr.image=function(t,e,i){var o=' src="'+Gr(t[e].src)+'"',n=t[e].title?' title="'+Gr(jr(t[e].title))+'"':"";return"<img"+o+(' alt="'+(t[e].alt?Gr(jr(Nr(t[e].alt))):"")+'"')+n+(i.xhtmlOut?" /":"")+">"},Yr.table_open=function(){return"<table>\n"},Yr.table_close=function(){return"</table>\n"},Yr.thead_open=function(){return"<thead>\n"},Yr.thead_close=function(){return"</thead>\n"},Yr.tbody_open=function(){return"<tbody>\n"},Yr.tbody_close=function(){return"</tbody>\n"},Yr.tr_open=function(){return"<tr>"},Yr.tr_close=function(){return"</tr>\n"},Yr.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Yr.th_close=function(){return"</th>"},Yr.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},Yr.td_close=function(){return"</td>"},Yr.strong_open=function(){return"<strong>"},Yr.strong_close=function(){return"</strong>"},Yr.em_open=function(){return"<em>"},Yr.em_close=function(){return"</em>"},Yr.del_open=function(){return"<del>"},Yr.del_close=function(){return"</del>"},Yr.ins_open=function(){return"<ins>"},Yr.ins_close=function(){return"</ins>"},Yr.mark_open=function(){return"<mark>"},Yr.mark_close=function(){return"</mark>"},Yr.sub=function(t,e){return"<sub>"+Gr(t[e].content)+"</sub>"},Yr.sup=function(t,e){return"<sup>"+Gr(t[e].content)+"</sup>"},Yr.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},Yr.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},Yr.text=function(t,e){return Gr(t[e].content)},Yr.htmlblock=function(t,e){return t[e].content},Yr.htmltag=function(t,e){return t[e].content},Yr.abbr_open=function(t,e){return'<abbr title="'+Gr(jr(t[e].title))+'">'},Yr.abbr_close=function(){return"</abbr>"},Yr.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),o="fnref"+i;return t[e].subId>0&&(o+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+o+'">['+i+"]</a></sup>"},Yr.footnote_block_open=function(t,e,i){return(i.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},Yr.footnote_block_close=function(){return"</ol>\n</section>\n"},Yr.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},Yr.footnote_close=function(){return"</li>\n"},Yr.footnote_anchor=function(t,e){var i="fnref"+Number(t[e].id+1).toString();return t[e].subId>0&&(i+=":"+t[e].subId),' <a href="#'+i+'" class="footnote-backref">↩</a>'},Yr.dl_open=function(){return"<dl>\n"},Yr.dt_open=function(){return"<dt>"},Yr.dd_open=function(){return"<dd>"},Yr.dl_close=function(){return"</dl>\n"},Yr.dt_close=function(){return"</dt>\n"},Yr.dd_close=function(){return"</dd>\n"};var Qr=Yr.getBreak=function(t,e){return(e=Kr(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function Jr(){this.rules=Dr({},Yr),this.getBreak=Yr.getBreak}function Xr(){this.__rules__=[],this.__cache__=null}function ta(t,e,i,o,n){this.src=t,this.env=o,this.options=i,this.parser=e,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function ea(t,e){var i,o,n,s=-1,r=t.posMax,a=t.pos,l=t.isInLabel;if(t.isInLabel)return-1;if(t.labelUnmatchedScopes)return t.labelUnmatchedScopes--,-1;for(t.pos=e+1,t.isInLabel=!0,i=1;t.pos<r;){if(91===(n=t.src.charCodeAt(t.pos)))i++;else if(93===n&&0===--i){o=!0;break}t.parser.skipToken(t)}return o?(s=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,s}function ia(t,e,i,o){var n,s,r,a,l,h;if(42!==t.charCodeAt(0))return-1;if(91!==t.charCodeAt(1))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ea(n=new ta(t,e,i,o,[]),1))<0||58!==t.charCodeAt(s+1))return-1;for(a=n.posMax,r=s+2;r<a&&10!==n.src.charCodeAt(r);r++);return l=t.slice(2,s),0===(h=t.slice(s+2,r).trim()).length?-1:(o.abbreviations||(o.abbreviations={}),void 0===o.abbreviations[":"+l]&&(o.abbreviations[":"+l]=h),r)}function oa(t){var e=jr(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function na(t,e){var i,o,n,s=e,r=t.posMax;if(60===t.src.charCodeAt(e)){for(e++;e<r;){if(10===(i=t.src.charCodeAt(e)))return!1;if(62===i)return n=oa(Nr(t.src.slice(s+1,e))),!!t.parser.validateLink(n)&&(t.pos=e+1,t.linkContent=n,!0);92===i&&e+1<r?e+=2:e++}return!1}for(o=0;e<r&&32!==(i=t.src.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<r)e+=2;else{if(40===i&&++o>1)break;if(41===i&&--o<0)break;e++}return s!==e&&(n=Nr(t.src.slice(s,e)),!!t.parser.validateLink(n)&&(t.linkContent=n,t.pos=e,!0))}function sa(t,e){var i,o=e,n=t.posMax,s=t.src.charCodeAt(e);if(34!==s&&39!==s&&40!==s)return!1;for(e++,40===s&&(s=41);e<n;){if((i=t.src.charCodeAt(e))===s)return t.pos=e+1,t.linkContent=Nr(t.src.slice(o+1,e)),!0;92===i&&e+1<n?e+=2:e++}return!1}function ra(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function aa(t,e,i,o){var n,s,r,a,l,h,c,d,u;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((s=ea(n=new ta(t,e,i,o,[]),0))<0||58!==t.charCodeAt(s+1))return-1;for(a=n.posMax,r=s+2;r<a&&(32===(l=n.src.charCodeAt(r))||10===l);r++);if(!na(n,r))return-1;for(c=n.linkContent,h=r=n.pos,r+=1;r<a&&(32===(l=n.src.charCodeAt(r))||10===l);r++);for(r<a&&h!==r&&sa(n,r)?(d=n.linkContent,r=n.pos):(d="",r=h);r<a&&32===n.src.charCodeAt(r);)r++;return r<a&&10!==n.src.charCodeAt(r)?-1:(u=ra(t.slice(1,s)),void 0===o.references[u]&&(o.references[u]={title:d,href:c}),r)}Jr.prototype.renderInline=function(t,e,i){for(var o=this.rules,n=t.length,s=0,r="";n--;)r+=o[t[s].type](t,s++,e,i,this);return r},Jr.prototype.render=function(t,e,i){for(var o=this.rules,n=t.length,s=-1,r="";++s<n;)"inline"===t[s].type?r+=this.renderInline(t[s].children,e,i):r+=o[t[s].type](t,s,e,i,this);return r},Xr.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},Xr.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(i){i.enabled&&(e&&i.alt.indexOf(e)<0||t.__cache__[e].push(i.fn))}))}))},Xr.prototype.at=function(t,e,i){var o=this.__find__(t),n=i||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=e,this.__rules__[o].alt=n.alt||[],this.__cache__=null},Xr.prototype.before=function(t,e,i,o){var n=this.__find__(t),s=o||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__.splice(n,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Xr.prototype.after=function(t,e,i,o){var n=this.__find__(t),s=o||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__.splice(n+1,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Xr.prototype.push=function(t,e,i){var o=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null},Xr.prototype.enable=function(t,e){t=Array.isArray(t)?t:[t],e&&this.__rules__.forEach((function(t){t.enabled=!1})),t.forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!0}),this),this.__cache__=null},Xr.prototype.disable=function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){var e=this.__find__(t);if(e<0)throw new Error("Rules manager: invalid rule name "+t);this.__rules__[e].enabled=!1}),this),this.__cache__=null},Xr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},ta.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},ta.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},ta.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},ta.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};var la=" \n()[]'\".,!?-";function ha(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var ca=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,da=/\((c|tm|r|p)\)/gi,ua={c:"©",r:"®",p:"§",tm:"™"};var pa=/['"]/,ma=/['"]/g,ga=/[-\s()\[\]]/;function fa(t,e){return!(e<0||e>=t.length)&&!ga.test(t[e])}function va(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var ba=[["block",function(t){t.inlineMode?t.tokens.push({type:"inline",content:t.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):t.block.parse(t.src,t.options,t.env,t.tokens)}],["abbr",function(t){var e,i,o,n,s=t.tokens;if(!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("paragraph_open"===s[e-1].type&&"inline"===s[e].type&&"paragraph_close"===s[e+1].type){for(o=s[e].content;o.length&&!((n=ia(o,t.inline,t.options,t.env))<0);)o=o.slice(n).trim();s[e].content=o,o.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["references",function(t){var e,i,o,n,s=t.tokens;if(t.env.references=t.env.references||{},!t.inlineMode)for(e=1,i=s.length-1;e<i;e++)if("inline"===s[e].type&&"paragraph_open"===s[e-1].type&&"paragraph_close"===s[e+1].type){for(o=s[e].content;o.length&&!((n=aa(o,t.inline,t.options,t.env))<0);)o=o.slice(n).trim();s[e].content=o,o.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["inline",function(t){var e,i,o,n=t.tokens;for(i=0,o=n.length;i<o;i++)"inline"===(e=n[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,o,n,s,r,a,l,h,c=0,d=!1,u={};if(t.env.footnotes&&(t.tokens=t.tokens.filter((function(t){return"footnote_reference_open"===t.type?(d=!0,l=[],h=t.label,!1):"footnote_reference_close"===t.type?(d=!1,u[":"+h]=l,!1):(d&&l.push(t),!d)})),t.env.footnotes.list)){for(r=t.env.footnotes.list,t.tokens.push({type:"footnote_block_open",level:c++}),e=0,i=r.length;e<i;e++){for(t.tokens.push({type:"footnote_open",id:e,level:c++}),r[e].tokens?((a=[]).push({type:"paragraph_open",tight:!1,level:c++}),a.push({type:"inline",content:"",level:c,children:r[e].tokens}),a.push({type:"paragraph_close",tight:!1,level:--c})):r[e].label&&(a=u[":"+r[e].label]),t.tokens=t.tokens.concat(a),s="paragraph_close"===t.tokens[t.tokens.length-1].type?t.tokens.pop():null,n=r[e].count>0?r[e].count:1,o=0;o<n;o++)t.tokens.push({type:"footnote_anchor",id:e,subId:o,level:c});s&&t.tokens.push(s),t.tokens.push({type:"footnote_close",level:--c})}t.tokens.push({type:"footnote_block_close",level:--c})}}],["abbr2",function(t){var e,i,o,n,s,r,a,l,h,c,d,u,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(u="(^|["+la.split("").map(ha).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(ha).join("|")+")($|["+la.split("").map(ha).join("")+"])",t.env.abbrRegExp=new RegExp(u,"g")),c=t.env.abbrRegExp,i=0,o=p.length;i<o;i++)if("inline"===p[i].type)for(e=(n=p[i].children).length-1;e>=0;e--)if("text"===(s=n[e]).type){for(l=0,r=s.content,c.lastIndex=0,h=s.level,a=[];d=c.exec(r);)c.lastIndex>l&&a.push({type:"text",content:r.slice(l,d.index+d[1].length),level:h}),a.push({type:"abbr_open",title:t.env.abbreviations[":"+d[2]],level:h++}),a.push({type:"text",content:d[2],level:h}),a.push({type:"abbr_close",level:--h}),l=c.lastIndex-d[3].length;a.length&&(l<r.length&&a.push({type:"text",content:r.slice(l),level:h}),p[i].children=n=[].concat(n.slice(0,e),a,n.slice(e+1)))}}],["replacements",function(t){var e,i,o,n,s,r;if(t.options.typographer)for(s=t.tokens.length-1;s>=0;s--)if("inline"===t.tokens[s].type)for(e=(n=t.tokens[s].children).length-1;e>=0;e--)"text"===(i=n[e]).type&&(o=i.content,o=(r=o).indexOf("(")<0?r:r.replace(da,(function(t,e){return ua[e.toLowerCase()]})),ca.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),i.content=o)}],["smartquotes",function(t){var e,i,o,n,s,r,a,l,h,c,d,u,p,m,g,f,v;if(t.options.typographer)for(v=[],g=t.tokens.length-1;g>=0;g--)if("inline"===t.tokens[g].type)for(f=t.tokens[g].children,v.length=0,e=0;e<f.length;e++)if("text"===(i=f[e]).type&&!pa.test(i.text)){for(a=f[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,s=0,r=(o=i.content).length;t:for(;s<r&&(ma.lastIndex=s,n=ma.exec(o));)if(l=!fa(o,n.index-1),s=n.index+1,m="'"===n[0],(h=!fa(o,s))||l){if(d=!h,u=!l)for(p=v.length-1;p>=0&&(c=v[p],!(v[p].level<a));p--)if(c.single===m&&v[p].level===a){c=v[p],m?(f[c.token].content=va(f[c.token].content,c.pos,t.options.quotes[2]),i.content=va(i.content,n.index,t.options.quotes[3])):(f[c.token].content=va(f[c.token].content,c.pos,t.options.quotes[0]),i.content=va(i.content,n.index,t.options.quotes[1])),v.length=p;continue t}d?v.push({token:e,pos:n.index,single:m,level:a}):u&&m&&(i.content=va(i.content,n.index,"’"))}else m&&(i.content=va(i.content,n.index,"’"))}}]];function ya(){this.options={},this.ruler=new Xr;for(var t=0;t<ba.length;t++)this.ruler.push(ba[t][0],ba[t][1])}function _a(t,e,i,o,n){var s,r,a,l,h,c,d;for(this.src=t,this.parser=e,this.options=i,this.env=o,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",c=0,d=!1,a=l=c=0,h=(r=this.src).length;l<h;l++){if(s=r.charCodeAt(l),!d){if(32===s){c++;continue}d=!0}10!==s&&l!==h-1||(10!==s&&l++,this.bMarks.push(a),this.eMarks.push(l),this.tShift.push(c),d=!1,c=0,a=l+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function xa(t,e){var i,o,n;return(o=t.bMarks[e]+t.tShift[e])>=(n=t.eMarks[e])||42!==(i=t.src.charCodeAt(o++))&&45!==i&&43!==i||o<n&&32!==t.src.charCodeAt(o)?-1:o}function wa(t,e){var i,o=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];if(o+1>=n)return-1;if((i=t.src.charCodeAt(o++))<48||i>57)return-1;for(;;){if(o>=n)return-1;if(!((i=t.src.charCodeAt(o++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return o<n&&32!==t.src.charCodeAt(o)?-1:o}ya.prototype.process=function(t){var e,i,o;for(e=0,i=(o=this.ruler.getRules("")).length;e<i;e++)o[e](t)},_a.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},_a.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},_a.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},_a.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},_a.prototype.skipCharsBack=function(t,e,i){if(t<=i)return t;for(;t>i;)if(e!==this.src.charCodeAt(--t))return t+1;return t},_a.prototype.getLines=function(t,e,i,o){var n,s,r,a,l,h=t;if(t>=e)return"";if(h+1===e)return s=this.bMarks[h]+Math.min(this.tShift[h],i),r=o?this.eMarks[h]+1:this.eMarks[h],this.src.slice(s,r);for(a=new Array(e-t),n=0;h<e;h++,n++)(l=this.tShift[h])>i&&(l=i),l<0&&(l=0),s=this.bMarks[h]+l,r=h+1<e||o?this.eMarks[h]+1:this.eMarks[h],a[n]=this.src.slice(s,r);return a.join("")};var ka={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(t){ka[t]=!0}));var Aa=/^<([a-zA-Z]{1,15})[\s\/>]/,Sa=/^<\/([a-zA-Z]{1,15})[\s>]/;function Ca(t,e){var i=t.bMarks[e]+t.blkIndent,o=t.eMarks[e];return t.src.substr(i,o-i)}function Ta(t,e){var i,o,n=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];return n>=s||126!==(o=t.src.charCodeAt(n++))&&58!==o||n===(i=t.skipSpaces(n))||i>=s?-1:i}var Ea=[["code",function(t,e,i){var o,n;if(t.tShift[e]-t.blkIndent<4)return!1;for(n=o=e+1;o<i;)if(t.isEmpty(o))o++;else{if(!(t.tShift[o]-t.blkIndent>=4))break;n=++o}return t.line=o,t.tokens.push({type:"code",content:t.getLines(e,n,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,o){var n,s,r,a,l,h=!1,c=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(c+3>d)return!1;if(126!==(n=t.src.charCodeAt(c))&&96!==n)return!1;if(l=c,(s=(c=t.skipChars(c,n))-l)<3)return!1;if((r=t.src.slice(c,d).trim()).indexOf("`")>=0)return!1;if(o)return!0;for(a=e;!(++a>=i)&&!((c=l=t.bMarks[a]+t.tShift[a])<(d=t.eMarks[a])&&t.tShift[a]<t.blkIndent);)if(t.src.charCodeAt(c)===n&&!(t.tShift[a]-t.blkIndent>=4||(c=t.skipChars(c,n))-l<s||(c=t.skipSpaces(c))<d)){h=!0;break}return s=t.tShift[e],t.line=a+(h?1:0),t.tokens.push({type:"fence",params:r,content:t.getLines(e+1,a,s,!0),lines:[e,t.line],level:t.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(g>f)return!1;if(62!==t.src.charCodeAt(g++))return!1;if(t.level>=t.options.maxNesting)return!1;if(o)return!0;for(32===t.src.charCodeAt(g)&&g++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=g,s=(g=g<f?t.skipSpaces(g):g)>=f,r=[t.tShift[e]],t.tShift[e]=g-t.bMarks[e],d=t.parser.ruler.getRules("blockquote"),n=e+1;n<i&&!((g=t.bMarks[n]+t.tShift[n])>=(f=t.eMarks[n]));n++)if(62!==t.src.charCodeAt(g++)){if(s)break;for(m=!1,u=0,p=d.length;u<p;u++)if(d[u](t,n,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[n]),r.push(t.tShift[n]),t.tShift[n]=-1337}else 32===t.src.charCodeAt(g)&&g++,a.push(t.bMarks[n]),t.bMarks[n]=g,s=(g=g<f?t.skipSpaces(g):g)>=f,r.push(t.tShift[n]),t.tShift[n]=g-t.bMarks[n];for(h=t.parentType,t.parentType="blockquote",t.tokens.push({type:"blockquote_open",lines:c=[e,0],level:t.level++}),t.parser.tokenize(t,e,n),t.tokens.push({type:"blockquote_close",level:--t.level}),t.parentType=h,c[1]=t.line,u=0;u<r.length;u++)t.bMarks[u+e]=a[u],t.tShift[u+e]=r[u];return t.blkIndent=l,!0},["paragraph","blockquote","list"]],["hr",function(t,e,i,o){var n,s,r,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(n=t.src.charCodeAt(a++))&&45!==n&&95!==n)return!1;for(s=1;a<l;){if((r=t.src.charCodeAt(a++))!==n&&32!==r)return!1;r===n&&s++}return!(s<3)&&(o||(t.line=e+1,t.tokens.push({type:"hr",lines:[e,t.line],level:t.level})),!0)},["paragraph","blockquote","list"]],["list",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g,f,v,b,y,_,x,w,k,A,S=!0;if((d=wa(t,e))>=0)g=!0;else{if(!((d=xa(t,e))>=0))return!1;g=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(d-1),o)return!0;for(v=t.tokens.length,g?(c=t.bMarks[e]+t.tShift[e],p=Number(t.src.substr(c,d-c-1)),t.tokens.push({type:"ordered_list_open",order:p,lines:y=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:y=[e,0],level:t.level++}),n=e,b=!1,x=t.parser.ruler.getRules("list");!(!(n<i)||((u=(f=t.skipSpaces(d))>=t.eMarks[n]?1:f-d)>4&&(u=1),u<1&&(u=1),s=d-t.bMarks[n]+u,t.tokens.push({type:"list_item_open",lines:_=[e,0],level:t.level++}),a=t.blkIndent,l=t.tight,r=t.tShift[e],h=t.parentType,t.tShift[e]=f-t.bMarks[e],t.blkIndent=s,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!b||(S=!1),b=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=a,t.tShift[e]=r,t.tight=l,t.parentType=h,t.tokens.push({type:"list_item_close",level:--t.level}),n=e=t.line,_[1]=n,f=t.bMarks[e],n>=i)||t.isEmpty(n)||t.tShift[n]<t.blkIndent);){for(A=!1,w=0,k=x.length;w<k;w++)if(x[w](t,n,i,!0)){A=!0;break}if(A)break;if(g){if((d=wa(t,n))<0)break}else if((d=xa(t,n))<0)break;if(m!==t.src.charCodeAt(d-1))break}return t.tokens.push({type:g?"ordered_list_close":"bullet_list_close",level:--t.level}),y[1]=n,t.line=n,S&&function(t,e){var i,o,n=t.level+2;for(i=e+2,o=t.tokens.length-2;i<o;i++)t.tokens[i].level===n&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,v),!0},["paragraph","blockquote"]],["footnote",function(t,e,i,o){var n,s,r,a,l,h=t.bMarks[e]+t.tShift[e],c=t.eMarks[e];if(h+4>c)return!1;if(91!==t.src.charCodeAt(h))return!1;if(94!==t.src.charCodeAt(h+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(a=h+2;a<c;a++){if(32===t.src.charCodeAt(a))return!1;if(93===t.src.charCodeAt(a))break}return a!==h+2&&(!(a+1>=c||58!==t.src.charCodeAt(++a))&&(o||(a++,t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.refs||(t.env.footnotes.refs={}),l=t.src.slice(h+2,a-2),t.env.footnotes.refs[":"+l]=-1,t.tokens.push({type:"footnote_reference_open",label:l,level:t.level++}),n=t.bMarks[e],s=t.tShift[e],r=t.parentType,t.tShift[e]=t.skipSpaces(a)-a,t.bMarks[e]=a,t.blkIndent+=4,t.parentType="footnote",t.tShift[e]<t.blkIndent&&(t.tShift[e]+=t.blkIndent,t.bMarks[e]-=t.blkIndent),t.parser.tokenize(t,e,i,!0),t.parentType=r,t.blkIndent-=4,t.tShift[e]=s,t.bMarks[e]=n,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,o){var n,s,r,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(n=t.src.charCodeAt(a))||a>=l)return!1;for(s=1,n=t.src.charCodeAt(++a);35===n&&a<l&&s<=6;)s++,n=t.src.charCodeAt(++a);return!(s>6||a<l&&32!==n)&&(o||(l=t.skipCharsBack(l,32,a),(r=t.skipCharsBack(l,35,a))>a&&32===t.src.charCodeAt(r-1)&&(l=r),t.line=e+1,t.tokens.push({type:"heading_open",hLevel:s,lines:[e,t.line],level:t.level}),a<l&&t.tokens.push({type:"inline",content:t.src.slice(a,l).trim(),level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"heading_close",hLevel:s,level:t.level})),!0)},["paragraph","blockquote"]],["lheading",function(t,e,i){var o,n,s,r=e+1;return!(r>=i)&&(!(t.tShift[r]<t.blkIndent)&&(!(t.tShift[r]-t.blkIndent>3)&&(!((n=t.bMarks[r]+t.tShift[r])>=(s=t.eMarks[r]))&&((45===(o=t.src.charCodeAt(n))||61===o)&&(n=t.skipChars(n,o),!((n=t.skipSpaces(n))<s)&&(n=t.bMarks[e]+t.tShift[e],t.line=r+1,t.tokens.push({type:"heading_open",hLevel:61===o?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(n,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===o?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,o){var n,s,r,a=t.bMarks[e],l=t.eMarks[e],h=t.tShift[e];if(a+=h,!t.options.html)return!1;if(h>3||a+2>=l)return!1;if(60!==t.src.charCodeAt(a))return!1;if(33===(n=t.src.charCodeAt(a+1))||63===n){if(o)return!0}else{if(47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))return!1;if(47===n){if(!(s=t.src.slice(a,l).match(Sa)))return!1}else if(!(s=t.src.slice(a,l).match(Aa)))return!1;if(!0!==ka[s[1].toLowerCase()])return!1;if(o)return!0}for(r=e+1;r<t.lineMax&&!t.isEmpty(r);)r++;return t.line=r,t.tokens.push({type:"htmlblock",level:t.level,lines:[e,t.line],content:t.getLines(e,r,0,!0)}),!0},["paragraph","blockquote"]],["table",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m;if(e+2>i)return!1;if(l=e+1,t.tShift[l]<t.blkIndent)return!1;if((r=t.bMarks[l]+t.tShift[l])>=t.eMarks[l])return!1;if(124!==(n=t.src.charCodeAt(r))&&45!==n&&58!==n)return!1;if(s=Ca(t,e+1),!/^[-:| ]+$/.test(s))return!1;if((h=s.split("|"))<=2)return!1;for(d=[],a=0;a<h.length;a++){if(!(u=h[a].trim())){if(0===a||a===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(u))return!1;58===u.charCodeAt(u.length-1)?d.push(58===u.charCodeAt(0)?"center":"right"):58===u.charCodeAt(0)?d.push("left"):d.push("")}if(-1===(s=Ca(t,e).trim()).indexOf("|"))return!1;if(h=s.replace(/^\||\|$/g,"").split("|"),d.length!==h.length)return!1;if(o)return!0;for(t.tokens.push({type:"table_open",lines:p=[e,0],level:t.level++}),t.tokens.push({type:"thead_open",lines:[e,e+1],level:t.level++}),t.tokens.push({type:"tr_open",lines:[e,e+1],level:t.level++}),a=0;a<h.length;a++)t.tokens.push({type:"th_open",align:d[a],lines:[e,e+1],level:t.level++}),t.tokens.push({type:"inline",content:h[a].trim(),lines:[e,e+1],level:t.level,children:[]}),t.tokens.push({type:"th_close",level:--t.level});for(t.tokens.push({type:"tr_close",level:--t.level}),t.tokens.push({type:"thead_close",level:--t.level}),t.tokens.push({type:"tbody_open",lines:m=[e+2,0],level:t.level++}),l=e+2;l<i&&!(t.tShift[l]<t.blkIndent)&&-1!==(s=Ca(t,l).trim()).indexOf("|");l++){for(h=s.replace(/^\||\|$/g,"").split("|"),t.tokens.push({type:"tr_open",level:t.level++}),a=0;a<h.length;a++)t.tokens.push({type:"td_open",align:d[a],level:t.level++}),c=h[a].substring(124===h[a].charCodeAt(0)?1:0,124===h[a].charCodeAt(h[a].length-1)?h[a].length-1:h[a].length).trim(),t.tokens.push({type:"inline",content:c,level:t.level,children:[]}),t.tokens.push({type:"td_close",level:--t.level});t.tokens.push({type:"tr_close",level:--t.level})}return t.tokens.push({type:"tbody_close",level:--t.level}),t.tokens.push({type:"table_close",level:--t.level}),p[1]=m[1]=l,t.line=l,!0},["paragraph"]],["deflist",function(t,e,i,o){var n,s,r,a,l,h,c,d,u,p,m,g,f,v;if(o)return!(t.ddIndent<0)&&Ta(t,e)>=0;if(c=e+1,t.isEmpty(c)&&++c>i)return!1;if(t.tShift[c]<t.blkIndent)return!1;if((n=Ta(t,c))<0)return!1;if(t.level>=t.options.maxNesting)return!1;h=t.tokens.length,t.tokens.push({type:"dl_open",lines:l=[e,0],level:t.level++}),r=e,s=c;t:for(;;){for(v=!0,f=!1,t.tokens.push({type:"dt_open",lines:[r,r],level:t.level++}),t.tokens.push({type:"inline",content:t.getLines(r,r+1,t.blkIndent,!1).trim(),level:t.level+1,lines:[r,r],children:[]}),t.tokens.push({type:"dt_close",level:--t.level});;){if(t.tokens.push({type:"dd_open",lines:a=[c,0],level:t.level++}),g=t.tight,u=t.ddIndent,d=t.blkIndent,m=t.tShift[s],p=t.parentType,t.blkIndent=t.ddIndent=t.tShift[s]+2,t.tShift[s]=n-t.bMarks[s],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,s,i,!0),t.tight&&!f||(v=!1),f=t.line-s>1&&t.isEmpty(t.line-1),t.tShift[s]=m,t.tight=g,t.parentType=p,t.blkIndent=d,t.ddIndent=u,t.tokens.push({type:"dd_close",level:--t.level}),a[1]=c=t.line,c>=i)break t;if(t.tShift[c]<t.blkIndent)break t;if((n=Ta(t,c))<0)break;s=c}if(c>=i)break;if(r=c,t.isEmpty(r))break;if(t.tShift[r]<t.blkIndent)break;if((s=r+1)>=i)break;if(t.isEmpty(s)&&s++,s>=i)break;if(t.tShift[s]<t.blkIndent)break;if((n=Ta(t,s))<0)break}return t.tokens.push({type:"dl_close",level:--t.level}),l[1]=c,t.line=c,v&&function(t,e){var i,o,n=t.level+2;for(i=e+2,o=t.tokens.length-2;i<o;i++)t.tokens[i].level===n&&"paragraph_open"===t.tokens[i].type&&(t.tokens[i+2].tight=!0,t.tokens[i].tight=!0,i+=2)}(t,h),!0},["paragraph"]],["paragraph",function(t,e){var i,o,n,s,r,a,l=e+1;if(l<(i=t.lineMax)&&!t.isEmpty(l))for(a=t.parser.ruler.getRules("paragraph");l<i&&!t.isEmpty(l);l++)if(!(t.tShift[l]-t.blkIndent>3)){for(n=!1,s=0,r=a.length;s<r;s++)if(a[s](t,l,i,!0)){n=!0;break}if(n)break}return o=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,o.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:o,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function $a(){this.ruler=new Xr;for(var t=0;t<Ea.length;t++)this.ruler.push(Ea[t][0],Ea[t][1],{alt:(Ea[t][2]||[]).slice()})}$a.prototype.tokenize=function(t,e,i){for(var o,n=this.ruler.getRules(""),s=n.length,r=e,a=!1;r<i&&(t.line=r=t.skipEmptyLines(r),!(r>=i))&&!(t.tShift[r]<t.blkIndent);){for(o=0;o<s&&!n[o](t,r,i,!1);o++);if(t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),(r=t.line)<i&&t.isEmpty(r)){if(a=!0,++r<i&&"list"===t.parentType&&t.isEmpty(r))break;t.line=r}}};var Oa=/[\n\t]/g,za=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,La=/\u00a0/g;function Ma(t){switch(t){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}$a.prototype.parse=function(t,e,i,o){var n,s=0,r=0;if(!t)return[];(t=(t=t.replace(La," ")).replace(za,"\n")).indexOf("\t")>=0&&(t=t.replace(Oa,(function(e,i){var o;return 10===t.charCodeAt(i)?(s=i+1,r=0,e):(o=" ".slice((i-s-r)%4),r=i-s+1,o)}))),n=new _a(t,this,e,i,o),this.tokenize(n,n.line,n.lineMax)};for(var Ia=[],Da=0;Da<256;Da++)Ia.push(0);function Pa(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function Na(t,e){var i,o,n,s=e,r=!0,a=!0,l=t.posMax,h=t.src.charCodeAt(e);for(i=e>0?t.src.charCodeAt(e-1):-1;s<l&&t.src.charCodeAt(s)===h;)s++;return s>=l&&(r=!1),(n=s-e)>=4?r=a=!1:(32!==(o=s<l?t.src.charCodeAt(s):-1)&&10!==o||(r=!1),32!==i&&10!==i||(a=!1),95===h&&(Pa(i)&&(r=!1),Pa(o)&&(a=!1))),{can_open:r,can_close:a,delims:n}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){Ia[t.charCodeAt(0)]=1}));var Ba=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var Ra=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var qa=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],Fa=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Ua=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function ja(t,e){return t=t.source,e=e||"",function i(o,n){return o?(n=n.source||n,t=t.replace(o,n),i):new RegExp(t,e)}}var Va=ja(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),Za=ja(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",Va)(),Ha=ja(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",Za)(),Wa=ja(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",Ha)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var Ga=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,Ya=/^&([a-z][a-z0-9]{1,31});/i;var Ka=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!Ma(t.src.charCodeAt(i));)i++;return i!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,i)),t.pos=i,!0)}],["newline",function(t,e){var i,o,n=t.pos;if(10!==t.src.charCodeAt(n))return!1;if(i=t.pending.length-1,o=t.posMax,!e)if(i>=0&&32===t.pending.charCodeAt(i))if(i>=1&&32===t.pending.charCodeAt(i-1)){for(var s=i-2;s>=0;s--)if(32!==t.pending.charCodeAt(s)){t.pending=t.pending.substring(0,s+1);break}t.push({type:"hardbreak",level:t.level})}else t.pending=t.pending.slice(0,-1),t.push({type:"softbreak",level:t.level});else t.push({type:"softbreak",level:t.level});for(n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}],["escape",function(t,e){var i,o=t.pos,n=t.posMax;if(92!==t.src.charCodeAt(o))return!1;if(++o<n){if((i=t.src.charCodeAt(o))<256&&0!==Ia[i])return e||(t.pending+=t.src[o]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,o,n,s,r,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,o=t.posMax;a<o&&96===t.src.charCodeAt(a);)a++;for(n=t.src.slice(i,a),s=r=a;-1!==(s=t.src.indexOf("`",r));){for(r=s+1;r<o&&96===t.src.charCodeAt(r);)r++;if(r-s===n.length)return e||t.push({type:"code",content:t.src.slice(a,s).replace(/[ \n]+/g," ").trim(),block:!1,level:t.level}),t.pos=r,!0}return e||(t.pending+=n),t.pos+=n.length,!0}],["del",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(126!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(126!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),126===s)return!1;if(126===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&126===t.src.charCodeAt(o);)o++;if(o>l+3)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(126===t.src.charCodeAt(t.pos)&&126===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),126!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&126!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"del_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"del_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["ins",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(43!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(43!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),43===s)return!1;if(43===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&43===t.src.charCodeAt(o);)o++;if(o!==l+2)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(43===t.src.charCodeAt(t.pos)&&43===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),43!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&43!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"ins_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"ins_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["mark",function(t,e){var i,o,n,s,r,a=t.posMax,l=t.pos;if(61!==t.src.charCodeAt(l))return!1;if(e)return!1;if(l+4>=a)return!1;if(61!==t.src.charCodeAt(l+1))return!1;if(t.level>=t.options.maxNesting)return!1;if(s=l>0?t.src.charCodeAt(l-1):-1,r=t.src.charCodeAt(l+2),61===s)return!1;if(61===r)return!1;if(32===r||10===r)return!1;for(o=l+2;o<a&&61===t.src.charCodeAt(o);)o++;if(o!==l+2)return t.pos+=o-l,e||(t.pending+=t.src.slice(l,o)),!0;for(t.pos=l+2,n=1;t.pos+1<a;){if(61===t.src.charCodeAt(t.pos)&&61===t.src.charCodeAt(t.pos+1)&&(s=t.src.charCodeAt(t.pos-1),61!==(r=t.pos+2<a?t.src.charCodeAt(t.pos+2):-1)&&61!==s&&(32!==s&&10!==s?n--:32!==r&&10!==r&&n++,n<=0))){i=!0;break}t.parser.skipToken(t)}return i?(t.posMax=t.pos,t.pos=l+2,e||(t.push({type:"mark_open",level:t.level++}),t.parser.tokenize(t),t.push({type:"mark_close",level:--t.level})),t.pos=t.posMax+2,t.posMax=a,!0):(t.pos=l,!1)}],["emphasis",function(t,e){var i,o,n,s,r,a,l,h=t.posMax,c=t.pos,d=t.src.charCodeAt(c);if(95!==d&&42!==d)return!1;if(e)return!1;if(i=(l=Na(t,c)).delims,!l.can_open)return t.pos+=i,e||(t.pending+=t.src.slice(c,t.pos)),!0;if(t.level>=t.options.maxNesting)return!1;for(t.pos=c+i,a=[i];t.pos<h;)if(t.src.charCodeAt(t.pos)!==d)t.parser.skipToken(t);else{if(o=(l=Na(t,t.pos)).delims,l.can_close){for(s=a.pop(),r=o;s!==r;){if(r<s){a.push(s-r);break}if(r-=s,0===a.length)break;t.pos+=s,s=a.pop()}if(0===a.length){i=s,n=!0;break}t.pos+=o;continue}l.can_open&&a.push(o),t.pos+=o}return n?(t.posMax=t.pos,t.pos=c+i,e||(2!==i&&3!==i||t.push({type:"strong_open",level:t.level++}),1!==i&&3!==i||t.push({type:"em_open",level:t.level++}),t.parser.tokenize(t),1!==i&&3!==i||t.push({type:"em_close",level:--t.level}),2!==i&&3!==i||t.push({type:"strong_close",level:--t.level})),t.pos=t.posMax+i,t.posMax=h,!0):(t.pos=c,!1)}],["sub",function(t,e){var i,o,n=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=n)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<n;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(o=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sub",level:t.level,content:o.replace(Ba,"$1")}),t.pos=t.posMax+1,t.posMax=n,!0):(t.pos=s,!1)}],["sup",function(t,e){var i,o,n=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=n)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<n;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(o=t.src.slice(s+1,t.pos)).match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,e||t.push({type:"sup",level:t.level,content:o.replace(Ra,"$1")}),t.pos=t.posMax+1,t.posMax=n,!0):(t.pos=s,!1)}],["links",function(t,e){var i,o,n,s,r,a,l,h,c=!1,d=t.pos,u=t.posMax,p=t.pos,m=t.src.charCodeAt(p);if(33===m&&(c=!0,m=t.src.charCodeAt(++p)),91!==m)return!1;if(t.level>=t.options.maxNesting)return!1;if(i=p+1,(o=ea(t,p))<0)return!1;if((a=o+1)<u&&40===t.src.charCodeAt(a)){for(a++;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a>=u)return!1;for(p=a,na(t,a)?(s=t.linkContent,a=t.pos):s="",p=a;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a<u&&p!==a&&sa(t,a))for(r=t.linkContent,a=t.pos;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);else r="";if(a>=u||41!==t.src.charCodeAt(a))return t.pos=d,!1;a++}else{if(t.linkLevel>0)return!1;for(;a<u&&(32===(h=t.src.charCodeAt(a))||10===h);a++);if(a<u&&91===t.src.charCodeAt(a)&&(p=a+1,(a=ea(t,a))>=0?n=t.src.slice(p,a++):a=p-1),n||(void 0===n&&(a=o+1),n=t.src.slice(i,o)),!(l=t.env.references[ra(n)]))return t.pos=d,!1;s=l.href,r=l.title}return e||(t.pos=i,t.posMax=o,c?t.push({type:"image",src:s,title:r,alt:t.src.substr(i,o-i),level:t.level}):(t.push({type:"link_open",href:s,title:r,level:t.level++}),t.linkLevel++,t.parser.tokenize(t),t.linkLevel--,t.push({type:"link_close",level:--t.level}))),t.pos=a,t.posMax=u,!0}],["footnote_inline",function(t,e){var i,o,n,s,r=t.posMax,a=t.pos;return!(a+2>=r)&&(94===t.src.charCodeAt(a)&&(91===t.src.charCodeAt(a+1)&&(!(t.level>=t.options.maxNesting)&&(i=a+2,!((o=ea(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),n=t.env.footnotes.list.length,t.pos=i,t.posMax=o,t.push({type:"footnote_ref",id:n,level:t.level}),t.linkLevel++,s=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[n]={tokens:t.tokens.splice(s)},t.linkLevel--),t.pos=o+1,t.posMax=r,!0)))))}],["footnote_ref",function(t,e){var i,o,n,s,r=t.posMax,a=t.pos;if(a+3>r)return!1;if(!t.env.footnotes||!t.env.footnotes.refs)return!1;if(91!==t.src.charCodeAt(a))return!1;if(94!==t.src.charCodeAt(a+1))return!1;if(t.level>=t.options.maxNesting)return!1;for(o=a+2;o<r;o++){if(32===t.src.charCodeAt(o))return!1;if(10===t.src.charCodeAt(o))return!1;if(93===t.src.charCodeAt(o))break}return o!==a+2&&(!(o>=r)&&(o++,i=t.src.slice(a+2,o-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(n=t.env.footnotes.list.length,t.env.footnotes.list[n]={label:i,count:0},t.env.footnotes.refs[":"+i]=n):n=t.env.footnotes.refs[":"+i],s=t.env.footnotes.list[n].count,t.env.footnotes.list[n].count++,t.push({type:"footnote_ref",id:n,subId:s,level:t.level})),t.pos=o,t.posMax=r,!0)))}],["autolink",function(t,e){var i,o,n,s,r,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((o=i.match(Ua))?!(qa.indexOf(o[1].toLowerCase())<0)&&(r=oa(s=o[0].slice(1,-1)),!!t.parser.validateLink(s)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=o[0].length,!0)):!!(n=i.match(Fa))&&(r=oa("mailto:"+(s=n[0].slice(1,-1))),!!t.parser.validateLink(r)&&(e||(t.push({type:"link_open",href:r,level:t.level}),t.push({type:"text",content:s,level:t.level+1}),t.push({type:"link_close",level:t.level})),t.pos+=n[0].length,!0))))}],["htmltag",function(t,e){var i,o,n,s=t.pos;return!!t.options.html&&(n=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=n)&&(!(33!==(i=t.src.charCodeAt(s+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(o=t.src.slice(s).match(Wa))&&(e||t.push({type:"htmltag",content:t.src.slice(s,s+o[0].length),level:t.level}),t.pos+=o[0].length,!0))))}],["entity",function(t,e){var i,o,n=t.pos,s=t.posMax;if(38!==t.src.charCodeAt(n))return!1;if(n+1<s)if(35===t.src.charCodeAt(n+1)){if(o=t.src.slice(n).match(Ga))return e||(i="x"===o[1][0].toLowerCase()?parseInt(o[1].slice(1),16):parseInt(o[1],10),t.pending+=Br(i)?Rr(i):Rr(65533)),t.pos+=o[0].length,!0}else if(o=t.src.slice(n).match(Ya)){var r=Mr(o[1]);if(o[1]!==r)return e||(t.pending+=r),t.pos+=o[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function Qa(){this.ruler=new Xr;for(var t=0;t<Ka.length;t++)this.ruler.push(Ka[t][0],Ka[t][1]);this.validateLink=Ja}function Ja(t){var e=t.trim().toLowerCase();return-1===(e=jr(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}Qa.prototype.skipToken=function(t){var e,i,o=this.ruler.getRules(""),n=o.length,s=t.pos;if((i=t.cacheGet(s))>0)t.pos=i;else{for(e=0;e<n;e++)if(o[e](t,!0))return void t.cacheSet(s,t.pos);t.pos++,t.cacheSet(s,t.pos)}},Qa.prototype.tokenize=function(t){for(var e,i,o=this.ruler.getRules(""),n=o.length,s=t.posMax;t.pos<s;){for(i=0;i<n&&!(e=o[i](t,!1));i++);if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Qa.prototype.parse=function(t,e,i,o){var n=new ta(t,this,e,i,o);this.tokenize(n)};var Xa={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function tl(t,e,i){this.src=e,this.env=i,this.options=t.options,this.tokens=[],this.inlineMode=!1,this.inline=t.inline,this.block=t.block,this.renderer=t.renderer,this.typographer=t.typographer}function el(t,e){"string"!=typeof t&&(e=t,t="default"),e&&null!=e.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Qa,this.block=new $a,this.core=new ya,this.renderer=new Jr,this.ruler=new Xr,this.options={},this.configure(Xa[t]),this.set(e||{})}el.prototype.set=function(t){Dr(this.options,t)},el.prototype.configure=function(t){var e=this;if(!t)throw new Error("Wrong `remarkable` preset, check name/content");t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach((function(i){t.components[i].rules&&e[i].ruler.enable(t.components[i].rules,!0)}))},el.prototype.use=function(t,e){return t(this,e),this},el.prototype.parse=function(t,e){var i=new tl(this,t,e);return this.core.process(i),i.tokens},el.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},el.prototype.parseInline=function(t,e){var i=new tl(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},el.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const il=new el;const ol=_e(class extends xe{constructor(t){if(super(t),t.type!==ye)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return V`${Or(il.render(t))}`}}),nl=new Er("@",["contact","fields","globals","urns"]),sl=new Er("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]),rl=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),o=t.signature.substr(0,i),n=t.signature.substr(i);return V`
|
|
603
603
|
<div style="${e?"font-weight: 400":""}">
|
|
604
604
|
<div style="display:inline-block;margin-right: 5px">ƒ</div>
|
|
605
605
|
<div style="display:inline-block">${o}</div>
|
|
606
|
-
${e?
|
|
606
|
+
${e?V`
|
|
607
607
|
<div
|
|
608
608
|
style="display:inline-block; font-weight: 300; font-size: 85%"
|
|
609
609
|
>
|
|
@@ -612,10 +612,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
612
612
|
<div class="detail">${ol(t.summary)}</div>
|
|
613
613
|
`:null}
|
|
614
614
|
</div>
|
|
615
|
-
`}return
|
|
615
|
+
`}return V`
|
|
616
616
|
<div>
|
|
617
617
|
<div style="${e?"font-weight: 400":""}">${t.name}</div>
|
|
618
|
-
${e?
|
|
618
|
+
${e?V` <div style="font-size: 85%">${t.summary}</div> `:null}
|
|
619
619
|
</div>
|
|
620
620
|
`},al=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,ll=(t,e,i={},o)=>{const n=(e||"").split(".");let s=o?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;n.length>0;)if(a=n.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const o=t.types.find((t=>t.name===e.type));if(o&&o.properties)s=o.properties,r+=a+".";else{if(!o||!o.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=o.property_template;s=i[o.name]?i[o.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})))},hl=(t,e)=>{const{offsetLeft:i,offsetTop:o}=t,n=document.createElement("div"),s=getComputedStyle(t);for(const t of s)n.style[t]=s[t];n.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);n.textContent=a,"TEXTAREA"===t.tagName&&(n.style.height="auto"),"INPUT"===t.tagName&&(n.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",n.appendChild(l),document.body.appendChild(n);const{offsetLeft:h,offsetTop:c}=l;return document.body.removeChild(n),{left:i+h,top:o+c}},cl=(t,e,i)=>{let o="";o=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const n=t.length;if(e){const t=e.value,i=e.selectionStart-n,s=t.substr(0,i),r=t.substr(i+n),a=s.length+o.length;e.value=s+o+r,e.setSelectionRange(a,a);const l=hl(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},dl=(t,e,i)=>{const o={currentFunction:null,options:[],anchorPosition:null,query:null};if(!t)return;if(!e)return o;const n=t.selectionStart,s=t.value.substring(0,n),r=i?sl:nl,a=r.findExpressions(s).find((t=>t.start<=n&&(t.end>n||t.end===n&&!t.closed)));if(a){const n=a.text.indexOf("(")>-1;if(n){const t=r.functionContext(a.text);if(t){const i=al(e.getFunctions(),t);i.length>0&&(o.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=hl(t,a.start+s);return o.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},o.query=a.text.substr(s,a.text.length-s),o.options=[...ll(e.getCompletionSchema(),o.query,e.getKeyedAssets(),i),...n?al(e.getFunctions(),o.query):[]],o}}}else o.options=[],o.query="";return o};class ul extends me{static get styles(){return r`
|
|
621
621
|
:host {
|
|
@@ -911,21 +911,21 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
911
911
|
pointer-events: none;
|
|
912
912
|
padding: 0px;
|
|
913
913
|
}
|
|
914
|
-
`}constructor(){super(),this.hiddenInputs=[],this.inputStyle={},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.values=[],this.getName=t=>t[this.nameKey||"name"],this.isMatch=this.isMatchDefault,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.sortFunction=null,this.renderOptionDetail=()=>j``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.prepareOptions=this.prepareOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.alphaSort=(t,e)=>this.endpoint?this.getName(t).localeCompare(this.getName(e)):0,this.next=null,this.lruCache=Le(20,6e4),this.getNameInternal=t=>this.getName(t),this.renderOptionDefault=this.renderOptionDefault.bind(this),this.renderSelectedItemDefault=this.renderSelectedItemDefault.bind(this),this.prepareOptionsDefault=this.prepareOptionsDefault.bind(this),this.isMatchDefault=this.isMatchDefault.bind(this)}prepareOptionsDefault(t){return t}isMatchDefault(t,e){return(this.getName(t)||"").toLowerCase().indexOf(e)>-1}handleSlotChange(){if(this.staticOptions&&0===this.staticOptions.length)for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;if(e){let t=!1;void 0!==e.selected&&(delete e.selected,t=!0);const i=this.value||this.getAttribute("value");if(i){this.getValue(e)==i&&(t=!0)}this.staticOptions.push(e),t&&(this.multi?this.addValue(e):this.setValues([e]))}}this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}checkSelectedOption(){if(this.value&&0==this.values.length&&0==this.staticOptions.length&&this.endpoint){const t=this.value;this.resolving=!0,Wt(this.endpoint).then((e=>{if(e&&e.length>0){if(t){const i=e.find((e=>this.getValue(e)===t));if(i)return this.resolving=!1,this.fetching=!1,void this.setValues([i])}this.setValues([e[0]]),this.resolving=!1}}))}else this.staticOptions.length>0&&(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.getAttribute("value")?this.setSelectedValue(this.getAttribute("value")):this.setValues([this.staticOptions[0]]))}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){super.updated(t),t.has("sorted")&&(this.sortFunction=this.sorted?this.alphaSort:null),t.has("value")&&this.value&&!this.values.length&&this.setSelectedValue(this.value),t.has("values")&&(this.updateInputs(),this.hasChanges(t.get("values"))&&this.fireEvent("change")),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),this.endpoint&&t.has("fetching")&&(this.fetching||this.isPastFetchThreshold()||this.fireCustomEvent($e.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&(this.next?this.fetchOptions(null,null,this.next):this.fetchOptions(this.query,this.page+1)),0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}hasChanges(t){if(void 0===t)return!1;let e;void 0!==t&&(e=(t||[]).map((t=>this.getValue(t))).join(","));return e!==(this.values||[]).map((t=>this.getValue(t))).join(",")}setSelectedValue(t){if(this.staticOptions.length>0){const e=this.staticOptions.find((e=>this.getValue(e)===t));e&&this.setValues([e])}else this.checkSelectedOption()}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();if(0===this.values.length)this.value=null;else{const t=this.getAttribute("name");t&&(this.multi||1!==this.values.length?this.inputRoot.parentElement&&this.values.forEach((e=>{const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",t),i.setAttribute("value",this.serializeValue(e)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)})):(this.selection=this.values[0],this.value=this.serializeValue(this.values[0])))}}setSelectedOption(t){this.multi?this.addValue(t):this.setValues([t]),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1}isPastFetchThreshold(){return(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20}handleOptionSelection(t){t.preventDefault(),t.stopPropagation();const e=t.detail.selected;e.post&&this.endpoint?Qt(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Le(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,o=this.shadowRoot.querySelector(".searchbox");cl(this.query,o,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[]}createArbitraryOptionDefault(){return null}open(){this.shadowRoot.querySelector(".select-container").click()}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t,this.fireCustomEvent($e.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=dl(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent($e.FetchComplete)}}fetchOptions(t,e=0,i=null){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const o=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(o.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||o.splice(0,0,{name:t,value:t})),this.endpoint){let s=this.endpoint;i?s=i:(t&&this.queryParam&&(s.indexOf("?")>-1?s+="&":s+="?",s+=this.queryParam+"="+encodeURIComponent(t)),e&&(s.indexOf("?")>-1?s+="&":s+="?",s+="page="+e));const r=this.lruCache.get(s);if(this.cache&&!this.tags&&r)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...r.options]):(this.cursorIndex=0,this.setVisibleOptions([...o,...r.options])),this.complete=r.complete,this.next=r.next,void(this.fetching=!1);this.searchable&&!this.queryParam?Wt(s).then((t=>{t=this.prepareOptions(t),this.cache&&!this.tags&&(this.lruCache.set(s,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...o,...t]),this.fetching=!1)})):jt(s).then((i=>{let r=this.getOptions(i).filter((t=>this.isMatch(t,n)));r=this.prepareOptions(r),this.next=null;const a=i.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,i)):(this.cursorIndex=0,this.setVisibleOptions([...o,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,i)),this.cache&&!this.tags&&this.lruCache.set(s,{options:r,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(o)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0)}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0)}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValues([e]),this.input="",this.multi||this.blur()}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1)}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(t.stopPropagation(),t.preventDefault(),this.focused=!0,"INPUT"!==t.target.tagName){const t=this.shadowRoot.querySelector("input");if(t)return t.click(),void t.focus();this.visibleOptions.length>0?this.visibleOptions=[]:this.requestUpdate("input")}}getEventHandlers(){return[{event:$e.Canceled,method:this.handleCancel},{event:$e.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}handleArrowClick(t){this.isOpen()&&(t.preventDefault(),t.stopPropagation(),this.blur())}renderOptionDefault(t){if(!t)return null;const e=t.icon;return j`
|
|
914
|
+
`}constructor(){super(),this.hiddenInputs=[],this.inputStyle={},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.values=[],this.getName=t=>t[this.nameKey||"name"],this.isMatch=this.isMatchDefault,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.sortFunction=null,this.renderOptionDetail=()=>V``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.prepareOptions=this.prepareOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.allowAnchor=!0,this.alphaSort=(t,e)=>this.endpoint?this.getName(t).localeCompare(this.getName(e)):0,this.next=null,this.lruCache=Le(20,6e4),this.getNameInternal=t=>this.getName(t),this.renderOptionDefault=this.renderOptionDefault.bind(this),this.renderSelectedItemDefault=this.renderSelectedItemDefault.bind(this),this.prepareOptionsDefault=this.prepareOptionsDefault.bind(this),this.isMatchDefault=this.isMatchDefault.bind(this)}prepareOptionsDefault(t){return t}isMatchDefault(t,e){return(this.getName(t)||"").toLowerCase().indexOf(e)>-1}handleSlotChange(){if(this.staticOptions&&0===this.staticOptions.length)for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;if(e){let t=!1;void 0!==e.selected&&(delete e.selected,t=!0);const i=this.value||this.getAttribute("value");if(i){this.getValue(e)==i&&(t=!0)}this.staticOptions.push(e),t&&(this.multi?this.addValue(e):this.setValues([e]))}}this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}checkSelectedOption(){if(this.value&&0==this.values.length&&0==this.staticOptions.length&&this.endpoint){const t=this.value;this.resolving=!0,Wt(this.endpoint).then((e=>{if(e&&e.length>0){if(t){const i=e.find((e=>this.getValue(e)===t));if(i)return this.resolving=!1,this.fetching=!1,void this.setValues([i])}this.setValues([e[0]]),this.resolving=!1}}))}else this.staticOptions.length>0&&(null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.getAttribute("value")?this.setSelectedValue(this.getAttribute("value")):this.setValues([this.staticOptions[0]]))}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){super.updated(t),t.has("sorted")&&(this.sortFunction=this.sorted?this.alphaSort:null),t.has("value")&&this.value&&!this.values.length&&this.setSelectedValue(this.value),t.has("values")&&(this.updateInputs(),this.hasChanges(t.get("values"))&&this.fireEvent("change")),t.has("cacheKey")&&this.lruCache.clear(),t.has("input")&&!t.has("values")&&!t.has("options")&&this.focused&&(this.lastQuery&&window.clearTimeout(this.lastQuery),this.lastQuery=window.setTimeout((()=>{this.expressions&&this.input.indexOf("@")>-1?this.fetchExpressions():this.fetchOptions(this.input)}),this.quietMillis)),this.endpoint&&t.has("fetching")&&(this.fetching||this.isPastFetchThreshold()||this.fireCustomEvent($e.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&(this.next?this.fetchOptions(null,null,this.next):this.fetchOptions(this.query,this.page+1)),0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}hasChanges(t){if(void 0===t)return!1;let e;void 0!==t&&(e=(t||[]).map((t=>this.getValue(t))).join(","));return e!==(this.values||[]).map((t=>this.getValue(t))).join(",")}setSelectedValue(t){if(this.staticOptions.length>0){const e=this.staticOptions.find((e=>this.getValue(e)===t));e&&this.setValues([e])}else this.checkSelectedOption()}updateInputs(){for(let t=null;t=this.hiddenInputs.pop();)t.remove();if(0===this.values.length)this.value=null;else{const t=this.getAttribute("name");t&&(this.multi||1!==this.values.length?this.inputRoot.parentElement&&this.values.forEach((e=>{const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",t),i.setAttribute("value",this.serializeValue(e)),this.hiddenInputs.push(i),this.inputRoot.parentElement.appendChild(i)})):(this.selection=this.values[0],this.value=this.serializeValue(this.values[0])))}}setSelectedOption(t){this.multi?this.addValue(t):this.setValues([t]),this.multi&&this.searchable||(this.blur(),this.focused=!1),this.visibleOptions=[],this.input="",this.next=null,this.complete=!0,this.selectedIndex=-1}isPastFetchThreshold(){return(this.visibleOptions.length>0||this.next)&&!this.complete&&(this.cursorIndex||0)>this.visibleOptions.length-20}handleOptionSelection(t){t.preventDefault(),t.stopPropagation();const e=t.detail.selected;e.post&&this.endpoint?Qt(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Le(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,o=this.shadowRoot.querySelector(".searchbox");cl(this.query,o,e),this.query="",this.completionOptions=[],i?this.fetchExpressions():-1===this.input.indexOf("(")&&this.addInputAsValue()}getOptionsDefault(t){return t.json.results}isCompleteDefault(t,e){const i=e.json;return!i.more&&!i.next}handleRemoveSelection(t){this.removeValue(t),this.visibleOptions=[]}createArbitraryOptionDefault(){return null}open(){this.shadowRoot.querySelector(".select-container").click()}isOpen(){return this.visibleOptions.length>0}setOptions(t){this.staticOptions=t}setVisibleOptions(t){if(t=t.filter((t=>!!this.getNameInternal(t)&&(!this.shouldExclude||!this.shouldExclude(t)))),this.input){if(this.searchable&&!this.queryParam){const e=this.input.trim().toLowerCase();t=t.filter((t=>this.isMatch(t,e)))}const e=this.createArbitraryOption(this.input,t);if(e){e.arbitrary=!0;t.find((t=>this.getValue(t)===this.getValue(e)))||(t.length>0&&t[0].arbitrary?t[0]=e:t.unshift(e))}}this.values.length>0&&(this.multi?t=t.filter((t=>!this.values.find((e=>this.getValue(e)===this.getValue(t))))):(this.input?this.cursorIndex=0:this.cursorIndex=t.findIndex((t=>this.getValue(t)===this.getValue(this.values[0]))),this.requestUpdate("cursorIndex"))),this.sortFunction&&t.sort(this.sortFunction),this.visibleOptions=t,this.fireCustomEvent($e.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=dl(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent($e.FetchComplete)}}fetchOptions(t,e=0,i=null){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const o=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(o.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||o.splice(0,0,{name:t,value:t})),this.endpoint){let s=this.endpoint;i?s=i:(t&&this.queryParam&&(s.indexOf("?")>-1?s+="&":s+="?",s+=this.queryParam+"="+encodeURIComponent(t)),e&&(s.indexOf("?")>-1?s+="&":s+="?",s+="page="+e));const r=this.lruCache.get(s);if(this.cache&&!this.tags&&r)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...r.options]):(this.cursorIndex=0,this.setVisibleOptions([...o,...r.options])),this.complete=r.complete,this.next=r.next,void(this.fetching=!1);this.searchable&&!this.queryParam?Wt(s).then((t=>{t=this.prepareOptions(t),this.cache&&!this.tags&&(this.lruCache.set(s,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...o,...t]),this.fetching=!1)})):Vt(s).then((i=>{let r=this.getOptions(i).filter((t=>this.isMatch(t,n)));r=this.prepareOptions(r),this.next=null;const a=i.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,i)):(this.cursorIndex=0,this.setVisibleOptions([...o,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,i)),this.cache&&!this.tags&&this.lruCache.set(s,{options:r,complete:this.complete,next:this.next}),this.fetching=!1,this.page=e})).catch((t=>{this.fetching=!1,console.error(t)}))}else this.fetching=!1,this.setVisibleOptions(o)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0)}handleBlur(){this.focused=!1,this.visibleOptions.length>0&&(this.input="",this.next=null,this.complete=!0,this.visibleOptions=[],this.cursorIndex=0)}handleClick(){this.selectedIndex=-1,this.requestUpdate("input")}addInputAsValue(){const t=this.shadowRoot.querySelector(".searchbox"),e={name:t.value,value:t.value,expression:!0};this.multi?this.values.find((t=>t.expression&&t.value&&e.value&&t.value.toLowerCase().trim()==e.value.toLowerCase().trim()))||this.addValue(e):this.setValues([e]),this.input="",this.multi||this.blur()}handleKeyDown(t){if("Enter"===t.key&&this.expressions&&0===this.completionOptions.length&&this.input.indexOf("@")>-1&&this.addInputAsValue(),("Enter"===t.key||"ArrowDown"===t.key||"n"===t.key&&t.ctrlKey)&&0===this.visibleOptions.length&&0===this.completionOptions.length)this.requestUpdate("input");else if(this.multi&&"Backspace"===t.key&&!this.input){if(this.visibleOptions.length>0)return void(this.visibleOptions=[]);-1===this.selectedIndex?(this.selectedIndex=this.values.length-1,this.visibleOptions=[]):(this.popValue(),this.selectedIndex=-1)}else this.selectedIndex=-1}getStaticOptions(){return this.staticOptions}handleInput(t){const e=t.currentTarget;this.input=e.value}handleCancel(){this.visibleOptions=[]}handleCursorChanged(t){this.cursorIndex=t.detail.index}handleContainerClick(t){if(t.stopPropagation(),t.preventDefault(),this.focused=!0,"INPUT"!==t.target.tagName){const t=this.shadowRoot.querySelector("input");if(t)return t.click(),void t.focus();this.visibleOptions.length>0?this.visibleOptions=[]:this.requestUpdate("input")}}getEventHandlers(){return[{event:$e.Canceled,method:this.handleCancel},{event:$e.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}handleArrowClick(t){this.isOpen()&&(t.preventDefault(),t.stopPropagation(),this.blur())}renderOptionDefault(t){if(!t)return null;const e=t.icon;return V`
|
|
915
915
|
<div class="option-name" style="display:flex">
|
|
916
|
-
${e?
|
|
916
|
+
${e?V`<temba-icon
|
|
917
917
|
name="${e}"
|
|
918
918
|
style="margin-right:0.5em;"
|
|
919
919
|
></temba-icon>`:null}<span>${this.getName(t)}</span>
|
|
920
920
|
</div>
|
|
921
|
-
`}renderSelectedItemDefault(t){return(this.renderOption||this.renderOptionDefault)(t,!0)}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(this.getValue(e)===t)return void(0!==this.values.length&&this.values[0].value==""+t||this.setValues([e]))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.visibleOptions.length>0&&(this.visibleOptions=[],this.requestUpdate()),this.fireCustomEvent($e.Selection,{selected:null})}setValues(t){const e=this.values;this.values=t,this.requestUpdate("values",e)}addValue(t){const e=[...this.values];this.values.push(t),this.requestUpdate("values",e)}removeValue(t){const e=[...this.values],i=this.values.indexOf(t);i>-1&&this.values.splice(i,1),this.requestUpdate("values",e)}popValue(){const t=[...this.values];this.values.pop(),this.requestUpdate("values",t)}clear(){const t=this.values;this.values=[],this.requestUpdate("values",t)}render(){const t=0===this.values.length?this.placeholder:"",e=
|
|
921
|
+
`}renderSelectedItemDefault(t){return(this.renderOption||this.renderOptionDefault)(t,!0)}serializeValue(t){return!this.jsonValue&&(this.staticOptions.length>0||this.tags)?t.value:super.serializeValue(t)}setSelection(t){for(const e of this.staticOptions)if(this.getValue(e)===t)return void(0!==this.values.length&&this.values[0].value==""+t||this.setValues([e]))}handleClear(t){t.preventDefault(),t.stopPropagation(),this.setValues([]),this.visibleOptions.length>0&&(this.visibleOptions=[],this.requestUpdate()),this.fireCustomEvent($e.Selection,{selected:null})}setValues(t){const e=this.values;this.values=t,this.requestUpdate("values",e)}addValue(t){const e=[...this.values];this.values.push(t),this.requestUpdate("values",e)}removeValue(t){const e=[...this.values],i=this.values.indexOf(t);i>-1&&this.values.splice(i,1),this.requestUpdate("values",e)}popValue(){const t=[...this.values];this.values.pop(),this.requestUpdate("values",t)}clear(){const t=this.values;this.values=[],this.requestUpdate("values",t)}render(){const t=0===this.values.length?this.placeholder:"",e=V`
|
|
922
922
|
<div class="placeholder">${t}</div>
|
|
923
|
-
`,i=this.clearable&&this.values.length>0&&!this.multi?
|
|
923
|
+
`,i=this.clearable&&this.values.length>0&&!this.multi?V`<temba-icon
|
|
924
924
|
name="${ge.select_clear}"
|
|
925
925
|
size="1.1"
|
|
926
926
|
class="clear-button"
|
|
927
927
|
@click=${this.handleClear}
|
|
928
|
-
/>`:null,o=Zt({multi:this.multi,single:!this.multi,searchable:this.searchable,empty:0===this.values.length,options:this.visibleOptions.length>0,focused:this.focused,"search-input":this.input.length>0,"no-search-input":0===this.input.length,[this.flavor]:null!==this.flavor,disabled:this.disabled}),n=this.anchorPosition?{top:"0px",left:this.anchorPosition.left-10+"px"}:{},s=this.searchable?
|
|
928
|
+
/>`:null,o=Zt({multi:this.multi,single:!this.multi,searchable:this.searchable,empty:0===this.values.length,options:this.visibleOptions.length>0,focused:this.focused,"search-input":this.input.length>0,"no-search-input":0===this.input.length,[this.flavor]:null!==this.flavor,disabled:this.disabled}),n=this.anchorPosition?{top:"0px",left:this.anchorPosition.left-10+"px"}:{},s=this.searchable?V`
|
|
929
929
|
<div class="input-wrapper">
|
|
930
930
|
<input
|
|
931
931
|
class="searchbox"
|
|
@@ -939,7 +939,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
939
939
|
<div id="anchor" style=${Ae(n)}></div>
|
|
940
940
|
${e}
|
|
941
941
|
</div>
|
|
942
|
-
`:e;return
|
|
942
|
+
`:e;return V`
|
|
943
943
|
|
|
944
944
|
<temba-field
|
|
945
945
|
name=${this.name}
|
|
@@ -961,15 +961,15 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
961
961
|
<div class="left-side" >
|
|
962
962
|
<slot name="prefix"></slot>
|
|
963
963
|
<div class="selected" >
|
|
964
|
-
${this.resolving?
|
|
964
|
+
${this.resolving?V`<temba-loading
|
|
965
965
|
style="margin-left:1em"
|
|
966
966
|
></temba-loading>`:null}
|
|
967
967
|
${this.multi||this.resolving?null:s}
|
|
968
|
-
${this.values.map(((t,e)=>
|
|
968
|
+
${this.values.map(((t,e)=>V`
|
|
969
969
|
<div
|
|
970
970
|
class="selected-item ${e===this.selectedIndex?"focused":""}"
|
|
971
971
|
>
|
|
972
|
-
${this.multi?
|
|
972
|
+
${this.multi?V`
|
|
973
973
|
<div
|
|
974
974
|
class="remove-item"
|
|
975
975
|
style="margin-top:1px"
|
|
@@ -992,7 +992,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
992
992
|
${i}
|
|
993
993
|
|
|
994
994
|
<slot name="right"></slot>
|
|
995
|
-
${this.tags?null:
|
|
995
|
+
${this.tags?null:V`<div
|
|
996
996
|
class="right-side arrow"
|
|
997
997
|
style="display:block;margin-right:5px"
|
|
998
998
|
@click=${this.handleArrowClick}
|
|
@@ -1015,7 +1015,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1015
1015
|
.renderOptionDetail=${this.renderOptionDetail}
|
|
1016
1016
|
.renderOptionName=${this.renderOptionName}
|
|
1017
1017
|
.renderOption=${this.renderOption||this.renderOptionDefault}
|
|
1018
|
-
.anchorTo=${this.anchorElement}
|
|
1018
|
+
.anchorTo=${this.allowAnchor?this.anchorElement:null}
|
|
1019
1019
|
.options=${this.visibleOptions}
|
|
1020
1020
|
.spaceSelect=${this.spaceSelect}
|
|
1021
1021
|
.nameKey=${this.nameKey}
|
|
@@ -1028,22 +1028,22 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1028
1028
|
<temba-options
|
|
1029
1029
|
@temba-selection=${this.handleExpressionSelection}
|
|
1030
1030
|
@temba-canceled=${()=>{}}
|
|
1031
|
-
.anchorTo=${this.anchorExpressions}
|
|
1031
|
+
.anchorTo=${this.allowAnchor?this.anchorExpressions:null}
|
|
1032
1032
|
.options=${this.completionOptions}
|
|
1033
1033
|
.renderOption=${rl}
|
|
1034
1034
|
?visible=${this.completionOptions.length>0}
|
|
1035
1035
|
>
|
|
1036
|
-
${this.currentFunction?
|
|
1036
|
+
${this.currentFunction?V`
|
|
1037
1037
|
<div class="current-fn">
|
|
1038
1038
|
${rl(this.currentFunction,!0)}
|
|
1039
1039
|
</div>
|
|
1040
1040
|
`:null}
|
|
1041
|
-
${this.completionOptions.length>0?
|
|
1041
|
+
${this.completionOptions.length>0?V`<div class="footer">
|
|
1042
1042
|
${fr("Tab to complete, enter to select")}
|
|
1043
1043
|
</div>`:null}
|
|
1044
1044
|
</temba-options>
|
|
1045
1045
|
</temba-field>
|
|
1046
|
-
`}}t([ce({type:Object})],ul.prototype,"inputStyle",void 0),t([ce({type:Boolean})],ul.prototype,"multi",void 0),t([ce({type:Boolean})],ul.prototype,"searchOnFocus",void 0),t([ce({type:String})],ul.prototype,"placeholder",void 0),t([ce()],ul.prototype,"name",void 0),t([ce()],ul.prototype,"endpoint",void 0),t([ce({type:String})],ul.prototype,"nameKey",void 0),t([ce({type:String})],ul.prototype,"valueKey",void 0),t([ce({attribute:!1})],ul.prototype,"currentFunction",void 0),t([ce({type:String})],ul.prototype,"queryParam",void 0),t([ce({type:String})],ul.prototype,"input",void 0),t([ce({type:Array})],ul.prototype,"visibleOptions",void 0),t([ce({type:Array})],ul.prototype,"completionOptions",void 0),t([ce({type:Number})],ul.prototype,"quietMillis",void 0),t([ce({type:Boolean})],ul.prototype,"fetching",void 0),t([ce({type:Boolean})],ul.prototype,"resolving",void 0),t([ce({type:Boolean})],ul.prototype,"searchable",void 0),t([ce({type:String})],ul.prototype,"expressions",void 0),t([ce({type:Boolean})],ul.prototype,"cache",void 0),t([ce({type:String})],ul.prototype,"cacheKey",void 0),t([ce({type:Boolean})],ul.prototype,"focused",void 0),t([ce({type:Boolean})],ul.prototype,"disabled",void 0),t([ce({attribute:!1})],ul.prototype,"selectedIndex",void 0),t([ce({type:Number})],ul.prototype,"cursorIndex",void 0),t([ce({attribute:!1})],ul.prototype,"anchorElement",void 0),t([ce({attribute:!1})],ul.prototype,"anchorExpressions",void 0),t([ce({type:Object})],ul.prototype,"anchorPosition",void 0),t([ce({type:Boolean})],ul.prototype,"tags",void 0),t([ce({type:Boolean,attribute:"space_select"})],ul.prototype,"spaceSelect",void 0),t([ce({type:Boolean})],ul.prototype,"jsonValue",void 0),t([ce({type:Boolean})],ul.prototype,"hideErrors",void 0),t([ce({type:Boolean})],ul.prototype,"clearable",void 0),t([ce({type:Boolean})],ul.prototype,"sorted",void 0),t([ce({type:String})],ul.prototype,"flavor",void 0),t([ce({type:String,attribute:"info_text"})],ul.prototype,"infoText",void 0),t([ce({type:Array})],ul.prototype,"values",void 0),t([ce({type:Object})],ul.prototype,"selection",void 0),t([ce({attribute:!1})],ul.prototype,"getName",void 0),t([ce({attribute:!1})],ul.prototype,"isMatch",void 0),t([ce({attribute:!1})],ul.prototype,"getValue",void 0),t([ce({type:Number,attribute:"option-width"})],ul.prototype,"optionWidth",void 0),t([ce({type:Boolean,attribute:"anchor-right"})],ul.prototype,"anchorRight",void 0),t([ce({attribute:!1})],ul.prototype,"shouldExclude",void 0),t([ce({attribute:!1})],ul.prototype,"sortFunction",void 0),t([ce({attribute:!1})],ul.prototype,"renderOption",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionName",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1})],ul.prototype,"renderSelectedItem",void 0),t([ce({attribute:!1})],ul.prototype,"createArbitraryOption",void 0),t([ce({attribute:!1})],ul.prototype,"getOptions",void 0),t([ce({attribute:!1})],ul.prototype,"prepareOptions",void 0),t([ce({attribute:!1})],ul.prototype,"isComplete",void 0),t([ce({type:Array,attribute:"options"})],ul.prototype,"staticOptions",void 0);class pl extends me{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value="",this.autogrow=!1}static get styles(){return r`
|
|
1046
|
+
`}}t([ce({type:Object})],ul.prototype,"inputStyle",void 0),t([ce({type:Boolean})],ul.prototype,"multi",void 0),t([ce({type:Boolean})],ul.prototype,"searchOnFocus",void 0),t([ce({type:String})],ul.prototype,"placeholder",void 0),t([ce()],ul.prototype,"name",void 0),t([ce()],ul.prototype,"endpoint",void 0),t([ce({type:String})],ul.prototype,"nameKey",void 0),t([ce({type:String})],ul.prototype,"valueKey",void 0),t([ce({attribute:!1})],ul.prototype,"currentFunction",void 0),t([ce({type:String})],ul.prototype,"queryParam",void 0),t([ce({type:String})],ul.prototype,"input",void 0),t([ce({type:Array})],ul.prototype,"visibleOptions",void 0),t([ce({type:Array})],ul.prototype,"completionOptions",void 0),t([ce({type:Number})],ul.prototype,"quietMillis",void 0),t([ce({type:Boolean})],ul.prototype,"fetching",void 0),t([ce({type:Boolean})],ul.prototype,"resolving",void 0),t([ce({type:Boolean})],ul.prototype,"searchable",void 0),t([ce({type:String})],ul.prototype,"expressions",void 0),t([ce({type:Boolean})],ul.prototype,"cache",void 0),t([ce({type:String})],ul.prototype,"cacheKey",void 0),t([ce({type:Boolean})],ul.prototype,"focused",void 0),t([ce({type:Boolean})],ul.prototype,"disabled",void 0),t([ce({attribute:!1})],ul.prototype,"selectedIndex",void 0),t([ce({type:Number})],ul.prototype,"cursorIndex",void 0),t([ce({attribute:!1})],ul.prototype,"anchorElement",void 0),t([ce({attribute:!1})],ul.prototype,"anchorExpressions",void 0),t([ce({type:Object})],ul.prototype,"anchorPosition",void 0),t([ce({type:Boolean})],ul.prototype,"tags",void 0),t([ce({type:Boolean,attribute:"space_select"})],ul.prototype,"spaceSelect",void 0),t([ce({type:Boolean})],ul.prototype,"jsonValue",void 0),t([ce({type:Boolean})],ul.prototype,"hideErrors",void 0),t([ce({type:Boolean})],ul.prototype,"clearable",void 0),t([ce({type:Boolean})],ul.prototype,"sorted",void 0),t([ce({type:String})],ul.prototype,"flavor",void 0),t([ce({type:String,attribute:"info_text"})],ul.prototype,"infoText",void 0),t([ce({type:Array})],ul.prototype,"values",void 0),t([ce({type:Object})],ul.prototype,"selection",void 0),t([ce({attribute:!1})],ul.prototype,"getName",void 0),t([ce({attribute:!1})],ul.prototype,"isMatch",void 0),t([ce({attribute:!1})],ul.prototype,"getValue",void 0),t([ce({type:Number,attribute:"option-width"})],ul.prototype,"optionWidth",void 0),t([ce({type:Boolean,attribute:"anchor-right"})],ul.prototype,"anchorRight",void 0),t([ce({attribute:!1})],ul.prototype,"shouldExclude",void 0),t([ce({attribute:!1})],ul.prototype,"sortFunction",void 0),t([ce({attribute:!1})],ul.prototype,"renderOption",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionName",void 0),t([ce({attribute:!1})],ul.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1})],ul.prototype,"renderSelectedItem",void 0),t([ce({attribute:!1})],ul.prototype,"createArbitraryOption",void 0),t([ce({attribute:!1})],ul.prototype,"getOptions",void 0),t([ce({attribute:!1})],ul.prototype,"prepareOptions",void 0),t([ce({attribute:!1})],ul.prototype,"isComplete",void 0),t([ce({type:Array,attribute:"options"})],ul.prototype,"staticOptions",void 0),t([ce({type:Boolean})],ul.prototype,"allowAnchor",void 0);class pl extends me{constructor(){super(...arguments),this.submitOnEnter=!1,this.anchorPosition={left:0,top:0},this.placeholder="",this.options=[],this.name="",this.value="",this.autogrow=!1}static get styles(){return r`
|
|
1047
1047
|
:host {
|
|
1048
1048
|
display: block;
|
|
1049
1049
|
}
|
|
@@ -1098,7 +1098,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1098
1098
|
padding: 1px 5px;
|
|
1099
1099
|
border-radius: var(--curvature);
|
|
1100
1100
|
}
|
|
1101
|
-
`}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.disableCompletion&&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){if(this.disableCompletion)return;const e=document.querySelector("temba-store");if(!t.inputElement)return;const i=dl(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;cl(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}getTextInput(){return this.textInputElement}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}focus(){super.focus();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.focus()}render(){const t=this.anchorPosition?{top:`${this.anchorPosition.top}px`,left:`${this.anchorPosition.left}px`}:{},e=this.options&&this.options.length>0;return
|
|
1101
|
+
`}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.disableCompletion&&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){if(this.disableCompletion)return;const e=document.querySelector("temba-store");if(!t.inputElement)return;const i=dl(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;cl(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}getTextInput(){return this.textInputElement}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}focus(){super.focus();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.focus()}render(){const t=this.anchorPosition?{top:`${this.anchorPosition.top}px`,left:`${this.anchorPosition.left}px`}:{},e=this.options&&this.options.length>0;return V`
|
|
1102
1102
|
<temba-field
|
|
1103
1103
|
name=${this.name}
|
|
1104
1104
|
.label=${this.label}
|
|
@@ -1132,7 +1132,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1132
1132
|
.options=${this.options}
|
|
1133
1133
|
?visible=${e}
|
|
1134
1134
|
>
|
|
1135
|
-
${this.currentFunction?
|
|
1135
|
+
${this.currentFunction?V`
|
|
1136
1136
|
<div class="current-fn">
|
|
1137
1137
|
${rl(this.currentFunction,!0)}
|
|
1138
1138
|
</div>
|
|
@@ -1309,13 +1309,13 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1309
1309
|
flex-grow: 1;
|
|
1310
1310
|
text-align: right;
|
|
1311
1311
|
}
|
|
1312
|
-
`}constructor(){super(),this.size="medium",this.primaryButtonName="Ok",this.cancelButtonName="Cancel",this.width=null,this.submittingName="Saving",this.buttons=[],this.scrollOffset=0}firstUpdated(t){t.has("cancelButtonName")&&this.cancelButtonName&&this.buttons.push({name:this.cancelButtonName,type:gl.SECONDARY,closes:!0}),t.has("primaryButtonName")&&this.primaryButtonName&&this.buttons.push({name:this.primaryButtonName,type:gl.PRIMARY})}updated(t){if(t.has("open")){const e=document.querySelector("body");this.open?(this.animationEnd=!0,window.setTimeout((()=>{this.ready=!0,this.animationEnd=!1}),400),this.scrollOffset=-document.documentElement.scrollTop,e.style.position="fixed",e.style.overflowY="scroll",e.style.top=this.scrollOffset+"px",e.style.width="100%",e.style.overflowY="hidden"):(e.style.position="",e.style.overflowY="",e.style.width="",e.style.marginRight="",e.style.paddingRight="0px",window.scrollTo(0,-1*parseInt(this.scrollOffset||"0"))),this.open&&!t.get("open")?(this.shadowRoot.querySelectorAll("temba-button").forEach((t=>{t&&(t.submitting=!1)})),this.noFocus||this.focusFirstInput()):window.setTimeout((()=>{this.ready=!1}),400)}}focusFirstInput(){window.setTimeout((()=>{let t=this.querySelector('temba-textinput, temba-completion, input[type="text"], textarea');t&&(t=t.textInputElement||t.inputElement||t,t.readOnly||(t.focus(),t.click()))}),100)}handleClick(t){const e=t.currentTarget;if(!e.disabled){let t={};e.index>=0&&e.index<this.buttons.length&&(t=this.buttons[e.index]),this.fireCustomEvent($e.ButtonClicked,{button:e,detail:t}),(e.name===this.cancelButtonName||t&&t.closes)&&(this.open=!1)}}getDocumentHeight(){const t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}clickCancel(){const t=this.getCancelButton();t&&t.click()}getCancelButton(){return this.shadowRoot.querySelector(`temba-button[name='${this.cancelButtonName}']`)}getPrimaryButton(){return this.shadowRoot.querySelector("temba-button[primary]")}handleKeyUp(t){"Escape"===t.key&&this.clickCancel()}handleClickMask(t){if(this.hideOnClick){const e=t.target.id;"dialog-mask"!==e&&"dialog-bg"!==e||(this.fireCustomEvent($e.DialogHidden),this.clickCancel())}}show(){this.open=!0}hide(){this.open=!1}render(){const t={width:this.width,minWidth:"250px",maxWidth:"600px"};this.width||(t.width=fl.widths[this.size]),this.isMobile()&&(t.width="100%",t.height="100%",delete t.maxWidth);const e=this.header?
|
|
1312
|
+
`}constructor(){super(),this.size="medium",this.primaryButtonName="Ok",this.cancelButtonName="Cancel",this.width=null,this.submittingName="Saving",this.buttons=[],this.scrollOffset=0}firstUpdated(t){t.has("cancelButtonName")&&this.cancelButtonName&&this.buttons.push({name:this.cancelButtonName,type:gl.SECONDARY,closes:!0}),t.has("primaryButtonName")&&this.primaryButtonName&&this.buttons.push({name:this.primaryButtonName,type:gl.PRIMARY})}updated(t){if(t.has("open")){const e=document.querySelector("body");this.open?(this.animationEnd=!0,window.setTimeout((()=>{this.ready=!0,this.animationEnd=!1}),400),this.scrollOffset=-document.documentElement.scrollTop,e.style.position="fixed",e.style.overflowY="scroll",e.style.top=this.scrollOffset+"px",e.style.width="100%",e.style.overflowY="hidden"):(e.style.position="",e.style.overflowY="",e.style.width="",e.style.marginRight="",e.style.paddingRight="0px",window.scrollTo(0,-1*parseInt(this.scrollOffset||"0"))),this.open&&!t.get("open")?(this.shadowRoot.querySelectorAll("temba-button").forEach((t=>{t&&(t.submitting=!1)})),this.noFocus||this.focusFirstInput()):window.setTimeout((()=>{this.ready=!1}),400)}}focusFirstInput(){window.setTimeout((()=>{let t=this.querySelector('temba-textinput, temba-completion, input[type="text"], textarea');t&&(t=t.textInputElement||t.inputElement||t,t.readOnly||(t.focus(),t.click()))}),100)}handleClick(t){const e=t.currentTarget;if(!e.disabled){let t={};e.index>=0&&e.index<this.buttons.length&&(t=this.buttons[e.index]),this.fireCustomEvent($e.ButtonClicked,{button:e,detail:t}),(e.name===this.cancelButtonName||t&&t.closes)&&(this.open=!1)}}getDocumentHeight(){const t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}clickCancel(){const t=this.getCancelButton();t&&t.click()}getCancelButton(){return this.shadowRoot.querySelector(`temba-button[name='${this.cancelButtonName}']`)}getPrimaryButton(){return this.shadowRoot.querySelector("temba-button[primary]")}handleKeyUp(t){"Escape"===t.key&&this.clickCancel()}handleClickMask(t){if(this.hideOnClick){const e=t.target.id;"dialog-mask"!==e&&"dialog-bg"!==e||(this.fireCustomEvent($e.DialogHidden),this.clickCancel())}}show(){this.open=!0}hide(){this.open=!1}render(){const t={width:this.width,minWidth:"250px",maxWidth:"600px"};this.width||(t.width=fl.widths[this.size]),this.isMobile()&&(t.width="100%",t.height="100%",delete t.maxWidth);const e=this.header?V`
|
|
1313
1313
|
<div class="dialog-header">
|
|
1314
1314
|
<div class="header-text">
|
|
1315
1315
|
<div class="title">${this.header}</div>
|
|
1316
1316
|
</div>
|
|
1317
1317
|
</div>
|
|
1318
|
-
`:null;return
|
|
1318
|
+
`:null;return V`
|
|
1319
1319
|
<div
|
|
1320
1320
|
id="dialog-mask"
|
|
1321
1321
|
@click=${this.handleClickMask}
|
|
@@ -1339,7 +1339,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1339
1339
|
>
|
|
1340
1340
|
${e}
|
|
1341
1341
|
<div class="dialog-body" @keypress=${this.handleKeyUp}>
|
|
1342
|
-
${this.body?this.body:
|
|
1342
|
+
${this.body?this.body:V`<slot></slot>`}
|
|
1343
1343
|
<temba-loading units="6" size="8"></temba-loading>
|
|
1344
1344
|
</div>
|
|
1345
1345
|
|
|
@@ -1347,7 +1347,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1347
1347
|
<div class="flex-grow">
|
|
1348
1348
|
<slot name="gutter"></slot>
|
|
1349
1349
|
</div>
|
|
1350
|
-
${this.buttons.map(((t,e)=>
|
|
1350
|
+
${this.buttons.map(((t,e)=>V`
|
|
1351
1351
|
<temba-button
|
|
1352
1352
|
name=${t.name}
|
|
1353
1353
|
?destructive=${"primary"==t.type&&this.destructive}
|
|
@@ -1454,11 +1454,11 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1454
1454
|
flex-direction: row;
|
|
1455
1455
|
margin-left: 0.6em;
|
|
1456
1456
|
}
|
|
1457
|
-
`}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&(this.open?window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500):this.setBody(""))),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return
|
|
1457
|
+
`}handleSlotClicked(){this.open=!0}updated(t){if(super.updated(t),t.has("open")&&(this.open?this.fetchForm():void 0!==t.get("open")&&(this.open?window.setTimeout((()=>{this.body=this.getLoading(),this.submitting=!1}),500):this.setBody(""))),t.has("body")&&this.open&&this.body&&!this.fetching){this.shadowRoot.querySelector("temba-dialog").focusFirstInput()}}getLoading(){return V`<temba-loading units="6" size="8"></temba-loading>`}updatePrimaryButton(){const t=this.shadowRoot.querySelector("#wizard-form");t&&(this.wizardStep=parseInt(t.dataset.step),this.wizardStepCount=parseInt(t.dataset.steps)),this.noSubmit||this.updateComplete.then((()=>{const t=this.shadowRoot.querySelector("input[type='submit'],button[type='submit']");this.buttons=t?[{type:gl.SECONDARY,name:"Cancel",closes:!0},{type:gl.PRIMARY,name:t.value}]:[{type:gl.SECONDARY,name:"Ok",closes:!0}],this.submitting=!1}))}setBody(t){const e=this.shadowRoot.querySelector(".scripts");for(const t of e.children)t.remove();const i=this.ownerDocument.createElement("div");i.innerHTML=t;const o=i.getElementsByTagName("script"),n=[];for(let t=o.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=o[t].innerText;o[t].src&&-1===o[t].src.indexOf("web-dev-server")?(e.src=o[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},n.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),n.push(e)),o[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=Or(i.innerHTML)),this.updateComplete.then((()=>{for(const t of n)e.appendChild(t)})),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),Vt(this.endpoint,null,this.getHeaders()).then((t=>{0==t.body.indexOf("<!DOCTYPE HTML>")?(this.open=!1,document.location=t.url):(this.setBody(t.body),this.fetching=!1,this.updateComplete.then((()=>{this.updatePrimaryButton(),this.fireCustomEvent($e.Loaded,{body:this.getBody()})})))})).catch((t=>{this.fetching=!1,this.open=!1,this.fireCustomEvent($e.Error,{error:t})}))}submit(t={}){this.submitting=!0;const e=this.shadowRoot.querySelector("form");let i=e?function(t){const e=[];for(let i=0;i<t.elements.length;i++){const o=t.elements[i];if(o.name&&!o.disabled&&"file"!==o.type&&"reset"!==o.type&&"submit"!==o.type&&"button"!==o.type)if("select-multiple"===o.type)for(let t=0;t<o.options.length;t++)o.options[t].selected&&o.options[t].value&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(o.options[t].value));else if("checkbox"!==o.type&&"radio"!==o.type||o.checked){let t=o.value;!t&&o.checked&&(t="1"),t&&e.push(encodeURIComponent(o.name)+"="+encodeURIComponent(t))}}return e.join("&")}(e):"";t&&Object.keys(t).forEach((e=>{i+=(i.length>1?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t[e])})),Kt(this.endpoint,i,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("X-Temba-Success");if(!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e)"hide"===e?this.updateComplete.then((()=>{this.open=!1,this.fireCustomEvent($e.Submitted)})):(this.fireCustomEvent($e.Redirected,{url:e}),this.open=!1);else{if(0==t.body.indexOf("<!DOCTYPE HTML>"))return this.open=!1,void(document.location=t.url);this.setBody(t.body)&&this.updateComplete.then((()=>{this.updatePrimaryButton()}))}}),1e3)})).catch((t=>{console.error(t)}))}handleDialogClick(t){const e=t.detail.button,i=t.detail.detail;e.disabled||e.submitting||(e.primary||e.destructive)&&(this.suspendSubmit||this.submit()),i.closes&&(this.open=!1,this.fetching=!1,this.cancelName=void 0)}handleDialogHidden(){this.open=!1,this.fetching=!1}isDestructive(){return this.endpoint&&(this.endpoint.indexOf("delete")>-1||this.endpoint.indexOf("interrupt")>-1)}handleGotoStep(t){const e=t.target.dataset.gotoStep;e&&this.submit({wizard_goto_step:e})}getBody(){return this.shadowRoot.querySelector(".modax-body")}render(){const t=[],e=this.shadowRoot.querySelector("#wizard-form");if(e){const i=(e.getAttribute("data-completed")||"").split(",").filter((t=>t.length>0));for(let e=0;e<this.wizardStepCount;e++)t.push(V`<div
|
|
1458
1458
|
data-goto-step=${i[e]}
|
|
1459
1459
|
@click=${this.handleGotoStep.bind(this)}
|
|
1460
1460
|
class="${Zt({"step-ball":!0,active:this.wizardStep-1===e,complete:e<i.length})}"
|
|
1461
|
-
></div>`)}return
|
|
1461
|
+
></div>`)}return V`
|
|
1462
1462
|
<temba-dialog
|
|
1463
1463
|
.header=${this.header}
|
|
1464
1464
|
.buttons=${this.buttons}
|
|
@@ -1608,6 +1608,11 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1608
1608
|
background: transparent;
|
|
1609
1609
|
}
|
|
1610
1610
|
|
|
1611
|
+
.lined-button .button-mask {
|
|
1612
|
+
display: block;
|
|
1613
|
+
flex-grow: 1;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1611
1616
|
.lined-button .button-mask:hover {
|
|
1612
1617
|
background: rgba(0, 0, 0, 0.03);
|
|
1613
1618
|
}
|
|
@@ -1652,9 +1657,9 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1652
1657
|
margin-bottom: -3px;
|
|
1653
1658
|
line-height: normal;
|
|
1654
1659
|
}
|
|
1655
|
-
`}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation()),this.href&&!this.disabled&&(this.ownerDocument.location.href=this.href,t.preventDefault(),t.stopPropagation())}handleKeyUp(t){this.active=!1,"Enter"===t.key&&this.click()}handleMouseDown(){this.disabled||this.submitting||(this.active=!0,this.classList.add("active"))}handleMouseUp(){this.active=!1,this.classList.remove("active")}render(){const t=this.submitting?
|
|
1660
|
+
`}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation()),this.href&&!this.disabled&&(this.ownerDocument.location.href=this.href,t.preventDefault(),t.stopPropagation())}handleKeyUp(t){this.active=!1,"Enter"===t.key&&this.click()}handleMouseDown(){this.disabled||this.submitting||(this.active=!0,this.classList.add("active"))}handleMouseUp(){this.active=!1,this.classList.remove("active")}render(){const t=this.submitting?V`<div class="submit-animation">
|
|
1656
1661
|
<temba-loading units="3" size="8" color="#eee"></temba-loading>
|
|
1657
|
-
</div>`:this.name;return
|
|
1662
|
+
</div>`:this.name;return V`
|
|
1658
1663
|
<div
|
|
1659
1664
|
class="button-container
|
|
1660
1665
|
v-${this.v}
|
|
@@ -1667,7 +1672,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1667
1672
|
@click=${this.handleClick}
|
|
1668
1673
|
>
|
|
1669
1674
|
<div class="button-mask">
|
|
1670
|
-
${this.icon?
|
|
1675
|
+
${this.icon?V`<temba-icon name="${this.icon}"></temba-icon>`:null}
|
|
1671
1676
|
<div class="button-name"><slot name="name">${t}</slot></div>
|
|
1672
1677
|
</div>
|
|
1673
1678
|
</div>
|
|
@@ -1725,12 +1730,12 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1725
1730
|
opacity: var(--disabled-opacity) !important;
|
|
1726
1731
|
pointer-events: none !important;
|
|
1727
1732
|
}
|
|
1728
|
-
`}render(){const t=this.hideErrors?[]:(this.errors||[]).map((t=>
|
|
1733
|
+
`}render(){const t=this.hideErrors?[]:(this.errors||[]).map((t=>V` <div class="alert-error">${t}</div> `));return this.widgetOnly?V`
|
|
1729
1734
|
<div class="${this.disabled?"disabled":""}"><slot></slot></div>
|
|
1730
1735
|
${t}
|
|
1731
|
-
`:
|
|
1736
|
+
`:V`
|
|
1732
1737
|
<div class="field ${this.disabled?"disabled":""}">
|
|
1733
|
-
${this.name&&!this.hideLabel&&this.label?
|
|
1738
|
+
${this.name&&!this.hideLabel&&this.label?V`
|
|
1734
1739
|
<label class="control-label" for="${this.name}"
|
|
1735
1740
|
>${this.label}</label
|
|
1736
1741
|
>
|
|
@@ -1738,7 +1743,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1738
1743
|
<div class="widget">
|
|
1739
1744
|
<slot></slot>
|
|
1740
1745
|
</div>
|
|
1741
|
-
${this.helpText&&"None"!==this.helpText?
|
|
1746
|
+
${this.helpText&&"None"!==this.helpText?V`
|
|
1742
1747
|
<div class="help-text ${this.helpAlways?"help-always":null}">
|
|
1743
1748
|
${this.helpText}
|
|
1744
1749
|
</div>
|
|
@@ -1773,9 +1778,9 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1773
1778
|
opacity: 0.1;
|
|
1774
1779
|
}
|
|
1775
1780
|
}
|
|
1776
|
-
`}render(){const t=this.size/2;return
|
|
1781
|
+
`}render(){const t=this.size/2;return V`
|
|
1777
1782
|
<div class="loading-container" style="flex-direction:${this.direction}">
|
|
1778
|
-
${(e=0,i=this.units,Array.from({length:i-e},((t,i)=>i+e))).map((e=>{const i={"border-radius":this.square?"0":"50%",width:this.size+"px",height:this.size+"px",margin:t+"px",animationDelay:`-${1-e*(1/this.units)}s`,background:this.color};return
|
|
1783
|
+
${(e=0,i=this.units,Array.from({length:i-e},((t,i)=>i+e))).map((e=>{const i={"border-radius":this.square?"0":"50%",width:this.size+"px",height:this.size+"px",margin:t+"px",animationDelay:`-${1-e*(1/this.units)}s`,background:this.color};return V`
|
|
1779
1784
|
<div class="loading-unit" style=${Ae(i)}></div>
|
|
1780
1785
|
`}))}
|
|
1781
1786
|
</div>
|
|
@@ -1888,28 +1893,28 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
1888
1893
|
transform: scale(1);
|
|
1889
1894
|
visibility: visible;
|
|
1890
1895
|
}
|
|
1891
|
-
`}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=Tl(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const o of t)i=o,El.hasOwnProperty(i)||(e[o]=!0);var i;return Object.keys(e)})(this.text),this.count=this.text.length}render(){const t=this.text&&this.text.indexOf("@")>-1;let e=
|
|
1892
|
-
<b>${this.segments} messages</b> to send over SMS.`:
|
|
1893
|
-
message to send over SMS.`;let i=null;this.extended.length>0&&(this.segments>1||t)&&(i=this.extended.map((t=>
|
|
1896
|
+
`}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=Tl(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const o of t)i=o,El.hasOwnProperty(i)||(e[o]=!0);var i;return Object.keys(e)})(this.text),this.count=this.text.length}render(){const t=this.text&&this.text.indexOf("@")>-1;let e=V`.`;e=this.segments>1?V`and will use ${t?V`at least`:null}
|
|
1897
|
+
<b>${this.segments} messages</b> to send over SMS.`:V`and will use ${t?V`at least`:null} one
|
|
1898
|
+
message to send over SMS.`;let i=null;this.extended.length>0&&(this.segments>1||t)&&(i=this.extended.map((t=>V`<div class="extended-char">${t}</div>`)),i=V`
|
|
1894
1899
|
<div class="extended-warning">
|
|
1895
1900
|
Some characters require more space over SMS. To save on fees, consider
|
|
1896
1901
|
replacing them.
|
|
1897
1902
|
<div class="extended">${i}</div>
|
|
1898
1903
|
</div>
|
|
1899
|
-
`);const o=this.count>1?
|
|
1904
|
+
`);const o=this.count>1?V` <div class="summary">
|
|
1900
1905
|
This message is <b>${this.count} characters</b>
|
|
1901
1906
|
${e} ${i}
|
|
1902
|
-
${t?
|
|
1907
|
+
${t?V`
|
|
1903
1908
|
<div class="fine-print">
|
|
1904
1909
|
<div class="note">NOTE</div>
|
|
1905
1910
|
Using variables may result in more messages when sending
|
|
1906
1911
|
over SMS than this estimate.
|
|
1907
1912
|
</div>
|
|
1908
1913
|
`:null}
|
|
1909
|
-
</div>`:null;return
|
|
1910
|
-
/ ${this.segments}${t?
|
|
1914
|
+
</div>`:null;return V`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?V`<div class="segments">
|
|
1915
|
+
/ ${this.segments}${t?V`+`:null}
|
|
1911
1916
|
<div></div>
|
|
1912
|
-
</div>`:null}</div> ${o}</div></div>`}}t([ce({type:String})],$l.prototype,"text",void 0),t([ce({type:Number})],$l.prototype,"count",void 0),t([ce({type:Number,attribute:!1})],$l.prototype,"segments",void 0),t([ce({type:Object,attribute:!1})],$l.prototype,"extended",void 0);class Ol extends pe{constructor(){super(...arguments),this.showLoading=!1,this.dirty=!1}markDirty(){this.dirty=!0,this.store.markDirty(this),this.fireCustomEvent($e.DetailsChanged,{dirty:!0})}markClean(){this.dirty=!1,this.store.markClean(this),this.fireCustomEvent($e.DetailsChanged,{dirty:!1})}handleStoreUpdated(t){this.storeUpdated(t)}storeUpdated(t){}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.store&&this.store.addEventListener($e.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&(this.store.removeEventListener($e.StoreUpdated,this.handleStoreUpdated),this.store.markClean(this))}render(){if(!this.store.ready&&this.showLoading)return
|
|
1917
|
+
</div>`:null}</div> ${o}</div></div>`}}t([ce({type:String})],$l.prototype,"text",void 0),t([ce({type:Number})],$l.prototype,"count",void 0),t([ce({type:Number,attribute:!1})],$l.prototype,"segments",void 0),t([ce({type:Object,attribute:!1})],$l.prototype,"extended",void 0);class Ol extends pe{constructor(){super(...arguments),this.showLoading=!1,this.dirty=!1}markDirty(){this.dirty=!0,this.store.markDirty(this),this.fireCustomEvent($e.DetailsChanged,{dirty:!0})}markClean(){this.dirty=!1,this.store.markClean(this),this.fireCustomEvent($e.DetailsChanged,{dirty:!1})}handleStoreUpdated(t){this.storeUpdated(t)}storeUpdated(t){}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.store&&this.store.addEventListener($e.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&(this.store.removeEventListener($e.StoreUpdated,this.handleStoreUpdated),this.store.markClean(this))}render(){if(!this.store.ready&&this.showLoading)return V`<temba-loading></temba-loading>`}}t([ce({type:String})],Ol.prototype,"url",void 0),t([ce({type:Boolean})],Ol.prototype,"showLoading",void 0),t([ce({type:Boolean})],Ol.prototype,"dirty",void 0),t([ce({type:String})],Ol.prototype,"dirtyMessage",void 0);class zl extends Ol{constructor(){super(...arguments),this.showLoading=!1}connectedCallback(){super.connectedCallback(),this.prepareData=this.prepareData.bind(this)}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}storeUpdated(t){if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent($e.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)}}t([ce({type:String})],zl.prototype,"url",void 0),t([ce({type:Boolean})],zl.prototype,"showLoading",void 0),t([ce({type:Object,attribute:!1})],zl.prototype,"data",void 0);class Ll extends zl{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}postChanges(t){return this.store.removeFromCache(`${this.endpoint}${this.contact}`),this.store.postJSON(`${this.endpoint}${this.contact}`,t).then((t=>{this.setContact(t.json)}))}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([ce({type:String})],Ll.prototype,"contact",void 0),t([ce({type:Object,attribute:!1})],Ll.prototype,"data",void 0),t([ce({type:String})],Ll.prototype,"endpoint",void 0);let Ml=[];const Il=(t,e,i,o=void 0,n=void 0)=>new Promise((t=>{const s=new AbortController;Ml.push(s);let r=e;o&&(r+=`&before=${o}`),n&&(r+=`&after=${n}`),i&&(r+=`&ticket=${i}`);const a=document.querySelector("temba-store");Vt(r,s).then((e=>{Ml=Ml.filter((t=>e.controller===t));const i=e.json;a.resolveUsers(i.events,["created_by"]).then((()=>{t(i)}))})).catch((()=>{}))})),Dl=t=>t?t.name?t.name:t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody",Pl=36e5;var Nl;!function(t){t.Inline="inline",t.Error="error",t.Collapse="collapse",t.Note="note",t.MsgIn="msg_in",t.MsgOut="msg_out"}(Nl||(Nl={}));const Bl={hour:"numeric",minute:"2-digit"},Rl={weekday:void 0,year:void 0,month:"short",day:"numeric",hour:"numeric",minute:"2-digit"};class ql extends pe{constructor(){super(...arguments),this.messageGroups=[],this.fetching=!1,this.hideTopScroll=!0,this.hideBottomScroll=!0,this.defaultAvatar=yr,this.agent=!1,this.msgMap=new Map}static get styles(){return r`
|
|
1913
1918
|
:host {
|
|
1914
1919
|
display: flex;
|
|
1915
1920
|
flex-direction: column;
|
|
@@ -2081,6 +2086,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2081
2086
|
word-break: break-word;
|
|
2082
2087
|
}
|
|
2083
2088
|
|
|
2089
|
+
.message-text {
|
|
2090
|
+
white-space: pre-line;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2084
2093
|
.chat {
|
|
2085
2094
|
width: 28rem;
|
|
2086
2095
|
border-radius: var(--curvature);
|
|
@@ -2347,21 +2356,21 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2347
2356
|
opacity: 1;
|
|
2348
2357
|
transition-delay: 1s;
|
|
2349
2358
|
}
|
|
2350
|
-
`}firstUpdated(t){super.firstUpdated(t);const e=this.shadowRoot.querySelector(".scroll"),i=e.scrollHeight>e.clientHeight;this.hideBottomScroll=!0,this.hideTopScroll=!i}addMessages(t,e=null,i=!1){t.forEach((t=>{t.id||(t.id=(t=>t.split("").reduce(((t,e)=>0|(t<<5)-t+e.charCodeAt(0)),0))(t.text)+"_"+t.date.toISOString())})),e||(e=new Date);const o=(new Date).getTime()-e.getTime();window.setTimeout((()=>{this.fetching=!1;const e=[];for(const i of t)this.addMessage(i)&&e.push(i.id);if(0===e.length)return;const o=this.shadowRoot.querySelector(".scroll"),n=o.scrollTop,s=this.groupMessages(e);this.insertGroups(s,i),window.setTimeout((()=>{o.scrollTop=n,this.fireCustomEvent($e.FetchComplete)}),100)}),0===this.messageGroups.length?0:Math.max(0,250-o))}addMessage(t){const e=!this.messageExists(t);return this.msgMap.set(t.id,t),e}messageExists(t){return this.msgMap.has(t.id)}isSameGroup(t,e){var i,o;return!(!t||!e)&&(t.type===e.type&&(null===(i=t.user)||void 0===i?void 0:i.name)===(null===(o=e.user)||void 0===o?void 0:o.name)&&Math.abs(t.date.getTime()-e.date.getTime())<Pl)}insertGroups(t,e=!1){e||t.reverse();for(const i of t){const t=this.messageGroups[e?0:this.messageGroups.length-1];if(t){const o=t[t.length-1],n=this.msgMap.get(o),s=this.msgMap.get(i[0]);this.isSameGroup(n,s)?t.push(...i):e?this.messageGroups.splice(0,0,i):this.messageGroups.push(i)}else e?this.messageGroups.splice(0,0,i):this.messageGroups.push(i)}this.requestUpdate("messageGroups")}groupMessages(t){const e=[];let i=[],o=null;for(const n of t){const t=this.msgMap.get(n);this.isSameGroup(t,o)||(i=[],e.push(i)),i.push(n),o=t}return e}handleScroll(t){const e=t.target,i=e.scrollHeight-e.clientHeight,o=Math.round(i+e.scrollTop)/i;this.hideTopScroll=o<=.01,this.hideBottomScroll=o>=.99,o<.05&&this.fireCustomEvent($e.ScrollThreshold)}scrollToBottom(){const t=this.shadowRoot.querySelector(".scroll");t&&(t.scrollTop=t.scrollHeight,this.hideBottomScroll=!0)}renderMessageGroup(t,e,i){var o,n,s;const r=new Date,a=e===i.length-1;let l;if(e>0){const t=i[e-1];t&&t.length>0&&(l=this.msgMap.get(t[0]))}const h=t[t.length-1],c=this.msgMap.get(h);let d=null;l&&!this.isSameGroup(l,c)&&(Math.abs(c.date.getTime()-l.date.getTime())>Pl||e===i.length-1)&&(d=r.getDate()!==l.date.getDate()||l.date.getDate()!==c.date.getDate()?
|
|
2359
|
+
`}firstUpdated(t){super.firstUpdated(t);const e=this.shadowRoot.querySelector(".scroll"),i=e.scrollHeight>e.clientHeight;this.hideBottomScroll=!0,this.hideTopScroll=!i}addMessages(t,e=null,i=!1){t.forEach((t=>{t.id||(t.id=(t=>t.split("").reduce(((t,e)=>0|(t<<5)-t+e.charCodeAt(0)),0))(t.text)+"_"+t.date.toISOString())})),e||(e=new Date);const o=(new Date).getTime()-e.getTime();window.setTimeout((()=>{this.fetching=!1;const e=[];for(const i of t)this.addMessage(i)&&e.push(i.id);if(0===e.length)return;const o=this.shadowRoot.querySelector(".scroll"),n=o.scrollTop,s=this.groupMessages(e);this.insertGroups(s,i),window.setTimeout((()=>{o.scrollTop=n,this.fireCustomEvent($e.FetchComplete)}),100)}),0===this.messageGroups.length?0:Math.max(0,250-o))}addMessage(t){const e=!this.messageExists(t);return this.msgMap.set(t.id,t),e}messageExists(t){return this.msgMap.has(t.id)}isSameGroup(t,e){var i,o;return!(!t||!e)&&(t.type===e.type&&(null===(i=t.user)||void 0===i?void 0:i.name)===(null===(o=e.user)||void 0===o?void 0:o.name)&&Math.abs(t.date.getTime()-e.date.getTime())<Pl)}insertGroups(t,e=!1){e||t.reverse();for(const i of t){const t=this.messageGroups[e?0:this.messageGroups.length-1];if(t){const o=t[t.length-1],n=this.msgMap.get(o),s=this.msgMap.get(i[0]);this.isSameGroup(n,s)?t.push(...i):e?this.messageGroups.splice(0,0,i):this.messageGroups.push(i)}else e?this.messageGroups.splice(0,0,i):this.messageGroups.push(i)}this.requestUpdate("messageGroups")}groupMessages(t){const e=[];let i=[],o=null;for(const n of t){const t=this.msgMap.get(n);this.isSameGroup(t,o)||(i=[],e.push(i)),i.push(n),o=t}return e}handleScroll(t){const e=t.target,i=e.scrollHeight-e.clientHeight,o=Math.round(i+e.scrollTop)/i;this.hideTopScroll=o<=.01,this.hideBottomScroll=o>=.99,o<.05&&this.fireCustomEvent($e.ScrollThreshold)}scrollToBottom(){const t=this.shadowRoot.querySelector(".scroll");t&&(t.scrollTop=t.scrollHeight,this.hideBottomScroll=!0)}renderMessageGroup(t,e,i){var o,n,s;const r=new Date,a=e===i.length-1;let l;if(e>0){const t=i[e-1];t&&t.length>0&&(l=this.msgMap.get(t[0]))}const h=t[t.length-1],c=this.msgMap.get(h);let d=null;l&&!this.isSameGroup(l,c)&&(Math.abs(c.date.getTime()-l.date.getTime())>Pl||e===i.length-1)&&(d=r.getDate()!==l.date.getDate()||l.date.getDate()!==c.date.getDate()?V`<div class="time ${a?"first":""}">
|
|
2351
2360
|
${l.date.toLocaleTimeString(void 0,Rl)}
|
|
2352
|
-
</div>`:
|
|
2361
|
+
</div>`:V`<div class="time ${a?"first":""}">
|
|
2353
2362
|
${l.date.toLocaleTimeString(void 0,Bl)}
|
|
2354
|
-
</div>`);const u=this.agent?"msg_in"!==c.type:"msg_in"===c.type,p=null===(o=c.user)||void 0===o?void 0:o.name,m=null===(n=c.user)||void 0===n?void 0:n.email,g=("note"===c.type||"msg_in"===c.type||"msg_out"===c.type)&&this.agent||!u;return
|
|
2363
|
+
</div>`);const u=this.agent?"msg_in"!==c.type:"msg_in"===c.type,p=null===(o=c.user)||void 0===o?void 0:o.name,m=null===(n=c.user)||void 0===n?void 0:n.email,g=("note"===c.type||"msg_in"===c.type||"msg_out"===c.type)&&this.agent||!u;return V`
|
|
2355
2364
|
${a?null:d}
|
|
2356
2365
|
<div
|
|
2357
2366
|
class="block ${u?"incoming":"outgoing"} ${c.type}"
|
|
2358
2367
|
>
|
|
2359
2368
|
<div class="group-messages" style="flex-grow:1">
|
|
2360
|
-
${t.map(((t,e)=>{const i=this.msgMap.get(t);return
|
|
2369
|
+
${t.map(((t,e)=>{const i=this.msgMap.get(t);return V`<div class="row message">
|
|
2361
2370
|
${this.renderMessage(i,0==e?p:null)}
|
|
2362
2371
|
</div>`}))}
|
|
2363
2372
|
</div>
|
|
2364
|
-
${g?
|
|
2373
|
+
${g?V`<div class="avatar" style="align-self:flex-end">
|
|
2365
2374
|
<temba-user
|
|
2366
2375
|
email=${m}
|
|
2367
2376
|
name=${p}
|
|
@@ -2372,37 +2381,37 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2372
2381
|
</div>`:null}
|
|
2373
2382
|
</div>
|
|
2374
2383
|
${a?d:null}
|
|
2375
|
-
`}renderMessage(t,e=null){if(t.type===Nl.Error||t.type===Nl.Collapse||t.type===Nl.Inline)return
|
|
2384
|
+
`}renderMessage(t,e=null){if(t.type===Nl.Error||t.type===Nl.Collapse||t.type===Nl.Inline)return V`<div class="event">${ol(t.text)}</div>`;const i=t;return V`
|
|
2376
2385
|
<div class="bubble-wrap ${i.sendError?"error":""}">
|
|
2377
|
-
${i.popup?
|
|
2386
|
+
${i.popup?V`<div class="popup">
|
|
2378
2387
|
${i.popup}
|
|
2379
2388
|
<div class="arrow">▼</div>
|
|
2380
2389
|
</div>`:null}
|
|
2381
2390
|
|
|
2382
|
-
${i.text?
|
|
2391
|
+
${i.text?V`
|
|
2383
2392
|
<div class="bubble">
|
|
2384
|
-
${e?
|
|
2385
|
-
<div class="message">${i.text}</div>
|
|
2393
|
+
${e?V`<div class="name">${e}</div>`:null}
|
|
2394
|
+
<div class="message message-text">${i.text}</div>
|
|
2386
2395
|
|
|
2387
2396
|
<!--div>${i.date.toLocaleDateString(void 0,Rl)}</div-->
|
|
2388
2397
|
</div>
|
|
2389
2398
|
`:null}
|
|
2390
2399
|
|
|
2391
2400
|
<div class="attachments">
|
|
2392
|
-
${(i.attachments||[]).map((t=>
|
|
2401
|
+
${(i.attachments||[]).map((t=>V`<temba-thumbnail
|
|
2393
2402
|
attachment="${t}"
|
|
2394
2403
|
></temba-thumbnail>`))}
|
|
2395
2404
|
</div>
|
|
2396
2405
|
</div>
|
|
2397
2406
|
</div>
|
|
2398
|
-
`}reset(){this.msgMap.clear(),this.messageGroups=[],this.hideBottomScroll=!0,this.hideTopScroll=!0}render(){return
|
|
2407
|
+
`}reset(){this.msgMap.clear(),this.messageGroups=[],this.hideBottomScroll=!0,this.hideTopScroll=!0}render(){return V` <div
|
|
2399
2408
|
class="
|
|
2400
2409
|
messages
|
|
2401
2410
|
${this.hideBottomScroll?"scroll-at-bottom":""}
|
|
2402
2411
|
${this.hideTopScroll?"scroll-at-top":""}"
|
|
2403
2412
|
>
|
|
2404
2413
|
<div class="scroll" @scroll=${this.handleScroll}>
|
|
2405
|
-
${this.messageGroups?this.messageGroups.map(((t,e,i)=>
|
|
2414
|
+
${this.messageGroups?this.messageGroups.map(((t,e,i)=>V`${this.renderMessageGroup(t,e,i)}`)):null}
|
|
2406
2415
|
|
|
2407
2416
|
<temba-loading
|
|
2408
2417
|
class="${this.fetching?"":"hidden"}"
|
|
@@ -2410,7 +2419,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2410
2419
|
</div>
|
|
2411
2420
|
<slot class="header" name="header"></slot>
|
|
2412
2421
|
<slot class="footer" name="footer"></slot>
|
|
2413
|
-
</div>`}}var Fl;t([ce({type:Array})],ql.prototype,"messageGroups",void 0),t([ce({type:Boolean})],ql.prototype,"fetching",void 0),t([ce({type:Boolean,attribute:!1})],ql.prototype,"hideTopScroll",void 0),t([ce({type:Boolean,attribute:!1})],ql.prototype,"hideBottomScroll",void 0),t([ce({type:String,attribute:"avatar"})],ql.prototype,"defaultAvatar",void 0),t([ce({type:Boolean})],ql.prototype,"agent",void 0),function(t){t.send="send-03",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder"}(Fl||(Fl={}));var Ul;!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.TICKET_TOPIC_CHANGED="ticket_topic_changed",t.OPTIN_REQUESTED="optin_requested",t.ERROR="error",t.FAILURE="failure"}(Ul||(Ul={}));const
|
|
2422
|
+
</div>`}}var Fl;t([ce({type:Array})],ql.prototype,"messageGroups",void 0),t([ce({type:Boolean})],ql.prototype,"fetching",void 0),t([ce({type:Boolean,attribute:!1})],ql.prototype,"hideTopScroll",void 0),t([ce({type:Boolean,attribute:!1})],ql.prototype,"hideBottomScroll",void 0),t([ce({type:String,attribute:"avatar"})],ql.prototype,"defaultAvatar",void 0),t([ce({type:Boolean})],ql.prototype,"agent",void 0),function(t){t.send="send-03",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder"}(Fl||(Fl={}));var Ul;!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.TICKET_TOPIC_CHANGED="ticket_topic_changed",t.OPTIN_REQUESTED="optin_requested",t.ERROR="error",t.FAILURE="failure"}(Ul||(Ul={}));const jl=(t,e,i)=>{if(1===i.length)return`${t} **${i[0].name}**`;{const t=i.map((t=>`**${t.name}**`));if(2===t.length)return`${e} ${t.join(" and ")}`;{const i=t.pop();return`${e} ${t.join(", ")}, and ${i}`}}},Vl=t=>{var e,i;return"mt_miss"===t.event.type?"Missed outgoing call":"mo_miss"===t.event.type?"Missed incoming call":"new_conversation"===t.event.type?"Started conversation":"welcome_message"===t.channel_event_type?"Welcome Message Sent":"referral"===t.event.type?"Referred":"follow"===t.event.type?"Followed":"stop_contact"===t.event.type?"Stopped":"mt_call"===t.event.type?"Outgoing Phone Call":"mo_call"==t.event.type?"Incoming Phone call":"optin"==t.event.type?`Opted in to **${null===(e=t.event.optin)||void 0===e?void 0:e.name}**`:"optout"==t.event.type?`Opted out of **${null===(i=t.event.optin)||void 0===i?void 0:i.name}**`:void 0},Zl=t=>{let e="Interrupted";return"I"!==t.status&&(e=t.type===Ul.FLOW_ENTERED?"Started":"Completed"),`${e} [**${t.flow.name}**](/flow/editor/${t.flow.uuid}/)`},Hl=t=>{if(!t.name.startsWith("_")&&t.value)return`Updated flow result **${t.name}** to **${t.value}**`},Wl=t=>t.value?`Updated **${t.field.name}** to **${t.value.text}**`:`Cleared **${t.field.name}**`,Gl=t=>`Updated **Contact Name** to **${t.name}**`,Yl=t=>`Updated **URNs** to ${((t,e,i="and")=>ie(t.map(e),i))(t.urns,(t=>`**${t.split(":")[1].split("?")[0]}**`))}`,Kl=t=>`Email sent to **${ie(t.to,"and")}** with subject **${t.subject}**`,Ql=t=>`Applied ${jl("label","labels",t.labels)}`,Jl=(t,e)=>t.created_by?`**${(t=>{if(t)return t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email})(t.created_by)}** ${e} a **[ticket](/ticket/all/closed/${t.ticket.uuid}/)**`:`A **[ticket](/ticket/all/closed/${t.ticket.uuid}/)** was **${e}**`,Xl=t=>t.assignee?t.assignee.id===t.created_by.id?`**${Dl(t.created_by)}** took this ticket`:`${Dl(t.created_by)} assigned this ticket to **${Dl(t.assignee)}**`:`**${Dl(t.created_by)}** unassigned this ticket`,th=t=>{const e=t;return e.groups_added?jl("Added to group","Added to groups",e.groups_added):e.groups_removed?jl("Removed from group","Removed from groups",e.groups_removed):void 0},eh=t=>`Campaign ${t.campaign.name}\n ${"S"===t.fired_result?"skipped":"triggered"}\n ${t.campaign_event.offset_display}\n ${t.campaign_event.relative_to.name}`,ih=t=>"success"===t.status?`Successfully called ${t.url}`:`Failed to call ${t.url}`,oh=t=>0===parseFloat(t.actual_amount)?"Airtime transfer failed":`Transferred **${t.actual_amount}** ${t.currency} of airtime`,nh=t=>`Language updated to **${t.language}**`,sh=t=>`Requested opt-in for ${t.optin.name}`;class rh extends Ll{static get styles(){return r`
|
|
2414
2423
|
:host {
|
|
2415
2424
|
flex-grow: 1;
|
|
2416
2425
|
display: flex;
|
|
@@ -2609,7 +2618,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2609
2618
|
temba-button {
|
|
2610
2619
|
--button-border: 1px solid #ddd;
|
|
2611
2620
|
}
|
|
2612
|
-
`}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.currentTicket=null,this.currentContact=null,this.agent="",this.blockFetching=!1,this.showInterrupt=!1,this.avatar=yr,this.ticket=null,this.lastEventTime=null,this.newestEventTime=null,this.refreshId=null,this.polling=!1}firstUpdated(t){super.firstUpdated(t)}connectedCallback(){super.connectedCallback(),this.chat=this.shadowRoot.querySelector("temba-chat")}disconnectedCallback(){super.disconnectedCallback(),this.refreshId&&clearInterval(this.refreshId)}updated(t){
|
|
2621
|
+
`}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.currentTicket=null,this.currentContact=null,this.agent="",this.blockFetching=!1,this.showInterrupt=!1,this.avatar=yr,this.ticket=null,this.lastEventTime=null,this.newestEventTime=null,this.refreshId=null,this.polling=!1}firstUpdated(t){super.firstUpdated(t)}connectedCallback(){super.connectedCallback(),this.chat=this.shadowRoot.querySelector("temba-chat")}disconnectedCallback(){super.disconnectedCallback(),this.refreshId&&clearInterval(this.refreshId)}updated(t){super.updated(t),(t.has("data")||t.has("currentContact"))&&(this.refreshId&&(clearTimeout(this.refreshId),this.refreshId=null),this.currentContact=this.data),t.has("currentContact")&&(this.chat=this.shadowRoot.querySelector("temba-chat"),this.reset(),this.fetchPreviousMessages())}reset(){this.chat&&this.chat.reset(),this.blockFetching=!1,this.ticket=null,this.lastEventTime=null,this.newestEventTime=null,this.refreshId=null,this.polling=!1,this.errorMessage=null;const t=this.shadowRoot.querySelector("temba-compose");t&&t.reset()}handleInterrupt(){this.fireCustomEvent($e.Interrupt,{contact:this.currentContact})}handleRetry(){this.shadowRoot.querySelector("temba-compose").triggerSend()}handleSend(t){this.errorMessage=null;const e=t.currentTarget,i=t.detail.langValues.und,o={contact:this.currentContact.uuid},n=i.text;n&&n.length>0&&(o.text=n);const s=i.attachments;if(s&&s.length>0){const t=s.map((t=>t.uuid));o.attachments=t}this.currentTicket&&(o.ticket=this.currentTicket.uuid);const r="Send failed, please try again.";Qt("/api/v2/messages.json",o).then((t=>{t.status<400?(this.checkForNewMessages(),e.reset(),this.fireCustomEvent($e.MessageSent,{msg:o})):this.errorMessage=r})).catch((()=>{this.errorMessage=r}))}getEndpoint(){return this.contact?`/contact/history/${this.contact}/?_format=json`:null}scheduleRefresh(){let t=(new Date).getTime()-this.newestEventTime/1e3-5e3;this.refreshId&&(clearTimeout(this.refreshId),this.refreshId=null),t=Math.min(t,15e3),t=Math.max(t,2e3),this.refreshId=setTimeout((()=>{this.checkForNewMessages()}),t)}getEventMessage(t){let e=null;switch(t.type){case Ul.ERROR:case Ul.FAILURE:e={type:Nl.Inline,text:`Error during flow: ${i=t.text,i.charAt(0).toUpperCase()+i.slice(1)}`};break;case Ul.TICKET_OPENED:e={type:Nl.Inline,text:Jl(t,"opened")};break;case Ul.TICKET_ASSIGNED:e={type:Nl.Inline,text:Xl(t)};break;case Ul.TICKET_REOPENED:e={type:Nl.Inline,text:Jl(t,"reopened")};break;case Ul.TICKET_CLOSED:e={type:Nl.Inline,text:Jl(t,"closed")};break;case Ul.TICKET_TOPIC_CHANGED:e={type:Nl.Inline,text:`Topic changed to **${t.topic.name}**`};break;case Ul.FLOW_ENTERED:case Ul.FLOW_EXITED:e={type:Nl.Inline,text:Zl(t)};break;case Ul.RUN_RESULT_CHANGED:e={type:Nl.Inline,text:Hl(t)};break;case Ul.CONTACT_FIELD_CHANGED:e={type:Nl.Inline,text:Wl(t)};break;case Ul.CONTACT_NAME_CHANGED:e={type:Nl.Inline,text:Gl(t)};break;case Ul.CONTACT_URNS_CHANGED:e={type:Nl.Inline,text:Yl(t)};break;case Ul.EMAIL_SENT:e={type:Nl.Inline,text:Kl(t)};break;case Ul.INPUT_LABELS_ADDED:e={type:Nl.Inline,text:Ql(t)};break;case Ul.CONTACT_GROUPS_CHANGED:e={type:Nl.Inline,text:th(t)};break;case Ul.WEBHOOK_CALLED:e={type:Nl.Inline,text:ih(t)};break;case Ul.AIRTIME_TRANSFERRED:e={type:Nl.Inline,text:oh(t)};break;case Ul.CALL_STARTED:e={type:Nl.Inline,text:"Call Started"};break;case Ul.CAMPAIGN_FIRED:e={type:Nl.Inline,text:eh(t)};break;case Ul.CHANNEL_EVENT:e={type:Nl.Inline,text:Vl(t)};break;case Ul.CONTACT_LANGUAGE_CHANGED:e={type:Nl.Inline,text:nh(t)};break;case Ul.OPTIN_REQUESTED:e={type:Nl.Inline,text:sh(t)}}var i;return e&&t.created_on?e.date=new Date(t.created_on):console.error("Unknown event type",t),e}getUserForEvent(t){let e=null;return"msg_received"===t.type?e={name:this.currentContact.name}:t.created_by&&(e={email:t.created_by.email,name:`${t.created_by.first_name} ${t.created_by.last_name}`.trim(),avatar:t.created_by.avatar}),e}createMessages(t){if(t.events){let e=[];return t.events.forEach((t=>{const i=1e3*new Date(t.created_on).getTime();if(i>this.newestEventTime&&(this.newestEventTime=i),"ticket_note_added"===t.type){const i=t;e.push({type:Nl.Note,id:t.created_on+t.type,user:this.getUserForEvent(i),date:new Date(i.created_on),text:i.note})}else if("ticket_opened"===t.type){const i=t;e.push({type:Nl.Note,id:t.created_on+t.type+"_note",user:this.getUserForEvent(i),date:new Date(i.created_on),text:i.note}),e.push(this.getEventMessage(t))}else if("msg_created"===t.type||"msg_received"===t.type||"broadcast_created"===t.type){const i=t;e.push({type:"msg_received"===i.type?"msg_in":"msg_out",id:i.msg.id+"",user:this.getUserForEvent(i),date:new Date(i.created_on),attachments:i.msg.attachments,text:i.msg.text,sendError:"E"===i.status||"F"===i.status,popup:V`<div
|
|
2613
2622
|
style="display: flex; flex-direction: row; align-items:center; justify-content: space-between;font-size:0.9em;line-height:1em;min-width:10em"
|
|
2614
2623
|
>
|
|
2615
2624
|
<div style="justify-content:left;text-align:left">
|
|
@@ -2618,10 +2627,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2618
2627
|
display="duration"
|
|
2619
2628
|
></temba-date>
|
|
2620
2629
|
|
|
2621
|
-
${i.optin?
|
|
2630
|
+
${i.optin?V`<div style="font-size:0.9em;color:#aaa">
|
|
2622
2631
|
${i.optin.name}
|
|
2623
2632
|
</div>`:null}
|
|
2624
|
-
${i.failed_reason_display?
|
|
2633
|
+
${i.failed_reason_display?V`
|
|
2625
2634
|
<div
|
|
2626
2635
|
style="margin-top:0.2em;margin-right: 0.5em;min-width:10em;max-width:15em;color:var(--color-error);font-size:0.9em"
|
|
2627
2636
|
>
|
|
@@ -2629,10 +2638,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2629
2638
|
</div>
|
|
2630
2639
|
`:null}
|
|
2631
2640
|
</div>
|
|
2632
|
-
${i.logs_url?
|
|
2641
|
+
${i.logs_url?V`<a style="margin-left:0.5em" href="${i.logs_url}"
|
|
2633
2642
|
><temba-icon name="log"></temba-icon
|
|
2634
2643
|
></a>`:null}
|
|
2635
|
-
</div> `})}else e.push(this.getEventMessage(t))})),e=e.filter((t=>!!t)),e}return[]}checkForNewMessages(){var t;if(this.polling)return;const e=this.chat,i=this;if(this.currentContact&&this.newestEventTime){this.polling=!0;const o=this.getEndpoint()
|
|
2644
|
+
</div> `})}else e.push(this.getEventMessage(t))})),e=e.filter((t=>!!t)),e}return[]}checkForNewMessages(){var t;if(this.polling)return;const e=this.chat,i=this;if(this.currentContact&&this.newestEventTime){this.polling=!0;const o=this.getEndpoint();if(!o)return;const n=this.currentContact.uuid;Il(0,o,null===(t=this.currentTicket)||void 0===t?void 0:t.uuid,null,this.newestEventTime).then((t=>{if(n===this.currentContact.uuid){this.lastEventTime=t.next_before;const o=this.createMessages(t);0===o.length&&(i.blockFetching=!0),o.reverse(),e.addMessages(o,null,!0)}this.polling=!1,this.scheduleRefresh()}))}}fetchPreviousMessages(){var t;const e=this.chat,i=this;if(e&&!e.fetching&&!i.blockFetching&&(e.fetching=!0,this.currentContact)){const o=this.getEndpoint();if(!o)return;Il(0,o,null===(t=this.currentTicket)||void 0===t?void 0:t.uuid,this.lastEventTime).then((t=>{this.lastEventTime=t.next_before;const o=this.createMessages(t);o.reverse(),0===o.length&&(i.blockFetching=!0),e.addMessages(o),this.scheduleRefresh()}))}}fetchComplete(){this.chat&&(this.chat.fetching=!1)}getTembaCompose(){return this.currentTicket?this.currentContact&&"active"!==this.currentContact.status||this.currentTicket.closed_on?null:this.getCompose():this.currentContact&&"active"!==this.currentContact.status?null:this.getCompose()}getCompose(){return V`<div class="border"></div>
|
|
2636
2645
|
<div class="compose">
|
|
2637
2646
|
<temba-compose
|
|
2638
2647
|
attachments
|
|
@@ -2643,21 +2652,21 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2643
2652
|
@temba-submitted=${this.handleSend.bind(this)}
|
|
2644
2653
|
>
|
|
2645
2654
|
</temba-compose>
|
|
2646
|
-
${this.errorMessage?
|
|
2655
|
+
${this.errorMessage?V` <div class="error-gutter">
|
|
2647
2656
|
<div class="error-message">${this.errorMessage}</div>
|
|
2648
2657
|
<temba-button
|
|
2649
2658
|
name="Retry"
|
|
2650
2659
|
@click=${this.handleRetry}
|
|
2651
2660
|
></temba-button>
|
|
2652
2661
|
</div>`:null}
|
|
2653
|
-
</div>`}handleAssignmentChanged(t){const e=t.currentTarget,i=e.values[0];this.assignTicket(i?i.email:null),e.blur()}handleTopicChanged(t){const e=t.target.values[0];this.currentTicket.topic.uuid!==e.uuid&&Qt("/api/v2/ticket_actions.json",{tickets:[this.currentTicket.uuid],action:"change_topic",topic:e.uuid}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}assignTicket(t){if(!(this.currentTicket.assignee&&this.currentTicket.assignee.email===t||null===this.currentTicket.assignee&&null===t))return Qt("/api/v2/ticket_actions.json",{tickets:[this.currentTicket.uuid],action:"assign",assignee:t}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)})),!0}refreshTicket(){this.currentTicket&&Wt(`/api/v2/tickets.json?uuid=${this.currentTicket.uuid}`).then((t=>{t.length>0&&(this.fireCustomEvent($e.TicketUpdated,{ticket:t[0],previous:this.currentTicket}),this.currentTicket=t[0])}))}handleReopen(){const t=this.currentTicket.uuid;Qt("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}handleClose(){const t=this.currentTicket.uuid;Qt("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}render(){const t=this.currentContact&&this.currentContact.flow,e=this.currentTicket,i=this.currentTicket&&this.currentTicket.closed_on;return
|
|
2654
|
-
${this.currentContact?
|
|
2662
|
+
</div>`}handleAssignmentChanged(t){const e=t.currentTarget,i=e.values[0];this.assignTicket(i?i.email:null),e.blur()}handleTopicChanged(t){const e=t.target.values[0];this.currentTicket.topic.uuid!==e.uuid&&Qt("/api/v2/ticket_actions.json",{tickets:[this.currentTicket.uuid],action:"change_topic",topic:e.uuid}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}assignTicket(t){if(!(this.currentTicket.assignee&&this.currentTicket.assignee.email===t||null===this.currentTicket.assignee&&null===t))return Qt("/api/v2/ticket_actions.json",{tickets:[this.currentTicket.uuid],action:"assign",assignee:t}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)})),!0}refreshTicket(){this.currentTicket&&Wt(`/api/v2/tickets.json?uuid=${this.currentTicket.uuid}`).then((t=>{this.store.resolveUsers(t,["assignee"]).then((()=>{t.length>0&&(this.fireCustomEvent($e.TicketUpdated,{ticket:t[0],previous:this.currentTicket}),this.currentTicket=t[0])}))}))}handleReopen(){const t=this.currentTicket.uuid;Qt("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}handleClose(){const t=this.currentTicket.uuid;Qt("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTicket()})).catch((t=>{console.error(t)}))}render(){const t=this.currentContact&&this.currentContact.flow,e=this.currentTicket,i=this.currentTicket&&this.currentTicket.closed_on;return V`<div class="chat-wrapper">
|
|
2663
|
+
${this.currentContact?V`<temba-chat
|
|
2655
2664
|
@temba-scroll-threshold=${this.fetchPreviousMessages}
|
|
2656
2665
|
@temba-fetch-complete=${this.fetchComplete}
|
|
2657
2666
|
avatar=${this.avatar}
|
|
2658
2667
|
agent
|
|
2659
2668
|
>
|
|
2660
|
-
${t?
|
|
2669
|
+
${t?V`
|
|
2661
2670
|
<div slot="footer" style="text-align:center;">
|
|
2662
2671
|
<div class="in-flow">
|
|
2663
2672
|
<div class="flow-name">
|
|
@@ -2670,7 +2679,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2670
2679
|
>
|
|
2671
2680
|
</div>
|
|
2672
2681
|
</div>
|
|
2673
|
-
${this.showInterrupt?
|
|
2682
|
+
${this.showInterrupt?V`<temba-button
|
|
2674
2683
|
class="interrupt-button"
|
|
2675
2684
|
destructive
|
|
2676
2685
|
small
|
|
@@ -2683,7 +2692,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2683
2692
|
`:null}
|
|
2684
2693
|
<div slot="footer"></div>
|
|
2685
2694
|
</temba-chat>
|
|
2686
|
-
${e?
|
|
2695
|
+
${e?V`<div class="in-ticket-wrapper">
|
|
2687
2696
|
<div class="in-ticket">
|
|
2688
2697
|
<temba-user-select
|
|
2689
2698
|
placeholder="Assign to.."
|
|
@@ -2705,12 +2714,12 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2705
2714
|
?disabled=${i}
|
|
2706
2715
|
></temba-select>
|
|
2707
2716
|
|
|
2708
|
-
${this.currentTicket.closed_on?
|
|
2717
|
+
${this.currentTicket.closed_on?V`
|
|
2709
2718
|
<temba-button
|
|
2710
2719
|
name="Reopen"
|
|
2711
2720
|
@click=${this.handleReopen}
|
|
2712
2721
|
></temba-button>
|
|
2713
|
-
`:
|
|
2722
|
+
`:V`
|
|
2714
2723
|
<temba-button
|
|
2715
2724
|
name="Close"
|
|
2716
2725
|
destructive
|
|
@@ -2726,7 +2735,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2726
2735
|
width: 100%;
|
|
2727
2736
|
flex-grow: 1;
|
|
2728
2737
|
}
|
|
2729
|
-
`}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.internalFocusDisabled=!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($e.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent($e.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected)),t.has("items")}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
|
|
2738
|
+
`}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.internalFocusDisabled=!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($e.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent($e.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected)),t.has("items")}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===e&&(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}sanitizeResults(t){return Promise.resolve(t)}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 Ht(this.getRefreshEndpoint(),t),o=await this.sanitizeResults(i.results),n=[...this.items];if(o){o.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=o;this.reverseRefresh&&(t=o.reverse());const i=[...t,...n],s=i[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=i[this.cursorIndex],o=this.getValue(e);if(o!==this.getValue(t)){const t=i.findIndex((t=>this.getValue(t)===o));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){const e=t.shadowRoot.querySelector(".option.focused");e&&e.scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=i}}catch(t){this.paused=!0}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,o=null,n=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await Ht(t,s),a=await this.sanitizeResults(r.results);this.sanitizeOption&&a.forEach(this.sanitizeOption),a&&(n=n.concat(a)),o=r.next,t=o,e--,i++}catch(t){return this.reset(),this.paused=!0,void(this.loading=!1)}this.nextPage=o}this.pages=i;const s=n[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s);const r=n[this.cursorIndex];if(!this.nextSelection&&this.selected&&r&&this.getValue(r)!==this.getValue(this.selected)){const t=n.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}if(this.items=n,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1!==this.cursorIndex||this.isMobile()||(this.cursorIndex=0),this.value)this.setSelection(this.value),this.value=null;else if(this.isMobile()&&!this.selected){this.cursorIndex=-1,this.value=null,this.selected=null;const t=new Event("change",{bubbles:!0});this.dispatchEvent(t)}return Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,Ht(this.nextPage).then((t=>{this.sanitizeResults(t.results).then((e=>{this.sanitizeOption&&e.forEach(this.sanitizeOption),this.items=[...this.items,...e],this.nextPage=t.next,this.pages++,this.loading=!1}))})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){let e=t.detail.index;const i=t.detail.selected;-1===e&&(e=0),this.selected=i,this.cursorIndex=e,t.stopPropagation(),t.preventDefault()}render(){return V`
|
|
2730
2739
|
${this.renderHeader()}
|
|
2731
2740
|
<temba-options
|
|
2732
2741
|
style="${this.getListStyle()}"
|
|
@@ -2747,7 +2756,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2747
2756
|
<slot></slot>
|
|
2748
2757
|
</temba-options>
|
|
2749
2758
|
${this.renderFooter()}
|
|
2750
|
-
`}}t([ce({type:Array,attribute:!1})],ah.prototype,"items",void 0),t([ce({type:Object,attribute:!1})],ah.prototype,"selected",void 0),t([ce({type:Number})],ah.prototype,"cursorIndex",void 0),t([ce({type:String})],ah.prototype,"endpoint",void 0),t([ce({type:String})],ah.prototype,"nextSelection",void 0),t([ce({type:Number})],ah.prototype,"tabIndex",void 0),t([ce({type:String})],ah.prototype,"valueKey",void 0),t([ce({type:String})],ah.prototype,"value",void 0),t([ce({type:Boolean})],ah.prototype,"loading",void 0),t([ce({type:Boolean})],ah.prototype,"collapsed",void 0),t([ce({type:Boolean})],ah.prototype,"hideShadow",void 0),t([ce({type:Boolean})],ah.prototype,"paused",void 0),t([ce({type:Boolean})],ah.prototype,"internalFocusDisabled",void 0),t([ce({attribute:!1})],ah.prototype,"getNextRefresh",void 0),t([ce({attribute:!1})],ah.prototype,"sanitizeOption",void 0),t([ce({attribute:!1})],ah.prototype,"renderOption",void 0),t([ce({attribute:!1})],ah.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1,type:Object})],ah.prototype,"mostRecentItem",void 0),t([ce({type:String})],ah.prototype,"refreshKey",void 0);class lh extends ah{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}sanitizeResults(t){return new Promise((e=>{const i=t;this.store.resolveUsers(i,["ticket.assignee"]).then((()=>{e(i)}))}))}constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>
|
|
2759
|
+
`}}t([ce({type:Array,attribute:!1})],ah.prototype,"items",void 0),t([ce({type:Object,attribute:!1})],ah.prototype,"selected",void 0),t([ce({type:Number})],ah.prototype,"cursorIndex",void 0),t([ce({type:String})],ah.prototype,"endpoint",void 0),t([ce({type:String})],ah.prototype,"nextSelection",void 0),t([ce({type:Number})],ah.prototype,"tabIndex",void 0),t([ce({type:String})],ah.prototype,"valueKey",void 0),t([ce({type:String})],ah.prototype,"value",void 0),t([ce({type:Boolean})],ah.prototype,"loading",void 0),t([ce({type:Boolean})],ah.prototype,"collapsed",void 0),t([ce({type:Boolean})],ah.prototype,"hideShadow",void 0),t([ce({type:Boolean})],ah.prototype,"paused",void 0),t([ce({type:Boolean})],ah.prototype,"internalFocusDisabled",void 0),t([ce({attribute:!1})],ah.prototype,"getNextRefresh",void 0),t([ce({attribute:!1})],ah.prototype,"sanitizeOption",void 0),t([ce({attribute:!1})],ah.prototype,"renderOption",void 0),t([ce({attribute:!1})],ah.prototype,"renderOptionDetail",void 0),t([ce({attribute:!1,type:Object})],ah.prototype,"mostRecentItem",void 0),t([ce({type:String})],ah.prototype,"refreshKey",void 0);class lh extends ah{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}sanitizeResults(t){return new Promise((e=>{const i=t;this.store.resolveUsers(i,["ticket.assignee"]).then((()=>{e(i)}))}))}constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>V`
|
|
2751
2760
|
<div
|
|
2752
2761
|
style="align-items:center; margin-top: 0.1em; margin-bottom: 0.1em"
|
|
2753
2762
|
>
|
|
@@ -2760,14 +2769,14 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2760
2769
|
>
|
|
2761
2770
|
${t.name}
|
|
2762
2771
|
</div>
|
|
2763
|
-
${t.ticket.closed_on?null:t.last_msg?
|
|
2772
|
+
${t.ticket.closed_on?null:t.last_msg?V`
|
|
2764
2773
|
<div
|
|
2765
2774
|
style="font-size: 0.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;"
|
|
2766
2775
|
>
|
|
2767
|
-
${"I"===t.last_msg.direction?
|
|
2776
|
+
${"I"===t.last_msg.direction?V`<div
|
|
2768
2777
|
style="border-radius:9999px; background:var(--color-primary-dark);width:6px;height:6px;display:inline-block;margin:0px 2px;margin-bottom:1px;"
|
|
2769
2778
|
></div>`:null}
|
|
2770
|
-
${t.last_msg.text?t.last_msg.text:t.last_msg.attachments?
|
|
2779
|
+
${t.last_msg.text?t.last_msg.text:t.last_msg.attachments?V`<div style="display:inline-block">
|
|
2771
2780
|
<div style="display:flex; margin-left:0.2em">
|
|
2772
2781
|
<temba-icon
|
|
2773
2782
|
name="${ge.attachment}"
|
|
@@ -2784,7 +2793,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2784
2793
|
style="margin-right: -5px; margin-top: 0px;display:flex;flex-direction:column;align-items:flex-end;max-width:60px;min-width:30px;border:0px solid green;text-align:right"
|
|
2785
2794
|
>
|
|
2786
2795
|
<div>
|
|
2787
|
-
${!t.ticket.closed_on&&t.ticket.assignee?
|
|
2796
|
+
${!t.ticket.closed_on&&t.ticket.assignee?V`<temba-user
|
|
2788
2797
|
name=${t.ticket.assignee.name}
|
|
2789
2798
|
email=${t.ticket.assignee.email}
|
|
2790
2799
|
avatar=${t.ticket.assignee.avatar}
|
|
@@ -2831,7 +2840,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
2831
2840
|
border: 1px solid var(--color-error);
|
|
2832
2841
|
border-left: 10px solid var(--color-error);
|
|
2833
2842
|
}
|
|
2834
|
-
`}render(){return
|
|
2843
|
+
`}render(){return V`
|
|
2835
2844
|
<div class="temba-alert temba-${this.level}"><slot></slot></div>
|
|
2836
2845
|
`}}t([ce({type:String})],dh.prototype,"level",void 0);class uh extends me{constructor(){super(...arguments),this.placeholder="",this.name="",this.query="",this.inactiveThreshold=1e3,this.inactiveDays=90,this.recipients=[],this.advanced=!1,this.refreshKey="0",this.exclusions={},this.initialized=!1}static get styles(){return r`
|
|
2837
2846
|
:host {
|
|
@@ -3034,7 +3043,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3034
3043
|
border: 1px solid var(--color-borders);
|
|
3035
3044
|
border-radius: var(--curvature);
|
|
3036
3045
|
}
|
|
3037
|
-
`}refresh(){this.advanced||this.recipients.length>0?this.refreshKey="requested_"+(new Date).getTime():(this.summary=null,this.fetching=!1,this.requestUpdate(),this.fireCustomEvent($e.ContentChanged,{reset:!0}))}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t),t.has("recipients")&&this.handleRecipientsChanged(),t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent($e.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3)))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Qt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,this.initialized=!0,(0!=this.recipients.length||this.advanced)&&(200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent($e.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent($e.ContentChanged,this.summary)))}))}}handleAdvancedToggle(t){var e;(e=t)&&(e.stopPropagation(),e.preventDefault()),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){this.endpoint&&(this.recipients&&("0"!==this.refreshKey||this.initialized)?this.refresh():this.initialized=!0)}handleActivityLevelChanged(t){const e=t.target.values[0];e&&this.exclusions.not_seen_since_days&&(this.exclusions.not_seen_since_days=parseInt(e.value),this.refresh())}handleActivityLabelClicked(t){if(t.target&&"TEMBA-CHECKBOX"!==t.target.tagName&&"TEMBA-SELECT"!==t.target.tagName&&!t.target.disabled){const e=t.currentTarget.querySelector("temba-checkbox");e.checked=!e.checked}}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;if("not_seen_since_days"===i.name&&o){const t=i.parentElement.querySelector("temba-select");o=t.values[0]?parseInt(t.values[0].value):this.exclusions[i.name]}o?this.exclusions[i.name]=o:delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.endpoint&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=
|
|
3046
|
+
`}refresh(){this.advanced||this.recipients.length>0?this.refreshKey="requested_"+(new Date).getTime():(this.summary=null,this.fetching=!1,this.requestUpdate(),this.fireCustomEvent($e.ContentChanged,{reset:!0}))}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t),t.has("recipients")&&this.handleRecipientsChanged(),t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent($e.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3)))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Qt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,this.initialized=!0,(0!=this.recipients.length||this.advanced)&&(200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent($e.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent($e.ContentChanged,this.summary)))}))}}handleAdvancedToggle(t){var e;(e=t)&&(e.stopPropagation(),e.preventDefault()),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){this.endpoint&&(this.recipients&&("0"!==this.refreshKey||this.initialized)?this.refresh():this.initialized=!0)}handleActivityLevelChanged(t){const e=t.target.values[0];e&&this.exclusions.not_seen_since_days&&(this.exclusions.not_seen_since_days=parseInt(e.value),this.refresh())}handleActivityLabelClicked(t){if(t.target&&"TEMBA-CHECKBOX"!==t.target.tagName&&"TEMBA-SELECT"!==t.target.tagName&&!t.target.disabled){const e=t.currentTarget.querySelector("temba-checkbox");e.checked=!e.checked}}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;if("not_seen_since_days"===i.name&&o){const t=i.parentElement.querySelector("temba-select");o=t.values[0]?parseInt(t.values[0].value):this.exclusions[i.name]}o?this.exclusions[i.name]=o:delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.endpoint&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=V`
|
|
3038
3047
|
<div class="result-count">
|
|
3039
3048
|
Found
|
|
3040
3049
|
<a
|
|
@@ -3055,11 +3064,11 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3055
3064
|
>
|
|
3056
3065
|
<div slot="name">
|
|
3057
3066
|
<div style="display: flex; align-items: center;">
|
|
3058
|
-
${this.advanced?
|
|
3067
|
+
${this.advanced?V` <temba-icon
|
|
3059
3068
|
name="reset"
|
|
3060
3069
|
style="margin-right:0.5em"
|
|
3061
3070
|
></temba-icon>
|
|
3062
|
-
Start Over`:
|
|
3071
|
+
Start Over`:V` <temba-icon
|
|
3063
3072
|
name="edit"
|
|
3064
3073
|
style="margin-right:0.5em"
|
|
3065
3074
|
></temba-icon>
|
|
@@ -3067,8 +3076,8 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3067
3076
|
</div>
|
|
3068
3077
|
</div>
|
|
3069
3078
|
</temba-button>
|
|
3070
|
-
`}const e=this.exclusions.not_seen_since_days;let i=null;return this.summary&&this.summary.blockers&&this.summary.blockers.length>0&&(i=
|
|
3071
|
-
${this.advanced?
|
|
3079
|
+
`}const e=this.exclusions.not_seen_since_days;let i=null;return this.summary&&this.summary.blockers&&this.summary.blockers.length>0&&(i=V`${this.summary.blockers.map((t=>V`<temba-alert level="error">${Or(t)}</temba-alert>`))}`),V`
|
|
3080
|
+
${this.advanced?V`<div class="query">
|
|
3072
3081
|
<temba-textinput
|
|
3073
3082
|
.label=${this.label}
|
|
3074
3083
|
.helpText=${this.helpText}
|
|
@@ -3083,7 +3092,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3083
3092
|
autogrow
|
|
3084
3093
|
>
|
|
3085
3094
|
</temba-textinput>
|
|
3086
|
-
</div>`:
|
|
3095
|
+
</div>`:V`<temba-omnibox
|
|
3087
3096
|
placeholder="Search for contacts or groups"
|
|
3088
3097
|
widget_only=""
|
|
3089
3098
|
groups=""
|
|
@@ -3099,7 +3108,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3099
3108
|
>
|
|
3100
3109
|
</temba-omnibox>
|
|
3101
3110
|
|
|
3102
|
-
${this.not_seen_since_days||this.in_a_flow||this.started_previously?
|
|
3111
|
+
${this.not_seen_since_days||this.in_a_flow||this.started_previously?V`
|
|
3103
3112
|
<div class="filters">
|
|
3104
3113
|
<div
|
|
3105
3114
|
style="display:flex;font-size:1em;margin-bottom:0.5em"
|
|
@@ -3109,13 +3118,13 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3109
3118
|
Only include contacts who...
|
|
3110
3119
|
</div>
|
|
3111
3120
|
</div>
|
|
3112
|
-
${this.in_a_flow?
|
|
3121
|
+
${this.in_a_flow?V`<temba-checkbox
|
|
3113
3122
|
name="in_a_flow"
|
|
3114
3123
|
label="${fr("Are not currently in a flow")}"
|
|
3115
3124
|
?checked=${this.exclusions.in_a_flow}
|
|
3116
3125
|
@change=${this.handleExclusionChanged}
|
|
3117
3126
|
></temba-checkbox>`:null}
|
|
3118
|
-
${this.not_seen_since_days?
|
|
3127
|
+
${this.not_seen_since_days?V`
|
|
3119
3128
|
<div
|
|
3120
3129
|
class="activity-select"
|
|
3121
3130
|
@click=${this.handleActivityLabelClicked}
|
|
@@ -3157,7 +3166,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3157
3166
|
<div></div>
|
|
3158
3167
|
</div>
|
|
3159
3168
|
`:null}
|
|
3160
|
-
${this.started_previously?
|
|
3169
|
+
${this.started_previously?V`<temba-checkbox
|
|
3161
3170
|
name="started_previously"
|
|
3162
3171
|
label="${fr("Have not started this flow in the last 90 days")}"
|
|
3163
3172
|
?checked=${this.exclusions.started_previously}
|
|
@@ -3173,7 +3182,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3173
3182
|
<div class="summary ${this.expanded?"expanded":""}">${t}</div>
|
|
3174
3183
|
</div>
|
|
3175
3184
|
${i}
|
|
3176
|
-
${!i&&this.summary&&this.summary.warnings?this.summary.warnings.map((t=>
|
|
3185
|
+
${!i&&this.summary&&this.summary.warnings?this.summary.warnings.map((t=>V`<temba-alert level="warning"
|
|
3177
3186
|
>${Or(t)}</temba-alert
|
|
3178
3187
|
>`)):""}
|
|
3179
3188
|
|
|
@@ -3270,7 +3279,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3270
3279
|
transform: rotate(360deg);
|
|
3271
3280
|
}
|
|
3272
3281
|
}
|
|
3273
|
-
`}constructor(){super(),this.size=1,this.animationDuration=200,this.src="",this.steps=2,this.easing="cubic-bezier(0.68, -0.55, 0.265, 1.55)"}firstUpdated(t){super.firstUpdated(t),t.has("animateChange")&&(t.has("animationDuration")||(this.animationDuration=this.steps*this.animationDuration),"spin"===this.animateChange&&(this.steps=3,this.animationDuration=400,this.easing="linear"))}handleClicked(){this.animateClick&&(this.animationStep=1)}updated(t){super.updated(t),t.has("animationStep")&&(this.lastName&&this.animationStep>=this.steps/2&&(this.lastName=null,this.requestUpdate()),setTimeout((()=>{this.animationStep>0&&this.animationStep<this.steps?this.animationStep++:this.animationStep=0}),this.animationDuration/this.steps)),t.has("name")&&this.animateChange&&(this.lastName=t.get("name"),this.lastName&&this.animateChange&&(this.animationStep=1))}render(){if(!this.name)return null;let t=this.lastName||this.name;return t=t.startsWith("channel_")&&!ge[t]?ge.channel_ex:ge[t.replace("icon.","")]||t,t||(t=this.id),
|
|
3282
|
+
`}constructor(){super(),this.size=1,this.animationDuration=200,this.src="",this.steps=2,this.easing="cubic-bezier(0.68, -0.55, 0.265, 1.55)"}firstUpdated(t){super.firstUpdated(t),t.has("animateChange")&&(t.has("animationDuration")||(this.animationDuration=this.steps*this.animationDuration),"spin"===this.animateChange&&(this.steps=3,this.animationDuration=400,this.easing="linear"))}handleClicked(){this.animateClick&&(this.animationStep=1)}updated(t){super.updated(t),t.has("animationStep")&&(this.lastName&&this.animationStep>=this.steps/2&&(this.lastName=null,this.requestUpdate()),setTimeout((()=>{this.animationStep>0&&this.animationStep<this.steps?this.animationStep++:this.animationStep=0}),this.animationDuration/this.steps)),t.has("name")&&this.animateChange&&(this.lastName=t.get("name"),this.lastName&&this.animateChange&&(this.animationStep=1))}render(){if(!this.name)return null;let t=this.lastName||this.name;return t=t.startsWith("channel_")&&!ge[t]?ge.channel_ex:ge[t.replace("icon.","")]||t,t||(t=this.id),V`
|
|
3274
3283
|
<div
|
|
3275
3284
|
@click=${this.handleClicked}
|
|
3276
3285
|
class="wrapper ${Zt({clickable:this.clickable,circled:this.circled,animate:!!this.animateChange||!!this.animateClick,"spin-forever":this.spin})}"
|
|
@@ -3285,7 +3294,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3285
3294
|
/>
|
|
3286
3295
|
</svg>
|
|
3287
3296
|
</div>
|
|
3288
|
-
`}}var mh;t([ce({type:String})],ph.prototype,"name",void 0),t([ce({type:String})],ph.prototype,"prefix",void 0),t([ce({type:String})],ph.prototype,"id",void 0),t([ce({type:Number})],ph.prototype,"size",void 0),t([ce({type:Boolean})],ph.prototype,"spin",void 0),t([ce({type:Boolean})],ph.prototype,"clickable",void 0),t([ce({type:Boolean})],ph.prototype,"circled",void 0),t([ce({type:String})],ph.prototype,"animateChange",void 0),t([ce({type:String})],ph.prototype,"animateClick",void 0),t([ce({type:Number})],ph.prototype,"animationDuration",void 0),t([ce({type:String})],ph.prototype,"src",void 0),t([ce({type:Number,attribute:!1})],ph.prototype,"steps",void 0),t([ce({type:Number,attribute:!1})],ph.prototype,"animationStep",void 0),t([ce({type:String})],ph.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact"}(mh||(mh={}));const gh={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class fh extends ul{constructor(){super(...arguments),this.valueKey="uuid",this.groups=!1,this.contacts=!1,this.placeholder="Select recipients",this.multi=!0,this.searchable=!0,this.searchOnFocus=!0,this.queryParam="search"}update(t){if(super.update(t),(t.has("groups")||t.has("contacts"))&&(this.groups||this.contacts)){let t="&types=";this.groups&&(t+="g"),this.contacts&&(t+="c"),this.endpoint=this.endpoint+t}}renderOptionDefault(t){return
|
|
3297
|
+
`}}var mh;t([ce({type:String})],ph.prototype,"name",void 0),t([ce({type:String})],ph.prototype,"prefix",void 0),t([ce({type:String})],ph.prototype,"id",void 0),t([ce({type:Number})],ph.prototype,"size",void 0),t([ce({type:Boolean})],ph.prototype,"spin",void 0),t([ce({type:Boolean})],ph.prototype,"clickable",void 0),t([ce({type:Boolean})],ph.prototype,"circled",void 0),t([ce({type:String})],ph.prototype,"animateChange",void 0),t([ce({type:String})],ph.prototype,"animateClick",void 0),t([ce({type:Number})],ph.prototype,"animationDuration",void 0),t([ce({type:String})],ph.prototype,"src",void 0),t([ce({type:Number,attribute:!1})],ph.prototype,"steps",void 0),t([ce({type:Number,attribute:!1})],ph.prototype,"animationStep",void 0),t([ce({type:String})],ph.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact"}(mh||(mh={}));const gh={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class fh extends ul{constructor(){super(...arguments),this.valueKey="uuid",this.groups=!1,this.contacts=!1,this.placeholder="Select recipients",this.multi=!0,this.searchable=!0,this.searchOnFocus=!0,this.queryParam="search"}update(t){if(super.update(t),(t.has("groups")||t.has("contacts"))&&(this.groups||this.contacts)){let t="&types=";this.groups&&(t+="g"),this.contacts&&(t+="c"),this.endpoint=this.endpoint+t}}renderOptionDefault(t){return V`
|
|
3289
3298
|
<div style="display:flex;">
|
|
3290
3299
|
<div style="margin-right: 8px">${this.getIcon(t)}</div>
|
|
3291
3300
|
<div style="flex: 1">${t.name}</div>
|
|
@@ -3295,9 +3304,9 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3295
3304
|
${this.getPostName(t)}
|
|
3296
3305
|
</div>
|
|
3297
3306
|
</div>
|
|
3298
|
-
`}getPostName(t){const e={...gh};return t.urn&&t.type===mh.Contact&&t.urn!==t.name?
|
|
3307
|
+
`}getPostName(t){const e={...gh};return t.urn&&t.type===mh.Contact&&t.urn!==t.name?V`<div style=${Ae(e)}>${t.urn}</div>`:t.type===mh.Group?V`
|
|
3299
3308
|
<div style=${Ae(e)}>${t.count.toLocaleString()}</div>
|
|
3300
|
-
`:null}renderSelectedItemDefault(t){return
|
|
3309
|
+
`:null}renderSelectedItemDefault(t){return V`
|
|
3301
3310
|
<div
|
|
3302
3311
|
style="flex:1 1 auto; display: flex; align-items: stretch; color: var(--color-text-dark); font-size: 12px;"
|
|
3303
3312
|
>
|
|
@@ -3316,7 +3325,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3316
3325
|
${this.getPostName(t)}
|
|
3317
3326
|
</div>
|
|
3318
3327
|
</div>
|
|
3319
|
-
`}getIcon(t){return t.type===mh.Group?
|
|
3328
|
+
`}getIcon(t){return t.type===mh.Group?V`<temba-icon name="${ge.group}"></temba-icon>`:t.type===mh.Contact?V`<temba-icon name="${ge.contact}"></temba-icon>`:void 0}}t([ce({type:String})],fh.prototype,"valueKey",void 0),t([ce({type:Boolean})],fh.prototype,"groups",void 0),t([ce({type:Boolean})],fh.prototype,"contacts",void 0),t([ce({type:String})],fh.prototype,"placeholder",void 0),t([ce({type:Boolean})],fh.prototype,"multi",void 0),t([ce({type:Boolean})],fh.prototype,"searchable",void 0),t([ce({type:Boolean})],fh.prototype,"searchOnFocus",void 0),t([ce({type:Boolean})],fh.prototype,"queryParam",void 0);const vh=(t,e)=>t.top+t.height/2-e.height/2,bh=(t,e)=>t.left+t.width/2-e.width/2;class yh extends pe{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return r`
|
|
3320
3329
|
.tip {
|
|
3321
3330
|
transition: opacity 200ms ease-in-out;
|
|
3322
3331
|
margin: 0px;
|
|
@@ -3368,7 +3377,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3368
3377
|
.▲ {
|
|
3369
3378
|
text-shadow: 0px -1px 1px rgba(0, 0, 0, 0.1);
|
|
3370
3379
|
}
|
|
3371
|
-
`}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=vh(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=vh(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=bh(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=bh(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=Zt({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return
|
|
3380
|
+
`}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=vh(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=vh(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=bh(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=bh(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=Zt({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return V`
|
|
3372
3381
|
<div
|
|
3373
3382
|
class="slot"
|
|
3374
3383
|
@click=${this.handleMouseLeave}
|
|
@@ -3912,11 +3921,6 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3912
3921
|
margin-right: 0.75em;
|
|
3913
3922
|
}
|
|
3914
3923
|
|
|
3915
|
-
temba-button[lined] {
|
|
3916
|
-
margin: 0.2em 0;
|
|
3917
|
-
display: block;
|
|
3918
|
-
}
|
|
3919
|
-
|
|
3920
3924
|
.expand-icon {
|
|
3921
3925
|
transform: rotate(180deg);
|
|
3922
3926
|
--icon-color: rgba(255, 255, 255, 0.5);
|
|
@@ -3978,27 +3982,38 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
3978
3982
|
.level-0 .icon-wrapper {
|
|
3979
3983
|
padding: 0.4em 0.9em;
|
|
3980
3984
|
}
|
|
3981
|
-
|
|
3985
|
+
|
|
3986
|
+
temba-workspace-select {
|
|
3987
|
+
margin: 0.2em;
|
|
3988
|
+
display: block;
|
|
3989
|
+
--options-shadow: none;
|
|
3990
|
+
--color-widget-border: transparent;
|
|
3991
|
+
--widget-box-shadow: none;
|
|
3992
|
+
}
|
|
3993
|
+
`}constructor(){super(),this.wraps=!1,this.selection=[],this.state={},this.refresh=te(this.doRefresh,200),this.renderMenuItem=(t,e=null)=>{if("divider"===t.type)return V`<div class="divider"></div>`;if("temba-workspace-select"===t.type)return V`<temba-workspace-select
|
|
3994
|
+
@change=${t=>{t.stopPropagation(),t.preventDefault()}}
|
|
3995
|
+
.values=${[JSON.parse(t.initial)]}
|
|
3996
|
+
></temba-workspace-select>`;if("temba-notification-list"===t.type)return V`<temba-notification-list
|
|
3982
3997
|
endpoint=${t.href}
|
|
3983
|
-
></temba-notification-list>`;if("space"===t.type)return
|
|
3998
|
+
></temba-notification-list>`;if("space"===t.type)return V`<div class="space"></div>`;if("section"===t.type||t.inline)return V`<div class="sub-section">${t.name}</div>`;if("modax-button"===t.type)return V`<temba-button
|
|
3984
3999
|
name=${t.name}
|
|
3985
4000
|
lined
|
|
3986
4001
|
icon=${t.icon}
|
|
3987
4002
|
@click=${e=>{this.handleItemClicked(e,t)}}
|
|
3988
|
-
/>`;const i=this.isSelected(t),o=i&&this.selection.length>t.level+1;let n=t.icon?
|
|
4003
|
+
/>`;const i=this.isSelected(t),o=i&&this.selection.length>t.level+1;let n=t.icon?V`<div class="icon-wrapper">
|
|
3989
4004
|
<temba-icon
|
|
3990
4005
|
size="${0===t.level?"1.5":"1"}"
|
|
3991
4006
|
name="${t.icon}"
|
|
3992
4007
|
></temba-icon
|
|
3993
|
-
>${t.bubble&&!t.count?
|
|
4008
|
+
>${t.bubble&&!t.count?V`<div
|
|
3994
4009
|
style="background-color: ${t.bubble}"
|
|
3995
4010
|
class="bubble"
|
|
3996
4011
|
></div>`:null}
|
|
3997
|
-
</div>`:null;const s=t.collapsed_icon?
|
|
4012
|
+
</div>`:null;const s=t.collapsed_icon?V`<temba-icon
|
|
3998
4013
|
size="${0===t.level?"1.5":"1"}"
|
|
3999
4014
|
name="${t.collapsed_icon}"
|
|
4000
4015
|
class="collapse-icon"
|
|
4001
|
-
></temba-icon>`:null,r=Zt({["menu-"+t.id]:!0,"child-selected":o,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,popup:t.popup,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!n&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id,"show-mobile":t.mobile});t.avatar&&(n=(t=>{t.position||(t.position="right");let e=t.name;t.user&&t.user.first_name&&t.user.last_name&&(e=`${t.user.first_name} ${t.user.last_name}`);let i="",o="";return t.user&&t.user.avatar?o=`url('${t.user.avatar}') center / contain no-repeat`:e&&(o=qt.hex(e),i=re(e)),
|
|
4016
|
+
></temba-icon>`:null,r=Zt({["menu-"+t.id]:!0,"child-selected":o,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,popup:t.popup,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!n&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id,"show-mobile":t.mobile});t.avatar&&(n=(t=>{t.position||(t.position="right");let e=t.name;t.user&&t.user.first_name&&t.user.last_name&&(e=`${t.user.first_name} ${t.user.last_name}`);let i="",o="";return t.user&&t.user.avatar?o=`url('${t.user.avatar}') center / contain no-repeat`:e&&(o=qt.hex(e),i=re(e)),V`
|
|
4002
4017
|
<div
|
|
4003
4018
|
style="display:flex; flex-direction: column; align-items:center;transform:scale(${t.scale||1});"
|
|
4004
4019
|
>
|
|
@@ -4018,17 +4033,17 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4018
4033
|
box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.1);
|
|
4019
4034
|
background:${o}"
|
|
4020
4035
|
>
|
|
4021
|
-
${i?
|
|
4036
|
+
${i?V` <div
|
|
4022
4037
|
style="border: 0px solid red; display:flex; flex-direction: column; align-items:center;flex-grow:1"
|
|
4023
4038
|
>
|
|
4024
4039
|
<div style="border:0px solid blue;">${i}</div>
|
|
4025
4040
|
</div>`:null}
|
|
4026
4041
|
</div>
|
|
4027
4042
|
</div>
|
|
4028
|
-
`})({name:t.avatar,scale:e?.9:1.2}),t.bubble&&(n=
|
|
4043
|
+
`})({name:t.avatar,scale:e?.9:1.2}),t.bubble&&(n=V`${n}${t.bubble?V`<div
|
|
4029
4044
|
style="background-color: ${t.bubble}"
|
|
4030
4045
|
class="bubble"
|
|
4031
|
-
></div>`:null}`),n=
|
|
4046
|
+
></div>`:null}`),n=V`<div style="position:relative; padding: 0em">${n}</div>`);const a=V`
|
|
4032
4047
|
<a
|
|
4033
4048
|
href=${ve(t.href?t.href:void 0)}
|
|
4034
4049
|
id="menu-${t.id}"
|
|
@@ -4037,9 +4052,9 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4037
4052
|
@mousedown=${()=>{t.level>0&&(this.pressedItem=t)}}
|
|
4038
4053
|
@mouseleave=${()=>{this.pressedItem=null}}
|
|
4039
4054
|
>
|
|
4040
|
-
${0===t.level?t.avatar?n:
|
|
4055
|
+
${0===t.level?t.avatar?n:V`<temba-tip style="display:flex;" text="${t.name}"
|
|
4041
4056
|
>${n}</temba-tip
|
|
4042
|
-
>`:
|
|
4057
|
+
>`:V`${n}${s}`}
|
|
4043
4058
|
|
|
4044
4059
|
<div class="details" style="flex-grow:1;display:flex">
|
|
4045
4060
|
<div
|
|
@@ -4048,28 +4063,28 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4048
4063
|
>
|
|
4049
4064
|
${t.name}
|
|
4050
4065
|
</div>
|
|
4051
|
-
${t.level>0?t.inline?
|
|
4066
|
+
${t.level>0?t.inline?V`<temba-icon
|
|
4052
4067
|
name="${i||o?ge.arrow_up:ge.arrow_down}"
|
|
4053
|
-
></temba-icon>`:
|
|
4068
|
+
></temba-icon>`:V`${t.count||0==t.count?V`
|
|
4054
4069
|
<div
|
|
4055
4070
|
class="count ${t.bubble?"bubble":""}"
|
|
4056
4071
|
style="background-color: ${t.bubble}"
|
|
4057
4072
|
>
|
|
4058
4073
|
${t.count.toLocaleString()}
|
|
4059
4074
|
</div>
|
|
4060
|
-
`:
|
|
4075
|
+
`:V`<div class="count"></div>`}`:null}
|
|
4061
4076
|
</div>
|
|
4062
4077
|
<div class="right"></div>
|
|
4063
4078
|
</a>
|
|
4064
|
-
`;return t.popup?
|
|
4079
|
+
`;return t.popup?V`
|
|
4065
4080
|
<temba-dropdown id="dd-${t.id}">
|
|
4066
4081
|
<div slot="toggle">${a}</div>
|
|
4067
4082
|
|
|
4068
4083
|
<div slot="dropdown">
|
|
4069
|
-
${(t.items||[]).map((e=>(e.level=t.level+1,
|
|
4084
|
+
${(t.items||[]).map((e=>(e.level=t.level+1,V`${this.renderMenuItem(e,t)}`)))}
|
|
4070
4085
|
</div>
|
|
4071
4086
|
</temba-dropdown>
|
|
4072
|
-
`:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=_h(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($e.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),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=Wt(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($e.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})).catch((t=>{this.fireCustomEvent($e.Error,{error:t})})))}handleItemClicked(t,e,i=null){const o=document.querySelector("temba-store");if(o){const t=o.getDirtyMessage();if(t&&!confirm(t))return;o.cleanAll()}if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if("modax-button"!==e.type){if(t&&t.metaKey&&e.href)return t.preventDefault(),t.stopPropagation(),void window.open(e.href,"_blank");if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger||e.event)this.fireCustomEvent($e.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($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}else this.fireCustomEvent($e.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,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=_h(i,t).item,!o)break;i=o.items}return o}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(!_h(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=_h(o.items,t).item,o?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=[],i=this.isMobile()?ge.menu:ge.menu_collapse;e.push(
|
|
4087
|
+
`:a},this.doRefresh=this.doRefresh.bind(this),this.addEventListener("blur",(()=>{this.shadowRoot.querySelectorAll("temba-list, temba-notification-list").forEach((t=>{t.scrollToTop()}))}))}setBubble(t,e){const i=_h(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($e.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),this.shadowRoot.querySelectorAll("temba-notification-list").forEach((t=>{t.refresh()}))}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=Wt(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($e.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})).catch((t=>{this.fireCustomEvent($e.Error,{error:t})})))}handleItemClicked(t,e,i=null){const o=document.querySelector("temba-store");if(o){const t=o.getDirtyMessage();if(t&&!confirm(t))return;o.cleanAll()}if(i&&i.popup){const o=this.shadowRoot.querySelector("temba-dropdown");return o&&o.blur(),void(t&&this.fireCustomEvent($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if("modax-button"!==e.type){if(t&&t.metaKey&&e.href)return t.preventDefault(),t.stopPropagation(),void window.open(e.href,"_blank");if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&!this.isMobile()&&(this.collapsed=!1),this.isMobile()&&(this.collapsed=!0),e.trigger||e.event)this.fireCustomEvent($e.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($e.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}else this.fireCustomEvent($e.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,o=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(o=_h(i,t).item,!o)break;i=o.items}return o}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(!_h(this.root.items,e[0]).item)return}const i=[];let o=this.root;for(;e.length>0;){const t=e.shift();t&&(o.items||(this.loadItems(o),await this.httpComplete),o=_h(o.items,t).item,o?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=[],i=this.isMobile()?ge.menu:ge.menu_collapse;e.push(V`<div class="level level-0 ${this.submenu?"hidden":""}">
|
|
4073
4088
|
<div class="top">
|
|
4074
4089
|
<div class="expand-icon" @click=${this.handleExpand}>
|
|
4075
4090
|
<temba-icon
|
|
@@ -4086,10 +4101,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4086
4101
|
<div class="empty"></div>
|
|
4087
4102
|
${t.filter((t=>!!t.bottom)).map((t=>this.renderMenuItem(t)))}
|
|
4088
4103
|
<div class="bottom"></div>
|
|
4089
|
-
</div>`),this.selection.forEach(((i,o)=>{const n=_h(t,i).item;let s=!1;if(n){t=n.items;const e=this.getMenuItemState(n.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>n.level+2&&(s=!1)}else t=null;const r=this.isMobile()?ge.close:ge.menu_collapse;t&&t.length>0&&!n.inline&&e.push(
|
|
4104
|
+
</div>`),this.selection.forEach(((i,o)=>{const n=_h(t,i).item;let s=!1;if(n){t=n.items;const e=this.getMenuItemState(n.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>n.level+2&&(s=!1)}else t=null;const r=this.isMobile()?ge.close:ge.menu_collapse;t&&t.length>0&&!n.inline&&e.push(V`<div
|
|
4090
4105
|
class="${Zt({level:!0,["level-"+(o+1)]:!0,collapsed:s})}"
|
|
4091
4106
|
>
|
|
4092
|
-
${this.submenu?null:
|
|
4107
|
+
${this.submenu?null:V`
|
|
4093
4108
|
<slot
|
|
4094
4109
|
class="${Zt({"show-header":n.show_header})}"
|
|
4095
4110
|
name="header"
|
|
@@ -4097,22 +4112,22 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4097
4112
|
<div class="section-header">
|
|
4098
4113
|
<div class="section">${n.name}</div>
|
|
4099
4114
|
|
|
4100
|
-
${0!=o||this.collapsed?null:
|
|
4115
|
+
${0!=o||this.collapsed?null:V`<temba-icon
|
|
4101
4116
|
name=${r}
|
|
4102
4117
|
size="1.5"
|
|
4103
4118
|
@click=${this.handleCollapse}
|
|
4104
4119
|
></temba-icon>`}
|
|
4105
4120
|
</div>
|
|
4106
4121
|
`}
|
|
4107
|
-
${t.map((t=>t.inline&&t.items?
|
|
4122
|
+
${t.map((t=>t.inline&&t.items?V`${this.renderMenuItem(t)}
|
|
4108
4123
|
<div class="inline-children">
|
|
4109
4124
|
${(t.items||[]).map((e=>this.renderMenuItem(e,t)))}
|
|
4110
4125
|
</div>`:this.renderMenuItem(t)))}
|
|
4111
|
-
</div>`)}));const o=
|
|
4126
|
+
</div>`)}));const o=V`<div
|
|
4112
4127
|
class="${Zt({root:!0,"fully-collapsed":this.collapsed,mobile:this.isMobile()})}"
|
|
4113
4128
|
>
|
|
4114
4129
|
${e}
|
|
4115
|
-
</div>`;return
|
|
4130
|
+
</div>`;return V`${o}`}}t([ce({type:Boolean})],xh.prototype,"wraps",void 0),t([ce({type:Boolean})],xh.prototype,"wait",void 0),t([ce({type:String})],xh.prototype,"endpoint",void 0),t([ce({type:String})],xh.prototype,"expanding",void 0),t([ce({type:String})],xh.prototype,"value",void 0),t([ce({type:String})],xh.prototype,"submenu",void 0),t([ce({type:Boolean})],xh.prototype,"collapsed",void 0),t([ce({type:Object})],xh.prototype,"pressedItem",void 0);class wh extends lt{static get styles(){return r`
|
|
4116
4131
|
:host {
|
|
4117
4132
|
color: var(--color-link-primary);
|
|
4118
4133
|
display: inline-block;
|
|
@@ -4122,7 +4137,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4122
4137
|
cursor: pointer;
|
|
4123
4138
|
text-decoration: underline;
|
|
4124
4139
|
}
|
|
4125
|
-
`}handleClick(t){window.goto(t)}render(){return
|
|
4140
|
+
`}handleClick(t){window.goto(t)}render(){return V`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([ce({type:String})],wh.prototype,"href",void 0);class kh extends pe{static get styles(){return r`
|
|
4126
4141
|
:host {
|
|
4127
4142
|
}
|
|
4128
4143
|
|
|
@@ -4151,7 +4166,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4151
4166
|
z-index: 2;
|
|
4152
4167
|
padding: 0;
|
|
4153
4168
|
opacity: 0;
|
|
4154
|
-
border-radius: var(--curvature);
|
|
4169
|
+
border-radius: calc(var(--curvature) * 1.5);
|
|
4155
4170
|
background: #fff;
|
|
4156
4171
|
transition: all calc(0.8 * var(--transition-speed)) var(--bounce);
|
|
4157
4172
|
user-select: none;
|
|
@@ -4203,8 +4218,8 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4203
4218
|
.right {
|
|
4204
4219
|
right: 0;
|
|
4205
4220
|
}
|
|
4206
|
-
`}constructor(){super(),this.open=!1,this.dormant=!0,this.arrowSize=8,this.margin=10,this.mask=!1,this.dropdownStyle={},this.arrowStyle={},this.calculatePosition=this.calculatePosition.bind(this)}firstUpdated(t){super.firstUpdated(t),this.resetBlurHandler()}resetBlurHandler(){const t=this.shadowRoot.querySelector(".dropdown");this.activeFocus&&this.activeFocus.removeEventListener("blur",this.blurHandler),this.activeFocus=t,this.blurHandler=this.handleBlur.bind(this),this.activeFocus.addEventListener("blur",this.blurHandler)}handleBlur(t){const e=t.relatedTarget;this.contains(e)?(e.addEventListener("blur",this.blurHandler),this.activeFocus=e):this.closeDropdown()}openDropdown(){this.open=!0,this.dormant=!1,this.resetBlurHandler();const t=this.shadowRoot.querySelector(".dropdown");t.focus(),t.click(),this.fireCustomEvent($e.Opened)}closeDropdown(){this.activeFocus.removeEventListener("blur",this.blurHandler),this.open=!1,this.resetBlurHandler(),window.setTimeout((()=>{this.dormant=!0}),250),this.blur()}updated(t){super.updated(t),t.has("open")&&(this.dropdownStyle={}),t.has("dropdownStyle")&&0===Object.keys(this.dropdownStyle).length&&this.calculatePosition()}calculatePosition(){const t=this.shadowRoot.querySelector(".dropdown"),e=this.querySelector('div[slot="toggle"]'),i=this.shadowRoot.querySelector(".arrow");let o=!1,n=!1;if(t&&e){const s=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=i.getBoundingClientRect();if(!e)return;const l={border:"1px solid rgba(0,0,0,0.1)",marginTop:"0.5em"};s.right>window.innerWidth&&(l.left=r.right-s.width+"px",delete l.right,n=!0),s.bottom>window.innerHeight&&(l.top=r.top-s.height+"px",l["margin-top"]="-0.5em",o=!0);const h={left:r.width/2-a.width/2+"px",borderWidth:this.arrowSize+"px",top:"-"+this.arrowSize+"px"};o&&(h.transform="rotate(180deg)",h.top="auto",h.bottom="-"+this.arrowSize+"px"),n&&(h.right=r.width/2-a.width/2+"px",delete h.left),this.arrowStyle=h,this.dropdownStyle=l}this.requestUpdate()}handleToggleClicked(t){t.preventDefault(),t.stopPropagation(),!this.open&&this.dormant&&this.openDropdown()}render(){return
|
|
4207
|
-
${this.mask?
|
|
4221
|
+
`}constructor(){super(),this.open=!1,this.dormant=!0,this.arrowSize=8,this.margin=10,this.mask=!1,this.dropdownStyle={},this.arrowStyle={},this.calculatePosition=this.calculatePosition.bind(this)}firstUpdated(t){super.firstUpdated(t),this.resetBlurHandler()}resetBlurHandler(){const t=this.shadowRoot.querySelector(".dropdown");this.activeFocus&&this.activeFocus.removeEventListener("blur",this.blurHandler),this.activeFocus=t,this.blurHandler=this.handleBlur.bind(this),this.activeFocus.addEventListener("blur",this.blurHandler)}handleBlur(t){const e=t.relatedTarget;this.contains(e)?(e.addEventListener("blur",this.blurHandler),this.activeFocus=e):this.closeDropdown()}openDropdown(){this.open=!0,this.dormant=!1,this.resetBlurHandler();const t=this.shadowRoot.querySelector(".dropdown");t.focus(),t.click(),this.fireCustomEvent($e.Opened)}closeDropdown(){this.activeFocus.removeEventListener("blur",this.blurHandler),this.open=!1,this.resetBlurHandler(),window.setTimeout((()=>{this.dormant=!0}),250),this.blur()}updated(t){super.updated(t),t.has("open")&&(this.dropdownStyle={}),t.has("dropdownStyle")&&0===Object.keys(this.dropdownStyle).length&&this.calculatePosition()}calculatePosition(){const t=this.shadowRoot.querySelector(".dropdown"),e=this.querySelector('div[slot="toggle"]'),i=this.shadowRoot.querySelector(".arrow");let o=!1,n=!1;if(t&&e){const s=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=i.getBoundingClientRect();if(!e)return;const l={border:"1px solid rgba(0,0,0,0.1)",marginTop:"0.5em"};s.right>window.innerWidth&&(l.left=r.right-s.width+"px",delete l.right,n=!0),s.bottom>window.innerHeight&&(l.top=r.top-s.height+"px",l["margin-top"]="-0.5em",o=!0);const h={left:r.width/2-a.width/2+"px",borderWidth:this.arrowSize+"px",top:"-"+this.arrowSize+"px"};o&&(h.transform="rotate(180deg)",h.top="auto",h.bottom="-"+this.arrowSize+"px"),n&&(h.right=r.width/2-a.width/2+"px",delete h.left),this.arrowStyle=h,this.dropdownStyle=l}this.requestUpdate()}handleToggleClicked(t){t.preventDefault(),t.stopPropagation(),!this.open&&this.dormant&&this.openDropdown()}render(){return V`
|
|
4222
|
+
${this.mask?V`<div class="mask ${this.open?"open":""}" />`:null}
|
|
4208
4223
|
|
|
4209
4224
|
<div
|
|
4210
4225
|
class="wrapper ${Zt({open:this.open})}"
|
|
@@ -4440,31 +4455,31 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4440
4455
|
.pane {
|
|
4441
4456
|
display: flex;
|
|
4442
4457
|
}
|
|
4443
|
-
`}handleTabClick(t){const e=parseInt(t.currentTarget.dataset.index);this.unselect&&this.index===e?this.index=-1:this.index=e,t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.options=t,this.index=0}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),t.has("options")&&this.options.forEach(((t,e)=>{t.selected=e==this.index})),t.has("index")&&this.options.length>=0&&this.index!==t.get("index")&&(this.options.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent($e.ContextChanged)),this.index>this.options.length){const t=this.options[this.index];if(t&&t.hidden)for(let t=0;t<this.options.length;t++){const e=this.options[t];if(e&&!e.hidden)return void(this.index=t)}}}focusTab(t){const e=this.options.findIndex((e=>e.name===t));if(e>=0)return this.index=e,this.getTab(e)}setTabDetails(t,e){if(t<this.options.length){const i=this.options[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.options[this.index]}getTab(t){return this.options[t]}handleTabContentChanged(){this.requestUpdate()}handleTabDetailsChanged(){this.requestUpdate()}render(){const t=this.options[this.index];return
|
|
4458
|
+
`}handleTabClick(t){const e=parseInt(t.currentTarget.dataset.index);this.unselect&&this.index===e?this.index=-1:this.index=e,t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.options=t,this.index=0}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),t.has("options")&&this.options.forEach(((t,e)=>{t.selected=e==this.index})),t.has("index")&&this.options.length>=0&&this.index!==t.get("index")&&(this.options.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent($e.ContextChanged)),this.index>this.options.length){const t=this.options[this.index];if(t&&t.hidden)for(let t=0;t<this.options.length;t++){const e=this.options[t];if(e&&!e.hidden)return void(this.index=t)}}}focusTab(t){const e=this.options.findIndex((e=>e.name===t));if(e>=0)return this.index=e,this.getTab(e)}setTabDetails(t,e){if(t<this.options.length){const i=this.options[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.options[this.index]}getTab(t){return this.options[t]}handleTabContentChanged(){this.requestUpdate()}handleTabDetailsChanged(){this.requestUpdate()}render(){const t=this.options[this.index];return V`
|
|
4444
4459
|
<div
|
|
4445
4460
|
class="${Zt({options:!0,collapses:this.collapses,embedded:this.embedded,focusedname:this.focusedName,unselect:this.unselect})}"
|
|
4446
4461
|
>
|
|
4447
|
-
${this.options.map(((t,e)=>
|
|
4462
|
+
${this.options.map(((t,e)=>V`
|
|
4448
4463
|
<div
|
|
4449
4464
|
@click=${this.handleTabClick}
|
|
4450
4465
|
data-index=${e}
|
|
4451
4466
|
class="${Zt({option:!0,first:0==e,selected:e==this.index,hidden:t.hidden,notify:t.notify,alert:t.alert,dirty:t.dirty})}"
|
|
4452
4467
|
style="${t.selectionColor&&e==this.index?`color:${t.selectionColor};--icon-color:${t.selectionColor};`:""} ${t.selectionBackground&&e==this.index?`background-color:${t.selectionBackground};`:""}"
|
|
4453
4468
|
>
|
|
4454
|
-
${t.icon?
|
|
4469
|
+
${t.icon?V`<temba-icon name=${t.icon} />`:null}
|
|
4455
4470
|
<div class="name">${t.name} ${t.dirty?" *":""}</div>
|
|
4456
|
-
${t.hasBadge()?
|
|
4471
|
+
${t.hasBadge()?V`
|
|
4457
4472
|
<div class="badge">
|
|
4458
|
-
${t.count>0&&!t.activity?
|
|
4473
|
+
${t.count>0&&!t.activity?V`<div class="count">
|
|
4459
4474
|
${t.activity?"":t.count.toLocaleString()}
|
|
4460
4475
|
</div>`:null}
|
|
4461
|
-
${t.activity&&t.count>0&&!t.dirty?
|
|
4476
|
+
${t.activity&&t.count>0&&!t.dirty?V`<div
|
|
4462
4477
|
class="dot"
|
|
4463
4478
|
style="background:${t.activityColor}"
|
|
4464
4479
|
></div>`:null}
|
|
4465
4480
|
</div>
|
|
4466
4481
|
`:null}
|
|
4467
|
-
${t.checked&&!t.alert?
|
|
4482
|
+
${t.checked&&!t.alert?V`<temba-icon class="check" name="check"></temba-icon>`:null}
|
|
4468
4483
|
</div>
|
|
4469
4484
|
`))}
|
|
4470
4485
|
|
|
@@ -4494,7 +4509,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4494
4509
|
flex-grow: 1;
|
|
4495
4510
|
pointer-events: auto;
|
|
4496
4511
|
}
|
|
4497
|
-
`}updated(t){super.updated(t),t.has("selected")&&this.classList.toggle("selected",this.selected)}hasBadge(){return this.count>0}handleDetailsChanged(t){"dirty"in t.detail&&(this.dirty=t.detail.dirty),"count"in t.detail&&(this.count=t.detail.count,this.hideEmpty&&(this.hidden=0===this.count))}render(){return
|
|
4512
|
+
`}updated(t){super.updated(t),t.has("selected")&&this.classList.toggle("selected",this.selected)}hasBadge(){return this.count>0}handleDetailsChanged(t){"dirty"in t.detail&&(this.dirty=t.detail.dirty),"count"in t.detail&&(this.count=t.detail.count,this.hideEmpty&&(this.hidden=0===this.count))}render(){return V`<slot
|
|
4498
4513
|
@temba-details-changed=${this.handleDetailsChanged}
|
|
4499
4514
|
class="${Zt({selected:this.selected})}"
|
|
4500
4515
|
></slot> `}}t([ce({type:String})],Sh.prototype,"name",void 0),t([ce({type:String})],Sh.prototype,"icon",void 0),t([ce({type:String})],Sh.prototype,"selectionColor",void 0),t([ce({type:String})],Sh.prototype,"selectionBackground",void 0),t([ce({type:String})],Sh.prototype,"borderColor",void 0),t([ce({type:String})],Sh.prototype,"activityColor",void 0),t([ce({type:Boolean})],Sh.prototype,"selected",void 0),t([ce({type:Boolean})],Sh.prototype,"notify",void 0),t([ce({type:Boolean})],Sh.prototype,"alert",void 0),t([ce({type:Boolean})],Sh.prototype,"hidden",void 0),t([ce({type:Boolean})],Sh.prototype,"hideEmpty",void 0),t([ce({type:Boolean})],Sh.prototype,"activity",void 0),t([ce({type:Number})],Sh.prototype,"count",void 0),t([ce({type:Boolean})],Sh.prototype,"checked",void 0),t([ce({type:Boolean})],Sh.prototype,"dirty",void 0);class Ch extends lt{static get styles(){return r`
|
|
@@ -4571,13 +4586,13 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4571
4586
|
.shadow {
|
|
4572
4587
|
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, 0.1);
|
|
4573
4588
|
}
|
|
4574
|
-
`}render(){const t={};return this.backgroundColor&&(t.background=this.backgroundColor),this.textColor&&(t.color=this.textColor,t["--icon-color"]=this.textColor),
|
|
4589
|
+
`}render(){const t={};return this.backgroundColor&&(t.background=this.backgroundColor),this.textColor&&(t.color=this.textColor,t["--icon-color"]=this.textColor),V`
|
|
4575
4590
|
<div
|
|
4576
4591
|
class="label ${Zt({clickable:this.clickable,primary:this.primary,secondary:this.secondary,tertiary:this.tertiary,shadow:this.shadow,danger:this.danger,dark:this.dark})}"
|
|
4577
4592
|
style=${Ae(t)}
|
|
4578
4593
|
>
|
|
4579
4594
|
<div class="mask">
|
|
4580
|
-
${this.icon?
|
|
4595
|
+
${this.icon?V`<temba-icon name=${this.icon} />`:null}
|
|
4581
4596
|
<slot></slot>
|
|
4582
4597
|
</div>
|
|
4583
4598
|
</div>
|
|
@@ -4600,7 +4615,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4600
4615
|
-webkit-line-clamp: 1;
|
|
4601
4616
|
text-overflow: ellipsis;
|
|
4602
4617
|
}
|
|
4603
|
-
`}render(){const t=this.urn?
|
|
4618
|
+
`}render(){const t=this.urn?V`<temba-urn size=${this.size} urn=${this.urn}></temba-urn>`:null;return V`
|
|
4604
4619
|
${t}
|
|
4605
4620
|
<div class="name">
|
|
4606
4621
|
${this.name?this.name:this.urn?this.urn.split(":")[1]:""}
|
|
@@ -4626,7 +4641,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4626
4641
|
box-shadow: none;
|
|
4627
4642
|
margin-right: 0.5em;
|
|
4628
4643
|
}
|
|
4629
|
-
`}render(){const t=this.scheme||this.urn.split(":")[0];return
|
|
4644
|
+
`}render(){const t=this.scheme||this.urn.split(":")[0];return V`
|
|
4630
4645
|
<img
|
|
4631
4646
|
class="urn ${this.size<20?"small":""}"
|
|
4632
4647
|
width="${this.size}em"
|
|
@@ -4690,7 +4705,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4690
4705
|
.disabled .toggle {
|
|
4691
4706
|
display: none;
|
|
4692
4707
|
}
|
|
4693
|
-
`}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&(Object.keys(this.data.fields).length<=10&&(this.showAll=!0),this.fireCustomEvent($e.DetailsChanged,{count:Object.values(this.data.fields).filter((t=>!!t)).length}))}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Qt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)})).catch((t=>{e.handleResponse(t)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return
|
|
4708
|
+
`}connectedCallback(){super.connectedCallback(),this.handleFieldChanged=this.handleFieldChanged.bind(this)}isAgent(){return"T"===this.role}updated(t){super.updated(t),t.has("data")&&(Object.keys(this.data.fields).length<=10&&(this.showAll=!0),this.fireCustomEvent($e.DetailsChanged,{count:Object.values(this.data.fields).filter((t=>!!t)).length}))}handleFieldChanged(t){const e=t.currentTarget,i=e.value;Qt("/api/v2/contacts.json?uuid="+this.data.uuid,{fields:{[e.key]:i}}).then((t=>{e.handleResponse(t),this.setContact(t.json)})).catch((t=>{e.handleResponse(t)}))}handleToggle(t){const e=t.currentTarget;this.showAll=e.checked}render(){if(this.data){const t=Object.entries(this.data.fields).sort(((t,e)=>{const[i]=t,[o]=e,n=this.store.getContactField(i),s=this.store.getContactField(o);if("ward"===n.type)return 1;if("ward"===s.type)return-1;if("district"===n.type&&"ward"!==s.type&&"district"!==s.type)return 1;if("district"===s.type&&"ward"!==n.type&&"district"!==n.type)return-1;if("state"===n.type&&"ward"!==s.type&&"district"!==s.type&&"state"!==s.type)return 1;if("state"===s.type&&"ward"!==n.type&&"district"!==n.type&&"state"!==n.type)return-1;if(n.featured&&!s.featured)return-1;if(s.featured&&!n.featured)return 1;const r=s.priority-n.priority;return 0!==r?r:i.localeCompare(o)}));if(0==t.length)return V`<slot name="empty"></slot>`;const e=t.map((t=>{const[e,i]=t,o=this.store.getContactField(e);return V`<temba-contact-field
|
|
4694
4709
|
class=${Zt({set:!!i,unset:!i,featured:o.featured})}
|
|
4695
4710
|
key=${o.key}
|
|
4696
4711
|
name=${o.label}
|
|
@@ -4699,10 +4714,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4699
4714
|
@change=${this.handleFieldChanged}
|
|
4700
4715
|
timezone=${this.timezone}
|
|
4701
4716
|
?disabled=${!!(this.isAgent()&&"view"===o.agent_access||this.disabled)}
|
|
4702
|
-
></temba-contact-field>`}));return
|
|
4717
|
+
></temba-contact-field>`}));return V`
|
|
4703
4718
|
<div class=${Zt({disabled:this.disabled})}>
|
|
4704
4719
|
<div class="fields ${this.showAll?"show-all":""}">${e}</div>
|
|
4705
|
-
${Object.keys(this.data.fields).length>=10?
|
|
4720
|
+
${Object.keys(this.data.fields).length>=10?V`<div class="toggle">
|
|
4706
4721
|
<div style="flex-grow: 1"></div>
|
|
4707
4722
|
<div>
|
|
4708
4723
|
<temba-checkbox
|
|
@@ -4975,7 +4990,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4975
4990
|
|
|
4976
4991
|
temba-option {
|
|
4977
4992
|
}
|
|
4978
|
-
`}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("icon-action"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent($e.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleResponse(t){200===t.status?(this.value=t.json.fields[this.key],this.status=Oh.Ready,this.dirty=!1):(this.status=Oh.Failure,this.dirty=!1)}handleSelectChange(t){const e=t.currentTarget;let i="";t.preventDefault(),t.stopPropagation(),e.values.length>0&&(i=e.values[0].path),i!==this.value&&(this.dirty=!0,this.status=Oh.Saving,this.value=i,this.fireEvent("change"))}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.dirty=!0,this.status=Oh.Saving,this.value=t.value,this.fireEvent("change"))}handleChange(t){t.preventDefault(),t.stopPropagation()}handleDateChange(t){t.preventDefault(),t.stopPropagation(),this.dirty=!0}handleInput(t){const e=t.currentTarget;"Enter"===t.key?(e.blur(),this.handleSubmit()):e.value!==this.value&&(this.dirty=!0)}getInputType(t){return"numeric"===t?Se.Number:Se.Text}renderDateField(t){return
|
|
4993
|
+
`}connectedCallback(){super.connectedCallback(),this.handleInput=this.handleInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}handleIconClick(t){const e=t.target.getAttribute("icon-action"),i=this.shadowRoot.querySelector("temba-textinput");"copy"===e&&navigator.clipboard&&(this.iconClass="clicked",navigator.clipboard.writeText(i.getDisplayValue()).then((()=>{window.setTimeout((()=>{this.iconClass=""}),300)}))),"search"===e&&this.fireCustomEvent($e.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleResponse(t){200===t.status?(this.value=t.json.fields[this.key],this.status=Oh.Ready,this.dirty=!1):(this.status=Oh.Failure,this.dirty=!1)}handleSelectChange(t){const e=t.currentTarget;let i="";t.preventDefault(),t.stopPropagation(),e.values.length>0&&(i=e.values[0].path),i!==this.value&&(this.dirty=!0,this.status=Oh.Saving,this.value=i,this.fireEvent("change"))}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.dirty=!0,this.status=Oh.Saving,this.value=t.value,this.fireEvent("change"))}handleChange(t){t.preventDefault(),t.stopPropagation()}handleDateChange(t){t.preventDefault(),t.stopPropagation(),this.dirty=!0}handleInput(t){const e=t.currentTarget;"Enter"===t.key?(e.blur(),this.handleSubmit()):e.value!==this.value&&(this.dirty=!0)}getInputType(t){return"numeric"===t?Se.Number:Se.Text}renderDateField(t){return V` <temba-datepicker
|
|
4979
4994
|
timezone=${this.timezone}
|
|
4980
4995
|
value="${this.value?this.value:""}"
|
|
4981
4996
|
@change=${this.handleDateChange}
|
|
@@ -4990,7 +5005,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
4990
5005
|
${t}
|
|
4991
5006
|
</div>
|
|
4992
5007
|
</div>
|
|
4993
|
-
</temba-datepicker>`}renderTextField(t){return
|
|
5008
|
+
</temba-datepicker>`}renderTextField(t){return V`
|
|
4994
5009
|
<temba-textinput
|
|
4995
5010
|
class="${this.status} ${this.dirty?"dirty":""}"
|
|
4996
5011
|
value="${this.value?this.value:""}"
|
|
@@ -5025,14 +5040,14 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5025
5040
|
</div>
|
|
5026
5041
|
</div>
|
|
5027
5042
|
</temba-textinput>
|
|
5028
|
-
`}getOptions(t){return t.json[0].children}renderSelectedLocation(t){return t?
|
|
5043
|
+
`}getOptions(t){return t.json[0].children}renderSelectedLocation(t){return t?V`
|
|
5029
5044
|
<div
|
|
5030
5045
|
class="selected-location"
|
|
5031
5046
|
style="display:flex;margin-top:1em;margin-left:0.1em"
|
|
5032
5047
|
>
|
|
5033
5048
|
<span>${t.path}</span>
|
|
5034
5049
|
</div>
|
|
5035
|
-
`:null}renderLocationField(t="state"){return
|
|
5050
|
+
`:null}renderLocationField(t="state"){return V`
|
|
5036
5051
|
<temba-select
|
|
5037
5052
|
endpoint="/api/internal/locations.json?level=${t}"
|
|
5038
5053
|
nameKey="path"
|
|
@@ -5050,31 +5065,31 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5050
5065
|
<div class="name">${this.name}</div>
|
|
5051
5066
|
</div>
|
|
5052
5067
|
</temba-select>
|
|
5053
|
-
`}render(){if(this.disabled)return
|
|
5068
|
+
`}render(){if(this.disabled)return V`<div
|
|
5054
5069
|
class=${this.status+" "+Zt({wrapper:!0,set:!!this.value,unset:!this.value,disabled:this.disabled,mutable:!this.disabled,dirty:this.dirty})}
|
|
5055
5070
|
>
|
|
5056
5071
|
<div class="label"><div class="name">${this.name}</div></div>
|
|
5057
5072
|
<div class="value">
|
|
5058
|
-
${"datetime"===this.type?this.value?
|
|
5073
|
+
${"datetime"===this.type?this.value?V`<temba-date
|
|
5059
5074
|
value=${this.value}
|
|
5060
5075
|
display="datetime"
|
|
5061
5076
|
></temba-date>`:null:this.value}
|
|
5062
5077
|
</div>
|
|
5063
|
-
</div>`;const t=
|
|
5064
|
-
${this.dirty?
|
|
5078
|
+
</div>`;const t=V`<div class="save-state">
|
|
5079
|
+
${this.dirty?V`<temba-button
|
|
5065
5080
|
class="save-button"
|
|
5066
5081
|
name="Save"
|
|
5067
5082
|
small
|
|
5068
5083
|
@click=${this.handleSubmit}
|
|
5069
|
-
></temba-button>`:
|
|
5084
|
+
></temba-button>`:V` ${this.status===Oh.Saving?V`<temba-icon
|
|
5070
5085
|
spin
|
|
5071
5086
|
name="${ge.progress_spinner}"
|
|
5072
5087
|
></temba-icon>`:null}
|
|
5073
|
-
${this.status!==Oh.Success||this.dirty?null:
|
|
5074
|
-
${this.status===Oh.Failure?
|
|
5088
|
+
${this.status!==Oh.Success||this.dirty?null:V`<temba-icon name="${ge.success}"></temba-icon>`}
|
|
5089
|
+
${this.status===Oh.Failure?V`<temba-tip text="Failed to save changes, try again later."
|
|
5075
5090
|
><temba-icon name="${ge.alert_warning}"></temba-icon
|
|
5076
5091
|
></temba-tip>`:null}`}
|
|
5077
|
-
</div>`;return
|
|
5092
|
+
</div>`;return V`
|
|
5078
5093
|
<div
|
|
5079
5094
|
class=${this.status+" "+Zt({wrapper:!0,set:!!this.value,unset:!this.value,disabled:this.disabled,mutable:!this.disabled,dirty:this.dirty})}
|
|
5080
5095
|
>
|
|
@@ -5149,12 +5164,12 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5149
5164
|
.show-button temba-icon {
|
|
5150
5165
|
border-radius: 9999px;
|
|
5151
5166
|
}
|
|
5152
|
-
`}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(te(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=Lh[this.data.status];return
|
|
5167
|
+
`}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(te(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=Lh[this.data.status];return V`
|
|
5153
5168
|
<div
|
|
5154
5169
|
class=${Zt({wrapper:!0,"has-more":this.hasMore,expanded:this.expanded})}
|
|
5155
5170
|
>
|
|
5156
5171
|
<div class="badges">
|
|
5157
|
-
${t&&"active"!==this.data.status?
|
|
5172
|
+
${t&&"active"!==this.data.status?V`
|
|
5158
5173
|
<temba-label
|
|
5159
5174
|
icon="icon.contact_${this.data.status}"
|
|
5160
5175
|
onclick="goto(event)"
|
|
@@ -5166,7 +5181,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5166
5181
|
${t.name}
|
|
5167
5182
|
</temba-label>
|
|
5168
5183
|
`:null}
|
|
5169
|
-
${this.data.flow?
|
|
5184
|
+
${this.data.flow?V`
|
|
5170
5185
|
<temba-label
|
|
5171
5186
|
icon="flow"
|
|
5172
5187
|
onclick="goto(event)"
|
|
@@ -5178,7 +5193,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5178
5193
|
${this.data.flow.name}
|
|
5179
5194
|
</temba-label>
|
|
5180
5195
|
`:null}
|
|
5181
|
-
${this.data.language?
|
|
5196
|
+
${this.data.language?V`
|
|
5182
5197
|
<temba-label
|
|
5183
5198
|
icon=${ge.language}
|
|
5184
5199
|
onclick="goto(event)"
|
|
@@ -5190,7 +5205,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5190
5205
|
${this.store.getLanguageName(this.data.language)}
|
|
5191
5206
|
</temba-label>
|
|
5192
5207
|
`:null}
|
|
5193
|
-
${this.data.groups.map((t=>
|
|
5208
|
+
${this.data.groups.map((t=>V`
|
|
5194
5209
|
<temba-label
|
|
5195
5210
|
class="group"
|
|
5196
5211
|
onclick="goto(event)"
|
|
@@ -5318,7 +5333,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5318
5333
|
.scheduled-by .name {
|
|
5319
5334
|
flex-grow: 1;
|
|
5320
5335
|
}
|
|
5321
|
-
`}constructor(){super(),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly},this.handleEventClicked=this.handleEventClicked.bind(this)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null),t.has("data")&&this.fireCustomEvent($e.DetailsChanged,{count:this.data.length})}handleEventClicked(t){this.fireCustomEvent($e.Selection,t)}renderEvent(t){return
|
|
5336
|
+
`}constructor(){super(),this.lang_weekly="Weekly",this.lang_daily="Daily",this.lang_once="Once",this.REPEAT_PERIOD={O:this.lang_once,D:this.lang_daily,W:this.lang_weekly},this.handleEventClicked=this.handleEventClicked.bind(this)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`/contact/scheduled/${this.contact}/`:this.url=null),t.has("data")&&this.fireCustomEvent($e.DetailsChanged,{count:this.data.length})}handleEventClicked(t){this.fireCustomEvent($e.Selection,t)}renderEvent(t){return V`
|
|
5322
5337
|
<div
|
|
5323
5338
|
class="event ${t.type}"
|
|
5324
5339
|
@click="${()=>this.handleEventClicked(t)}"
|
|
@@ -5332,16 +5347,16 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5332
5347
|
|
|
5333
5348
|
<div class="details">
|
|
5334
5349
|
<div>
|
|
5335
|
-
${t.flow?
|
|
5336
|
-
${t.message?
|
|
5350
|
+
${t.flow?V` Start ${t.flow.name}`:null}
|
|
5351
|
+
${t.message?V` <div class="message">${t.message}</div> `:null}
|
|
5337
5352
|
</div>
|
|
5338
5353
|
|
|
5339
5354
|
<div class="scheduled-by">
|
|
5340
|
-
${t.campaign?
|
|
5355
|
+
${t.campaign?V`<div style="display:flex">
|
|
5341
5356
|
<temba-icon name="${ge.campaign}"></temba-icon>
|
|
5342
5357
|
<div class="name">${t.campaign.name}</div>
|
|
5343
|
-
</div>`:
|
|
5344
|
-
${t.type===Te.ScheduledTrigger?
|
|
5358
|
+
</div>`:V`
|
|
5359
|
+
${t.type===Te.ScheduledTrigger?V`<temba-icon
|
|
5345
5360
|
name="${Ih[t.type]}"
|
|
5346
5361
|
></temba-icon>`:null}
|
|
5347
5362
|
<div class="name">
|
|
@@ -5362,9 +5377,9 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5362
5377
|
</div>
|
|
5363
5378
|
</div>
|
|
5364
5379
|
</div>
|
|
5365
|
-
`}render(){if(this.data)return this.data.length>0?
|
|
5380
|
+
`}render(){if(this.data)return this.data.length>0?V`
|
|
5366
5381
|
${this.data.map((t=>this.renderEvent(t)))}
|
|
5367
|
-
`:
|
|
5382
|
+
`:V`<slot name="empty"></slot>`}}t([ce({type:String})],Dh.prototype,"contact",void 0),t([ce({type:Object,attribute:!1})],Dh.prototype,"data",void 0),t([ce({type:String})],Dh.prototype,"lang_weekly",void 0),t([ce({type:String})],Dh.prototype,"lang_daily",void 0),t([ce({type:String})],Dh.prototype,"lang_once",void 0);class Ph extends me{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
|
|
5368
5383
|
:host {
|
|
5369
5384
|
display: block;
|
|
5370
5385
|
}
|
|
@@ -5419,16 +5434,16 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5419
5434
|
color: #999;
|
|
5420
5435
|
padding: 0em 1em;
|
|
5421
5436
|
}
|
|
5422
|
-
`}firstUpdated(t){super.firstUpdated(t),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}updated(t){t.has("value")&&this.updateCircle()}updateValue(t){const e=this.shadowRoot.querySelector(".track"),i=(t.pageX-e.offsetLeft)/e.offsetWidth,o=(this.max-this.min)*i+this.min;this.value=""+Math.max(this.min,Math.min(Math.round(o),this.max))}handleMouseMove(t){this.grabbed&&this.updateValue(t)}handleTrackDown(t){this.grabbed=!0,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.add("dragging"),this.updateValue(t),this.requestUpdate()}handleMouseUp(t){this.grabbed=!1,this.updateValue(t),this.requestUpdate(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.remove("dragging")}updateCircle(){const t=this.shadowRoot.querySelector(".track"),e=this.shadowRoot.querySelector(".pre"),i=this.max-this.min;let o=parseInt(this.value);!o||o<this.min?o=this.min:o>this.max&&(o=this.max),this.value=""+o;const n=(o-this.min)/i,s=t.offsetWidth*n;this.circleX=s+(e?e.offsetWidth:0),this.requestUpdate()}render(){return
|
|
5437
|
+
`}firstUpdated(t){super.firstUpdated(t),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}updated(t){t.has("value")&&this.updateCircle()}updateValue(t){const e=this.shadowRoot.querySelector(".track"),i=(t.pageX-e.offsetLeft)/e.offsetWidth,o=(this.max-this.min)*i+this.min;this.value=""+Math.max(this.min,Math.min(Math.round(o),this.max))}handleMouseMove(t){this.grabbed&&this.updateValue(t)}handleTrackDown(t){this.grabbed=!0,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.add("dragging"),this.updateValue(t),this.requestUpdate()}handleMouseUp(t){this.grabbed=!1,this.updateValue(t),this.requestUpdate(),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.querySelector("html").classList.remove("dragging")}updateCircle(){const t=this.shadowRoot.querySelector(".track"),e=this.shadowRoot.querySelector(".pre"),i=this.max-this.min;let o=parseInt(this.value);!o||o<this.min?o=this.min:o>this.max&&(o=this.max),this.value=""+o;const n=(o-this.min)/i,s=t.offsetWidth*n;this.circleX=s+(e?e.offsetWidth:0),this.requestUpdate()}render(){return V` <div class="${Zt({grabbed:this.grabbed})}">
|
|
5423
5438
|
<div
|
|
5424
5439
|
style=${Ae({left:this.circleX+"px"})}
|
|
5425
5440
|
class="circle"
|
|
5426
5441
|
@mousedown=${this.handleTrackDown}
|
|
5427
5442
|
></div>
|
|
5428
5443
|
<div class="wrapper">
|
|
5429
|
-
${this.range?
|
|
5444
|
+
${this.range?V`<div class="pre">${this.min}</div>`:null}
|
|
5430
5445
|
<div class="track" @mousedown=${this.handleTrackDown}></div>
|
|
5431
|
-
${this.range?
|
|
5446
|
+
${this.range?V`<div class="post">${this.max}</div>`:null}
|
|
5432
5447
|
</div>
|
|
5433
5448
|
</div>`}}t([ce({type:Boolean})],Ph.prototype,"range",void 0),t([ce({type:Number})],Ph.prototype,"min",void 0),t([ce({type:Number})],Ph.prototype,"max",void 0);const Nh="rgb(223, 65, 159)";class Bh extends ah{static get styles(){return r`
|
|
5434
5449
|
:host {
|
|
@@ -5447,22 +5462,22 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5447
5462
|
width: 100%;
|
|
5448
5463
|
flex-grow: 1;
|
|
5449
5464
|
}
|
|
5450
|
-
`}firstUpdated(t){super.firstUpdated(t)}updated(t){if(super.updated(t),(t.has("responses")||t.has("flow"))&&this.flow&&(this.endpoint=`/api/v2/runs.json?flow=${this.flow}${this.responses?"&responded=1":""}`),t.has("resultPreview")&&this.createRenderOption(),t.has("results")&&this.results){this.shadowRoot.querySelector("temba-select").setOptions(this.results),this.resultKeys=this.results.reduce(((t,e)=>({...t,[e.key]:e})),{})}}renderResultPreview(t){if(this.resultPreview){const e=t.values[this.resultPreview.key];if(e){if(!(this.resultPreview.categories.length>1))return e.value;if(e.category)return e.category}}return null}removeRun(t){this.items=this.items.filter((e=>e.id!==t)),this.cursorIndex=Math.min(this.cursorIndex,this.items.length),this.requestUpdate("cursorIndex")}getIcon(t){let e=null;return"completed"==t.exit_type?e=
|
|
5465
|
+
`}firstUpdated(t){super.firstUpdated(t)}updated(t){if(super.updated(t),(t.has("responses")||t.has("flow"))&&this.flow&&(this.endpoint=`/api/v2/runs.json?flow=${this.flow}${this.responses?"&responded=1":""}`),t.has("resultPreview")&&this.createRenderOption(),t.has("results")&&this.results){this.shadowRoot.querySelector("temba-select").setOptions(this.results),this.resultKeys=this.results.reduce(((t,e)=>({...t,[e.key]:e})),{})}}renderResultPreview(t){if(this.resultPreview){const e=t.values[this.resultPreview.key];if(e){if(!(this.resultPreview.categories.length>1))return e.value;if(e.category)return e.category}}return null}removeRun(t){this.items=this.items.filter((e=>e.id!==t)),this.cursorIndex=Math.min(this.cursorIndex,this.items.length),this.requestUpdate("cursorIndex")}getIcon(t){let e=null;return"completed"==t.exit_type?e=V`<temba-icon
|
|
5451
5466
|
name="check"
|
|
5452
5467
|
style="--icon-color:#666;margin-left:0.5em"
|
|
5453
|
-
/>`:"interrupted"==t.exit_type?e=
|
|
5468
|
+
/>`:"interrupted"==t.exit_type?e=V`<temba-icon
|
|
5454
5469
|
name="x-octagon"
|
|
5455
5470
|
style="--icon-color:${Nh};margin-left:0.5em"
|
|
5456
|
-
/>`:"expired"==t.exit_type?e=
|
|
5471
|
+
/>`:"expired"==t.exit_type?e=V`<temba-icon
|
|
5457
5472
|
name="clock"
|
|
5458
5473
|
style="--icon-color:${Nh};margin-left:0.5em"
|
|
5459
|
-
/>`:t.exit_type||(e=t.responded?
|
|
5474
|
+
/>`:t.exit_type||(e=t.responded?V`<temba-icon
|
|
5460
5475
|
name="activity"
|
|
5461
5476
|
style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
|
|
5462
|
-
/>`:
|
|
5477
|
+
/>`:V`<temba-icon
|
|
5463
5478
|
name="hourglass"
|
|
5464
5479
|
style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
|
|
5465
|
-
/>`),e}createRenderOption(){this.renderOption=t=>{let e="";return t.exited_on||(e="font-weight:400;"),t.responded||(e+=""),
|
|
5480
|
+
/>`),e}createRenderOption(){this.renderOption=t=>{let e="";return t.exited_on||(e="font-weight:400;"),t.responded||(e+=""),V`
|
|
5466
5481
|
<div class="row" style="${e}display:flex;align-items:center">
|
|
5467
5482
|
<div
|
|
5468
5483
|
style="width:16em;white-space:nowrap;overflow: hidden; text-overflow: ellipsis;"
|
|
@@ -5485,10 +5500,10 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5485
5500
|
</div>
|
|
5486
5501
|
${this.getIcon(t)}
|
|
5487
5502
|
</div>
|
|
5488
|
-
`}}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].modified_on;return this.endpoint+"&after="+t}return this.endpoint}toggleResponded(){this.responses=this.shadowRoot.querySelector("#responded").checked}handleColumnChanged(t){t.target.values.length>0?this.resultPreview=t.target.values[0]:this.resultPreview=null}handleSelected(t){this.selectedRun=t}getListStyle(){return""}renderHeader(){return
|
|
5503
|
+
`}}getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].modified_on;return this.endpoint+"&after="+t}return this.endpoint}toggleResponded(){this.responses=this.shadowRoot.querySelector("#responded").checked}handleColumnChanged(t){t.target.values.length>0?this.resultPreview=t.target.values[0]:this.resultPreview=null}handleSelected(t){this.selectedRun=t}getListStyle(){return""}renderHeader(){return V`
|
|
5489
5504
|
<div style="display:flex;width:100%;margin-bottom: 1em;">
|
|
5490
5505
|
<div style="flex-grow:1">
|
|
5491
|
-
${this.results?
|
|
5506
|
+
${this.results?V`
|
|
5492
5507
|
<temba-select
|
|
5493
5508
|
clearable
|
|
5494
5509
|
placeholder="Result Preview"
|
|
@@ -5522,7 +5537,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5522
5537
|
>
|
|
5523
5538
|
Last Updated
|
|
5524
5539
|
</div>
|
|
5525
|
-
`}renderFooter(){if(!this.selectedRun||!this.resultKeys)return null;const t=Object.keys(this.selectedRun.values);return
|
|
5540
|
+
`}renderFooter(){if(!this.selectedRun||!this.resultKeys)return null;const t=Object.keys(this.selectedRun.values);return V` <div
|
|
5526
5541
|
style="margin-top: 1.5em; margin-bottom:0.5em;flex-grow:1;border-radius:var(--curvature); border: 1px solid var(--color-widget-border);"
|
|
5527
5542
|
>
|
|
5528
5543
|
<div style="display:flex;flex-direction:column;">
|
|
@@ -5540,7 +5555,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5540
5555
|
<div
|
|
5541
5556
|
style="display:flex;margin-left:-0.2em;margin-top:0.25em;font-size: 0.65em"
|
|
5542
5557
|
>
|
|
5543
|
-
${this.selectedRun.exit_type?
|
|
5558
|
+
${this.selectedRun.exit_type?V`
|
|
5544
5559
|
<div style="margin-left:2em;flex-grow:1;display:flex">
|
|
5545
5560
|
${this.getIcon(this.selectedRun)}
|
|
5546
5561
|
<div style="margin-left:0.5em">
|
|
@@ -5552,7 +5567,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5552
5567
|
display="duration"
|
|
5553
5568
|
/>
|
|
5554
5569
|
</div>
|
|
5555
|
-
`:
|
|
5570
|
+
`:V`${this.getIcon(this.selectedRun)}
|
|
5556
5571
|
<div style="margin-left:1.5em;flex-grow:1;display:flex">
|
|
5557
5572
|
<div>Started </div>
|
|
5558
5573
|
<temba-date
|
|
@@ -5573,7 +5588,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5573
5588
|
Started
|
|
5574
5589
|
</div>
|
|
5575
5590
|
</div>
|
|
5576
|
-
${this.allowDelete?
|
|
5591
|
+
${this.allowDelete?V` <temba-icon
|
|
5577
5592
|
clickable
|
|
5578
5593
|
style="margin-left:0.75em;"
|
|
5579
5594
|
name=${ge.delete}
|
|
@@ -5581,7 +5596,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5581
5596
|
></temba-icon>`:null}
|
|
5582
5597
|
</div>
|
|
5583
5598
|
|
|
5584
|
-
${t.length>0?
|
|
5599
|
+
${t.length>0?V`
|
|
5585
5600
|
<div style="padding:1em;">
|
|
5586
5601
|
<div
|
|
5587
5602
|
style="display:flex;font-size:1.2em;position:relative;right:0px"
|
|
@@ -5596,7 +5611,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5596
5611
|
<th style="text-align:left">Value</th>
|
|
5597
5612
|
</tr>
|
|
5598
5613
|
|
|
5599
|
-
${Object.keys(this.selectedRun.values).map((t=>{const e=this.selectedRun.values[t],i=this.resultKeys[t];return i?
|
|
5614
|
+
${Object.keys(this.selectedRun.values).map((t=>{const e=this.selectedRun.values[t],i=this.resultKeys[t];return i?V`<tr>
|
|
5600
5615
|
<td>${e.name}</td>
|
|
5601
5616
|
<td>
|
|
5602
5617
|
${i.categories.length>1?e.category:"--"}
|
|
@@ -5607,7 +5622,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5607
5622
|
</div>
|
|
5608
5623
|
`:null}
|
|
5609
5624
|
</div>
|
|
5610
|
-
</div>`}constructor(){super(),this.responses=!0,this.allowDelete=!1,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([ce({type:String})],Bh.prototype,"flow",void 0),t([ce({type:Object,attribute:!1})],Bh.prototype,"results",void 0),t([ce({type:Boolean})],Bh.prototype,"responses",void 0),t([ce({type:Object})],Bh.prototype,"resultPreview",void 0),t([ce({type:Object})],Bh.prototype,"selectedRun",void 0),t([ce({type:Boolean})],Bh.prototype,"allowDelete",void 0);class Rh extends zl{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
|
|
5625
|
+
</div>`}constructor(){super(),this.responses=!0,this.allowDelete=!1,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([ce({type:String})],Bh.prototype,"flow",void 0),t([ce({type:Object,attribute:!1})],Bh.prototype,"results",void 0),t([ce({type:Boolean})],Bh.prototype,"responses",void 0),t([ce({type:Object})],Bh.prototype,"resultPreview",void 0),t([ce({type:Object})],Bh.prototype,"selectedRun",void 0),t([ce({type:Boolean})],Bh.prototype,"allowDelete",void 0);class Rh extends zl{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 V`<div></div>`}}t([ce({type:String})],Rh.prototype,"flow",void 0),t([ce({type:Object,attribute:!1})],Rh.prototype,"data",void 0),t([ce({type:String})],Rh.prototype,"endpoint",void 0);class qh extends Ll{constructor(){super(...arguments),this.size=20}static get styles(){return r`
|
|
5611
5626
|
:host {
|
|
5612
5627
|
display: flex;
|
|
5613
5628
|
}
|
|
@@ -5616,7 +5631,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5616
5631
|
margin-right: 0.2em;
|
|
5617
5632
|
margin-top: 2px;
|
|
5618
5633
|
}
|
|
5619
|
-
`}render(){return this.data?
|
|
5634
|
+
`}render(){return this.data?V` <temba-contact-name
|
|
5620
5635
|
name=${this.data.name||this.data.anon_display}
|
|
5621
5636
|
urn=${this.data.urns.length>0?this.data.urns[0]:null}
|
|
5622
5637
|
></temba-contact-name>
|
|
@@ -5730,7 +5745,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5730
5745
|
margin: 0;
|
|
5731
5746
|
padding: 0;
|
|
5732
5747
|
}
|
|
5733
|
-
`}serializeValue(t){return t}constructor(){super(),this.timezone="",this.timezoneFriendly="",this.datetime=null,this.time=!1}firstUpdated(t){if(t.has("value"))if(this.time){if(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.value){let t=Hs.fromSQL(this.value).setZone(this.timezone);t.invalid&&(t=Hs.fromISO(this.value).setZone(this.timezone)),this.datetime=t,this.value=this.datetime.toUTC().toISO()}}else this.datetime=Hs.fromSQL(this.value),this.value=this.datetime.toISODate()}updated(t){super.updated(t),t.has("timezone")&&this.time&&(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.requestUpdate("value"))}handleChange(t){t.preventDefault(),t.stopPropagation(),this.time?(this.datetime=Hs.fromISO(t.target.value,{zone:this.timezone}),this.value=this.datetime.toUTC().toISO()):this.value=t.target.value,this.fireEvent("change")}handleClicked(){this.shadowRoot.querySelector("input").focus()}render(){const t=Zt({unset:!this.value});let e=null;return this.time&&this.datetime&&!this.datetime.invalid?e=this.datetime.toFormat("yyyy-LL-dd'T'HH:mm"):this.time||(e=this.value),
|
|
5748
|
+
`}serializeValue(t){return t}constructor(){super(),this.timezone="",this.timezoneFriendly="",this.datetime=null,this.time=!1}firstUpdated(t){if(t.has("value"))if(this.time){if(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.value){let t=Hs.fromSQL(this.value).setZone(this.timezone);t.invalid&&(t=Hs.fromISO(this.value).setZone(this.timezone)),this.datetime=t,this.value=this.datetime.toUTC().toISO()}}else this.datetime=Hs.fromSQL(this.value),this.value=this.datetime.toISODate()}updated(t){super.updated(t),t.has("timezone")&&this.time&&(this.timezone=this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,this.timezoneFriendly=this.timezone.replace("_"," ").replace("/",", "),this.requestUpdate("value"))}handleChange(t){t.preventDefault(),t.stopPropagation(),this.time?(this.datetime=Hs.fromISO(t.target.value,{zone:this.timezone}),this.value=this.datetime.toUTC().toISO()):this.value=t.target.value,this.fireEvent("change")}handleClicked(){this.shadowRoot.querySelector("input").focus()}render(){const t=Zt({unset:!this.value});let e=null;return this.time&&this.datetime&&!this.datetime.invalid?e=this.datetime.toFormat("yyyy-LL-dd'T'HH:mm"):this.time||(e=this.value),V`
|
|
5734
5749
|
<temba-field
|
|
5735
5750
|
class=${Zt({disabled:this.disabled})}
|
|
5736
5751
|
name=${this.name}
|
|
@@ -5752,7 +5767,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5752
5767
|
@change=${this.handleChange}
|
|
5753
5768
|
/>
|
|
5754
5769
|
</div>
|
|
5755
|
-
${this.time?
|
|
5770
|
+
${this.time?V`
|
|
5756
5771
|
<div class="tz-wrapper">
|
|
5757
5772
|
<div class="tz">
|
|
5758
5773
|
<div class="label">Time Zone</div>
|
|
@@ -5763,7 +5778,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5763
5778
|
<slot name="postfix"></slot>
|
|
5764
5779
|
</div>
|
|
5765
5780
|
</temba-field>
|
|
5766
|
-
`}}t([ce({type:String})],Fh.prototype,"timezone",void 0),t([ce({type:String})],Fh.prototype,"timezoneFriendly",void 0),t([ce({type:Object})],Fh.prototype,"datetime",void 0),t([ce({type:Boolean})],Fh.prototype,"time",void 0);const Uh={text:"Text",numeric:"Number",number:"Number",datetime:"Date & Time",state:"State",ward:"Ward",district:"District"},
|
|
5781
|
+
`}}t([ce({type:String})],Fh.prototype,"timezone",void 0),t([ce({type:String})],Fh.prototype,"timezoneFriendly",void 0),t([ce({type:Object})],Fh.prototype,"datetime",void 0),t([ce({type:Boolean})],Fh.prototype,"time",void 0);const Uh={text:"Text",numeric:"Number",number:"Number",datetime:"Date & Time",state:"State",ward:"Ward",district:"District"},jh=(t,e)=>{if(!e)return!0;return(t.label+t.key+Uh[t.value_type]).toLowerCase().toLowerCase().indexOf(e)>-1};class Vh extends zl{constructor(){super(...arguments),this.otherFieldKeys=[],this.query=""}static get styles(){return r`
|
|
5767
5782
|
:host {
|
|
5768
5783
|
display: flex;
|
|
5769
5784
|
flex-grow: 1;
|
|
@@ -5856,7 +5871,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5856
5871
|
border-color: #e6e6e6;
|
|
5857
5872
|
background: #fcfcfc;
|
|
5858
5873
|
}
|
|
5859
|
-
`}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&&
|
|
5874
|
+
`}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&&jh(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=>{jh(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;Qt(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,o=e.dataset.action;this.fireCustomEvent($e.Selection,{key:i,action:o})}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 V`
|
|
5860
5875
|
<div
|
|
5861
5876
|
class="field sortable"
|
|
5862
5877
|
id="${t.key}"
|
|
@@ -5878,7 +5893,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5878
5893
|
>
|
|
5879
5894
|
${t.label}
|
|
5880
5895
|
</span>
|
|
5881
|
-
${this.hasUsages(t)?
|
|
5896
|
+
${this.hasUsages(t)?V`
|
|
5882
5897
|
<temba-icon
|
|
5883
5898
|
size="0.8"
|
|
5884
5899
|
style="color: #ccc; margin-left: 0.7em;"
|
|
@@ -5905,7 +5920,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5905
5920
|
@click=${this.handleFieldAction}
|
|
5906
5921
|
></temba-icon>
|
|
5907
5922
|
</div>
|
|
5908
|
-
`}render(){return this.featuredFields?
|
|
5923
|
+
`}render(){return this.featuredFields?V`
|
|
5909
5924
|
<temba-textinput
|
|
5910
5925
|
id="search"
|
|
5911
5926
|
placeholder="Search"
|
|
@@ -5914,17 +5929,17 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5914
5929
|
value=${this.query}
|
|
5915
5930
|
></temba-textinput>
|
|
5916
5931
|
|
|
5917
|
-
${this.featuredFields.length>0?
|
|
5932
|
+
${this.featuredFields.length>0?V`
|
|
5918
5933
|
<div class="featured">
|
|
5919
5934
|
<div class="header">
|
|
5920
5935
|
<temba-icon name="featured"></temba-icon>
|
|
5921
5936
|
<div class="label">Featured</div>
|
|
5922
5937
|
</div>
|
|
5923
|
-
${this.query?
|
|
5938
|
+
${this.query?V`
|
|
5924
5939
|
<div class="scroll-box">
|
|
5925
5940
|
${this.featuredFields.map((t=>this.renderField(t)))}
|
|
5926
5941
|
</div>
|
|
5927
|
-
`:
|
|
5942
|
+
`:V`
|
|
5928
5943
|
<temba-sortable-list
|
|
5929
5944
|
@change=${this.handleSaveOrder}
|
|
5930
5945
|
@temba-order-changed=${this.handleOrderChanged}
|
|
@@ -5946,7 +5961,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5946
5961
|
${this.otherFieldKeys.map((t=>this.renderField(this.store.getContactField(t))))}
|
|
5947
5962
|
</div>
|
|
5948
5963
|
</div>
|
|
5949
|
-
`:null}}t([ce({type:String,attribute:"priority-endpoint"})],
|
|
5964
|
+
`:null}}t([ce({type:String,attribute:"priority-endpoint"})],Vh.prototype,"priorityEndpoint",void 0),t([ce({type:Object,attribute:!1})],Vh.prototype,"featuredFields",void 0),t([ce({type:Object,attribute:!1})],Vh.prototype,"otherFieldKeys",void 0),t([ce({type:String})],Vh.prototype,"draggingId",void 0),t([ce({type:String})],Vh.prototype,"query",void 0);class Zh extends pe{static get styles(){return r`
|
|
5950
5965
|
:host {
|
|
5951
5966
|
margin: auto;
|
|
5952
5967
|
}
|
|
@@ -5989,7 +6004,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
5989
6004
|
padding: 0.2em 0.5em;
|
|
5990
6005
|
transition: all 300ms ease-in-out;
|
|
5991
6006
|
}
|
|
5992
|
-
`}constructor(){super(),this.ghostElement=null,this.downEle=null,this.xOffset=0,this.yOffset=0,this.yDown=0,this.draggingIdx=-1,this.draggingEle=null,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this)}firstUpdated(t){super.firstUpdated(t)}getIds(){return this.shadowRoot.querySelector("slot").assignedElements().map((t=>t.id))}getRowIndex(t){return this.shadowRoot.querySelector("slot").assignedElements().findIndex((e=>e.id===t))}getOverlappingElement(t){const e=this.ghostElement.getBoundingClientRect();return this.shadowRoot.querySelector("slot").assignedElements().find((i=>{const o=i.getBoundingClientRect();return i.id!==this.ghostElement.id&&(t>this.yDown?e.top<o.bottom&&e.bottom>o.bottom:o.top<e.bottom&&o.bottom>e.bottom)}))}handleMouseDown(t){let e=t.target;e=e.closest(".sortable"),e&&(this.downEle=e,this.draggingId=e.id,this.draggingIdx=this.getRowIndex(e.id),this.draggingEle=e,this.xOffset=t.clientX-e.offsetLeft,this.yOffset=t.clientY-e.offsetTop,this.yDown=t.clientY,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp))}handleMouseMove(t){const e=this.shadowRoot.querySelector("slot").assignedElements()[0].parentElement.scrollTop;if(!this.ghostElement&&this.downEle&&Math.abs(t.clientY-this.yDown)>5){this.fireCustomEvent($e.DragStart,{id:this.downEle.id}),this.ghostElement=this.downEle.cloneNode(!0),this.ghostElement.classList.add("ghost");const t=getComputedStyle(this.downEle);this.ghostElement.style.width=this.downEle.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)+"px";this.shadowRoot.querySelector(".container").appendChild(this.ghostElement),this.downEle=null}if(this.ghostElement){this.ghostElement.style.left=t.clientX-this.xOffset+"px",this.ghostElement.style.top=t.clientY-this.yOffset-e+"px";const i=this.getOverlappingElement(t.clientY);if(i){const t=this.getRowIndex(i.id),e=this.ghostElement.id,o=i.id;this.fireCustomEvent($e.OrderChanged,{from:e,to:o,fromIdx:this.draggingIdx,toIdx:t}),this.draggingIdx=t,this.draggingId=o}}}handleMouseUp(){this.draggingId&&(this.fireCustomEvent($e.DragStop,{id:this.draggingId}),this.draggingId=null,this.downEle=null,this.ghostElement&&(this.ghostElement.remove(),this.ghostElement=null)),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.dispatchEvent(new Event("change"))}render(){return
|
|
6007
|
+
`}constructor(){super(),this.ghostElement=null,this.downEle=null,this.xOffset=0,this.yOffset=0,this.yDown=0,this.draggingIdx=-1,this.draggingEle=null,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this)}firstUpdated(t){super.firstUpdated(t)}getIds(){return this.shadowRoot.querySelector("slot").assignedElements().map((t=>t.id))}getRowIndex(t){return this.shadowRoot.querySelector("slot").assignedElements().findIndex((e=>e.id===t))}getOverlappingElement(t){const e=this.ghostElement.getBoundingClientRect();return this.shadowRoot.querySelector("slot").assignedElements().find((i=>{const o=i.getBoundingClientRect();return i.id!==this.ghostElement.id&&(t>this.yDown?e.top<o.bottom&&e.bottom>o.bottom:o.top<e.bottom&&o.bottom>e.bottom)}))}handleMouseDown(t){let e=t.target;e=e.closest(".sortable"),e&&(this.downEle=e,this.draggingId=e.id,this.draggingIdx=this.getRowIndex(e.id),this.draggingEle=e,this.xOffset=t.clientX-e.offsetLeft,this.yOffset=t.clientY-e.offsetTop,this.yDown=t.clientY,document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp))}handleMouseMove(t){const e=this.shadowRoot.querySelector("slot").assignedElements()[0].parentElement.scrollTop;if(!this.ghostElement&&this.downEle&&Math.abs(t.clientY-this.yDown)>5){this.fireCustomEvent($e.DragStart,{id:this.downEle.id}),this.ghostElement=this.downEle.cloneNode(!0),this.ghostElement.classList.add("ghost");const t=getComputedStyle(this.downEle);this.ghostElement.style.width=this.downEle.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)+"px";this.shadowRoot.querySelector(".container").appendChild(this.ghostElement),this.downEle=null}if(this.ghostElement){this.ghostElement.style.left=t.clientX-this.xOffset+"px",this.ghostElement.style.top=t.clientY-this.yOffset-e+"px";const i=this.getOverlappingElement(t.clientY);if(i){const t=this.getRowIndex(i.id),e=this.ghostElement.id,o=i.id;this.fireCustomEvent($e.OrderChanged,{from:e,to:o,fromIdx:this.draggingIdx,toIdx:t}),this.draggingIdx=t,this.draggingId=o}}}handleMouseUp(){this.draggingId&&(this.fireCustomEvent($e.DragStop,{id:this.draggingId}),this.draggingId=null,this.downEle=null,this.ghostElement&&(this.ghostElement.remove(),this.ghostElement=null)),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.dispatchEvent(new Event("change"))}render(){return V`
|
|
5993
6008
|
<div class="container">
|
|
5994
6009
|
<slot @mousedown=${this.handleMouseDown}></slot>
|
|
5995
6010
|
</div>
|
|
@@ -6048,21 +6063,21 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6048
6063
|
.item:hover {
|
|
6049
6064
|
color: var(--color-link-primary);
|
|
6050
6065
|
}
|
|
6051
|
-
`}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=Hh;e&&delete i["Temba-Spa"],
|
|
6066
|
+
`}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=Hh;e&&delete i["Temba-Spa"],Vt(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($e.Loaded,{buttons:this.buttons,items:this.items})})).catch((t=>{this.fireCustomEvent($e.Loaded,{buttons:this.buttons,items:this.items}),console.error(t)}))}}refresh(){this.fetchContentMenu()}updated(t){super.updated(t),(t.has("endpoint")||t.has("legacy"))&&this.fetchContentMenu()}handleItemClicked(t,e){this.fireCustomEvent($e.Selection,{item:t,event:e})}render(){return V`
|
|
6052
6067
|
<div class="container">
|
|
6053
|
-
${this.buttons.map((t=>
|
|
6068
|
+
${this.buttons.map((t=>V`<temba-button
|
|
6054
6069
|
class="${t.primary?"primary_button_item":"button_item"}"
|
|
6055
6070
|
name=${t.label}
|
|
6056
6071
|
@click=${e=>this.handleItemClicked(t,e)}
|
|
6057
6072
|
>
|
|
6058
6073
|
${t.label}
|
|
6059
6074
|
</temba-button>`))}
|
|
6060
|
-
${this.items&&this.items.length>0?
|
|
6075
|
+
${this.items&&this.items.length>0?V`<temba-dropdown>
|
|
6061
6076
|
<div slot="toggle" class="toggle">
|
|
6062
6077
|
<temba-icon name="menu" size="1.5"></temba-icon>
|
|
6063
6078
|
</div>
|
|
6064
6079
|
<div slot="dropdown" class="dropdown">
|
|
6065
|
-
${this.items.map((t=>t.type===Wh.DIVIDER?
|
|
6080
|
+
${this.items.map((t=>t.type===Wh.DIVIDER?V` <div class="divider"></div>`:V` <div
|
|
6066
6081
|
class="item"
|
|
6067
6082
|
name=${t.label}
|
|
6068
6083
|
@click=${e=>this.handleItemClicked(t,e)}
|
|
@@ -6076,19 +6091,19 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6076
6091
|
.date {
|
|
6077
6092
|
display: inline;
|
|
6078
6093
|
}
|
|
6079
|
-
`}firstUpdated(t){super.firstUpdated(t),this.store=document.querySelector("temba-store")}updated(t){super.updated(t),t.has("value")&&(this.datetime=Hs.fromISO(this.value))}connectedCallback(){super.connectedCallback()}render(){if(this.datetime&&this.store){this.datetime.setLocale(this.store.getLocale());let t="";if(this.display===Yh.timedate){const e=Math.abs(this.datetime.diffNow().milliseconds/1e3/60/60);t=e<24?this.datetime.toLocaleString(Yh.time):e<8760?this.datetime.toFormat(Yh.day):this.datetime.toLocaleString(Yh.date)}else if(this.display===Yh.relative){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return
|
|
6094
|
+
`}firstUpdated(t){super.firstUpdated(t),this.store=document.querySelector("temba-store")}updated(t){super.updated(t),t.has("value")&&(this.datetime=Hs.fromISO(this.value))}connectedCallback(){super.connectedCallback()}render(){if(this.datetime&&this.store){this.datetime.setLocale(this.store.getLocale());let t="";if(this.display===Yh.timedate){const e=Math.abs(this.datetime.diffNow().milliseconds/1e3/60/60);t=e<24?this.datetime.toLocaleString(Yh.time):e<8760?this.datetime.toFormat(Yh.day):this.datetime.toLocaleString(Yh.date)}else if(this.display===Yh.relative){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return V`<span
|
|
6080
6095
|
class="date"
|
|
6081
6096
|
title="${this.datetime.toLocaleString(Yh.datetime)}"
|
|
6082
6097
|
>just now</span
|
|
6083
|
-
>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===Yh.duration){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return
|
|
6098
|
+
>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===Yh.duration){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return V`<span
|
|
6084
6099
|
class="date"
|
|
6085
6100
|
title="${this.datetime.toLocaleString(Yh.datetime)}"
|
|
6086
6101
|
>just now</span
|
|
6087
|
-
>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===Yh.countdown?this.store.getCountdown(this.datetime):this.display===Yh.day?this.datetime.toLocaleString(Yh.day):this.datetime.toLocaleString(Yh[this.display]);return
|
|
6102
|
+
>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===Yh.countdown?this.store.getCountdown(this.datetime):this.display===Yh.day?this.datetime.toLocaleString(Yh.day):this.datetime.toLocaleString(Yh[this.display]);return V`<span
|
|
6088
6103
|
class="date"
|
|
6089
6104
|
title="${this.datetime.toLocaleString(Yh.datetime)}"
|
|
6090
6105
|
>${t}</span
|
|
6091
|
-
>`}}}t([ce({type:String})],Kh.prototype,"value",void 0),t([ce({type:String})],Kh.prototype,"display",void 0),t([ce({type:Object,attribute:!1})],Kh.prototype,"datetime",void 0);let Qh=class extends pe{constructor(){super(...arguments),this.body=
|
|
6106
|
+
>`}}}t([ce({type:String})],Kh.prototype,"value",void 0),t([ce({type:String})],Kh.prototype,"display",void 0),t([ce({type:Object,attribute:!1})],Kh.prototype,"datetime",void 0);let Qh=class extends pe{constructor(){super(...arguments),this.body=V`<temba-loading></temba-loading>`}static get styles(){return r``}updated(t){super.updated(t),t.has("endpoint")&&Vt(this.endpoint).then((t=>{this.body=Or(t.body)}))}render(){return V`${this.body}`}};t([ce({type:String})],Qh.prototype,"endpoint",void 0),t([ce({attribute:!1})],Qh.prototype,"body",void 0),Qh=t([(t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)})
|
|
6092
6107
|
/**
|
|
6093
6108
|
* @license
|
|
6094
6109
|
* Copyright 2017 Google LLC
|
|
@@ -6241,7 +6256,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6241
6256
|
.quick-replies {
|
|
6242
6257
|
background: #f9f9f9;
|
|
6243
6258
|
}
|
|
6244
|
-
`}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.currentText="",this.initialText="",this.accept="",this.endpoint=Rt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.currentOptin=[],this.variables=[],this.optinEndpoint="/api/v2/optins.json",this.templateEndpoint="/api/internal/templates.json",this.empty=!0,this.langValues={},this.currentLanguage="und",this.hasPendingText=!1}isBaseLanguage(){return"und"==this.currentLanguage||this.currentLanguage==this.languages[0].iso}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs");if(this.currentTab=t.getCurrentTab(),this.currentTab&&"Shortcuts"===this.currentTab.name){this.shadowRoot.querySelector("temba-shortcuts").filter=""}this.setFocusOnChatbox()}firstUpdated(t){var e,i;super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{},this.variables=(null===(e=this.langValues[this.currentLanguage])||void 0===e?void 0:e.variables)||[],this.template=(null===(i=this.langValues[this.currentLanguage])||void 0===i?void 0:i.template)||null),this.setFocusOnChatbox()}updated(t){if(super.updated(t),t.has("currentLanguage")&&this.langValues){let t={text:"",attachments:[],quick_replies:[]};this.currentLanguage in this.langValues&&(t=this.langValues[this.currentLanguage]),this.currentText=t.text,this.initialText=t.text,this.currentAttachments=t.attachments,this.currentQuickReplies=(t.quick_replies||[]).map((t=>({name:t,value:t}))),this.currentOptin=t.optin?[t.optin]:[],this.setFocusOnChatbox();const e=this.shadowRoot.querySelector(".chatbox");e&&(e.value=this.initialText),this.resetTabs(),this.requestUpdate("currentAttachments")}if(this.langValues&&(t.has("currentText")||t.has("currentAttachments")||t.has("currentQuickReplies"))||t.has("currentOptin")||t.has("currentTemplate")||t.has("variables")){this.checkIfEmpty();const t=this.currentText?this.currentText.trim():"";t||(this.currentAttachments||[]).length>0||this.currentQuickReplies.length>0||this.variables.length>0?this.langValues[this.currentLanguage]={text:t,attachments:this.currentAttachments,quick_replies:this.currentQuickReplies.map((t=>t.value)),optin:this.currentOptin.length>0?this.currentOptin[0]:null,template:this.currentTemplate?this.currentTemplate.uuid:null,variables:this.variables,locale:this.locale}:delete this.langValues[this.currentLanguage],this.fireCustomEvent($e.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}handleAttachmentsChanged(t){const e=t.target;this.currentAttachments=e.attachments,this.requestUpdate()}setFocusOnChatbox(){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}reset(){const t=this.shadowRoot.querySelector(".chatbox");t&&(t.textInputElement.value="",t.value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.resetTabs())}handleQuickReplyChange(){this.requestUpdate("currentQuickReplies")}handleOptInChange(t){this.currentOptin=t.target.values,this.requestUpdate("optIn")}handleChatboxChange(t){const e=t.target.getTextInput().inputElement;this.currentText=e.value,this.hasPendingText=e.value.length>0;const i=e.selectionStart,o=e.value,n=o.lastIndexOf("\n",i-1)+1,s=o.substring(n,i);if(s.startsWith("/")){"Shortcuts"!==this.currentTab.name&&this.getTabs().focusTab("Shortcuts");this.shadowRoot.querySelector("temba-shortcuts").filter=s.substring(1)}}checkIfEmpty(){const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.attachments?this.empty=t&&e:this.empty=t}getCurrentLine(){const t=this.shadowRoot.querySelector(".chatbox"),e=t.getTextInput().inputElement.selectionStart-1,i=t.value.substring(0,e).lastIndexOf("\n")+1;let o=t.value.indexOf("\n",i);return-1===o&&(o=t.value.length),{text:t.value.substring(i,o),index:i}}handleKeyDown(t){const e=this.shadowRoot.querySelector("temba-tabs"),i=parseInt(t.key);if(!Number.isNaN(i)&&i>0&&t.ctrlKey&&t.metaKey&&i<=e.options.length&&(e.index=i-1),"Backspace"===t.key){"/"===this.getCurrentLine().text&&e.focusTab("Reply")}if(("Shortcuts"!==this.currentTab.name||"Enter"!==t.key||t.shiftKey)&&"Enter"===t.key&&!t.shiftKey)if(t.preventDefault(),this.completion){t.target.hasVisibleOptions()||this.triggerSend()}else this.triggerSend()}triggerSend(){this.empty||this.fireCustomEvent($e.Submitted,{langValues:this.langValues})}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.getTabs().focusTab("Reply")}getTabs(){return this.shadowRoot.querySelector("temba-tabs")}render(){return
|
|
6259
|
+
`}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.currentText="",this.initialText="",this.accept="",this.endpoint=Rt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.currentOptin=[],this.variables=[],this.optinEndpoint="/api/v2/optins.json",this.templateEndpoint="/api/internal/templates.json",this.empty=!0,this.langValues={},this.currentLanguage="und",this.hasPendingText=!1}isBaseLanguage(){return"und"==this.currentLanguage||this.currentLanguage==this.languages[0].iso}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs");if(this.currentTab=t.getCurrentTab(),this.currentTab&&"Shortcuts"===this.currentTab.name){this.shadowRoot.querySelector("temba-shortcuts").filter=""}this.setFocusOnChatbox()}firstUpdated(t){var e,i;super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{},this.variables=(null===(e=this.langValues[this.currentLanguage])||void 0===e?void 0:e.variables)||[],this.template=(null===(i=this.langValues[this.currentLanguage])||void 0===i?void 0:i.template)||null),this.setFocusOnChatbox()}updated(t){if(super.updated(t),t.has("currentLanguage")&&this.langValues){let t={text:"",attachments:[],quick_replies:[]};this.currentLanguage in this.langValues&&(t=this.langValues[this.currentLanguage]),this.currentText=t.text,this.initialText=t.text,this.currentAttachments=t.attachments,this.currentQuickReplies=(t.quick_replies||[]).map((t=>({name:t,value:t}))),this.currentOptin=t.optin?[t.optin]:[],this.setFocusOnChatbox();const e=this.shadowRoot.querySelector(".chatbox");e&&(e.value=this.initialText),this.resetTabs(),this.requestUpdate("currentAttachments")}if(this.langValues&&(t.has("currentText")||t.has("currentAttachments")||t.has("currentQuickReplies"))||t.has("currentOptin")||t.has("currentTemplate")||t.has("variables")){this.checkIfEmpty();const t=this.currentText?this.currentText.trim():"";t||(this.currentAttachments||[]).length>0||this.currentQuickReplies.length>0||this.variables.length>0?this.langValues[this.currentLanguage]={text:t,attachments:this.currentAttachments,quick_replies:this.currentQuickReplies.map((t=>t.value)),optin:this.currentOptin.length>0?this.currentOptin[0]:null,template:this.currentTemplate?this.currentTemplate.uuid:null,variables:this.variables,locale:this.locale}:delete this.langValues[this.currentLanguage],this.fireCustomEvent($e.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}handleAttachmentsChanged(t){const e=t.target;this.currentAttachments=e.attachments,this.requestUpdate()}setFocusOnChatbox(){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}reset(){const t=this.shadowRoot.querySelector(".chatbox");t&&(t.textInputElement.value="",t.value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.resetTabs())}handleQuickReplyChange(){this.requestUpdate("currentQuickReplies")}handleOptInChange(t){this.currentOptin=t.target.values,this.requestUpdate("optIn")}handleChatboxChange(t){const e=t.target.getTextInput().inputElement;this.currentText=e.value,this.hasPendingText=e.value.length>0;const i=e.selectionStart,o=e.value,n=o.lastIndexOf("\n",i-1)+1,s=o.substring(n,i);if(s.startsWith("/")){"Shortcuts"!==this.currentTab.name&&this.getTabs().focusTab("Shortcuts");this.shadowRoot.querySelector("temba-shortcuts").filter=s.substring(1)}}checkIfEmpty(){const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.attachments?this.empty=t&&e:this.empty=t}getCurrentLine(){const t=this.shadowRoot.querySelector(".chatbox"),e=t.getTextInput().inputElement.selectionStart-1,i=t.value.substring(0,e).lastIndexOf("\n")+1;let o=t.value.indexOf("\n",i);return-1===o&&(o=t.value.length),{text:t.value.substring(i,o),index:i}}handleKeyDown(t){const e=this.shadowRoot.querySelector("temba-tabs"),i=parseInt(t.key);if(!Number.isNaN(i)&&i>0&&t.ctrlKey&&t.metaKey&&i<=e.options.length&&(e.index=i-1),"Backspace"===t.key){"/"===this.getCurrentLine().text&&e.focusTab("Reply")}if(("Shortcuts"!==this.currentTab.name||"Enter"!==t.key||t.shiftKey)&&"Enter"===t.key&&!t.shiftKey)if(t.preventDefault(),this.completion){t.target.hasVisibleOptions()||this.triggerSend()}else this.triggerSend()}triggerSend(){this.empty||this.fireCustomEvent($e.Submitted,{langValues:this.langValues})}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.getTabs().focusTab("Reply")}getTabs(){return this.shadowRoot.querySelector("temba-tabs")}render(){return V`
|
|
6245
6260
|
<temba-field
|
|
6246
6261
|
name=${this.name}
|
|
6247
6262
|
.errors=${this.errors}
|
|
@@ -6249,7 +6264,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6249
6264
|
.value=${this.value}
|
|
6250
6265
|
class=${Zt({"active-template":!!this.currentTemplate&&this.currentTab&&"Template"===this.currentTab.name})}
|
|
6251
6266
|
>
|
|
6252
|
-
${this.languages.length>1?
|
|
6267
|
+
${this.languages.length>1?V`<temba-select
|
|
6253
6268
|
@change=${this.handleLanguageChange}
|
|
6254
6269
|
class="language"
|
|
6255
6270
|
name="language"
|
|
@@ -6261,7 +6276,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6261
6276
|
<div class="items actions">${this.getActions()}</div>
|
|
6262
6277
|
</div>
|
|
6263
6278
|
</temba-field>
|
|
6264
|
-
`}handleTemplateChanged(t){var e;this.currentTemplate=t.detail.template,this.locale=null===(e=t.detail.translation)||void 0===e?void 0:e.locale,this.requestUpdate()}handleTemplateVariablesChanged(t){this.variables=[...t.detail.variables]}getTextInput(){return this.shadowRoot.querySelector(".chatbox").getTextInput()}handleShortcutSelection(t){this.activeShortcut=t.detail.selected;const e=this.getCurrentLine(),i=this.getTextInput(),o=i.value;if(e.text.startsWith("/")){const t=o.substring(0,e.index)+this.activeShortcut.text+o.substring(e.index+e.text.length);i.updateValue(t);const n=e.index+this.activeShortcut.text.length;i.inputElement.setSelectionRange(n,n)}else{const t=i.inputElement.selectionStart,e=o.substring(0,t)+this.activeShortcut.text+o.substring(t);i.updateValue(e);const n=t+this.activeShortcut.text.length;i.inputElement.setSelectionRange(n,n)}const n=this.shadowRoot.querySelector("temba-tabs");n.index=n.options.findIndex((t=>"Reply"===t.name))}getActions(){const t=this.optIns&&this.isBaseLanguage(),e=this.templates&&this.isBaseLanguage();return
|
|
6279
|
+
`}handleTemplateChanged(t){var e;this.currentTemplate=t.detail.template,this.locale=null===(e=t.detail.translation)||void 0===e?void 0:e.locale,this.requestUpdate()}handleTemplateVariablesChanged(t){this.variables=[...t.detail.variables]}getTextInput(){return this.shadowRoot.querySelector(".chatbox").getTextInput()}handleShortcutSelection(t){this.activeShortcut=t.detail.selected;const e=this.getCurrentLine(),i=this.getTextInput(),o=i.value;if(e.text.startsWith("/")){const t=o.substring(0,e.index)+this.activeShortcut.text+o.substring(e.index+e.text.length);i.updateValue(t);const n=e.index+this.activeShortcut.text.length;i.inputElement.setSelectionRange(n,n)}else{const t=i.inputElement.selectionStart,e=o.substring(0,t)+this.activeShortcut.text+o.substring(t);i.updateValue(e);const n=t+this.activeShortcut.text.length;i.inputElement.setSelectionRange(n,n)}const n=this.shadowRoot.querySelector("temba-tabs");n.index=n.options.findIndex((t=>"Reply"===t.name))}getActions(){const t=this.optIns&&this.isBaseLanguage(),e=this.templates&&this.isBaseLanguage();return V`
|
|
6265
6280
|
<temba-tabs
|
|
6266
6281
|
focusedname
|
|
6267
6282
|
@temba-context-changed=${this.handleTabChanged}
|
|
@@ -6272,7 +6287,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6272
6287
|
icon="message"
|
|
6273
6288
|
selectionBackground="#fff"
|
|
6274
6289
|
></temba-tab>
|
|
6275
|
-
${this.attachments?
|
|
6290
|
+
${this.attachments?V`<temba-tab
|
|
6276
6291
|
name="Attachments"
|
|
6277
6292
|
icon="attachment"
|
|
6278
6293
|
selectionBackground="#fff"
|
|
@@ -6287,7 +6302,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6287
6302
|
></temba-media-picker>
|
|
6288
6303
|
</div>
|
|
6289
6304
|
</temba-tab>`:null}
|
|
6290
|
-
${this.quickReplies?
|
|
6305
|
+
${this.quickReplies?V`<temba-tab
|
|
6291
6306
|
name="Quick Replies"
|
|
6292
6307
|
icon="quick_replies"
|
|
6293
6308
|
selectionBackground="#fff"
|
|
@@ -6305,7 +6320,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6305
6320
|
placeholder="Add Quick Reply"
|
|
6306
6321
|
></temba-select>
|
|
6307
6322
|
</temba-tab>`:null}
|
|
6308
|
-
${t?
|
|
6323
|
+
${t?V`<temba-tab
|
|
6309
6324
|
name="Opt-in"
|
|
6310
6325
|
icon="channel_fba"
|
|
6311
6326
|
selectionBackground="#fff"
|
|
@@ -6322,7 +6337,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6322
6337
|
placeholder="Select an opt-in to use for Facebook (optional)"
|
|
6323
6338
|
></temba-select>
|
|
6324
6339
|
</temba-tab>`:null}
|
|
6325
|
-
${e?
|
|
6340
|
+
${e?V`<temba-tab
|
|
6326
6341
|
name="Template"
|
|
6327
6342
|
icon="channel_wa"
|
|
6328
6343
|
selectionBackground="#fff"
|
|
@@ -6350,7 +6365,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6350
6365
|
borderColor="#ebdf6f"
|
|
6351
6366
|
></temba-tab-->
|
|
6352
6367
|
|
|
6353
|
-
${this.shortcuts?
|
|
6368
|
+
${this.shortcuts?V`<temba-tab
|
|
6354
6369
|
name="Shortcuts"
|
|
6355
6370
|
icon="shortcut"
|
|
6356
6371
|
selectionBackground="#fff"
|
|
@@ -6385,7 +6400,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6385
6400
|
</temba-completion>
|
|
6386
6401
|
</div>
|
|
6387
6402
|
</temba-tabs>
|
|
6388
|
-
`}getCounter(){return
|
|
6403
|
+
`}getCounter(){return V`<temba-charcount
|
|
6389
6404
|
.text="${this.currentText}"
|
|
6390
6405
|
></temba-charcount>`}}t([ce({type:Number})],tc.prototype,"index",void 0),t([ce({type:Number})],tc.prototype,"maxAttachments",void 0),t([ce({type:Number})],tc.prototype,"maxLength",void 0),t([ce({type:Boolean})],tc.prototype,"completion",void 0),t([ce({type:Boolean})],tc.prototype,"attachments",void 0),t([ce({type:Boolean})],tc.prototype,"quickReplies",void 0),t([ce({type:Boolean})],tc.prototype,"optIns",void 0),t([ce({type:Boolean})],tc.prototype,"templates",void 0),t([ce({type:Boolean})],tc.prototype,"counter",void 0),t([ce({type:Boolean})],tc.prototype,"autogrow",void 0),t([ce({type:Boolean})],tc.prototype,"shortcuts",void 0),t([ce({type:String})],tc.prototype,"currentText",void 0),t([ce({type:String})],tc.prototype,"initialText",void 0),t([ce({type:String})],tc.prototype,"accept",void 0),t([ce({type:String,attribute:!1})],tc.prototype,"endpoint",void 0),t([ce({type:Boolean,attribute:!1})],tc.prototype,"uploading",void 0),t([ce({type:Array})],tc.prototype,"languages",void 0),t([ce({type:Array})],tc.prototype,"currentAttachments",void 0),t([ce({type:Array})],tc.prototype,"currentQuickReplies",void 0),t([ce({type:Array})],tc.prototype,"currentOptin",void 0),t([ce({type:Array})],tc.prototype,"variables",void 0),t([ce({type:String})],tc.prototype,"template",void 0),t([ce({type:Object})],tc.prototype,"currentTemplate",void 0),t([ce({type:String})],tc.prototype,"locale",void 0),t([ce({type:String})],tc.prototype,"optinEndpoint",void 0),t([ce({type:String})],tc.prototype,"templateEndpoint",void 0),t([ce({type:Boolean,attribute:!1})],tc.prototype,"empty",void 0),t([ce({type:Boolean,attribute:"widget_only"})],tc.prototype,"widgetOnly",void 0),t([ce({type:Array})],tc.prototype,"errors",void 0),t([ce({type:Object})],tc.prototype,"langValues",void 0),t([ce({type:String})],tc.prototype,"currentLanguage",void 0),t([ce({type:Object})],tc.prototype,"currentTab",void 0),t([ce({type:Boolean})],tc.prototype,"hasPendingText",void 0),t([ce({type:Object})],tc.prototype,"activeShortcut",void 0);class ec extends pe{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`
|
|
6391
6406
|
:host {
|
|
@@ -6417,7 +6432,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6417
6432
|
overflow: hidden;
|
|
6418
6433
|
box-shadow: 0 0 12px 3px rgba(0, 0, 0, 0.15);
|
|
6419
6434
|
}
|
|
6420
|
-
`}updated(t){t.has("show")&&this.show&&window.setTimeout((()=>{this.zoom=!0}),0),t.has("zoom")&&!this.zoom&&this.show&&window.setTimeout((()=>{this.show=!1}),this.animationTime)}showElement(t){const e=t.getBoundingClientRect();this.ele=t.cloneNode(),this.ele.zoom=!0,this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height,this.xTrans="0px",this.yTrans="0px",this.scale=1;let i=this.width,o=this.height,n=this.scale;const s=window.innerHeight*this.zoomPct,r=window.innerWidth*this.zoomPct;this.width*(s/this.height)<r?(o=window.innerHeight*this.zoomPct,n=o/this.height,i=this.width*n):(i=window.innerWidth*this.zoomPct,n=i/this.width,o=this.height*n);const a=(i-this.width)/2,l=(window.innerWidth-i)/2;this.xTrans=l-this.left+a+"px";const h=(o-this.height)/2,c=(window.innerHeight-o)/2;this.yTrans=c-this.top+h+"px",this.scale=n,this.show=!0}handleClick(){this.zoom=!1}render(){const t={transition:`transform ${this.animationTime}ms ease, box-shadow ${this.animationTime}ms ease`};return this.show&&(t.left=this.left+"px",t.top=this.top+"px",t.width=this.width+"px",t.height=this.height+"px"),this.zoom&&(t.transform=`translate(${this.xTrans}, ${this.yTrans}) scale(${this.scale}, ${this.scale})`),
|
|
6435
|
+
`}updated(t){t.has("show")&&this.show&&window.setTimeout((()=>{this.zoom=!0}),0),t.has("zoom")&&!this.zoom&&this.show&&window.setTimeout((()=>{this.show=!1}),this.animationTime)}showElement(t){const e=t.getBoundingClientRect();this.ele=t.cloneNode(),this.ele.zoom=!0,this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height,this.xTrans="0px",this.yTrans="0px",this.scale=1;let i=this.width,o=this.height,n=this.scale;const s=window.innerHeight*this.zoomPct,r=window.innerWidth*this.zoomPct;this.width*(s/this.height)<r?(o=window.innerHeight*this.zoomPct,n=o/this.height,i=this.width*n):(i=window.innerWidth*this.zoomPct,n=i/this.width,o=this.height*n);const a=(i-this.width)/2,l=(window.innerWidth-i)/2;this.xTrans=l-this.left+a+"px";const h=(o-this.height)/2,c=(window.innerHeight-o)/2;this.yTrans=c-this.top+h+"px",this.scale=n,this.show=!0}handleClick(){this.zoom=!1}render(){const t={transition:`transform ${this.animationTime}ms ease, box-shadow ${this.animationTime}ms ease`};return this.show&&(t.left=this.left+"px",t.top=this.top+"px",t.width=this.width+"px",t.height=this.height+"px"),this.zoom&&(t.transform=`translate(${this.xTrans}, ${this.yTrans}) scale(${this.scale}, ${this.scale})`),V`
|
|
6421
6436
|
<div
|
|
6422
6437
|
class=${Zt({container:!0,show:this.show,zoom:this.zoom})}
|
|
6423
6438
|
@click=${this.handleClick}
|
|
@@ -6539,7 +6554,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6539
6554
|
.color-picker:focus {
|
|
6540
6555
|
outline: none;
|
|
6541
6556
|
}
|
|
6542
|
-
`}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t),t.has("value")&&(this.previewColor=this.value||"#9c9c9c",this.hex=this.value),t.has("selecting")&&this.selecting&&window.setTimeout((()=>{this.selecting=!1}),100),t.has("previewLabel")&&this.hue&&(this.hex=ae(this.hue,this.saturation,this.lightness))}handleBlur(){this.expanded&&(this.expanded=!1)}handleMouseOut(){this.previewColor=this.value,this.hex=this.value}handleMouseMove(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,o=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-o/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.hex=ae(this.hue,this.saturation,this.lightness)}}handlePreviewClick(){this.expanded=!this.expanded,this.selecting=!0,this.shadowRoot.querySelector(".color-picker").focus()}handleColorClick(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,o=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-o/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.value=this.hex,this.selecting=!0,this.expanded=!1}this.expanded}handleHexInput(t){const e=t.target.value;e.startsWith("#")&&(this.previewColor=e,this.value=e)}serializeValue(t){return t}render(){return
|
|
6557
|
+
`}firstUpdated(t){super.firstUpdated(t)}updated(t){super.updated(t),t.has("value")&&(this.previewColor=this.value||"#9c9c9c",this.hex=this.value),t.has("selecting")&&this.selecting&&window.setTimeout((()=>{this.selecting=!1}),100),t.has("previewLabel")&&this.hue&&(this.hex=ae(this.hue,this.saturation,this.lightness))}handleBlur(){this.expanded&&(this.expanded=!1)}handleMouseOut(){this.previewColor=this.value,this.hex=this.value}handleMouseMove(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,o=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-o/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.hex=ae(this.hue,this.saturation,this.lightness)}}handlePreviewClick(){this.expanded=!this.expanded,this.selecting=!0,this.shadowRoot.querySelector(".color-picker").focus()}handleColorClick(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,o=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-o/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.value=this.hex,this.selecting=!0,this.expanded=!1}this.expanded}handleHexInput(t){const e=t.target.value;e.startsWith("#")&&(this.previewColor=e,this.value=e)}serializeValue(t){return t}render(){return V`
|
|
6543
6558
|
<temba-field
|
|
6544
6559
|
name=${this.name}
|
|
6545
6560
|
.helpText=${this.helpText}
|
|
@@ -6575,7 +6590,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6575
6590
|
</div>
|
|
6576
6591
|
</div>
|
|
6577
6592
|
</temba-field>
|
|
6578
|
-
`}}t([ce({type:Boolean})],ic.prototype,"expanded",void 0),t([ce({type:String})],ic.prototype,"previewColor",void 0),t([ce({type:String})],ic.prototype,"labelColor",void 0),t([ce({type:Boolean})],ic.prototype,"selecting",void 0),t([ce({type:Number})],ic.prototype,"hue",void 0),t([ce({type:Number})],ic.prototype,"saturation",void 0),t([ce({type:Number})],ic.prototype,"lightness",void 0),t([ce({type:String})],ic.prototype,"hex",void 0);class oc extends ml{constructor(){super(),this.minWidth=200,this.maxWidth=2e3,this.resizing=!1,this.startResize=this.startResize.bind(this),this.resize=this.resize.bind(this),this.stopResize=this.stopResize.bind(this)}updated(t){super.updated(t),t.has("currentWidth")&&this.style.setProperty("--box-width",`${this.currentWidth}px`)}setWidth(t){const e=Math.min(Math.max(t,this.minWidth),this.maxWidth);this.currentWidth=e}startResize(t){this.initialX=t.x,this.boxWidth=this.offsetWidth,document.body.style.userSelect="none",this.resizing=!0,window.addEventListener("mousemove",this.resize),window.addEventListener("mouseup",this.stopResize),this.requestUpdate()}resize(t){const e=t.x-this.initialX;this.setWidth(this.boxWidth+e)}stopResize(){document.body.style.userSelect="initial",window.removeEventListener("mousemove",this.resize),window.removeEventListener("mouseup",this.stopResize),this.requestUpdate(),this.resizing=!1,this.fireCustomEvent($e.Resized,{width:this.currentWidth})}render(){return
|
|
6593
|
+
`}}t([ce({type:Boolean})],ic.prototype,"expanded",void 0),t([ce({type:String})],ic.prototype,"previewColor",void 0),t([ce({type:String})],ic.prototype,"labelColor",void 0),t([ce({type:Boolean})],ic.prototype,"selecting",void 0),t([ce({type:Number})],ic.prototype,"hue",void 0),t([ce({type:Number})],ic.prototype,"saturation",void 0),t([ce({type:Number})],ic.prototype,"lightness",void 0),t([ce({type:String})],ic.prototype,"hex",void 0);class oc extends ml{constructor(){super(),this.minWidth=200,this.maxWidth=2e3,this.resizing=!1,this.startResize=this.startResize.bind(this),this.resize=this.resize.bind(this),this.stopResize=this.stopResize.bind(this)}updated(t){super.updated(t),t.has("currentWidth")&&this.style.setProperty("--box-width",`${this.currentWidth}px`)}setWidth(t){const e=Math.min(Math.max(t,this.minWidth),this.maxWidth);this.currentWidth=e}startResize(t){this.initialX=t.x,this.boxWidth=this.offsetWidth,document.body.style.userSelect="none",this.resizing=!0,window.addEventListener("mousemove",this.resize),window.addEventListener("mouseup",this.stopResize),this.requestUpdate()}resize(t){const e=t.x-this.initialX;this.setWidth(this.boxWidth+e)}stopResize(){document.body.style.userSelect="initial",window.removeEventListener("mousemove",this.resize),window.removeEventListener("mouseup",this.stopResize),this.requestUpdate(),this.resizing=!1,this.fireCustomEvent($e.Resized,{width:this.currentWidth})}render(){return V`
|
|
6579
6594
|
<div
|
|
6580
6595
|
class=${Zt({resizer:!0,resizing:this.resizing})}
|
|
6581
6596
|
@mousedown="${this.startResize}"
|
|
@@ -6686,7 +6701,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6686
6701
|
.zoom temba-icon {
|
|
6687
6702
|
display: none;
|
|
6688
6703
|
}
|
|
6689
|
-
`}updated(t){if(super.updated(t),t.has("attachment")&&this.attachment){const t=this.attachment.indexOf(":");if(-1===t)this.url=this.attachment;else{const e=this.attachment.substring(0,t);this.url=this.attachment.substring(t+1),e.startsWith("image")?this.contentType=Jh.IMAGE:e.startsWith("audio")?this.contentType=Jh.AUDIO:e.startsWith("video")?this.contentType=Jh.VIDEO:e.startsWith("application")?this.contentType=Jh.DOCUMENT:this.contentType=Jh.OTHER}}}handleThumbnailClicked(){this.contentType===Jh.IMAGE?window.setTimeout((()=>{document.querySelector("temba-lightbox").showElement(this)}),100):window.open(this.url,"_blank")}render(){return
|
|
6704
|
+
`}updated(t){if(super.updated(t),t.has("attachment")&&this.attachment){const t=this.attachment.indexOf(":");if(-1===t)this.url=this.attachment;else{const e=this.attachment.substring(0,t);this.url=this.attachment.substring(t+1),e.startsWith("image")?this.contentType=Jh.IMAGE:e.startsWith("audio")?this.contentType=Jh.AUDIO:e.startsWith("video")?this.contentType=Jh.VIDEO:e.startsWith("application")?this.contentType=Jh.DOCUMENT:this.contentType=Jh.OTHER}}}handleThumbnailClicked(){this.contentType===Jh.IMAGE?window.setTimeout((()=>{document.querySelector("temba-lightbox").showElement(this)}),100):window.open(this.url,"_blank")}render(){return V`
|
|
6690
6705
|
<div
|
|
6691
6706
|
@click=${this.handleThumbnailClicked.bind(this)}
|
|
6692
6707
|
class="${Zt({wrapper:!0,zoom:this.zoom})}"
|
|
@@ -6696,7 +6711,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6696
6711
|
class="thumb ${this.contentType} "
|
|
6697
6712
|
style="${this.url?Ae({backgroundImage:`url(${this.url})`}):""}"
|
|
6698
6713
|
>
|
|
6699
|
-
${this.contentType!==Jh.IMAGE?
|
|
6714
|
+
${this.contentType!==Jh.IMAGE?V`<temba-icon
|
|
6700
6715
|
size="1.5"
|
|
6701
6716
|
name="${nc[this.contentType]}"
|
|
6702
6717
|
></temba-icon>`:null}
|
|
@@ -6953,7 +6968,7 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6953
6968
|
temba-loading.hidden {
|
|
6954
6969
|
display: none;
|
|
6955
6970
|
}
|
|
6956
|
-
`}constructor(){super(),this.messageGroups=[],this.status=rc.DISCONNECTED,this.open=!1,this.hasPendingText=!1,this.blockHistoryFetching=!1,this.newMessageCount=0}firstUpdated(t){super.firstUpdated(t),this.chat=this.shadowRoot.querySelector("temba-chat");const e=document.createElement("temba-lightbox");document.querySelector("body").appendChild(e)}handleReconnect(){this.openSocket()}sendSockMessage(t){console.log("out",t),this.sock.send(JSON.stringify(t))}openSocket(){if(this.status!==rc.DISCONNECTED)return;this.status=rc.CONNECTING;const t=this;let e=`wss://localhost.textit.com/wc/connect/${this.channel}/`;this.urn&&(e=`${e}?chat_id=${this.urn}`);const i=new WebSocket(e);this.sock=i,this.sock.onclose=function(){t.status=rc.DISCONNECTED},this.sock.onopen=function(){t.beforeTime=(new Date).toISOString(),t.status=rc.CONNECTED,t.urn=oe("temba-chat-urn");const e={type:"start_chat"};t.urn&&(e.chat_id=t.urn),t.sendSockMessage(e)},this.sock.onmessage=function(e){t.status=rc.CONNECTED;const i=JSON.parse(e.data);if(console.log("in",i),"chat_started"===i.type){const e=i;t.urn!==e.chat_id&&(t.messageGroups=[]),t.urn=e.chat_id,((t,e,i)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const o=new Date;o.setTime(o.getTime()+2592e6),document.cookie=`${t}=${e};expires=${o.toUTCString()};path=${i}`})("temba-chat-urn",e.chat_id),t.requestUpdate("messageGroups")}else if("chat_resumed"===i.type){const e=i;t.urn=e.chat_id,t.fetchPreviousMessages()}else if("chat_out"===i.type){const e=i;t.chat.addMessages([ac(e)],null,!0);const o={type:"ack_chat",msg_id:e.msg_out.id};t.sendSockMessage(o)}else"history"===i.type&&t.handleHistoryResponse(i)},this.sock.onerror=function(){t.status=rc.DISCONNECTED}}fetchPreviousMessages(){if(!this.blockHistoryFetching){this.fetchRequested=new Date,this.blockHistoryFetching=!0,this.chat.fetching=!0;const t={type:"get_history",before:this.beforeTime};this.fetchRequested=new Date,this.sendSockMessage(t)}}handleHistoryResponse(t){const e=t.history.reverse();if(e.length>0){const t=e[0];if(t.msg_in){const e=t.msg_in;this.beforeTime=e.time}else if(t.msg_out){const e=t.msg_out;this.beforeTime=e.time}}this.chat.addMessages(e.map(ac),this.fetchRequested)}fetchComplete(){this.blockHistoryFetching=!1}focusInput(){const t=this.shadowRoot.querySelector(".input");t&&t.focus()}updated(t){super.updated(t),this.open&&t.has("open")&&void 0!==t.get("open")&&this.status===rc.DISCONNECTED&&this.openSocket(),t.has("status")&&this.status===rc.CONNECTED&&this.focusInput()}openChat(){this.open=!0}handleKeyUp(t){this.hasPendingText&&"Enter"===t.key&&this.sendPendingMessage(),this.hasPendingText=t.target.value.length>0}sendPendingMessage(){if(this.status===rc.CONNECTED){const t=this.shadowRoot.querySelector(".input"),e=t.value;t.value="";const i={type:"send_msg",text:e};this.sendSockMessage(i);const o=new Date;this.chat.addMessages([{type:Nl.MsgIn,text:e,date:o}],o,!0),this.hasPendingText=t.value.length>0}}handleClickInputPanel(t){t.preventDefault(),t.stopPropagation();this.shadowRoot.querySelector(".input").focus()}toggleChat(){this.open=!this.open}render(){return
|
|
6971
|
+
`}constructor(){super(),this.messageGroups=[],this.status=rc.DISCONNECTED,this.open=!1,this.hasPendingText=!1,this.blockHistoryFetching=!1,this.newMessageCount=0}firstUpdated(t){super.firstUpdated(t),this.chat=this.shadowRoot.querySelector("temba-chat");const e=document.createElement("temba-lightbox");document.querySelector("body").appendChild(e)}handleReconnect(){this.openSocket()}sendSockMessage(t){console.log("out",t),this.sock.send(JSON.stringify(t))}openSocket(){if(this.status!==rc.DISCONNECTED)return;this.status=rc.CONNECTING;const t=this;let e=`wss://localhost.textit.com/wc/connect/${this.channel}/`;this.urn&&(e=`${e}?chat_id=${this.urn}`);const i=new WebSocket(e);this.sock=i,this.sock.onclose=function(){t.status=rc.DISCONNECTED},this.sock.onopen=function(){t.beforeTime=(new Date).toISOString(),t.status=rc.CONNECTED,t.urn=oe("temba-chat-urn");const e={type:"start_chat"};t.urn&&(e.chat_id=t.urn),t.sendSockMessage(e)},this.sock.onmessage=function(e){t.status=rc.CONNECTED;const i=JSON.parse(e.data);if(console.log("in",i),"chat_started"===i.type){const e=i;t.urn!==e.chat_id&&(t.messageGroups=[]),t.urn=e.chat_id,((t,e,i)=>{if(!i){const t=document.location.pathname;i=t.substring(0,t.indexOf("/",1))}const o=new Date;o.setTime(o.getTime()+2592e6),document.cookie=`${t}=${e};expires=${o.toUTCString()};path=${i}`})("temba-chat-urn",e.chat_id),t.requestUpdate("messageGroups")}else if("chat_resumed"===i.type){const e=i;t.urn=e.chat_id,t.fetchPreviousMessages()}else if("chat_out"===i.type){const e=i;t.chat.addMessages([ac(e)],null,!0);const o={type:"ack_chat",msg_id:e.msg_out.id};t.sendSockMessage(o)}else"history"===i.type&&t.handleHistoryResponse(i)},this.sock.onerror=function(){t.status=rc.DISCONNECTED}}fetchPreviousMessages(){if(!this.blockHistoryFetching){this.fetchRequested=new Date,this.blockHistoryFetching=!0,this.chat.fetching=!0;const t={type:"get_history",before:this.beforeTime};this.fetchRequested=new Date,this.sendSockMessage(t)}}handleHistoryResponse(t){const e=t.history.reverse();if(e.length>0){const t=e[0];if(t.msg_in){const e=t.msg_in;this.beforeTime=e.time}else if(t.msg_out){const e=t.msg_out;this.beforeTime=e.time}}this.chat.addMessages(e.map(ac),this.fetchRequested)}fetchComplete(){this.blockHistoryFetching=!1}focusInput(){const t=this.shadowRoot.querySelector(".input");t&&t.focus()}updated(t){super.updated(t),this.open&&t.has("open")&&void 0!==t.get("open")&&this.status===rc.DISCONNECTED&&this.openSocket(),t.has("status")&&this.status===rc.CONNECTED&&this.focusInput()}openChat(){this.open=!0}handleKeyUp(t){this.hasPendingText&&"Enter"===t.key&&this.sendPendingMessage(),this.hasPendingText=t.target.value.length>0}sendPendingMessage(){if(this.status===rc.CONNECTED){const t=this.shadowRoot.querySelector(".input"),e=t.value;t.value="";const i={type:"send_msg",text:e};this.sendSockMessage(i);const o=new Date;this.chat.addMessages([{type:Nl.MsgIn,text:e,date:o}],o,!0),this.hasPendingText=t.value.length>0}}handleClickInputPanel(t){t.preventDefault(),t.stopPropagation();this.shadowRoot.querySelector(".input").focus()}toggleChat(){this.open=!this.open}render(){return V`
|
|
6957
6972
|
<div class="chat ${this.status} ${this.open?"open":""}">
|
|
6958
6973
|
<div class="header">
|
|
6959
6974
|
<slot name="header">${this.urn?this.urn:"Chat"}</slot>
|
|
@@ -6970,18 +6985,18 @@ let fr=Ys,vr=!1;const br=["es","fr","pt"],yr="data:image/png;base64,iVBORw0KGgoA
|
|
|
6970
6985
|
@temba-fetch-complete=${this.fetchComplete}
|
|
6971
6986
|
></temba-chat>
|
|
6972
6987
|
|
|
6973
|
-
${this.status===rc.DISCONNECTED?
|
|
6988
|
+
${this.status===rc.DISCONNECTED?V`<div class="notice">
|
|
6974
6989
|
<div>This chat is not currently connected.</div>
|
|
6975
6990
|
<div class="reconnect" @click=${this.handleReconnect}>
|
|
6976
6991
|
Click here to reconnect
|
|
6977
6992
|
<div></div>
|
|
6978
6993
|
</div>
|
|
6979
6994
|
</div>`:null}
|
|
6980
|
-
${this.status===rc.CONNECTING?
|
|
6995
|
+
${this.status===rc.CONNECTING?V`<div class="notice">
|
|
6981
6996
|
<div>Connecting</div>
|
|
6982
6997
|
<temba-icon name="progress_spinner" spin></temba-icon>
|
|
6983
6998
|
</div>`:null}
|
|
6984
|
-
${this.status===rc.CONNECTED?
|
|
6999
|
+
${this.status===rc.CONNECTED?V` <div class="border"></div>
|
|
6985
7000
|
<div
|
|
6986
7001
|
class="row input-panel ${this.hasPendingText?"pending":""}"
|
|
6987
7002
|
@click=${this.handleClickInputPanel}
|
|
@@ -7261,7 +7276,7 @@ background: #ccc;
|
|
|
7261
7276
|
.cr-rotate-r i:before {
|
|
7262
7277
|
content: '↻';
|
|
7263
7278
|
}
|
|
7264
|
-
`;class cc extends me{constructor(){super(...arguments),this.shape="square",this.showCroppie=!1,this.uploadReader=new FileReader}firstUpdated(t){super.firstUpdated(t);const e=this;this.uploadReader.onload=function(){e.launchCroppie(e.uploadReader.result)}}updated(t){super.updated(t),t.has("url")&&this.setAttribute("url",this.url)}closeCroppie(){this.showCroppie=!1;const t=this.shadowRoot.querySelector(".croppie .embed");t.firstChild&&t.removeChild(t.firstChild)}launchCroppie(t){const e=this.shadowRoot.querySelector(".croppie .embed");e.firstChild&&e.removeChild(e.firstChild),this.showCroppie=!0;const i=document.createElement("div");e.appendChild(i);const o=window.Croppie;this.croppie=new o(i,{enableExif:!0,viewport:{width:300,height:300,type:this.shape},boundary:{width:400,height:400}}),this.croppie.bind({url:t})}saveResult(){const t=this;this.croppie.result({type:"blob",size:"viewport",format:"webp",quality:1,circle:!1}).then((function(e){const i=e;t.url=URL.createObjectURL(i);const o=new FormData;o.append(t.name,i,"filename.webp"),t.value=o,t.closeCroppie()}))}handleToggleClicked(){this.shadowRoot.querySelector("#file").click()}handleFileChanged(t){const e=t.target;e.files.length>0&&this.uploadReader.readAsDataURL(e.files[0]),e.value=""}render(){return
|
|
7279
|
+
`;class cc extends me{constructor(){super(...arguments),this.shape="square",this.showCroppie=!1,this.uploadReader=new FileReader}firstUpdated(t){super.firstUpdated(t);const e=this;this.uploadReader.onload=function(){e.launchCroppie(e.uploadReader.result)}}updated(t){super.updated(t),t.has("url")&&this.setAttribute("url",this.url)}closeCroppie(){this.showCroppie=!1;const t=this.shadowRoot.querySelector(".croppie .embed");t.firstChild&&t.removeChild(t.firstChild)}launchCroppie(t){const e=this.shadowRoot.querySelector(".croppie .embed");e.firstChild&&e.removeChild(e.firstChild),this.showCroppie=!0;const i=document.createElement("div");e.appendChild(i);const o=window.Croppie;this.croppie=new o(i,{enableExif:!0,viewport:{width:300,height:300,type:this.shape},boundary:{width:400,height:400}}),this.croppie.bind({url:t})}saveResult(){const t=this;this.croppie.result({type:"blob",size:"viewport",format:"webp",quality:1,circle:!1}).then((function(e){const i=e;t.url=URL.createObjectURL(i);const o=new FormData;o.append(t.name,i,"filename.webp"),t.value=o,t.closeCroppie()}))}handleToggleClicked(){this.shadowRoot.querySelector("#file").click()}handleFileChanged(t){const e=t.target;e.files.length>0&&this.uploadReader.readAsDataURL(e.files[0]),e.value=""}render(){return V`
|
|
7265
7280
|
<div class="wrapper ${this.shape} ${this.label?"label":""}">
|
|
7266
7281
|
<temba-field
|
|
7267
7282
|
name=${this.name}
|
|
@@ -7398,7 +7413,7 @@ background: #ccc;
|
|
|
7398
7413
|
cursor: pointer;
|
|
7399
7414
|
background: var(--color-primary-dark);
|
|
7400
7415
|
}
|
|
7401
|
-
`,t([ce({type:String})],cc.prototype,"tempImage",void 0),t([ce({type:String})],cc.prototype,"url",void 0),t([ce({type:String})],cc.prototype,"shape",void 0),t([ce({type:Boolean,attribute:!1})],cc.prototype,"showCroppie",void 0);class dc extends lt{constructor(){super(...arguments),this.show=!1}render(){return
|
|
7416
|
+
`,t([ce({type:String})],cc.prototype,"tempImage",void 0),t([ce({type:String})],cc.prototype,"url",void 0),t([ce({type:String})],cc.prototype,"shape",void 0),t([ce({type:Boolean,attribute:!1})],cc.prototype,"showCroppie",void 0);class dc extends lt{constructor(){super(...arguments),this.show=!1}render(){return V` <div class="mask ${this.show?"show":""}">
|
|
7402
7417
|
<slot></slot>
|
|
7403
7418
|
</div>`}}dc.styles=r`
|
|
7404
7419
|
.mask {
|
|
@@ -7528,7 +7543,7 @@ background: #ccc;
|
|
|
7528
7543
|
color: #777;
|
|
7529
7544
|
margin-left: 0.25em;
|
|
7530
7545
|
}
|
|
7531
|
-
`}updated(t){super.updated(t),t.has("template")&&(this.textInputAttachments={},this.currentVariables=this.variables||[],this.currentVariables.length>0&&this.currentVariables.forEach(((t,e)=>{const i=t.split(":");i.length>1&&-1===i[0].indexOf("/")&&(this.textInputAttachments[e]=!0)})))}handleTemplateChanged(t){const e=this.selectedTemplate;this.selectedTemplate=t.target.values[0],e&&(this.currentVariables=[],this.textInputAttachments={}),this.selectedTemplate?(this.translation=this.selectedTemplate.base_translation,this.translation?this.variables=new Array((this.translation.variables||[]).length).fill(""):this.variables=[]):(this.translation=null,this.variables=[]),this.fireCustomEvent($e.ContextChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.currentVariables})}handleAttachmentLoading(t){const e=t.target,i=parseInt(e.getAttribute("index"));this.pickersLoading[i]=t.detail.loading,this.requestUpdate()}handleAttachmentsChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));if(0===e.attachments.length)this.currentVariables[i]="";else{const t=e.attachments[0];t.url&&t.content_type?this.currentVariables[i]=`${t.content_type}:${t.url}`:this.currentVariables[i]=""}this.fireContentChange(),this.requestUpdate("currentVariables")}handleVariableChanged(t){const e=t.target,i=parseInt(e.getAttribute("index")),o=e.getAttribute("prefix")||"";let n=e.value;n&&(n=o+n),this.currentVariables[i]=n,this.fireContentChange()}fireContentChange(){this.fireCustomEvent($e.ContentChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.currentVariables})}renderVariables(t){var e;const i=new RegExp(`{{(${Object.keys(t.variables||[]).join("|")})}}`,"g");let o=null,n=[];t.content&&t.content.trim().length>0&&(n=(null===(e=t.content)||void 0===e?void 0:e.split(i))||[]);const s=this.currentVariables||[];return o=n.length>0?n.map(((e,i)=>{if(i%2==0)return
|
|
7546
|
+
`}updated(t){super.updated(t),t.has("template")&&(this.textInputAttachments={},this.currentVariables=this.variables||[],this.currentVariables.length>0&&this.currentVariables.forEach(((t,e)=>{const i=t.split(":");i.length>1&&-1===i[0].indexOf("/")&&(this.textInputAttachments[e]=!0)})))}handleTemplateChanged(t){const e=this.selectedTemplate;this.selectedTemplate=t.target.values[0],e&&(this.currentVariables=[],this.textInputAttachments={}),this.selectedTemplate?(this.translation=this.selectedTemplate.base_translation,this.translation?this.variables=new Array((this.translation.variables||[]).length).fill(""):this.variables=[]):(this.translation=null,this.variables=[]),this.fireCustomEvent($e.ContextChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.currentVariables})}handleAttachmentLoading(t){const e=t.target,i=parseInt(e.getAttribute("index"));this.pickersLoading[i]=t.detail.loading,this.requestUpdate()}handleAttachmentsChanged(t){const e=t.target,i=parseInt(e.getAttribute("index"));if(0===e.attachments.length)this.currentVariables[i]="";else{const t=e.attachments[0];t.url&&t.content_type?this.currentVariables[i]=`${t.content_type}:${t.url}`:this.currentVariables[i]=""}this.fireContentChange(),this.requestUpdate("currentVariables")}handleVariableChanged(t){const e=t.target,i=parseInt(e.getAttribute("index")),o=e.getAttribute("prefix")||"";let n=e.value;n&&(n=o+n),this.currentVariables[i]=n,this.fireContentChange()}fireContentChange(){this.fireCustomEvent($e.ContentChanged,{template:this.selectedTemplate,translation:this.translation,variables:this.currentVariables})}renderVariables(t){var e;const i=new RegExp(`{{(${Object.keys(t.variables||[]).join("|")})}}`,"g");let o=null,n=[];t.content&&t.content.trim().length>0&&(n=(null===(e=t.content)||void 0===e?void 0:e.split(i))||[]);const s=this.currentVariables||[];return o=n.length>0?n.map(((e,i)=>{if(i%2==0)return V`<span class="text">${e}</span>`;const o=t.variables[e];return V`<temba-completion
|
|
7532
7547
|
class="variable"
|
|
7533
7548
|
type="text"
|
|
7534
7549
|
value=${o<s.length?s[o]:null}
|
|
@@ -7536,8 +7551,8 @@ background: #ccc;
|
|
|
7536
7551
|
name="${t.name}"
|
|
7537
7552
|
index="${o}"
|
|
7538
7553
|
placeholder="{{${e}}}"
|
|
7539
|
-
></temba-completion>`})):Object.values(t.variables).map((t=>{const e=this.translation.variables[t];if("image"===e.type||"document"===e.type||"audio"===e.type||"video"===e.type){let i=[];if(this.currentVariables[t]){const e=this.currentVariables[t].split(":"),o=e[0];i=[{url:e.slice(1).join(":"),content_type:o}]}const o=this.pickersLoading[t],n=e.type+":";let r=t<s.length?s[t]:null;return r&&r.startsWith(n)&&(r=r.slice(n.length)),
|
|
7540
|
-
${this.textInputAttachments[t]?
|
|
7554
|
+
></temba-completion>`})):Object.values(t.variables).map((t=>{const e=this.translation.variables[t];if("image"===e.type||"document"===e.type||"audio"===e.type||"video"===e.type){let i=[];if(this.currentVariables[t]){const e=this.currentVariables[t].split(":"),o=e[0];i=[{url:e.slice(1).join(":"),content_type:o}]}const o=this.pickersLoading[t],n=e.type+":";let r=t<s.length?s[t]:null;return r&&r.startsWith(n)&&(r=r.slice(n.length)),V`
|
|
7555
|
+
${this.textInputAttachments[t]?V` <div class="label">
|
|
7541
7556
|
${e.type.charAt(0).toUpperCase()+e.type.slice(1)}
|
|
7542
7557
|
URL
|
|
7543
7558
|
</div>
|
|
@@ -7558,7 +7573,7 @@ background: #ccc;
|
|
|
7558
7573
|
>
|
|
7559
7574
|
</temba-icon>
|
|
7560
7575
|
<div></div>
|
|
7561
|
-
</div>`:
|
|
7576
|
+
</div>`:V`
|
|
7562
7577
|
<div
|
|
7563
7578
|
class=${Zt({loading:o})}
|
|
7564
7579
|
style="
|
|
@@ -7578,7 +7593,7 @@ background: #ccc;
|
|
|
7578
7593
|
@change=${this.handleAttachmentsChanged.bind(this)}
|
|
7579
7594
|
></temba-media-picker>
|
|
7580
7595
|
<div style="flex-grow:1">
|
|
7581
|
-
${0!=i.length||o?"":
|
|
7596
|
+
${0!=i.length||o?"":V`Attach ${e.type} to continue`}
|
|
7582
7597
|
</div>
|
|
7583
7598
|
<temba-icon
|
|
7584
7599
|
clickable
|
|
@@ -7588,25 +7603,25 @@ background: #ccc;
|
|
|
7588
7603
|
></temba-icon>
|
|
7589
7604
|
</div>
|
|
7590
7605
|
`}
|
|
7591
|
-
`}})),
|
|
7606
|
+
`}})),V`<div class="content">${o}</div> `}renderComponents(t){const e=t.filter((t=>!t.type.startsWith("button/"))).map((t=>V`<div class="${t.name}">
|
|
7592
7607
|
${this.renderVariables(t)}
|
|
7593
|
-
</div>`)),i=t.filter((t=>t.type.startsWith("button/"))),o=i.length>0?this.renderButtons(i):null;return
|
|
7608
|
+
</div>`)),i=t.filter((t=>t.type.startsWith("button/"))),o=i.length>0?this.renderButtons(i):null;return V`<div class="main">${e}</div>
|
|
7594
7609
|
<div class="buttons">
|
|
7595
7610
|
${o}
|
|
7596
7611
|
<div></div>
|
|
7597
|
-
</div>`}renderButtons(t){const e=t.map((t=>t.display?
|
|
7612
|
+
</div>`}renderButtons(t){const e=t.map((t=>t.display?V`
|
|
7598
7613
|
<div class="button">
|
|
7599
7614
|
<div class="display">${t.display}</div>
|
|
7600
7615
|
${this.renderVariables(t)}
|
|
7601
7616
|
</div>
|
|
7602
|
-
`:
|
|
7617
|
+
`:V`
|
|
7603
7618
|
<div class="button">${this.renderVariables(t)}</div>
|
|
7604
|
-
`));return
|
|
7619
|
+
`));return V`<div class="button-wrapper">
|
|
7605
7620
|
<div class="button-header">Template Buttons</div>
|
|
7606
7621
|
<div class="buttons">${e}</div>
|
|
7607
|
-
</div>`}render(){let t=null;return this.translation?t=this.renderComponents(this.translation.components):this.selectedTemplate&&(t=
|
|
7622
|
+
</div>`}render(){let t=null;return this.translation?t=this.renderComponents(this.translation.components):this.selectedTemplate&&(t=V`<div class="error-message">
|
|
7608
7623
|
This template currently has no approved translations.
|
|
7609
|
-
</div>`),
|
|
7624
|
+
</div>`),V`
|
|
7610
7625
|
<div>
|
|
7611
7626
|
<temba-select
|
|
7612
7627
|
searchable
|
|
@@ -7622,7 +7637,7 @@ background: #ccc;
|
|
|
7622
7637
|
@change=${this.handleTemplateChanged}
|
|
7623
7638
|
>
|
|
7624
7639
|
</temba-select>
|
|
7625
|
-
${t?
|
|
7640
|
+
${t?V` <div class="template">${t}</div>`:null}
|
|
7626
7641
|
</div>
|
|
7627
7642
|
`}}uc.shadowRootOptions={...lt.shadowRootOptions,delegatesFocus:!0},t([ce({type:String})],uc.prototype,"url",void 0),t([ce({type:String})],uc.prototype,"template",void 0),t([ce({type:Object})],uc.prototype,"selectedTemplate",void 0),t([ce({type:Array})],uc.prototype,"variables",void 0),t([ce({type:Array})],uc.prototype,"currentVariables",void 0),t([ce({type:Object,attribute:!1})],uc.prototype,"translation",void 0),t([ce({type:Boolean})],uc.prototype,"translating",void 0);
|
|
7628
7643
|
/**
|
|
@@ -7635,8 +7650,8 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7635
7650
|
* @license
|
|
7636
7651
|
* Copyright 2017 Google LLC
|
|
7637
7652
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7638
|
-
*/class xc extends pe{constructor(){super(...arguments),this.messages=[],this.staleDuration=5e3,this.animationDuration=200,this.errorSticky=!1,this.warningSticky=!1,this.infoSticky=!1,this.messageId=0}checkForStaleMessages(){const t=new Date;this.messages.filter((t=>("error"!==t.level||!this.errorSticky)&&(("warning"!==t.level||!this.warningSticky)&&("info"!==t.level||!this.infoSticky)))).forEach((e=>{t.getTime()-e.time.getTime()>this.staleDuration&&this.removeMessage(e)})),0===this.messages.length&&this.checker&&(window.clearInterval(this.checker),this.checker=0)}addMessages(t){t.forEach((t=>{this.addMessage(t.text,t.level)}))}addMessage(t,e){const i={id:++this.messageId,text:t,level:e,time:new Date};this.messages.push(i),window.setTimeout((()=>{i.visible=!0,this.requestUpdate("messages")}),100),this.requestUpdate("messages"),this.checker&&(window.clearInterval(this.checker),this.checker=0),this.checker=window.setInterval(this.checkForStaleMessages.bind(this),1e3)}info(t){this.addMessage(t,"info")}warning(t){this.addMessage(t,"warning")}error(t){this.addMessage(t,"error")}removeMessage(t){t.removeTime=new Date,window.setTimeout((()=>{this.messages=this.messages.filter((e=>e!==t)),this.requestUpdate("messages")}),this.animationDuration),this.requestUpdate("messages")}handleMessageClicked(t){const e=t.target,i=parseInt(e.getAttribute("message_id")),o=this.messages.find((t=>t.id===i));o&&this.removeMessage(o)}render(){return
|
|
7639
|
-
${_c(this.messages,(t=>t.id),(t=>
|
|
7653
|
+
*/class xc extends pe{constructor(){super(...arguments),this.messages=[],this.staleDuration=5e3,this.animationDuration=200,this.errorSticky=!1,this.warningSticky=!1,this.infoSticky=!1,this.messageId=0}checkForStaleMessages(){const t=new Date;this.messages.filter((t=>("error"!==t.level||!this.errorSticky)&&(("warning"!==t.level||!this.warningSticky)&&("info"!==t.level||!this.infoSticky)))).forEach((e=>{t.getTime()-e.time.getTime()>this.staleDuration&&this.removeMessage(e)})),0===this.messages.length&&this.checker&&(window.clearInterval(this.checker),this.checker=0)}addMessages(t){t.forEach((t=>{this.addMessage(t.text,t.level)}))}addMessage(t,e){const i={id:++this.messageId,text:t,level:e,time:new Date};this.messages.push(i),window.setTimeout((()=>{i.visible=!0,this.requestUpdate("messages")}),100),this.requestUpdate("messages"),this.checker&&(window.clearInterval(this.checker),this.checker=0),this.checker=window.setInterval(this.checkForStaleMessages.bind(this),1e3)}info(t){this.addMessage(t,"info")}warning(t){this.addMessage(t,"warning")}error(t){this.addMessage(t,"error")}removeMessage(t){t.removeTime=new Date,window.setTimeout((()=>{this.messages=this.messages.filter((e=>e!==t)),this.requestUpdate("messages")}),this.animationDuration),this.requestUpdate("messages")}handleMessageClicked(t){const e=t.target,i=parseInt(e.getAttribute("message_id")),o=this.messages.find((t=>t.id===i));o&&this.removeMessage(o)}render(){return V`
|
|
7654
|
+
${_c(this.messages,(t=>t.id),(t=>V`
|
|
7640
7655
|
<div
|
|
7641
7656
|
style="transition-duration: ${this.animationDuration}ms"
|
|
7642
7657
|
class="message ${t.level} ${t.visible?"visible":""} ${t.removeTime?"removing":""}"
|
|
@@ -7811,7 +7826,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7811
7826
|
background-color: rgba(0, 0, 0, 0.07);
|
|
7812
7827
|
cursor: pointer;
|
|
7813
7828
|
}
|
|
7814
|
-
`}updated(t){super.updated(t),t.has("attachments")&&setTimeout((()=>{this.dispatchEvent(new Event("change"))}),0),t.has("uploading")&&this.dispatchEvent(new CustomEvent($e.Loading,{detail:{loading:this.uploading}}))}getAcceptableFiles(t){const e=t.dataTransfer;if(e){return[...e.files].filter((t=>wc(t.type,this.accept)))}}handleDragEnter(t){this.highlight(t)}handleDragOver(t){this.highlight(t)}handleDragLeave(t){this.unhighlight(t)}handleDrop(t){this.unhighlight(t),this.canAcceptAttachments()&&this.uploadFiles(this.getAcceptableFiles(t))}canAcceptAttachments(){return this.attachments.length<this.max}highlight(t){t.preventDefault(),t.stopPropagation(),this.canAcceptAttachments()&&(this.pendingDrop=!0)}unhighlight(t){t.preventDefault(),t.stopPropagation(),this.pendingDrop=!1}addCurrentAttachment(t){this.attachments.push(t),this.requestUpdate("attachments")}removeCurrentAttachment(t){this.attachments=this.attachments.filter((e=>e!==t)),this.requestUpdate("attachments")}handleRemoveFileClicked(t){const e=t.target,i=this.attachments.find((({url:t})=>t===e.id));i&&this.removeCurrentAttachment(i)}handleUploadFileInputChanged(t){const e=t.target.files;this.uploadFiles([...e])}uploadFiles(t){let e=[];e=t.filter((t=>{if(this.accept&&!wc(t.type,this.accept))return!1;return-1===this.attachments.findIndex((e=>e.filename===t.name&&e.size===t.size))?t:void 0})),e.map((t=>{this.uploadFile(t)}))}uploadFile(t){this.uploading=!0;const e=this.endpoint,i=new FormData;i.append("file",t),Jt(e,i).then((t=>{if(this.attachments.length<this.max){const e=t.json;e&&this.addCurrentAttachment(e)}})).catch((t=>{let e="";e=400===t.status?t.json.file[0]:"Server failure",console.error(e)})).finally((()=>{this.uploading=!1}))}renderUploader(){return this.uploading?
|
|
7829
|
+
`}updated(t){super.updated(t),t.has("attachments")&&setTimeout((()=>{this.dispatchEvent(new Event("change"))}),0),t.has("uploading")&&this.dispatchEvent(new CustomEvent($e.Loading,{detail:{loading:this.uploading}}))}getAcceptableFiles(t){const e=t.dataTransfer;if(e){return[...e.files].filter((t=>wc(t.type,this.accept)))}}handleDragEnter(t){this.highlight(t)}handleDragOver(t){this.highlight(t)}handleDragLeave(t){this.unhighlight(t)}handleDrop(t){this.unhighlight(t),this.canAcceptAttachments()&&this.uploadFiles(this.getAcceptableFiles(t))}canAcceptAttachments(){return this.attachments.length<this.max}highlight(t){t.preventDefault(),t.stopPropagation(),this.canAcceptAttachments()&&(this.pendingDrop=!0)}unhighlight(t){t.preventDefault(),t.stopPropagation(),this.pendingDrop=!1}addCurrentAttachment(t){this.attachments.push(t),this.requestUpdate("attachments")}removeCurrentAttachment(t){this.attachments=this.attachments.filter((e=>e!==t)),this.requestUpdate("attachments")}handleRemoveFileClicked(t){const e=t.target,i=this.attachments.find((({url:t})=>t===e.id));i&&this.removeCurrentAttachment(i)}handleUploadFileInputChanged(t){const e=t.target.files;this.uploadFiles([...e])}uploadFiles(t){let e=[];e=t.filter((t=>{if(this.accept&&!wc(t.type,this.accept))return!1;return-1===this.attachments.findIndex((e=>e.filename===t.name&&e.size===t.size))?t:void 0})),e.map((t=>{this.uploadFile(t)}))}uploadFile(t){this.uploading=!0;const e=this.endpoint,i=new FormData;i.append("file",t),Jt(e,i).then((t=>{if(this.attachments.length<this.max){const e=t.json;e&&this.addCurrentAttachment(e)}})).catch((t=>{let e="";e=400===t.status?t.json.file[0]:"Server failure",console.error(e)})).finally((()=>{this.uploading=!1}))}renderUploader(){return this.uploading?V`<temba-loading units="3" size="12"></temba-loading>`:this.attachments.length<this.max?V`<input
|
|
7815
7830
|
type="file"
|
|
7816
7831
|
id="upload-input"
|
|
7817
7832
|
?multiple=${this.max>1}
|
|
@@ -7826,7 +7841,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7826
7841
|
<div class="add-attachment">
|
|
7827
7842
|
<temba-icon name="${this.icon}" size="1.5"></temba-icon>
|
|
7828
7843
|
</div>
|
|
7829
|
-
</label>`:null}render(){return
|
|
7844
|
+
</label>`:null}render(){return V` <div
|
|
7830
7845
|
class=${Zt({container:!0,highlight:this.pendingDrop})}
|
|
7831
7846
|
@dragenter="${this.handleDragEnter}"
|
|
7832
7847
|
@dragover="${this.handleDragOver}"
|
|
@@ -7835,7 +7850,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7835
7850
|
>
|
|
7836
7851
|
<div class="drop-mask">
|
|
7837
7852
|
<div class="attachments-list">
|
|
7838
|
-
${this.attachments.map((t=>
|
|
7853
|
+
${this.attachments.map((t=>V`<div class="attachment-item">
|
|
7839
7854
|
<temba-icon
|
|
7840
7855
|
class="remove-item"
|
|
7841
7856
|
@click="${this.handleRemoveFileClicked}"
|
|
@@ -7898,19 +7913,19 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7898
7913
|
flex-grow: 1;
|
|
7899
7914
|
margin-left: 0.5em;
|
|
7900
7915
|
}
|
|
7901
|
-
`}handleChange(){this.markDirty()}submitChanges(){const t=this.shadowRoot.querySelector(".notepad").value;this.postChanges({note:t}).then((()=>{this.markClean()}))}updated(t){var e;super.updated(t),t.has("data")&&(this.note=(null===(e=this.data)||void 0===e?void 0:e.notes.length)>0?{...this.data.notes[this.data.notes.length-1]}:null,this.fireCustomEvent($e.DetailsChanged,{count:this.note&&this.note.text.length>0?1:0}),this.markClean())}render(){return this.data?
|
|
7916
|
+
`}handleChange(){this.markDirty()}submitChanges(){const t=this.shadowRoot.querySelector(".notepad").value;this.postChanges({note:t}).then((()=>{this.markClean()}))}updated(t){var e;super.updated(t),t.has("data")&&(this.note=(null===(e=this.data)||void 0===e?void 0:e.notes.length)>0?{...this.data.notes[this.data.notes.length-1]}:null,this.fireCustomEvent($e.DetailsChanged,{count:this.note&&this.note.text.length>0?1:0}),this.markClean())}render(){return this.data?V`
|
|
7902
7917
|
<div class="wrapper">
|
|
7903
7918
|
<!-- prettier-ignore -->
|
|
7904
7919
|
<textarea class="notepad" @input=${this.handleChange} .value=${this.note?this.note.text:""}></textarea>
|
|
7905
7920
|
<div class="toolbar">
|
|
7906
7921
|
<div class="updated">
|
|
7907
|
-
${this.note?
|
|
7922
|
+
${this.note?V`Last updated by ${Dl(this.note.created_by)}
|
|
7908
7923
|
<temba-date
|
|
7909
7924
|
value="${this.note.created_on}"
|
|
7910
7925
|
display="duration"
|
|
7911
7926
|
></temba-date>`:null}
|
|
7912
7927
|
</div>
|
|
7913
|
-
${this.dirty?
|
|
7928
|
+
${this.dirty?V`
|
|
7914
7929
|
<temba-button
|
|
7915
7930
|
name="Save"
|
|
7916
7931
|
small
|
|
@@ -7932,7 +7947,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7932
7947
|
.estimate {
|
|
7933
7948
|
font-size: 0.9em;
|
|
7934
7949
|
}
|
|
7935
|
-
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,this.scheduleRefresh(Math.min(5e3*this.fetches,6e4));const e=this.folders.outbox;this.backlogSize=e.current,e.current>1&&this.estimateCompletion()}))}estimateCompletion(){if(this.lastFetch){const t=(this.lastFetch.getTime()-this.firstFetch.getTime())/1e3,e=this.folders.sent,i=this.folders.failed,o=e.current+i.current-(e.start+i.start);this.msgsPerSecond=o/t;const n=this.folders.outbox.current/this.msgsPerSecond;this.estimatedCompletionDate=new Date((new Date).getTime()+1e3*n)}}scheduleRefresh(t){setTimeout((()=>{this.fetchFolders()}),t)}firstUpdated(t){t.has("endpoint")&&this.endpoint&&this.fetchFolders()}hasBacklog(){return this.backlogSize>5e5}render(){const t=Math.round(this.msgsPerSecond);return this.hasBacklog()&&this.estimatedCompletionDate&&!this.isMobile()?
|
|
7950
|
+
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,this.scheduleRefresh(Math.min(5e3*this.fetches,6e4));const e=this.folders.outbox;this.backlogSize=e.current,e.current>1&&this.estimateCompletion()}))}estimateCompletion(){if(this.lastFetch){const t=(this.lastFetch.getTime()-this.firstFetch.getTime())/1e3,e=this.folders.sent,i=this.folders.failed,o=e.current+i.current-(e.start+i.start);this.msgsPerSecond=o/t;const n=this.folders.outbox.current/this.msgsPerSecond;this.estimatedCompletionDate=new Date((new Date).getTime()+1e3*n)}}scheduleRefresh(t){setTimeout((()=>{this.fetchFolders()}),t)}firstUpdated(t){t.has("endpoint")&&this.endpoint&&this.fetchFolders()}hasBacklog(){return this.backlogSize>5e5}render(){const t=Math.round(this.msgsPerSecond);return this.hasBacklog()&&this.estimatedCompletionDate&&!this.isMobile()?V`<div class="monitor">
|
|
7936
7951
|
<temba-alert
|
|
7937
7952
|
><div class="header">Outbox Notice</div>
|
|
7938
7953
|
<div class="estimate">
|
|
@@ -7948,19 +7963,19 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
7948
7963
|
>.
|
|
7949
7964
|
</div></temba-alert
|
|
7950
7965
|
>
|
|
7951
|
-
</div>`:null}}t([ce({type:Number})],Sc.prototype,"backlogSize",void 0),t([ce({type:String})],Sc.prototype,"endpoint",void 0),t([ce({type:Object})],Sc.prototype,"firstFetch",void 0),t([ce({type:Object})],Sc.prototype,"lastFetch",void 0),t([ce({type:Number})],Sc.prototype,"fetches",void 0),t([ce({type:Number})],Sc.prototype,"msgsPerSecond",void 0),t([ce({type:Object})],Sc.prototype,"estimatedCompletionDate",void 0);class Cc extends pe{constructor(){super(...arguments),this.total=100,this.current=0,this.pct=0,this.done=!1,this.showEstimatedCompletion=!1,this.showPercentage=!1}updated(t){if(t.has("eta")&&this.eta&&(this.estimatedCompletionDate=new Date(this.eta),this.showEstimatedCompletion=this.estimatedCompletionDate>new Date),t.has("current")){const t=Math.floor(Math.min(this.current/this.total*100,100));Number.isNaN(t)?this.showPercentage=!1:(this.pct=t,this.showPercentage=!0),this.done=this.pct>=100}}render(){return
|
|
7966
|
+
</div>`:null}}t([ce({type:Number})],Sc.prototype,"backlogSize",void 0),t([ce({type:String})],Sc.prototype,"endpoint",void 0),t([ce({type:Object})],Sc.prototype,"firstFetch",void 0),t([ce({type:Object})],Sc.prototype,"lastFetch",void 0),t([ce({type:Number})],Sc.prototype,"fetches",void 0),t([ce({type:Number})],Sc.prototype,"msgsPerSecond",void 0),t([ce({type:Object})],Sc.prototype,"estimatedCompletionDate",void 0);class Cc extends pe{constructor(){super(...arguments),this.total=100,this.current=0,this.pct=0,this.done=!1,this.showEstimatedCompletion=!1,this.showPercentage=!1}updated(t){if(t.has("eta")&&this.eta&&(this.estimatedCompletionDate=new Date(this.eta),this.showEstimatedCompletion=this.estimatedCompletionDate>new Date),t.has("current")){const t=Math.floor(Math.min(this.current/this.total*100,100));Number.isNaN(t)?this.showPercentage=!1:(this.pct=t,this.showPercentage=!0),this.done=this.pct>=100}}render(){return V`<div class="wrapper ${this.done?"complete":""}">
|
|
7952
7967
|
<div class="meter ${this.done?"done":""}">
|
|
7953
|
-
${this.message?
|
|
7968
|
+
${this.message?V`<div class="message">${this.message}</div>`:null}
|
|
7954
7969
|
<span class="complete" style="flex-basis: ${this.pct}%"></span>
|
|
7955
7970
|
<div class="incomplete"></div>
|
|
7956
7971
|
</div>
|
|
7957
7972
|
|
|
7958
|
-
${this.showPercentage||this.showEstimatedCompletion?
|
|
7973
|
+
${this.showPercentage||this.showEstimatedCompletion?V`<div class="etc">
|
|
7959
7974
|
<div>
|
|
7960
|
-
${this.estimatedCompletionDate&&this.showEstimatedCompletion&&!this.done?
|
|
7975
|
+
${this.estimatedCompletionDate&&this.showEstimatedCompletion&&!this.done?V`<temba-date
|
|
7961
7976
|
value="${this.estimatedCompletionDate.toISOString()}"
|
|
7962
7977
|
display="countdown"
|
|
7963
|
-
></temba-date>`:
|
|
7978
|
+
></temba-date>`:V`${this.pct}%`}
|
|
7964
7979
|
</div>
|
|
7965
7980
|
</div>`:null}
|
|
7966
7981
|
|
|
@@ -8087,13 +8102,13 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8087
8102
|
.meter.done > span {
|
|
8088
8103
|
background: rgb(var(--success-rgb));
|
|
8089
8104
|
}
|
|
8090
|
-
`,t([ce({type:Number})],Cc.prototype,"total",void 0),t([ce({type:Number})],Cc.prototype,"current",void 0),t([ce({type:Number})],Cc.prototype,"pct",void 0),t([ce({type:Boolean})],Cc.prototype,"done",void 0),t([ce({type:String})],Cc.prototype,"eta",void 0),t([ce({type:String,attribute:!1})],Cc.prototype,"estimatedCompletionDate",void 0),t([ce({type:Boolean})],Cc.prototype,"showEstimatedCompletion",void 0),t([ce({type:Boolean})],Cc.prototype,"showPercentage",void 0),t([ce({type:String})],Cc.prototype,"message",void 0);class Tc extends pe{constructor(){super(...arguments),this.refreshes=0,this.complete=!1,this.running=!1}updated(t){super.updated(t),t.has("id")&&this.refresh()}interruptStart(){var t,e;t=this.interruptTitle,e=this.interruptEndpoint,window.showModax(t,e)}refresh(){Wt(this.statusEndpoint,this.getHeaders()).then((t=>{if(t.length>0){this.refreshes++;const e=t[0];if(this.current=e.progress.current,this.total=e.progress.total,this.complete="Completed"==e.status||"Failed"==e.status||"Interrupted"==e.status,this.running="Started"===e.status,"Pending"===e.status?this.message="Preparing to start..":"Queued"===e.status?this.message="Waiting..":this.message=null,"Started"===e.status){const t=(new Date).getTime()-new Date(e.modified_on).getTime(),i=this.current/t;if(i>.1){const t=new Date((new Date).getTime()+(this.total-this.current)/i),e=new Date;e.setMonth(e.getMonth()+2),this.eta=t>e?null:t.toISOString()}}!this.complete&&this.current<this.total&&setTimeout((()=>{this.refresh()}),Math.min(1e3*this.refreshes,6e4)),this.complete&&this.scheduleRemoval()}}))}scheduleRemoval(){setTimeout((()=>{this.remove()}),5e3)}render(){return
|
|
8105
|
+
`,t([ce({type:Number})],Cc.prototype,"total",void 0),t([ce({type:Number})],Cc.prototype,"current",void 0),t([ce({type:Number})],Cc.prototype,"pct",void 0),t([ce({type:Boolean})],Cc.prototype,"done",void 0),t([ce({type:String})],Cc.prototype,"eta",void 0),t([ce({type:String,attribute:!1})],Cc.prototype,"estimatedCompletionDate",void 0),t([ce({type:Boolean})],Cc.prototype,"showEstimatedCompletion",void 0),t([ce({type:Boolean})],Cc.prototype,"showPercentage",void 0),t([ce({type:String})],Cc.prototype,"message",void 0);class Tc extends pe{constructor(){super(...arguments),this.refreshes=0,this.complete=!1,this.running=!1}updated(t){super.updated(t),t.has("id")&&this.refresh()}interruptStart(){var t,e;t=this.interruptTitle,e=this.interruptEndpoint,window.showModax(t,e)}refresh(){Wt(this.statusEndpoint,this.getHeaders()).then((t=>{if(t.length>0){this.refreshes++;const e=t[0];if(this.current=e.progress.current,this.total=e.progress.total,this.complete="Completed"==e.status||"Failed"==e.status||"Interrupted"==e.status,this.running="Started"===e.status,"Pending"===e.status?this.message="Preparing to start..":"Queued"===e.status?this.message="Waiting..":this.message=null,"Started"===e.status){const t=(new Date).getTime()-new Date(e.modified_on).getTime(),i=this.current/t;if(i>.1){const t=new Date((new Date).getTime()+(this.total-this.current)/i),e=new Date;e.setMonth(e.getMonth()+2),this.eta=t>e?null:t.toISOString()}}!this.complete&&this.current<this.total&&setTimeout((()=>{this.refresh()}),Math.min(1e3*this.refreshes,6e4)),this.complete&&this.scheduleRemoval()}}))}scheduleRemoval(){setTimeout((()=>{this.remove()}),5e3)}render(){return V`<temba-progress
|
|
8091
8106
|
total=${this.total}
|
|
8092
8107
|
current=${this.current}
|
|
8093
8108
|
eta=${this.eta}
|
|
8094
8109
|
message=${this.message}
|
|
8095
8110
|
>
|
|
8096
|
-
${this.running&&this.interruptTitle&&this.interruptEndpoint?
|
|
8111
|
+
${this.running&&this.interruptTitle&&this.interruptEndpoint?V`<temba-icon
|
|
8097
8112
|
name="close"
|
|
8098
8113
|
@click=${this.interruptStart}
|
|
8099
8114
|
></temba-icon>`:null}
|
|
@@ -8128,7 +8143,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8128
8143
|
padding: 0.1em 0.3em;
|
|
8129
8144
|
border-radius: var(--curvature);
|
|
8130
8145
|
}
|
|
8131
|
-
`}constructor(){super(),this.filteredShortcuts=[],this.cursorIndex=0}firstUpdated(t){super.firstUpdated(t)}storeUpdated(){this.filteredShortcuts=this.store.getShortcuts()}updated(t){super.updated(t),t.has("filter")&&(this.filter?this.filteredShortcuts=this.store.getShortcuts().filter((t=>t.name.toLowerCase().includes(this.filter.toLowerCase()))):this.filteredShortcuts=this.store.getShortcuts(),this.cursorIndex=0)}renderShortcut(t){return
|
|
8146
|
+
`}constructor(){super(),this.filteredShortcuts=[],this.cursorIndex=0}firstUpdated(t){super.firstUpdated(t)}storeUpdated(){this.filteredShortcuts=this.store.getShortcuts()}updated(t){super.updated(t),t.has("filter")&&(this.filter?this.filteredShortcuts=this.store.getShortcuts().filter((t=>t.name.toLowerCase().includes(this.filter.toLowerCase()))):this.filteredShortcuts=this.store.getShortcuts(),this.cursorIndex=0)}renderShortcut(t){return V`<div style="display:flex;align-items: center;min-width:0">
|
|
8132
8147
|
<div
|
|
8133
8148
|
style="
|
|
8134
8149
|
overflow: hidden;
|
|
@@ -8156,9 +8171,9 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8156
8171
|
>
|
|
8157
8172
|
${t.text}
|
|
8158
8173
|
</div>
|
|
8159
|
-
</div>`}getShortcut(){return this.shadowRoot.querySelector("temba-options").getSelection()}render(){return
|
|
8160
|
-
${0===this.filteredShortcuts.length?
|
|
8161
|
-
${this.filter?
|
|
8174
|
+
</div>`}getShortcut(){return this.shadowRoot.querySelector("temba-options").getSelection()}render(){return V`
|
|
8175
|
+
${0===this.filteredShortcuts.length?V`<div class="no-match">
|
|
8176
|
+
${this.filter?V`No matches for <span class="filter">${this.filter}</span>.`:V`No shortcuts yet, create some to quickly include them in
|
|
8162
8177
|
your messages.`}
|
|
8163
8178
|
</div>`:null}
|
|
8164
8179
|
|
|
@@ -8171,7 +8186,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8171
8186
|
.cursorIndex=${this.cursorIndex}
|
|
8172
8187
|
.options=${this.filteredShortcuts}
|
|
8173
8188
|
></temba-options>
|
|
8174
|
-
`}}t([ce({type:String})],Ec.prototype,"filter",void 0),t([ce({type:Array})],Ec.prototype,"filteredShortcuts",void 0),t([ce({type:Number})],Ec.prototype,"cursorIndex",void 0);class $c extends pe{constructor(){super(...arguments),this.placeholder="",this.endpoint=""}handleChange(){this.blur()}render(){return
|
|
8189
|
+
`}}t([ce({type:String})],Ec.prototype,"filter",void 0),t([ce({type:Array})],Ec.prototype,"filteredShortcuts",void 0),t([ce({type:Number})],Ec.prototype,"cursorIndex",void 0);class $c extends pe{constructor(){super(...arguments),this.placeholder="",this.endpoint=""}handleChange(){this.blur()}render(){return V`
|
|
8175
8190
|
<div>
|
|
8176
8191
|
<temba-dropdown>
|
|
8177
8192
|
<div slot="toggle"><slot name="toggle"></slot></div>
|
|
@@ -8208,13 +8223,16 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8208
8223
|
width: 150px;
|
|
8209
8224
|
display: block;
|
|
8210
8225
|
}
|
|
8211
|
-
`]}constructor(){super(),this.endpoint="/api/v2/users.json",this.nameKey="name",this.valueKey="email",this.placeholder="Select a user",this.sorted=!0,this.shouldExclude=t=>{const e=this.values[0];return t.email===(null==e?void 0:e.email)}}prepareOptionsDefault(t){return t.forEach((t=>{t.name=_r(t)})),t}renderOptionDefault(t){return t?
|
|
8226
|
+
`]}constructor(){super(),this.endpoint="/api/v2/users.json",this.nameKey="name",this.valueKey="email",this.placeholder="Select a user",this.sorted=!0,this.shouldExclude=t=>{const e=this.values[0];return t.email===(null==e?void 0:e.email)}}prepareOptionsDefault(t){return t.forEach((t=>{t.name=_r(t)})),t}renderOptionDefault(t){return t?V`<temba-user
|
|
8212
8227
|
email=${t.email}
|
|
8213
8228
|
name=${t.name}
|
|
8214
8229
|
avatar=${t.avatar}
|
|
8215
|
-
scale="0.8"
|
|
8216
8230
|
showname
|
|
8217
|
-
></temba-user>`:
|
|
8231
|
+
></temba-user>`:V``}}t([ce({type:String})],Oc.prototype,"endpoint",void 0),t([ce({type:String})],Oc.prototype,"nameKey",void 0),t([ce({type:String})],Oc.prototype,"valueKey",void 0),t([ce({type:String})],Oc.prototype,"placeholder",void 0),t([ce({type:Boolean})],Oc.prototype,"sorted",void 0),t([ce({type:Object})],Oc.prototype,"user",void 0);class zc extends ul{static get styles(){return[super.styles,r`
|
|
8232
|
+
:host {
|
|
8233
|
+
border: 0px solid blue;
|
|
8234
|
+
}
|
|
8235
|
+
`]}constructor(){super(),this.endpoint="/api/internal/orgs.json",this.nameKey="name",this.valueKey="id",this.placeholder="Choose Workspace",this.sorted=!0,this.shouldExclude=t=>{const e=this.values[0];return t.id===(null==e?void 0:e.id)},this.searchable=!0}firstUpdated(t){super.firstUpdated(t),this.allowAnchor=!!Xt(this)}prepareOptionsDefault(t){return t.forEach((t=>{t.type="workspace"})),t}renderOptionDefault(t){return t?V`<temba-user name=${t.name} showname></temba-user>`:V``}}function Lc(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([ce({type:String})],zc.prototype,"endpoint",void 0),t([ce({type:String})],zc.prototype,"nameKey",void 0),t([ce({type:String})],zc.prototype,"valueKey",void 0),t([ce({type:String})],zc.prototype,"placeholder",void 0),t([ce({type:Boolean})],zc.prototype,"sorted",void 0),t([ce({type:Object})],zc.prototype,"workspace",void 0),Lc("temba-anchor",wh),Lc("temba-alert",dh),Lc("temba-store",kr),Lc("temba-textinput",Oe),Lc("temba-datepicker",Fh),Lc("temba-date",Kh),Lc("temba-completion",pl),Lc("temba-checkbox",fe),Lc("temba-select",ul),Lc("temba-options",Ar),Lc("temba-loading",_l),Lc("temba-lightbox",ec),Lc("temba-button",bl),Lc("temba-omnibox",fh),Lc("temba-tip",yh),Lc("temba-contact-name",Th),Lc("temba-contact-name-fetch",qh),Lc("temba-contact-field",zh),Lc("temba-contact-fields",$h),Lc("temba-field-manager",Vh),Lc("temba-urn",Eh),Lc("temba-content-menu",Gh),Lc("temba-field",yl),Lc("temba-dialog",fl),Lc("temba-modax",vl),Lc("temba-charcount",$l),Lc("temba-contact-chat",rh),Lc("temba-contact-details",class extends Ll{static get styles(){return r`
|
|
8218
8236
|
.urn {
|
|
8219
8237
|
display: flex;
|
|
8220
8238
|
padding: 0.4em 1em 0.8em 1em;
|
|
@@ -8246,11 +8264,11 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8246
8264
|
margin-left: 0.5em;
|
|
8247
8265
|
margin-bottom: 0.4em;
|
|
8248
8266
|
}
|
|
8249
|
-
`}render(){if(!this.data)return;const t=this.store.getLanguageName(this.data.language);return
|
|
8267
|
+
`}render(){if(!this.data)return;const t=this.store.getLanguageName(this.data.language);return V`
|
|
8250
8268
|
<div class="wrapper">
|
|
8251
|
-
${this.data.groups.length>0?
|
|
8269
|
+
${this.data.groups.length>0?V` <div class="groups">
|
|
8252
8270
|
<div class="label">Groups</div>
|
|
8253
|
-
${this.data.groups.map((t=>
|
|
8271
|
+
${this.data.groups.map((t=>V`<temba-label
|
|
8254
8272
|
class="group"
|
|
8255
8273
|
onclick="goto(event)"
|
|
8256
8274
|
href="/contact/group/${t.uuid}/"
|
|
@@ -8260,7 +8278,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8260
8278
|
${t.name}
|
|
8261
8279
|
</temba-label>`))}
|
|
8262
8280
|
</div>`:null}
|
|
8263
|
-
${this.data.urns.map((t=>{const e=t.split(":");let i=ch[e[0]];return i||(i=se(e[0])),
|
|
8281
|
+
${this.data.urns.map((t=>{const e=t.split(":");let i=ch[e[0]];return i||(i=se(e[0])),V`<temba-contact-field
|
|
8264
8282
|
name=${i}
|
|
8265
8283
|
value=${e[1]}
|
|
8266
8284
|
disabled
|
|
@@ -8271,7 +8289,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8271
8289
|
value=${hh[this.data.status]}
|
|
8272
8290
|
disabled
|
|
8273
8291
|
></temba-contact-field>
|
|
8274
|
-
${t?
|
|
8292
|
+
${t?V`<temba-contact-field
|
|
8275
8293
|
name="Language"
|
|
8276
8294
|
value=${t}
|
|
8277
8295
|
disabled
|
|
@@ -8290,7 +8308,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8290
8308
|
disabled
|
|
8291
8309
|
></temba-contact-field>
|
|
8292
8310
|
</div>
|
|
8293
|
-
`}}),
|
|
8311
|
+
`}}),Lc("temba-ticket-list",lh),Lc("temba-notification-list",class extends ah{static get styles(){return r`
|
|
8294
8312
|
:host {
|
|
8295
8313
|
--option-hover-bg: #f9f9f9;
|
|
8296
8314
|
}
|
|
@@ -8316,10 +8334,10 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8316
8334
|
.title {
|
|
8317
8335
|
font-weight: normal;
|
|
8318
8336
|
}
|
|
8319
|
-
`}constructor(){super(),this.reverseRefresh=!1,this.internalFocusDisabled=!0,this.valueKey="target_url",this.renderOption=t=>{let e=null,i=null;return"incident:started"===t.type?"org:flagged"===t.incident.type?(e=ge.incidents,i="Your workspace was flagged, please contact support for assistance."):"org:suspended"===t.incident.type?(e=ge.incidents,i="Your workspace was suspended, please contact support for assistance."):"channel:disconnected"===t.incident.type?(e=ge.channel,i="Your android channel is not connected"):"channel:templates_failed"===t.incident.type?(e=ge.channel,i="Your WhatsApp channel templates failed syncing"):"webhooks:unhealthy"===t.incident.type&&(e=ge.webhook,i="Your webhook calls are not working properly."):"import:finished"===t.type?"contact"===t.import.type&&(e=ge.contact_import,i=`Imported ${t.import.num_records.toLocaleString()} contacts`):"export:finished"===t.type?"contact"===t.export.type?(e=ge.contact_export,i=`Exported ${t.export.num_records.toLocaleString()} contacts`):"message"===t.export.type?(e=ge.message_export,i=`Exported ${t.export.num_records.toLocaleString()} messages`):"results"===t.export.type?(e=ge.results_export,i="Exported flow results"):"ticket"===t.export.type?(e=ge.tickets_export,i=`Exported ${t.export.num_records.toLocaleString()} tickets`):"definition"===t.export.type&&(e=ge.definitions_export,i="Exported definitions"):"tickets:activity"===t.type?(e=ge.tickets,i="New ticket activity"):"tickets:opened"===t.type&&(e=ge.tickets,i="New unassigned ticket"),
|
|
8337
|
+
`}constructor(){super(),this.reverseRefresh=!1,this.internalFocusDisabled=!0,this.valueKey="target_url",this.renderOption=t=>{let e=null,i=null;return"incident:started"===t.type?"org:flagged"===t.incident.type?(e=ge.incidents,i="Your workspace was flagged, please contact support for assistance."):"org:suspended"===t.incident.type?(e=ge.incidents,i="Your workspace was suspended, please contact support for assistance."):"channel:disconnected"===t.incident.type?(e=ge.channel,i="Your android channel is not connected"):"channel:templates_failed"===t.incident.type?(e=ge.channel,i="Your WhatsApp channel templates failed syncing"):"webhooks:unhealthy"===t.incident.type&&(e=ge.webhook,i="Your webhook calls are not working properly."):"import:finished"===t.type?"contact"===t.import.type&&(e=ge.contact_import,i=`Imported ${t.import.num_records.toLocaleString()} contacts`):"export:finished"===t.type?"contact"===t.export.type?(e=ge.contact_export,i=`Exported ${t.export.num_records.toLocaleString()} contacts`):"message"===t.export.type?(e=ge.message_export,i=`Exported ${t.export.num_records.toLocaleString()} messages`):"results"===t.export.type?(e=ge.results_export,i="Exported flow results"):"ticket"===t.export.type?(e=ge.tickets_export,i=`Exported ${t.export.num_records.toLocaleString()} tickets`):"definition"===t.export.type&&(e=ge.definitions_export,i="Exported definitions"):"tickets:activity"===t.type?(e=ge.tickets,i="New ticket activity"):"tickets:opened"===t.type&&(e=ge.tickets,i="New unassigned ticket"),V`<div
|
|
8320
8338
|
style="color:${"#333"};display:flex;align-items:flex-start;flex-direction:row;font-weight:${t.is_seen?400:500}"
|
|
8321
8339
|
>
|
|
8322
|
-
${e?
|
|
8340
|
+
${e?V`<div style="margin-right:0.6em">
|
|
8323
8341
|
<temba-icon name="${e}"></temba-icon>
|
|
8324
8342
|
</div>`:null}
|
|
8325
8343
|
<div style="display:flex;flex-direction:column">
|
|
@@ -8330,10 +8348,10 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8330
8348
|
display="duration"
|
|
8331
8349
|
></temba-date>
|
|
8332
8350
|
</div>
|
|
8333
|
-
</div>`}}renderHeader(){return
|
|
8351
|
+
</div>`}}renderHeader(){return V`<div class="header">
|
|
8334
8352
|
<temba-icon name="notification"></temba-icon>
|
|
8335
8353
|
<div class="title">Notifications</div>
|
|
8336
|
-
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),
|
|
8354
|
+
</div>`}handleSelection(t){super.handleSelected(t)}scrollToTop(){window.setTimeout((()=>{this.shadowRoot.querySelector("temba-options").scrollToTop()}),1e3)}}),Lc("temba-list",ah),Lc("temba-sortable-list",Zh),Lc("temba-run-list",Bh),Lc("temba-flow-details",Rh),Lc("temba-label",Ch),Lc("temba-menu",xh),Lc("temba-remote",Xh),Lc("temba-contact-search",uh),Lc("temba-icon",ph),Lc("temba-dropdown",kh),Lc("temba-tabs",Ah),Lc("temba-tab",Sh),Lc("temba-contact-badges",Mh),Lc("temba-contact-pending",Dh),Lc("temba-slider",Ph),Lc("temba-content-menu",Gh),Lc("temba-compose",tc),Lc("temba-color-picker",ic),Lc("temba-resizer",oc),Lc("temba-thumbnail",sc),Lc("temba-webchat",lc),Lc("temba-image-picker",cc),Lc("temba-mask",dc),Lc("temba-user",xr),Lc("temba-template-editor",uc),Lc("temba-toast",xc),Lc("temba-chat",ql),Lc("temba-media-picker",kc),Lc("temba-contact-notepad",Ac),Lc("temba-outbox-monitor",Sc),Lc("temba-progress",Cc),Lc("temba-start-progress",Tc),Lc("temba-shortcuts",Ec),Lc("temba-popup-select",$c),Lc("temba-user-select",Oc),Lc("temba-workspace-select",zc);class Mc extends lt{static get styles(){return r`
|
|
8337
8355
|
:host {
|
|
8338
8356
|
line-height: normal;
|
|
8339
8357
|
}
|
|
@@ -8452,7 +8470,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8452
8470
|
display: inline-block;
|
|
8453
8471
|
margin-right: 0px;
|
|
8454
8472
|
}
|
|
8455
|
-
`}constructor(){super(),this.path=[]}updated(t){if(t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId)return this.path=[...t],void this.hideAliasDialog();this.fetchFeature()}}fetchFeature(){
|
|
8473
|
+
`}constructor(){super(),this.path=[]}updated(t){if(t.has("osmId")){const t=[];for(const e of this.path)if(t.push(e),e.osm_id===this.osmId)return this.path=[...t],void this.hideAliasDialog();this.fetchFeature()}}fetchFeature(){Vt(this.getEndpoint()+"boundaries/"+this.osmId+"/").then((t=>{this.path=t.json,this.hideAliasDialog()}))}handleMapClicked(t){this.hovered=null,t&&t.osm_id===this.osmId||(this.osmId=t.osm_id)}handlePlaceClicked(t){this.osmId=t.osm_id}handleSearchSelection(t){const e=t.detail.selected;this.showAliasDialog(e);this.shadowRoot.querySelector("temba-select").clear()}isMatch(t,e){return`${t.name} ${t.aliases}`.toLowerCase().indexOf(e)>-1}renderFeature(t,e){const i=this.path[this.path.length-1],o=(t.has_children||0===t.level)&&t!==i,n=V`
|
|
8456
8474
|
<div class="feature">
|
|
8457
8475
|
<div
|
|
8458
8476
|
@mouseover=${()=>{t.level>0&&(this.hovered=t)}}
|
|
@@ -8467,7 +8485,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8467
8485
|
</div>
|
|
8468
8486
|
|
|
8469
8487
|
<div class="aliases">
|
|
8470
|
-
${t.aliases.split("\n").map((e=>e.trim().length>0?
|
|
8488
|
+
${t.aliases.split("\n").map((e=>e.trim().length>0?V`
|
|
8471
8489
|
<temba-label
|
|
8472
8490
|
class="alias"
|
|
8473
8491
|
@click=${()=>{this.showAliasDialog(t)}}
|
|
@@ -8476,7 +8494,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8476
8494
|
>${e}</temba-label
|
|
8477
8495
|
>
|
|
8478
8496
|
`:null))}
|
|
8479
|
-
${t.level>0?
|
|
8497
|
+
${t.level>0?V`
|
|
8480
8498
|
<div
|
|
8481
8499
|
class="edit clickable showonhover"
|
|
8482
8500
|
@click=${e=>{this.showAliasDialog(t),e.preventDefault(),e.stopPropagation()}}
|
|
@@ -8487,14 +8505,14 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8487
8505
|
</div>
|
|
8488
8506
|
</div>
|
|
8489
8507
|
</div>
|
|
8490
|
-
`,s=(t.children||[]).map((t=>e.length>0&&e[0].osm_id===t.osm_id?this.renderFeature(e[0],e.slice(1)):0===e.length||0===e[0].children.length?this.renderFeature(t,e):null));return
|
|
8508
|
+
`,s=(t.children||[]).map((t=>e.length>0&&e[0].osm_id===t.osm_id?this.renderFeature(e[0],e.slice(1)):0===e.length||0===e[0].children.length?this.renderFeature(t,e):null));return V` ${n} ${s} `}showAliasDialog(t){this.editFeatureAliases=t.aliases,this.editFeature=t;const e=this.shadowRoot.getElementById("alias-dialog");e&&e.setAttribute("open","")}hideAliasDialog(){const t=this.shadowRoot.getElementById("alias-dialog");this.editFeature=null,this.editFeatureAliases=null,t&&t.removeAttribute("open"),this.requestUpdate()}getEndpoint(){return this.endpoint+(this.endpoint.endsWith("/")?"":"/")}handleDialogClick(t){const e=t.detail.button;if("Save"===e.name){const t=this.shadowRoot.getElementById(this.editFeature.osm_id).inputElement.value,e={osm_id:this.editFeature.osm_id,aliases:t};Qt(this.getEndpoint()+"boundaries/"+this.editFeature.osm_id+"/",e).then((()=>{this.fetchFeature()}))}"Cancel"===e.name&&this.hideAliasDialog()}getOptions(t){return t.json.filter((t=>t.level>0))}getOptionsComplete(t){return 0===t.length}renderOptionDetail(t){const e={marginTop:"3px",marginRight:"3px"},i=t.aliases.split("\n").map((t=>t.trim().length>0?V`
|
|
8491
8509
|
<temba-label style=${Ae(e)} class="alias" dark
|
|
8492
8510
|
>${t}</temba-label
|
|
8493
8511
|
>
|
|
8494
|
-
`:null));return
|
|
8512
|
+
`:null));return V`
|
|
8495
8513
|
<div class="path">${t.path.replace(/>/gi,"‣")}</div>
|
|
8496
8514
|
<div class="aliases">${i}</div>
|
|
8497
|
-
`}render(){if(0===this.path.length)return
|
|
8515
|
+
`}render(){if(0===this.path.length)return V``;const t=this.path[this.path.length-1],e=0===t.children.length?this.path[this.path.length-2]:t,i=this.editFeature?this.editFeature.osm_id:null,o=this.editFeature?this.editFeature.name:null;return V`
|
|
8498
8516
|
<div id="left-column">
|
|
8499
8517
|
<div class="search">
|
|
8500
8518
|
<temba-select
|
|
@@ -8541,7 +8559,7 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8541
8559
|
></temba-textinput>
|
|
8542
8560
|
</div>
|
|
8543
8561
|
</temba-dialog>
|
|
8544
|
-
`}}t([ce({type:Array,attribute:!1})],Lc.prototype,"path",void 0),t([ce()],Lc.prototype,"endpoint",void 0),t([ce()],Lc.prototype,"osmId",void 0),t([ce({type:Object})],Lc.prototype,"hovered",void 0),t([ce({type:Object})],Lc.prototype,"editFeature",void 0),t([ce({type:String,attribute:!1})],Lc.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Mc={exports:{}};(function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function o(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}Object.freeze=function(t){return t};var n=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 o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.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 o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}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?n(t.options):{}),e)t.options[i]=e[i];return t.options}function g(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var f=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(f,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(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 A=window.requestAnimationFrame||x("RequestAnimationFrame")||k,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||A!==k)return A.call(window,s(t,e));t.call(e)}function T(t){t&&S.call(window,t)}var E=(Object.freeze||Object)({freeze:i,extend:o,create:n,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:g,template:v,isArray:b,indexOf:y,emptyImageUrl:_,requestFn:A,cancelFn:S,requestAnimFrame:C,cancelAnimFrame:T});function $(){}function O(t){if("undefined"!=typeof L&&L&&L.Mixin){t=b(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)}}$.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=n(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&&(o(e,t.statics),delete t.statics),t.includes&&(O(t.includes),o.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=o(n(s.options),t.options)),o(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},$.include=function(t){return o(this.prototype,t),this},$.mergeOptions=function(t){return o(this.prototype.options,t),this},$.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 z={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(o=[],this._events[t]=o),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=o({},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,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var n=s((function(){this.off(t,e,i).off(t,n,i)}),this);return this.on(t,e,i).on(t,n,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,o({layer:t.target,propagatedFrom:t.target},t),!0)}};z.addEventListener=z.on,z.removeEventListener=z.clearAllEventListeners=z.off,z.addOneTimeEventListener=z.once,z.fireEvent=z.fire,z.hasEventListeners=z.listens;var M=$.extend(z);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var D=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function P(t,e,i){return t instanceof I?t:b(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function B(t,e){return!t||t instanceof N?t:new N(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function q(t,e){return t instanceof R?t:new R(t,e)}function F(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 U(t,e,i){return t instanceof F?t:b(t)&&"object"!=typeof t[0]?3===t.length?new F(t[0],t[1],t[2]):2===t.length?new F(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new F(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new F(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(P(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(P(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 I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(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=D(this.x),this.y=D(this.y),this},distanceTo:function(t){var e=(t=P(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=P(t)).x===this.x&&t.y===this.y},contains:function(t){return t=P(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=P(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 I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(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 I?P(t):B(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=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>=e.x&&o.x<=i.x,r=n.y>=e.y&&o.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>e.x&&o.x<i.x,r=n.y>e.y&&o.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof F)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(U(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new F(e.lat,e.lng),this._northEast=new F(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new F(e.lat-o,e.lng-n),new F(i.lat+o,i.lng+n))},getCenter:function(){return new F((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 F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(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 F||"lat"in t?U(t):q(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>=e.lat&&o.lat<=i.lat,r=n.lng>=e.lng&&o.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>e.lat&&o.lat<i.lat,r=n.lng>e.lng&&o.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)}},F.prototype={equals:function(t,e){return!!t&&(t=U(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 j.distance(this,U(t))},wrap:function(){return j.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 F(this.lat,this.lng,this.alt)}};var V={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},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 F(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new F(s.lat-o,s.lng-n),new F(r.lat-o,r.lng-n))}},j=o({},V,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=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(o)*Math.cos(n)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),Z=6378137,H={R:Z,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new F((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Z*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,o){if(b(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=o}function G(t,e,i,o){return new W(t,e,i,o)}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 I((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Y=o({},j,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),K=o({},Y,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){var i,o,n,s,r,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)l+=(o?"L":"M")+(a=r[o]).x+" "+a.y;l+=e?$t?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=zt("webkit"),nt=zt("android"),st=zt("android 2")||zt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&zt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=zt("chrome"),ct=zt("gecko")&&!ot&&!lt&&!tt,dt=!ht&&zt("safari"),ut=zt("phantom"),pt="OTransition"in X,mt=0===navigator.platform.indexOf("Win"),gt=tt&&"transition"in X,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in X,bt=!window.L_DISABLE_3D&&(gt||ft||vt)&&!pt&&!ut,yt="undefined"!=typeof orientation||zt("mobile"),_t=yt&&ot,xt=yt&&ft,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),At=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),St=yt&<,Ct=yt&&ct,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Et=!!document.createElement("canvas").getContext,$t=!(!document.createElementNS||!Q("svg").createSVGRect),Ot=!$t&&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 zt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Lt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:gt,webkit3d:ft,gecko3d:vt,any3d:bt,mobile:yt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:At,mobileOpera:St,mobileGecko:Ct,retina:Tt,canvas:Et,svg:$t,vml:Ot}),Mt=wt?"MSPointerDown":"pointerdown",It=wt?"MSPointerMove":"pointermove",Dt=wt?"MSPointerUp":"pointerup",Pt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Bt={},Rt=!1,qt=0;function Ft(t,e,i,o){return"touchstart"===e?Vt(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Yt(t,i,o),this}function Ut(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(Mt,o,!1):"touchmove"===e?t.removeEventListener(It,o,!1):"touchend"===e&&(t.removeEventListener(Dt,o,!1),t.removeEventListener(Pt,o,!1)),this}function Vt(t,e,i){var o=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;Ve(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(Mt,o,!1),Rt||(document.documentElement.addEventListener(Mt,jt,!0),document.documentElement.addEventListener(It,Zt,!0),document.documentElement.addEventListener(Dt,Ht,!0),document.documentElement.addEventListener(Pt,Ht,!0),Rt=!0)}function jt(t){Bt[t.pointerId]=t,qt++}function Zt(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Ht(t){delete Bt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Bt)t.touches.push(Bt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(It,o,!1)}function Yt(t,e,i){var o=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Dt,o,!1),t.addEventListener(Pt,o,!1)}var Kt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Qt=wt?"MSPointerUp":kt?"pointerup":"touchend",Jt="_leaflet_";function Xt(t,e,i){var o,n,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-(o||i);n=t.touches?t.touches[0]:t,s=a>0&&a<=r,o=i}}function l(t){if(s&&!n.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in n)i=n[r],a[r]=i&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Jt+Kt+i]=a,t[Jt+Qt+i]=l,t[Jt+"dblclick"+i]=e,t.addEventListener(Kt,a,!1),t.addEventListener(Qt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Jt+Kt+e],o=t[Jt+Qt+e],n=t[Jt+"dblclick"+e];return t.removeEventListener(Kt,i,!1),t.removeEventListener(Qt,o,!1),it||t.removeEventListener("dblclick",n,!1),this}var ee,ie,oe,ne,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 o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function de(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}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 ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function fe(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),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!fe(t,e)){var s=_e(t);ye(t,(s?s+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function ye(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,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(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 Ae(t,e,i){var o=e||new I(0,0);t.style[re]=(gt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Se(t,e){t._leaflet_pos=e,bt?Ae(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ce(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)ee=function(){De(window,"selectstart",Ve)},ie=function(){Ne(window,"selectstart",Ve)};else{var Te=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Te){var t=document.documentElement.style;oe=t[Te],t[Te]="none"}},ie=function(){Te&&(document.documentElement.style[Te]=oe,oe=void 0)}}function Ee(){De(window,"dragstart",Ve)}function $e(){Ne(window,"dragstart",Ve)}function Oe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),ne=t,se=t.style.outline,t.style.outline="none",De(window,"keydown",ze))}function ze(){ne&&(ne.style.outline=se,ne=void 0,se=void 0,Ne(window,"keydown",ze))}function Le(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Me(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:ge,hasClass:fe,addClass:ve,removeClass:be,setClass:ye,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Ae,setPosition:Se,getPosition:Ce,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Ee,enableImageDrag:$e,preventOutline:Oe,restoreOutline:ze,getSizedParentNode:Le,getScale:Me});function De(t,e,i,o){if("object"==typeof e)for(var n in e)Be(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,o);return this}var Pe="_leaflet_events";function Ne(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,o);else{for(var a in t[Pe])Re(t,a,t[Pe][a]);delete t[Pe]}return this}function Be(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):"");if(t[Pe]&&t[Pe][n])return this;var s=function(e){return i.call(o||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ft(t,e,s,n):!At||"dblclick"!==e||!Xt||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,Je(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&nt&&(s=function(t){Xe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Xt(t,s,n),t[Pe]=t[Pe]||{},t[Pe][n]=s}function Re(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):""),s=t[Pe]&&t[Pe][n];if(!s)return this;kt&&0===e.indexOf("touch")?Ut(t,e,n):!At||"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,n),t[Pe][n]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Fe(t){return Be(t,"mousewheel",qe),this}function Ue(t){return De(t,"mousedown touchstart dblclick",qe),Be(t,"click",Ke),this}function Ve(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function je(t){return Ve(t),qe(t),this}function Ze(t,e){if(!e)return new I(t.clientX,t.clientY);var i=Me(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.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,Ye={};function Ke(t){Ye[t.type]=!0}function Qe(t){var e=Ye[t.type];return Ye[t.type]=!1,e}function Je(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 Xe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,o=Ge&&i-Ge;o&&o>100&&o<500||t.target._simulatedClick&&!t._simulated?je(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:De,off:Ne,stopPropagation:qe,disableScrollPropagation:Fe,disableClickPropagation:Ue,preventDefault:Ve,stop:je,getMousePosition:Ze,getWheelDelta:We,fakeStop:Ke,skipped:Qe,isExternalTarget:Je,addListener:De,removeListener:Ne}),ei=M.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Ce(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=C(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(),Se(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=M.extend({options:{crs:Y,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(U(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&bt&&!St&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),De(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(U(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=o({animate:i.animate},i.zoom),i.pan=o({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||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=P(e.paddingTopLeft||e.padding||[0,0]),o=P(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},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=P(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||!bt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=U(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=n.distanceTo(o)||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 g(t){return p(t)/m(t)}var f=u(0);function v(t){return a*(m(f)/m(f+c*t))}function b(t){return a*(m(f)*g(f+c*t)-p(f))/d}function y(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-f)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=y(i)*x;i<=1?(this._flyToFrame=C(k,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(b(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(),o=this._limitCenter(i,this._zoom,q(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=P((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=P(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=B([a.min.add(i),a.max.subtract(o)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=P(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-o.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-o.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),r=i.divideBy(2).round(),a=n.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=o({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 F(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}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 R(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=P(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=B(this.project(a,o),this.project(r,o)).getSize(),c=bt?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 o=this.getScaleZoom(p,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(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 o=i.zoom(t*i.scale(e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(U(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(P(t),e)},layerPointToLatLng:function(t){var e=P(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(U(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(U(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(U(t),U(e))},containerPointToLayerPoint:function(t){return P(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return P(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(P(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(U(t)))},mouseEventToContainerPoint:function(t){return Ze(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.");De(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&bt,ve(t,"leaflet-container"+(At?" 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),Se(this._mapPane,new I(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){Se(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),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 o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||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){Se(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:De;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),bt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=C((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,o=[],n="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(n&&!Je(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||r||n||!Je(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Oe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=o({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Ve(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!==y(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 Ce(this._mapPane)||new I(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 o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return B([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_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 o=this.project(t,e),n=this.getSize().divideBy(2),s=new N(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new I(this._rebound(n.x,-s.x),this._rebound(n.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(),o=bt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(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];Ae(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();Ae(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 o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){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:o}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function oi(t,e){return new ii(t,e)}var ni=$.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(),o=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.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 ni(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 o(o,n){var s=e+o+" "+e+n;t[o+n]=de("div",s,i)}o("top","left"),o("top","right"),o("bottom","left"),o("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=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!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 ni.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"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(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),Ue(e),Fe(e);var o=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||De(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=de("a",t+"-toggle",e);n.href="#",n.title="Layers",At?(De(n,"click",je),De(n,"click",this.expand,this)):De(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",o),this._separator=de("div",t+"-separator",o),this._overlaysList=de("div",t+"-overlays",o),e.appendChild(o)},_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,o,n=0;for(i=0;i<this._layers.length;i++)o=this._layers[i],this._addItem(o),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(t=t&&n>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"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+a(this),o),this._layerControlInputs.push(e),e.layerId=a(t.layer),De(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)t=i[n],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>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=ni.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"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.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,o,n){var s=de("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ue(s),De(s,"click",je),De(s,"click",n,this),De(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(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=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.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,o,n=3.2808399*t;n>5280?(e=n/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_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=ni.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"),Ue(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)};ni.Layers=ri,ni.Zoom=li,ni.Scale=ci,ni.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=$.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 gi,fi={Events:z},vi=At?"touchstart mousedown":"mousedown",bi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=M.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){m(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(De(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,!fe(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Oe(this._element),Ee(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Le(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=Me(i),De(document,yi[t.type],this._onMove,this),De(document,bi[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 I(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,Ve(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ce(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=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Se(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ne(document,yi[t],this._onMove,this),Ne(document,bi[t],this._onUp,this);$e(),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=Ai(t=Ci(t,i),i)}function wi(t,e,i){return Math.sqrt(zi(t,e,i,!0))}function ki(t,e,i){return zi(t,e,i)}function Ai(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Si(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Si(t,e,i,o,n){var s,r,a,l=0;for(r=o+1;r<=n-1;r++)(a=zi(t[r],t[o],t[n],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Si(t,e,i,o,s),Si(t,e,i,s,n))}function Ci(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Oi(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ti(t,e,i,o,n){var s,r,a,l=o?gi:$i(t,i),h=$i(e,i);for(gi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=$i(r=Ei(t,e,s=l||h,i,n),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ei(t,e,i,o,n){var s,r,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.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 I(s,r,n)}function $i(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 Oi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function zi(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((n=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=l*n)),a=t.x-s,l=t.y-r,o?a*a+l*l:new I(s,r)}function Li(t){return!b(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Mi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Li(t)}var Ii=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ti,_getEdgeIntersection:Ei,_getBitCode:$i,_sqClosestPointOnSegment:zi,isFlat:Li,_flat:Mi});function Di(t,e,i){var o,n,s,r,a,l,h,c,d,u=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=$i(t[n],e);for(r=0;r<4;r++){for(c=u[r],o=[],n=0,s=(h=t.length)-1;n<h;s=n++)a=t[n],l=t[s],a._code&c?l._code&c||((d=Ei(l,a,c,e,i))._code=$i(d,e),o.push(d)):(l._code&c&&((d=Ei(l,a,c,e,i))._code=$i(d,e),o.push(d)),o.push(a));t=o}return t}var Pi=(Object.freeze||Object)({clipPolygon:Di}),Ni={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new F(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Bi={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,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),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 F(a*i,t.x*i/o)}},Ri=(Object.freeze||Object)({LonLat:Ni,Mercator:Bi,SphericalMercator:H}),qi=o({},j,{code:"EPSG:3395",projection:Bi,transformation:function(){var t=.5/(Math.PI*Bi.R);return G(t,.5,-t,.5)}()}),Fi=o({},j,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Ui=o({},V,{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,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});V.Earth=j,V.EPSG3395=qi,V.EPSG3857=Y,V.EPSG900913=K,V.EPSG4326=Fi,V.Simple=Ui;var Vi=M.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?b(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 o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.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 ji=Vi.extend({initialize:function(t,e){var i,o;if(m(this,e),this._layers={},t)for(i=0,o=t.length;i<o;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,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);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)}}),Zi=function(t,e){return new ji(t,e)},Hi=ji.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ji.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),ji.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 R;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=$.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 o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=P(o),s=P("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.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 Yi(t){return new Gi(t)}var Ki=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 Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.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["']?\)$/,"")}}),Qi=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&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Ce(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=B(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!l.contains(s)){var h=P((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(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Se(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(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=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Ce(e._icon),n=e._map.layerPointToLatLng(o);i&&Se(i,o),e._latlng=n,t.latlng=n,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)}}),Ji=Vi.extend({options:{icon:new Ki,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=U(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=U(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),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!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 n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(ve(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&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){Se(this._icon,t),this._shadow&&Se(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),Qi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Qi(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 Xi(t,e){return new Ji(t,e)}var to=Vi.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}}),eo=to.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=U(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=U(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 to.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(),o=[t+i,e+i];this._pxBounds=new N(this._point.subtract(o),this._point.add(o))},_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 io(t,e){return new eo(t,e)}var oo=eo.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=o({},i,{radius:e})),m(this,e),this._latlng=U(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 R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:to.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===j.distance){var n=Math.PI/180,s=this._mRadius/j.R/n,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*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(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=o.unproject(o.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 no(t,e,i){return new oo(t,e,i)}var so=to.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,o=1/0,n=null,s=zi,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<o&&(o=d,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,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,o=0;t<l-1;t++)if(n=a[t],s=a[t+1],(o+=i=n.distanceTo(s))>e)return r=(o-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=U(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Li(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Li(t),o=0,n=t.length;o<n;o++)i?(e[o]=U(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);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 I(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t[0]instanceof F,r=t.length;if(s){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],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,o,n,s,r,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;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[o]=l[o]||[],l[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;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,o,n,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(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new so(t,e)}so._flat=Mi;var ao=so.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,o,n,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],o=h[e],n=i.y*o.x-o.y*i.x,r+=(i.x+o.x)*n,a+=(i.y+o.y)*n,s+=3*n;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=so.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof F&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){so.prototype._setLatLngs.call(this,t),Li(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Li(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(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 o,n=0,s=this._rings.length;n<s;n++)(o=Di(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(l=(e=this._parts[n]).length)-1;s<l;r=s++)i=e[s],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||so.prototype._containsPoint.call(this,t,!0)}});function lo(t,e){return new ao(t,e)}var ho=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=b(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=co(t,s);return r?(r.feature=vo(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=o({},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 co(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Ji(i);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),l.push(h?h(t,i):new Ji(i));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new so(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ao(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var d=co({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function uo(t){return new F(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function mo(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 go(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?go(t[s],e-1,i,o):mo(t[s],o));return!e&&i&&n.push(n[0]),n}function fo(t,e){return t.feature?o({},t.feature,{geometry:e}):vo(e)}function vo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var bo={toGeoJSON:function(t){return fo(this,{type:"Point",coordinates:mo(this.getLatLng(),t)})}};function yo(t,e){return new ho(t,e)}Ji.include(bo),oo.include(bo),eo.include(bo),so.include({toGeoJSON:function(t){var e=!Li(this._latlngs);return fo(this,{type:(e?"Multi":"")+"LineString",coordinates:go(this._latlngs,e?1:0,!1,t)})}}),ao.include({toGeoJSON:function(t){var e=!Li(this._latlngs),i=e&&!Li(this._latlngs[0]),o=go(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),fo(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),ji.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),fo(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,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=vo(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?fo(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var _o=yo,xo=Vi.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&&ge(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;Ae(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();Se(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)}}),wo=function(t,e,i){return new xo(t,e,i)},ko=xo.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"),o=[],n=0;n<i.length;n++)o.push(i[n].src);this._url=i.length>0?o:[e.src]}else{b(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 Ao(t,e,i){return new ko(t,e,i)}var So=xo.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 Co(t,e,i){return new So(t,e,i)}var To=Vi.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=U(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&&ge(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Vi||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];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=P(this.options.offset),i=this._getAnchor();this._zoomAnimated?Se(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),Eo=To.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){To.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof to||this._source.on("preclick",qe))},onRemove:function(t){To.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof to||this._source.off("preclick",qe))},getEvents:function(){var t=To.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),Ue(i),Fe(this._contentNode),De(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=de("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",De(o,"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 o=t.offsetHeight,n=this.options.maxHeight,s="leaflet-popup-scrolled";n&&o>n?(e.height=n+"px",ve(t,s)):be(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Se(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,o=this._containerWidth,n=new I(this._containerLeft,-i-this._containerBottom);n._add(Ce(this._container));var s=t.layerPointToContainerPoint(n),r=P(this.options.autoPanPadding),a=P(this.options.autoPanPaddingTopLeft||r),l=P(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+o+l.x>h.x&&(c=s.x+o-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(),je(t)},_getAnchor:function(){return P(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),$o=function(t,e){return new Eo(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof Eo||(t=new Eo(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}}),Vi.include({bindPopup:function(t,e){return t instanceof Eo?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Eo(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&&(je(t),e instanceof to?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 Oo=To.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){To.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){To.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=To.prototype.getEvents.call(this);return At&&!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,o=e.latLngToContainerPoint(e.getCenter()),n=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=P(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(P(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(P(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(P(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&n.x<o.x?(s="right",t=t.add(P(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(P(r+h.x-l.x,a/2-h.y-l.y,!0))),be(i,"leaflet-tooltip-right"),be(i,"leaflet-tooltip-left"),be(i,"leaflet-tooltip-top"),be(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Se(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 P(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),zo=function(t,e){return new Oo(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Oo||(t=new Oo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Vi.include({bindTooltip:function(t,e){return t instanceof Oo?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Oo(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),At&&(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&&(be(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,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Lo=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 o=P(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Mo(t){return new Lo(t)}Gi.Default=Ki;var Io=Vi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,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&&(ge(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 I?t:new I(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,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+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 o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);xe(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=C(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 o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_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 o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.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,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new I(+n,+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>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new I(n,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<o&&this._retainChildren(n,s,i+1,o))}},_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,o){var n=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom)&&(n=void 0);var s=this.options.updateWhenZooming&&n!==this._tileZoom;o&&!s||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&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 o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();bt?Ae(t.el,n,o):Se(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).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(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new N(n.subtract(s),n.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 o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,l=new N(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.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 I(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=n.min.y;d<=n.max.y;d++)for(var u=n.min.x;u<=n.max.x;u++){var p=new I(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 g=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],g);this._level.el.appendChild(g)}}}}},_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 o=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(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 I(+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),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),n=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(n),this.createTile.length<2&&C(s(this._tileReady,this,t,null,n)),Se(n,i),this._tiles[o]={el:n,coords:t,current:!0},e.appendChild(n),this.fire("tileloadstart",{tile:n,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),T(this._fadeFrame),this._fadeFrame=C(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?C(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 I(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 Do(t){return new Io(t)}var Po=Io.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("")),nt||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 De(i,"load",s(this._tileOnLoad,this,e,i)),De(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,o(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),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",_),Io.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Io.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Po(t,e)}var Bo=Po.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=o({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);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,Po.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=B(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===Fi?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Po.prototype.getTileUrl.call(this,t);return a+g(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return o(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new Bo(t,e)}Po.WMS=Bo,No.wms=Ro;var qo=Vi.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),o=Ce(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);bt?Ae(this._container,a,i):Se(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()}}),Fo=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");De(t,"mousemove",l(this._onMouseMove,32,this),this),De(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),De(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){qo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Tt?2:1;Se(e,t.min),e.width=o*i.x,e.height=o*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(){qo.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,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.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,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(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 o=this._drawFirst;o;o=o.next)t=o.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,o,n,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)s=r[i][o],l[o?"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,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&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,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ke(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&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,o,n=this._drawFirst;n;n=n.next)(i=n.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ve(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),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,o=e.prev;i&&(i.prev=o,o?o.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,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return Et?new Fo(t):null}var Vo=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">')}}}(),jo={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vo("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vo("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,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Vo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,o.dashArray?e.dashStyle=b(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Vo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){ge(t._container)}},Zo=Ot?Vo:Q,Ho=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Zo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Zo("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){qo.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)),Se(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=Zo("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,J(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){ge(t._path)}});function Wo(t){return $t||Ot?new Ho(t):null}Ot&&Ho.include(jo),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&&Uo(t)||Wo(t)}});var Go=ao.extend({initialize:function(t,e){ao.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 Yo(t,e){return new Go(t,e)}Ho.create=Zo,Ho.pointsToPath=J,ho.geometryToLayer=co,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=mo,ho.latLngsToCoords=go,ho.getFeature=fo,ho.asFeature=vo,ii.mergeOptions({boxZoom:!0});var Ko=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(){De(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(),Ee(),this._startPoint=this._map.mouseEventToContainerPoint(t),De(document,{contextmenu:je,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();Se(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),be(this._container,"leaflet-crosshair")),ie(),$e(),Ne(document,{contextmenu:je,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 R(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",Ko),ii.mergeOptions({doubleClickZoom:!0});var Qo=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(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ii.addInitHook("addHandler","doubleClickZoom",Qo),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jo=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(){be(this._map._container,"leaflet-grab"),be(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=B(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,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=n.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),C((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Jo),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=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"),De(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,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,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,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){De(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,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=P(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}je(t)}}});ii.addInitHook("addHandler","keyboard",Xo),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=mi.extend({addHooks:function(){De(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 o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),o),je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=this._delta/(4*this._map.options.wheelPxPerZoomLevel),n=4*Math.log(2/(1+Math.exp(-Math.abs(o))))/Math.LN2,s=i?Math.ceil(n/i)*i:n,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",tn),ii.mergeOptions({tap:!0,tapTolerance:15});var en=mi.extend({addHooks:function(){De(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ve(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 I(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),De(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()&&be(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 I(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)}});At&&!kt&&ii.addInitHook("addHandler","tap",en),ii.mergeOptions({touchZoom:At&&!st,bounceAtZoomLimits:!0});var on=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),De(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(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]),o=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(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),De(document,"touchmove",this._onTouchMove,this),De(document,"touchend",this._onTouchEnd,this),Ve(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),n=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(n,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&n<1||this._zoom>e.getMaxZoom()&&n>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===n)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===n&&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=C(a,this,!0),Ve(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",on),ii.BoxZoom=Ko,ii.DoubleClickZoom=Qo,ii.Drag=Jo,ii.Keyboard=Xo,ii.ScrollWheelZoom=tn,ii.Tap=en,ii.TouchZoom=on,Object.freeze=i,t.version=e,t.Control=ni,t.control=si,t.Browser=Lt,t.Evented=M,t.Mixin=fi,t.Util=E,t.Class=$,t.Handler=mi,t.extend=o,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Ie,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Ii,t.PolyUtil=Pi,t.Point=I,t.point=P,t.Bounds=N,t.bounds=B,t.Transformation=W,t.transformation=G,t.Projection=Ri,t.LatLng=F,t.latLng=U,t.LatLngBounds=R,t.latLngBounds=q,t.CRS=V,t.GeoJSON=ho,t.geoJSON=yo,t.geoJson=_o,t.Layer=Vi,t.LayerGroup=ji,t.layerGroup=Zi,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xo,t.imageOverlay=wo,t.VideoOverlay=ko,t.videoOverlay=Ao,t.SVGOverlay=So,t.svgOverlay=Co,t.DivOverlay=To,t.Popup=Eo,t.popup=$o,t.Tooltip=Oo,t.tooltip=zo,t.Icon=Gi,t.icon=Yi,t.DivIcon=Lo,t.divIcon=Mo,t.Marker=Ji,t.marker=Xi,t.TileLayer=Po,t.tileLayer=No,t.GridLayer=Io,t.gridLayer=Do,t.SVG=Ho,t.svg=Wo,t.Renderer=qo,t.Canvas=Fo,t.canvas=Uo,t.Path=to,t.CircleMarker=eo,t.circleMarker=io,t.Circle=oo,t.circle=no,t.Polyline=so,t.polyline=ro,t.Polygon=ao,t.polygon=lo,t.Rectangle=Go,t.rectangle=Yo,t.Map=ii,t.map=oi;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(Mc.exports);var Ic=Mc.exports;const Dc={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},Pc={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},Nc=()=>Dc;class Bc extends lt{static get styles(){return r`
|
|
8562
|
+
`}}t([ce({type:Array,attribute:!1})],Mc.prototype,"path",void 0),t([ce()],Mc.prototype,"endpoint",void 0),t([ce()],Mc.prototype,"osmId",void 0),t([ce({type:Object})],Mc.prototype,"hovered",void 0),t([ce({type:Object})],Mc.prototype,"editFeature",void 0),t([ce({type:String,attribute:!1})],Mc.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ic={exports:{}};(function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function o(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}Object.freeze=function(t){return t};var n=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 o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.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 o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}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?n(t.options):{}),e)t.options[i]=e[i];return t.options}function g(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var f=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(f,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var b=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(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 A=window.requestAnimationFrame||x("RequestAnimationFrame")||k,S=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||A!==k)return A.call(window,s(t,e));t.call(e)}function T(t){t&&S.call(window,t)}var E=(Object.freeze||Object)({freeze:i,extend:o,create:n,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:g,template:v,isArray:b,indexOf:y,emptyImageUrl:_,requestFn:A,cancelFn:S,requestAnimFrame:C,cancelAnimFrame:T});function $(){}function O(t){if("undefined"!=typeof L&&L&&L.Mixin){t=b(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)}}$.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=n(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&&(o(e,t.statics),delete t.statics),t.includes&&(O(t.includes),o.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=o(n(s.options),t.options)),o(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},$.include=function(t){return o(this.prototype,t),this},$.mergeOptions=function(t){return o(this.prototype.options,t),this},$.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 z={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(o=[],this._events[t]=o),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var n=o({},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,n)}this._firingCount--}}return i&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var n=s((function(){this.off(t,e,i).off(t,n,i)}),this);return this.on(t,e,i).on(t,n,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,o({layer:t.target,propagatedFrom:t.target},t),!0)}};z.addEventListener=z.on,z.removeEventListener=z.clearAllEventListeners=z.off,z.addOneTimeEventListener=z.once,z.fireEvent=z.fire,z.hasEventListeners=z.listens;var M=$.extend(z);function I(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var D=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function P(t,e,i){return t instanceof I?t:b(t)?new I(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new I(t.x,t.y):new I(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function B(t,e){return!t||t instanceof N?t:new N(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function q(t,e){return t instanceof R?t:new R(t,e)}function F(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 U(t,e,i){return t instanceof F?t:b(t)&&"object"!=typeof t[0]?3===t.length?new F(t[0],t[1],t[2]):2===t.length?new F(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new F(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new F(t,e,i)}I.prototype={clone:function(){return new I(this.x,this.y)},add:function(t){return this.clone()._add(P(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(P(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 I(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new I(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=D(this.x),this.y=D(this.y),this},distanceTo:function(t){var e=(t=P(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=P(t)).x===this.x&&t.y===this.y},contains:function(t){return t=P(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=P(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 I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new I(this.min.x,this.max.y)},getTopRight:function(){return new I(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 I?P(t):B(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=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>=e.x&&o.x<=i.x,r=n.y>=e.y&&o.y<=i.y;return s&&r},overlaps:function(t){t=B(t);var e=this.min,i=this.max,o=t.min,n=t.max,s=n.x>e.x&&o.x<i.x,r=n.y>e.y&&o.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof F)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(U(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new F(e.lat,e.lng),this._northEast=new F(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new F(e.lat-o,e.lng-n),new F(i.lat+o,i.lng+n))},getCenter:function(){return new F((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 F(this.getNorth(),this.getWest())},getSouthEast:function(){return new F(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 F||"lat"in t?U(t):q(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>=e.lat&&o.lat<=i.lat,r=n.lng>=e.lng&&o.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast(),s=n.lat>e.lat&&o.lat<i.lat,r=n.lng>e.lng&&o.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)}},F.prototype={equals:function(t,e){return!!t&&(t=U(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,U(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 F(this.lat,this.lng,this.alt)}};var j={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},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 F(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new F(s.lat-o,s.lng-n),new F(r.lat-o,r.lng-n))}},V=o({},j,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=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(o)*Math.cos(n)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),Z=6378137,H={R:Z,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new I(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new F((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=Z*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,o){if(b(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=o}function G(t,e,i,o){return new W(t,e,i,o)}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 I((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var Y=o({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),K=o({},Y,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function J(t,e){var i,o,n,s,r,a,l="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)l+=(o?"L":"M")+(a=r[o]).x+" "+a.y;l+=e?$t?"z":"x":""}return l||"M0 0"}var X=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=zt("webkit"),nt=zt("android"),st=zt("android 2")||zt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&zt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=zt("chrome"),ct=zt("gecko")&&!ot&&!lt&&!tt,dt=!ht&&zt("safari"),ut=zt("phantom"),pt="OTransition"in X,mt=0===navigator.platform.indexOf("Win"),gt=tt&&"transition"in X,ft="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in X,bt=!window.L_DISABLE_3D&&(gt||ft||vt)&&!pt&&!ut,yt="undefined"!=typeof orientation||zt("mobile"),_t=yt&&ot,xt=yt&&ft,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),At=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),St=yt&<,Ct=yt&&ct,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Et=!!document.createElement("canvas").getContext,$t=!(!document.createElementNS||!Q("svg").createSVGRect),Ot=!$t&&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 zt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Lt=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:gt,webkit3d:ft,gecko3d:vt,any3d:bt,mobile:yt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:At,mobileOpera:St,mobileGecko:Ct,retina:Tt,canvas:Et,svg:$t,vml:Ot}),Mt=wt?"MSPointerDown":"pointerdown",It=wt?"MSPointerMove":"pointermove",Dt=wt?"MSPointerUp":"pointerup",Pt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Bt={},Rt=!1,qt=0;function Ft(t,e,i,o){return"touchstart"===e?jt(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Yt(t,i,o),this}function Ut(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(Mt,o,!1):"touchmove"===e?t.removeEventListener(It,o,!1):"touchend"===e&&(t.removeEventListener(Dt,o,!1),t.removeEventListener(Pt,o,!1)),this}function jt(t,e,i){var o=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;je(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(Mt,o,!1),Rt||(document.documentElement.addEventListener(Mt,Vt,!0),document.documentElement.addEventListener(It,Zt,!0),document.documentElement.addEventListener(Dt,Ht,!0),document.documentElement.addEventListener(Pt,Ht,!0),Rt=!0)}function Vt(t){Bt[t.pointerId]=t,qt++}function Zt(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Ht(t){delete Bt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Bt)t.touches.push(Bt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(It,o,!1)}function Yt(t,e,i){var o=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Dt,o,!1),t.addEventListener(Pt,o,!1)}var Kt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Qt=wt?"MSPointerUp":kt?"pointerup":"touchend",Jt="_leaflet_";function Xt(t,e,i){var o,n,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-(o||i);n=t.touches?t.touches[0]:t,s=a>0&&a<=r,o=i}}function l(t){if(s&&!n.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in n)i=n[r],a[r]=i&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Jt+Kt+i]=a,t[Jt+Qt+i]=l,t[Jt+"dblclick"+i]=e,t.addEventListener(Kt,a,!1),t.addEventListener(Qt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Jt+Kt+e],o=t[Jt+Qt+e],n=t[Jt+"dblclick"+e];return t.removeEventListener(Kt,i,!1),t.removeEventListener(Qt,o,!1),it||t.removeEventListener("dblclick",n,!1),this}var ee,ie,oe,ne,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 o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function de(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}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 ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function fe(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),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!fe(t,e)){var s=_e(t);ye(t,(s?s+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function ye(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,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(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 Ae(t,e,i){var o=e||new I(0,0);t.style[re]=(gt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Se(t,e){t._leaflet_pos=e,bt?Ae(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ce(t){return t._leaflet_pos||new I(0,0)}if("onselectstart"in document)ee=function(){De(window,"selectstart",je)},ie=function(){Ne(window,"selectstart",je)};else{var Te=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Te){var t=document.documentElement.style;oe=t[Te],t[Te]="none"}},ie=function(){Te&&(document.documentElement.style[Te]=oe,oe=void 0)}}function Ee(){De(window,"dragstart",je)}function $e(){Ne(window,"dragstart",je)}function Oe(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),ne=t,se=t.style.outline,t.style.outline="none",De(window,"keydown",ze))}function ze(){ne&&(ne.style.outline=se,ne=void 0,se=void 0,Ne(window,"keydown",ze))}function Le(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Me(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ie=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:ge,hasClass:fe,addClass:ve,removeClass:be,setClass:ye,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Ae,setPosition:Se,getPosition:Ce,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Ee,enableImageDrag:$e,preventOutline:Oe,restoreOutline:ze,getSizedParentNode:Le,getScale:Me});function De(t,e,i,o){if("object"==typeof e)for(var n in e)Be(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,o);return this}var Pe="_leaflet_events";function Ne(t,e,i,o){if("object"==typeof e)for(var n in e)Re(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,o);else{for(var a in t[Pe])Re(t,a,t[Pe][a]);delete t[Pe]}return this}function Be(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):"");if(t[Pe]&&t[Pe][n])return this;var s=function(e){return i.call(o||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ft(t,e,s,n):!At||"dblclick"!==e||!Xt||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,Je(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&nt&&(s=function(t){Xe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Xt(t,s,n),t[Pe]=t[Pe]||{},t[Pe][n]=s}function Re(t,e,i,o){var n=e+a(i)+(o?"_"+a(o):""),s=t[Pe]&&t[Pe][n];if(!s)return this;kt&&0===e.indexOf("touch")?Ut(t,e,n):!At||"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,n),t[Pe][n]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Fe(t){return Be(t,"mousewheel",qe),this}function Ue(t){return De(t,"mousedown touchstart dblclick",qe),Be(t,"click",Ke),this}function je(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return je(t),qe(t),this}function Ze(t,e){if(!e)return new I(t.clientX,t.clientY);var i=Me(e),o=i.boundingClientRect;return new I((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.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,Ye={};function Ke(t){Ye[t.type]=!0}function Qe(t){var e=Ye[t.type];return Ye[t.type]=!1,e}function Je(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 Xe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,o=Ge&&i-Ge;o&&o>100&&o<500||t.target._simulatedClick&&!t._simulated?Ve(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:De,off:Ne,stopPropagation:qe,disableScrollPropagation:Fe,disableClickPropagation:Ue,preventDefault:je,stop:Ve,getMousePosition:Ze,getWheelDelta:We,fakeStop:Ke,skipped:Qe,isExternalTarget:Je,addListener:De,removeListener:Ne}),ei=M.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Ce(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=C(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(),Se(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=M.extend({options:{crs:Y,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(U(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&bt&&!St&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),De(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(U(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=o({animate:i.animate},i.zoom),i.pan=o({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||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(bt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof I?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=P(e.paddingTopLeft||e.padding||[0,0]),o=P(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},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=P(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||!bt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=U(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=n.distanceTo(o)||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 g(t){return p(t)/m(t)}var f=u(0);function v(t){return a*(m(f)/m(f+c*t))}function b(t){return a*(m(f)*g(f+c*t)-p(f))/d}function y(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-f)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=y(i)*x;i<=1?(this._flyToFrame=C(k,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(b(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(),o=this._limitCenter(i,this._zoom,q(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=P((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=P(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=B([a.min.add(i),a.max.subtract(o)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=P(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-o.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-o.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),r=i.divideBy(2).round(),a=n.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=o({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 F(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}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 R(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=P(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=B(this.project(a,o),this.project(r,o)).getSize(),c=bt?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 o=this.getScaleZoom(p,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new I(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 o=i.zoom(t*i.scale(e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(U(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(P(t),e)},layerPointToLatLng:function(t){var e=P(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(U(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(U(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(U(t),U(e))},containerPointToLayerPoint:function(t){return P(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return P(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(P(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(U(t)))},mouseEventToContainerPoint:function(t){return Ze(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.");De(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&bt,ve(t,"leaflet-container"+(At?" 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),Se(this._mapPane,new I(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){Se(this._mapPane,new I(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),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 o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||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){Se(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:De;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),bt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=C((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,o=[],n="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(n&&!Je(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||r||n||!Je(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Oe(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=o({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&je(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!==y(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 Ce(this._mapPane)||new I(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 o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return B([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_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 o=this.project(t,e),n=this.getSize().divideBy(2),s=new N(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=B(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new I(this._rebound(n.x,-s.x),this._rebound(n.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(),o=bt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(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];Ae(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();Ae(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 o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){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:o}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function oi(t,e){return new ii(t,e)}var ni=$.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(),o=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.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 ni(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 o(o,n){var s=e+o+" "+e+n;t[o+n]=de("div",s,i)}o("top","left"),o("top","right"),o("bottom","left"),o("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=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!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 ni.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"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(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),Ue(e),Fe(e);var o=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||De(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=de("a",t+"-toggle",e);n.href="#",n.title="Layers",At?(De(n,"click",Ve),De(n,"click",this.expand,this)):De(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",o),this._separator=de("div",t+"-separator",o),this._overlaysList=de("div",t+"-overlays",o),e.appendChild(o)},_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,o,n=0;for(i=0;i<this._layers.length;i++)o=this._layers[i],this._addItem(o),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(t=t&&n>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"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+a(this),o),this._layerControlInputs.push(e),e.layerId=a(t.layer),De(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)t=i[n],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>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=ni.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"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.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,o,n){var s=de("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ue(s),De(s,"click",Ve),De(s,"click",n,this),De(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(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=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.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,o,n=3.2808399*t;n>5280?(e=n/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_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=ni.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"),Ue(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)};ni.Layers=ri,ni.Zoom=li,ni.Scale=ci,ni.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=$.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 gi,fi={Events:z},vi=At?"touchstart mousedown":"mousedown",bi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=M.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){m(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(De(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,!fe(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Oe(this._element),Ee(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Le(this._element);this._startPoint=new I(e.clientX,e.clientY),this._parentScale=Me(i),De(document,yi[t.type],this._onMove,this),De(document,bi[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 I(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,je(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ce(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=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Se(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ne(document,yi[t],this._onMove,this),Ne(document,bi[t],this._onUp,this);$e(),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=Ai(t=Ci(t,i),i)}function wi(t,e,i){return Math.sqrt(zi(t,e,i,!0))}function ki(t,e,i){return zi(t,e,i)}function Ai(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Si(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Si(t,e,i,o,n){var s,r,a,l=0;for(r=o+1;r<=n-1;r++)(a=zi(t[r],t[o],t[n],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Si(t,e,i,o,s),Si(t,e,i,s,n))}function Ci(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Oi(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ti(t,e,i,o,n){var s,r,a,l=o?gi:$i(t,i),h=$i(e,i);for(gi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=$i(r=Ei(t,e,s=l||h,i,n),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ei(t,e,i,o,n){var s,r,a=e.x-t.x,l=e.y-t.y,h=o.min,c=o.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 I(s,r,n)}function $i(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 Oi(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function zi(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((n=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=l*n)),a=t.x-s,l=t.y-r,o?a*a+l*l:new I(s,r)}function Li(t){return!b(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Mi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Li(t)}var Ii=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ti,_getEdgeIntersection:Ei,_getBitCode:$i,_sqClosestPointOnSegment:zi,isFlat:Li,_flat:Mi});function Di(t,e,i){var o,n,s,r,a,l,h,c,d,u=[1,4,2,8];for(n=0,h=t.length;n<h;n++)t[n]._code=$i(t[n],e);for(r=0;r<4;r++){for(c=u[r],o=[],n=0,s=(h=t.length)-1;n<h;s=n++)a=t[n],l=t[s],a._code&c?l._code&c||((d=Ei(l,a,c,e,i))._code=$i(d,e),o.push(d)):(l._code&c&&((d=Ei(l,a,c,e,i))._code=$i(d,e),o.push(d)),o.push(a));t=o}return t}var Pi=(Object.freeze||Object)({clipPolygon:Di}),Ni={project:function(t){return new I(t.lng,t.lat)},unproject:function(t){return new F(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Bi={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,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new I(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),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 F(a*i,t.x*i/o)}},Ri=(Object.freeze||Object)({LonLat:Ni,Mercator:Bi,SphericalMercator:H}),qi=o({},V,{code:"EPSG:3395",projection:Bi,transformation:function(){var t=.5/(Math.PI*Bi.R);return G(t,.5,-t,.5)}()}),Fi=o({},V,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Ui=o({},j,{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,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});j.Earth=V,j.EPSG3395=qi,j.EPSG3857=Y,j.EPSG900913=K,j.EPSG4326=Fi,j.Simple=Ui;var ji=M.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?b(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 o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.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=ji.extend({initialize:function(t,e){var i,o;if(m(this,e),this._layers={},t)for(i=0,o=t.length;i<o;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,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);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)}}),Zi=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 R;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=$.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 o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=P(o),s=P("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.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 Yi(t){return new Gi(t)}var Ki=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 Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.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["']?\)$/,"")}}),Qi=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&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Ce(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=B(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!l.contains(s)){var h=P((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(o);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Se(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(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=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Ce(e._icon),n=e._map.layerPointToLatLng(o);i&&Se(i,o),e._latlng=n,t.latlng=n,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)}}),Ji=ji.extend({options:{icon:new Ki,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=U(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=U(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),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!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 n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(ve(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&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){Se(this._icon,t),this._shadow&&Se(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),Qi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Qi(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 Xi(t,e){return new Ji(t,e)}var to=ji.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}}),eo=to.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=U(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=U(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 to.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(),o=[t+i,e+i];this._pxBounds=new N(this._point.subtract(o),this._point.add(o))},_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 io(t,e){return new eo(t,e)}var oo=eo.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=o({},i,{radius:e})),m(this,e),this._latlng=U(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 R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:to.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===V.distance){var n=Math.PI/180,s=this._mRadius/V.R/n,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*n)-Math.sin(e*n)*Math.sin(h*n))/(Math.cos(e*n)*Math.cos(h*n)))/n;(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=o.unproject(o.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 no(t,e,i){return new oo(t,e,i)}var so=to.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,o=1/0,n=null,s=zi,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<o&&(o=d,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,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,o=0;t<l-1;t++)if(n=a[t],s=a[t+1],(o+=i=n.distanceTo(s))>e)return r=(o-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=U(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Li(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Li(t),o=0,n=t.length;o<n;o++)i?(e[o]=U(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);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 I(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t[0]instanceof F,r=t.length;if(s){for(n=[],o=0;o<r;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<r;o++)this._projectLatlngs(t[o],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,o,n,s,r,a,l=this._parts;for(e=0,o=0,n=this._rings.length;e<n;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[o]=l[o]||[],l[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;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,o,n,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(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=l)return!0;return!1}});function ro(t,e){return new so(t,e)}so._flat=Mi;var ao=so.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,o,n,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],o=h[e],n=i.y*o.x-o.y*i.x,r+=(i.x+o.x)*n,a+=(i.y+o.y)*n,s+=3*n;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=so.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof F&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){so.prototype._setLatLngs.call(this,t),Li(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Li(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new I(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 o,n=0,s=this._rings.length;n<s;n++)(o=Di(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(l=(e=this._parts[n]).length)-1;s<l;r=s++)i=e[s],o=e[r],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(h=!h);return h||so.prototype._containsPoint.call(this,t,!0)}});function lo(t,e){return new ao(t,e)}var ho=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=b(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=co(t,s);return r?(r.feature=vo(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=o({},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 co(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Ji(i);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),l.push(h?h(t,i):new Ji(i));return new Hi(l);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new so(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ao(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var d=co({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function uo(t){return new F(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function mo(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 go(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?go(t[s],e-1,i,o):mo(t[s],o));return!e&&i&&n.push(n[0]),n}function fo(t,e){return t.feature?o({},t.feature,{geometry:e}):vo(e)}function vo(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var bo={toGeoJSON:function(t){return fo(this,{type:"Point",coordinates:mo(this.getLatLng(),t)})}};function yo(t,e){return new ho(t,e)}Ji.include(bo),oo.include(bo),eo.include(bo),so.include({toGeoJSON:function(t){var e=!Li(this._latlngs);return fo(this,{type:(e?"Multi":"")+"LineString",coordinates:go(this._latlngs,e?1:0,!1,t)})}}),ao.include({toGeoJSON:function(t){var e=!Li(this._latlngs),i=e&&!Li(this._latlngs[0]),o=go(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),fo(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Vi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),fo(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,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=vo(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?fo(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var _o=yo,xo=ji.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&&ge(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;Ae(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();Se(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)}}),wo=function(t,e,i){return new xo(t,e,i)},ko=xo.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"),o=[],n=0;n<i.length;n++)o.push(i[n].src);this._url=i.length>0?o:[e.src]}else{b(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 Ao(t,e,i){return new ko(t,e,i)}var So=xo.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 Co(t,e,i){return new So(t,e,i)}var To=ji.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=U(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&&ge(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof ji||(i=e,e=t),e instanceof Hi)for(var o in t._layers){e=t._layers[o];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=P(this.options.offset),i=this._getAnchor();this._zoomAnimated?Se(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),Eo=To.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){To.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof to||this._source.on("preclick",qe))},onRemove:function(t){To.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof to||this._source.off("preclick",qe))},getEvents:function(){var t=To.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),Ue(i),Fe(this._contentNode),De(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=de("a",t+"-close-button",e);o.href="#close",o.innerHTML="×",De(o,"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 o=t.offsetHeight,n=this.options.maxHeight,s="leaflet-popup-scrolled";n&&o>n?(e.height=n+"px",ve(t,s)):be(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Se(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,o=this._containerWidth,n=new I(this._containerLeft,-i-this._containerBottom);n._add(Ce(this._container));var s=t.layerPointToContainerPoint(n),r=P(this.options.autoPanPadding),a=P(this.options.autoPanPaddingTopLeft||r),l=P(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+o+l.x>h.x&&(c=s.x+o-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 P(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),$o=function(t,e){return new Eo(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof Eo||(t=new Eo(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}}),ji.include({bindPopup:function(t,e){return t instanceof Eo?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Eo(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 to?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 Oo=To.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){To.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){To.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=To.prototype.getEvents.call(this);return At&&!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,o=e.latLngToContainerPoint(e.getCenter()),n=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=P(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(P(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(P(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(P(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&n.x<o.x?(s="right",t=t.add(P(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(P(r+h.x-l.x,a/2-h.y-l.y,!0))),be(i,"leaflet-tooltip-right"),be(i,"leaflet-tooltip-left"),be(i,"leaflet-tooltip-top"),be(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Se(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 P(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),zo=function(t,e){return new Oo(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Oo||(t=new Oo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),ji.include({bindTooltip:function(t,e){return t instanceof Oo?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Oo(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),At&&(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&&(be(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,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Lo=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 o=P(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Mo(t){return new Lo(t)}Gi.Default=Ki;var Io=ji.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,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&&(ge(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 I?t:new I(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,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+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 o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);xe(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=C(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 o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),c(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_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 o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.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,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new I(+n,+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>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new I(n,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<o&&this._retainChildren(n,s,i+1,o))}},_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,o){var n=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom)&&(n=void 0);var s=this.options.updateWhenZooming&&n!==this._tileZoom;o&&!s||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&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 o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();bt?Ae(t.el,n,o):Se(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).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(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new N(n.subtract(s),n.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 o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,l=new N(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.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 I(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=n.min.y;d<=n.max.y;d++)for(var u=n.min.x;u<=n.max.x;u++){var p=new I(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 g=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],g);this._level.el.appendChild(g)}}}}},_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 o=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(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 I(+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),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),n=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(n),this.createTile.length<2&&C(s(this._tileReady,this,t,null,n)),Se(n,i),this._tiles[o]={el:n,coords:t,current:!0},e.appendChild(n),this.fire("tileloadstart",{tile:n,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),T(this._fadeFrame),this._fadeFrame=C(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?C(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 I(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 Do(t){return new Io(t)}var Po=Io.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("")),nt||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 De(i,"load",s(this._tileOnLoad,this,e,i)),De(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,o(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),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",_),Io.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Io.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Po(t,e)}var Bo=Po.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=o({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);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,Po.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=B(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===Fi?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Po.prototype.getTileUrl.call(this,t);return a+g(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return o(this.wmsParams,t),e||this.redraw(),this}});function Ro(t,e){return new Bo(t,e)}Po.WMS=Bo,No.wms=Ro;var qo=ji.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),o=Ce(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);bt?Ae(this._container,a,i):Se(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()}}),Fo=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");De(t,"mousemove",l(this._onMouseMove,32,this),this),De(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),De(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){qo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=Tt?2:1;Se(e,t.min),e.width=o*i.x,e.height=o*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(){qo.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,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.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,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(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 o=this._drawFirst;o;o=o.next)t=o.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,o,n,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)s=r[i][o],l[o?"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,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&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,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ke(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&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,o,n=this._drawFirst;n;n=n.next)(i=n.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(ve(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),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,o=e.prev;i&&(i.prev=o,o?o.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,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return Et?new Fo(t):null}var jo=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">')}}}(),Vo={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=jo("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=jo("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,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=jo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,o.dashArray?e.dashStyle=b(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=jo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){ge(t._container)}},Zo=Ot?jo:Q,Ho=qo.extend({getEvents:function(){var t=qo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Zo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Zo("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){qo.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)),Se(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=Zo("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,J(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){ge(t._path)}});function Wo(t){return $t||Ot?new Ho(t):null}Ot&&Ho.include(Vo),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&&Uo(t)||Wo(t)}});var Go=ao.extend({initialize:function(t,e){ao.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 Yo(t,e){return new Go(t,e)}Ho.create=Zo,Ho.pointsToPath=J,ho.geometryToLayer=co,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=mo,ho.latLngsToCoords=go,ho.getFeature=fo,ho.asFeature=vo,ii.mergeOptions({boxZoom:!0});var Ko=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(){De(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(),Ee(),this._startPoint=this._map.mouseEventToContainerPoint(t),De(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();Se(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),be(this._container,"leaflet-crosshair")),ie(),$e(),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 R(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",Ko),ii.mergeOptions({doubleClickZoom:!0});var Qo=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(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ii.addInitHook("addHandler","doubleClickZoom",Qo),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jo=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(){be(this._map._container,"leaflet-grab"),be(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=B(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,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=n.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),C((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Jo),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Xo=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"),De(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,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,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,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){De(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,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=P(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Ve(t)}}});ii.addInitHook("addHandler","keyboard",Xo),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=mi.extend({addHooks:function(){De(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 o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),o),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=this._delta/(4*this._map.options.wheelPxPerZoomLevel),n=4*Math.log(2/(1+Math.exp(-Math.abs(o))))/Math.LN2,s=i?Math.ceil(n/i)*i:n,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",tn),ii.mergeOptions({tap:!0,tapTolerance:15});var en=mi.extend({addHooks:function(){De(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(je(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 I(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),De(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()&&be(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 I(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)}});At&&!kt&&ii.addInitHook("addHandler","tap",en),ii.mergeOptions({touchZoom:At&&!st,bounceAtZoomLimits:!0});var on=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),De(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(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]),o=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(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),De(document,"touchmove",this._onTouchMove,this),De(document,"touchend",this._onTouchEnd,this),je(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),n=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(n,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&n<1||this._zoom>e.getMaxZoom()&&n>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===n)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===n&&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=C(a,this,!0),je(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",on),ii.BoxZoom=Ko,ii.DoubleClickZoom=Qo,ii.Drag=Jo,ii.Keyboard=Xo,ii.ScrollWheelZoom=tn,ii.Tap=en,ii.TouchZoom=on,Object.freeze=i,t.version=e,t.Control=ni,t.control=si,t.Browser=Lt,t.Evented=M,t.Mixin=fi,t.Util=E,t.Class=$,t.Handler=mi,t.extend=o,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Ie,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Ii,t.PolyUtil=Pi,t.Point=I,t.point=P,t.Bounds=N,t.bounds=B,t.Transformation=W,t.transformation=G,t.Projection=Ri,t.LatLng=F,t.latLng=U,t.LatLngBounds=R,t.latLngBounds=q,t.CRS=j,t.GeoJSON=ho,t.geoJSON=yo,t.geoJson=_o,t.Layer=ji,t.LayerGroup=Vi,t.layerGroup=Zi,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xo,t.imageOverlay=wo,t.VideoOverlay=ko,t.videoOverlay=Ao,t.SVGOverlay=So,t.svgOverlay=Co,t.DivOverlay=To,t.Popup=Eo,t.popup=$o,t.Tooltip=Oo,t.tooltip=zo,t.Icon=Gi,t.icon=Yi,t.DivIcon=Lo,t.divIcon=Mo,t.Marker=Ji,t.marker=Xi,t.TileLayer=Po,t.tileLayer=No,t.GridLayer=Io,t.gridLayer=Do,t.SVG=Ho,t.svg=Wo,t.Renderer=qo,t.Canvas=Fo,t.canvas=Uo,t.Path=to,t.CircleMarker=eo,t.circleMarker=io,t.Circle=oo,t.circle=no,t.Polyline=so,t.polyline=ro,t.Polygon=ao,t.polygon=lo,t.Rectangle=Go,t.rectangle=Yo,t.Map=ii,t.map=oi;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t})(Ic.exports);var Dc=Ic.exports;const Pc={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},Nc={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},Bc=()=>Pc;class Rc extends lt{static get styles(){return r`
|
|
8545
8563
|
:host {
|
|
8546
8564
|
display: block;
|
|
8547
8565
|
padding: 0px;
|
|
@@ -8576,11 +8594,11 @@ const{I:pc}=rt,mc=()=>document.createComment(""),gc=(t,e,i)=>{const o=t._$AA.par
|
|
|
8576
8594
|
color: var(--color-link-primary);
|
|
8577
8595
|
cursor: pointer;
|
|
8578
8596
|
}
|
|
8579
|
-
`}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(
|
|
8597
|
+
`}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(Nc),this.hovered=e)},mouseout:t=>{t.target.setStyle(Pc),this.hovered=null}})};Vt(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=Dc.geoJSON(i.geometry,{style:Bc,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(Pc),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(Nc)}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=Dc.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?V`
|
|
8580
8598
|
<link
|
|
8581
8599
|
rel="stylesheet"
|
|
8582
8600
|
href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
|
|
8583
8601
|
/>
|
|
8584
8602
|
<div id="alias-map"></div>
|
|
8585
|
-
`:
|
|
8603
|
+
`:V`<div>No osm map id</div>`}}t([ce()],Rc.prototype,"feature",void 0),t([ce()],Rc.prototype,"osmId",void 0),t([ce()],Rc.prototype,"endpoint",void 0),t([ce()],Rc.prototype,"onFeatureClicked",void 0),t([ce()],Rc.prototype,"hovered",void 0),t([ce()],Rc.prototype,"path",void 0),Lc("leaflet-map",Rc),Lc("alias-editor",Mc)}();
|
|
8586
8604
|
//# sourceMappingURL=temba-components.js.map
|