@nyaruka/temba-components 0.63.3 → 0.64.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.
@@ -225,7 +225,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
225
225
  <slot></slot>
226
226
  </div>
227
227
  </temba-field>
228
- `}}t([ct({type:Boolean})],xt.prototype,"textarea",void 0),t([ct({type:String})],xt.prototype,"placeholder",void 0),t([ct({type:Boolean})],xt.prototype,"password",void 0),t([ct({type:Number})],xt.prototype,"maxlength",void 0),t([ct({type:Object})],xt.prototype,"inputElement",void 0),t([ct({type:Boolean})],xt.prototype,"clearable",void 0),t([ct({type:Boolean})],xt.prototype,"gsm",void 0),t([ct({type:String})],xt.prototype,"counter",void 0),t([ct({type:Boolean})],xt.prototype,"loading",void 0),t([ct({type:Boolean})],xt.prototype,"submitOnEnter",void 0),t([ct()],xt.prototype,"onBlur",void 0),t([ct({type:Boolean})],xt.prototype,"autogrow",void 0);var wt,kt,St,Et,$t,Ct,Tt,At,Lt,Mt,Ot,zt,Pt,It,Dt,Nt,Rt,Bt,qt=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},Ut=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Zt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let n=0;n<t.length;n++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(n);return e},Ft="0123456789abcdef".split(""),Vt=[-2147483648,8388608,32768,128],jt=[24,16,8,0],Ht=[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],Wt=[];class Gt{constructor(t=!1,e=!1){wt.set(this,void 0),kt.set(this,void 0),St.set(this,void 0),Et.set(this,void 0),$t.set(this,void 0),Ct.set(this,void 0),Tt.set(this,void 0),At.set(this,void 0),Lt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),zt.set(this,void 0),Pt.set(this,void 0),It.set(this,void 0),Dt.set(this,void 0),Nt.set(this,void 0),Rt.set(this,0),Bt.set(this,void 0),this.init(t,e)}init(t,e){e?(Wt[0]=Wt[16]=Wt[1]=Wt[2]=Wt[3]=Wt[4]=Wt[5]=Wt[6]=Wt[7]=Wt[8]=Wt[9]=Wt[10]=Wt[11]=Wt[12]=Wt[13]=Wt[14]=Wt[15]=0,qt(this,kt,Wt)):qt(this,kt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(qt(this,Ct,3238371032),qt(this,Tt,914150663),qt(this,At,812702999),qt(this,Lt,4144912697),qt(this,Mt,4290775857),qt(this,Ot,1750603025),qt(this,zt,1694076839),qt(this,Pt,3204075428)):(qt(this,Ct,1779033703),qt(this,Tt,3144134277),qt(this,At,1013904242),qt(this,Lt,2773480762),qt(this,Mt,1359893119),qt(this,Ot,2600822924),qt(this,zt,528734635),qt(this,Pt,1541459225)),qt(this,wt,qt(this,Bt,qt(this,St,qt(this,Dt,0)))),qt(this,Et,qt(this,It,!1)),qt(this,$t,!0),qt(this,Nt,t)}update(t){if(Ut(this,Et))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const n=e.length,o=Ut(this,kt);for(;i<n;){let t;if(Ut(this,It)&&(qt(this,It,!1),o[0]=Ut(this,wt),o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),"string"!=typeof e)for(t=Ut(this,Bt);i<n&&t<64;++i)o[t>>2]|=e[i]<<jt[3&t++];else for(t=Ut(this,Bt);i<n&&t<64;++i){let n=e.charCodeAt(i);n<128?o[t>>2]|=n<<jt[3&t++]:n<2048?(o[t>>2]|=(192|n>>6)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++]):n<55296||n>=57344?(o[t>>2]|=(224|n>>12)<<jt[3&t++],o[t>>2]|=(128|n>>6&63)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[t>>2]|=(240|n>>18)<<jt[3&t++],o[t>>2]|=(128|n>>12&63)<<jt[3&t++],o[t>>2]|=(128|n>>6&63)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++])}qt(this,Rt,t),qt(this,St,Ut(this,St)+(t-Ut(this,Bt))),t>=64?(qt(this,wt,o[16]),qt(this,Bt,t-64),this.hash(),qt(this,It,!0)):qt(this,Bt,t)}return Ut(this,St)>4294967295&&(qt(this,Dt,Ut(this,Dt)+(Ut(this,St)/4294967296<<0)),qt(this,St,Ut(this,St)%4294967296)),this}finalize(){if(Ut(this,Et))return;qt(this,Et,!0);const t=Ut(this,kt),e=Ut(this,Rt);t[16]=Ut(this,wt),t[e>>2]|=Vt[3&e],qt(this,wt,t[16]),e>=56&&(Ut(this,It)||this.hash(),t[0]=Ut(this,wt),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]=Ut(this,Dt)<<3|Ut(this,St)>>>29,t[15]=Ut(this,St)<<3,this.hash()}hash(){let t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt);const l=Ut(this,kt);let h,c,d,u,p,m,f,g,v,y;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c<<0;y=e&i;for(let b=0;b<64;b+=4)Ut(this,$t)?(Ut(this,Nt)?(f=300032,u=l[0]-1413257819,a=u-150054599<<0,n=u+24177077<<0):(f=704751109,u=l[0]-210244248,a=u-1521486534<<0,n=u+143694565<<0),qt(this,$t,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),f=t&e,d=f^t&i^y,m=o&s^~o&r,u=a+c+m+Ht[b]+l[b],p=h+d,a=n+u<<0,n=u+p<<0),h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),g=n&t,d=g^n&e^f,m=a&o^~a&s,u=r+c+m+Ht[b+1]+l[b+1],p=h+d,r=i+u<<0,i=u+p<<0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&n,d=v^i&t^g,m=r&a^~r&o,u=s+c+m+Ht[b+2]+l[b+2],p=h+d,s=e+u<<0,e=u+p<<0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=e&i,d=y^e&n^v,m=s&r^~s&a,u=o+c+m+Ht[b+3]+l[b+3],p=h+d,o=t+u<<0,t=u+p<<0;qt(this,Ct,Ut(this,Ct)+t<<0),qt(this,Tt,Ut(this,Tt)+e<<0),qt(this,At,Ut(this,At)+i<<0),qt(this,Lt,Ut(this,Lt)+n<<0),qt(this,Mt,Ut(this,Mt)+o<<0),qt(this,Ot,Ut(this,Ot)+s<<0),qt(this,zt,Ut(this,zt)+r<<0),qt(this,Pt,Ut(this,Pt)+a<<0)}hex(){this.finalize();const t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt);let l=Ft[t>>28&15]+Ft[t>>24&15]+Ft[t>>20&15]+Ft[t>>16&15]+Ft[t>>12&15]+Ft[t>>8&15]+Ft[t>>4&15]+Ft[15&t]+Ft[e>>28&15]+Ft[e>>24&15]+Ft[e>>20&15]+Ft[e>>16&15]+Ft[e>>12&15]+Ft[e>>8&15]+Ft[e>>4&15]+Ft[15&e]+Ft[i>>28&15]+Ft[i>>24&15]+Ft[i>>20&15]+Ft[i>>16&15]+Ft[i>>12&15]+Ft[i>>8&15]+Ft[i>>4&15]+Ft[15&i]+Ft[n>>28&15]+Ft[n>>24&15]+Ft[n>>20&15]+Ft[n>>16&15]+Ft[n>>12&15]+Ft[n>>8&15]+Ft[n>>4&15]+Ft[15&n]+Ft[o>>28&15]+Ft[o>>24&15]+Ft[o>>20&15]+Ft[o>>16&15]+Ft[o>>12&15]+Ft[o>>8&15]+Ft[o>>4&15]+Ft[15&o]+Ft[s>>28&15]+Ft[s>>24&15]+Ft[s>>20&15]+Ft[s>>16&15]+Ft[s>>12&15]+Ft[s>>8&15]+Ft[s>>4&15]+Ft[15&s]+Ft[r>>28&15]+Ft[r>>24&15]+Ft[r>>20&15]+Ft[r>>16&15]+Ft[r>>12&15]+Ft[r>>8&15]+Ft[r>>4&15]+Ft[15&r];return Ut(this,Nt)||(l+=Ft[a>>28&15]+Ft[a>>24&15]+Ft[a>>20&15]+Ft[a>>16&15]+Ft[a>>12&15]+Ft[a>>8&15]+Ft[a>>4&15]+Ft[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Ut(this,Nt)||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(Ut(this,Nt)?28:32),e=new DataView(t);return e.setUint32(0,Ut(this,Ct)),e.setUint32(4,Ut(this,Tt)),e.setUint32(8,Ut(this,At)),e.setUint32(12,Ut(this,Lt)),e.setUint32(16,Ut(this,Mt)),e.setUint32(20,Ut(this,Ot)),e.setUint32(24,Ut(this,zt)),Ut(this,Nt)||e.setUint32(28,Ut(this,Pt)),t}}function Kt(t){const e=new Gt;return e.update(t),parseInt(e.hex().substring(0,8),16)}wt=new WeakMap,kt=new WeakMap,St=new WeakMap,Et=new WeakMap,$t=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,At=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Pt=new WeakMap,It=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Bt=new WeakMap;const Yt=function(t,e,i){var n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?o+6*(n-o)*t:t<.5?n:t<2/3?o+6*(n-o)*(2/3-t):o,Math.round(255*t)}))};const Jt="/api/v2/media.json",Xt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Kt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Zt)}hsl(t){var e,i,n=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[n%this.hueRanges.length];e=n/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=n%359;return n=Math.ceil(n/360),i=this.S[n%this.S.length],n=Math.ceil(n/this.S.length),[e,i,this.L[n%this.L.length]]}rgb(t){var e=this.hsl(t);return Yt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}},Qt=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},te=(t,e=null,i={})=>new Promise(((n,o)=>{const s={method:"GET",headers:Qt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),ee=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()},ie=(t,e=null)=>new Promise(((i,n)=>{te(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),ne=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ie(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},oe=t=>new Promise(((e,i)=>{te(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),se=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await oe(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},re=(t,e,i={},n=null)=>{const o=Qt(i);n&&(o["Content-Type"]=n);const s={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},ae=(t,e)=>re(t,JSON.stringify(e),!1,"application/json"),le=(t,e)=>new Promise(((i,n)=>{re(t,e,!0).then((e=>{e.status>=200&&e.status<400?i(e):n(t===Jt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),he=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:he(e):null}return null},ce=(t,e,i=!1)=>{let n;return function(...o){const s=this,r=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(s,o)}),e),r&&t.apply(s,o)}},de=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},ue=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,n)=>n<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],pe=(t,e,i="and")=>ue(t.map(e),i),me=t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e};var fe;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(fe||(fe={}));const ge=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),ve=(t,e)=>{if(0==t)return"0 KB";const i=e||2,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(i))+" "+["B","KB","MB","GB"][n]},ye=t=>{t&&(t.stopPropagation(),t.preventDefault())},be=(t,e,i)=>{i/=100;const n=e*Math.min(i,1-i)/100,o=e=>{const o=(e+t/30)%12,s=i-n*Math.max(Math.min(o-3,9-o,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`},_e=t=>{if(t.position||(t.position="right"),t.image)return D`<img src="${t.image}">`;let e=t.name;if(t.user&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;const i=Xt.hex(e);let n=e.indexOf(" ")+1;n<1&&(n=e.length>1?1:0);let o=e.substring(0,1)+e.substring(n,n+1);o=o.toUpperCase();const s=D` <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center"> <div class="avatar-circle" style="display:flex;height:2em;width:2em;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;border:.3em solid rgba(0,0,0,.05);background:${i}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${o}</div> </div> </div> </div> `;return t.tip?D` <temba-tip text="${e}" position="${t.position}"> ${s} </temba-tip> `:s};var xe,we,ke,Se;!function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(xe||(xe={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}(we||(we={})),function(t){t.Open="open",t.Closed="closed"}(ke||(ke={})),function(t){t.Loaded="temba-loaded",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.MessageSent="temba-message-sent",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready",t.OrderChanged="temba-order-changed",t.DragStart="temba-drag-start",t.DragStop="temba-drag-stop",t.Resized="temba-resized"}(Se||(Se={}));class Ee{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function $e(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new Ee(t,e)}class Ce extends Error{}class Te extends Ce{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Ae extends Ce{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Le extends Ce{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Me extends Ce{}class Oe extends Ce{constructor(t){super(`Invalid unit ${t}`)}}class ze extends Ce{}class Pe extends Ce{constructor(){super("Zone is an abstract class")}}const Ie="numeric",De="short",Ne="long",Re={year:Ie,month:Ie,day:Ie},Be={year:Ie,month:De,day:Ie},qe={year:Ie,month:De,day:Ie,weekday:De},Ue={year:Ie,month:Ne,day:Ie},Ze={year:Ie,month:Ne,day:Ie,weekday:Ne},Fe={hour:Ie,minute:Ie},Ve={hour:Ie,minute:Ie,second:Ie},je={hour:Ie,minute:Ie,second:Ie,timeZoneName:De},He={hour:Ie,minute:Ie,second:Ie,timeZoneName:Ne},We={hour:Ie,minute:Ie,hourCycle:"h23"},Ge={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23"},Ke={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:De},Ye={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:Ne},Je={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie},Xe={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie,second:Ie},Qe={year:Ie,month:De,day:Ie,hour:Ie,minute:Ie},ti={year:Ie,month:De,day:Ie,hour:Ie,minute:Ie,second:Ie},ei={year:Ie,month:De,day:Ie,weekday:De,hour:Ie,minute:Ie},ii={year:Ie,month:Ne,day:Ie,hour:Ie,minute:Ie,timeZoneName:De},ni={year:Ie,month:Ne,day:Ie,hour:Ie,minute:Ie,second:Ie,timeZoneName:De},oi={year:Ie,month:Ne,day:Ie,weekday:Ne,hour:Ie,minute:Ie,timeZoneName:Ne},si={year:Ie,month:Ne,day:Ie,weekday:Ne,hour:Ie,minute:Ie,second:Ie,timeZoneName:Ne};function ri(t){return void 0===t}function ai(t){return"number"==typeof t}function li(t){return"number"==typeof t&&t%1==0}function hi(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function ci(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function di(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ui(t,e,i){return li(t)&&t>=e&&t<=i}function pi(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function mi(t){return ri(t)||null===t||""===t?void 0:parseInt(t,10)}function fi(t){return ri(t)||null===t||""===t?void 0:parseFloat(t)}function gi(t){if(!ri(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function vi(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function yi(t){return t%4==0&&(t%100!=0||t%400==0)}function bi(t){return yi(t)?366:365}function _i(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?yi(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function xi(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function wi(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function ki(t){return t>99?t:t>60?1900+t:2e3+t}function Si(t,e,i,n=null){const o=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Ei(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function $i(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new ze(`Invalid unit value ${t}`);return e}function Ci(t,e){const i={};for(const n in t)if(di(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=$i(o)}return i}function Ti(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${pi(i,2)}:${pi(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${pi(i,2)}${pi(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ai(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Li=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Mi=["January","February","March","April","May","June","July","August","September","October","November","December"],Oi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zi=["J","F","M","A","M","J","J","A","S","O","N","D"];function Pi(t){switch(t){case"narrow":return[...zi];case"short":return[...Oi];case"long":return[...Mi];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 Ii=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Di=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ni=["M","T","W","T","F","S","S"];function Ri(t){switch(t){case"narrow":return[...Ni];case"short":return[...Di];case"long":return[...Ii];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Bi=["AM","PM"],qi=["Before Christ","Anno Domini"],Ui=["BC","AD"],Zi=["B","A"];function Fi(t){switch(t){case"narrow":return[...Zi];case"short":return[...Ui];case"long":return[...qi];default:return null}}function Vi(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const ji={D:Re,DD:Be,DDD:Ue,DDDD:Ze,t:Fe,tt:Ve,ttt:je,tttt:He,T:We,TT:Ge,TTT:Ke,TTTT:Ye,f:Je,ff:Qe,fff:ii,ffff:oi,F:Xe,FF:ti,FFF:ni,FFFF:si};class Hi{static create(t,e={}){return new Hi(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&o.push({literal:!1,val:i}),i=r,e=r)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return ji[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return pi(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),s=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return Bi[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return Pi(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Ri(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=Hi.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Fi(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return Vi(Hi.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=Hi.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...o.map(i).filter((t=>t)));return Vi(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(s))}}class Wi{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Gi{get type(){throw new Pe}get name(){throw new Pe}get ianaName(){return this.name}get isUniversal(){throw new Pe}offsetName(t,e){throw new Pe}formatOffset(t,e){throw new Pe}offset(t){throw new Pe}equals(t){throw new Pe}get isValid(){throw new Pe}}let Ki=null;class Yi extends Gi{static get instance(){return null===Ki&&(Ki=new Yi),Ki}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Si(t,e,i)}formatOffset(t,e){return Ti(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let Ji={};const Xi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Qi={};class tn extends Gi{static create(t){return Qi[t]||(Qi[t]=new tn(t)),Qi[t]}static resetCache(){Qi={},Ji={}}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=tn.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return Si(t,e,i,this.name)}formatOffset(t,e){return Ti(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,Ji[n]||(Ji[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ji[n]);var n;let[o,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],s=Xi[e];"era"===e?n[s]=o:ri(s)||(n[s]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,s,r,a,l,h,c]=n;return[r,o,s,a,l,h,c]}(i,e);"BC"===a&&(o=1-Math.abs(o));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,(xi({year:o,month:s,day:r,hour:24===l?0:l,minute:h,second:c,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let en=null;class nn extends Gi{static get utcInstance(){return null===en&&(en=new nn(0)),en}static instance(t){return 0===t?nn.utcInstance:new nn(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new nn(Ei(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Ti(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${Ti(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Ti(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 on extends Gi{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 sn(t,e){if(ri(t)||null===t)return e;if(t instanceof Gi)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?nn.utcInstance:nn.parseSpecifier(i)||tn.create(t)}return ai(t)?nn.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new on(t)}let rn,an=()=>Date.now(),ln="system",hn=null,cn=null,dn=null;class un{static get now(){return an}static set now(t){an=t}static set defaultZone(t){ln=t}static get defaultZone(){return sn(ln,Yi.instance)}static get defaultLocale(){return hn}static set defaultLocale(t){hn=t}static get defaultNumberingSystem(){return cn}static set defaultNumberingSystem(t){cn=t}static get defaultOutputCalendar(){return dn}static set defaultOutputCalendar(t){dn=t}static get throwOnInvalid(){return rn}static set throwOnInvalid(t){rn=t}static resetCaches(){kn.resetCache(),tn.resetCache()}}let pn={};let mn={};function fn(t,e={}){const i=JSON.stringify([t,e]);let n=mn[i];return n||(n=new Intl.DateTimeFormat(t,e),mn[i]=n),n}let gn={};let vn={};let yn=null;function bn(t,e,i,n,o){const s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):o(e)}class _n{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...s}=i;if(!e||Object.keys(s).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=gn[i];return n||(n=new Intl.NumberFormat(t,e),gn[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return pi(this.floor?Math.floor(t):vi(t,3),this.padTo)}}class xn{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&tn.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:ks.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=fn(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class wn{constructor(t,e,i){this.opts={style:"long",...i},!e&&hi()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let s=vn[o];return s||(s=new Intl.RelativeTimeFormat(t,e),vn[o]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=o[t],c=n?l?h[1]:h[2]||h[1]:l?o[t][0]:t;return r?`${a} ${c} ago`:`in ${a} ${c}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class kn{static fromOpts(t){return kn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||un.defaultLocale,s=o||(n?"en-US":yn||(yn=(new Intl.DateTimeFormat).resolvedOptions().locale,yn)),r=e||un.defaultNumberingSystem,a=i||un.defaultOutputCalendar;return new kn(s,r,a,o)}static resetCache(){yn=null,mn={},gn={},vn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return kn.create(t,e,i)}constructor(t,e,i,n){const[o,s,r]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=fn(t).resolvedOptions()}catch(t){i=fn(n).resolvedOptions()}const{numberingSystem:o,calendar:s}=i;return[n,o,s]}}(t);this.locale=o,this.numberingSystem=e||s||null,this.outputCalendar=i||r||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?kn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return bn(this,t,i,Pi,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=ks.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return bn(this,t,i,Ri,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=ks.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return bn(this,void 0,t,(()=>Bi),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ks.utc(2016,11,13,9),ks.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return bn(this,t,e,Fi,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[ks.utc(-40,1,1),ks.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new _n(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new xn(t,this.intl,e)}relFormatter(t={}){return new wn(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=pn[i];return n||(n=new Intl.ListFormat(t,e),pn[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Sn(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function En(...t){return e=>t.reduce((([t,i,n],o)=>{const[s,r,a]=o(e,n);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function $n(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function Cn(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=mi(e[i+o]);return[n,null,i+o]}}const Tn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,An=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ln=RegExp(`${An.source}${`(?:${Tn.source}?(?:\\[(${Li.source})\\])?)?`}`),Mn=RegExp(`(?:T${Ln.source})?`),On=Cn("weekYear","weekNumber","weekDay"),zn=Cn("year","ordinal"),Pn=RegExp(`${An.source} ?(?:${Tn.source}|(${Li.source}))?`),In=RegExp(`(?: ${Pn.source})?`);function Dn(t,e,i){const n=t[e];return ri(n)?i:mi(n)}function Nn(t,e){return[{hours:Dn(t,e,0),minutes:Dn(t,e+1,0),seconds:Dn(t,e+2,0),milliseconds:gi(t[e+3])},null,e+4]}function Rn(t,e){const i=!t[e]&&!t[e+1],n=Ei(t[e+1],t[e+2]);return[{},i?null:nn.instance(n),e+3]}function Bn(t,e){return[{},t[e]?tn.create(t[e]):null,e+1]}const qn=RegExp(`^T?${An.source}$`),Un=/^-?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 Zn(t){const[e,i,n,o,s,r,a,l,h]=t,c="-"===e[0],d=l&&"-"===l[0],u=(t,e=!1)=>void 0!==t&&(e||t&&c)?-t:t;return[{years:u(fi(i)),months:u(fi(n)),weeks:u(fi(o)),days:u(fi(s)),hours:u(fi(r)),minutes:u(fi(a)),seconds:u(fi(l),"-0"===l),milliseconds:u(gi(h),d)}]}const Fn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Vn(t,e,i,n,o,s,r){const a={year:2===e.length?ki(mi(e)):mi(e),month:Oi.indexOf(i)+1,day:mi(n),hour:mi(o),minute:mi(s)};return r&&(a.second=mi(r)),t&&(a.weekday=t.length>3?Ii.indexOf(t)+1:Di.indexOf(t)+1),a}const jn=/^(?:(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 Hn(t){const[,e,i,n,o,s,r,a,l,h,c,d]=t,u=Vn(e,o,n,i,s,r,a);let p;return p=l?Fn[l]:h?0:Ei(c,d),[u,new nn(p)]}const Wn=/^(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$/,Gn=/^(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$/,Kn=/^(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 Yn(t){const[,e,i,n,o,s,r,a]=t;return[Vn(e,o,n,i,s,r,a),nn.utcInstance]}function Jn(t){const[,e,i,n,o,s,r,a]=t;return[Vn(e,a,i,n,o,s,r),nn.utcInstance]}const Xn=Sn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Mn),Qn=Sn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Mn),to=Sn(/(\d{4})-?(\d{3})/,Mn),eo=Sn(Ln),io=En((function(t,e){return[{year:Dn(t,e),month:Dn(t,e+1,1),day:Dn(t,e+2,1)},null,e+3]}),Nn,Rn,Bn),no=En(On,Nn,Rn,Bn),oo=En(zn,Nn,Rn,Bn),so=En(Nn,Rn,Bn);const ro=En(Nn);const ao=Sn(/(\d{4})-(\d\d)-(\d\d)/,In),lo=Sn(Pn),ho=En(Nn,Rn,Bn);const co={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}},uo={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},...co},po=365.2425,mo=30.436875,fo={years:{quarters:4,months:12,weeks:52.1775,days:po,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:mo,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...co},go=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vo=go.slice(0).reverse();function yo(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new _o(n)}function bo(t,e,i,n,o){const s=t[o][i],r=e[i]/s,a=!(Math.sign(r)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(r)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(r):Math.trunc(r);n[o]+=a,e[i]-=a*s}class _o{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||kn.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?fo:uo,this.isLuxonDuration=!0}static fromMillis(t,e){return _o.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new ze("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new _o({values:Ci(t,_o.normalizeUnit),loc:kn.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(ai(t))return _o.fromMillis(t);if(_o.isDuration(t))return t;if("object"==typeof t)return _o.fromObject(t);throw new ze(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return $n(t,[Un,Zn])}(t);return i?_o.fromObject(i,e):_o.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return $n(t,[qn,ro])}(t);return i?_o.fromObject(i,e):_o.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new ze("need to specify a reason the Duration is invalid");const i=t instanceof Wi?t:new Wi(t,e);if(un.throwOnInvalid)throw new Le(i);return new _o({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 Oe(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?Hi.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=go.map((e=>{const i=this.values[e];return ri(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+=vi(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=_o.fromDurationLike(t),i={};for(const t of go)(di(e.values,t)||di(this.values,t))&&(i[t]=e.get(t)+this.get(t));return yo(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=_o.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]=$i(t(this.values[i],i));return yo(this,{values:e},!0)}get(t){return this[_o.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return yo(this,{values:{...this.values,...Ci(t,_o.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),yo(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){vo.reduce(((i,n)=>ri(e[n])?i:(i&&bo(t,e,i,e,n),n)),null)}(this.matrix,t),yo(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>_o.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const s of go)if(t.indexOf(s)>=0){o=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;ai(n[s])&&(t+=n[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3;for(const t in n)go.indexOf(t)>go.indexOf(s)&&bo(this.matrix,n,t,e,s)}else ai(n[s])&&(i[s]=n[s]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return yo(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return yo(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of go)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const xo="Invalid Interval";class wo{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 ze("need to specify a reason the Interval is invalid");const i=t instanceof Wi?t:new Wi(t,e);if(un.throwOnInvalid)throw new Ae(i);return new wo({invalid:i})}static fromDateTimes(t,e){const i=Ss(t),n=Ss(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?wo.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:wo.invalid("missing or invalid end"):wo.invalid("missing or invalid start")}(i,n);return null==o?new wo({start:i,end:n}):o}static after(t,e){const i=_o.fromDurationLike(e),n=Ss(t);return wo.fromDateTimes(n,n.plus(i))}static before(t,e){const i=_o.fromDurationLike(e),n=Ss(t);return wo.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,s,r;try{t=ks.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{s=ks.fromISO(n,e),r=s.isValid}catch(n){r=!1}if(o&&r)return wo.fromDateTimes(t,s);if(o){const i=_o.fromISO(n,e);if(i.isValid)return wo.after(t,i)}else if(r){const t=_o.fromISO(i,e);if(t.isValid)return wo.before(s,t)}}return wo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?wo.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(Ss).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,s=+t>+this.e?this.e:t;i.push(wo.fromDateTimes(n,s)),n=s,o+=1}return i}splitBy(t){const e=_o.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const s=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,s.push(wo.fromDateTimes(n,i)),n=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:wo.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 wo.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of s)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(wo.fromDateTimes(e,t.time)),e=null);return wo.merge(n)}difference(...t){return wo.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:xo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:xo}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:xo}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):_o.invalid(this.invalidReason)}mapEndpoints(t){return wo.fromDateTimes(t(this.s),t(this.e))}}class ko{static hasDST(t=un.defaultZone){const e=ks.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return tn.isValidZone(t)}static normalizeZone(t){return sn(t,un.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||kn.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||kn.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||kn.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||kn.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return kn.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return kn.create(e,null,"gregory").eras(t)}static features(){return{relative:hi()}}}function So(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(_o.fromMillis(n).as("days"))}function Eo(t,e,i,n){let[o,s,r,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=So(t,e);return(i-i%7)/7}],["days",So]],o={};let s,r;for(const[a,l]of n)if(i.indexOf(a)>=0){s=a;let i=l(t,e);r=t.plus({[a]:i}),r>e?(t=t.plus({[a]:i-1}),i-=1):t=r,o[a]=i}return[t,o,r,s]}(t,e,i);const l=e-o,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=o.plus({[a]:1})),r!==o&&(s[a]=(s[a]||0)+l/(r-o)));const c=_o.fromObject(s,n);return h.length>0?_o.fromMillis(l,n).shiftTo(...h).plus(c):c}const $o={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Co={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]},To=$o.hanidec.replace(/[\[|\]]/g,"").split("");function Ao({numberingSystem:t},e=""){return new RegExp(`${$o[t||"latn"]}${e}`)}function Lo(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search($o.hanidec))e+=To.indexOf(t[i]);else for(const t in Co){const[i,o]=Co[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const Mo=`[ ${String.fromCharCode(160)}]`,Oo=new RegExp(Mo,"g");function zo(t){return t.replace(/\./g,"\\.?").replace(Oo,Mo)}function Po(t){return t.replace(/\./g,"").replace(Oo," ").toLowerCase()}function Io(t,e){return null===t?null:{regex:RegExp(t.map(zo).join("|")),deser:([i])=>t.findIndex((t=>Po(i)===Po(t)))+e}}function Do(t,e){return{regex:t,deser:([,t,e])=>Ei(t,e),groups:e}}function No(t){return{regex:t,deser:([t])=>t}}const Ro={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let Bo=null;function qo(t,e){if(t.literal)return t;const i=Hi.macroTokenToFormatOpts(t.val);if(!i)return t;const n=Hi.create(e,i).formatDateTimeParts((Bo||(Bo=ks.fromMillis(1555555555555)),Bo)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const s=i[n];let r=Ro[n];return"object"==typeof r&&(r=r[s]),r?{literal:!1,val:r}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function Uo(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>qo(t,e))))}(Hi.parseFormat(i),t),o=n.map((e=>function(t,e){const i=Ao(e),n=Ao(e,"{2}"),o=Ao(e,"{3}"),s=Ao(e,"{4}"),r=Ao(e,"{6}"),a=Ao(e,"{1,2}"),l=Ao(e,"{1,3}"),h=Ao(e,"{1,6}"),c=Ao(e,"{1,9}"),d=Ao(e,"{2,4}"),u=Ao(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 Io(e.eras("short",!1),0);case"GG":return Io(e.eras("long",!1),0);case"y":return Lo(h);case"yy":case"kk":return Lo(d,ki);case"yyyy":case"kkkk":return Lo(s);case"yyyyy":return Lo(u);case"yyyyyy":return Lo(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Lo(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Lo(n);case"MMM":return Io(e.months("short",!0,!1),1);case"MMMM":return Io(e.months("long",!0,!1),1);case"LLL":return Io(e.months("short",!1,!1),1);case"LLLL":return Io(e.months("long",!1,!1),1);case"o":case"S":return Lo(l);case"ooo":case"SSS":return Lo(o);case"u":return No(c);case"uu":return No(a);case"uuu":case"E":case"c":return Lo(i);case"a":return Io(e.meridiems(),0);case"EEE":return Io(e.weekdays("short",!1,!1),1);case"EEEE":return Io(e.weekdays("long",!1,!1),1);case"ccc":return Io(e.weekdays("short",!0,!1),1);case"cccc":return Io(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Do(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return Do(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return No(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),s=o.find((t=>t.invalidReason));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),s=RegExp(t,"i"),[r,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(di(i,o)){const s=i[o],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(e,s,i),[l,h,c]=a?function(t){let e,i=null;ri(t.z)||(i=tn.create(t.z)),ri(t.Z)||(i||(i=new nn(t.Z)),e=t.Z),ri(t.q)||(t.M=3*(t.q-1)+1),ri(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),ri(t.u)||(t.S=gi(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(di(a,"a")&&di(a,"H"))throw new Me("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:s,rawMatches:r,matches:a,result:l,zone:h,specificOffset:c}}}const Zo=[0,31,59,90,120,151,181,212,243,273,304,334],Fo=[0,31,60,91,121,152,182,213,244,274,305,335];function Vo(t,e){return new Wi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function jo(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function Ho(t,e,i){return i+(yi(t)?Fo:Zo)[e-1]}function Wo(t,e){const i=yi(t)?Fo:Zo,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function Go(t){const{year:e,month:i,day:n}=t,o=Ho(e,i,n),s=jo(e,i,n);let r,a=Math.floor((o-s+10)/7);return a<1?(r=e-1,a=wi(r)):a>wi(e)?(r=e+1,a=1):r=e,{weekYear:r,weekNumber:a,weekday:s,...Ai(t)}}function Ko(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=jo(e,1,4),s=bi(e);let r,a=7*i+n-o-3;a<1?(r=e-1,a+=bi(r)):a>s?(r=e+1,a-=bi(e)):r=e;const{month:l,day:h}=Wo(r,a);return{year:r,month:l,day:h,...Ai(t)}}function Yo(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:Ho(e,i,n),...Ai(t)}}function Jo(t){const{year:e,ordinal:i}=t,{month:n,day:o}=Wo(e,i);return{year:e,month:n,day:o,...Ai(t)}}function Xo(t){const e=li(t.year),i=ui(t.month,1,12),n=ui(t.day,1,_i(t.year,t.month));return e?i?!n&&Vo("day",t.day):Vo("month",t.month):Vo("year",t.year)}function Qo(t){const{hour:e,minute:i,second:n,millisecond:o}=t,s=ui(e,0,23)||24===e&&0===i&&0===n&&0===o,r=ui(i,0,59),a=ui(n,0,59),l=ui(o,0,999);return s?r?a?!l&&Vo("millisecond",o):Vo("second",n):Vo("minute",i):Vo("hour",e)}const ts="Invalid DateTime",es=864e13;function is(t){return new Wi("unsupported zone",`the zone "${t.name}" is not supported`)}function ns(t){return null===t.weekData&&(t.weekData=Go(t.c)),t.weekData}function os(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new ks({...i,...e,old:i})}function ss(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const s=i.offset(n);return o===s?[n,o]:[t-60*Math.min(o,s)*1e3,Math.max(o,s)]}function rs(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 as(t,e,i){return ss(xi(t),e,i)}function ls(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:n,month:o,day:Math.min(t.c.day,_i(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=_o.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=xi(s);let[l,h]=ss(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function hs(t,e,i,n,o,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=ks.fromObject(t,{...i,zone:n,specificOffset:s});return r?o:o.setZone(a)}return ks.invalid(new Wi("unparsable",`the input "${o}" can't be parsed as ${n}`))}function cs(t,e,i=!0){return t.isValid?Hi.create(kn.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ds(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=pi(t.c.year,i?6:4),e?(n+="-",n+=pi(t.c.month),n+="-",n+=pi(t.c.day)):(n+=pi(t.c.month),n+=pi(t.c.day)),n}function us(t,e,i,n,o,s){let r=pi(t.c.hour);return e?(r+=":",r+=pi(t.c.minute),0===t.c.second&&i||(r+=":")):r+=pi(t.c.minute),0===t.c.second&&i||(r+=pi(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=pi(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=pi(Math.trunc(-t.o/60)),r+=":",r+=pi(Math.trunc(-t.o%60))):(r+="+",r+=pi(Math.trunc(t.o/60)),r+=":",r+=pi(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const ps={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ms={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},fs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},gs=["year","month","day","hour","minute","second","millisecond"],vs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ys=["year","ordinal","hour","minute","second","millisecond"];function bs(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 Oe(t);return e}function _s(t,e){const i=sn(e.zone,un.defaultZone),n=kn.fromObject(e),o=un.now();let s,r;if(ri(t.year))s=o;else{for(const e of gs)ri(t[e])&&(t[e]=ps[e]);const e=Xo(t)||Qo(t);if(e)return ks.invalid(e);const n=i.offset(o);[s,r]=as(t,n,i)}return new ks({ts:s,zone:i,loc:n,o:r})}function xs(t,e,i){const n=!!ri(i.round)||i.round,o=(t,o)=>{t=vi(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},s=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function ws(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class ks{constructor(t){const e=t.zone||un.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Wi("invalid input"):null)||(e.isValid?null:is(e));this.ts=ri(t.ts)?un.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=rs(this.ts,t),i=Number.isNaN(n.year)?new Wi("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||kn.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new ks({})}static local(){const[t,e]=ws(arguments),[i,n,o,s,r,a,l]=e;return _s({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=ws(arguments),[i,n,o,s,r,a,l]=e;return t.zone=nn.utcInstance,_s({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return ks.invalid("invalid input");const n=sn(e.zone,un.defaultZone);return n.isValid?new ks({ts:i,zone:n,loc:kn.fromObject(e)}):ks.invalid(is(n))}static fromMillis(t,e={}){if(ai(t))return t<-es||t>es?ks.invalid("Timestamp out of range"):new ks({ts:t,zone:sn(e.zone,un.defaultZone),loc:kn.fromObject(e)});throw new ze(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(ai(t))return new ks({ts:1e3*t,zone:sn(e.zone,un.defaultZone),loc:kn.fromObject(e)});throw new ze("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=sn(e.zone,un.defaultZone);if(!i.isValid)return ks.invalid(is(i));const n=un.now(),o=ri(e.specificOffset)?i.offset(n):e.specificOffset,s=Ci(t,bs),r=!ri(s.ordinal),a=!ri(s.year),l=!ri(s.month)||!ri(s.day),h=a||l,c=s.weekYear||s.weekNumber,d=kn.fromObject(e);if((h||r)&&c)throw new Me("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new Me("Can't mix ordinal dates with month/day");const u=c||s.weekday&&!h;let p,m,f=rs(n,o);u?(p=vs,m=ms,f=Go(f)):r?(p=ys,m=fs,f=Yo(f)):(p=gs,m=ps);let g=!1;for(const t of p){ri(s[t])?s[t]=g?m[t]:f[t]:g=!0}const v=u?function(t){const e=li(t.weekYear),i=ui(t.weekNumber,1,wi(t.weekYear)),n=ui(t.weekday,1,7);return e?i?!n&&Vo("weekday",t.weekday):Vo("week",t.week):Vo("weekYear",t.weekYear)}(s):r?function(t){const e=li(t.year),i=ui(t.ordinal,1,bi(t.year));return e?!i&&Vo("ordinal",t.ordinal):Vo("year",t.year)}(s):Xo(s),y=v||Qo(s);if(y)return ks.invalid(y);const b=u?Ko(s):r?Jo(s):s,[_,x]=as(b,o,i),w=new ks({ts:_,zone:i,o:x,loc:d});return s.weekday&&h&&t.weekday!==w.weekday?ks.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return $n(t,[Xn,io],[Qn,no],[to,oo],[eo,so])}(t);return hs(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return $n(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[jn,Hn])}(t);return hs(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return $n(t,[Wn,Yn],[Gn,Yn],[Kn,Jn])}(t);return hs(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(ri(t)||ri(e))throw new ze("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,s=kn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:n,zone:o,specificOffset:s,invalidReason:r}=Uo(t,e,i);return[n,o,s,r]}(s,t,e);return h?ks.invalid(h):hs(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return ks.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return $n(t,[ao,io],[lo,ho])}(t);return hs(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new ze("need to specify a reason the DateTime is invalid");const i=t instanceof Wi?t:new Wi(t,e);if(un.throwOnInvalid)throw new Te(i);return new ks({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ns(this).weekYear:NaN}get weekNumber(){return this.isValid?ns(this).weekNumber:NaN}get weekday(){return this.isValid?ns(this).weekday:NaN}get ordinal(){return this.isValid?Yo(this.c).ordinal:NaN}get monthShort(){return this.isValid?ko.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ko.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ko.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ko.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return yi(this.year)}get daysInMonth(){return _i(this.year,this.month)}get daysInYear(){return this.isValid?bi(this.year):NaN}get weeksInWeekYear(){return this.isValid?wi(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=Hi.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(nn.instance(t),e)}toLocal(){return this.setZone(un.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=sn(t,un.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=as(i,e,t)}return os(this,{ts:n,zone:t})}return ks.invalid(is(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return os(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=Ci(t,bs),i=!ri(e.weekYear)||!ri(e.weekNumber)||!ri(e.weekday),n=!ri(e.ordinal),o=!ri(e.year),s=!ri(e.month)||!ri(e.day),r=o||s,a=e.weekYear||e.weekNumber;if((r||n)&&a)throw new Me("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new Me("Can't mix ordinal dates with month/day");let l;i?l=Ko({...Go(this.c),...e}):ri(e.ordinal)?(l={...this.toObject(),...e},ri(e.day)&&(l.day=Math.min(_i(l.year,l.month),l.day))):l=Jo({...Yo(this.c),...e});const[h,c]=as(l,this.o,this.zone);return os(this,{ts:h,o:c})}plus(t){if(!this.isValid)return this;return os(this,ls(this,_o.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return os(this,ls(this,_o.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=_o.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?Hi.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):ts}toLocaleString(t=Re,e={}){return this.isValid?Hi.create(this.loc.clone(e),t).formatDateTime(this):ts}toLocaleParts(t={}){return this.isValid?Hi.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=ds(this,s);return r+="T",r+=us(this,s,e,i,n,o),r}toISODate({format:t="extended"}={}){return this.isValid?ds(this,"extended"===t):null}toISOWeekDate(){return cs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+us(this,"extended"===s,e,t,i,o)}toRFC2822(){return cs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return cs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ds(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),cs(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():ts}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 _o.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(_o.normalizeUnit),s=t.valueOf()>this.valueOf(),r=Eo(s?this:t,s?t:this,o,n);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(ks.now(),t,e)}until(t){return this.isValid?wo.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||ks.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),xs(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?xs(t.base||ks.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(ks.isDateTime))throw new ze("min requires all arguments be DateTimes");return ci(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(ks.isDateTime))throw new ze("max requires all arguments be DateTimes");return ci(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return Uo(kn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return ks.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Re}static get DATE_MED(){return Be}static get DATE_MED_WITH_WEEKDAY(){return qe}static get DATE_FULL(){return Ue}static get DATE_HUGE(){return Ze}static get TIME_SIMPLE(){return Fe}static get TIME_WITH_SECONDS(){return Ve}static get TIME_WITH_SHORT_OFFSET(){return je}static get TIME_WITH_LONG_OFFSET(){return He}static get TIME_24_SIMPLE(){return We}static get TIME_24_WITH_SECONDS(){return Ge}static get TIME_24_WITH_SHORT_OFFSET(){return Ke}static get TIME_24_WITH_LONG_OFFSET(){return Ye}static get DATETIME_SHORT(){return Je}static get DATETIME_SHORT_WITH_SECONDS(){return Xe}static get DATETIME_MED(){return Qe}static get DATETIME_MED_WITH_SECONDS(){return ti}static get DATETIME_MED_WITH_WEEKDAY(){return ei}static get DATETIME_FULL(){return ii}static get DATETIME_FULL_WITH_SECONDS(){return ni}static get DATETIME_HUGE(){return oi}static get DATETIME_HUGE_WITH_SECONDS(){return si}}function Ss(t){if(ks.isDateTime(t))return t;if(t&&t.valueOf&&ai(t.valueOf()))return ks.fromJSDate(t);if(t&&"object"==typeof t)return ks.fromObject(t);throw new ze(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Es=(t,e,i)=>{let n=t[0];for(let o=1;o<t.length;o++)n+=e[i?i[o-1]:o-1],n+=t[o];return n},$s=t=>{return"string"!=typeof(e=t)&&"strTag"in e?Es(t.strings,t.values):t;var e};class Cs{constructor(){this.settled=!1,this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){this.settled=!0,this._resolve(t)}reject(t){this.settled=!0,this._reject(t)}}const Ts=[];for(let t=0;t<256;t++)Ts[t]=(t>>4&15).toString(16)+(15&t).toString(16);function As(t,e){return(e?"h":"s")+function(t){let e=0,i=8997,n=0,o=33826,s=0,r=40164,a=0,l=52210;for(let h=0;h<t.length;h++)i^=t.charCodeAt(h),e=435*i,n=435*o,s=435*r,a=435*l,s+=i<<8,a+=o<<8,n+=e>>>16,i=65535&e,s+=n>>>16,o=65535&n,l=a+(s>>>16)&65535,r=65535&s;return Ts[l>>8]+Ts[255&l]+Ts[r>>8]+Ts[255&r]+Ts[o>>8]+Ts[255&o]+Ts[i>>8]+Ts[255&i]}("string"==typeof t?t:t.join(""))}const Ls=new WeakMap,Ms=new Map;function Os(t,e,i){var n;if(t){const o=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:function(t){const e="string"==typeof t?t:t.strings;let i=Ms.get(e);void 0===i&&(i=As(e,"string"!=typeof t&&!("strTag"in t)),Ms.set(e,i));return i}(e),s=t[o];if(s){if("string"==typeof s)return s;if("strTag"in s)return Es(s.strings,e.values,s.values);{let t=Ls.get(s);return void 0===t&&(t=s.values,Ls.set(s,t)),{...s,values:t.map((t=>e.values[t]))}}}}return $s(e)}function zs(t){window.dispatchEvent(new CustomEvent("lit-localize-status",{detail:t}))}let Ps,Is,Ds,Ns,Rs,Bs="",qs=new Cs;qs.resolve();let Us=0;const Zs=()=>Bs,Fs=t=>{if(t===(null!=Ps?Ps:Bs))return qs.promise;if(!Ds||!Ns)throw new Error("Internal error");if(!Ds.has(t))throw new Error("Invalid locale code");Us++;const e=Us;Ps=t,qs.settled&&(qs=new Cs),zs({status:"loading",loadingLocale:t});return(t===Is?Promise.resolve({templates:void 0}):Ns(t)).then((i=>{Us===e&&(Bs=t,Ps=void 0,Rs=i.templates,zs({status:"ready",readyLocale:t}),qs.resolve())}),(i=>{Us===e&&(zs({status:"error",errorLocale:t,errorMessage:i.toString()}),qs.reject(i))})),qs.promise};let Vs=$s,js=!1;const Hs=["es","fr","pt"],{setLocale:Ws}=(t=>(function(t){if(js)throw new Error("lit-localize can only be configured once");Vs=t,js=!0}(((t,e)=>Os(Rs,t,e))),Bs=Is=t.sourceLocale,Ds=new Set(t.targetLocales),Ds.add(t.sourceLocale),Ns=t.loadLocale,{getLocale:Zs,setLocale:Fs}))({sourceLocale:"en",targetLocales:Hs,loadLocale:t=>import(`./locales/${t}.js`)});class Gs extends lt{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.languages={},this.featuredFields=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
228
+ `}}t([ct({type:Boolean})],xt.prototype,"textarea",void 0),t([ct({type:String})],xt.prototype,"placeholder",void 0),t([ct({type:Boolean})],xt.prototype,"password",void 0),t([ct({type:Number})],xt.prototype,"maxlength",void 0),t([ct({type:Object})],xt.prototype,"inputElement",void 0),t([ct({type:Boolean})],xt.prototype,"clearable",void 0),t([ct({type:Boolean})],xt.prototype,"gsm",void 0),t([ct({type:String})],xt.prototype,"counter",void 0),t([ct({type:Boolean})],xt.prototype,"loading",void 0),t([ct({type:Boolean})],xt.prototype,"submitOnEnter",void 0),t([ct()],xt.prototype,"onBlur",void 0),t([ct({type:Boolean})],xt.prototype,"autogrow",void 0);var wt,kt,St,Et,$t,Ct,Tt,At,Lt,Mt,Ot,zt,Pt,It,Dt,Nt,Rt,Bt,qt=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},Ut=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};const Zt=function(t){var e=0;t+="x";var i=Math.floor(65745979961613.07);for(let n=0;n<t.length;n++)e>i&&(e=Math.floor(e/137)),e=131*e+t.charCodeAt(n);return e},Ft="0123456789abcdef".split(""),Vt=[-2147483648,8388608,32768,128],jt=[24,16,8,0],Ht=[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],Wt=[];class Gt{constructor(t=!1,e=!1){wt.set(this,void 0),kt.set(this,void 0),St.set(this,void 0),Et.set(this,void 0),$t.set(this,void 0),Ct.set(this,void 0),Tt.set(this,void 0),At.set(this,void 0),Lt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),zt.set(this,void 0),Pt.set(this,void 0),It.set(this,void 0),Dt.set(this,void 0),Nt.set(this,void 0),Rt.set(this,0),Bt.set(this,void 0),this.init(t,e)}init(t,e){e?(Wt[0]=Wt[16]=Wt[1]=Wt[2]=Wt[3]=Wt[4]=Wt[5]=Wt[6]=Wt[7]=Wt[8]=Wt[9]=Wt[10]=Wt[11]=Wt[12]=Wt[13]=Wt[14]=Wt[15]=0,qt(this,kt,Wt)):qt(this,kt,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t?(qt(this,Ct,3238371032),qt(this,Tt,914150663),qt(this,At,812702999),qt(this,Lt,4144912697),qt(this,Mt,4290775857),qt(this,Ot,1750603025),qt(this,zt,1694076839),qt(this,Pt,3204075428)):(qt(this,Ct,1779033703),qt(this,Tt,3144134277),qt(this,At,1013904242),qt(this,Lt,2773480762),qt(this,Mt,1359893119),qt(this,Ot,2600822924),qt(this,zt,528734635),qt(this,Pt,1541459225)),qt(this,wt,qt(this,Bt,qt(this,St,qt(this,Dt,0)))),qt(this,Et,qt(this,It,!1)),qt(this,$t,!0),qt(this,Nt,t)}update(t){if(Ut(this,Et))return this;let e;e=t instanceof ArrayBuffer?new Uint8Array(t):t;let i=0;const n=e.length,o=Ut(this,kt);for(;i<n;){let t;if(Ut(this,It)&&(qt(this,It,!1),o[0]=Ut(this,wt),o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),"string"!=typeof e)for(t=Ut(this,Bt);i<n&&t<64;++i)o[t>>2]|=e[i]<<jt[3&t++];else for(t=Ut(this,Bt);i<n&&t<64;++i){let n=e.charCodeAt(i);n<128?o[t>>2]|=n<<jt[3&t++]:n<2048?(o[t>>2]|=(192|n>>6)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++]):n<55296||n>=57344?(o[t>>2]|=(224|n>>12)<<jt[3&t++],o[t>>2]|=(128|n>>6&63)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),o[t>>2]|=(240|n>>18)<<jt[3&t++],o[t>>2]|=(128|n>>12&63)<<jt[3&t++],o[t>>2]|=(128|n>>6&63)<<jt[3&t++],o[t>>2]|=(128|63&n)<<jt[3&t++])}qt(this,Rt,t),qt(this,St,Ut(this,St)+(t-Ut(this,Bt))),t>=64?(qt(this,wt,o[16]),qt(this,Bt,t-64),this.hash(),qt(this,It,!0)):qt(this,Bt,t)}return Ut(this,St)>4294967295&&(qt(this,Dt,Ut(this,Dt)+(Ut(this,St)/4294967296<<0)),qt(this,St,Ut(this,St)%4294967296)),this}finalize(){if(Ut(this,Et))return;qt(this,Et,!0);const t=Ut(this,kt),e=Ut(this,Rt);t[16]=Ut(this,wt),t[e>>2]|=Vt[3&e],qt(this,wt,t[16]),e>=56&&(Ut(this,It)||this.hash(),t[0]=Ut(this,wt),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]=Ut(this,Dt)<<3|Ut(this,St)>>>29,t[15]=Ut(this,St)<<3,this.hash()}hash(){let t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt);const l=Ut(this,kt);let h,c,d,u,p,m,f,g,v,y;for(let t=16;t<64;++t)u=l[t-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=l[t-2],c=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,l[t]=l[t-16]+h+l[t-7]+c<<0;y=e&i;for(let b=0;b<64;b+=4)Ut(this,$t)?(Ut(this,Nt)?(f=300032,u=l[0]-1413257819,a=u-150054599<<0,n=u+24177077<<0):(f=704751109,u=l[0]-210244248,a=u-1521486534<<0,n=u+143694565<<0),qt(this,$t,!1)):(h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),c=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),f=t&e,d=f^t&i^y,m=o&s^~o&r,u=a+c+m+Ht[b]+l[b],p=h+d,a=n+u<<0,n=u+p<<0),h=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),c=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),g=n&t,d=g^n&e^f,m=a&o^~a&s,u=r+c+m+Ht[b+1]+l[b+1],p=h+d,r=i+u<<0,i=u+p<<0,h=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),c=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),v=i&n,d=v^i&t^g,m=r&a^~r&o,u=s+c+m+Ht[b+2]+l[b+2],p=h+d,s=e+u<<0,e=u+p<<0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),c=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=e&i,d=y^e&n^v,m=s&r^~s&a,u=o+c+m+Ht[b+3]+l[b+3],p=h+d,o=t+u<<0,t=u+p<<0;qt(this,Ct,Ut(this,Ct)+t<<0),qt(this,Tt,Ut(this,Tt)+e<<0),qt(this,At,Ut(this,At)+i<<0),qt(this,Lt,Ut(this,Lt)+n<<0),qt(this,Mt,Ut(this,Mt)+o<<0),qt(this,Ot,Ut(this,Ot)+s<<0),qt(this,zt,Ut(this,zt)+r<<0),qt(this,Pt,Ut(this,Pt)+a<<0)}hex(){this.finalize();const t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt);let l=Ft[t>>28&15]+Ft[t>>24&15]+Ft[t>>20&15]+Ft[t>>16&15]+Ft[t>>12&15]+Ft[t>>8&15]+Ft[t>>4&15]+Ft[15&t]+Ft[e>>28&15]+Ft[e>>24&15]+Ft[e>>20&15]+Ft[e>>16&15]+Ft[e>>12&15]+Ft[e>>8&15]+Ft[e>>4&15]+Ft[15&e]+Ft[i>>28&15]+Ft[i>>24&15]+Ft[i>>20&15]+Ft[i>>16&15]+Ft[i>>12&15]+Ft[i>>8&15]+Ft[i>>4&15]+Ft[15&i]+Ft[n>>28&15]+Ft[n>>24&15]+Ft[n>>20&15]+Ft[n>>16&15]+Ft[n>>12&15]+Ft[n>>8&15]+Ft[n>>4&15]+Ft[15&n]+Ft[o>>28&15]+Ft[o>>24&15]+Ft[o>>20&15]+Ft[o>>16&15]+Ft[o>>12&15]+Ft[o>>8&15]+Ft[o>>4&15]+Ft[15&o]+Ft[s>>28&15]+Ft[s>>24&15]+Ft[s>>20&15]+Ft[s>>16&15]+Ft[s>>12&15]+Ft[s>>8&15]+Ft[s>>4&15]+Ft[15&s]+Ft[r>>28&15]+Ft[r>>24&15]+Ft[r>>20&15]+Ft[r>>16&15]+Ft[r>>12&15]+Ft[r>>8&15]+Ft[r>>4&15]+Ft[15&r];return Ut(this,Nt)||(l+=Ft[a>>28&15]+Ft[a>>24&15]+Ft[a>>20&15]+Ft[a>>16&15]+Ft[a>>12&15]+Ft[a>>8&15]+Ft[a>>4&15]+Ft[15&a]),l}toString(){return this.hex()}digest(){this.finalize();const t=Ut(this,Ct),e=Ut(this,Tt),i=Ut(this,At),n=Ut(this,Lt),o=Ut(this,Mt),s=Ut(this,Ot),r=Ut(this,zt),a=Ut(this,Pt),l=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s,r>>24&255,r>>16&255,r>>8&255,255&r];return Ut(this,Nt)||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(Ut(this,Nt)?28:32),e=new DataView(t);return e.setUint32(0,Ut(this,Ct)),e.setUint32(4,Ut(this,Tt)),e.setUint32(8,Ut(this,At)),e.setUint32(12,Ut(this,Lt)),e.setUint32(16,Ut(this,Mt)),e.setUint32(20,Ut(this,Ot)),e.setUint32(24,Ut(this,zt)),Ut(this,Nt)||e.setUint32(28,Ut(this,Pt)),t}}function Kt(t){const e=new Gt;return e.update(t),parseInt(e.hex().substring(0,8),16)}wt=new WeakMap,kt=new WeakMap,St=new WeakMap,Et=new WeakMap,$t=new WeakMap,Ct=new WeakMap,Tt=new WeakMap,At=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Pt=new WeakMap,It=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Bt=new WeakMap;const Yt=function(t,e,i){var n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;return[(t/=360)+1/3,t,t-1/3].map((function(t){return t<0&&t++,t>1&&t--,t=t<1/6?o+6*(n-o)*t:t<.5?n:t<2/3?o+6*(n-o)*(2/3-t):o,Math.round(255*t)}))};const Jt="/api/v2/media.json",Xt=new class{constructor(t={}){const[e,i]=[t.lightness,t.saturation].map((function(t){return t=void 0!==t?t:[.35,.5,.65],Array.isArray(t)?t.concat():[t]}));this.L=e,this.S=i,"number"==typeof t.hue&&(t.hue={min:t.hue,max:t.hue}),"object"!=typeof t.hue||Array.isArray(t.hue)||(t.hue=[t.hue]),void 0===t.hue&&(t.hue=[]),this.hueRanges=t.hue.map((function(t){return{min:void 0===t.min?0:t.min,max:void 0===t.max?360:t.max}})),this.hash=Kt,"function"==typeof t.hash&&(this.hash=t.hash),"bkdr"===t.hash&&(this.hash=Zt)}hsl(t){var e,i,n=this.hash(t);if(this.hueRanges.length){const t=this.hueRanges[n%this.hueRanges.length];e=n/this.hueRanges.length%727*(t.max-t.min)/727+t.min}else e=n%359;return n=Math.ceil(n/360),i=this.S[n%this.S.length],n=Math.ceil(n/this.S.length),[e,i,this.L[n%this.L.length]]}rgb(t){var e=this.hsl(t);return Yt.apply(this,e)}hex(t){var e,i=this.rgb(t);return e="#",i.forEach((function(t){t<16&&(e+=0),e+=t.toString(16)})),e}},Qt=(t={})=>{const e=(t=>{for(const e of document.cookie.split(";")){const i=e.indexOf("=");let n=e.substr(0,i),o=e.substr(i+1);if(n=n.trim(),o=o.trim(),n===t)return o}return null})("csrftoken"),i=e?{"X-CSRFToken":e}:{};return i["X-Requested-With"]="XMLHttpRequest",Object.keys(t).forEach((e=>{i[e]=t[e]})),i},te=(t,e=null,i={})=>new Promise(((n,o)=>{const s={method:"GET",headers:Qt(i)};e&&(s.signal=e.signal),fetch(t,s).then((t=>{t.text().then((i=>{let o={};try{o=JSON.parse(i)}catch(t){}n({controller:e,body:i,json:o,url:t.url,headers:t.headers,status:t.status})}))})).catch((t=>{o(t)}))})),ee=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()},ie=(t,e=null)=>new Promise(((i,n)=>{te(t,e).then((t=>{i({results:t.json.results,next:t.json.next})})).catch((t=>n(t)))})),ne=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await ie(i);t.results&&(e=e.concat(t.results)),i=t.next}return e},oe=t=>new Promise(((e,i)=>{te(t).then((t=>{t.status>=200&&t.status<300?e({assets:t.json.results,next:t.json.next}):i(t)})).catch((t=>i(t)))})),se=async t=>{if(!t)return new Promise((t=>t([])));let e=[],i=t;for(;i;){const t=await oe(i);t.assets?(e=e.concat(t.assets),i=t.next):i=null}return e},re=(t,e,i={},n=null)=>{const o=Qt(i);n&&(o["Content-Type"]=n);const s={method:"POST",headers:o,body:e};return new Promise(((e,i)=>{fetch(t,s).then((async t=>{t.text().then((i=>{let n={};try{n=JSON.parse(i)}catch(t){}e({body:i,json:n,headers:t.headers,status:t.status,redirected:t.redirected,url:t.url})}))})).catch((t=>{i(t)}))}))},ae=(t,e)=>re(t,JSON.stringify(e),!1,"application/json"),le=(t,e)=>new Promise(((i,n)=>{re(t,e,!0).then((e=>{e.status>=200&&e.status<400?i(e):n(t===Jt?e:"Server failure")})).catch((t=>{console.error(t),n(t)}))})),he=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:he(e):null}return null},ce=(t,e,i=!1)=>{let n;return function(...o){const s=this,r=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(s,o)}),e),r&&t.apply(s,o)}},de=(t,e)=>{let i=!0;return function(...n){i&&(i=!1,t.apply(this,n),setTimeout((()=>{i=!0}),e))}},ue=(t,e="and")=>1===t.length?t[0]:2===t.length?"object"==typeof t[0]?D`${t[0]} ${e} ${t[1]}`:t.join(" "+e+" "):"object"==typeof t[0]?t.map(((i,n)=>n<t.length-1?D`${i}, `:D`${e} ${i}`)):t.join(", ")+e+t[t.length-1],pe=(t,e,i="and")=>ue(t.map(e),i);var me;!function(t){t.SETTINGS="settings",t.MENU_COLLAPSED="menu-collapsed",t.TICKET_SHOW_DETAILS="tickets.show-details"}(me||(me={}));const fe=([t,...e],i=navigator.language)=>void 0===t?"":t.toLocaleUpperCase(i)+e.join(""),ge=(t,e)=>{if(0==t)return"0 KB";const i=e||2,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(i))+" "+["B","KB","MB","GB"][n]},ve=t=>{t&&(t.stopPropagation(),t.preventDefault())},ye=(t,e,i)=>{i/=100;const n=e*Math.min(i,1-i)/100,o=e=>{const o=(e+t/30)%12,s=i-n*Math.max(Math.min(o-3,9-o,1),-1);return Math.round(255*s).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`},be=t=>{if(t.position||(t.position="right"),t.image)return D`<img src="${t.image}">`;let e=t.name;if(t.user&&(e=`${t.user.first_name} ${t.user.last_name}`),!e)return null;const i=Xt.hex(e);let n=e.indexOf(" ")+1;n<1&&(n=e.length>1?1:0);let o=e.substring(0,1)+e.substring(n,n+1);o=o.toUpperCase();const s=D` <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center"> <div class="avatar-circle" style="display:flex;height:2em;width:2em;flex-direction:row;align-items:center;color:#fff;border-radius:100%;font-weight:400;border:.3em solid rgba(0,0,0,.05);background:${i}"> <div style="border:0 solid red;display:flex;flex-direction:column;align-items:center;flex-grow:1"> <div style="border:0 solid #00f">${o}</div> </div> </div> </div> `;return t.tip?D` <temba-tip text="${e}" position="${t.position}"> ${s} </temba-tip> `:s};var _e,xe,we,ke;!function(t){t.DayFirst="day_first",t.MonthFirst="month_first",t.YearFirst="year_first"}(_e||(_e={})),function(t){t.CampaignEvent="campaign_event",t.ScheduledBroadcast="scheduled_broadcast",t.ScheduledTrigger="scheduled_trigger"}(xe||(xe={})),function(t){t.Open="open",t.Closed="closed"}(we||(we={})),function(t){t.Loaded="temba-loaded",t.Canceled="temba-canceled",t.CursorChanged="temba-cursor-changed",t.Refreshed="temba-refreshed",t.Selection="temba-selection",t.ButtonClicked="temba-button-clicked",t.DialogHidden="temba-dialog-hidden",t.ScrollThreshold="temba-scroll-threshold",t.ContentChanged="temba-content-changed",t.ContextChanged="temba-context-changed",t.FetchComplete="temba-fetch-complete",t.MessageSent="temba-message-sent",t.Submitted="temba-submitted",t.Redirected="temba-redirected",t.NoPath="temba-no-path",t.StoreUpdated="temba-store-updated",t.Ready="temba-ready",t.OrderChanged="temba-order-changed",t.DragStart="temba-drag-start",t.DragStop="temba-drag-stop",t.Resized="temba-resized"}(ke||(ke={}));class Se{constructor(t=0,e=0){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.size=0,this.ttl=e}has(t){return t in this.items}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],this.size--,0===this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}get(t){let e;if(this.has(t)){const i=this.items[t];this.ttl>0&&i.expiry<=(new Date).getTime()?this.delete(t):(e=i.value,this.set(t,e,!0))}return e}keys(){return Object.keys(this.items)}set(t,e,i=!1){let n;if(i||this.has(t)){if(n=this.items[t],n.value=e,this.last!==n){const t=this.last,e=n.next,i=n.prev;this.first===n&&(this.first=n.next),n.next=null,n.prev=this.last,t.next=n,null!==i&&(i.next=e),null!==e&&(e.prev=i)}}else this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={expiry:this.ttl>0?(new Date).getTime()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=n:this.last.next=n;return this.last=n,this}}function Ee(t=1e3,e=0){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");return new Se(t,e)}class $e extends Error{}class Ce extends $e{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Te extends $e{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ae extends $e{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Le extends $e{}class Me extends $e{constructor(t){super(`Invalid unit ${t}`)}}class Oe extends $e{}class ze extends $e{constructor(){super("Zone is an abstract class")}}const Pe="numeric",Ie="short",De="long",Ne={year:Pe,month:Pe,day:Pe},Re={year:Pe,month:Ie,day:Pe},Be={year:Pe,month:Ie,day:Pe,weekday:Ie},qe={year:Pe,month:De,day:Pe},Ue={year:Pe,month:De,day:Pe,weekday:De},Ze={hour:Pe,minute:Pe},Fe={hour:Pe,minute:Pe,second:Pe},Ve={hour:Pe,minute:Pe,second:Pe,timeZoneName:Ie},je={hour:Pe,minute:Pe,second:Pe,timeZoneName:De},He={hour:Pe,minute:Pe,hourCycle:"h23"},We={hour:Pe,minute:Pe,second:Pe,hourCycle:"h23"},Ge={hour:Pe,minute:Pe,second:Pe,hourCycle:"h23",timeZoneName:Ie},Ke={hour:Pe,minute:Pe,second:Pe,hourCycle:"h23",timeZoneName:De},Ye={year:Pe,month:Pe,day:Pe,hour:Pe,minute:Pe},Je={year:Pe,month:Pe,day:Pe,hour:Pe,minute:Pe,second:Pe},Xe={year:Pe,month:Ie,day:Pe,hour:Pe,minute:Pe},Qe={year:Pe,month:Ie,day:Pe,hour:Pe,minute:Pe,second:Pe},ti={year:Pe,month:Ie,day:Pe,weekday:Ie,hour:Pe,minute:Pe},ei={year:Pe,month:De,day:Pe,hour:Pe,minute:Pe,timeZoneName:Ie},ii={year:Pe,month:De,day:Pe,hour:Pe,minute:Pe,second:Pe,timeZoneName:Ie},ni={year:Pe,month:De,day:Pe,weekday:De,hour:Pe,minute:Pe,timeZoneName:De},oi={year:Pe,month:De,day:Pe,weekday:De,hour:Pe,minute:Pe,second:Pe,timeZoneName:De};function si(t){return void 0===t}function ri(t){return"number"==typeof t}function ai(t){return"number"==typeof t&&t%1==0}function li(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function hi(t,e,i){if(0!==t.length)return t.reduce(((t,n)=>{const o=[e(n),n];return t&&i(t[0],o[0])===t[0]?t:o}),null)[1]}function ci(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function di(t,e,i){return ai(t)&&t>=e&&t<=i}function ui(t,e=2){let i;return i=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),i}function pi(t){return si(t)||null===t||""===t?void 0:parseInt(t,10)}function mi(t){return si(t)||null===t||""===t?void 0:parseFloat(t)}function fi(t){if(!si(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function gi(t,e,i=!1){const n=10**e;return(i?Math.trunc:Math.round)(t*n)/n}function vi(t){return t%4==0&&(t%100!=0||t%400==0)}function yi(t){return vi(t)?366:365}function bi(t,e){const i=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===i?vi(t+(e-i)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function _i(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function xi(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function wi(t){return t>99?t:t>60?1900+t:2e3+t}function ki(t,e,i,n=null){const o=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const r={timeZoneName:e,...s},a=new Intl.DateTimeFormat(i,r).formatToParts(o).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function Si(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function Ei(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new Oe(`Invalid unit value ${t}`);return e}function $i(t,e){const i={};for(const n in t)if(ci(t,n)){const o=t[n];if(null==o)continue;i[e(n)]=Ei(o)}return i}function Ci(t,e){const i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),o=t>=0?"+":"-";switch(e){case"short":return`${o}${ui(i,2)}:${ui(n,2)}`;case"narrow":return`${o}${i}${n>0?`:${n}`:""}`;case"techie":return`${o}${ui(i,2)}${ui(n,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ti(t){return function(t,e){return e.reduce(((e,i)=>(e[i]=t[i],e)),{})}(t,["hour","minute","second","millisecond"])}const Ai=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Li=["January","February","March","April","May","June","July","August","September","October","November","December"],Mi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Oi=["J","F","M","A","M","J","J","A","S","O","N","D"];function zi(t){switch(t){case"narrow":return[...Oi];case"short":return[...Mi];case"long":return[...Li];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 Pi=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ii=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Di=["M","T","W","T","F","S","S"];function Ni(t){switch(t){case"narrow":return[...Di];case"short":return[...Ii];case"long":return[...Pi];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ri=["AM","PM"],Bi=["Before Christ","Anno Domini"],qi=["BC","AD"],Ui=["B","A"];function Zi(t){switch(t){case"narrow":return[...Ui];case"short":return[...qi];case"long":return[...Bi];default:return null}}function Fi(t,e){let i="";for(const n of t)n.literal?i+=n.val:i+=e(n.val);return i}const Vi={D:Ne,DD:Re,DDD:qe,DDDD:Ue,t:Ze,tt:Fe,ttt:Ve,tttt:je,T:He,TT:We,TTT:Ge,TTTT:Ke,f:Ye,ff:Xe,fff:ei,ffff:ni,F:Je,FF:Qe,FFF:ii,FFFF:oi};class ji{static create(t,e={}){return new ji(t,e)}static parseFormat(t){let e=null,i="",n=!1;const o=[];for(let s=0;s<t.length;s++){const r=t.charAt(s);"'"===r?(i.length>0&&o.push({literal:n,val:i}),e=null,i="",n=!n):n||r===e?i+=r:(i.length>0&&o.push({literal:!1,val:i}),i=r,e=r)}return i.length>0&&o.push({literal:n,val:i}),o}static macroTokenToFormatOpts(t){return Vi[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTime(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).format()}formatDateTimeParts(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).formatToParts()}resolvedOptions(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e}).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return ui(t,e);const i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){const i="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=(e,i)=>this.loc.extract(t,e,i),s=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",r=()=>i?function(t){return Ri[t.hour<12?0:1]}(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,n)=>i?function(t,e){return zi(e)[t.month-1]}(t,e):o(n?{month:e}:{month:e,day:"numeric"},"month"),l=(e,n)=>i?function(t,e){return Ni(e)[t.weekday-1]}(t,e):o(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),h=e=>{const i=ji.macroTokenToFormatOpts(e);return i?this.formatWithSystemDefault(t,i):e},c=e=>i?function(t,e){return Zi(e)[t.year<0?0:1]}(t,e):o({era:e},"era");return Fi(ji.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return r();case"d":return n?o({day:"numeric"},"day"):this.num(t.day);case"dd":return n?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?o({month:"numeric"},"month"):this.num(t.month);case"MM":return n?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?o({year:"numeric"},"year"):this.num(t.year);case"yy":return n?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(e)}}))}formatDurationFromString(t,e){const i=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=ji.parseFormat(e),o=n.reduce(((t,{literal:e,val:i})=>e?t:t.concat(i)),[]),s=t.shiftTo(...o.map(i).filter((t=>t)));return Fi(n,(t=>e=>{const n=i(e);return n?this.num(t.get(n),e.length):e})(s))}}class Hi{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Wi{get type(){throw new ze}get name(){throw new ze}get ianaName(){return this.name}get isUniversal(){throw new ze}offsetName(t,e){throw new ze}formatOffset(t,e){throw new ze}offset(t){throw new ze}equals(t){throw new ze}get isValid(){throw new ze}}let Gi=null;class Ki extends Wi{static get instance(){return null===Gi&&(Gi=new Ki),Gi}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return ki(t,e,i)}formatOffset(t,e){return Ci(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let Yi={};const Ji={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Xi={};class Qi extends Wi{static create(t){return Xi[t]||(Xi[t]=new Qi(t)),Xi[t]}static resetCache(){Xi={},Yi={}}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=Qi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:i}){return ki(t,e,i,this.name)}formatOffset(t,e){return Ci(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const i=(n=this.name,Yi[n]||(Yi[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Yi[n]);var n;let[o,s,r,a,l,h,c]=i.formatToParts?function(t,e){const i=t.formatToParts(e),n=[];for(let t=0;t<i.length;t++){const{type:e,value:o}=i[t],s=Ji[e];"era"===e?n[s]=o:si(s)||(n[s]=parseInt(o,10))}return n}(i,e):function(t,e){const i=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,o,s,r,a,l,h,c]=n;return[r,o,s,a,l,h,c]}(i,e);"BC"===a&&(o=1-Math.abs(o));let d=+e;const u=d%1e3;return d-=u>=0?u:1e3+u,(_i({year:o,month:s,day:r,hour:24===l?0:l,minute:h,second:c,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let tn=null;class en extends Wi{static get utcInstance(){return null===tn&&(tn=new en(0)),tn}static instance(t){return 0===t?en.utcInstance:new en(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new en(Si(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Ci(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${Ci(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return Ci(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 nn extends Wi{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 on(t,e){if(si(t)||null===t)return e;if(t instanceof Wi)return t;if(function(t){return"string"==typeof t}(t)){const i=t.toLowerCase();return"local"===i||"system"===i?e:"utc"===i||"gmt"===i?en.utcInstance:en.parseSpecifier(i)||Qi.create(t)}return ri(t)?en.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new nn(t)}let sn,rn=()=>Date.now(),an="system",ln=null,hn=null,cn=null;class dn{static get now(){return rn}static set now(t){rn=t}static set defaultZone(t){an=t}static get defaultZone(){return on(an,Ki.instance)}static get defaultLocale(){return ln}static set defaultLocale(t){ln=t}static get defaultNumberingSystem(){return hn}static set defaultNumberingSystem(t){hn=t}static get defaultOutputCalendar(){return cn}static set defaultOutputCalendar(t){cn=t}static get throwOnInvalid(){return sn}static set throwOnInvalid(t){sn=t}static resetCaches(){wn.resetCache(),Qi.resetCache()}}let un={};let pn={};function mn(t,e={}){const i=JSON.stringify([t,e]);let n=pn[i];return n||(n=new Intl.DateTimeFormat(t,e),pn[i]=n),n}let fn={};let gn={};let vn=null;function yn(t,e,i,n,o){const s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):o(e)}class bn{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:n,floor:o,...s}=i;if(!e||Object.keys(s).length>0){const e={useGrouping:!1,...i};i.padTo>0&&(e.minimumIntegerDigits=i.padTo),this.inf=function(t,e={}){const i=JSON.stringify([t,e]);let n=fn[i];return n||(n=new Intl.NumberFormat(t,e),fn[i]=n),n}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return ui(this.floor?Math.floor(t):gi(t,3),this.padTo)}}class _n{constructor(t,e,i){let n;if(this.opts=i,t.zone.isUniversal){const e=t.offset/60*-1,o=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&Qi.create(o).valid?(n=o,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:ws.fromMillis(t.ts+60*t.offset*1e3))}else"system"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);const o={...this.opts};n&&(o.timeZone=n),this.dtf=mn(e,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class xn{constructor(t,e,i){this.opts={style:"long",...i},!e&&li()&&(this.rtf=function(t,e={}){const{base:i,...n}=e,o=JSON.stringify([t,n]);let s=gn[o];return s||(s=new Intl.RelativeTimeFormat(t,e),gn[o]=s),s}(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i="always",n=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){const i="days"===t;switch(e){case 1:return i?"tomorrow":`next ${o[t][0]}`;case-1:return i?"yesterday":`last ${o[t][0]}`;case 0:return i?"today":`this ${o[t][0]}`}}const r=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,h=o[t],c=n?l?h[1]:h[2]||h[1]:l?o[t][0]:t;return r?`${a} ${c} ago`:`in ${a} ${c}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}class wn{static fromOpts(t){return wn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,e,i,n=!1){const o=t||dn.defaultLocale,s=o||(n?"en-US":vn||(vn=(new Intl.DateTimeFormat).resolvedOptions().locale,vn)),r=e||dn.defaultNumberingSystem,a=i||dn.defaultOutputCalendar;return new wn(s,r,a,o)}static resetCache(){vn=null,pn={},fn={},gn={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i}={}){return wn.create(t,e,i)}constructor(t,e,i,n){const[o,s,r]=function(t){const e=t.indexOf("-u-");if(-1===e)return[t];{let i;const n=t.substring(0,e);try{i=mn(t).resolvedOptions()}catch(t){i=mn(n).resolvedOptions()}const{numberingSystem:o,calendar:s}=i;return[n,o,s]}}(t);this.locale=o,this.numberingSystem=e||s||null,this.outputCalendar=i||r||null,this.intl=function(t,e,i){return i||e?(t+="-u",i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?wn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1,i=!0){return yn(this,t,i,zi,(()=>{const i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=function(t){const e=[];for(let i=1;i<=12;i++){const n=ws.utc(2016,i,1);e.push(t(n))}return e}((t=>this.extract(t,i,"month")))),this.monthsCache[n][t]}))}weekdays(t,e=!1,i=!0){return yn(this,t,i,Ni,(()=>{const i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=function(t){const e=[];for(let i=1;i<=7;i++){const n=ws.utc(2016,11,13+i);e.push(t(n))}return e}((t=>this.extract(t,i,"weekday")))),this.weekdaysCache[n][t]}))}meridiems(t=!0){return yn(this,void 0,t,(()=>Ri),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ws.utc(2016,11,13,9),ws.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t,e=!0){return yn(this,t,e,Zi,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[ws.utc(-40,1,1),ws.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,i){const n=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===i));return n?n.value:null}numberFormatter(t={}){return new bn(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new _n(t,this.intl,e)}relFormatter(t={}){return new xn(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const i=JSON.stringify([t,e]);let n=un[i];return n||(n=new Intl.ListFormat(t,e),un[i]=n),n}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function kn(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function Sn(...t){return e=>t.reduce((([t,i,n],o)=>{const[s,r,a]=o(e,n);return[{...t,...s},r||i,a]}),[{},null,1]).slice(0,2)}function En(t,...e){if(null==t)return[null,null];for(const[i,n]of e){const e=i.exec(t);if(e)return n(e)}return[null,null]}function $n(...t){return(e,i)=>{const n={};let o;for(o=0;o<t.length;o++)n[t[o]]=pi(e[i+o]);return[n,null,i+o]}}const Cn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Tn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,An=RegExp(`${Tn.source}${`(?:${Cn.source}?(?:\\[(${Ai.source})\\])?)?`}`),Ln=RegExp(`(?:T${An.source})?`),Mn=$n("weekYear","weekNumber","weekDay"),On=$n("year","ordinal"),zn=RegExp(`${Tn.source} ?(?:${Cn.source}|(${Ai.source}))?`),Pn=RegExp(`(?: ${zn.source})?`);function In(t,e,i){const n=t[e];return si(n)?i:pi(n)}function Dn(t,e){return[{hours:In(t,e,0),minutes:In(t,e+1,0),seconds:In(t,e+2,0),milliseconds:fi(t[e+3])},null,e+4]}function Nn(t,e){const i=!t[e]&&!t[e+1],n=Si(t[e+1],t[e+2]);return[{},i?null:en.instance(n),e+3]}function Rn(t,e){return[{},t[e]?Qi.create(t[e]):null,e+1]}const Bn=RegExp(`^T?${Tn.source}$`),qn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Un(t){const[e,i,n,o,s,r,a,l,h]=t,c="-"===e[0],d=l&&"-"===l[0],u=(t,e=!1)=>void 0!==t&&(e||t&&c)?-t:t;return[{years:u(mi(i)),months:u(mi(n)),weeks:u(mi(o)),days:u(mi(s)),hours:u(mi(r)),minutes:u(mi(a)),seconds:u(mi(l),"-0"===l),milliseconds:u(fi(h),d)}]}const Zn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Fn(t,e,i,n,o,s,r){const a={year:2===e.length?wi(pi(e)):pi(e),month:Mi.indexOf(i)+1,day:pi(n),hour:pi(o),minute:pi(s)};return r&&(a.second=pi(r)),t&&(a.weekday=t.length>3?Pi.indexOf(t)+1:Ii.indexOf(t)+1),a}const Vn=/^(?:(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 jn(t){const[,e,i,n,o,s,r,a,l,h,c,d]=t,u=Fn(e,o,n,i,s,r,a);let p;return p=l?Zn[l]:h?0:Si(c,d),[u,new en(p)]}const Hn=/^(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$/,Wn=/^(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$/,Gn=/^(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 Kn(t){const[,e,i,n,o,s,r,a]=t;return[Fn(e,o,n,i,s,r,a),en.utcInstance]}function Yn(t){const[,e,i,n,o,s,r,a]=t;return[Fn(e,a,i,n,o,s,r),en.utcInstance]}const Jn=kn(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ln),Xn=kn(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ln),Qn=kn(/(\d{4})-?(\d{3})/,Ln),to=kn(An),eo=Sn((function(t,e){return[{year:In(t,e),month:In(t,e+1,1),day:In(t,e+2,1)},null,e+3]}),Dn,Nn,Rn),io=Sn(Mn,Dn,Nn,Rn),no=Sn(On,Dn,Nn,Rn),oo=Sn(Dn,Nn,Rn);const so=Sn(Dn);const ro=kn(/(\d{4})-(\d\d)-(\d\d)/,Pn),ao=kn(zn),lo=Sn(Dn,Nn,Rn);const ho={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}},co={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},...ho},uo=365.2425,po=30.436875,mo={years:{quarters:4,months:12,weeks:52.1775,days:uo,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:po,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...ho},fo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],go=fo.slice(0).reverse();function vo(t,e,i=!1){const n={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new bo(n)}function yo(t,e,i,n,o){const s=t[o][i],r=e[i]/s,a=!(Math.sign(r)===Math.sign(n[o]))&&0!==n[o]&&Math.abs(r)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(r):Math.trunc(r);n[o]+=a,e[i]-=a*s}class bo{constructor(t){const e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||wn.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?mo:co,this.isLuxonDuration=!0}static fromMillis(t,e){return bo.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new Oe("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new bo({values:$i(t,bo.normalizeUnit),loc:wn.fromObject(e),conversionAccuracy:e.conversionAccuracy})}static fromDurationLike(t){if(ri(t))return bo.fromMillis(t);if(bo.isDuration(t))return t;if("object"==typeof t)return bo.fromObject(t);throw new Oe(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[i]=function(t){return En(t,[qn,Un])}(t);return i?bo.fromObject(i,e):bo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[i]=function(t){return En(t,[Bn,so])}(t);return i?bo.fromObject(i,e):bo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new Oe("need to specify a reason the Duration is invalid");const i=t instanceof Hi?t:new Hi(t,e);if(dn.throwOnInvalid)throw new Ae(i);return new bo({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 Me(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?ji.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"}toHuman(t={}){const e=fo.map((e=>{const i=this.values[e];return si(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+=gi(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));let o=i.toFormat(n);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=bo.fromDurationLike(t),i={};for(const t of fo)(ci(e.values,t)||ci(this.values,t))&&(i[t]=e.get(t)+this.get(t));return vo(this,{values:i},!0)}minus(t){if(!this.isValid)return this;const e=bo.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]=Ei(t(this.values[i],i));return vo(this,{values:e},!0)}get(t){return this[bo.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return vo(this,{values:{...this.values,...$i(t,bo.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i}={}){const n={loc:this.loc.clone({locale:t,numberingSystem:e})};return i&&(n.conversionAccuracy=i),vo(this,n)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return function(t,e){go.reduce(((i,n)=>si(e[n])?i:(i&&yo(t,e,i,e,n),n)),null)}(this.matrix,t),vo(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>bo.normalizeUnit(t)));const e={},i={},n=this.toObject();let o;for(const s of fo)if(t.indexOf(s)>=0){o=s;let t=0;for(const e in i)t+=this.matrix[e][s]*i[e],i[e]=0;ri(n[s])&&(t+=n[s]);const r=Math.trunc(t);e[s]=r,i[s]=(1e3*t-1e3*r)/1e3;for(const t in n)fo.indexOf(t)>fo.indexOf(s)&&yo(this.matrix,n,t,e,s)}else ri(n[s])&&(i[s]=n[s]);for(const t in i)0!==i[t]&&(e[o]+=t===o?i[t]:i[t]/this.matrix[o][t]);return vo(this,{values:e},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return vo(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const n of fo)if(e=this.values[n],i=t.values[n],!(void 0===e||0===e?void 0===i||0===i:e===i))return!1;var e,i;return!0}}const _o="Invalid Interval";class xo{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 Oe("need to specify a reason the Interval is invalid");const i=t instanceof Hi?t:new Hi(t,e);if(dn.throwOnInvalid)throw new Te(i);return new xo({invalid:i})}static fromDateTimes(t,e){const i=ks(t),n=ks(e),o=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?xo.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:xo.invalid("missing or invalid end"):xo.invalid("missing or invalid start")}(i,n);return null==o?new xo({start:i,end:n}):o}static after(t,e){const i=bo.fromDurationLike(e),n=ks(t);return xo.fromDateTimes(n,n.plus(i))}static before(t,e){const i=bo.fromDurationLike(e),n=ks(t);return xo.fromDateTimes(n.minus(i),n)}static fromISO(t,e){const[i,n]=(t||"").split("/",2);if(i&&n){let t,o,s,r;try{t=ws.fromISO(i,e),o=t.isValid}catch(n){o=!1}try{s=ws.fromISO(n,e),r=s.isValid}catch(n){r=!1}if(o&&r)return xo.fromDateTimes(t,s);if(o){const i=bo.fromISO(n,e);if(i.isValid)return xo.after(t,i)}else if(r){const t=bo.fromISO(i,e);if(t.isValid)return xo.before(s,t)}}return xo.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const e=this.start.startOf(t),i=this.end.startOf(t);return Math.floor(i.diff(e,t).get(t))+1}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?xo.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(ks).filter((t=>this.contains(t))).sort(),i=[];let{s:n}=this,o=0;for(;n<this.e;){const t=e[o]||this.e,s=+t>+this.e?this.e:t;i.push(xo.fromDateTimes(n,s)),n=s,o+=1}return i}splitBy(t){const e=bo.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let i,{s:n}=this,o=1;const s=[];for(;n<this.e;){const t=this.start.plus(e.mapUnits((t=>t*o)));i=+t>+this.e?this.e:t,s.push(xo.fromDateTimes(n,i)),n=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,i=this.e<t.e?this.e:t.e;return e>=i?null:xo.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 xo.fromDateTimes(e,i)}static merge(t){const[e,i]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],i)=>e?e.overlaps(i)||e.abutsStart(i)?[t,e.union(i)]:[t.concat([e]),i]:[t,i]),[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0;const n=[],o=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),s=Array.prototype.concat(...o).sort(((t,e)=>t.time-e.time));for(const t of s)i+="s"===t.type?1:-1,1===i?e=t.time:(e&&+e!=+t.time&&n.push(xo.fromDateTimes(e,t.time)),e=null);return xo.merge(n)}difference(...t){return xo.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:_o}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:_o}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:_o}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:_o}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:_o}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):bo.invalid(this.invalidReason)}mapEndpoints(t){return xo.fromDateTimes(t(this.s),t(this.e))}}class wo{static hasDST(t=dn.defaultZone){const e=ws.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return Qi.isValidZone(t)}static normalizeZone(t){return on(t,dn.defaultZone)}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||wn.create(e,i,o)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:o="gregory"}={}){return(n||wn.create(e,i,o)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||wn.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||wn.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return wn.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return wn.create(e,null,"gregory").eras(t)}static features(){return{relative:li()}}}function ko(t,e){const i=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=i(e)-i(t);return Math.floor(bo.fromMillis(n).as("days"))}function So(t,e,i,n){let[o,s,r,a]=function(t,e,i){const n=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const i=ko(t,e);return(i-i%7)/7}],["days",ko]],o={};let s,r;for(const[a,l]of n)if(i.indexOf(a)>=0){s=a;let i=l(t,e);r=t.plus({[a]:i}),r>e?(t=t.plus({[a]:i-1}),i-=1):t=r,o[a]=i}return[t,o,r,s]}(t,e,i);const l=e-o,h=i.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===h.length&&(r<e&&(r=o.plus({[a]:1})),r!==o&&(s[a]=(s[a]||0)+l/(r-o)));const c=bo.fromObject(s,n);return h.length>0?bo.fromMillis(l,n).shiftTo(...h).plus(c):c}const Eo={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$o={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Co=Eo.hanidec.replace(/[\[|\]]/g,"").split("");function To({numberingSystem:t},e=""){return new RegExp(`${Eo[t||"latn"]}${e}`)}function Ao(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(-1!==t[i].search(Eo.hanidec))e+=Co.indexOf(t[i]);else for(const t in $o){const[i,o]=$o[t];n>=i&&n<=o&&(e+=n-i)}}return parseInt(e,10)}return e}(t))}}const Lo=`[ ${String.fromCharCode(160)}]`,Mo=new RegExp(Lo,"g");function Oo(t){return t.replace(/\./g,"\\.?").replace(Mo,Lo)}function zo(t){return t.replace(/\./g,"").replace(Mo," ").toLowerCase()}function Po(t,e){return null===t?null:{regex:RegExp(t.map(Oo).join("|")),deser:([i])=>t.findIndex((t=>zo(i)===zo(t)))+e}}function Io(t,e){return{regex:t,deser:([,t,e])=>Si(t,e),groups:e}}function Do(t){return{regex:t,deser:([t])=>t}}const No={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let Ro=null;function Bo(t,e){if(t.literal)return t;const i=ji.macroTokenToFormatOpts(t.val);if(!i)return t;const n=ji.create(e,i).formatDateTimeParts((Ro||(Ro=ws.fromMillis(1555555555555)),Ro)).map((t=>function(t,e,i){const{type:n,value:o}=t;if("literal"===n)return{literal:!0,val:o};const s=i[n];let r=No[n];return"object"==typeof r&&(r=r[s]),r?{literal:!1,val:r}:void 0}(t,0,i)));return n.includes(void 0)?t:n}function qo(t,e,i){const n=function(t,e){return Array.prototype.concat(...t.map((t=>Bo(t,e))))}(ji.parseFormat(i),t),o=n.map((e=>function(t,e){const i=To(e),n=To(e,"{2}"),o=To(e,"{3}"),s=To(e,"{4}"),r=To(e,"{6}"),a=To(e,"{1,2}"),l=To(e,"{1,3}"),h=To(e,"{1,6}"),c=To(e,"{1,9}"),d=To(e,"{2,4}"),u=To(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 Po(e.eras("short",!1),0);case"GG":return Po(e.eras("long",!1),0);case"y":return Ao(h);case"yy":case"kk":return Ao(d,wi);case"yyyy":case"kkkk":return Ao(s);case"yyyyy":return Ao(u);case"yyyyyy":return Ao(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Ao(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Ao(n);case"MMM":return Po(e.months("short",!0,!1),1);case"MMMM":return Po(e.months("long",!0,!1),1);case"LLL":return Po(e.months("short",!1,!1),1);case"LLLL":return Po(e.months("long",!1,!1),1);case"o":case"S":return Ao(l);case"ooo":case"SSS":return Ao(o);case"u":return Do(c);case"uu":return Do(a);case"uuu":case"E":case"c":return Ao(i);case"a":return Po(e.meridiems(),0);case"EEE":return Po(e.weekdays("short",!1,!1),1);case"EEEE":return Po(e.weekdays("long",!1,!1),1);case"ccc":return Po(e.weekdays("short",!0,!1),1);case"cccc":return Po(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Io(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return Io(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Do(/[a-z_+-/]{1,256}?/i);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),s=o.find((t=>t.invalidReason));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};{const[t,i]=function(t){const e=t.map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"");return[`^${e}$`,t]}(o),s=RegExp(t,"i"),[r,a]=function(t,e,i){const n=t.match(e);if(n){const t={};let e=1;for(const o in i)if(ci(i,o)){const s=i[o],r=s.groups?s.groups+1:1;!s.literal&&s.token&&(t[s.token.val[0]]=s.deser(n.slice(e,e+r))),e+=r}return[n,t]}return[n,{}]}(e,s,i),[l,h,c]=a?function(t){let e,i=null;si(t.z)||(i=Qi.create(t.z)),si(t.Z)||(i||(i=new en(t.Z)),e=t.Z),si(t.q)||(t.M=3*(t.q-1)+1),si(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),si(t.u)||(t.S=fi(t.u));const n=Object.keys(t).reduce(((e,i)=>{const n=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(i);return n&&(e[n]=t[i]),e}),{});return[n,i,e]}(a):[null,null,void 0];if(ci(a,"a")&&ci(a,"H"))throw new Le("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:s,rawMatches:r,matches:a,result:l,zone:h,specificOffset:c}}}const Uo=[0,31,59,90,120,151,181,212,243,273,304,334],Zo=[0,31,60,91,121,152,182,213,244,274,305,335];function Fo(t,e){return new Hi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Vo(t,e,i){const n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const o=n.getUTCDay();return 0===o?7:o}function jo(t,e,i){return i+(vi(t)?Zo:Uo)[e-1]}function Ho(t,e){const i=vi(t)?Zo:Uo,n=i.findIndex((t=>t<e));return{month:n+1,day:e-i[n]}}function Wo(t){const{year:e,month:i,day:n}=t,o=jo(e,i,n),s=Vo(e,i,n);let r,a=Math.floor((o-s+10)/7);return a<1?(r=e-1,a=xi(r)):a>xi(e)?(r=e+1,a=1):r=e,{weekYear:r,weekNumber:a,weekday:s,...Ti(t)}}function Go(t){const{weekYear:e,weekNumber:i,weekday:n}=t,o=Vo(e,1,4),s=yi(e);let r,a=7*i+n-o-3;a<1?(r=e-1,a+=yi(r)):a>s?(r=e+1,a-=yi(e)):r=e;const{month:l,day:h}=Ho(r,a);return{year:r,month:l,day:h,...Ti(t)}}function Ko(t){const{year:e,month:i,day:n}=t;return{year:e,ordinal:jo(e,i,n),...Ti(t)}}function Yo(t){const{year:e,ordinal:i}=t,{month:n,day:o}=Ho(e,i);return{year:e,month:n,day:o,...Ti(t)}}function Jo(t){const e=ai(t.year),i=di(t.month,1,12),n=di(t.day,1,bi(t.year,t.month));return e?i?!n&&Fo("day",t.day):Fo("month",t.month):Fo("year",t.year)}function Xo(t){const{hour:e,minute:i,second:n,millisecond:o}=t,s=di(e,0,23)||24===e&&0===i&&0===n&&0===o,r=di(i,0,59),a=di(n,0,59),l=di(o,0,999);return s?r?a?!l&&Fo("millisecond",o):Fo("second",n):Fo("minute",i):Fo("hour",e)}const Qo="Invalid DateTime",ts=864e13;function es(t){return new Hi("unsupported zone",`the zone "${t.name}" is not supported`)}function is(t){return null===t.weekData&&(t.weekData=Wo(t.c)),t.weekData}function ns(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new ws({...i,...e,old:i})}function os(t,e,i){let n=t-60*e*1e3;const o=i.offset(n);if(e===o)return[n,e];n-=60*(o-e)*1e3;const s=i.offset(n);return o===s?[n,o]:[t-60*Math.min(o,s)*1e3,Math.max(o,s)]}function ss(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 rs(t,e,i){return os(_i(t),e,i)}function as(t,e){const i=t.o,n=t.c.year+Math.trunc(e.years),o=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s={...t.c,year:n,month:o,day:Math.min(t.c.day,bi(n,o))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},r=bo.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=_i(s);let[l,h]=os(a,i,t.zone);return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function ls(t,e,i,n,o,s){const{setZone:r,zone:a}=i;if(t&&0!==Object.keys(t).length){const n=e||a,o=ws.fromObject(t,{...i,zone:n,specificOffset:s});return r?o:o.setZone(a)}return ws.invalid(new Hi("unparsable",`the input "${o}" can't be parsed as ${n}`))}function hs(t,e,i=!0){return t.isValid?ji.create(wn.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function cs(t,e){const i=t.c.year>9999||t.c.year<0;let n="";return i&&t.c.year>=0&&(n+="+"),n+=ui(t.c.year,i?6:4),e?(n+="-",n+=ui(t.c.month),n+="-",n+=ui(t.c.day)):(n+=ui(t.c.month),n+=ui(t.c.day)),n}function ds(t,e,i,n,o,s){let r=ui(t.c.hour);return e?(r+=":",r+=ui(t.c.minute),0===t.c.second&&i||(r+=":")):r+=ui(t.c.minute),0===t.c.second&&i||(r+=ui(t.c.second),0===t.c.millisecond&&n||(r+=".",r+=ui(t.c.millisecond,3))),o&&(t.isOffsetFixed&&0===t.offset&&!s?r+="Z":t.o<0?(r+="-",r+=ui(Math.trunc(-t.o/60)),r+=":",r+=ui(Math.trunc(-t.o%60))):(r+="+",r+=ui(Math.trunc(t.o/60)),r+=":",r+=ui(Math.trunc(t.o%60)))),s&&(r+="["+t.zone.ianaName+"]"),r}const us={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ps={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ms={ordinal:1,hour:0,minute:0,second:0,millisecond:0},fs=["year","month","day","hour","minute","second","millisecond"],gs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],vs=["year","ordinal","hour","minute","second","millisecond"];function ys(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 Me(t);return e}function bs(t,e){const i=on(e.zone,dn.defaultZone),n=wn.fromObject(e),o=dn.now();let s,r;if(si(t.year))s=o;else{for(const e of fs)si(t[e])&&(t[e]=us[e]);const e=Jo(t)||Xo(t);if(e)return ws.invalid(e);const n=i.offset(o);[s,r]=rs(t,n,i)}return new ws({ts:s,zone:i,loc:n,o:r})}function _s(t,e,i){const n=!!si(i.round)||i.round,o=(t,o)=>{t=gi(t,n||i.calendary?0:2,!0);return e.loc.clone(i).relFormatter(i).format(t,o)},s=n=>i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n);if(i.unit)return o(s(i.unit),i.unit);for(const t of i.units){const e=s(t);if(Math.abs(e)>=1)return o(e,t)}return o(t>e?-0:0,i.units[i.units.length-1])}function xs(t){let e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}class ws{constructor(t){const e=t.zone||dn.defaultZone;let i=t.invalid||(Number.isNaN(t.ts)?new Hi("invalid input"):null)||(e.isValid?null:es(e));this.ts=si(t.ts)?dn.now():t.ts;let n=null,o=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,o]=[t.old.c,t.old.o];else{const t=e.offset(this.ts);n=ss(this.ts,t),i=Number.isNaN(n.year)?new Hi("invalid input"):null,n=i?null:n,o=i?null:t}}this._zone=e,this.loc=t.loc||wn.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=o,this.isLuxonDateTime=!0}static now(){return new ws({})}static local(){const[t,e]=xs(arguments),[i,n,o,s,r,a,l]=e;return bs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static utc(){const[t,e]=xs(arguments),[i,n,o,s,r,a,l]=e;return t.zone=en.utcInstance,bs({year:i,month:n,day:o,hour:s,minute:r,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const i=function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?t.valueOf():NaN;if(Number.isNaN(i))return ws.invalid("invalid input");const n=on(e.zone,dn.defaultZone);return n.isValid?new ws({ts:i,zone:n,loc:wn.fromObject(e)}):ws.invalid(es(n))}static fromMillis(t,e={}){if(ri(t))return t<-ts||t>ts?ws.invalid("Timestamp out of range"):new ws({ts:t,zone:on(e.zone,dn.defaultZone),loc:wn.fromObject(e)});throw new Oe(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(ri(t))return new ws({ts:1e3*t,zone:on(e.zone,dn.defaultZone),loc:wn.fromObject(e)});throw new Oe("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const i=on(e.zone,dn.defaultZone);if(!i.isValid)return ws.invalid(es(i));const n=dn.now(),o=si(e.specificOffset)?i.offset(n):e.specificOffset,s=$i(t,ys),r=!si(s.ordinal),a=!si(s.year),l=!si(s.month)||!si(s.day),h=a||l,c=s.weekYear||s.weekNumber,d=wn.fromObject(e);if((h||r)&&c)throw new Le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new Le("Can't mix ordinal dates with month/day");const u=c||s.weekday&&!h;let p,m,f=ss(n,o);u?(p=gs,m=ps,f=Wo(f)):r?(p=vs,m=ms,f=Ko(f)):(p=fs,m=us);let g=!1;for(const t of p){si(s[t])?s[t]=g?m[t]:f[t]:g=!0}const v=u?function(t){const e=ai(t.weekYear),i=di(t.weekNumber,1,xi(t.weekYear)),n=di(t.weekday,1,7);return e?i?!n&&Fo("weekday",t.weekday):Fo("week",t.week):Fo("weekYear",t.weekYear)}(s):r?function(t){const e=ai(t.year),i=di(t.ordinal,1,yi(t.year));return e?!i&&Fo("ordinal",t.ordinal):Fo("year",t.year)}(s):Jo(s),y=v||Xo(s);if(y)return ws.invalid(y);const b=u?Go(s):r?Yo(s):s,[_,x]=rs(b,o,i),w=new ws({ts:_,zone:i,o:x,loc:d});return s.weekday&&h&&t.weekday!==w.weekday?ws.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${w.toISO()}`):w}static fromISO(t,e={}){const[i,n]=function(t){return En(t,[Jn,eo],[Xn,io],[Qn,no],[to,oo])}(t);return ls(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[i,n]=function(t){return En(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Vn,jn])}(t);return ls(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[i,n]=function(t){return En(t,[Hn,Kn],[Wn,Kn],[Gn,Yn])}(t);return ls(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(si(t)||si(e))throw new Oe("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:o=null}=i,s=wn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),[r,a,l,h]=function(t,e,i){const{result:n,zone:o,specificOffset:s,invalidReason:r}=qo(t,e,i);return[n,o,s,r]}(s,t,e);return h?ws.invalid(h):ls(r,a,i,`format ${e}`,t,l)}static fromString(t,e,i={}){return ws.fromFormat(t,e,i)}static fromSQL(t,e={}){const[i,n]=function(t){return En(t,[ro,eo],[ao,lo])}(t);return ls(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new Oe("need to specify a reason the DateTime is invalid");const i=t instanceof Hi?t:new Hi(t,e);if(dn.throwOnInvalid)throw new Ce(i);return new ws({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?is(this).weekYear:NaN}get weekNumber(){return this.isValid?is(this).weekNumber:NaN}get weekday(){return this.isValid?is(this).weekday:NaN}get ordinal(){return this.isValid?Ko(this.c).ordinal:NaN}get monthShort(){return this.isValid?wo.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?wo.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?wo.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?wo.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return vi(this.year)}get daysInMonth(){return bi(this.year,this.month)}get daysInYear(){return this.isValid?yi(this.year):NaN}get weeksInWeekYear(){return this.isValid?xi(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:i,calendar:n}=ji.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(en.instance(t),e)}toLocal(){return this.setZone(dn.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if((t=on(t,dn.defaultZone)).equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){const e=t.offset(this.ts),i=this.toObject();[n]=rs(i,e,t)}return ns(this,{ts:n,zone:t})}return ws.invalid(es(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){return ns(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=$i(t,ys),i=!si(e.weekYear)||!si(e.weekNumber)||!si(e.weekday),n=!si(e.ordinal),o=!si(e.year),s=!si(e.month)||!si(e.day),r=o||s,a=e.weekYear||e.weekNumber;if((r||n)&&a)throw new Le("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&n)throw new Le("Can't mix ordinal dates with month/day");let l;i?l=Go({...Wo(this.c),...e}):si(e.ordinal)?(l={...this.toObject(),...e},si(e.day)&&(l.day=Math.min(bi(l.year,l.month),l.day))):l=Yo({...Ko(this.c),...e});const[h,c]=rs(l,this.o,this.zone);return ns(this,{ts:h,o:c})}plus(t){if(!this.isValid)return this;return ns(this,as(this,bo.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return ns(this,as(this,bo.fromDurationLike(t).negate()))}startOf(t){if(!this.isValid)return this;const e={},i=bo.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){const t=Math.ceil(this.month/3);e.month=3*(t-1)+1}return this.set(e)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,e={}){return this.isValid?ji.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Qo}toLocaleString(t=Ne,e={}){return this.isValid?ji.create(this.loc.clone(e),t).formatDateTime(this):Qo}toLocaleParts(t={}){return this.isValid?ji.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:i=!1,includeOffset:n=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s="extended"===t;let r=cs(this,s);return r+="T",r+=ds(this,s,e,i,n,o),r}toISODate({format:t="extended"}={}){return this.isValid?cs(this,"extended"===t):null}toISOWeekDate(){return hs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:i=!0,includePrefix:n=!1,extendedZone:o=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+ds(this,"extended"===s,e,t,i,o)}toRFC2822(){return hs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return hs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cs(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:i=!0}={}){let n="HH:mm:ss.SSS";return(e||t)&&(i&&(n+=" "),e?n+="z":t&&(n+="ZZ")),hs(this,n,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Qo}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 bo.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...i},o=(a=e,Array.isArray(a)?a:[a]).map(bo.normalizeUnit),s=t.valueOf()>this.valueOf(),r=So(s?this:t,s?t:this,o,n);var a;return s?r.negate():r}diffNow(t="milliseconds",e={}){return this.diff(ws.now(),t,e)}until(t){return this.isValid?xo.fromDateTimes(this,t):this}hasSame(t,e){if(!this.isValid)return!1;const i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||ws.fromObject({},{zone:this.zone}),i=t.padding?this<e?-t.padding:t.padding:0;let n=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(n=t.unit,o=void 0),_s(e,this.plus(i),{...t,numeric:"always",units:n,unit:o})}toRelativeCalendar(t={}){return this.isValid?_s(t.base||ws.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(ws.isDateTime))throw new Oe("min requires all arguments be DateTimes");return hi(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(ws.isDateTime))throw new Oe("max requires all arguments be DateTimes");return hi(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,i={}){const{locale:n=null,numberingSystem:o=null}=i;return qo(wn.fromOpts({locale:n,numberingSystem:o,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,i={}){return ws.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return Ne}static get DATE_MED(){return Re}static get DATE_MED_WITH_WEEKDAY(){return Be}static get DATE_FULL(){return qe}static get DATE_HUGE(){return Ue}static get TIME_SIMPLE(){return Ze}static get TIME_WITH_SECONDS(){return Fe}static get TIME_WITH_SHORT_OFFSET(){return Ve}static get TIME_WITH_LONG_OFFSET(){return je}static get TIME_24_SIMPLE(){return He}static get TIME_24_WITH_SECONDS(){return We}static get TIME_24_WITH_SHORT_OFFSET(){return Ge}static get TIME_24_WITH_LONG_OFFSET(){return Ke}static get DATETIME_SHORT(){return Ye}static get DATETIME_SHORT_WITH_SECONDS(){return Je}static get DATETIME_MED(){return Xe}static get DATETIME_MED_WITH_SECONDS(){return Qe}static get DATETIME_MED_WITH_WEEKDAY(){return ti}static get DATETIME_FULL(){return ei}static get DATETIME_FULL_WITH_SECONDS(){return ii}static get DATETIME_HUGE(){return ni}static get DATETIME_HUGE_WITH_SECONDS(){return oi}}function ks(t){if(ws.isDateTime(t))return t;if(t&&t.valueOf&&ri(t.valueOf()))return ws.fromJSDate(t);if(t&&"object"==typeof t)return ws.fromObject(t);throw new Oe(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Ss=(t,e,i)=>{let n=t[0];for(let o=1;o<t.length;o++)n+=e[i?i[o-1]:o-1],n+=t[o];return n},Es=t=>{return"string"!=typeof(e=t)&&"strTag"in e?Ss(t.strings,t.values):t;var e};class $s{constructor(){this.settled=!1,this.promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}resolve(t){this.settled=!0,this._resolve(t)}reject(t){this.settled=!0,this._reject(t)}}const Cs=[];for(let t=0;t<256;t++)Cs[t]=(t>>4&15).toString(16)+(15&t).toString(16);function Ts(t,e){return(e?"h":"s")+function(t){let e=0,i=8997,n=0,o=33826,s=0,r=40164,a=0,l=52210;for(let h=0;h<t.length;h++)i^=t.charCodeAt(h),e=435*i,n=435*o,s=435*r,a=435*l,s+=i<<8,a+=o<<8,n+=e>>>16,i=65535&e,s+=n>>>16,o=65535&n,l=a+(s>>>16)&65535,r=65535&s;return Cs[l>>8]+Cs[255&l]+Cs[r>>8]+Cs[255&r]+Cs[o>>8]+Cs[255&o]+Cs[i>>8]+Cs[255&i]}("string"==typeof t?t:t.join(""))}const As=new WeakMap,Ls=new Map;function Ms(t,e,i){var n;if(t){const o=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:function(t){const e="string"==typeof t?t:t.strings;let i=Ls.get(e);void 0===i&&(i=Ts(e,"string"!=typeof t&&!("strTag"in t)),Ls.set(e,i));return i}(e),s=t[o];if(s){if("string"==typeof s)return s;if("strTag"in s)return Ss(s.strings,e.values,s.values);{let t=As.get(s);return void 0===t&&(t=s.values,As.set(s,t)),{...s,values:t.map((t=>e.values[t]))}}}}return Es(e)}function Os(t){window.dispatchEvent(new CustomEvent("lit-localize-status",{detail:t}))}let zs,Ps,Is,Ds,Ns,Rs="",Bs=new $s;Bs.resolve();let qs=0;const Us=()=>Rs,Zs=t=>{if(t===(null!=zs?zs:Rs))return Bs.promise;if(!Is||!Ds)throw new Error("Internal error");if(!Is.has(t))throw new Error("Invalid locale code");qs++;const e=qs;zs=t,Bs.settled&&(Bs=new $s),Os({status:"loading",loadingLocale:t});return(t===Ps?Promise.resolve({templates:void 0}):Ds(t)).then((i=>{qs===e&&(Rs=t,zs=void 0,Ns=i.templates,Os({status:"ready",readyLocale:t}),Bs.resolve())}),(i=>{qs===e&&(Os({status:"error",errorLocale:t,errorMessage:i.toString()}),Bs.reject(i))})),Bs.promise};let Fs=Es,Vs=!1;const js=["es","fr","pt"],{setLocale:Hs}=(t=>(function(t){if(Vs)throw new Error("lit-localize can only be configured once");Fs=t,Vs=!0}(((t,e)=>Ms(Ns,t,e))),Rs=Ps=t.sourceLocale,Is=new Set(t.targetLocales),Is.add(t.sourceLocale),Ds=t.loadLocale,{getLocale:Us,setLocale:Zs}))({sourceLocale:"en",targetLocales:js,loadLocale:t=>import(`./locales/${t}.js`)});class Ws extends lt{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.languages={},this.featuredFields=[],this.pendingResolves={},this.fetching={}}static get styles(){return r`
229
229
  :host {
230
230
  position: fixed;
231
231
  z-index: 1000;
@@ -236,7 +236,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
236
236
  width: 100%;
237
237
  top: 0.5em;
238
238
  }
239
- `}getLocale(){return this.locale[0]}clearCache(){this.cache=$e(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(me("settings")||"{}");const t=[];this.completionEndpoint&&t.push(te(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(se(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(se(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(te(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(se(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return se(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(Se.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||ks.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=ks.fromISO(t),n=e?ks.fromISO(e):ks.now();return this.getShortDuration(i,n)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=Hs.find((e=>e===t));e&&Ws(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||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return ks.fromISO(t).setLocale(this.getLocale()).toLocaleString(ks.DATETIME_SHORT)}postJSON(t,e=""){return ae(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),le(t,i)})(t,e)}postUrl(t,e="",i={},n=null){return re(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):te(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&ne(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(Se.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(Se.StoreUpdated,{url:t,data:o}):ne(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(Se.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 D`<temba-loading size="10" units="8"></temba-loading>`}}t([ct({type:Number})],Gs.prototype,"ttl",void 0),t([ct({type:Number})],Gs.prototype,"max",void 0),t([ct({type:Boolean})],Gs.prototype,"ready",void 0),t([ct({type:Boolean})],Gs.prototype,"loader",void 0),t([ct({type:String,attribute:"completion"})],Gs.prototype,"completionEndpoint",void 0),t([ct({type:String,attribute:"fields"})],Gs.prototype,"fieldsEndpoint",void 0),t([ct({type:String,attribute:"groups"})],Gs.prototype,"groupsEndpoint",void 0),t([ct({type:String,attribute:"globals"})],Gs.prototype,"globalsEndpoint",void 0),t([ct({type:String,attribute:"languages"})],Gs.prototype,"languagesEndpoint",void 0),t([ct({type:String,attribute:"workspace"})],Gs.prototype,"workspaceEndpoint",void 0),t([ct({type:String,attribute:"users"})],Gs.prototype,"usersEndpoint",void 0),t([ct({type:Object,attribute:!1})],Gs.prototype,"schema",void 0),t([ct({type:Object,attribute:!1})],Gs.prototype,"fnOptions",void 0),t([ct({type:Object,attribute:!1})],Gs.prototype,"keyedAssets",void 0);class Ks extends lt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-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=de((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
239
+ `}getLocale(){return this.locale[0]}clearCache(){this.cache=Ee(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse((t=>{let e=null;if(document.cookie&&""!=document.cookie){const i=document.cookie.split(";");for(let n=0;n<i.length;n++){const o=i[n].trim();if(o.substring(0,t.length+1)==t+"="){e=decodeURIComponent(o.substring(t.length+1));break}}}return e})("settings")||"{}");const t=[];this.completionEndpoint&&t.push(te(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(se(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(se(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(te(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(se(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return se(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(ke.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||ws.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=ws.fromISO(t),n=e?ws.fromISO(e):ws.now();return this.getShortDuration(i,n)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=js.find((e=>e===t));e&&Hs(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||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return ws.fromISO(t).setLocale(this.getLocale()).toLocaleString(ws.DATETIME_SHORT)}postJSON(t,e=""){return ae(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),le(t,i)})(t,e)}postUrl(t,e="",i={},n=null){return re(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):te(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&ne(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(ke.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(ke.StoreUpdated,{url:t,data:o}):ne(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(ke.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 D`<temba-loading size="10" units="8"></temba-loading>`}}t([ct({type:Number})],Ws.prototype,"ttl",void 0),t([ct({type:Number})],Ws.prototype,"max",void 0),t([ct({type:Boolean})],Ws.prototype,"ready",void 0),t([ct({type:Boolean})],Ws.prototype,"loader",void 0),t([ct({type:String,attribute:"completion"})],Ws.prototype,"completionEndpoint",void 0),t([ct({type:String,attribute:"fields"})],Ws.prototype,"fieldsEndpoint",void 0),t([ct({type:String,attribute:"groups"})],Ws.prototype,"groupsEndpoint",void 0),t([ct({type:String,attribute:"globals"})],Ws.prototype,"globalsEndpoint",void 0),t([ct({type:String,attribute:"languages"})],Ws.prototype,"languagesEndpoint",void 0),t([ct({type:String,attribute:"workspace"})],Ws.prototype,"workspaceEndpoint",void 0),t([ct({type:String,attribute:"users"})],Ws.prototype,"usersEndpoint",void 0),t([ct({type:Object,attribute:!1})],Ws.prototype,"schema",void 0),t([ct({type:Object,attribute:!1})],Ws.prototype,"fnOptions",void 0),t([ct({type:Object,attribute:!1})],Ws.prototype,"keyedAssets",void 0);class Gs extends lt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-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=de((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
240
240
  .options-container {
241
241
  background: var(--color-options-bg);
242
242
  user-select: none;
@@ -396,7 +396,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
396
396
  .loading .loader-bar {
397
397
  max-height: 1.1em;
398
398
  }
399
- `}firstUpdated(){this.block||(this.scrollParent=he(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition),this.calculatePosition()),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition)}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("cursorIndex")){const t=this.shadowRoot.querySelector(`div[data-option-index="${this.cursorIndex}"]`);if(t){const e=this.shadowRoot.querySelector(".options-container"),i=e.getBoundingClientRect().height,n=t.getBoundingClientRect().height;if(t.offsetTop+n>e.scrollTop+i-5){const o=t.offsetTop-i+n+5;e.scrollTop=o}else if(t.offsetTop<e.scrollTop){const i=t.offsetTop-5;e.scrollTop=i}}this.fireCustomEvent(Se.CursorChanged,{index:this.cursorIndex})}if(t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),300))),t.has("options")){this.calculatePosition(),this.triggerScroll=!0;const e=t.get("options"),i=e?e.length:0,n=this.options?this.options.length:0;(-1===this.cursorIndex||n<i||0===i&&n>0&&!t.has("cursorIndex"))&&(this.block?this.cursorIndex>=n&&(this.cursorIndex=n-1):this.cursorIndex=0,this.block&&this.handleSelection(!1));const o=this.shadowRoot.querySelector(".options");o.scrollHeight==o.clientHeight&&this.fireCustomEvent(Se.ScrollThreshold)}t.has("visible")&&window.setTimeout((()=>{this.calculatePosition()}),100)}renderOptionDefault(t,e){const i=(this.renderOptionName||this.renderOptionNameDefault).bind(this),n=(this.renderOptionDetail||this.renderOptionDetailDefault).bind(this);return e?D`
399
+ `}firstUpdated(){this.block||(this.scrollParent=he(this),this.calculatePosition=this.calculatePosition.bind(this),this.scrollParent&&this.scrollParent.addEventListener("scroll",this.calculatePosition),this.calculatePosition()),this.resolvedRenderOption=(this.renderOption||this.renderOptionDefault).bind(this)}disconnectedCallback(){this.block||this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.calculatePosition)}isFocused(){return this.closestElement(document.activeElement.tagName)===document.activeElement}updated(t){if(super.updated(t),t.has("cursorIndex")){const t=this.shadowRoot.querySelector(`div[data-option-index="${this.cursorIndex}"]`);if(t){const e=this.shadowRoot.querySelector(".options-container"),i=e.getBoundingClientRect().height,n=t.getBoundingClientRect().height;if(t.offsetTop+n>e.scrollTop+i-5){const o=t.offsetTop-i+n+5;e.scrollTop=o}else if(t.offsetTop<e.scrollTop){const i=t.offsetTop-5;e.scrollTop=i}}this.fireCustomEvent(ke.CursorChanged,{index:this.cursorIndex})}if(t.has("visible")&&t.has("options")&&(this.visible||0!=this.options.length||(this.tempOptions=t.get("options"),window.setTimeout((()=>{this.tempOptions=[]}),300))),t.has("options")){this.calculatePosition(),this.triggerScroll=!0;const e=t.get("options"),i=e?e.length:0,n=this.options?this.options.length:0;(-1===this.cursorIndex||n<i||0===i&&n>0&&!t.has("cursorIndex"))&&(this.block?this.cursorIndex>=n&&(this.cursorIndex=n-1):this.cursorIndex=0,this.block&&this.handleSelection(!1));const o=this.shadowRoot.querySelector(".options");o.scrollHeight==o.clientHeight&&this.fireCustomEvent(ke.ScrollThreshold)}t.has("visible")&&window.setTimeout((()=>{this.calculatePosition()}),100)}renderOptionDefault(t,e){const i=(this.renderOptionName||this.renderOptionNameDefault).bind(this),n=(this.renderOptionDetail||this.renderOptionDetailDefault).bind(this);return e?D`
400
400
  <div class="name">${i(t,e)}</div>
401
401
  <div class="detail">${n(t,e)}</div>
402
402
  `:D`
@@ -407,7 +407,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
407
407
  style="margin-right:0.5em; fill: var(--color-text-dark);"
408
408
  ></temba-icon>`:null}
409
409
  <div style="flex-grow:1">${t.prefix}${this.getName(t)}</div>
410
- </div>`}renderOptionDetailDefault(t){return D` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(Se.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(Se.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(Se.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={"margin-left":`${this.marginHorizontal}px`,"margin-top":`${t}px`};this.top&&(e.top=`${this.top}px`),this.left&&(e.left=`${this.left}px`);const i={};this.width&&(i.width=`${this.width}px`);const n=ee({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),o=ee({options:!0});let s=this.options||[];return 0==s.length&&this.tempOptions&&this.tempOptions.length>0&&(s=this.tempOptions),D`
410
+ </div>`}renderOptionDetailDefault(t){return D` ${t.detail} `}handleSelection(t=!1,e=-1){-1===e&&(e=this.cursorIndex);const i=this.options[e];this.fireCustomEvent(ke.Selection,{selected:i,tabbed:t,index:e})}moveCursor(t){const e=Math.max(Math.min(this.cursorIndex+t,this.options.length-1),0);this.setCursor(e)}handleKeyDown(t){this.block&&!this.isFocused()||this.options&&this.options.length>0&&(t.ctrlKey&&"n"===t.key||"ArrowDown"===t.key?(this.moveCursor(1),t.preventDefault(),t.stopPropagation(),this.block&&this.handleSelection(!1)):t.ctrlKey&&"p"===t.key||"ArrowUp"===t.key?(this.moveCursor(-1),t.preventDefault(),this.block&&this.handleSelection(!1)):("Enter"===t.key||"Tab"===t.key||this.spaceSelect&&" "===t.key)&&(t.preventDefault(),t.stopPropagation(),this.handleSelection("Tab"===t.key)),"Escape"===t.key&&this.fireCustomEvent(ke.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(ke.ScrollThreshold),this.triggerScroll=!1)}}calculatePosition(){if(this.visible&&!this.block){const t=this.shadowRoot.querySelector(".options-container").getBoundingClientRect();if(this.anchorTo){const e=this.anchorTo.getBoundingClientRect(),i=e.top-t.height;this.anchorTo&&this.scrollParent&&((t,e)=>{e=e||document.body;const{top:i,bottom:n}=t.getBoundingClientRect(),o=e.getBoundingClientRect();i<=o.top?o.top:o.bottom})(this.anchorTo,this.scrollParent),i>0&&e.bottom+t.height>window.innerHeight?(this.top=i,this.poppedTop=!0):(this.top=e.bottom,this.poppedTop=!1),this.left=e.left,this.width=this.staticWidth>0?this.staticWidth:e.width-2-2*this.marginHorizontal,this.anchorRight&&(this.left=e.right-this.width)}}}getEventHandlers(){return[{event:"keydown",method:this.handleKeyDown,isDocument:!0},{event:"scroll",method:this.calculatePosition,isDocument:!0}]}handleMouseMove(t){if(!this.block&&Math.abs(t.movementX)+Math.abs(t.movementY)>0){const e=t.currentTarget.getAttribute("data-option-index");this.setCursor(parseInt(e))}}handleMouseDown(t){t.preventDefault(),t.stopPropagation()}handleOptionClick(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.getAttribute("data-option-index");if(e){const t=parseInt(e);this.setCursor(t),this.handleSelection(!1,t)}}render(){let t=this.block?0:this.marginVertical;this.poppedTop&&(t*=-1);const e={"margin-left":`${this.marginHorizontal}px`,"margin-top":`${t}px`};this.top&&(e.top=`${this.top}px`),this.left&&(e.left=`${this.left}px`);const i={};this.width&&(i.width=`${this.width}px`);const n=ee({"options-container":!0,show:this.visible,top:this.poppedTop,anchored:!this.block,loading:this.loading,shadow:!this.hideShadow,bordered:this.hideShadow}),o=ee({options:!0});let s=this.options||[];return 0==s.length&&this.tempOptions&&this.tempOptions.length>0&&(s=this.tempOptions),D`
411
411
  <div class=${n} style=${_t(e)}>
412
412
  <div
413
413
  class="options-scroll"
@@ -433,7 +433,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
433
433
  <temba-loading></temba-loading>
434
434
  </div>
435
435
  </div>
436
- `}}t([ct({type:Number})],Ks.prototype,"top",void 0),t([ct({type:Number})],Ks.prototype,"left",void 0),t([ct({type:Number})],Ks.prototype,"width",void 0),t([ct({type:Number,attribute:"static-width"})],Ks.prototype,"staticWidth",void 0),t([ct({type:Boolean,attribute:"anchor-right"})],Ks.prototype,"anchorRight",void 0),t([ct({type:Number})],Ks.prototype,"marginHorizontal",void 0),t([ct({type:Number})],Ks.prototype,"marginVertical",void 0),t([ct({type:Object})],Ks.prototype,"anchorTo",void 0),t([ct({type:Boolean})],Ks.prototype,"visible",void 0),t([ct({type:Boolean})],Ks.prototype,"block",void 0),t([ct({type:Number})],Ks.prototype,"scrollPct",void 0),t([ct({type:Number})],Ks.prototype,"cursorIndex",void 0),t([ct({type:Array})],Ks.prototype,"options",void 0),t([ct({type:Array})],Ks.prototype,"tempOptions",void 0),t([ct({type:Boolean})],Ks.prototype,"poppedTop",void 0),t([ct({type:Boolean})],Ks.prototype,"spaceSelect",void 0),t([ct({type:String})],Ks.prototype,"nameKey",void 0),t([ct({type:Boolean})],Ks.prototype,"loading",void 0),t([ct({type:Boolean})],Ks.prototype,"collapsed",void 0),t([ct({type:Boolean})],Ks.prototype,"hideShadow",void 0),t([ct({attribute:!1})],Ks.prototype,"getName",void 0),t([ct({attribute:!1})],Ks.prototype,"renderInputOption",void 0),t([ct({attribute:!1})],Ks.prototype,"renderOption",void 0),t([ct({attribute:!1})],Ks.prototype,"renderOptionName",void 0),t([ct({attribute:!1})],Ks.prototype,"renderOptionDetail",void 0),t([ct({type:Number})],Ks.prototype,"scrollHeight",void 0),t([ct({type:Boolean})],Ks.prototype,"triggerScroll",void 0);class Ys extends bt{constructor(t){if(super(t),this.it=R,t.type!==vt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===R||null==t)return this._t=void 0,this.it=t;if(t===N)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:[]}}}Ys.directiveName="unsafeHTML",Ys.resultType=1;const Js=yt(Ys),Xs=(t,e,i)=>{const n=t.substring(1);if("("===n[0])return!0;{const t=n.split(".")[0].toLowerCase();if(!i)return e.indexOf(t)>=0;for(const i of e)if(o=t,0===i.indexOf(o,0))return!0;return!1}var o},Qs=t=>t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t,tr=t=>{let e=0;for(const i of t)'"'===i&&e++;return e%2!=0};class er{constructor(t,e){this.expressionPrefix=t,this.allowedTopLevels=e}expressionContext(t){const e=this.findExpressions(t);if(0===e.length)return null;const i=e[e.length-1];return i.end<t.length||i.closed?null:i.text.substring(1)}autoCompleteContext(t){if(tr(t))return null;const e=[];let i="",n=!1,o=!1,s="";for(let r=t.length-1;r>=0;r--){const a=t[r];if(" "===a&&(n=!0),","===a&&(n=!0,"("!==e[e.length-1]&&e.push("(")),")"!==a||o||(n=!0,e.push("("),e.push("(")),'"'===a&&(o=!o),n&&("("!==a||o||("("===e[e.length-1]&&e.pop(),0===e.length&&(n=!1))),"("===a&&""===i&&(s="#"),!(n||o||"("===a&&""===i)){if(!Qs(a)&&"."!==a)break;i=a+i}}return i.match(/[A-Za-z][\w]*(\.[\w]+)*/)?s+i:null}functionContext(t){let e=tr(t)?4:6,i="",n="("===t[-1]?0:1;for(let o=t.length-1;o>=0;o--){const s=t[o];if("@"===s)return"";if(6===e)0!==n||!Qs(s)&&"."!==s?'"'===s?e=4:"("===s?n--:")"===s&&n++:(e=2,i=s+i);else if(2===e){if(!Qs(s)&&"."!==s)return i;i=s+i}else 4===e&&'"'===s&&(e=6)}return""}getContactFields(t){const e={},i=/((parent|child\.)*contact\.)*fields\.([a-z0-9_]+)/g,n=this.findExpressions(t);for(const t of n){let n;for(;n=i.exec(t.text);)e[n[3]]=!0}return Object.keys(e)}findExpressions(t){const e=[];let i=0,n=null,o=0;for(let s=0;s<t.length;s++){const r=t[s],a=s<t.length-1?t[s+1]:0,l=s<t.length-2?t[s+2]:0;if(0===i?r!==this.expressionPrefix||!Qs(a)&&"("!==a?r===this.expressionPrefix&&a===this.expressionPrefix&&(i=5):(i=1,n={start:s,end:null,text:r,closed:!1}):1===i?(Qs(r)?i=2:"("===r&&(i=3,o+=1),n.text+=r):2===i?n.text+=r:3===i?("("===r?o+=1:")"===r?o-=1:'"'===r&&(i=4),n.text+=r,0===o&&(n.end=s+1)):4===i?('"'===r&&(i=3),n.text+=r):5===i&&(i=0),2===i&&(!Qs(a)&&"."!==a||"."===a&&!Qs(l))&&(n.end=s+1),null!=n&&(null!=n.end||0===a)){const t=0===a;Xs(n.text,this.allowedTopLevels,t)&&(n.closed="("===n.text[1]&&0===o,n.end=s+1,e.push(n)),n=null,i=0}}return e}}var ir={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:"‌"},nr=Object.prototype.hasOwnProperty;function or(t){return i=t,(e=ir)&&nr.call(e,i)?ir[t]:t;var e,i}var sr=Object.prototype.hasOwnProperty;function rr(t){var e=[].slice.call(arguments,1);return e.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 ar=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function lr(t){return t.indexOf("\\")<0?t:t.replace(ar,"$1")}function hr(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function cr(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var dr=/&([a-z#][a-z0-9]{1,31});/gi,ur=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function pr(t,e){var i=0,n=or(e);return e!==n?n:35===e.charCodeAt(0)&&ur.test(e)&&hr(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?cr(i):t}function mr(t){return t.indexOf("&")<0?t:t.replace(dr,pr)}var fr=/[&<>"]/,gr=/[&<>"]/g,vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function yr(t){return vr[t]}function br(t){return fr.test(t)?t.replace(gr,yr):t}var _r={};function xr(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?xr(t,e+2):e}_r.blockquote_open=function(){return"<blockquote>\n"},_r.blockquote_close=function(t,e){return"</blockquote>"+wr(t,e)},_r.code=function(t,e){return t[e].block?"<pre><code>"+br(t[e].content)+"</code></pre>"+wr(t,e):"<code>"+br(t[e].content)+"</code>"},_r.fence=function(t,e,i,n,o){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=o.rules.fence_custom,l=s[0],a&&sr.call(a,l))return o.rules.fence_custom[s[0]](t,e,i,n,o);c=' class="'+d+br(mr(lr(r)))+'"'}return"<pre><code"+c+">"+(i.highlight&&i.highlight.apply(i.highlight,[h.content].concat(s))||br(h.content))+"</code></pre>"+wr(t,e)},_r.fence_custom={},_r.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},_r.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},_r.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+wr(t,e)},_r.bullet_list_open=function(){return"<ul>\n"},_r.bullet_list_close=function(t,e){return"</ul>"+wr(t,e)},_r.list_item_open=function(){return"<li>"},_r.list_item_close=function(){return"</li>\n"},_r.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},_r.ordered_list_close=function(t,e){return"</ol>"+wr(t,e)},_r.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},_r.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?wr(t,e):"")},_r.link_open=function(t,e,i){var n=t[e].title?' title="'+br(mr(t[e].title))+'"':"",o=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+br(t[e].href)+'"'+n+o+">"},_r.link_close=function(){return"</a>"},_r.image=function(t,e,i){var n=' src="'+br(t[e].src)+'"',o=t[e].title?' title="'+br(mr(t[e].title))+'"':"";return"<img"+n+(' alt="'+(t[e].alt?br(mr(lr(t[e].alt))):"")+'"')+o+(i.xhtmlOut?" /":"")+">"},_r.table_open=function(){return"<table>\n"},_r.table_close=function(){return"</table>\n"},_r.thead_open=function(){return"<thead>\n"},_r.thead_close=function(){return"</thead>\n"},_r.tbody_open=function(){return"<tbody>\n"},_r.tbody_close=function(){return"</tbody>\n"},_r.tr_open=function(){return"<tr>"},_r.tr_close=function(){return"</tr>\n"},_r.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},_r.th_close=function(){return"</th>"},_r.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},_r.td_close=function(){return"</td>"},_r.strong_open=function(){return"<strong>"},_r.strong_close=function(){return"</strong>"},_r.em_open=function(){return"<em>"},_r.em_close=function(){return"</em>"},_r.del_open=function(){return"<del>"},_r.del_close=function(){return"</del>"},_r.ins_open=function(){return"<ins>"},_r.ins_close=function(){return"</ins>"},_r.mark_open=function(){return"<mark>"},_r.mark_close=function(){return"</mark>"},_r.sub=function(t,e){return"<sub>"+br(t[e].content)+"</sub>"},_r.sup=function(t,e){return"<sup>"+br(t[e].content)+"</sup>"},_r.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},_r.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},_r.text=function(t,e){return br(t[e].content)},_r.htmlblock=function(t,e){return t[e].content},_r.htmltag=function(t,e){return t[e].content},_r.abbr_open=function(t,e){return'<abbr title="'+br(mr(t[e].title))+'">'},_r.abbr_close=function(){return"</abbr>"},_r.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),n="fnref"+i;return t[e].subId>0&&(n+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+n+'">['+i+"]</a></sup>"},_r.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'},_r.footnote_block_close=function(){return"</ol>\n</section>\n"},_r.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},_r.footnote_close=function(){return"</li>\n"},_r.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>'},_r.dl_open=function(){return"<dl>\n"},_r.dt_open=function(){return"<dt>"},_r.dd_open=function(){return"<dd>"},_r.dl_close=function(){return"</dl>\n"},_r.dt_close=function(){return"</dt>\n"},_r.dd_close=function(){return"</dd>\n"};var wr=_r.getBreak=function(t,e){return(e=xr(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function kr(){this.rules=rr({},_r),this.getBreak=_r.getBreak}function Sr(){this.__rules__=[],this.__cache__=null}function Er(t,e,i,n,o){this.src=t,this.env=n,this.options=i,this.parser=e,this.tokens=o,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 $r(t,e){var i,n,o,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===(o=t.src.charCodeAt(t.pos)))i++;else if(93===o&&0===--i){n=!0;break}t.parser.skipToken(t)}return n?(s=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,s}function Cr(t,e,i,n){var o,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=$r(o=new Er(t,e,i,n,[]),1))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&10!==o.src.charCodeAt(r);r++);return l=t.slice(2,s),0===(h=t.slice(s+2,r).trim()).length?-1:(n.abbreviations||(n.abbreviations={}),void 0===n.abbreviations[":"+l]&&(n.abbreviations[":"+l]=h),r)}function Tr(t){var e=mr(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function Ar(t,e){var i,n,o,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 o=Tr(lr(t.src.slice(s+1,e))),!!t.parser.validateLink(o)&&(t.pos=e+1,t.linkContent=o,!0);92===i&&e+1<r?e+=2:e++}return!1}for(n=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&&++n>1)break;if(41===i&&--n<0)break;e++}return s!==e&&(o=lr(t.src.slice(s,e)),!!t.parser.validateLink(o)&&(t.linkContent=o,t.pos=e,!0))}function Lr(t,e){var i,n=e,o=t.posMax,s=t.src.charCodeAt(e);if(34!==s&&39!==s&&40!==s)return!1;for(e++,40===s&&(s=41);e<o;){if((i=t.src.charCodeAt(e))===s)return t.pos=e+1,t.linkContent=lr(t.src.slice(n+1,e)),!0;92===i&&e+1<o?e+=2:e++}return!1}function Mr(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function Or(t,e,i,n){var o,s,r,a,l,h,c,d,u;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((s=$r(o=new Er(t,e,i,n,[]),0))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);if(!Ar(o,r))return-1;for(c=o.linkContent,h=r=o.pos,r+=1;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);for(r<a&&h!==r&&Lr(o,r)?(d=o.linkContent,r=o.pos):(d="",r=h);r<a&&32===o.src.charCodeAt(r);)r++;return r<a&&10!==o.src.charCodeAt(r)?-1:(u=Mr(t.slice(1,s)),void 0===n.references[u]&&(n.references[u]={title:d,href:c}),r)}kr.prototype.renderInline=function(t,e,i){for(var n=this.rules,o=t.length,s=0,r="";o--;)r+=n[t[s].type](t,s++,e,i,this);return r},kr.prototype.render=function(t,e,i){for(var n=this.rules,o=t.length,s=-1,r="";++s<o;)"inline"===t[s].type?r+=this.renderInline(t[s].children,e,i):r+=n[t[s].type](t,s,e,i,this);return r},Sr.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},Sr.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))}))}))},Sr.prototype.at=function(t,e,i){var n=this.__find__(t),o=i||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__[n].fn=e,this.__rules__[n].alt=o.alt||[],this.__cache__=null},Sr.prototype.before=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Sr.prototype.after=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},Sr.prototype.push=function(t,e,i){var n=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},Sr.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},Sr.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},Sr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},Er.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},Er.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},Er.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},Er.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};var zr=" \n()[]'\".,!?-";function Pr(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var Ir=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Dr=/\((c|tm|r|p)\)/gi,Nr={c:"©",r:"®",p:"§",tm:"™"};var Rr=/['"]/,Br=/['"]/g,qr=/[-\s()\[\]]/;function Ur(t,e){return!(e<0||e>=t.length)&&!qr.test(t[e])}function Zr(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var Fr=[["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,n,o,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(n=s[e].content;n.length&&!((o=Cr(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["references",function(t){var e,i,n,o,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(n=s[e].content;n.length&&!((o=Or(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["inline",function(t){var e,i,n,o=t.tokens;for(i=0,n=o.length;i<n;i++)"inline"===(e=o[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,n,o,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,o=r[e].count>0?r[e].count:1,n=0;n<o;n++)t.tokens.push({type:"footnote_anchor",id:e,subId:n,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,n,o,s,r,a,l,h,c,d,u,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(u="(^|["+zr.split("").map(Pr).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(Pr).join("|")+")($|["+zr.split("").map(Pr).join("")+"])",t.env.abbrRegExp=new RegExp(u,"g")),c=t.env.abbrRegExp,i=0,n=p.length;i<n;i++)if("inline"===p[i].type)for(e=(o=p[i].children).length-1;e>=0;e--)if("text"===(s=o[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=o=[].concat(o.slice(0,e),a,o.slice(e+1)))}}],["replacements",function(t){var e,i,n,o,s,r;if(t.options.typographer)for(s=t.tokens.length-1;s>=0;s--)if("inline"===t.tokens[s].type)for(e=(o=t.tokens[s].children).length-1;e>=0;e--)"text"===(i=o[e]).type&&(n=i.content,n=(r=n).indexOf("(")<0?r:r.replace(Dr,(function(t,e){return Nr[e.toLowerCase()]})),Ir.test(n)&&(n=n.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=n)}],["smartquotes",function(t){var e,i,n,o,s,r,a,l,h,c,d,u,p,m,f,g,v;if(t.options.typographer)for(v=[],f=t.tokens.length-1;f>=0;f--)if("inline"===t.tokens[f].type)for(g=t.tokens[f].children,v.length=0,e=0;e<g.length;e++)if("text"===(i=g[e]).type&&!Rr.test(i.text)){for(a=g[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,s=0,r=(n=i.content).length;t:for(;s<r&&(Br.lastIndex=s,o=Br.exec(n));)if(l=!Ur(n,o.index-1),s=o.index+1,m="'"===o[0],(h=!Ur(n,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?(g[c.token].content=Zr(g[c.token].content,c.pos,t.options.quotes[2]),i.content=Zr(i.content,o.index,t.options.quotes[3])):(g[c.token].content=Zr(g[c.token].content,c.pos,t.options.quotes[0]),i.content=Zr(i.content,o.index,t.options.quotes[1])),v.length=p;continue t}d?v.push({token:e,pos:o.index,single:m,level:a}):u&&m&&(i.content=Zr(i.content,o.index,"’"))}else m&&(i.content=Zr(i.content,o.index,"’"))}}]];function Vr(){this.options={},this.ruler=new Sr;for(var t=0;t<Fr.length;t++)this.ruler.push(Fr[t][0],Fr[t][1])}function jr(t,e,i,n,o){var s,r,a,l,h,c,d;for(this.src=t,this.parser=e,this.options=i,this.env=n,this.tokens=o,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 Hr(t,e){var i,n,o;return(n=t.bMarks[e]+t.tShift[e])>=(o=t.eMarks[e])||42!==(i=t.src.charCodeAt(n++))&&45!==i&&43!==i||n<o&&32!==t.src.charCodeAt(n)?-1:n}function Wr(t,e){var i,n=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(n+1>=o)return-1;if((i=t.src.charCodeAt(n++))<48||i>57)return-1;for(;;){if(n>=o)return-1;if(!((i=t.src.charCodeAt(n++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return n<o&&32!==t.src.charCodeAt(n)?-1:n}Vr.prototype.process=function(t){var e,i,n;for(e=0,i=(n=this.ruler.getRules("")).length;e<i;e++)n[e](t)},jr.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},jr.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},jr.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},jr.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},jr.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},jr.prototype.getLines=function(t,e,i,n){var o,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=n?this.eMarks[h]+1:this.eMarks[h],this.src.slice(s,r);for(a=new Array(e-t),o=0;h<e;h++,o++)(l=this.tShift[h])>i&&(l=i),l<0&&(l=0),s=this.bMarks[h]+l,r=h+1<e||n?this.eMarks[h]+1:this.eMarks[h],a[o]=this.src.slice(s,r);return a.join("")};var Gr={};["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){Gr[t]=!0}));var Kr=/^<([a-zA-Z]{1,15})[\s\/>]/,Yr=/^<\/([a-zA-Z]{1,15})[\s>]/;function Jr(t,e){var i=t.bMarks[e]+t.blkIndent,n=t.eMarks[e];return t.src.substr(i,n-i)}function Xr(t,e){var i,n,o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];return o>=s||126!==(n=t.src.charCodeAt(o++))&&58!==n||o===(i=t.skipSpaces(o))||i>=s?-1:i}var Qr=[["code",function(t,e,i){var n,o;if(t.tShift[e]-t.blkIndent<4)return!1;for(o=n=e+1;n<i;)if(t.isEmpty(n))n++;else{if(!(t.tShift[n]-t.blkIndent>=4))break;o=++n}return t.line=n,t.tokens.push({type:"code",content:t.getLines(e,o,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,n){var o,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!==(o=t.src.charCodeAt(c))&&96!==o)return!1;if(l=c,(s=(c=t.skipChars(c,o))-l)<3)return!1;if((r=t.src.slice(c,d).trim()).indexOf("`")>=0)return!1;if(n)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)===o&&!(t.tShift[a]-t.blkIndent>=4||(c=t.skipChars(c,o))-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,n){var o,s,r,a,l,h,c,d,u,p,m,f=t.bMarks[e]+t.tShift[e],g=t.eMarks[e];if(f>g)return!1;if(62!==t.src.charCodeAt(f++))return!1;if(t.level>=t.options.maxNesting)return!1;if(n)return!0;for(32===t.src.charCodeAt(f)&&f++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r=[t.tShift[e]],t.tShift[e]=f-t.bMarks[e],d=t.parser.ruler.getRules("blockquote"),o=e+1;o<i&&!((f=t.bMarks[o]+t.tShift[o])>=(g=t.eMarks[o]));o++)if(62!==t.src.charCodeAt(f++)){if(s)break;for(m=!1,u=0,p=d.length;u<p;u++)if(d[u](t,o,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[o]),r.push(t.tShift[o]),t.tShift[o]=-1337}else 32===t.src.charCodeAt(f)&&f++,a.push(t.bMarks[o]),t.bMarks[o]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r.push(t.tShift[o]),t.tShift[o]=f-t.bMarks[o];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,o),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,n){var o,s,r,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(o=t.src.charCodeAt(a++))&&45!==o&&95!==o)return!1;for(s=1;a<l;){if((r=t.src.charCodeAt(a++))!==o&&32!==r)return!1;r===o&&s++}return!(s<3)&&(n||(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,n){var o,s,r,a,l,h,c,d,u,p,m,f,g,v,y,b,_,x,w,k,S,E=!0;if((d=Wr(t,e))>=0)f=!0;else{if(!((d=Hr(t,e))>=0))return!1;f=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(d-1),n)return!0;for(v=t.tokens.length,f?(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:b=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:b=[e,0],level:t.level++}),o=e,y=!1,x=t.parser.ruler.getRules("list");!(!(o<i)||((u=(g=t.skipSpaces(d))>=t.eMarks[o]?1:g-d)>4&&(u=1),u<1&&(u=1),s=d-t.bMarks[o]+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]=g-t.bMarks[e],t.blkIndent=s,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!y||(E=!1),y=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}),o=e=t.line,_[1]=o,g=t.bMarks[e],o>=i)||t.isEmpty(o)||t.tShift[o]<t.blkIndent);){for(S=!1,w=0,k=x.length;w<k;w++)if(x[w](t,o,i,!0)){S=!0;break}if(S)break;if(f){if((d=Wr(t,o))<0)break}else if((d=Hr(t,o))<0)break;if(m!==t.src.charCodeAt(d-1))break}return t.tokens.push({type:f?"ordered_list_close":"bullet_list_close",level:--t.level}),b[1]=o,t.line=o,E&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"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,n){var o,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))&&(n||(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++}),o=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]=o,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,n){var o,s,r,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(o=t.src.charCodeAt(a))||a>=l)return!1;for(s=1,o=t.src.charCodeAt(++a);35===o&&a<l&&s<=6;)s++,o=t.src.charCodeAt(++a);return!(s>6||a<l&&32!==o)&&(n||(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 n,o,s,r=e+1;return!(r>=i)&&(!(t.tShift[r]<t.blkIndent)&&(!(t.tShift[r]-t.blkIndent>3)&&(!((o=t.bMarks[r]+t.tShift[r])>=(s=t.eMarks[r]))&&((45===(n=t.src.charCodeAt(o))||61===n)&&(o=t.skipChars(o,n),!((o=t.skipSpaces(o))<s)&&(o=t.bMarks[e]+t.tShift[e],t.line=r+1,t.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(o,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,n){var o,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===(o=t.src.charCodeAt(a+1))||63===o){if(n)return!0}else{if(47!==o&&!function(t){var e=32|t;return e>=97&&e<=122}(o))return!1;if(47===o){if(!(s=t.src.slice(a,l).match(Yr)))return!1}else if(!(s=t.src.slice(a,l).match(Kr)))return!1;if(!0!==Gr[s[1].toLowerCase()])return!1;if(n)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,n){var o,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!==(o=t.src.charCodeAt(r))&&45!==o&&58!==o)return!1;if(s=Jr(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=Jr(t,e).trim()).indexOf("|"))return!1;if(h=s.replace(/^\||\|$/g,"").split("|"),d.length!==h.length)return!1;if(n)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=Jr(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,n){var o,s,r,a,l,h,c,d,u,p,m,f,g,v;if(n)return!(t.ddIndent<0)&&Xr(t,e)>=0;if(c=e+1,t.isEmpty(c)&&++c>i)return!1;if(t.tShift[c]<t.blkIndent)return!1;if((o=Xr(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,g=!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++}),f=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]=o-t.bMarks[s],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,s,i,!0),t.tight&&!g||(v=!1),g=t.line-s>1&&t.isEmpty(t.line-1),t.tShift[s]=m,t.tight=f,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((o=Xr(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((o=Xr(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,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"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,n,o,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(o=!1,s=0,r=a.length;s<r;s++)if(a[s](t,l,i,!0)){o=!0;break}if(o)break}return n=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,n.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:n,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function ta(){this.ruler=new Sr;for(var t=0;t<Qr.length;t++)this.ruler.push(Qr[t][0],Qr[t][1],{alt:(Qr[t][2]||[]).slice()})}ta.prototype.tokenize=function(t,e,i){for(var n,o=this.ruler.getRules(""),s=o.length,r=e,a=!1;r<i&&(t.line=r=t.skipEmptyLines(r),!(r>=i))&&!(t.tShift[r]<t.blkIndent);){for(n=0;n<s&&!o[n](t,r,i,!1);n++);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 ea=/[\n\t]/g,ia=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,na=/\u00a0/g;function oa(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}}ta.prototype.parse=function(t,e,i,n){var o,s=0,r=0;if(!t)return[];(t=(t=t.replace(na," ")).replace(ia,"\n")).indexOf("\t")>=0&&(t=t.replace(ea,(function(e,i){var n;return 10===t.charCodeAt(i)?(s=i+1,r=0,e):(n=" ".slice((i-s-r)%4),r=i-s+1,n)}))),o=new jr(t,this,e,i,n),this.tokenize(o,o.line,o.lineMax)};for(var sa=[],ra=0;ra<256;ra++)sa.push(0);function aa(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function la(t,e){var i,n,o,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),(o=s-e)>=4?r=a=!1:(32!==(n=s<l?t.src.charCodeAt(s):-1)&&10!==n||(r=!1),32!==i&&10!==i||(a=!1),95===h&&(aa(i)&&(r=!1),aa(n)&&(a=!1))),{can_open:r,can_close:a,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){sa[t.charCodeAt(0)]=1}));var ha=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var ca=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var da=["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"],ua=/^<([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])?)*)>/,pa=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function ma(t,e){return t=t.source,e=e||"",function i(n,o){return n?(o=o.source||o,t=t.replace(n,o),i):new RegExp(t,e)}}var fa=ma(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),ga=ma(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",fa)(),va=ma(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",ga)(),ya=ma(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",va)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var ba=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,_a=/^&([a-z][a-z0-9]{1,31});/i;var xa=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!oa(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,n,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;if(i=t.pending.length-1,n=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(o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}],["escape",function(t,e){var i,n=t.pos,o=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(++n<o){if((i=t.src.charCodeAt(n))<256&&0!==sa[i])return e||(t.pending+=t.src[n]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,n,o,s,r,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,n=t.posMax;a<n&&96===t.src.charCodeAt(a);)a++;for(o=t.src.slice(i,a),s=r=a;-1!==(s=t.src.indexOf("`",r));){for(r=s+1;r<n&&96===t.src.charCodeAt(r);)r++;if(r-s===o.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+=o),t.pos+=o.length,!0}],["del",function(t,e){var i,n,o,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(n=l+2;n<a&&126===t.src.charCodeAt(n);)n++;if(n>l+3)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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(n=l+2;n<a&&43===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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(n=l+2;n<a&&61===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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=la(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(n=(l=la(t,t.pos)).delims,l.can_close){for(s=a.pop(),r=n;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,o=!0;break}t.pos+=n;continue}l.can_open&&a.push(n),t.pos+=n}return o?(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,n,o=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=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:n.replace(ha,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["sup",function(t,e){var i,n,o=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=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:n.replace(ca,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["links",function(t,e){var i,n,o,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,(n=$r(t,p))<0)return!1;if((a=n+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,Ar(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&&Lr(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=$r(t,a))>=0?o=t.src.slice(p,a++):a=p-1),o||(void 0===o&&(a=n+1),o=t.src.slice(i,n)),!(l=t.env.references[Mr(o)]))return t.pos=d,!1;s=l.href,r=l.title}return e||(t.pos=i,t.posMax=n,c?t.push({type:"image",src:s,title:r,alt:t.src.substr(i,n-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,n,o,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,!((n=$r(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),o=t.env.footnotes.list.length,t.pos=i,t.posMax=n,t.push({type:"footnote_ref",id:o,level:t.level}),t.linkLevel++,s=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[o]={tokens:t.tokens.splice(s)},t.linkLevel--),t.pos=n+1,t.posMax=r,!0)))))}],["footnote_ref",function(t,e){var i,n,o,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(n=a+2;n<r;n++){if(32===t.src.charCodeAt(n))return!1;if(10===t.src.charCodeAt(n))return!1;if(93===t.src.charCodeAt(n))break}return n!==a+2&&(!(n>=r)&&(n++,i=t.src.slice(a+2,n-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(o=t.env.footnotes.list.length,t.env.footnotes.list[o]={label:i,count:0},t.env.footnotes.refs[":"+i]=o):o=t.env.footnotes.refs[":"+i],s=t.env.footnotes.list[o].count,t.env.footnotes.list[o].count++,t.push({type:"footnote_ref",id:o,subId:s,level:t.level})),t.pos=n,t.posMax=r,!0)))}],["autolink",function(t,e){var i,n,o,s,r,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((n=i.match(pa))?!(da.indexOf(n[1].toLowerCase())<0)&&(r=Tr(s=n[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+=n[0].length,!0)):!!(o=i.match(ua))&&(r=Tr("mailto:"+(s=o[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+=o[0].length,!0))))}],["htmltag",function(t,e){var i,n,o,s=t.pos;return!!t.options.html&&(o=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=o)&&(!(33!==(i=t.src.charCodeAt(s+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(n=t.src.slice(s).match(ya))&&(e||t.push({type:"htmltag",content:t.src.slice(s,s+n[0].length),level:t.level}),t.pos+=n[0].length,!0))))}],["entity",function(t,e){var i,n,o=t.pos,s=t.posMax;if(38!==t.src.charCodeAt(o))return!1;if(o+1<s)if(35===t.src.charCodeAt(o+1)){if(n=t.src.slice(o).match(ba))return e||(i="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),t.pending+=hr(i)?cr(i):cr(65533)),t.pos+=n[0].length,!0}else if(n=t.src.slice(o).match(_a)){var r=or(n[1]);if(n[1]!==r)return e||(t.pending+=r),t.pos+=n[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function wa(){this.ruler=new Sr;for(var t=0;t<xa.length;t++)this.ruler.push(xa[t][0],xa[t][1]);this.validateLink=ka}function ka(t){var e=t.trim().toLowerCase();return-1===(e=mr(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}wa.prototype.skipToken=function(t){var e,i,n=this.ruler.getRules(""),o=n.length,s=t.pos;if((i=t.cacheGet(s))>0)t.pos=i;else{for(e=0;e<o;e++)if(n[e](t,!0))return void t.cacheSet(s,t.pos);t.pos++,t.cacheSet(s,t.pos)}},wa.prototype.tokenize=function(t){for(var e,i,n=this.ruler.getRules(""),o=n.length,s=t.posMax;t.pos<s;){for(i=0;i<o&&!(e=n[i](t,!1));i++);if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},wa.prototype.parse=function(t,e,i,n){var o=new Er(t,this,e,i,n);this.tokenize(o)};var Sa={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 Ea(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 $a(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 wa,this.block=new ta,this.core=new Vr,this.renderer=new kr,this.ruler=new Sr,this.options={},this.configure(Sa[t]),this.set(e||{})}$a.prototype.set=function(t){rr(this.options,t)},$a.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)}))},$a.prototype.use=function(t,e){return t(this,e),this},$a.prototype.parse=function(t,e){var i=new Ea(this,t,e);return this.core.process(i),i.tokens},$a.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},$a.prototype.parseInline=function(t,e){var i=new Ea(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},$a.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Ca=new $a,Ta=new er("@",["contact","fields","globals","urns"]),Aa=new er("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]);const La=yt(class extends bt{constructor(t){if(super(t),t.type!==vt)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return void 0===this.value&&(this.value=t),D`${Js(Ca.render(this.value))}`}}),Ma=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),n=t.signature.substr(0,i),o=t.signature.substr(i);return D`
436
+ `}}t([ct({type:Number})],Gs.prototype,"top",void 0),t([ct({type:Number})],Gs.prototype,"left",void 0),t([ct({type:Number})],Gs.prototype,"width",void 0),t([ct({type:Number,attribute:"static-width"})],Gs.prototype,"staticWidth",void 0),t([ct({type:Boolean,attribute:"anchor-right"})],Gs.prototype,"anchorRight",void 0),t([ct({type:Number})],Gs.prototype,"marginHorizontal",void 0),t([ct({type:Number})],Gs.prototype,"marginVertical",void 0),t([ct({type:Object})],Gs.prototype,"anchorTo",void 0),t([ct({type:Boolean})],Gs.prototype,"visible",void 0),t([ct({type:Boolean})],Gs.prototype,"block",void 0),t([ct({type:Number})],Gs.prototype,"scrollPct",void 0),t([ct({type:Number})],Gs.prototype,"cursorIndex",void 0),t([ct({type:Array})],Gs.prototype,"options",void 0),t([ct({type:Array})],Gs.prototype,"tempOptions",void 0),t([ct({type:Boolean})],Gs.prototype,"poppedTop",void 0),t([ct({type:Boolean})],Gs.prototype,"spaceSelect",void 0),t([ct({type:String})],Gs.prototype,"nameKey",void 0),t([ct({type:Boolean})],Gs.prototype,"loading",void 0),t([ct({type:Boolean})],Gs.prototype,"collapsed",void 0),t([ct({type:Boolean})],Gs.prototype,"hideShadow",void 0),t([ct({attribute:!1})],Gs.prototype,"getName",void 0),t([ct({attribute:!1})],Gs.prototype,"renderInputOption",void 0),t([ct({attribute:!1})],Gs.prototype,"renderOption",void 0),t([ct({attribute:!1})],Gs.prototype,"renderOptionName",void 0),t([ct({attribute:!1})],Gs.prototype,"renderOptionDetail",void 0),t([ct({type:Number})],Gs.prototype,"scrollHeight",void 0),t([ct({type:Boolean})],Gs.prototype,"triggerScroll",void 0);class Ks extends bt{constructor(t){if(super(t),this.it=R,t.type!==vt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===R||null==t)return this._t=void 0,this.it=t;if(t===N)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:[]}}}Ks.directiveName="unsafeHTML",Ks.resultType=1;const Ys=yt(Ks),Js=(t,e,i)=>{const n=t.substring(1);if("("===n[0])return!0;{const t=n.split(".")[0].toLowerCase();if(!i)return e.indexOf(t)>=0;for(const i of e)if(o=t,0===i.indexOf(o,0))return!0;return!1}var o},Xs=t=>t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t,Qs=t=>{let e=0;for(const i of t)'"'===i&&e++;return e%2!=0};class tr{constructor(t,e){this.expressionPrefix=t,this.allowedTopLevels=e}expressionContext(t){const e=this.findExpressions(t);if(0===e.length)return null;const i=e[e.length-1];return i.end<t.length||i.closed?null:i.text.substring(1)}autoCompleteContext(t){if(Qs(t))return null;const e=[];let i="",n=!1,o=!1,s="";for(let r=t.length-1;r>=0;r--){const a=t[r];if(" "===a&&(n=!0),","===a&&(n=!0,"("!==e[e.length-1]&&e.push("(")),")"!==a||o||(n=!0,e.push("("),e.push("(")),'"'===a&&(o=!o),n&&("("!==a||o||("("===e[e.length-1]&&e.pop(),0===e.length&&(n=!1))),"("===a&&""===i&&(s="#"),!(n||o||"("===a&&""===i)){if(!Xs(a)&&"."!==a)break;i=a+i}}return i.match(/[A-Za-z][\w]*(\.[\w]+)*/)?s+i:null}functionContext(t){let e=Qs(t)?4:6,i="",n="("===t[-1]?0:1;for(let o=t.length-1;o>=0;o--){const s=t[o];if("@"===s)return"";if(6===e)0!==n||!Xs(s)&&"."!==s?'"'===s?e=4:"("===s?n--:")"===s&&n++:(e=2,i=s+i);else if(2===e){if(!Xs(s)&&"."!==s)return i;i=s+i}else 4===e&&'"'===s&&(e=6)}return""}getContactFields(t){const e={},i=/((parent|child\.)*contact\.)*fields\.([a-z0-9_]+)/g,n=this.findExpressions(t);for(const t of n){let n;for(;n=i.exec(t.text);)e[n[3]]=!0}return Object.keys(e)}findExpressions(t){const e=[];let i=0,n=null,o=0;for(let s=0;s<t.length;s++){const r=t[s],a=s<t.length-1?t[s+1]:0,l=s<t.length-2?t[s+2]:0;if(0===i?r!==this.expressionPrefix||!Xs(a)&&"("!==a?r===this.expressionPrefix&&a===this.expressionPrefix&&(i=5):(i=1,n={start:s,end:null,text:r,closed:!1}):1===i?(Xs(r)?i=2:"("===r&&(i=3,o+=1),n.text+=r):2===i?n.text+=r:3===i?("("===r?o+=1:")"===r?o-=1:'"'===r&&(i=4),n.text+=r,0===o&&(n.end=s+1)):4===i?('"'===r&&(i=3),n.text+=r):5===i&&(i=0),2===i&&(!Xs(a)&&"."!==a||"."===a&&!Xs(l))&&(n.end=s+1),null!=n&&(null!=n.end||0===a)){const t=0===a;Js(n.text,this.allowedTopLevels,t)&&(n.closed="("===n.text[1]&&0===o,n.end=s+1,e.push(n)),n=null,i=0}}return e}}var er={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:"‌"},ir=Object.prototype.hasOwnProperty;function nr(t){return i=t,(e=er)&&ir.call(e,i)?er[t]:t;var e,i}var or=Object.prototype.hasOwnProperty;function sr(t){var e=[].slice.call(arguments,1);return e.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 rr=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function ar(t){return t.indexOf("\\")<0?t:t.replace(rr,"$1")}function lr(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function hr(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}var cr=/&([a-z#][a-z0-9]{1,31});/gi,dr=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function ur(t,e){var i=0,n=nr(e);return e!==n?n:35===e.charCodeAt(0)&&dr.test(e)&&lr(i="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?hr(i):t}function pr(t){return t.indexOf("&")<0?t:t.replace(cr,ur)}var mr=/[&<>"]/,fr=/[&<>"]/g,gr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function vr(t){return gr[t]}function yr(t){return mr.test(t)?t.replace(fr,vr):t}var br={};function _r(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?_r(t,e+2):e}br.blockquote_open=function(){return"<blockquote>\n"},br.blockquote_close=function(t,e){return"</blockquote>"+xr(t,e)},br.code=function(t,e){return t[e].block?"<pre><code>"+yr(t[e].content)+"</code></pre>"+xr(t,e):"<code>"+yr(t[e].content)+"</code>"},br.fence=function(t,e,i,n,o){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=o.rules.fence_custom,l=s[0],a&&or.call(a,l))return o.rules.fence_custom[s[0]](t,e,i,n,o);c=' class="'+d+yr(pr(ar(r)))+'"'}return"<pre><code"+c+">"+(i.highlight&&i.highlight.apply(i.highlight,[h.content].concat(s))||yr(h.content))+"</code></pre>"+xr(t,e)},br.fence_custom={},br.heading_open=function(t,e){return"<h"+t[e].hLevel+">"},br.heading_close=function(t,e){return"</h"+t[e].hLevel+">\n"},br.hr=function(t,e,i){return(i.xhtmlOut?"<hr />":"<hr>")+xr(t,e)},br.bullet_list_open=function(){return"<ul>\n"},br.bullet_list_close=function(t,e){return"</ul>"+xr(t,e)},br.list_item_open=function(){return"<li>"},br.list_item_close=function(){return"</li>\n"},br.ordered_list_open=function(t,e){var i=t[e];return"<ol"+(i.order>1?' start="'+i.order+'"':"")+">\n"},br.ordered_list_close=function(t,e){return"</ol>"+xr(t,e)},br.paragraph_open=function(t,e){return t[e].tight?"":"<p>"},br.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?xr(t,e):"")},br.link_open=function(t,e,i){var n=t[e].title?' title="'+yr(pr(t[e].title))+'"':"",o=i.linkTarget?' target="'+i.linkTarget+'"':"";return'<a href="'+yr(t[e].href)+'"'+n+o+">"},br.link_close=function(){return"</a>"},br.image=function(t,e,i){var n=' src="'+yr(t[e].src)+'"',o=t[e].title?' title="'+yr(pr(t[e].title))+'"':"";return"<img"+n+(' alt="'+(t[e].alt?yr(pr(ar(t[e].alt))):"")+'"')+o+(i.xhtmlOut?" /":"")+">"},br.table_open=function(){return"<table>\n"},br.table_close=function(){return"</table>\n"},br.thead_open=function(){return"<thead>\n"},br.thead_close=function(){return"</thead>\n"},br.tbody_open=function(){return"<tbody>\n"},br.tbody_close=function(){return"</tbody>\n"},br.tr_open=function(){return"<tr>"},br.tr_close=function(){return"</tr>\n"},br.th_open=function(t,e){var i=t[e];return"<th"+(i.align?' style="text-align:'+i.align+'"':"")+">"},br.th_close=function(){return"</th>"},br.td_open=function(t,e){var i=t[e];return"<td"+(i.align?' style="text-align:'+i.align+'"':"")+">"},br.td_close=function(){return"</td>"},br.strong_open=function(){return"<strong>"},br.strong_close=function(){return"</strong>"},br.em_open=function(){return"<em>"},br.em_close=function(){return"</em>"},br.del_open=function(){return"<del>"},br.del_close=function(){return"</del>"},br.ins_open=function(){return"<ins>"},br.ins_close=function(){return"</ins>"},br.mark_open=function(){return"<mark>"},br.mark_close=function(){return"</mark>"},br.sub=function(t,e){return"<sub>"+yr(t[e].content)+"</sub>"},br.sup=function(t,e){return"<sup>"+yr(t[e].content)+"</sup>"},br.hardbreak=function(t,e,i){return i.xhtmlOut?"<br />\n":"<br>\n"},br.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},br.text=function(t,e){return yr(t[e].content)},br.htmlblock=function(t,e){return t[e].content},br.htmltag=function(t,e){return t[e].content},br.abbr_open=function(t,e){return'<abbr title="'+yr(pr(t[e].title))+'">'},br.abbr_close=function(){return"</abbr>"},br.footnote_ref=function(t,e){var i=Number(t[e].id+1).toString(),n="fnref"+i;return t[e].subId>0&&(n+=":"+t[e].subId),'<sup class="footnote-ref"><a href="#fn'+i+'" id="'+n+'">['+i+"]</a></sup>"},br.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'},br.footnote_block_close=function(){return"</ol>\n</section>\n"},br.footnote_open=function(t,e){return'<li id="fn'+Number(t[e].id+1).toString()+'" class="footnote-item">'},br.footnote_close=function(){return"</li>\n"},br.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>'},br.dl_open=function(){return"<dl>\n"},br.dt_open=function(){return"<dt>"},br.dd_open=function(){return"<dd>"},br.dl_close=function(){return"</dl>\n"},br.dt_close=function(){return"</dt>\n"},br.dd_close=function(){return"</dd>\n"};var xr=br.getBreak=function(t,e){return(e=_r(t,e))<t.length&&"list_item_close"===t[e].type?"":"\n"};function wr(){this.rules=sr({},br),this.getBreak=br.getBreak}function kr(){this.__rules__=[],this.__cache__=null}function Sr(t,e,i,n,o){this.src=t,this.env=n,this.options=i,this.parser=e,this.tokens=o,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 Er(t,e){var i,n,o,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===(o=t.src.charCodeAt(t.pos)))i++;else if(93===o&&0===--i){n=!0;break}t.parser.skipToken(t)}return n?(s=t.pos,t.labelUnmatchedScopes=0):t.labelUnmatchedScopes=i-1,t.pos=a,t.isInLabel=l,s}function $r(t,e,i,n){var o,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=Er(o=new Sr(t,e,i,n,[]),1))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&10!==o.src.charCodeAt(r);r++);return l=t.slice(2,s),0===(h=t.slice(s+2,r).trim()).length?-1:(n.abbreviations||(n.abbreviations={}),void 0===n.abbreviations[":"+l]&&(n.abbreviations[":"+l]=h),r)}function Cr(t){var e=pr(t);try{e=decodeURI(e)}catch(t){}return encodeURI(e)}function Tr(t,e){var i,n,o,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 o=Cr(ar(t.src.slice(s+1,e))),!!t.parser.validateLink(o)&&(t.pos=e+1,t.linkContent=o,!0);92===i&&e+1<r?e+=2:e++}return!1}for(n=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&&++n>1)break;if(41===i&&--n<0)break;e++}return s!==e&&(o=ar(t.src.slice(s,e)),!!t.parser.validateLink(o)&&(t.linkContent=o,t.pos=e,!0))}function Ar(t,e){var i,n=e,o=t.posMax,s=t.src.charCodeAt(e);if(34!==s&&39!==s&&40!==s)return!1;for(e++,40===s&&(s=41);e<o;){if((i=t.src.charCodeAt(e))===s)return t.pos=e+1,t.linkContent=ar(t.src.slice(n+1,e)),!0;92===i&&e+1<o?e+=2:e++}return!1}function Lr(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function Mr(t,e,i,n){var o,s,r,a,l,h,c,d,u;if(91!==t.charCodeAt(0))return-1;if(-1===t.indexOf("]:"))return-1;if((s=Er(o=new Sr(t,e,i,n,[]),0))<0||58!==t.charCodeAt(s+1))return-1;for(a=o.posMax,r=s+2;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);if(!Tr(o,r))return-1;for(c=o.linkContent,h=r=o.pos,r+=1;r<a&&(32===(l=o.src.charCodeAt(r))||10===l);r++);for(r<a&&h!==r&&Ar(o,r)?(d=o.linkContent,r=o.pos):(d="",r=h);r<a&&32===o.src.charCodeAt(r);)r++;return r<a&&10!==o.src.charCodeAt(r)?-1:(u=Lr(t.slice(1,s)),void 0===n.references[u]&&(n.references[u]={title:d,href:c}),r)}wr.prototype.renderInline=function(t,e,i){for(var n=this.rules,o=t.length,s=0,r="";o--;)r+=n[t[s].type](t,s++,e,i,this);return r},wr.prototype.render=function(t,e,i){for(var n=this.rules,o=t.length,s=-1,r="";++s<o;)"inline"===t[s].type?r+=this.renderInline(t[s].children,e,i):r+=n[t[s].type](t,s,e,i,this);return r},kr.prototype.__find__=function(t){for(var e=this.__rules__.length,i=-1;e--;)if(this.__rules__[++i].name===t)return i;return-1},kr.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))}))}))},kr.prototype.at=function(t,e,i){var n=this.__find__(t),o=i||{};if(-1===n)throw new Error("Parser rule not found: "+t);this.__rules__[n].fn=e,this.__rules__[n].alt=o.alt||[],this.__cache__=null},kr.prototype.before=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},kr.prototype.after=function(t,e,i,n){var o=this.__find__(t),s=n||{};if(-1===o)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:i,alt:s.alt||[]}),this.__cache__=null},kr.prototype.push=function(t,e,i){var n=i||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},kr.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},kr.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},kr.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},Sr.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},Sr.prototype.push=function(t){this.pending&&this.pushPending(),this.tokens.push(t),this.pendingLevel=this.level},Sr.prototype.cacheSet=function(t,e){for(var i=this.cache.length;i<=t;i++)this.cache.push(0);this.cache[t]=e},Sr.prototype.cacheGet=function(t){return t<this.cache.length?this.cache[t]:0};var Or=" \n()[]'\".,!?-";function zr(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var Pr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Ir=/\((c|tm|r|p)\)/gi,Dr={c:"©",r:"®",p:"§",tm:"™"};var Nr=/['"]/,Rr=/['"]/g,Br=/[-\s()\[\]]/;function qr(t,e){return!(e<0||e>=t.length)&&!Br.test(t[e])}function Ur(t,e,i){return t.substr(0,e)+i+t.substr(e+1)}var Zr=[["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,n,o,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(n=s[e].content;n.length&&!((o=$r(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["references",function(t){var e,i,n,o,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(n=s[e].content;n.length&&!((o=Mr(n,t.inline,t.options,t.env))<0);)n=n.slice(o).trim();s[e].content=n,n.length||(s[e-1].tight=!0,s[e+1].tight=!0)}}],["inline",function(t){var e,i,n,o=t.tokens;for(i=0,n=o.length;i<n;i++)"inline"===(e=o[i]).type&&t.inline.parse(e.content,t.options,t.env,e.children)}],["footnote_tail",function(t){var e,i,n,o,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,o=r[e].count>0?r[e].count:1,n=0;n<o;n++)t.tokens.push({type:"footnote_anchor",id:e,subId:n,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,n,o,s,r,a,l,h,c,d,u,p=t.tokens;if(t.env.abbreviations)for(t.env.abbrRegExp||(u="(^|["+Or.split("").map(zr).join("")+"])("+Object.keys(t.env.abbreviations).map((function(t){return t.substr(1)})).sort((function(t,e){return e.length-t.length})).map(zr).join("|")+")($|["+Or.split("").map(zr).join("")+"])",t.env.abbrRegExp=new RegExp(u,"g")),c=t.env.abbrRegExp,i=0,n=p.length;i<n;i++)if("inline"===p[i].type)for(e=(o=p[i].children).length-1;e>=0;e--)if("text"===(s=o[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=o=[].concat(o.slice(0,e),a,o.slice(e+1)))}}],["replacements",function(t){var e,i,n,o,s,r;if(t.options.typographer)for(s=t.tokens.length-1;s>=0;s--)if("inline"===t.tokens[s].type)for(e=(o=t.tokens[s].children).length-1;e>=0;e--)"text"===(i=o[e]).type&&(n=i.content,n=(r=n).indexOf("(")<0?r:r.replace(Ir,(function(t,e){return Dr[e.toLowerCase()]})),Pr.test(n)&&(n=n.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=n)}],["smartquotes",function(t){var e,i,n,o,s,r,a,l,h,c,d,u,p,m,f,g,v;if(t.options.typographer)for(v=[],f=t.tokens.length-1;f>=0;f--)if("inline"===t.tokens[f].type)for(g=t.tokens[f].children,v.length=0,e=0;e<g.length;e++)if("text"===(i=g[e]).type&&!Nr.test(i.text)){for(a=g[e].level,p=v.length-1;p>=0&&!(v[p].level<=a);p--);v.length=p+1,s=0,r=(n=i.content).length;t:for(;s<r&&(Rr.lastIndex=s,o=Rr.exec(n));)if(l=!qr(n,o.index-1),s=o.index+1,m="'"===o[0],(h=!qr(n,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?(g[c.token].content=Ur(g[c.token].content,c.pos,t.options.quotes[2]),i.content=Ur(i.content,o.index,t.options.quotes[3])):(g[c.token].content=Ur(g[c.token].content,c.pos,t.options.quotes[0]),i.content=Ur(i.content,o.index,t.options.quotes[1])),v.length=p;continue t}d?v.push({token:e,pos:o.index,single:m,level:a}):u&&m&&(i.content=Ur(i.content,o.index,"’"))}else m&&(i.content=Ur(i.content,o.index,"’"))}}]];function Fr(){this.options={},this.ruler=new kr;for(var t=0;t<Zr.length;t++)this.ruler.push(Zr[t][0],Zr[t][1])}function Vr(t,e,i,n,o){var s,r,a,l,h,c,d;for(this.src=t,this.parser=e,this.options=i,this.env=n,this.tokens=o,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 jr(t,e){var i,n,o;return(n=t.bMarks[e]+t.tShift[e])>=(o=t.eMarks[e])||42!==(i=t.src.charCodeAt(n++))&&45!==i&&43!==i||n<o&&32!==t.src.charCodeAt(n)?-1:n}function Hr(t,e){var i,n=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(n+1>=o)return-1;if((i=t.src.charCodeAt(n++))<48||i>57)return-1;for(;;){if(n>=o)return-1;if(!((i=t.src.charCodeAt(n++))>=48&&i<=57)){if(41===i||46===i)break;return-1}}return n<o&&32!==t.src.charCodeAt(n)?-1:n}Fr.prototype.process=function(t){var e,i,n;for(e=0,i=(n=this.ruler.getRules("")).length;e<i;e++)n[e](t)},Vr.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Vr.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Vr.prototype.skipSpaces=function(t){for(var e=this.src.length;t<e&&32===this.src.charCodeAt(t);t++);return t},Vr.prototype.skipChars=function(t,e){for(var i=this.src.length;t<i&&this.src.charCodeAt(t)===e;t++);return t},Vr.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},Vr.prototype.getLines=function(t,e,i,n){var o,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=n?this.eMarks[h]+1:this.eMarks[h],this.src.slice(s,r);for(a=new Array(e-t),o=0;h<e;h++,o++)(l=this.tShift[h])>i&&(l=i),l<0&&(l=0),s=this.bMarks[h]+l,r=h+1<e||n?this.eMarks[h]+1:this.eMarks[h],a[o]=this.src.slice(s,r);return a.join("")};var Wr={};["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){Wr[t]=!0}));var Gr=/^<([a-zA-Z]{1,15})[\s\/>]/,Kr=/^<\/([a-zA-Z]{1,15})[\s>]/;function Yr(t,e){var i=t.bMarks[e]+t.blkIndent,n=t.eMarks[e];return t.src.substr(i,n-i)}function Jr(t,e){var i,n,o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];return o>=s||126!==(n=t.src.charCodeAt(o++))&&58!==n||o===(i=t.skipSpaces(o))||i>=s?-1:i}var Xr=[["code",function(t,e,i){var n,o;if(t.tShift[e]-t.blkIndent<4)return!1;for(o=n=e+1;n<i;)if(t.isEmpty(n))n++;else{if(!(t.tShift[n]-t.blkIndent>=4))break;o=++n}return t.line=n,t.tokens.push({type:"code",content:t.getLines(e,o,4+t.blkIndent,!0),block:!0,lines:[e,t.line],level:t.level}),!0}],["fences",function(t,e,i,n){var o,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!==(o=t.src.charCodeAt(c))&&96!==o)return!1;if(l=c,(s=(c=t.skipChars(c,o))-l)<3)return!1;if((r=t.src.slice(c,d).trim()).indexOf("`")>=0)return!1;if(n)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)===o&&!(t.tShift[a]-t.blkIndent>=4||(c=t.skipChars(c,o))-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,n){var o,s,r,a,l,h,c,d,u,p,m,f=t.bMarks[e]+t.tShift[e],g=t.eMarks[e];if(f>g)return!1;if(62!==t.src.charCodeAt(f++))return!1;if(t.level>=t.options.maxNesting)return!1;if(n)return!0;for(32===t.src.charCodeAt(f)&&f++,l=t.blkIndent,t.blkIndent=0,a=[t.bMarks[e]],t.bMarks[e]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r=[t.tShift[e]],t.tShift[e]=f-t.bMarks[e],d=t.parser.ruler.getRules("blockquote"),o=e+1;o<i&&!((f=t.bMarks[o]+t.tShift[o])>=(g=t.eMarks[o]));o++)if(62!==t.src.charCodeAt(f++)){if(s)break;for(m=!1,u=0,p=d.length;u<p;u++)if(d[u](t,o,i,!0)){m=!0;break}if(m)break;a.push(t.bMarks[o]),r.push(t.tShift[o]),t.tShift[o]=-1337}else 32===t.src.charCodeAt(f)&&f++,a.push(t.bMarks[o]),t.bMarks[o]=f,s=(f=f<g?t.skipSpaces(f):f)>=g,r.push(t.tShift[o]),t.tShift[o]=f-t.bMarks[o];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,o),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,n){var o,s,r,a=t.bMarks[e],l=t.eMarks[e];if((a+=t.tShift[e])>l)return!1;if(42!==(o=t.src.charCodeAt(a++))&&45!==o&&95!==o)return!1;for(s=1;a<l;){if((r=t.src.charCodeAt(a++))!==o&&32!==r)return!1;r===o&&s++}return!(s<3)&&(n||(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,n){var o,s,r,a,l,h,c,d,u,p,m,f,g,v,y,b,_,x,w,k,S,E=!0;if((d=Hr(t,e))>=0)f=!0;else{if(!((d=jr(t,e))>=0))return!1;f=!1}if(t.level>=t.options.maxNesting)return!1;if(m=t.src.charCodeAt(d-1),n)return!0;for(v=t.tokens.length,f?(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:b=[e,0],level:t.level++})):t.tokens.push({type:"bullet_list_open",lines:b=[e,0],level:t.level++}),o=e,y=!1,x=t.parser.ruler.getRules("list");!(!(o<i)||((u=(g=t.skipSpaces(d))>=t.eMarks[o]?1:g-d)>4&&(u=1),u<1&&(u=1),s=d-t.bMarks[o]+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]=g-t.bMarks[e],t.blkIndent=s,t.tight=!0,t.parentType="list",t.parser.tokenize(t,e,i,!0),t.tight&&!y||(E=!1),y=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}),o=e=t.line,_[1]=o,g=t.bMarks[e],o>=i)||t.isEmpty(o)||t.tShift[o]<t.blkIndent);){for(S=!1,w=0,k=x.length;w<k;w++)if(x[w](t,o,i,!0)){S=!0;break}if(S)break;if(f){if((d=Hr(t,o))<0)break}else if((d=jr(t,o))<0)break;if(m!==t.src.charCodeAt(d-1))break}return t.tokens.push({type:f?"ordered_list_close":"bullet_list_close",level:--t.level}),b[1]=o,t.line=o,E&&function(t,e){var i,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"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,n){var o,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))&&(n||(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++}),o=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]=o,t.tokens.push({type:"footnote_reference_close",level:--t.level})),!0))},["paragraph"]],["heading",function(t,e,i,n){var o,s,r,a=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(a>=l)return!1;if(35!==(o=t.src.charCodeAt(a))||a>=l)return!1;for(s=1,o=t.src.charCodeAt(++a);35===o&&a<l&&s<=6;)s++,o=t.src.charCodeAt(++a);return!(s>6||a<l&&32!==o)&&(n||(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 n,o,s,r=e+1;return!(r>=i)&&(!(t.tShift[r]<t.blkIndent)&&(!(t.tShift[r]-t.blkIndent>3)&&(!((o=t.bMarks[r]+t.tShift[r])>=(s=t.eMarks[r]))&&((45===(n=t.src.charCodeAt(o))||61===n)&&(o=t.skipChars(o,n),!((o=t.skipSpaces(o))<s)&&(o=t.bMarks[e]+t.tShift[e],t.line=r+1,t.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:t.src.slice(o,t.eMarks[e]).trim(),level:t.level+1,lines:[e,t.line-1],children:[]}),t.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:t.level}),!0))))))}],["htmlblock",function(t,e,i,n){var o,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===(o=t.src.charCodeAt(a+1))||63===o){if(n)return!0}else{if(47!==o&&!function(t){var e=32|t;return e>=97&&e<=122}(o))return!1;if(47===o){if(!(s=t.src.slice(a,l).match(Kr)))return!1}else if(!(s=t.src.slice(a,l).match(Gr)))return!1;if(!0!==Wr[s[1].toLowerCase()])return!1;if(n)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,n){var o,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!==(o=t.src.charCodeAt(r))&&45!==o&&58!==o)return!1;if(s=Yr(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=Yr(t,e).trim()).indexOf("|"))return!1;if(h=s.replace(/^\||\|$/g,"").split("|"),d.length!==h.length)return!1;if(n)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=Yr(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,n){var o,s,r,a,l,h,c,d,u,p,m,f,g,v;if(n)return!(t.ddIndent<0)&&Jr(t,e)>=0;if(c=e+1,t.isEmpty(c)&&++c>i)return!1;if(t.tShift[c]<t.blkIndent)return!1;if((o=Jr(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,g=!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++}),f=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]=o-t.bMarks[s],t.tight=!0,t.parentType="deflist",t.parser.tokenize(t,s,i,!0),t.tight&&!g||(v=!1),g=t.line-s>1&&t.isEmpty(t.line-1),t.tShift[s]=m,t.tight=f,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((o=Jr(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((o=Jr(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,n,o=t.level+2;for(i=e+2,n=t.tokens.length-2;i<n;i++)t.tokens[i].level===o&&"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,n,o,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(o=!1,s=0,r=a.length;s<r;s++)if(a[s](t,l,i,!0)){o=!0;break}if(o)break}return n=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,n.length&&(t.tokens.push({type:"paragraph_open",tight:!1,lines:[e,t.line],level:t.level}),t.tokens.push({type:"inline",content:n,level:t.level+1,lines:[e,t.line],children:[]}),t.tokens.push({type:"paragraph_close",tight:!1,level:t.level})),!0}]];function Qr(){this.ruler=new kr;for(var t=0;t<Xr.length;t++)this.ruler.push(Xr[t][0],Xr[t][1],{alt:(Xr[t][2]||[]).slice()})}Qr.prototype.tokenize=function(t,e,i){for(var n,o=this.ruler.getRules(""),s=o.length,r=e,a=!1;r<i&&(t.line=r=t.skipEmptyLines(r),!(r>=i))&&!(t.tShift[r]<t.blkIndent);){for(n=0;n<s&&!o[n](t,r,i,!1);n++);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 ta=/[\n\t]/g,ea=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,ia=/\u00a0/g;function na(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}}Qr.prototype.parse=function(t,e,i,n){var o,s=0,r=0;if(!t)return[];(t=(t=t.replace(ia," ")).replace(ea,"\n")).indexOf("\t")>=0&&(t=t.replace(ta,(function(e,i){var n;return 10===t.charCodeAt(i)?(s=i+1,r=0,e):(n=" ".slice((i-s-r)%4),r=i-s+1,n)}))),o=new Vr(t,this,e,i,n),this.tokenize(o,o.line,o.lineMax)};for(var oa=[],sa=0;sa<256;sa++)oa.push(0);function ra(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function aa(t,e){var i,n,o,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),(o=s-e)>=4?r=a=!1:(32!==(n=s<l?t.src.charCodeAt(s):-1)&&10!==n||(r=!1),32!==i&&10!==i||(a=!1),95===h&&(ra(i)&&(r=!1),ra(n)&&(a=!1))),{can_open:r,can_close:a,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){oa[t.charCodeAt(0)]=1}));var la=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var ha=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;var ca=["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"],da=/^<([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 pa(t,e){return t=t.source,e=e||"",function i(n,o){return n?(o=o.source||o,t=t.replace(n,o),i):new RegExp(t,e)}}var ma=pa(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),fa=pa(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",ma)(),ga=pa(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",fa)(),va=pa(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",ga)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)();var ya=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,ba=/^&([a-z][a-z0-9]{1,31});/i;var _a=[["text",function(t,e){for(var i=t.pos;i<t.posMax&&!na(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,n,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;if(i=t.pending.length-1,n=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(o++;o<n&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}],["escape",function(t,e){var i,n=t.pos,o=t.posMax;if(92!==t.src.charCodeAt(n))return!1;if(++n<o){if((i=t.src.charCodeAt(n))<256&&0!==oa[i])return e||(t.pending+=t.src[n]),t.pos+=2,!0;if(10===i){for(e||t.push({type:"hardbreak",level:t.level}),n++;n<o&&32===t.src.charCodeAt(n);)n++;return t.pos=n,!0}}return e||(t.pending+="\\"),t.pos++,!0}],["backticks",function(t,e){var i,n,o,s,r,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(i=a,a++,n=t.posMax;a<n&&96===t.src.charCodeAt(a);)a++;for(o=t.src.slice(i,a),s=r=a;-1!==(s=t.src.indexOf("`",r));){for(r=s+1;r<n&&96===t.src.charCodeAt(r);)r++;if(r-s===o.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+=o),t.pos+=o.length,!0}],["del",function(t,e){var i,n,o,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(n=l+2;n<a&&126===t.src.charCodeAt(n);)n++;if(n>l+3)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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(n=l+2;n<a&&43===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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(n=l+2;n<a&&61===t.src.charCodeAt(n);)n++;if(n!==l+2)return t.pos+=n-l,e||(t.pending+=t.src.slice(l,n)),!0;for(t.pos=l+2,o=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?o--:32!==r&&10!==r&&o++,o<=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,n,o,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=aa(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(n=(l=aa(t,t.pos)).delims,l.can_close){for(s=a.pop(),r=n;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,o=!0;break}t.pos+=n;continue}l.can_open&&a.push(n),t.pos+=n}return o?(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,n,o=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(126===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=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:n.replace(la,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["sup",function(t,e){var i,n,o=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=o)return!1;if(t.level>=t.options.maxNesting)return!1;for(t.pos=s+1;t.pos<o;){if(94===t.src.charCodeAt(t.pos)){i=!0;break}t.parser.skipToken(t)}return i&&s+1!==t.pos?(n=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:n.replace(ha,"$1")}),t.pos=t.posMax+1,t.posMax=o,!0):(t.pos=s,!1)}],["links",function(t,e){var i,n,o,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,(n=Er(t,p))<0)return!1;if((a=n+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,Tr(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&&Ar(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=Er(t,a))>=0?o=t.src.slice(p,a++):a=p-1),o||(void 0===o&&(a=n+1),o=t.src.slice(i,n)),!(l=t.env.references[Lr(o)]))return t.pos=d,!1;s=l.href,r=l.title}return e||(t.pos=i,t.posMax=n,c?t.push({type:"image",src:s,title:r,alt:t.src.substr(i,n-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,n,o,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,!((n=Er(t,a+1))<0)&&(e||(t.env.footnotes||(t.env.footnotes={}),t.env.footnotes.list||(t.env.footnotes.list=[]),o=t.env.footnotes.list.length,t.pos=i,t.posMax=n,t.push({type:"footnote_ref",id:o,level:t.level}),t.linkLevel++,s=t.tokens.length,t.parser.tokenize(t),t.env.footnotes.list[o]={tokens:t.tokens.splice(s)},t.linkLevel--),t.pos=n+1,t.posMax=r,!0)))))}],["footnote_ref",function(t,e){var i,n,o,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(n=a+2;n<r;n++){if(32===t.src.charCodeAt(n))return!1;if(10===t.src.charCodeAt(n))return!1;if(93===t.src.charCodeAt(n))break}return n!==a+2&&(!(n>=r)&&(n++,i=t.src.slice(a+2,n-1),void 0!==t.env.footnotes.refs[":"+i]&&(e||(t.env.footnotes.list||(t.env.footnotes.list=[]),t.env.footnotes.refs[":"+i]<0?(o=t.env.footnotes.list.length,t.env.footnotes.list[o]={label:i,count:0},t.env.footnotes.refs[":"+i]=o):o=t.env.footnotes.refs[":"+i],s=t.env.footnotes.list[o].count,t.env.footnotes.list[o].count++,t.push({type:"footnote_ref",id:o,subId:s,level:t.level})),t.pos=n,t.posMax=r,!0)))}],["autolink",function(t,e){var i,n,o,s,r,a=t.pos;return 60===t.src.charCodeAt(a)&&(!((i=t.src.slice(a)).indexOf(">")<0)&&((n=i.match(ua))?!(ca.indexOf(n[1].toLowerCase())<0)&&(r=Cr(s=n[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+=n[0].length,!0)):!!(o=i.match(da))&&(r=Cr("mailto:"+(s=o[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+=o[0].length,!0))))}],["htmltag",function(t,e){var i,n,o,s=t.pos;return!!t.options.html&&(o=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=o)&&(!(33!==(i=t.src.charCodeAt(s+1))&&63!==i&&47!==i&&!function(t){var e=32|t;return e>=97&&e<=122}(i))&&(!!(n=t.src.slice(s).match(va))&&(e||t.push({type:"htmltag",content:t.src.slice(s,s+n[0].length),level:t.level}),t.pos+=n[0].length,!0))))}],["entity",function(t,e){var i,n,o=t.pos,s=t.posMax;if(38!==t.src.charCodeAt(o))return!1;if(o+1<s)if(35===t.src.charCodeAt(o+1)){if(n=t.src.slice(o).match(ya))return e||(i="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),t.pending+=lr(i)?hr(i):hr(65533)),t.pos+=n[0].length,!0}else if(n=t.src.slice(o).match(ba)){var r=nr(n[1]);if(n[1]!==r)return e||(t.pending+=r),t.pos+=n[0].length,!0}return e||(t.pending+="&"),t.pos++,!0}]];function xa(){this.ruler=new kr;for(var t=0;t<_a.length;t++)this.ruler.push(_a[t][0],_a[t][1]);this.validateLink=wa}function wa(t){var e=t.trim().toLowerCase();return-1===(e=pr(e)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(e.split(":")[0])}xa.prototype.skipToken=function(t){var e,i,n=this.ruler.getRules(""),o=n.length,s=t.pos;if((i=t.cacheGet(s))>0)t.pos=i;else{for(e=0;e<o;e++)if(n[e](t,!0))return void t.cacheSet(s,t.pos);t.pos++,t.cacheSet(s,t.pos)}},xa.prototype.tokenize=function(t){for(var e,i,n=this.ruler.getRules(""),o=n.length,s=t.posMax;t.pos<s;){for(i=0;i<o&&!(e=n[i](t,!1));i++);if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},xa.prototype.parse=function(t,e,i,n){var o=new Sr(t,this,e,i,n);this.tokenize(o)};var ka={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 Sa(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 Ea(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 xa,this.block=new Qr,this.core=new Fr,this.renderer=new wr,this.ruler=new kr,this.options={},this.configure(ka[t]),this.set(e||{})}Ea.prototype.set=function(t){sr(this.options,t)},Ea.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)}))},Ea.prototype.use=function(t,e){return t(this,e),this},Ea.prototype.parse=function(t,e){var i=new Sa(this,t,e);return this.core.process(i),i.tokens},Ea.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},Ea.prototype.parseInline=function(t,e){var i=new Sa(this,t,e);return i.inlineMode=!0,this.core.process(i),i.tokens},Ea.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const $a=new Ea,Ca=new tr("@",["contact","fields","globals","urns"]),Ta=new tr("@",["contact","fields","globals","urns","results","input","run","child","parent","node","webhook","ticket","trigger","resume"]);const Aa=yt(class extends bt{constructor(t){if(super(t),t.type!==vt)throw new Error("renderMarkdown only supports child expressions")}update(t,[e]){return this.render(e)}render(t){return void 0===this.value&&(this.value=t),D`${Ys($a.render(this.value))}`}}),La=(t,e)=>{if(t.signature){const i=t.signature.indexOf("("),n=t.signature.substr(0,i),o=t.signature.substr(i);return D`
437
437
  <div style="${e?"font-weight: 400":""}">
438
438
  <div style="display:inline-block;margin-right: 5px">ƒ</div>
439
439
  <div style="display:inline-block">${n}</div>
@@ -443,7 +443,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
443
443
  >
444
444
  ${o}
445
445
  </div>
446
- <div class="detail">${La(t.summary)}</div>
446
+ <div class="detail">${Aa(t.summary)}</div>
447
447
  `:null}
448
448
  </div>
449
449
  `}return D`
@@ -451,7 +451,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
451
451
  <div style="${e?"font-weight: 400":""}">${t.name}</div>
452
452
  ${e?D` <div style="font-size: 85%">${t.summary}</div> `:null}
453
453
  </div>
454
- `},Oa=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,za=(t,e,i={},n)=>{const o=(e||"").split(".");let s=n?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)s=n.properties,r+=a+".";else{if(!n||!n.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=n.property_template;s=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return s.map((t=>({name:"__default__"===t.key?r.substr(0,r.length-1):r+t.key,summary:t.help})))},Pa=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),s=getComputedStyle(t);for(const t of s)o.style[t]=s[t];o.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:h,offsetTop:c}=l;return document.body.removeChild(o),{left:i+h,top:n+c}},Ia=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,s=t.substr(0,i),r=t.substr(i+o),a=s.length+n.length;e.value=s+n+r,e.setSelectionRange(a,a);const l=Pa(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},Da=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!t)return;if(!e)return n;const o=t.selectionStart,s=t.value.substring(0,o),r=i?Aa:Ta,a=r.findExpressions(s).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=r.functionContext(a.text);if(t){const i=Oa(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let s=a.text.length;s>=0;s--){const r=a.text[s];if("@"===r||"("===r||" "===r||","===r||")"===r||0===s){"("!==r&&" "!==r&&","!==r&&")"!==r&&"@"!==r||s++;const l=Pa(t,a.start+s);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(s,a.text.length-s),n.options=[...za(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?Oa(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class Na extends ut{constructor(){super(...arguments),this.hiddenInputs=[],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=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>D``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=$e(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return r`
454
+ `},Ma=(t,e)=>e?t.filter((t=>!!t.signature&&0===t.signature.indexOf((e||"").toLowerCase()))):t,Oa=(t,e,i={},n)=>{const o=(e||"").split(".");let s=n?t.root:t.root_no_session;if(!s)return[];let r="",a="";for(;o.length>0;)if(a=o.shift(),a){const e=s.find((t=>t.key===a));if(!e){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{const n=t.types.find((t=>t.name===e.type));if(n&&n.properties)s=n.properties,r+=a+".";else{if(!n||!n.property_template){s=s.filter((t=>t.key.startsWith(a.toLowerCase())));break}{r+=a+".";const t=n.property_template;s=i[n.name]?i[n.name].map((e=>({key:t.key.replace("{key}",e),help:t.help.replace("{key}",e),type:t.type}))):[]}}}}return s.map((t=>({name:"__default__"===t.key?r.substr(0,r.length-1):r+t.key,summary:t.help})))},za=(t,e)=>{const{offsetLeft:i,offsetTop:n}=t,o=document.createElement("div"),s=getComputedStyle(t);for(const t of s)o.style[t]=s[t];o.style.position="relative";const r="INPUT"===t.tagName?t.value.replace(/ /g,"."):t.value,a=r.substr(0,e);o.textContent=a,"TEXTAREA"===t.tagName&&(o.style.height="auto"),"INPUT"===t.tagName&&(o.style.width="auto");const l=document.createElement("span");l.textContent=r.substr(e)||".",o.appendChild(l),document.body.appendChild(o);const{offsetLeft:h,offsetTop:c}=l;return document.body.removeChild(o),{left:i+h,top:n+c}},Pa=(t,e,i)=>{let n="";n=i.signature?i.signature.substr(0,i.signature.indexOf("(")+1):i.name;const o=t.length;if(e){const t=e.value,i=e.selectionStart-o,s=t.substr(0,i),r=t.substr(i+o),a=s.length+n.length;e.value=s+n+r,e.setSelectionRange(a,a);const l=za(e,a);l.left>e.width&&(e.scrollLeft=l.left),e.dispatchEvent(new Event("input"))}},Ia=(t,e,i)=>{const n={currentFunction:null,options:[],anchorPosition:null,query:null};if(!t)return;if(!e)return n;const o=t.selectionStart,s=t.value.substring(0,o),r=i?Ta:Ca,a=r.findExpressions(s).find((t=>t.start<=o&&(t.end>o||t.end===o&&!t.closed)));if(a){const o=a.text.indexOf("(")>-1;if(o){const t=r.functionContext(a.text);if(t){const i=Ma(e.getFunctions(),t);i.length>0&&(n.currentFunction=i[0])}}for(let s=a.text.length;s>=0;s--){const r=a.text[s];if("@"===r||"("===r||" "===r||","===r||")"===r||0===s){"("!==r&&" "!==r&&","!==r&&")"!==r&&"@"!==r||s++;const l=za(t,a.start+s);return n.anchorPosition={left:l.left-2-t.scrollLeft,top:l.top-t.scrollTop},n.query=a.text.substr(s,a.text.length-s),n.options=[...Oa(e.getCompletionSchema(),n.query,e.getKeyedAssets(),i),...o?Ma(e.getFunctions(),n.query):[]],n}}}else n.options=[],n.query="";return n};class Da extends ut{constructor(){super(...arguments),this.hiddenInputs=[],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=(t,e)=>(this.getName(t)||"").toLowerCase().indexOf(e)>-1,this.getValue=t=>t[this.valueKey||"value"]||t.id,this.renderOptionDetail=()=>D``,this.renderSelectedItem=this.renderSelectedItemDefault,this.createArbitraryOption=this.createArbitraryOptionDefault,this.getOptions=this.getOptionsDefault,this.isComplete=this.isCompleteDefault,this.staticOptions=[],this.next=null,this.lruCache=Ee(20,6e4),this.getNameInternal=t=>this.getName(t)}static get styles(){return r`
455
455
  :host {
456
456
  font-family: var(--font-family);
457
457
  transition: all ease-in-out var(--transition-speed);
@@ -761,7 +761,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
761
761
  pointer-events: none;
762
762
  padding: 0px;
763
763
  }
764
- `}updated(t){if(super.updated(t),t.has("values")&&(this.updateInputs(),(this.multi||1===this.values.length)&&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(Se.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&this.fetchOptions(this.query,this.page+1),t.has("value")&&this.value&&!this.values.length){const t=this.staticOptions.find((t=>this.getValue(t)===this.value));t&&this.setValues([t])}0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}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){const e=t.detail.selected;e.post&&this.endpoint?ae(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=$e(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,n=this.shadowRoot.querySelector(".searchbox");Ia(this.query,n,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.requestUpdate("input")}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(Se.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=Da(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent(Se.FetchComplete)}}fetchOptions(t,e=0){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const i=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(i.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||i.splice(0,0,{name:t,value:t})),this.endpoint){let o=this.endpoint;t&&this.queryParam&&(o.indexOf("?")>-1?o+="&":o+="?",o+=this.queryParam+"="+encodeURIComponent(t)),e&&(o.indexOf("?")>-1?o+="&":o+="?",o+="page="+e),this.next&&(o=this.next);const s=this.lruCache.get(o);if(this.cache&&!this.tags&&s)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...s.options]):(this.cursorIndex=0,this.setVisibleOptions([...i,...s.options])),this.complete=s.complete,this.next=s.next,void(this.fetching=!1);this.searchable&&!this.queryParam?ne(o).then((t=>{this.cache&&!this.tags&&(this.lruCache.set(o,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...i,...t]),this.fetching=!1)})):te(o).then((s=>{const r=this.getOptions(s).filter((t=>this.isMatch(t,n))),a=s.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,s)):(this.cursorIndex=0,this.setVisibleOptions([...i,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,s)),this.cache&&!this.tags&&this.lruCache.set(o,{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(i)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0,this.searchOnFocus&&!this.removingSelection&&this.requestUpdate("input"))}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(this.focused=!0,"INPUT"!==t.target.tagName){const e=this.shadowRoot.querySelector("input");if(e)return e.click(),void e.focus();this.visibleOptions.length>0?(this.visibleOptions=[],t.preventDefault(),t.stopPropagation()):this.requestUpdate("input")}}getEventHandlers(){return[{event:Se.Canceled,method:this.handleCancel},{event:Se.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),window.setTimeout((()=>{for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;this.staticOptions.push(e),null===t.getAttribute("selected")&&this.getValue(e)!=this.value||(null!==this.getAttribute("multi")?this.addValue(e):this.setValues([e]))}0!==this.values.length||this.placeholder||(0==this.staticOptions.length&&this.endpoint?ne(this.endpoint).then((t=>{t.length>0&&this.setValues([t[0]])})):null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.setValues([this.staticOptions[0]])),this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}),0)}handleArrowClick(t){this.visibleOptions.length>0&&(this.visibleOptions=[],t.preventDefault(),t.stopPropagation())}renderSelectedItemDefault(t){return t?D`
764
+ `}updated(t){if(super.updated(t),t.has("values")&&(this.updateInputs(),(this.multi||1===this.values.length||0==this.values.length&&t.get("values")&&t.get("values").length>0)&&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(ke.FetchComplete)),(t.has("cursorIndex")||t.has("visibleOptions"))&&this.endpoint&&!this.fetching&&this.isPastFetchThreshold()&&this.fetchOptions(this.query,this.page+1),t.has("value")&&this.value&&!this.values.length){const t=this.staticOptions.find((t=>this.getValue(t)===this.value));t&&this.setValues([t])}0===this.values.length&&!this.placeholder&&this.staticOptions.length>0&&this.setValues([this.staticOptions[0]])}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){const e=t.detail.selected;e.post&&this.endpoint?ae(this.endpoint,e).then((t=>{t.status>=200&&t.status<300?(this.setSelectedOption(t.json),this.lruCache=Ee(20,6e4)):this.blur()})):this.setSelectedOption(e)}handleExpressionSelection(t){const e=t.detail.selected,i=t.detail.tabbed,n=this.shadowRoot.querySelector(".searchbox");Pa(this.query,n,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.requestUpdate("input")}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(ke.ContentChanged,{options:this.visibleOptions})}fetchExpressions(){const t=document.querySelector("temba-store");if(this.expressions&&t){const e=this.shadowRoot.querySelector(".searchbox"),i=Ia(e,t,"session"===this.expressions);return this.query=i.query,this.completionOptions=i.options,this.visibleOptions=[],this.anchorPosition=i.anchorPosition,void this.fireCustomEvent(ke.FetchComplete)}}fetchOptions(t,e=0){if(this.completionOptions=[],!this.fetching){this.fetching=!0;const i=[...this.staticOptions],n=(t||"").trim().toLowerCase();if(this.tags&&n&&(i.find((t=>this.getValue(t)&&this.getValue(t).toLowerCase()===n))||i.splice(0,0,{name:t,value:t})),this.endpoint){let o=this.endpoint;t&&this.queryParam&&(o.indexOf("?")>-1?o+="&":o+="?",o+=this.queryParam+"="+encodeURIComponent(t)),e&&(o.indexOf("?")>-1?o+="&":o+="?",o+="page="+e),this.next&&(o=this.next);const s=this.lruCache.get(o);if(this.cache&&!this.tags&&s)return 0!==e||this.next?this.setVisibleOptions([...this.visibleOptions,...s.options]):(this.cursorIndex=0,this.setVisibleOptions([...i,...s.options])),this.complete=s.complete,this.next=s.next,void(this.fetching=!1);this.searchable&&!this.queryParam?ne(o).then((t=>{this.cache&&!this.tags&&(this.lruCache.set(o,{options:t,complete:!0,next:null}),this.complete=!0,this.next=null,this.setVisibleOptions([...i,...t]),this.fetching=!1)})):te(o).then((s=>{const r=this.getOptions(s).filter((t=>this.isMatch(t,n))),a=s.json;a.next&&(this.next=a.next),0!==e||this.next?(r.length>0&&this.setVisibleOptions([...this.visibleOptions,...r]),this.complete=this.isComplete(r,s)):(this.cursorIndex=0,this.setVisibleOptions([...i,...r]),this.query=t,this.complete=this.isComplete(this.visibleOptions,s)),this.cache&&!this.tags&&this.lruCache.set(o,{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(i)}}handleFocus(){this.focused||0!==this.visibleOptions.length||(this.focused=!0,this.searchOnFocus&&!this.removingSelection&&this.requestUpdate("input"))}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(this.focused=!0,"INPUT"!==t.target.tagName){const e=this.shadowRoot.querySelector("input");if(e)return e.click(),void e.focus();this.visibleOptions.length>0?(this.visibleOptions=[],t.preventDefault(),t.stopPropagation()):this.requestUpdate("input")}}getEventHandlers(){return[{event:ke.Canceled,method:this.handleCancel},{event:ke.CursorChanged,method:this.handleCursorChanged},{event:"blur",method:this.handleBlur},{event:"focus",method:this.handleFocus}]}firstUpdated(t){super.firstUpdated(t),this.anchorElement=this.shadowRoot.querySelector(".select-container"),this.anchorExpressions=this.shadowRoot.querySelector("#anchor"),window.setTimeout((()=>{for(const t of this.children)if("TEMBA-OPTION"===t.tagName){const e={};for(const i of t.attributes)e[i.name]=i.value;this.staticOptions.push(e),null===t.getAttribute("selected")&&this.getValue(e)!=this.value||(null!==this.getAttribute("multi")?this.addValue(e):this.setValues([e]))}0!==this.values.length||this.placeholder||(0==this.staticOptions.length&&this.endpoint?ne(this.endpoint).then((t=>{t.length>0&&this.setValues([t[0]])})):null!==this.getAttribute("multi")?this.addValue(this.staticOptions[0]):this.setValues([this.staticOptions[0]])),this.searchable&&0===this.staticOptions.length&&(this.quietMillis=200)}),0)}handleArrowClick(t){this.visibleOptions.length>0&&(this.visibleOptions=[],t.preventDefault(),t.stopPropagation())}renderSelectedItemDefault(t){return t?D`
765
765
  <div class="option-name" style="display:flex">
766
766
  ${t.icon?D`<temba-icon
767
767
  name="${t.icon}"
@@ -876,22 +876,22 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
876
876
  @temba-canceled=${()=>{}}
877
877
  .anchorTo=${this.anchorExpressions}
878
878
  .options=${this.completionOptions}
879
- .renderOption=${Ma}
879
+ .renderOption=${La}
880
880
  ?visible=${this.completionOptions.length>0}
881
881
  >
882
882
  ${this.currentFunction?D`
883
883
  <div class="current-fn">
884
- ${Ma(this.currentFunction,!0)}
884
+ ${La(this.currentFunction,!0)}
885
885
  </div>
886
886
  `:null}
887
- <div class="footer">${Vs("Tab to complete, enter to select")}</div>
887
+ <div class="footer">${Fs("Tab to complete, enter to select")}</div>
888
888
  </temba-options>
889
889
 
890
890
 
891
891
 
892
892
  </temba-field>
893
893
 
894
- `}}t([ct({type:Boolean})],Na.prototype,"multi",void 0),t([ct({type:Boolean})],Na.prototype,"searchOnFocus",void 0),t([ct({type:String})],Na.prototype,"placeholder",void 0),t([ct()],Na.prototype,"name",void 0),t([ct()],Na.prototype,"endpoint",void 0),t([ct({type:String})],Na.prototype,"nameKey",void 0),t([ct({type:String})],Na.prototype,"valueKey",void 0),t([ct({attribute:!1})],Na.prototype,"currentFunction",void 0),t([ct({type:String})],Na.prototype,"queryParam",void 0),t([ct({type:String})],Na.prototype,"input",void 0),t([ct({type:Array})],Na.prototype,"visibleOptions",void 0),t([ct({type:Array})],Na.prototype,"completionOptions",void 0),t([ct({type:Number})],Na.prototype,"quietMillis",void 0),t([ct({type:Boolean})],Na.prototype,"fetching",void 0),t([ct({type:Boolean})],Na.prototype,"searchable",void 0),t([ct({type:String})],Na.prototype,"expressions",void 0),t([ct({type:Boolean})],Na.prototype,"cache",void 0),t([ct({type:String})],Na.prototype,"cacheKey",void 0),t([ct({type:Boolean})],Na.prototype,"focused",void 0),t([ct({type:Boolean})],Na.prototype,"disabled",void 0),t([ct({attribute:!1})],Na.prototype,"selectedIndex",void 0),t([ct({type:Number})],Na.prototype,"cursorIndex",void 0),t([ct({attribute:!1})],Na.prototype,"anchorElement",void 0),t([ct({attribute:!1})],Na.prototype,"anchorExpressions",void 0),t([ct({type:Object})],Na.prototype,"anchorPosition",void 0),t([ct({type:Boolean})],Na.prototype,"tags",void 0),t([ct({type:Boolean,attribute:"space_select"})],Na.prototype,"spaceSelect",void 0),t([ct({type:Boolean})],Na.prototype,"jsonValue",void 0),t([ct({type:Boolean})],Na.prototype,"hideErrors",void 0),t([ct({type:Boolean})],Na.prototype,"clearable",void 0),t([ct({type:String})],Na.prototype,"flavor",void 0),t([ct({type:String,attribute:"info_text"})],Na.prototype,"infoText",void 0),t([ct({type:Array})],Na.prototype,"values",void 0),t([ct({type:Object})],Na.prototype,"selection",void 0),t([ct({attribute:!1})],Na.prototype,"getName",void 0),t([ct({attribute:!1})],Na.prototype,"isMatch",void 0),t([ct({attribute:!1})],Na.prototype,"getValue",void 0),t([ct({type:Number,attribute:"option-width"})],Na.prototype,"optionWidth",void 0),t([ct({type:Boolean,attribute:"anchor-right"})],Na.prototype,"anchorRight",void 0),t([ct({attribute:!1})],Na.prototype,"shouldExclude",void 0),t([ct({attribute:!1})],Na.prototype,"sortFunction",void 0),t([ct({attribute:!1})],Na.prototype,"renderOption",void 0),t([ct({attribute:!1})],Na.prototype,"renderOptionName",void 0),t([ct({attribute:!1})],Na.prototype,"renderOptionDetail",void 0),t([ct({attribute:!1})],Na.prototype,"renderSelectedItem",void 0),t([ct({attribute:!1})],Na.prototype,"createArbitraryOption",void 0),t([ct({attribute:!1})],Na.prototype,"getOptions",void 0),t([ct({attribute:!1})],Na.prototype,"isComplete",void 0),t([ct({type:Array,attribute:"options"})],Na.prototype,"staticOptions",void 0);class Ra extends ut{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`
894
+ `}}t([ct({type:Boolean})],Da.prototype,"multi",void 0),t([ct({type:Boolean})],Da.prototype,"searchOnFocus",void 0),t([ct({type:String})],Da.prototype,"placeholder",void 0),t([ct()],Da.prototype,"name",void 0),t([ct()],Da.prototype,"endpoint",void 0),t([ct({type:String})],Da.prototype,"nameKey",void 0),t([ct({type:String})],Da.prototype,"valueKey",void 0),t([ct({attribute:!1})],Da.prototype,"currentFunction",void 0),t([ct({type:String})],Da.prototype,"queryParam",void 0),t([ct({type:String})],Da.prototype,"input",void 0),t([ct({type:Array})],Da.prototype,"visibleOptions",void 0),t([ct({type:Array})],Da.prototype,"completionOptions",void 0),t([ct({type:Number})],Da.prototype,"quietMillis",void 0),t([ct({type:Boolean})],Da.prototype,"fetching",void 0),t([ct({type:Boolean})],Da.prototype,"searchable",void 0),t([ct({type:String})],Da.prototype,"expressions",void 0),t([ct({type:Boolean})],Da.prototype,"cache",void 0),t([ct({type:String})],Da.prototype,"cacheKey",void 0),t([ct({type:Boolean})],Da.prototype,"focused",void 0),t([ct({type:Boolean})],Da.prototype,"disabled",void 0),t([ct({attribute:!1})],Da.prototype,"selectedIndex",void 0),t([ct({type:Number})],Da.prototype,"cursorIndex",void 0),t([ct({attribute:!1})],Da.prototype,"anchorElement",void 0),t([ct({attribute:!1})],Da.prototype,"anchorExpressions",void 0),t([ct({type:Object})],Da.prototype,"anchorPosition",void 0),t([ct({type:Boolean})],Da.prototype,"tags",void 0),t([ct({type:Boolean,attribute:"space_select"})],Da.prototype,"spaceSelect",void 0),t([ct({type:Boolean})],Da.prototype,"jsonValue",void 0),t([ct({type:Boolean})],Da.prototype,"hideErrors",void 0),t([ct({type:Boolean})],Da.prototype,"clearable",void 0),t([ct({type:String})],Da.prototype,"flavor",void 0),t([ct({type:String,attribute:"info_text"})],Da.prototype,"infoText",void 0),t([ct({type:Array})],Da.prototype,"values",void 0),t([ct({type:Object})],Da.prototype,"selection",void 0),t([ct({attribute:!1})],Da.prototype,"getName",void 0),t([ct({attribute:!1})],Da.prototype,"isMatch",void 0),t([ct({attribute:!1})],Da.prototype,"getValue",void 0),t([ct({type:Number,attribute:"option-width"})],Da.prototype,"optionWidth",void 0),t([ct({type:Boolean,attribute:"anchor-right"})],Da.prototype,"anchorRight",void 0),t([ct({attribute:!1})],Da.prototype,"shouldExclude",void 0),t([ct({attribute:!1})],Da.prototype,"sortFunction",void 0),t([ct({attribute:!1})],Da.prototype,"renderOption",void 0),t([ct({attribute:!1})],Da.prototype,"renderOptionName",void 0),t([ct({attribute:!1})],Da.prototype,"renderOptionDetail",void 0),t([ct({attribute:!1})],Da.prototype,"renderSelectedItem",void 0),t([ct({attribute:!1})],Da.prototype,"createArbitraryOption",void 0),t([ct({attribute:!1})],Da.prototype,"getOptions",void 0),t([ct({attribute:!1})],Da.prototype,"isComplete",void 0),t([ct({type:Array,attribute:"options"})],Da.prototype,"staticOptions",void 0);class Na extends ut{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`
895
895
  :host {
896
896
  display: block;
897
897
  }
@@ -946,7 +946,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
946
946
  padding: 1px 5px;
947
947
  border-radius: var(--curvature);
948
948
  }
949
- `}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store");if(!t.inputElement)return;const i=Da(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;Ia(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}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`}:{};return D`
949
+ `}firstUpdated(){this.textInputElement=this.shadowRoot.querySelector("temba-textinput"),this.anchorElement=this.shadowRoot.querySelector("#anchor"),this.hiddenElement=document.createElement("input"),this.hiddenElement.setAttribute("type","hidden"),this.hiddenElement.setAttribute("name",this.getAttribute("name")),this.hiddenElement.setAttribute("value",this.getAttribute("value")||""),this.appendChild(this.hiddenElement)}handleKeyUp(t){if(this.options&&this.options.length>0){if("ArrowUp"===t.key||"ArrowDown"===t.key)return;if(t.ctrlKey&&("n"===t.key||"p"===t.key))return;if("Enter"===t.key||"Escape"===t.key||"Tab"===t.key||t.key.startsWith("Control"))return t.stopPropagation(),void t.preventDefault();this.executeQuery(t.currentTarget)}}hasVisibleOptions(){return this.options.length>0}executeQuery(t){const e=document.querySelector("temba-store");if(!t.inputElement)return;const i=Ia(t.inputElement,e,this.session);this.query=i.query,this.options=i.options,this.anchorPosition=i.anchorPosition}handleClick(t){this.executeQuery(t.currentTarget)}updated(t){super.updated(t),t.has("value")&&this.hiddenElement.setAttribute("value",this.value)}handleInput(t){const e=t.currentTarget;this.executeQuery(e),this.value=e.inputElement.value,this.fireEvent("change")}handleOptionCanceled(){window.setTimeout((()=>{this.options=[],this.query=""}),100)}handleOptionSelection(t){const e=t.detail.selected,i=t.detail.tabbed;Pa(this.query,this.textInputElement.inputElement,e),this.query="",this.options=[],i&&this.executeQuery(this.textInputElement)}click(){super.click();const t=this.shadowRoot.querySelector("temba-textinput");t&&t.click()}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`}:{};return D`
950
950
  <temba-field
951
951
  name=${this.name}
952
952
  .label=${this.label}
@@ -975,21 +975,21 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
975
975
  <temba-options
976
976
  @temba-selection=${this.handleOptionSelection}
977
977
  @temba-canceled=${this.handleOptionCanceled}
978
- .renderOption=${Ma}
978
+ .renderOption=${La}
979
979
  .anchorTo=${this.anchorElement}
980
980
  .options=${this.options}
981
981
  ?visible=${this.options&&this.options.length>0}
982
982
  >
983
983
  ${this.currentFunction?D`
984
984
  <div class="current-fn">
985
- ${Ma(this.currentFunction,!0)}
985
+ ${La(this.currentFunction,!0)}
986
986
  </div>
987
987
  `:null}
988
- <div class="footer">${Vs("Tab to complete, enter to select")}</div>
988
+ <div class="footer">${Fs("Tab to complete, enter to select")}</div>
989
989
  </temba-options>
990
990
  </div>
991
991
  </temba-field>
992
- `}}var Ba;t([ct({type:Number})],Ra.prototype,"maxLength",void 0),t([ct({type:Boolean})],Ra.prototype,"session",void 0),t([ct({type:Boolean})],Ra.prototype,"submitOnEnter",void 0),t([ct({type:Object})],Ra.prototype,"anchorPosition",void 0),t([ct({attribute:!1})],Ra.prototype,"currentFunction",void 0),t([ct({type:String})],Ra.prototype,"placeholder",void 0),t([ct({attribute:!1})],Ra.prototype,"textInputElement",void 0),t([ct({attribute:!1})],Ra.prototype,"anchorElement",void 0),t([ct({type:Array})],Ra.prototype,"options",void 0),t([ct({type:String})],Ra.prototype,"name",void 0),t([ct({type:String})],Ra.prototype,"value",void 0),t([ct({type:Boolean})],Ra.prototype,"textarea",void 0),t([ct({type:Boolean})],Ra.prototype,"gsm",void 0),t([ct({type:String})],Ra.prototype,"counter",void 0),t([ct({type:Boolean})],Ra.prototype,"autogrow",void 0),function(t){t.PRIMARY="primary",t.SECONDARY="secondary",t.DESTRUCTIVE="destructive"}(Ba||(Ba={}));class qa extends lt{static get widths(){return{small:"400px",medium:"600px",large:"655px"}}static get styles(){return r`
992
+ `}}var Ra;t([ct({type:Number})],Na.prototype,"maxLength",void 0),t([ct({type:Boolean})],Na.prototype,"session",void 0),t([ct({type:Boolean})],Na.prototype,"submitOnEnter",void 0),t([ct({type:Object})],Na.prototype,"anchorPosition",void 0),t([ct({attribute:!1})],Na.prototype,"currentFunction",void 0),t([ct({type:String})],Na.prototype,"placeholder",void 0),t([ct({attribute:!1})],Na.prototype,"textInputElement",void 0),t([ct({attribute:!1})],Na.prototype,"anchorElement",void 0),t([ct({type:Array})],Na.prototype,"options",void 0),t([ct({type:String})],Na.prototype,"name",void 0),t([ct({type:String})],Na.prototype,"value",void 0),t([ct({type:Boolean})],Na.prototype,"textarea",void 0),t([ct({type:Boolean})],Na.prototype,"gsm",void 0),t([ct({type:String})],Na.prototype,"counter",void 0),t([ct({type:Boolean})],Na.prototype,"autogrow",void 0),function(t){t.PRIMARY="primary",t.SECONDARY="secondary",t.DESTRUCTIVE="destructive"}(Ra||(Ra={}));class Ba extends lt{static get widths(){return{small:"400px",medium:"600px",large:"655px"}}static get styles(){return r`
993
993
  :host {
994
994
  position: absolute;
995
995
  z-index: 10000;
@@ -1137,7 +1137,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1137
1137
  flex-grow: 1;
1138
1138
  text-align: right;
1139
1139
  }
1140
- `}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:Ba.SECONDARY,closes:!0}),t.has("primaryButtonName")&&this.primaryButtonName&&this.buttons.push({name:this.primaryButtonName,type:Ba.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(Se.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(Se.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=qa.widths[this.size]);const e=this.header?D`
1140
+ `}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:Ra.SECONDARY,closes:!0}),t.has("primaryButtonName")&&this.primaryButtonName&&this.buttons.push({name:this.primaryButtonName,type:Ra.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(ke.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(ke.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=Ba.widths[this.size]);const e=this.header?D`
1141
1141
  <div class="dialog-header">
1142
1142
  <div class="header-text">
1143
1143
  <div class="title">${this.header}</div>
@@ -1193,7 +1193,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1193
1193
  </div>
1194
1194
  </div>
1195
1195
  </div>
1196
- `}}t([ct({type:Boolean})],qa.prototype,"open",void 0),t([ct()],qa.prototype,"header",void 0),t([ct()],qa.prototype,"body",void 0),t([ct({type:Boolean})],qa.prototype,"submitting",void 0),t([ct({type:Boolean})],qa.prototype,"destructive",void 0),t([ct({type:Boolean})],qa.prototype,"disabled",void 0),t([ct({type:Boolean})],qa.prototype,"loading",void 0),t([ct({type:Boolean})],qa.prototype,"hideOnClick",void 0),t([ct({type:Boolean})],qa.prototype,"noFocus",void 0),t([ct()],qa.prototype,"size",void 0),t([ct({type:String})],qa.prototype,"primaryButtonName",void 0),t([ct({type:String})],qa.prototype,"cancelButtonName",void 0),t([ct({type:String})],qa.prototype,"width",void 0),t([ct()],qa.prototype,"submittingName",void 0),t([ct()],qa.prototype,"animationEnd",void 0),t([ct()],qa.prototype,"ready",void 0),t([ct({type:Array})],qa.prototype,"buttons",void 0),t([ct({attribute:!1})],qa.prototype,"onButtonClicked",void 0);class Ua extends lt{constructor(){super(...arguments),this.header="",this.open=!1,this.fetching=!1,this.headers={},this.body=this.getLoading(),this.disabled=!1,this.buttons=[],this.wizardStep=0,this.wizardStepCount=0,this.suspendSubmit=!1}static get styles(){return r`
1196
+ `}}t([ct({type:Boolean})],Ba.prototype,"open",void 0),t([ct()],Ba.prototype,"header",void 0),t([ct()],Ba.prototype,"body",void 0),t([ct({type:Boolean})],Ba.prototype,"submitting",void 0),t([ct({type:Boolean})],Ba.prototype,"destructive",void 0),t([ct({type:Boolean})],Ba.prototype,"disabled",void 0),t([ct({type:Boolean})],Ba.prototype,"loading",void 0),t([ct({type:Boolean})],Ba.prototype,"hideOnClick",void 0),t([ct({type:Boolean})],Ba.prototype,"noFocus",void 0),t([ct()],Ba.prototype,"size",void 0),t([ct({type:String})],Ba.prototype,"primaryButtonName",void 0),t([ct({type:String})],Ba.prototype,"cancelButtonName",void 0),t([ct({type:String})],Ba.prototype,"width",void 0),t([ct()],Ba.prototype,"submittingName",void 0),t([ct()],Ba.prototype,"animationEnd",void 0),t([ct()],Ba.prototype,"ready",void 0),t([ct({type:Array})],Ba.prototype,"buttons",void 0),t([ct({attribute:!1})],Ba.prototype,"onButtonClicked",void 0);class qa extends lt{constructor(){super(...arguments),this.header="",this.open=!1,this.fetching=!1,this.headers={},this.body=this.getLoading(),this.disabled=!1,this.buttons=[],this.wizardStep=0,this.wizardStepCount=0,this.suspendSubmit=!1}static get styles(){return r`
1197
1197
  fieldset {
1198
1198
  border: none;
1199
1199
  margin: 0;
@@ -1283,7 +1283,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1283
1283
  flex-direction: row;
1284
1284
  margin-left: 0.6em;
1285
1285
  }
1286
- `}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 D`<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:Ba.SECONDARY,name:"Cancel",closes:!0},{type:Ba.PRIMARY,name:t.value}]:[{type:Ba.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 n=i.getElementsByTagName("script"),o=[];for(let t=n.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=n[t].innerText;n[t].src&&-1===n[t].src.indexOf("web-dev-server")?(e.src=n[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},o.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),o.push(e)),n[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=Js(i.innerHTML)),this.updateComplete.then((()=>{for(const t of o)e.appendChild(t)})),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),te(this.endpoint,null,this.getHeaders()).then((t=>{0==t.body.indexOf("<!DOCTYPE HTML>")?document.location=t.url:(this.setBody(t.body),this.fetching=!1,this.updateComplete.then((()=>{this.updatePrimaryButton(),this.fireCustomEvent(Se.Loaded,{body:this.getBody()})})))}))}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 n=t.elements[i];if(n.name&&!n.disabled&&"file"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&"button"!==n.type)if("select-multiple"===n.type)for(let t=0;t<n.options.length;t++)n.options[t].selected&&n.options[t].value&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.options[t].value));else if("checkbox"!==n.type&&"radio"!==n.type||n.checked){let t=n.value;!t&&n.checked&&(t="1"),t&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(t))}}return e.join("&")}(e):"";t&&Object.keys(t).forEach((e=>{i+=(i.length>1?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t[e])})),re(this.endpoint,i,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?this.updateComplete.then((()=>{this.open=!1,this.fireCustomEvent(Se.Submitted)})):(this.fireCustomEvent(Se.Redirected,{url:e}),this.open=!1):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}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(D`<div
1286
+ `}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 D`<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:Ra.SECONDARY,name:"Cancel",closes:!0},{type:Ra.PRIMARY,name:t.value}]:[{type:Ra.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 n=i.getElementsByTagName("script"),o=[];for(let t=n.length-1;t>=0;t--){const e=this.ownerDocument.createElement("script"),i=n[t].innerText;n[t].src&&-1===n[t].src.indexOf("web-dev-server")?(e.src=n[t].src,e.type="text/javascript",e.async=!0,e.onload=function(){},o.push(e)):i&&(e.appendChild(this.ownerDocument.createTextNode(i)),o.push(e)),n[t].remove()}const s=!!i.querySelector(".success-script");return s||(this.body=Ys(i.innerHTML)),this.updateComplete.then((()=>{for(const t of o)e.appendChild(t)})),!s}getHeaders(){const t=this.headers;return t["X-PJAX"]=1,t}fetchForm(){this.fetching=!0,this.body=this.getLoading(),te(this.endpoint,null,this.getHeaders()).then((t=>{0==t.body.indexOf("<!DOCTYPE HTML>")?document.location=t.url:(this.setBody(t.body),this.fetching=!1,this.updateComplete.then((()=>{this.updatePrimaryButton(),this.fireCustomEvent(ke.Loaded,{body:this.getBody()})})))}))}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 n=t.elements[i];if(n.name&&!n.disabled&&"file"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&"button"!==n.type)if("select-multiple"===n.type)for(let t=0;t<n.options.length;t++)n.options[t].selected&&n.options[t].value&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(n.options[t].value));else if("checkbox"!==n.type&&"radio"!==n.type||n.checked){let t=n.value;!t&&n.checked&&(t="1"),t&&e.push(encodeURIComponent(n.name)+"="+encodeURIComponent(t))}}return e.join("&")}(e):"";t&&Object.keys(t).forEach((e=>{i+=(i.length>1?"&":"")+encodeURIComponent(e)+"="+encodeURIComponent(t[e])})),re(this.endpoint,i,this.getHeaders(),"application/x-www-form-urlencoded").then((t=>{window.setTimeout((()=>{let e=t.headers.get("temba-success");!e&&t.url&&-1===t.url.indexOf(this.endpoint)&&(e=t.url),e?"hide"===e?this.updateComplete.then((()=>{this.open=!1,this.fireCustomEvent(ke.Submitted)})):(this.fireCustomEvent(ke.Redirected,{url:e}),this.open=!1):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}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(D`<div
1287
1287
  data-goto-step=${i[e]}
1288
1288
  @click=${this.handleGotoStep.bind(this)}
1289
1289
  class="${ee({"step-ball":!0,active:this.wizardStep-1===e,complete:e<i.length})}"
@@ -1311,7 +1311,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1311
1311
  <div class="slot-wrapper" @click=${this.handleSlotClicked}>
1312
1312
  <slot></slot>
1313
1313
  </div>
1314
- `}}t([ct({type:String})],Ua.prototype,"header",void 0),t([ct({type:String})],Ua.prototype,"endpoint",void 0),t([ct({type:Boolean,reflect:!0})],Ua.prototype,"open",void 0),t([ct({type:Boolean})],Ua.prototype,"fetching",void 0),t([ct({type:Boolean})],Ua.prototype,"submitting",void 0),t([ct({type:String})],Ua.prototype,"primaryName",void 0),t([ct({type:String})],Ua.prototype,"cancelName",void 0),t([ct({type:String})],Ua.prototype,"onLoaded",void 0),t([ct({type:Boolean})],Ua.prototype,"noSubmit",void 0),t([ct({type:Object})],Ua.prototype,"headers",void 0),t([ct({type:String})],Ua.prototype,"body",void 0),t([ct({type:Boolean})],Ua.prototype,"disabled",void 0),t([ct({type:Array})],Ua.prototype,"buttons",void 0),t([ct({type:Number})],Ua.prototype,"wizardStep",void 0),t([ct({type:Number})],Ua.prototype,"wizardStepCount",void 0),t([ct({type:Boolean})],Ua.prototype,"suspendSubmit",void 0);class Za extends et{constructor(){super(...arguments),this.v=1}static get styles(){return r`
1314
+ `}}t([ct({type:String})],qa.prototype,"header",void 0),t([ct({type:String})],qa.prototype,"endpoint",void 0),t([ct({type:Boolean,reflect:!0})],qa.prototype,"open",void 0),t([ct({type:Boolean})],qa.prototype,"fetching",void 0),t([ct({type:Boolean})],qa.prototype,"submitting",void 0),t([ct({type:String})],qa.prototype,"primaryName",void 0),t([ct({type:String})],qa.prototype,"cancelName",void 0),t([ct({type:String})],qa.prototype,"onLoaded",void 0),t([ct({type:Boolean})],qa.prototype,"noSubmit",void 0),t([ct({type:Object})],qa.prototype,"headers",void 0),t([ct({type:String})],qa.prototype,"body",void 0),t([ct({type:Boolean})],qa.prototype,"disabled",void 0),t([ct({type:Array})],qa.prototype,"buttons",void 0),t([ct({type:Number})],qa.prototype,"wizardStep",void 0),t([ct({type:Number})],qa.prototype,"wizardStepCount",void 0),t([ct({type:Boolean})],qa.prototype,"suspendSubmit",void 0);class Ua extends et{constructor(){super(...arguments),this.v=1}static get styles(){return r`
1315
1315
  :host {
1316
1316
  display: inline-block;
1317
1317
  font-family: var(--font-family);
@@ -1469,7 +1469,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1469
1469
  <div class="button-name"><slot name="name">${t}</slot></div>
1470
1470
  </div>
1471
1471
  </div>
1472
- `}}t([ct({type:Boolean})],Za.prototype,"primary",void 0),t([ct({type:Boolean})],Za.prototype,"secondary",void 0),t([ct({type:Boolean})],Za.prototype,"attention",void 0),t([ct({type:Number})],Za.prototype,"v",void 0),t([ct({type:Boolean})],Za.prototype,"destructive",void 0),t([ct({type:Boolean})],Za.prototype,"light",void 0),t([ct()],Za.prototype,"name",void 0),t([ct({type:Boolean})],Za.prototype,"disabled",void 0),t([ct({type:Boolean})],Za.prototype,"submitting",void 0),t([ct({type:Boolean})],Za.prototype,"active",void 0),t([ct({type:Boolean})],Za.prototype,"small",void 0),t([ct({type:String})],Za.prototype,"href",void 0),t([ct({type:Number})],Za.prototype,"index",void 0);class Fa extends et{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return r`
1472
+ `}}t([ct({type:Boolean})],Ua.prototype,"primary",void 0),t([ct({type:Boolean})],Ua.prototype,"secondary",void 0),t([ct({type:Boolean})],Ua.prototype,"attention",void 0),t([ct({type:Number})],Ua.prototype,"v",void 0),t([ct({type:Boolean})],Ua.prototype,"destructive",void 0),t([ct({type:Boolean})],Ua.prototype,"light",void 0),t([ct()],Ua.prototype,"name",void 0),t([ct({type:Boolean})],Ua.prototype,"disabled",void 0),t([ct({type:Boolean})],Ua.prototype,"submitting",void 0),t([ct({type:Boolean})],Ua.prototype,"active",void 0),t([ct({type:Boolean})],Ua.prototype,"small",void 0),t([ct({type:String})],Ua.prototype,"href",void 0),t([ct({type:Number})],Ua.prototype,"index",void 0);class Za extends et{constructor(){super(...arguments),this.hideLabel=!1,this.widgetOnly=!1,this.errors=[],this.hideErrors=!1,this.helpText="",this.helpAlways=!0,this.label="",this.name="",this.disabled=!1}static get styles(){return r`
1473
1473
  :host {
1474
1474
  font-family: var(--font-family);
1475
1475
  }
@@ -1543,7 +1543,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1543
1543
  `:null}
1544
1544
  ${t}
1545
1545
  </div>
1546
- `}}t([ct({type:Boolean,attribute:"hide_label"})],Fa.prototype,"hideLabel",void 0),t([ct({type:Boolean,attribute:"widget_only"})],Fa.prototype,"widgetOnly",void 0),t([ct({type:Array,attribute:!1})],Fa.prototype,"errors",void 0),t([ct({type:Boolean})],Fa.prototype,"hideErrors",void 0),t([ct({type:String,attribute:"help_text"})],Fa.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],Fa.prototype,"helpAlways",void 0),t([ct({type:String})],Fa.prototype,"label",void 0),t([ct({type:String})],Fa.prototype,"name",void 0),t([ct({type:Boolean})],Fa.prototype,"disabled",void 0);class Va extends et{constructor(){super(...arguments),this.color="var(--color-primary-dark)",this.size=5,this.units=5,this.direction="row"}static get styles(){return r`
1546
+ `}}t([ct({type:Boolean,attribute:"hide_label"})],Za.prototype,"hideLabel",void 0),t([ct({type:Boolean,attribute:"widget_only"})],Za.prototype,"widgetOnly",void 0),t([ct({type:Array,attribute:!1})],Za.prototype,"errors",void 0),t([ct({type:Boolean})],Za.prototype,"hideErrors",void 0),t([ct({type:String,attribute:"help_text"})],Za.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],Za.prototype,"helpAlways",void 0),t([ct({type:String})],Za.prototype,"label",void 0),t([ct({type:String})],Za.prototype,"name",void 0),t([ct({type:Boolean})],Za.prototype,"disabled",void 0);class Fa extends et{constructor(){super(...arguments),this.color="var(--color-primary-dark)",this.size=5,this.units=5,this.direction="row"}static get styles(){return r`
1547
1547
  :host {
1548
1548
  display: block;
1549
1549
  }
@@ -1577,7 +1577,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1577
1577
  <div class="loading-unit" style=${_t(i)}></div>
1578
1578
  `}))}
1579
1579
  </div>
1580
- `;var e,i}}t([ct({type:String})],Va.prototype,"color",void 0),t([ct({type:Number})],Va.prototype,"size",void 0),t([ct({type:Number})],Va.prototype,"units",void 0),t([ct({type:Boolean})],Va.prototype,"square",void 0),t([ct({type:String})],Va.prototype,"direction",void 0);const ja=[10,12,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,163,164,165,167,191,196,197,198,199,201,209,214,216,220,223,224,228,229,230,232,233,236,241,242,246,248,249,252,915,916,920,923,926,928,931,934,936,937,8364],Ha=[12,91,92,93,94,123,124,125,126,8364];function Wa(t,e){const i=e.length;let n=0;for(;n<i;){if(t===e[n])return!0;n++}return!1}function Ga(t){return Wa(t.charCodeAt(0),ja)}function Ka(t){return t>=55296&&t<=56319}function Ya(t){return t>=55296&&t<=56319}const Ja=function(t,e={}){const i=e&&e.characterset;e={summary:e&&e.summary};const n=void 0===i&&function(t){for(let e=0;e<t.length;e++)if(!Ga(t.charAt(e)))return!1;return!0}(t)||"GSM"===i;let o,s,r,a;n?(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a="";function l(){const t={content:e.summary?void 0:a,length:n,bytes:o};i.push(t),r+=n,n=0,s+=o,o=0,a=""}for(let i=0,s=t.length;i<s;i++){let s=t.charAt(i);Ga(s)?Wa(s.charCodeAt(0),Ha)&&(152===o&&l(),o++):(Ka(s.charCodeAt(0))&&i++,s=" "),o++,n++,e.summary||(a+=s),153===o&&l()}return o>0&&l(),i[1]&&s<=160?{parts:[{content:e.summary?void 0:i[0].content+i[1].content,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=160,r=153,a=1):(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a=0;function l(l){const h={content:e.summary?void 0:l?t.substring(a,l+1):t.substring(a),length:n,bytes:o};i.push(h),a=l+1,r+=n,n=0,s+=o,o=0}for(let e=0,i=t.length;e<i;e++)Ya(t.charCodeAt(e))&&(132===o&&l(e-1),o+=2,e++),o+=2,n++,134===o&&l(e);return o>0&&l(),i[1]&&s<=140?{parts:[{content:e.summary?void 0:t,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=140,r=134,a=2);const l=function(t,e,i,n){return((1===t.length?e:i)-t[t.length-1].bytes)/n}(o.parts,s,r,a);return{characterSet:n?"GSM":"Unicode",parts:o.parts,bytes:o.totalBytes,length:o.totalLength,remainingInPart:l}},Xa={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,"\n":10,"\f":12,"\r":13," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,a:97,b:98,c:99,d:100,e:101,f:102,g:103,h:104,i:105,j:106,k:107,l:108,m:109,n:110,o:111,p:112,q:113,r:114,s:115,t:116,u:117,v:118,w:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,"¡":161,"£":163,"¤":164,"¥":165,"§":167,"¿":191,"Ä":196,"Å":197,"Æ":198,"Ç":199,"É":201,"Ñ":209,"Ö":214,"Ø":216,"Ü":220,"ß":223,"à":224,"ä":228,"å":229,"æ":230,"è":232,"é":233,"ì":236,"ñ":241,"ò":242,"ö":246,"ø":248,"ù":249,"ü":252,"Γ":915,"Δ":916,"Θ":920,"Λ":923,"Ξ":926,"Π":928,"Σ":931,"Φ":934,"Ψ":936,"Ω":937,"€":8364};class Qa extends lt{constructor(){super(...arguments),this.extended=[]}static get styles(){return r`
1580
+ `;var e,i}}t([ct({type:String})],Fa.prototype,"color",void 0),t([ct({type:Number})],Fa.prototype,"size",void 0),t([ct({type:Number})],Fa.prototype,"units",void 0),t([ct({type:Boolean})],Fa.prototype,"square",void 0),t([ct({type:String})],Fa.prototype,"direction",void 0);const Va=[10,12,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,163,164,165,167,191,196,197,198,199,201,209,214,216,220,223,224,228,229,230,232,233,236,241,242,246,248,249,252,915,916,920,923,926,928,931,934,936,937,8364],ja=[12,91,92,93,94,123,124,125,126,8364];function Ha(t,e){const i=e.length;let n=0;for(;n<i;){if(t===e[n])return!0;n++}return!1}function Wa(t){return Ha(t.charCodeAt(0),Va)}function Ga(t){return t>=55296&&t<=56319}function Ka(t){return t>=55296&&t<=56319}const Ya=function(t,e={}){const i=e&&e.characterset;e={summary:e&&e.summary};const n=void 0===i&&function(t){for(let e=0;e<t.length;e++)if(!Wa(t.charAt(e)))return!1;return!0}(t)||"GSM"===i;let o,s,r,a;n?(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a="";function l(){const t={content:e.summary?void 0:a,length:n,bytes:o};i.push(t),r+=n,n=0,s+=o,o=0,a=""}for(let i=0,s=t.length;i<s;i++){let s=t.charAt(i);Wa(s)?Ha(s.charCodeAt(0),ja)&&(152===o&&l(),o++):(Ga(s.charCodeAt(0))&&i++,s=" "),o++,n++,e.summary||(a+=s),153===o&&l()}return o>0&&l(),i[1]&&s<=160?{parts:[{content:e.summary?void 0:i[0].content+i[1].content,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=160,r=153,a=1):(o=function(t,e){if(e=e||{summary:!1},""===t)return{parts:[{content:e.summary?void 0:"",length:0,bytes:0}],totalLength:0,totalBytes:0};const i=[];let n=0,o=0,s=0,r=0,a=0;function l(l){const h={content:e.summary?void 0:l?t.substring(a,l+1):t.substring(a),length:n,bytes:o};i.push(h),a=l+1,r+=n,n=0,s+=o,o=0}for(let e=0,i=t.length;e<i;e++)Ka(t.charCodeAt(e))&&(132===o&&l(e-1),o+=2,e++),o+=2,n++,134===o&&l(e);return o>0&&l(),i[1]&&s<=140?{parts:[{content:e.summary?void 0:t,length:r,bytes:s}],totalLength:r,totalBytes:s}:{parts:i,totalLength:r,totalBytes:s}}(t,e),s=140,r=134,a=2);const l=function(t,e,i,n){return((1===t.length?e:i)-t[t.length-1].bytes)/n}(o.parts,s,r,a);return{characterSet:n?"GSM":"Unicode",parts:o.parts,bytes:o.totalBytes,length:o.totalLength,remainingInPart:l}},Ja={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,"\n":10,"\f":12,"\r":13," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,a:97,b:98,c:99,d:100,e:101,f:102,g:103,h:104,i:105,j:106,k:107,l:108,m:109,n:110,o:111,p:112,q:113,r:114,s:115,t:116,u:117,v:118,w:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,"¡":161,"£":163,"¤":164,"¥":165,"§":167,"¿":191,"Ä":196,"Å":197,"Æ":198,"Ç":199,"É":201,"Ñ":209,"Ö":214,"Ø":216,"Ü":220,"ß":223,"à":224,"ä":228,"å":229,"æ":230,"è":232,"é":233,"ì":236,"ñ":241,"ò":242,"ö":246,"ø":248,"ù":249,"ü":252,"Γ":915,"Δ":916,"Θ":920,"Λ":923,"Ξ":926,"Π":928,"Σ":931,"Φ":934,"Ψ":936,"Ω":937,"€":8364};class Xa extends lt{constructor(){super(...arguments),this.extended=[]}static get styles(){return r`
1581
1581
  :host {
1582
1582
  overflow: auto;
1583
1583
  }
@@ -1681,7 +1681,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1681
1681
  transform: scale(1);
1682
1682
  visibility: visible;
1683
1683
  }
1684
- `}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=Ja(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const n of t)i=n,Xa.hasOwnProperty(i)||(e[n]=!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=D`.`;e=this.segments>1?D`and will use ${t?D`at least`:null}
1684
+ `}updated(t){super.updated(t),t.has("text")&&this.updateSegments()}updateSegments(){const t=Ya(this.text);this.count=t.length,this.segments=t.parts.length,this.extended=(t=>{const e={};for(const n of t)i=n,Ja.hasOwnProperty(i)||(e[n]=!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=D`.`;e=this.segments>1?D`and will use ${t?D`at least`:null}
1685
1685
  <b>${this.segments} messages</b> to send over SMS.`:D`and will use ${t?D`at least`:null} one
1686
1686
  message to send over SMS.`;let i=null;this.extended.length>0&&(this.segments>1||t)&&(i=this.extended.map((t=>D`<div class="extended-char">${t}</div>`)),i=D`
1687
1687
  <div class="extended-warning">
@@ -1702,7 +1702,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1702
1702
  </div>`:null;return D`<div class="counter${i?" attention":""}"><div class="counts">${this.count}${this.segments>1||t?D`<div class="segments">
1703
1703
  &nbsp;/&nbsp;${this.segments}${t?D`+`:null}
1704
1704
  <div></div>
1705
- </div>`:null}</div> ${n}</div></div>`}}t([ct({type:String})],Qa.prototype,"text",void 0),t([ct({type:Number})],Qa.prototype,"count",void 0),t([ct({type:Number,attribute:!1})],Qa.prototype,"segments",void 0),t([ct({type:Object,attribute:!1})],Qa.prototype,"extended",void 0);class tl extends lt{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent(Se.Refreshed,{data:t.detail.data,previous:e})}}))}updated(t){super.updated(t),t.has("url")&&(this.url?this.store.makeRequest(this.url,{prepareData:this.prepareData}):this.data=null)}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.prepareData=this.prepareData.bind(this),this.store&&this.store.addEventListener(Se.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(Se.StoreUpdated,this.handleStoreUpdated)}render(){if(!this.store.ready&&this.showLoading)return D`<temba-loading></temba-loading>`}}t([ct({type:String})],tl.prototype,"url",void 0),t([ct({type:Boolean})],tl.prototype,"showLoading",void 0),t([ct({type:Object,attribute:!1})],tl.prototype,"data",void 0);class el extends tl{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}setContact(t){this.data=this.prepareData([t]),this.store.updateCache(`${this.endpoint}${this.contact}`,this.data)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([ct({type:String})],el.prototype,"contact",void 0),t([ct({type:Object,attribute:!1})],el.prototype,"data",void 0),t([ct({type:String})],el.prototype,"endpoint",void 0);class il extends el{static get styles(){return r`
1705
+ </div>`:null}</div> ${n}</div></div>`}}t([ct({type:String})],Xa.prototype,"text",void 0),t([ct({type:Number})],Xa.prototype,"count",void 0),t([ct({type:Number,attribute:!1})],Xa.prototype,"segments",void 0),t([ct({type:Object,attribute:!1})],Xa.prototype,"extended",void 0);class Qa extends lt{constructor(){super(...arguments),this.showLoading=!1}prepareData(t){return t}refresh(){this.store.makeRequest(this.url,{prepareData:this.prepareData,force:!0})}handleStoreUpdated(t){this.store.initialHttpComplete.then((()=>{if(t.detail.url===this.url){const e=this.data;this.data=t.detail.data,this.fireCustomEvent(ke.Refreshed,{data:t.detail.data,previous:e})}}))}updated(t){super.updated(t),t.has("url")&&(this.url?this.store.makeRequest(this.url,{prepareData:this.prepareData}):this.data=null)}connectedCallback(){super.connectedCallback(),this.store=document.querySelector("temba-store"),this.handleStoreUpdated=this.handleStoreUpdated.bind(this),this.prepareData=this.prepareData.bind(this),this.store&&this.store.addEventListener(ke.StoreUpdated,this.handleStoreUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.store&&this.store.removeEventListener(ke.StoreUpdated,this.handleStoreUpdated)}render(){if(!this.store.ready&&this.showLoading)return D`<temba-loading></temba-loading>`}}t([ct({type:String})],Qa.prototype,"url",void 0),t([ct({type:Boolean})],Qa.prototype,"showLoading",void 0),t([ct({type:Object,attribute:!1})],Qa.prototype,"data",void 0);class tl extends Qa{constructor(){super(...arguments),this.endpoint="/api/v2/contacts.json?uuid="}prepareData(t){return t&&t.length>0?((t=t[0]).groups.forEach((t=>{t.is_dynamic=this.store.isDynamicGroup(t.uuid)})),t.groups.sort(((t,e)=>{if(!t.is_dynamic||!e.is_dynamic){if(t.is_dynamic)return-1;if(e.is_dynamic)return 1}return t.name.localeCompare(e.name)})),t):null}setContact(t){this.data=this.prepareData([t]),this.store.updateCache(`${this.endpoint}${this.contact}`,this.data)}updated(t){super.updated(t),t.has("contact")&&(this.contact?this.url=`${this.endpoint}${this.contact}`:this.url=null)}}t([ct({type:String})],tl.prototype,"contact",void 0),t([ct({type:Object,attribute:!1})],tl.prototype,"data",void 0),t([ct({type:String})],tl.prototype,"endpoint",void 0);class el extends tl{static get styles(){return r`
1706
1706
  .left-pane {
1707
1707
  box-shadow: -13px 10px 7px 14px rgba(0, 0, 0, 0);
1708
1708
  transition: box-shadow 600ms linear;
@@ -1741,7 +1741,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1741
1741
  padding: 0.8em;
1742
1742
  display: flex;
1743
1743
  flex-direction: column;
1744
- z-index: 3;
1745
1744
  border-bottom-left-radius: var(--curvature);
1746
1745
  border-bottom-right-radius: var(--curvature);
1747
1746
  }
@@ -1780,12 +1779,9 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1780
1779
  --color-focus: transparent;
1781
1780
  --color-widget-bg-focused: transparent;
1782
1781
  }
1783
- `}constructor(){var t;super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.monitor=!1,this.currentTicket=null,this.currentContact=null,this.agent="",this.refreshInterval=null,this.showDetails=(t=fe.TICKET_SHOW_DETAILS,"true"===(me(t)||""))}connectedCallback(){super.connectedCallback(),this.monitor&&(this.refreshInterval=setInterval((()=>{this.currentTicket&&this.currentTicket.closed_on||this.refresh()}),1e4))}disconnectedCallback(){this.refreshInterval&&clearInterval(this.refreshInterval)}getContactHistory(){return this.shadowRoot.querySelector("temba-contact-history")}refresh(t=!1){const e=this.getContactHistory();e&&(t&&e.scrollToBottom(),e.refresh())}updated(t){super.updated(t),(t.has("data")||t.has("currentContact"))&&(this.currentContact=this.data)}handleSend(t){const e=t.detail.name;if("Send"===e){const i={contact:this.currentContact.uuid},n=t.currentTarget;if(n){const t=n.currentText;t&&t.length>0&&(i.text=t);const e=n.currentAttachments;if(e&&e.length>0){const t=e.map((t=>t.uuid));i.attachments=t}}this.currentTicket&&(i.ticket=this.currentTicket.uuid);const o=e+" failed, please try again.";ae("/api/v2/messages.json",i).then((t=>{if(t.status<400)n.reset(),this.refresh(!0),this.fireCustomEvent(Se.MessageSent,{msg:i});else if(t.status<500)if(t.json.text&&t.json.text.length>0&&t.json.text[0].length>0){let e=t.json.text[0];e=e.replace("Ensure this field has no more than","Maximum allowed text is"),n.buttonError=e}else if(t.json.attachments&&t.json.attachments.length>0&&t.json.attachments[0].length>0){let e=t.json.attachments[0];e=e.replace("Ensure this field has no more than","Maximum allowed attachments is").replace("elements","files"),n.buttonError=e}else n.buttonError=o;else n.buttonError=o})).catch((t=>{console.error(t),n.buttonError=o}))}}render(){const t=this.currentContact?this.getTembaContactHistory():null,e=this.currentContact?this.getTembaChatbox():null,i=D`<div
1784
- style="flex-grow: 1; margin-right: 0em; display:flex; flex-direction:row; min-height: 0;"
1785
- class="left-pane ${this.showDetails?"open":""}"
1786
- >
1782
+ `}constructor(){super(),this.contactsEndpoint="/api/v2/contacts.json",this.currentNote="",this.showDetails=!0,this.monitor=!1,this.currentTicket=null,this.currentContact=null,this.agent="",this.refreshInterval=null}connectedCallback(){super.connectedCallback(),this.monitor&&(this.refreshInterval=setInterval((()=>{this.currentTicket&&this.currentTicket.closed_on||this.refresh()}),1e4))}disconnectedCallback(){this.refreshInterval&&clearInterval(this.refreshInterval)}getContactHistory(){return this.shadowRoot.querySelector("temba-contact-history")}refresh(t=!1){const e=this.getContactHistory();e&&(t&&e.scrollToBottom(),e.refresh())}updated(t){super.updated(t),(t.has("data")||t.has("currentContact"))&&(this.currentContact=this.data)}handleSend(t){const e=t.detail.name;if("Send"===e){const i={contact:this.currentContact.uuid},n=t.currentTarget;if(n){const t=n.currentText;t&&t.length>0&&(i.text=t);const e=n.currentAttachments;if(e&&e.length>0){const t=e.map((t=>t.uuid));i.attachments=t}}this.currentTicket&&(i.ticket=this.currentTicket.uuid);const o=e+" failed, please try again.";ae("/api/v2/messages.json",i).then((t=>{if(t.status<400)n.reset(),this.refresh(!0),this.fireCustomEvent(ke.MessageSent,{msg:i});else if(t.status<500)if(t.json.text&&t.json.text.length>0&&t.json.text[0].length>0){let e=t.json.text[0];e=e.replace("Ensure this field has no more than","Maximum allowed text is"),n.buttonError=e}else if(t.json.attachments&&t.json.attachments.length>0&&t.json.attachments[0].length>0){let e=t.json.attachments[0];e=e.replace("Ensure this field has no more than","Maximum allowed attachments is").replace("elements","files"),n.buttonError=e}else n.buttonError=o;else n.buttonError=o})).catch((t=>{console.error(t),n.buttonError=o}))}}render(){const t=this.currentContact?this.getTembaContactHistory():null,e=this.currentContact?this.getTembaChatbox():null,i=D`
1787
1783
  <div class="chat-wrapper">${t} ${e}</div>
1788
- </div>`;return D`${i}`}getTembaContactHistory(){return D` <temba-contact-history
1784
+ `;return D`${i}`}getTembaContactHistory(){return D` <temba-contact-history
1789
1785
  .uuid=${this.currentContact.uuid}
1790
1786
  .contact=${this.currentContact}
1791
1787
  .ticket=${this.currentTicket?this.currentTicket.uuid:null}
@@ -1801,9 +1797,9 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1801
1797
  @temba-button-clicked=${this.handleSend.bind(this)}
1802
1798
  >
1803
1799
  </temba-compose>
1804
- </div>`}}t([ct({type:String,attribute:"ticket"})],il.prototype,"ticketUUID",void 0),t([ct({type:String})],il.prototype,"contactsEndpoint",void 0),t([ct({type:String})],il.prototype,"currentNote",void 0),t([ct({type:Boolean})],il.prototype,"showDetails",void 0),t([ct({type:Boolean})],il.prototype,"monitor",void 0),t([ct({type:Object})],il.prototype,"currentTicket",void 0),t([ct({type:Object})],il.prototype,"currentContact",void 0),t([ct({type:String})],il.prototype,"agent",void 0);let nl=[];const ol=(t,e,i,n,o)=>(t&&(nl.forEach((t=>{t.abort()})),nl=[]),new Promise((t=>{const s=new AbortController;nl.push(s);let r=e;n&&(r+=`&before=${n}`),o&&(r+=`&after=${o}`),i&&(r+=`&ticket=${i}`),te(r,s).then((e=>{nl=nl.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),sl=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var rl;!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.OPTIN_REQUESTED="optin_requested",t.ERROR="error",t.FAILURE="failure"}(rl||(rl={}));const al=(t,e)=>{if(!t)return"messages";switch(t.type){case rl.TICKET_ASSIGNED:case rl.TICKET_OPENED:case rl.TICKET_CLOSED:case rl.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case rl.FLOW_ENTERED:case rl.FLOW_EXITED:return"flows";case rl.BROADCAST_CREATED:case rl.MESSAGE_CREATED:case rl.MESSAGE_RECEIVED:case rl.IVR_CREATED:case rl.TICKET_NOTE_ADDED:case rl.NOTE_CREATED:return"messages"}return"verbose"},ll=t=>D`<div style="width:3.5em;font-size:0.8em">
1805
- ${_e({user:t,position:"left"})}
1806
- </div>`,hl=(t,e)=>{const i=t.type===rl.MESSAGE_RECEIVED,n="E"===t.status,o="F"===t.status,s=[];return t.logs_url?s.push(D` <div class="icon-link">
1800
+ </div>`}}t([ct({type:String,attribute:"ticket"})],el.prototype,"ticketUUID",void 0),t([ct({type:String})],el.prototype,"contactsEndpoint",void 0),t([ct({type:String})],el.prototype,"currentNote",void 0),t([ct({type:Boolean})],el.prototype,"showDetails",void 0),t([ct({type:Boolean})],el.prototype,"monitor",void 0),t([ct({type:Object})],el.prototype,"currentTicket",void 0),t([ct({type:Object})],el.prototype,"currentContact",void 0),t([ct({type:String})],el.prototype,"agent",void 0);let il=[];const nl=(t,e,i,n,o)=>(t&&(il.forEach((t=>{t.abort()})),il=[]),new Promise((t=>{const s=new AbortController;il.push(s);let r=e;n&&(r+=`&before=${n}`),o&&(r+=`&after=${o}`),i&&(r+=`&ticket=${i}`),te(r,s).then((e=>{il=il.filter((t=>e.controller===t)),t(e.json)})).catch((()=>{}))}))),ol=t=>t?t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.first_name?t.first_name:t.email:"Somebody";var sl;!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.OPTIN_REQUESTED="optin_requested",t.ERROR="error",t.FAILURE="failure"}(sl||(sl={}));const rl=(t,e)=>{if(!t)return"messages";switch(t.type){case sl.TICKET_ASSIGNED:case sl.TICKET_OPENED:case sl.TICKET_CLOSED:case sl.TICKET_REOPENED:if(!e)return"verbose";if(t.ticket.uuid===e)return"tickets";break;case sl.FLOW_ENTERED:case sl.FLOW_EXITED:return"flows";case sl.BROADCAST_CREATED:case sl.MESSAGE_CREATED:case sl.MESSAGE_RECEIVED:case sl.IVR_CREATED:case sl.TICKET_NOTE_ADDED:case sl.NOTE_CREATED:return"messages"}return"verbose"},al=t=>D`<div style="width:3.5em;font-size:0.8em">
1801
+ ${be({user:t,position:"left"})}
1802
+ </div>`,ll=(t,e)=>{const i=t.type===sl.MESSAGE_RECEIVED,n="E"===t.status,o="F"===t.status,s=[];return t.logs_url?s.push(D` <div class="icon-link">
1807
1803
  <temba-icon
1808
1804
  onclick="goto(event)"
1809
1805
  href="${t.logs_url}"
@@ -1881,18 +1877,18 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1881
1877
  </div>
1882
1878
 
1883
1879
  ${!i&&t.created_by?D`<div style="margin-left:0.8em;margin-top:0.3em;font-size:0.9em">
1884
- ${ll(t.created_by)}
1880
+ ${al(t.created_by)}
1885
1881
  </div>`:null}
1886
- </div>`},cl=t=>D`
1882
+ </div>`},hl=t=>D`
1887
1883
  <temba-icon name="${pt.label}"></temba-icon>
1888
1884
  <div class="description">
1889
1885
  Message labeled with
1890
1886
  <div class="attn">${((t,e="and")=>pe(t,(t=>t.name),e))(t.labels,"and")}</div>
1891
1887
  </div>
1892
- `,dl=t=>{let e=pt.inbox;return t.ticket.ticketer.name.indexOf("Email")>-1?e=pt.email:t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e=pt.zendesk),e},ul=(t,e,i)=>{new Date(t.created_on);const n=dl(t);return i?D`<div class="" style="display: flex">
1888
+ `,cl=t=>{let e=pt.inbox;return t.ticket.ticketer.name.indexOf("Email")>-1?e=pt.email:t.ticket.ticketer.name.indexOf("Zendesk")>-1&&(e=pt.zendesk),e},dl=(t,e,i)=>{new Date(t.created_on);const n=cl(t);return i?D`<div class="" style="display: flex">
1893
1889
  <temba-icon name="${n}"></temba-icon>
1894
1890
  <div class="description">
1895
- ${sl(t.created_by)} ${e} a
1891
+ ${ol(t.created_by)} ${e} a
1896
1892
  <span
1897
1893
  onclick="goto(event)"
1898
1894
  class="linked"
@@ -1904,7 +1900,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1904
1900
  </div>`:D`
1905
1901
  <div class="assigned active">
1906
1902
  <div style="text-align:center">
1907
- ${t.created_by?D` ${sl(t.created_by)} ${e} this ticket `:D` This ticket was ${e} `}
1903
+ ${t.created_by?D` ${ol(t.created_by)} ${e} this ticket `:D` This ticket was ${e} `}
1908
1904
  </div>
1909
1905
  <div class="subtext" style="justify-content:center">
1910
1906
  <temba-date
@@ -1914,7 +1910,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1914
1910
  ></temba-date>
1915
1911
  </div>
1916
1912
  </div>
1917
- `},pl=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class ml extends lt{constructor(){super(),this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",pl,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",pl,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return r`
1913
+ `},ul=function(t){const e=t.target,i=this.host.getEventsPane();"IMG"==e.tagName&&(this.host.showMessageAlert||i.scrollTop>e.offsetTop-1e3&&e.offsetTop>i.scrollHeight-500&&this.host.scrollToBottom())};class pl extends lt{constructor(){super(),this.eventGroups=[],this.refreshing=!1,this.fetching=!1,this.complete=!1,this.debug=!1,this.showMessageAlert=!1,this.ticket=null,this.endDate=null,this.tickets=null,this.ticketEvents={},this.lastHeight=0,this.refreshTimeout=null,this.empty=!1}connectedCallback(){super.connectedCallback(),this.shadowRoot.addEventListener("load",ul,!0)}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot.removeEventListener("load",ul,!0)}getTicketForEvent(t){return this.getTicket(t.ticket.uuid)}getTicket(t){return(this.tickets||[]).find((e=>e.uuid===t))}static get styles(){return r`
1918
1914
  ${r`
1919
1915
  .grouping {
1920
1916
  margin-top: 1em;
@@ -2462,7 +2458,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2462
2458
  .attachment img {
2463
2459
  cursor: pointer;
2464
2460
  }
2465
- `}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&t.get("mostRecentEvent")&&this.mostRecentEvent&&this.fireCustomEvent(Se.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;ol(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===rl.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=ol(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===rl.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events?t.events.reverse():[];if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}t.has("endpoint")&&this.endpoint&&(this.fetching=!0,this.empty=!0)}refreshTickets(){if(this.ticket){let t=`/api/v2/tickets.json?contact=${this.uuid}`;this.ticket&&(t=`${t}&ticket=${this.ticket}`),se(t).then((t=>{this.tickets=t.reverse()}))}}getEventsPane(){return this.getDiv(".events")}scrollToBottom(t=!1){const e=this.getEventsPane();e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"}),this.showMessageAlert=!1,window.setTimeout((()=>{e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})}),0)}refresh(){this.scheduleRefresh(500)}getEventGroups(t){const e=[];let i;for(const n of t){const t=al(n,this.ticket);i&&i.type===t?i.events.push(n):(i&&e.push(i),i={open:!1,events:[n],type:t})}return i&&i.events.length>0&&e.push(i),e}scheduleRefresh(t=-1){if(this.endDate)return;let e=t;if(-1===t){const t=this.getLastEventTime();e=Math.max(Math.min(((new Date).getTime()-t)/2,1e4),500)}t>-1&&this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshing?(this.scheduleRefresh(),this.refreshing=!1):this.refreshing=!0}),e)}reset(){this.endpoint=null,this.tickets=null,this.ticketEvents={},this.eventGroups=[],this.fetching=!1,this.complete=!1,this.nextBefore=null,this.nextAfter=null,this.lastHeight=0}handleEventGroupShow(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!0,this.requestUpdate("eventGroups")}handleEventGroupHide(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!1,this.requestUpdate("eventGroups")}handleScroll(){this.getEventsPane().scrollTop<=100&&this.eventGroups.length>0&&!this.fetching&&!this.complete&&(this.fetching=!0)}updateMostRecent(t){this.mostRecentEvent&&this.mostRecentEvent.type===t.type&&this.mostRecentEvent.created_on===t.created_on||(this.mostRecentEvent=t)}getLastEventTime(){const t=this.eventGroups[this.eventGroups.length-1];if(t){const e=t.events[t.events.length-1];return new Date(e.created_on).getTime()}return 0}renderEvent(t){switch(t.type){case rl.IVR_CREATED:case rl.MESSAGE_CREATED:case rl.MESSAGE_RECEIVED:case rl.BROADCAST_CREATED:return hl(t,this.agent);case rl.FLOW_ENTERED:case rl.FLOW_EXITED:return(t=>{let e="Interrupted",i=pt.flow_interrupted;return"I"!==t.status&&(t.type===rl.FLOW_ENTERED?(e="Started",i=pt.flow):(e="Completed",i=pt.flow)),D`
2461
+ `}firstUpdated(t){super.firstUpdated(t),this.handleClose=this.handleClose.bind(this)}updated(t){if(super.updated(t),t.has("mostRecentEvent")&&t.get("mostRecentEvent")&&this.mostRecentEvent&&this.fireCustomEvent(ke.Refreshed),t.has("endDate")&&this.refreshTimeout&&this.endDate&&window.clearTimeout(this.refreshTimeout),t.has("uuid"))if(null==this.uuid)this.reset();else{const t=`/contact/history/${this.uuid}/?_format=json`;if(this.endpoint!==t){if(this.reset(),this.endDate){const t=new Date(this.endDate);this.nextBefore=1e3*t.getTime()+1e3}this.endpoint=t,this.refreshTickets()}}if(t.has("ticket")&&(this.endpoint=null,this.requestUpdate("uuid")),t.has("refreshing")&&this.refreshing&&this.endpoint&&!this.endDate){const t=1e3*(this.getLastEventTime()-1);let e=!1;nl(!1,this.endpoint,this.ticket,null,t).then((t=>{t.events&&t.events.length>0&&this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===sl.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}}));let i=t.events.reverse();i=i.filter((t=>{const e=!!this.eventGroups.find((e=>!!e.events.find((e=>e.created_on===t.created_on&&e.type===t.type))));return!e})),this.lastRefreshAdded=i.length;const n=[...this.eventGroups];if(this.eventGroups.length>0){const t=n.splice(n.length-1,1)[0];e=t.open,i.splice(0,0,...t.events)}const o=this.getEventGroups(i);o.length&&(e&&(o[o.length-1].open=e),this.eventGroups=[...n,...o]),this.refreshing=!1,this.scheduleRefresh()})).catch((()=>{this.refreshing=!1,this.scheduleRefresh()}))}if(t.has("fetching")&&this.fetching&&(this.nextBefore||(this.nextBefore=1e3*(new Date).getTime()-1e3),this.httpComplete=nl(this.empty,this.endpoint,this.ticket,this.nextBefore,this.nextAfter).then((t=>{t.events&&t.events.length>0&&(this.updateMostRecent(t.events[0]),t.events.forEach((t=>{if(t.type===sl.TICKET_OPENED){const e=t;this.ticketEvents[e.ticket.uuid]=e}})));let e=!1;const i=t.events?t.events.reverse():[];if(this.eventGroups.length>0){const t=this.eventGroups.splice(0,1)[0];e=t.open,i.push(...t.events)}const n=this.getEventGroups(i);n.length&&(e&&(n[n.length-1].open=e),this.eventGroups=[...n,...this.eventGroups]),t.next_before===this.nextBefore&&(this.complete=!0),this.nextBefore=t.next_before,this.nextAfter=t.next_after,this.fetching=!1,this.empty=!1}))),t.has("refreshing")&&!this.refreshing&&this.lastRefreshAdded>0){const t=this.getEventsPane();if(this.lastHeight>0){const e=t.scrollHeight-this.lastHeight;t.scrollHeight-t.scrollTop-e-t.clientHeight<500?this.scrollToBottom():this.showMessageAlert=!0}this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}if(t.has("fetching")&&!this.fetching&&void 0!==t.get("fetching")){const t=this.getEventsPane();if(this.lastHeight&&t.scrollHeight>this.lastHeight){const e=t.scrollTop+t.scrollHeight-this.lastHeight;t.scrollTop=e}this.lastHeight||this.scrollToBottom(),this.eventGroups.length>0&&(this.lastHeight=t.scrollHeight)}t.has("endpoint")&&this.endpoint&&(this.fetching=!0,this.empty=!0)}refreshTickets(){if(this.ticket){let t=`/api/v2/tickets.json?contact=${this.uuid}`;this.ticket&&(t=`${t}&ticket=${this.ticket}`),se(t).then((t=>{this.tickets=t.reverse()}))}}getEventsPane(){return this.getDiv(".events")}scrollToBottom(t=!1){const e=this.getEventsPane();e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"}),this.showMessageAlert=!1,window.setTimeout((()=>{e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})}),0)}refresh(){this.scheduleRefresh(500)}getEventGroups(t){const e=[];let i;for(const n of t){const t=rl(n,this.ticket);i&&i.type===t?i.events.push(n):(i&&e.push(i),i={open:!1,events:[n],type:t})}return i&&i.events.length>0&&e.push(i),e}scheduleRefresh(t=-1){if(this.endDate)return;let e=t;if(-1===t){const t=this.getLastEventTime();e=Math.max(Math.min(((new Date).getTime()-t)/2,1e4),500)}t>-1&&this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=window.setTimeout((()=>{this.refreshing?(this.scheduleRefresh(),this.refreshing=!1):this.refreshing=!0}),e)}reset(){this.endpoint=null,this.tickets=null,this.ticketEvents={},this.eventGroups=[],this.fetching=!1,this.complete=!1,this.nextBefore=null,this.nextAfter=null,this.lastHeight=0}handleEventGroupShow(t){const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!0,this.requestUpdate("eventGroups")}handleEventGroupHide(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget,i=parseInt(e.getAttribute("data-group-index"));this.eventGroups[this.eventGroups.length-i-1].open=!1,this.requestUpdate("eventGroups")}handleScroll(){this.getEventsPane().scrollTop<=100&&this.eventGroups.length>0&&!this.fetching&&!this.complete&&(this.fetching=!0)}updateMostRecent(t){this.mostRecentEvent&&this.mostRecentEvent.type===t.type&&this.mostRecentEvent.created_on===t.created_on||(this.mostRecentEvent=t)}getLastEventTime(){const t=this.eventGroups[this.eventGroups.length-1];if(t){const e=t.events[t.events.length-1];return new Date(e.created_on).getTime()}return 0}renderEvent(t){switch(t.type){case sl.IVR_CREATED:case sl.MESSAGE_CREATED:case sl.MESSAGE_RECEIVED:case sl.BROADCAST_CREATED:return ll(t,this.agent);case sl.FLOW_ENTERED:case sl.FLOW_EXITED:return(t=>{let e="Interrupted",i=pt.flow_interrupted;return"I"!==t.status&&(t.type===sl.FLOW_ENTERED?(e="Started",i=pt.flow):(e="Completed",i=pt.flow)),D`
2466
2462
  <temba-icon name="${i}"></temba-icon>
2467
2463
  <div class="description">
2468
2464
  ${e}
@@ -2474,7 +2470,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2474
2470
  ${t.flow.name}
2475
2471
  </span>
2476
2472
  </div>
2477
- `})(t);case rl.RUN_RESULT_CHANGED:return(t=>t.name.startsWith("_")?null:D`
2473
+ `})(t);case sl.RUN_RESULT_CHANGED:return(t=>t.name.startsWith("_")?null:D`
2478
2474
  <temba-icon name="${pt.updated}"></temba-icon>
2479
2475
  <div class="description">
2480
2476
  Updated
@@ -2484,7 +2480,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2484
2480
  ${t.category?D`with category
2485
2481
  <div class="attn">${t.category}</div>`:null}
2486
2482
  </div>
2487
- `)(t);case rl.CONTACT_FIELD_CHANGED:return(t=>D`
2483
+ `)(t);case sl.CONTACT_FIELD_CHANGED:return(t=>D`
2488
2484
  <temba-icon name="${pt.contact_updated}"></temba-icon>
2489
2485
  <div class="description">
2490
2486
  ${t.value?D`Updated
@@ -2493,7 +2489,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2493
2489
  <div class="attn">${t.value.text}</div>`:D`Cleared
2494
2490
  <div class="attn">${t.field.name}</div>`}
2495
2491
  </div>
2496
- `)(t);case rl.CONTACT_NAME_CHANGED:return(t=>D`
2492
+ `)(t);case sl.CONTACT_NAME_CHANGED:return(t=>D`
2497
2493
  <temba-icon name="${pt.contact_updated}"></temba-icon>
2498
2494
  <div class="description">
2499
2495
  Updated
@@ -2501,7 +2497,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2501
2497
  to
2502
2498
  <div class="attn">${t.name}</div>
2503
2499
  </div>
2504
- `)(t);case rl.CONTACT_URNS_CHANGED:return(t=>D`
2500
+ `)(t);case sl.CONTACT_URNS_CHANGED:return(t=>D`
2505
2501
  <temba-icon name="${pt.contact_updated}"></temba-icon>
2506
2502
  <div class="description">
2507
2503
  Updated
@@ -2510,7 +2506,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2510
2506
  ${pe(t.urns,(t=>D`<div class="attn">${t.split(":")[1].split("?")[0]}</div>`))}
2511
2507
  </div>
2512
2508
  </div>
2513
- `)(t);case rl.EMAIL_SENT:return(t=>D`
2509
+ `)(t);case sl.EMAIL_SENT:return(t=>D`
2514
2510
  <temba-icon name="${pt.email}"></temba-icon>
2515
2511
  <div class="description">
2516
2512
  Email sent to
@@ -2518,7 +2514,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2518
2514
  with subject
2519
2515
  <div class="attn">${t.subject}</div>
2520
2516
  </div>
2521
- `)(t);case rl.INPUT_LABELS_ADDED:return cl(t);case rl.TICKET_OPENED:return ul(t,"opened",!this.ticket);case rl.TICKET_NOTE_ADDED:return(t=>D` <div style="display:flex;align-items:flex-start">
2517
+ `)(t);case sl.INPUT_LABELS_ADDED:return hl(t);case sl.TICKET_OPENED:return dl(t,"opened",!this.ticket);case sl.TICKET_NOTE_ADDED:return(t=>D` <div style="display:flex;align-items:flex-start">
2522
2518
  <div style="display:flex;flex-direction:column">
2523
2519
  <div class="description">${t.note}</div>
2524
2520
  <div class="note-summary">
@@ -2531,13 +2527,13 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2531
2527
  </div>
2532
2528
  </div>
2533
2529
  <div style="margin-left:0.8em;margin-top:0.3em;font-size:0.8em">
2534
- ${ll(t.created_by)}
2530
+ ${al(t.created_by)}
2535
2531
  </div>
2536
- </div>`)(t);case rl.TICKET_ASSIGNED:return(t=>D`
2532
+ </div>`)(t);case sl.TICKET_ASSIGNED:return(t=>D`
2537
2533
  <div class="assigned active">
2538
2534
  <div style="text-align:center">
2539
- ${t.assignee?t.assignee.id===t.created_by.id?D`${sl(t.created_by)} took this ticket`:D`${sl(t.created_by)} assigned this ticket to
2540
- <div class="attn">${sl(t.assignee)}</div>`:D`${sl(t.created_by)} unassigned this ticket`}
2535
+ ${t.assignee?t.assignee.id===t.created_by.id?D`${ol(t.created_by)} took this ticket`:D`${ol(t.created_by)} assigned this ticket to
2536
+ <div class="attn">${ol(t.assignee)}</div>`:D`${ol(t.created_by)} unassigned this ticket`}
2541
2537
  </div>
2542
2538
  <div class="subtext" style="justify-content:center">
2543
2539
  <temba-date
@@ -2547,16 +2543,16 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2547
2543
  ></temba-date>
2548
2544
  </div>
2549
2545
  </div>
2550
- `)(t);case rl.TICKET_REOPENED:return ul(t,"reopened",!this.ticket);case rl.TICKET_CLOSED:return ul(t,"closed",!this.ticket);case rl.ERROR:case rl.FAILURE:return(t=>D`
2546
+ `)(t);case sl.TICKET_REOPENED:return dl(t,"reopened",!this.ticket);case sl.TICKET_CLOSED:return dl(t,"closed",!this.ticket);case sl.ERROR:case sl.FAILURE:return(t=>D`
2551
2547
  <temba-icon
2552
2548
  name="${pt.error}"
2553
2549
  style="--icon-color:var(--color-error)"
2554
2550
  ></temba-icon>
2555
2551
  <div class="description">
2556
2552
  ${t.text}
2557
- ${t.type===rl.FAILURE?D`<div>Run ended prematurely, check the flow design.</div>`:null}
2553
+ ${t.type===sl.FAILURE?D`<div>Run ended prematurely, check the flow design.</div>`:null}
2558
2554
  </div>
2559
- `)(t);case rl.CONTACT_GROUPS_CHANGED:return(t=>{const e=t.groups_added||t.groups_removed,i=!!t.groups_added;return D`
2555
+ `)(t);case sl.CONTACT_GROUPS_CHANGED:return(t=>{const e=t.groups_added||t.groups_removed,i=!!t.groups_added;return D`
2560
2556
  <temba-icon
2561
2557
  name="${pt.users}"
2562
2558
  class="${ee({added:i,removed:!i})}"
@@ -2569,9 +2565,9 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2569
2565
  href="/contact/filter/${t.uuid}"
2570
2566
  >${t.name}</span
2571
2567
  >`))}
2572
- ${t.type===rl.FAILURE?D`<div>Run ended prematurely, check the flow design.</div>`:null}
2568
+ ${t.type===sl.FAILURE?D`<div>Run ended prematurely, check the flow design.</div>`:null}
2573
2569
  </div>
2574
- `})(t);case rl.WEBHOOK_CALLED:return(t=>D`
2570
+ `})(t);case sl.WEBHOOK_CALLED:return(t=>D`
2575
2571
  <div
2576
2572
  class="${"success"===t.status?"":"failed"}"
2577
2573
  style="display: flex"
@@ -2581,7 +2577,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2581
2577
  ${"success"===t.status?D`Successfully called ${t.url}`:D`Failed to call ${t.url}`}
2582
2578
  </div>
2583
2579
  </div>
2584
- `)(t);case rl.AIRTIME_TRANSFERRED:return(t=>0===parseFloat(t.actual_amount)?D`<temba-icon
2580
+ `)(t);case sl.AIRTIME_TRANSFERRED:return(t=>0===parseFloat(t.actual_amount)?D`<temba-icon
2585
2581
  name="${pt.error}"
2586
2582
  style="--icon-color: var(--color-error)"
2587
2583
  ></temba-icon>
@@ -2590,8 +2586,8 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2590
2586
  Transferred
2591
2587
  <div class="attn">${t.actual_amount} ${t.currency}</div>
2592
2588
  of airtime
2593
- </div>`)(t);case rl.CALL_STARTED:return D`<temba-icon name="${pt.call}"></temba-icon>
2594
- <div class="description">Call Started</div>`;case rl.CAMPAIGN_FIRED:return(t=>D`<temba-icon name="${pt.campaign}"></temba-icon>
2589
+ </div>`)(t);case sl.CALL_STARTED:return D`<temba-icon name="${pt.call}"></temba-icon>
2590
+ <div class="description">Call Started</div>`;case sl.CAMPAIGN_FIRED:return(t=>D`<temba-icon name="${pt.campaign}"></temba-icon>
2595
2591
  <div class="description">
2596
2592
  Campaign
2597
2593
  <span
@@ -2609,16 +2605,16 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2609
2605
  ${t.campaign_event.offset_display}
2610
2606
  ${t.campaign_event.relative_to.name}</span
2611
2607
  >
2612
- </div>`)(t);case rl.CHANNEL_EVENT:return(t=>{let e="",i=pt.call;return"mt_miss"===t.event.type?(e="Missed outgoing call",i=pt.call_missed):"mo_miss"===t.event.type?(e="Missed incoming call",i=pt.call_missed):"new_conversation"===t.event.type?(e="Started Conversation",i=pt.event):"welcome_message"===t.channel_event_type?(e="Welcome Message Sent",i=pt.event):"referral"===t.event.type?(e="Referred",i=pt.event):"follow"===t.event.type?(e="Followed",i=pt.event):"stop_contact"===t.event.type?(e="Stopped",i=pt.contact_stopped):"mt_call"===t.event.type?e="Outgoing Phone Call":"mo_call"==t.event.type?e="Incoming Phone call":"optin"==t.event.type?(e=D`Opted in to
2613
- <span class="attn">${t.event.optin.name}</span>`,i=pt.optin):"optout"==t.event.type&&(e=D`Opted out of
2614
- <span class="attn">${t.event.optin.name}</span>`,i=pt.optout),D`<temba-icon name="${i}"></temba-icon>
2615
- <div class="description">${e}</div>`})(t);case rl.CONTACT_LANGUAGE_CHANGED:return(t=>D`<temba-icon name="${pt.contact_updated}"></temba-icon>
2608
+ </div>`)(t);case sl.CHANNEL_EVENT:return(t=>{var e,i;let n="",o=pt.call;return"mt_miss"===t.event.type?(n="Missed outgoing call",o=pt.call_missed):"mo_miss"===t.event.type?(n="Missed incoming call",o=pt.call_missed):"new_conversation"===t.event.type?(n="Started Conversation",o=pt.event):"welcome_message"===t.channel_event_type?(n="Welcome Message Sent",o=pt.event):"referral"===t.event.type?(n="Referred",o=pt.event):"follow"===t.event.type?(n="Followed",o=pt.event):"stop_contact"===t.event.type?(n="Stopped",o=pt.contact_stopped):"mt_call"===t.event.type?n="Outgoing Phone Call":"mo_call"==t.event.type?n="Incoming Phone call":"optin"==t.event.type?(n=D`Opted in to
2609
+ <span class="attn">${null===(e=t.event.optin)||void 0===e?void 0:e.name}</span>`,o=pt.optin):"optout"==t.event.type&&(n=D`Opted out of
2610
+ <span class="attn">${null===(i=t.event.optin)||void 0===i?void 0:i.name}</span>`,o=pt.optout),D`<temba-icon name="${o}"></temba-icon>
2611
+ <div class="description">${n}</div>`})(t);case sl.CONTACT_LANGUAGE_CHANGED:return(t=>D`<temba-icon name="${pt.contact_updated}"></temba-icon>
2616
2612
  <div class="description">
2617
2613
  Language updated to <span class="attn">${t.language}</span>
2618
- </div>`)(t);case rl.OPTIN_REQUESTED:return(t=>D`<temba-icon name="${pt.optin_requested}"></temba-icon>
2614
+ </div>`)(t);case sl.OPTIN_REQUESTED:return(t=>D`<temba-icon name="${pt.optin_requested}"></temba-icon>
2619
2615
  <div class="description">
2620
2616
  Requested opt-in for <span class="attn">${t.optin.name}</span>
2621
- </div>`)(t)}return D`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=ae("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(Se.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=se(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(Se.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(Se.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:de(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}handleEventClicked(t){const e=t.target;if("IMG"==e.tagName){const t=document.querySelector("temba-lightbox");t&&t.showElement(e)}}renderEventContainer(t){return D` <div @click="${this.handleEventClicked}" class="${this.ticket?"active-ticket":""} event ${t.type}"> ${this.renderEvent(t)} </div> ${this.debug?D`<pre>${JSON.stringify(t,null,2)}</pre>`:null} `}render(){return this.eventGroups.length>0&&this.tickets&&this.tickets.map((t=>{if(t&&"open"===t.status){if(1e3*new Date(t.opened_on).getTime()<this.nextBefore||this.isPurged(t)){const e=((t,e,i)=>{const n=dl(t);return i?D`<div class="" style="display: flex">
2617
+ </div>`)(t)}return D`<temba-icon name="alert-triangle" style="fill:var(--color-error)"></temba-icon> <div class="description">${t.type}</div>`}handleClose(t){this.httpComplete=ae("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refreshTickets(),this.refresh(),this.fireCustomEvent(ke.ContentChanged,{ticket:{uuid:t,status:"closed"}})})).catch((t=>{console.error(t)}))}checkForAgentAssignmentEvent(t){this.httpComplete=se(`/api/v2/tickets.json?uuid=${this.ticket}`).then((e=>{if(1===e.length){const i=e[0];i.assignee&&i.assignee.email===t?this.fireCustomEvent(ke.ContentChanged,{ticket:{uuid:this.ticket,assigned:"self"}}):this.fireCustomEvent(ke.ContentChanged,{ticket:{uuid:this.ticket,assigned:i.assignee?i.assignee:null}})}}))}getEventHandlers(){return[{event:"scroll",method:de(this.handleScroll,50)}]}isPurged(t){return!this.ticketEvents[t.uuid]}handleEventClicked(t){const e=t.target;if("IMG"==e.tagName){const t=document.querySelector("temba-lightbox");t&&t.showElement(e)}}renderEventContainer(t){return D` <div @click="${this.handleEventClicked}" class="${this.ticket?"active-ticket":""} event ${t.type}"> ${this.renderEvent(t)} </div> ${this.debug?D`<pre>${JSON.stringify(t,null,2)}</pre>`:null} `}render(){return this.eventGroups.length>0&&this.tickets&&this.tickets.map((t=>{if(t&&"open"===t.status){if(1e3*new Date(t.opened_on).getTime()<this.nextBefore||this.isPurged(t)){const e=((t,e,i)=>{const n=cl(t);return i?D`<div class="" style="display: flex">
2622
2618
  <temba-icon name="${n}"></temba-icon>
2623
2619
  <div class="description">
2624
2620
  ${t.ticket.topic.name}
@@ -2633,7 +2629,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2633
2629
  </div>`:D`
2634
2630
  <div>
2635
2631
  <div style="text-align:center">
2636
- ${sl(t.created_by)} opened this ticket
2632
+ ${ol(t.created_by)} opened this ticket
2637
2633
  </div>
2638
2634
  <div class="subtext" style="justify-content:center">
2639
2635
  <temba-date
@@ -2643,13 +2639,13 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2643
2639
  ></temba-date>
2644
2640
  </div>
2645
2641
  </div>
2646
- `})({type:rl.TICKET_OPENED,ticket:{uuid:t.uuid,topic:t.topic,body:t.body,ticketer:t.ticketer},created_on:t.opened_on},this.handleClose,!this.ticket);return D`<div class="event ticket_opened"> ${e} </div>`}}})),D` ${this.fetching?D`<temba-loading units="5" size="10"></temba-loading>`:D`<div style="height:0"></div>`} <div class="events" @scroll="${this.handleScroll}"> ${this.eventGroups.map(((t,e)=>{const i=al(t.events[0],this.ticket),n=this.eventGroups.length-e-1,o=ee({grouping:!0,[i]:!0,expanded:t.open});return D`<div class="${o}"> ${"verbose"===i?D`<div class="event-count" @click="${this.handleEventGroupShow}" data-group-index="${n}"> ${t.open?D`<temba-icon @click="${this.handleEventGroupHide}" data-group-index="${n}" name="x" clickable></temba-icon>`:D`${t.events.length} ${1===t.events.length?D`event`:D`events`} `} </div>`:null} <div class="items"> ${t.events.map((t=>{if(t.type===rl.TICKET_ASSIGNED&&t.note){const e={...t};return e.type=rl.TICKET_NOTE_ADDED,D`${this.renderEventContainer(e)}${this.renderEventContainer(t)}`}return this.renderEventContainer(t)}))} </div> </div>`}))} </div> <div class="new-messages-container"> <div @click="${()=>{this.scrollToBottom(!0)}}" class="new-messages ${ee({expanded:this.showMessageAlert})}"> New Messages </div> </div> `}}t([ct({type:Object})],ml.prototype,"contact",void 0),t([ct({type:String})],ml.prototype,"uuid",void 0),t([ct({type:String})],ml.prototype,"agent",void 0),t([ct({type:Array})],ml.prototype,"eventGroups",void 0),t([ct({type:Boolean})],ml.prototype,"refreshing",void 0),t([ct({type:Boolean})],ml.prototype,"fetching",void 0),t([ct({type:Boolean})],ml.prototype,"complete",void 0),t([ct({type:String})],ml.prototype,"endpoint",void 0),t([ct({type:Boolean})],ml.prototype,"debug",void 0),t([ct({type:Boolean})],ml.prototype,"showMessageAlert",void 0),t([ct({attribute:!1,type:Object})],ml.prototype,"mostRecentEvent",void 0),t([ct({type:String})],ml.prototype,"ticket",void 0),t([ct({type:String})],ml.prototype,"endDate",void 0),t([ct({type:Array})],ml.prototype,"tickets",void 0);class fl extends lt{static get styles(){return r`
2642
+ `})({type:sl.TICKET_OPENED,ticket:{uuid:t.uuid,topic:t.topic,body:t.body,ticketer:t.ticketer},created_on:t.opened_on},this.handleClose,!this.ticket);return D`<div class="event ticket_opened"> ${e} </div>`}}})),D` ${this.fetching?D`<temba-loading units="5" size="10"></temba-loading>`:D`<div style="height:0"></div>`} <div class="events" @scroll="${this.handleScroll}"> ${this.eventGroups.map(((t,e)=>{const i=rl(t.events[0],this.ticket),n=this.eventGroups.length-e-1,o=ee({grouping:!0,[i]:!0,expanded:t.open});return D`<div class="${o}"> ${"verbose"===i?D`<div class="event-count" @click="${this.handleEventGroupShow}" data-group-index="${n}"> ${t.open?D`<temba-icon @click="${this.handleEventGroupHide}" data-group-index="${n}" name="x" clickable></temba-icon>`:D`${t.events.length} ${1===t.events.length?D`event`:D`events`} `} </div>`:null} <div class="items"> ${t.events.map((t=>{if(t.type===sl.TICKET_ASSIGNED&&t.note){const e={...t};return e.type=sl.TICKET_NOTE_ADDED,D`${this.renderEventContainer(e)}${this.renderEventContainer(t)}`}return this.renderEventContainer(t)}))} </div> </div>`}))} </div> <div class="new-messages-container"> <div @click="${()=>{this.scrollToBottom(!0)}}" class="new-messages ${ee({expanded:this.showMessageAlert})}"> New Messages </div> </div> `}}t([ct({type:Object})],pl.prototype,"contact",void 0),t([ct({type:String})],pl.prototype,"uuid",void 0),t([ct({type:String})],pl.prototype,"agent",void 0),t([ct({type:Array})],pl.prototype,"eventGroups",void 0),t([ct({type:Boolean})],pl.prototype,"refreshing",void 0),t([ct({type:Boolean})],pl.prototype,"fetching",void 0),t([ct({type:Boolean})],pl.prototype,"complete",void 0),t([ct({type:String})],pl.prototype,"endpoint",void 0),t([ct({type:Boolean})],pl.prototype,"debug",void 0),t([ct({type:Boolean})],pl.prototype,"showMessageAlert",void 0),t([ct({attribute:!1,type:Object})],pl.prototype,"mostRecentEvent",void 0),t([ct({type:String})],pl.prototype,"ticket",void 0),t([ct({type:String})],pl.prototype,"endDate",void 0),t([ct({type:Array})],pl.prototype,"tickets",void 0);class ml extends lt{static get styles(){return r`
2647
2643
  temba-options {
2648
2644
  display: block;
2649
2645
  width: 100%;
2650
2646
  flex-grow: 1;
2651
2647
  }
2652
- `}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.reset(),this.loading=!0,this.fetchItems()),t.has("loading")&&(this.loading||this.fireCustomEvent(Se.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent(Se.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await ie(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],s=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await ie(t,s);this.sanitizeOption&&r.results.forEach(this.sanitizeOption),r.results&&(o=o.concat(r.results)),n=r.next,t=n,e--,i++}catch(t){return this.reset(),void console.log(t)}this.nextPage=n}this.pages=i;const s=o[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s);const r=o[this.cursorIndex];if(!this.nextSelection&&this.selected&&r&&this.getValue(r)!==this.getValue(this.selected)){const t=o.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}return this.items=o,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1===this.cursorIndex&&(this.cursorIndex=0),this.value&&(this.setSelection(this.value),this.value=null),Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,ie(this.nextPage).then((t=>{this.sanitizeOption&&t.results.forEach(this.sanitizeOption),this.items=[...this.items,...t.results],this.nextPage=t.next,this.pages++,this.loading=!1})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){const{selected:e,index:i}=t.detail;this.selected=e,this.cursorIndex=i,t.stopPropagation(),t.preventDefault()}render(){return D`
2648
+ `}constructor(){super(),this.items=[],this.cursorIndex=-1,this.tabIndex=1,this.valueKey="id",this.loading=!1,this.paused=!1,this.refreshKey="0",this.reverseRefresh=!0,this.nextPage=null,this.pages=0,this.pending=[],this.refreshInterval=null,this.store=document.querySelector("temba-store"),this.handleSelection.bind(this)}reset(){this.selected=null,this.nextPage=null,this.cursorIndex=-1,this.mostRecentItem=null,this.items=[]}connectedCallback(){super.connectedCallback(),this.refreshInterval=setInterval((()=>{this.paused||(this.refreshKey="default_"+(new Date).getTime())}),1e4)}disconnectedCallback(){clearInterval(this.refreshInterval)}updated(t){super.updated(t),t.has("endpoint")&&this.endpoint&&(this.reset(),this.loading=!0,this.fetchItems()),t.has("loading")&&(this.loading||this.fireCustomEvent(ke.FetchComplete)),t.has("refreshKey")&&!t.has("endpoint")&&this.refreshTop(),t.has("mostRecentItem")&&this.mostRecentItem&&this.fireCustomEvent(ke.Refreshed),t.has("cursorIndex")&&this.cursorIndex>-1&&(this.selected=this.items[this.cursorIndex],this.handleSelected(this.selected))}handleSelected(t){const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)}getValue(t){if(!t)return null;const e=this.valueKey.split(".");let i=t;for(;e.length>0;){i=i[e.shift()]}return i}setSelection(t){const e=this.items.findIndex((e=>this.getValue(e)===t));this.cursorIndex=e,this.selected=this.items[e];const i=new Event("change",{bubbles:!0});this.dispatchEvent(i)}getItemIndex(t){return this.items.findIndex((e=>this.getValue(e)===t))}removeItem(t){const e=this.getItemIndex(t);this.items.splice(e,1),this.items=[...this.items],this.cursorIndex=Math.max(0,Math.min(this.items.length-1,this.cursorIndex-1)),this.requestUpdate("cursorIndex"),this.requestUpdate("items")}getSelection(){return this.selected}refresh(){this.refreshKey="requested_"+(new Date).getTime()}setEndpoint(t,e=null){this.endpoint=t,this.nextSelection=e}getRefreshEndpoint(){return this.endpoint}async refreshTop(){if(!this.getRefreshEndpoint())return;for(;this.pending.length>0;){this.pending.pop().abort()}const t=new AbortController;this.pending.push(t);const e=this.items[this.cursorIndex];try{const i=await ie(this.getRefreshEndpoint(),t),n=[...this.items];if(i.results){i.results.forEach((t=>{this.sanitizeOption&&this.sanitizeOption(t);const e=this.getValue(t),i=n.findIndex((t=>this.getValue(t)===e));i>-1&&n.splice(i,1)}));let t=i.results;this.reverseRefresh&&(t=i.results.reverse());const o=[...t,...n],s=o[0];if(this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s),e){const t=o[this.cursorIndex],i=this.getValue(e);if(i!==this.getValue(t)){const t=o.findIndex((t=>this.getValue(t)===i));this.cursorIndex=t,window.setTimeout((()=>{const t=this.shadowRoot.querySelector("temba-options");if(t){t.shadowRoot.querySelector(".option.focused").scrollIntoView({block:"end",inline:"nearest"})}}),0)}}this.items=o}}catch(t){console.error(t)}}async fetchItems(){for(;this.pending.length>0;){this.pending.pop().abort()}let t=this.endpoint,e=this.pages||1,i=0,n=null,o=[];for(;e>0&&t;){const s=new AbortController;this.pending.push(s);try{const r=await ie(t,s);this.sanitizeOption&&r.results.forEach(this.sanitizeOption),r.results&&(o=o.concat(r.results)),n=r.next,t=n,e--,i++}catch(t){return this.reset(),void console.log(t)}this.nextPage=n}this.pages=i;const s=o[0];this.mostRecentItem&&JSON.stringify(this.mostRecentItem)===JSON.stringify(s)||(this.mostRecentItem=s);const r=o[this.cursorIndex];if(!this.nextSelection&&this.selected&&r&&this.getValue(r)!==this.getValue(this.selected)){const t=o.findIndex((t=>this.getValue(t)===this.getValue(this.selected)));t>-1?this.cursorIndex=t:0===this.cursorIndex?this.requestUpdate("cursorIndex"):this.cursorIndex=0}return this.items=o,this.loading=!1,this.pending=[],this.nextSelection?(this.setSelection(this.nextSelection),this.nextSelection=!1):-1===this.cursorIndex&&(this.cursorIndex=0),this.value&&(this.setSelection(this.value),this.value=null),Promise.resolve()}handleScrollThreshold(){this.nextPage&&!this.loading&&(this.loading=!0,ie(this.nextPage).then((t=>{this.sanitizeOption&&t.results.forEach(this.sanitizeOption),this.items=[...this.items,...t.results],this.nextPage=t.next,this.pages++,this.loading=!1})))}renderHeader(){return null}renderFooter(){return null}getListStyle(){return""}handleSelection(t){const{selected:e,index:i}=t.detail;this.selected=e,this.cursorIndex=i,t.stopPropagation(),t.preventDefault()}render(){return D`
2653
2649
  ${this.renderHeader()}
2654
2650
  <temba-options
2655
2651
  style="${this.getListStyle()}"
@@ -2668,7 +2664,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2668
2664
  <slot></slot>
2669
2665
  </temba-options>
2670
2666
  ${this.renderFooter()}
2671
- `}}t([ct({type:Array,attribute:!1})],fl.prototype,"items",void 0),t([ct({type:Object,attribute:!1})],fl.prototype,"selected",void 0),t([ct({type:Number})],fl.prototype,"cursorIndex",void 0),t([ct({type:String})],fl.prototype,"endpoint",void 0),t([ct({type:String})],fl.prototype,"nextSelection",void 0),t([ct({type:Number})],fl.prototype,"tabIndex",void 0),t([ct({type:String})],fl.prototype,"valueKey",void 0),t([ct({type:String})],fl.prototype,"value",void 0),t([ct({type:Boolean})],fl.prototype,"loading",void 0),t([ct({type:Boolean})],fl.prototype,"collapsed",void 0),t([ct({type:Boolean})],fl.prototype,"hideShadow",void 0),t([ct({type:Boolean})],fl.prototype,"paused",void 0),t([ct({attribute:!1})],fl.prototype,"getNextRefresh",void 0),t([ct({attribute:!1})],fl.prototype,"sanitizeOption",void 0),t([ct({attribute:!1})],fl.prototype,"renderOption",void 0),t([ct({attribute:!1})],fl.prototype,"renderOptionDetail",void 0),t([ct({attribute:!1,type:Object})],fl.prototype,"mostRecentItem",void 0),t([ct({type:String})],fl.prototype,"refreshKey",void 0);class gl extends fl{getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].ticket.last_activity_on;return this.endpoint+"?after="+1e3*new Date(t).getTime()}return this.endpoint}constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>D`
2667
+ `}}t([ct({type:Array,attribute:!1})],ml.prototype,"items",void 0),t([ct({type:Object,attribute:!1})],ml.prototype,"selected",void 0),t([ct({type:Number})],ml.prototype,"cursorIndex",void 0),t([ct({type:String})],ml.prototype,"endpoint",void 0),t([ct({type:String})],ml.prototype,"nextSelection",void 0),t([ct({type:Number})],ml.prototype,"tabIndex",void 0),t([ct({type:String})],ml.prototype,"valueKey",void 0),t([ct({type:String})],ml.prototype,"value",void 0),t([ct({type:Boolean})],ml.prototype,"loading",void 0),t([ct({type:Boolean})],ml.prototype,"collapsed",void 0),t([ct({type:Boolean})],ml.prototype,"hideShadow",void 0),t([ct({type:Boolean})],ml.prototype,"paused",void 0),t([ct({attribute:!1})],ml.prototype,"getNextRefresh",void 0),t([ct({attribute:!1})],ml.prototype,"sanitizeOption",void 0),t([ct({attribute:!1})],ml.prototype,"renderOption",void 0),t([ct({attribute:!1})],ml.prototype,"renderOptionDetail",void 0),t([ct({attribute:!1,type:Object})],ml.prototype,"mostRecentItem",void 0),t([ct({type:String})],ml.prototype,"refreshKey",void 0);class fl extends ml{getRefreshEndpoint(){if(this.items.length>0){const t=this.items[0].ticket.last_activity_on;return this.endpoint+"?after="+1e3*new Date(t).getTime()}return this.endpoint}constructor(){super(),this.agent="",this.valueKey="ticket.uuid",this.renderOption=t=>D`
2672
2668
  <div
2673
2669
  style="align-items:center; margin-top: 0.1em; margin-bottom: 0.1em"
2674
2670
  >
@@ -2711,12 +2707,12 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2711
2707
  ></temba-date>
2712
2708
  </div>
2713
2709
  <div style="font-size:0.7em;">
2714
- ${!t.ticket.closed_on&&t.ticket.assignee?D`${ll(t.ticket.assignee)}`:null}
2710
+ ${!t.ticket.closed_on&&t.ticket.assignee?D`${al(t.ticket.assignee)}`:null}
2715
2711
  </div>
2716
2712
  </div>
2717
2713
  </div>
2718
2714
  </div>
2719
- `}}t([ct({type:String})],gl.prototype,"agent",void 0);const vl={active:"Active",blocked:"Blocked",stopped:"Stopped",archived:"Archived"},yl={tel:"Phone",whatsapp:"WhatsApp",fcm:"Firebase Cloud Messaging",twitter:"Twitter"};class bl extends et{constructor(){super(...arguments),this.level="info"}static get styles(){return r`
2715
+ `}}t([ct({type:String})],fl.prototype,"agent",void 0);const gl={active:"Active",blocked:"Blocked",stopped:"Stopped",archived:"Archived"},vl={tel:"Phone",whatsapp:"WhatsApp",fcm:"Firebase Cloud Messaging",twitter:"Twitter"};class yl extends et{constructor(){super(...arguments),this.level="info"}static get styles(){return r`
2720
2716
  :host {
2721
2717
  display: block;
2722
2718
  }
@@ -2748,7 +2744,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2748
2744
  }
2749
2745
  `}render(){return D`
2750
2746
  <div class="temba-alert temba-${this.level}"><slot></slot></div>
2751
- `}}t([ct({type:String})],bl.prototype,"level",void 0);class _l extends ut{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`
2747
+ `}}t([ct({type:String})],yl.prototype,"level",void 0);class bl extends ut{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`
2752
2748
  :host {
2753
2749
  color: var(--color-text);
2754
2750
  }
@@ -2917,7 +2913,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2917
2913
  temba-alert {
2918
2914
  margin: 1em 0;
2919
2915
  }
2920
- `}refresh(){this.refreshKey="requested_"+(new Date).getTime()}updated(t){super.updated(t),t.has("advanced")&&this.advanced||(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(Se.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));ae(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,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(Se.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(Se.ContentChanged,this.summary))}))}}handleAdvancedToggle(t){ye(t),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(t){"0"!==this.refreshKey||this.initialized?this.refresh():this.initialized=!0}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let n=i.checked;n?("not_seen_since_days"===i.name&&(n=90),this.exclusions[i.name]=n):delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=D`
2916
+ `}refresh(){this.refreshKey="requested_"+(new Date).getTime()}updated(t){super.updated(t),t.has("advanced")&&this.advanced||(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(ke.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));ae(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,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(ke.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(ke.ContentChanged,this.summary))}))}}handleAdvancedToggle(t){ve(t),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(t){"0"!==this.refreshKey||this.initialized?this.refresh():this.initialized=!0}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let n=i.checked;n?("not_seen_since_days"===i.name&&(n=90),this.exclusions[i.name]=n):delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=D`
2921
2917
  <div class="result-count">
2922
2918
  Found
2923
2919
  <a
@@ -2950,7 +2946,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2950
2946
  </div>
2951
2947
  </div>
2952
2948
  </temba-button>
2953
- `}return this.summary&&this.summary.blockers&&this.summary.blockers.length>0?D`${this.summary.blockers.map((t=>D`<temba-alert level="error">${Js(t)}</temba-alert>`))}`:D`
2949
+ `}return this.summary&&this.summary.blockers&&this.summary.blockers.length>0?D`${this.summary.blockers.map((t=>D`<temba-alert level="error">${Ys(t)}</temba-alert>`))}`:D`
2954
2950
  ${this.advanced?D`<div class="query">
2955
2951
  <temba-textinput
2956
2952
  .label=${this.label}
@@ -2984,22 +2980,22 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2984
2980
 
2985
2981
  ${this.not_seen_since_days?D`<temba-checkbox
2986
2982
  name="not_seen_since_days"
2987
- label="${Vs("Skip inactive contacts")}"
2988
- help_text="${Vs("Only include contacts who have sent a message in the last 90 days.")}"
2983
+ label="${Fs("Skip inactive contacts")}"
2984
+ help_text="${Fs("Only include contacts who have sent a message in the last 90 days.")}"
2989
2985
  ?checked=${90===this.exclusions.not_seen_since_days}
2990
2986
  @change=${this.handleExclusionChanged}
2991
2987
  ></temba-checkbox>`:null}
2992
2988
  ${this.in_a_flow?D`<temba-checkbox
2993
2989
  name="in_a_flow"
2994
- label="${Vs("Skip contacts currently in a flow")}"
2995
- help_text="${Vs("Avoid interrupting a contact who is already in a flow.")}"
2990
+ label="${Fs("Skip contacts currently in a flow")}"
2991
+ help_text="${Fs("Avoid interrupting a contact who is already in a flow.")}"
2996
2992
  ?checked=${this.exclusions.in_a_flow}
2997
2993
  @change=${this.handleExclusionChanged}
2998
2994
  ></temba-checkbox>`:null}
2999
2995
  ${this.started_previously?D`<temba-checkbox
3000
2996
  name="started_previously"
3001
- label="${Vs("Skip repeat contacts")}"
3002
- help_text="${Vs("Avoid restarting a contact who has been in this flow in the last 90 days.")}"
2997
+ label="${Fs("Skip repeat contacts")}"
2998
+ help_text="${Fs("Avoid restarting a contact who has been in this flow in the last 90 days.")}"
3003
2999
  ?checked=${this.exclusions.started_previously}
3004
3000
  @change=${this.handleExclusionChanged}
3005
3001
  ></temba-checkbox>`:null}`}
@@ -3012,9 +3008,9 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3012
3008
  </div>
3013
3009
 
3014
3010
  ${this.summary&&this.summary.warnings?this.summary.warnings.map((t=>D`<temba-alert level="warning"
3015
- >${Js(t)}</temba-alert
3011
+ >${Ys(t)}</temba-alert
3016
3012
  >`)):""}
3017
- `}}t([ct({type:Boolean})],_l.prototype,"in_a_flow",void 0),t([ct({type:Boolean})],_l.prototype,"started_previously",void 0),t([ct({type:Boolean})],_l.prototype,"not_seen_since_days",void 0),t([ct({type:Boolean})],_l.prototype,"fetching",void 0),t([ct({type:Boolean})],_l.prototype,"expanded",void 0),t([ct({type:String})],_l.prototype,"endpoint",void 0),t([ct({type:String})],_l.prototype,"placeholder",void 0),t([ct({type:String})],_l.prototype,"name",void 0),t([ct({type:String})],_l.prototype,"query",void 0),t([ct({type:Number})],_l.prototype,"inactiveThreshold",void 0),t([ct({type:Number})],_l.prototype,"inactiveDays",void 0),t([ct({type:Object,attribute:!1})],_l.prototype,"summary",void 0),t([ct({type:Object,attribute:!1})],_l.prototype,"flow",void 0),t([ct({type:Array})],_l.prototype,"recipients",void 0),t([ct({type:Boolean})],_l.prototype,"advanced",void 0),t([ct({type:String})],_l.prototype,"refreshKey",void 0),t([ct({type:Object})],_l.prototype,"exclusions",void 0);class xl extends et{static get styles(){return r`
3013
+ `}}t([ct({type:Boolean})],bl.prototype,"in_a_flow",void 0),t([ct({type:Boolean})],bl.prototype,"started_previously",void 0),t([ct({type:Boolean})],bl.prototype,"not_seen_since_days",void 0),t([ct({type:Boolean})],bl.prototype,"fetching",void 0),t([ct({type:Boolean})],bl.prototype,"expanded",void 0),t([ct({type:String})],bl.prototype,"endpoint",void 0),t([ct({type:String})],bl.prototype,"placeholder",void 0),t([ct({type:String})],bl.prototype,"name",void 0),t([ct({type:String})],bl.prototype,"query",void 0),t([ct({type:Number})],bl.prototype,"inactiveThreshold",void 0),t([ct({type:Number})],bl.prototype,"inactiveDays",void 0),t([ct({type:Object,attribute:!1})],bl.prototype,"summary",void 0),t([ct({type:Object,attribute:!1})],bl.prototype,"flow",void 0),t([ct({type:Array})],bl.prototype,"recipients",void 0),t([ct({type:Boolean})],bl.prototype,"advanced",void 0),t([ct({type:String})],bl.prototype,"refreshKey",void 0),t([ct({type:Object})],bl.prototype,"exclusions",void 0);class _l extends et{static get styles(){return r`
3018
3014
  :host {
3019
3015
  display: flex-inline;
3020
3016
  align-items: center;
@@ -3122,7 +3118,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3122
3118
  />
3123
3119
  </svg>
3124
3120
  </div>
3125
- `}}var wl;t([ct({type:String})],xl.prototype,"name",void 0),t([ct({type:String})],xl.prototype,"prefix",void 0),t([ct({type:String})],xl.prototype,"id",void 0),t([ct({type:Number})],xl.prototype,"size",void 0),t([ct({type:Boolean})],xl.prototype,"spin",void 0),t([ct({type:Boolean})],xl.prototype,"clickable",void 0),t([ct({type:Boolean})],xl.prototype,"circled",void 0),t([ct({type:String})],xl.prototype,"animateChange",void 0),t([ct({type:String})],xl.prototype,"animateClick",void 0),t([ct({type:Number})],xl.prototype,"animationDuration",void 0),t([ct({type:String})],xl.prototype,"src",void 0),t([ct({type:Number,attribute:!1})],xl.prototype,"steps",void 0),t([ct({type:Number,attribute:!1})],xl.prototype,"animationStep",void 0),t([ct({type:String})],xl.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact"}(wl||(wl={}));const kl={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class Sl extends lt{constructor(){super(...arguments),this.groups=!1,this.contacts=!1,this.value=[],this.placeholder="Select recipients",this.disabled=!1,this.infoText=""}static get styles(){return r`
3121
+ `}}var xl;t([ct({type:String})],_l.prototype,"name",void 0),t([ct({type:String})],_l.prototype,"prefix",void 0),t([ct({type:String})],_l.prototype,"id",void 0),t([ct({type:Number})],_l.prototype,"size",void 0),t([ct({type:Boolean})],_l.prototype,"spin",void 0),t([ct({type:Boolean})],_l.prototype,"clickable",void 0),t([ct({type:Boolean})],_l.prototype,"circled",void 0),t([ct({type:String})],_l.prototype,"animateChange",void 0),t([ct({type:String})],_l.prototype,"animateClick",void 0),t([ct({type:Number})],_l.prototype,"animationDuration",void 0),t([ct({type:String})],_l.prototype,"src",void 0),t([ct({type:Number,attribute:!1})],_l.prototype,"steps",void 0),t([ct({type:Number,attribute:!1})],_l.prototype,"animationStep",void 0),t([ct({type:String})],_l.prototype,"easing",void 0),function(t){t.Group="group",t.Contact="contact"}(xl||(xl={}));const wl={color:"var(--color-text-dark)",padding:"0px 6px",fontSize:"12px"};class kl extends lt{constructor(){super(...arguments),this.groups=!1,this.contacts=!1,this.value=[],this.placeholder="Select recipients",this.disabled=!1,this.infoText=""}static get styles(){return r`
3126
3122
  temba-select:focus {
3127
3123
  outline: none;
3128
3124
  box-shadow: none;
@@ -3140,7 +3136,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3140
3136
  ${this.getPostName(t)}
3141
3137
  </div>
3142
3138
  </div>
3143
- `}getPostName(t){const e={...kl};return t.urn&&t.type===wl.Contact&&t.urn!==t.name?D`<div style=${_t(e)}>${t.urn}</div>`:t.type===wl.Group?D`
3139
+ `}getPostName(t){const e={...wl};return t.urn&&t.type===xl.Contact&&t.urn!==t.name?D`<div style=${_t(e)}>${t.urn}</div>`:t.type===xl.Group?D`
3144
3140
  <div style=${_t(e)}>${t.count.toLocaleString()}</div>
3145
3141
  `:null}renderSelection(t){return D`
3146
3142
  <div
@@ -3161,7 +3157,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3161
3157
  ${this.getPostName(t)}
3162
3158
  </div>
3163
3159
  </div>
3164
- `}getIcon(t){return t.type===wl.Group?D`<temba-icon name="${pt.group}"></temba-icon>`:t.type===wl.Contact?D`<temba-icon name="${pt.contact}"></temba-icon>`:void 0}getEndpoint(){const t=this.endpoint;let e="&types=";return this.groups&&(e+="g"),this.contacts&&(e+="c"),t+e}getValues(){return this.shadowRoot.querySelector("temba-select").values}isMatch(){return!0}render(){return D`
3160
+ `}getIcon(t){return t.type===xl.Group?D`<temba-icon name="${pt.group}"></temba-icon>`:t.type===xl.Contact?D`<temba-icon name="${pt.contact}"></temba-icon>`:void 0}getEndpoint(){const t=this.endpoint;let e="&types=";return this.groups&&(e+="g"),this.contacts&&(e+="c"),t+e}getValues(){return this.shadowRoot.querySelector("temba-select").values}isMatch(){return!0}render(){return D`
3165
3161
  <temba-select
3166
3162
  name=${this.name}
3167
3163
  endpoint=${this.getEndpoint()}
@@ -3184,7 +3180,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3184
3180
  ><div slot="right">
3185
3181
  <slot name="right"></slot></div
3186
3182
  ></temba-select>
3187
- `}}t([ct()],Sl.prototype,"endpoint",void 0),t([ct()],Sl.prototype,"name",void 0),t([ct({type:Boolean})],Sl.prototype,"groups",void 0),t([ct({type:Boolean})],Sl.prototype,"contacts",void 0),t([ct({type:Array})],Sl.prototype,"value",void 0),t([ct({type:Array})],Sl.prototype,"errors",void 0),t([ct()],Sl.prototype,"placeholder",void 0),t([ct({type:Boolean})],Sl.prototype,"disabled",void 0),t([ct({type:String,attribute:"help_text"})],Sl.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],Sl.prototype,"helpAlways",void 0),t([ct({type:Boolean,attribute:"widget_only"})],Sl.prototype,"widgetOnly",void 0),t([ct({type:Boolean,attribute:"hide_label"})],Sl.prototype,"hideLabel",void 0),t([ct({type:String})],Sl.prototype,"label",void 0),t([ct({type:String,attribute:"info_text"})],Sl.prototype,"infoText",void 0);const El=(t,e)=>t.top+t.height/2-e.height/2,$l=(t,e)=>t.left+t.width/2-e.width/2;class Cl extends lt{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return r`
3183
+ `}}t([ct()],kl.prototype,"endpoint",void 0),t([ct()],kl.prototype,"name",void 0),t([ct({type:Boolean})],kl.prototype,"groups",void 0),t([ct({type:Boolean})],kl.prototype,"contacts",void 0),t([ct({type:Array})],kl.prototype,"value",void 0),t([ct({type:Array})],kl.prototype,"errors",void 0),t([ct()],kl.prototype,"placeholder",void 0),t([ct({type:Boolean})],kl.prototype,"disabled",void 0),t([ct({type:String,attribute:"help_text"})],kl.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],kl.prototype,"helpAlways",void 0),t([ct({type:Boolean,attribute:"widget_only"})],kl.prototype,"widgetOnly",void 0),t([ct({type:Boolean,attribute:"hide_label"})],kl.prototype,"hideLabel",void 0),t([ct({type:String})],kl.prototype,"label",void 0),t([ct({type:String,attribute:"info_text"})],kl.prototype,"infoText",void 0);const Sl=(t,e)=>t.top+t.height/2-e.height/2,El=(t,e)=>t.left+t.width/2-e.width/2;class $l extends lt{constructor(){super(...arguments),this.visible=!1,this.position="auto",this.lastEnter=0,this.failSafe=0}static get styles(){return r`
3188
3184
  .tip {
3189
3185
  transition: opacity 200ms ease-in-out;
3190
3186
  margin: 0px;
@@ -3236,7 +3232,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3236
3232
  .▲ {
3237
3233
  text-shadow: 0px -1px 1px rgba(0, 0, 0, 0.1);
3238
3234
  }
3239
- `}updated(t){(t.has("visible")||t.has("text"))&&this.visible&&this.calculatePosition(),t.has("text")&&this.hideOnChange&&(this.visible=!1)}calculatePosition(){if(this.visible){const t=this.getDiv(".tip").getBoundingClientRect(),e=this.getDiv(".slot").getBoundingClientRect();let i=this.position;"auto"===i&&(i="left"),this.arrowLeft=0,this.arrowTop=0,"left"===i?(this.left=e.left-t.width-16,this.top=El(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=El(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=$l(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=$l(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=ee({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return D`
3235
+ `}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=Sl(e,t),this.arrowTop=t.height/2,this.arrowLeft=t.width-1,this.arrow="▶"):"right"===i?(this.left=e.right+12,this.top=Sl(e,t),this.arrowTop=t.height/2,this.arrowLeft=-8,this.arrow="◀"):"top"===i?(this.top=e.top-t.height-12,this.left=El(e,t),this.arrowTop=t.height+2,this.arrowLeft=t.width/2-4,this.arrow="▼"):"bottom"===i&&(this.top=e.bottom+10,this.left=El(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=ee({tip:!0,show:this.visible,top:this.poppedTop,"hide-on-change":this.hideOnChange});return D`
3240
3236
  <div
3241
3237
  class="slot"
3242
3238
  @click=${this.handleMouseLeave}
@@ -3251,7 +3247,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3251
3247
  ${this.arrow}
3252
3248
  </div>
3253
3249
  </div>
3254
- `}}t([ct({type:String})],Cl.prototype,"text",void 0),t([ct({type:Boolean})],Cl.prototype,"visible",void 0),t([ct({type:String})],Cl.prototype,"position",void 0),t([ct({type:Boolean})],Cl.prototype,"hideOnChange",void 0),t([ct({type:Number,attribute:!1})],Cl.prototype,"top",void 0),t([ct({type:Number,attribute:!1})],Cl.prototype,"left",void 0),t([ct({type:Number,attribute:!1})],Cl.prototype,"width",void 0),t([ct({type:Boolean,attribute:!1})],Cl.prototype,"poppedTop",void 0);const Tl=(t,e)=>{const i=t||[],n=i.findIndex((t=>t.id==e||t.vanity_id==e));if(n>-1){return{item:i[n],index:n}}return{item:null,index:-1}};class Al extends lt{static get styles(){return r`
3250
+ `}}t([ct({type:String})],$l.prototype,"text",void 0),t([ct({type:Boolean})],$l.prototype,"visible",void 0),t([ct({type:String})],$l.prototype,"position",void 0),t([ct({type:Boolean})],$l.prototype,"hideOnChange",void 0),t([ct({type:Number,attribute:!1})],$l.prototype,"top",void 0),t([ct({type:Number,attribute:!1})],$l.prototype,"left",void 0),t([ct({type:Number,attribute:!1})],$l.prototype,"width",void 0),t([ct({type:Boolean,attribute:!1})],$l.prototype,"poppedTop",void 0);const Cl=(t,e)=>{const i=t||[],n=i.findIndex((t=>t.id==e||t.vanity_id==e));if(n>-1){return{item:i[n],index:n}}return{item:null,index:-1}};class Tl extends lt{static get styles(){return r`
3255
3251
  :host {
3256
3252
  width: 100%;
3257
3253
  display: block;
@@ -3746,7 +3742,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3746
3742
  size="${0===t.level?"1.5":"1"}"
3747
3743
  name="${t.collapsed_icon}"
3748
3744
  class="collapse-icon"
3749
- ></temba-icon>`:null,r=ee({["menu-"+t.id]:!0,"child-selected":n,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!o&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id});t.avatar&&(o=_e({name:t.avatar,tip:!1}),t.bubble&&(o=D`${o}${t.bubble?D`<div
3745
+ ></temba-icon>`:null,r=ee({["menu-"+t.id]:!0,"child-selected":n,selected:i,item:!(t.avatar&&0===t.level),avatar:!!t.avatar,inline:t.inline,expanding:this.expanding&&this.expanding===t.id,expanded:this.isExpanded(t),iconless:!o&&!s&&!t.avatar,pressed:this.pressedItem&&this.pressedItem.id==t.id});t.avatar&&(o=be({name:t.avatar,tip:!1}),t.bubble&&(o=D`${o}${t.bubble?D`<div
3750
3746
  style="background-color: ${t.bubble}"
3751
3747
  class="bubble"
3752
3748
  ></div>`:null}`),o=D`<div style="position:relative; padding: 0em">${o}</div>`);const a=D`
@@ -3797,7 +3793,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3797
3793
  </div>
3798
3794
  </div>
3799
3795
  </temba-dropdown>
3800
- `:a},this.doRefresh=this.doRefresh.bind(this)}setBubble(t,e){const i=Tl(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(Se.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e)}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=ne(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(Se.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup){const n=this.shadowRoot.querySelector("temba-dropdown");return n&&n.blur(),void(t&&this.fireCustomEvent(Se.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(Se.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(t&&(t.preventDefault(),t.stopPropagation(),t.metaKey&&e.href))window.open(e.href,"_blank");else if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&(this.collapsed=!1),e.trigger)this.fireCustomEvent(Se.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(Se.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,n=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(n=Tl(i,t).item,!n)break;i=n.items}return n}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!Tl(this.root.items,e[0]).item)return}const i=[];let n=this.root;for(;e.length>0;){const t=e.shift();t&&(n.items||(this.loadItems(n),await this.httpComplete),n=Tl(n.items,t).item,n?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[];e.push(D`<div class="level level-0 ${this.submenu?"hidden":""}">
3796
+ `:a},this.doRefresh=this.doRefresh.bind(this)}setBubble(t,e){const i=Cl(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(ke.Ready):this.loadItems(this.root)),t.has("root")&&this.value&&(this.setFocusedItem(this.value),this.value=null)}reset(){this.loadItems(this.root)}async doRefresh(){const t=[...this.selection];let e=this.root;for(;t.length>0;){this.loadItems(e),await this.httpComplete;const i=t.shift();e=(e.items||[]).find((t=>t.id==i))}this.loadItems(e)}loadItems(t,e=null){t&&t.endpoint&&(t.loading=!0,this.httpComplete=ne(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(ke.Ready),this.wait=!0),this.requestUpdate("root"),this.scrollSelectedIntoView()})))}handleItemClicked(t,e,i=null){if(i&&i.popup){const n=this.shadowRoot.querySelector("temba-dropdown");return n&&n.blur(),void(t&&this.fireCustomEvent(ke.ButtonClicked,{item:e,selection:this.getSelection(),parent:i}))}if(e.popup)t&&this.fireCustomEvent(ke.ButtonClicked,{item:e,selection:this.getSelection(),parent:i});else if(t&&(t.preventDefault(),t.stopPropagation(),t.metaKey&&e.href))window.open(e.href,"_blank");else if(i&&i.inline&&this.handleItemClicked(null,i),this.collapsed&&(this.collapsed=!1),e.trigger)this.fireCustomEvent(ke.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(ke.ButtonClicked,{item:e,selection:this.getSelection(),parent:i})}}scrollSelectedIntoView(){window.setTimeout((()=>{this.shadowRoot.querySelectorAll(".selected").forEach((t=>{t.scrollIntoView({block:"end",behavior:"smooth"})}))}),0)}clickItem(t){const e=[...this.selection];e.splice(e.length-1,1,t);const i=this.getMenuItemForSelection(e);return!!i&&(this.handleItemClicked(null,i),this.scrollSelectedIntoView(),!0)}getMenuItem(){return this.getMenuItemForSelection([...this.selection])}getMenuItemForSelection(t){const e=[...t];let i=this.root.items,n=null;for(;e.length>0;){const t=e.splice(0,1)[0];if(!i)break;if(n=Cl(i,t).item,!n)break;i=n.items}return n}getSelection(){return this.selection}handleExpand(){this.collapsed=!1}handleCollapse(){this.collapsed=!0}async setFocusedItem(t){const e=t.split("/").filter((t=>!!t));if(!this.root)return;if(e.length>0){if(!Cl(this.root.items,e[0]).item)return}const i=[];let n=this.root;for(;e.length>0;){const t=e.shift();t&&(n.items||(this.loadItems(n),await this.httpComplete),n=Cl(n.items,t).item,n?i.push(t):e.splice(0,e.length))}this.selection=i,this.refresh(),this.requestUpdate("root")}isSelected(t){if(t.level<this.selection.length){return this.selection[t.level]==(t.vanity_id||t.id)}return!1}isExpanded(t){return!!this.selection.find((e=>e===t.vanity_id||t.id))}render(){if(!this.root||!this.root.items)return null;let t=this.root.items||[];const e=[];e.push(D`<div class="level level-0 ${this.submenu?"hidden":""}">
3801
3797
  <div class="top">
3802
3798
  <div class="expand-icon" @click=${this.handleExpand}>
3803
3799
  <temba-icon
@@ -3814,7 +3810,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3814
3810
  <div class="empty"></div>
3815
3811
  ${t.filter((t=>!!t.bottom)).map((t=>this.renderMenuItem(t)))}
3816
3812
  <div class="bottom"></div>
3817
- </div>`),this.selection.forEach(((i,n)=>{const o=Tl(t,i).item;let s=!1;if(o){t=o.items;const e=this.getMenuItemState(o.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>o.level+2&&(s=!1)}else t=null;t&&t.length>0&&!o.inline&&e.push(D`<div
3813
+ </div>`),this.selection.forEach(((i,n)=>{const o=Cl(t,i).item;let s=!1;if(o){t=o.items;const e=this.getMenuItemState(o.id);e.collapsed?s="collapsed"===e.collapsed:this.selection.length>o.level+2&&(s=!1)}else t=null;t&&t.length>0&&!o.inline&&e.push(D`<div
3818
3814
  class="${ee({level:!0,["level-"+(n+1)]:!0,collapsed:s})}"
3819
3815
  >
3820
3816
  ${this.submenu?null:D`
@@ -3840,7 +3836,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3840
3836
  class="${ee({root:!0,"fully-collapsed":this.collapsed})}"
3841
3837
  >
3842
3838
  ${e}
3843
- </div>`;return D`${i}`}}t([ct({type:Boolean})],Al.prototype,"wraps",void 0),t([ct({type:Boolean})],Al.prototype,"wait",void 0),t([ct({type:String})],Al.prototype,"endpoint",void 0),t([ct({type:String})],Al.prototype,"expanding",void 0),t([ct({type:String})],Al.prototype,"value",void 0),t([ct({type:String})],Al.prototype,"submenu",void 0),t([ct({type:Boolean})],Al.prototype,"collapsed",void 0),t([ct({type:Object})],Al.prototype,"pressedItem",void 0);class Ll extends et{static get styles(){return r`
3839
+ </div>`;return D`${i}`}}t([ct({type:Boolean})],Tl.prototype,"wraps",void 0),t([ct({type:Boolean})],Tl.prototype,"wait",void 0),t([ct({type:String})],Tl.prototype,"endpoint",void 0),t([ct({type:String})],Tl.prototype,"expanding",void 0),t([ct({type:String})],Tl.prototype,"value",void 0),t([ct({type:String})],Tl.prototype,"submenu",void 0),t([ct({type:Boolean})],Tl.prototype,"collapsed",void 0),t([ct({type:Object})],Tl.prototype,"pressedItem",void 0);class Al extends et{static get styles(){return r`
3844
3840
  :host {
3845
3841
  color: var(--color-link-primary);
3846
3842
  display: inline-block;
@@ -3850,7 +3846,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3850
3846
  cursor: pointer;
3851
3847
  text-decoration: underline;
3852
3848
  }
3853
- `}handleClick(t){window.goto(t)}render(){return D`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([ct({type:String})],Ll.prototype,"href",void 0);class Ml extends lt{constructor(){super(...arguments),this.open=!1,this.dropAlign="left",this.arrowSize=6,this.arrowOffset=2*this.arrowSize,this.offsetX=0,this.offsetY=0,this.mask=!1}static get styles(){return r`
3849
+ `}handleClick(t){window.goto(t)}render(){return D`<slot href="${this.href}" @click="${this.handleClick}"></slot>`}}t([ct({type:String})],Al.prototype,"href",void 0);class Ll extends lt{constructor(){super(...arguments),this.open=!1,this.dropAlign="left",this.arrowSize=6,this.arrowOffset=2*this.arrowSize,this.offsetX=0,this.offsetY=0,this.mask=!1}static get styles(){return r`
3854
3850
  .wrapper {
3855
3851
  position: relative;
3856
3852
  }
@@ -3939,7 +3935,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3939
3935
  </div>
3940
3936
  </div>
3941
3937
  </div>
3942
- `}}t([ct({type:Boolean})],Ml.prototype,"open",void 0),t([ct({type:String,attribute:"drop_align"})],Ml.prototype,"dropAlign",void 0),t([ct({type:Number})],Ml.prototype,"arrowSize",void 0),t([ct({type:Number})],Ml.prototype,"arrowOffset",void 0),t([ct({type:Number})],Ml.prototype,"offsetX",void 0),t([ct({type:Number})],Ml.prototype,"offsetY",void 0),t([ct({type:Boolean})],Ml.prototype,"mask",void 0);class Ol extends lt{constructor(){super(...arguments),this.embedded=!1,this.collapses=!1,this.bottom=!1,this.focusedName=!1,this.index=-1,this.refresh=""}static get styles(){return r`
3938
+ `}}t([ct({type:Boolean})],Ll.prototype,"open",void 0),t([ct({type:String,attribute:"drop_align"})],Ll.prototype,"dropAlign",void 0),t([ct({type:Number})],Ll.prototype,"arrowSize",void 0),t([ct({type:Number})],Ll.prototype,"arrowOffset",void 0),t([ct({type:Number})],Ll.prototype,"offsetX",void 0),t([ct({type:Number})],Ll.prototype,"offsetY",void 0),t([ct({type:Boolean})],Ll.prototype,"mask",void 0);class Ml extends lt{constructor(){super(...arguments),this.embedded=!1,this.collapses=!1,this.bottom=!1,this.focusedName=!1,this.index=-1,this.refresh=""}static get styles(){return r`
3943
3939
  :host {
3944
3940
  display: flex;
3945
3941
  flex-direction: column;
@@ -3988,7 +3984,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3988
3984
  .tab .name {
3989
3985
  margin-left: 0.4em;
3990
3986
  max-width: 80px;
3991
- margin-right: 0.4em;
3992
3987
  overflow: hidden;
3993
3988
  transition: max-width 500ms ease-in-out, margin 500ms ease-in-out;
3994
3989
  white-space: nowrap;
@@ -4025,7 +4020,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4025
4020
  .focusedname .tab.selected .name {
4026
4021
  margin-left: 0.4em;
4027
4022
  max-width: 200px;
4028
- margin-right: 0.4em;
4029
4023
  }
4030
4024
 
4031
4025
  .tab {
@@ -4126,7 +4120,11 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4126
4120
  .embedded.pane {
4127
4121
  // padding: 0.3em;
4128
4122
  }
4129
- `}handleTabClick(t){this.index=parseInt(t.currentTarget.dataset.index),t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}updated(t){if(super.updated(t),t.has("index")){const t=this.getTabs();if(t.length>this.index)for(let e=0;e<t.length;e++){const i=t[e];i.selected=e==this.index,i.selected?i.style.display="flex":i.style.display="none"}this.fireEvent(Se.ContextChanged)}if(this.index>-1){const t=this.getTabs();if(this.getTab(this.index).hidden)for(let e=0;e<t.length;e++){if(!this.getTab(e).hidden)return void(this.index=e)}}}getCurrentTab(){return this.getTabs()[this.index]}getTab(t){return this.getTabs()[t]}handleTabContentChanged(){this.requestUpdate()}getTabs(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}return t}render(){const t=this.getTabs();return D`
4123
+
4124
+ .check {
4125
+ margin-left: 0.4em;
4126
+ }
4127
+ `}handleTabClick(t){this.index=parseInt(t.currentTarget.dataset.index),t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}updated(t){if(super.updated(t),t.has("index")){const t=this.getTabs();if(t.length>this.index)for(let e=0;e<t.length;e++){const i=t[e];i.selected=e==this.index,i.selected?i.style.display="flex":i.style.display="none"}this.fireEvent(ke.ContextChanged)}if(this.index>-1){const t=this.getTabs();if(this.getTab(this.index).hidden)for(let e=0;e<t.length;e++){if(!this.getTab(e).hidden)return void(this.index=e)}}}getCurrentTab(){return this.getTabs()[this.index]}getTab(t){return this.getTabs()[t]}handleTabContentChanged(){this.requestUpdate()}getTabs(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}return t}render(){const t=this.getTabs();return D`
4130
4128
  ${this.bottom?D`<div
4131
4129
  class="pane ${ee({first:0==this.index,embedded:this.embedded,bottom:this.bottom})}"
4132
4130
  >
@@ -4152,6 +4150,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4152
4150
  </div>`:null}
4153
4151
  </div>
4154
4152
  `:null}
4153
+ ${t.checked?D`<temba-icon class="check" name="check"></temba-icon>`:null}
4155
4154
  </div>
4156
4155
  `))}
4157
4156
 
@@ -4165,7 +4164,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4165
4164
  >
4166
4165
  <slot></slot>
4167
4166
  </div>`}
4168
- `}}t([ct({type:Boolean})],Ol.prototype,"embedded",void 0),t([ct({type:Boolean})],Ol.prototype,"collapses",void 0),t([ct({type:Boolean})],Ol.prototype,"bottom",void 0),t([ct({type:Boolean})],Ol.prototype,"focusedName",void 0),t([ct({type:Number})],Ol.prototype,"index",void 0),t([ct({type:String})],Ol.prototype,"refresh",void 0);class zl extends lt{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0}static get styles(){return r`
4167
+ `}}t([ct({type:Boolean})],Ml.prototype,"embedded",void 0),t([ct({type:Boolean})],Ml.prototype,"collapses",void 0),t([ct({type:Boolean})],Ml.prototype,"bottom",void 0),t([ct({type:Boolean})],Ml.prototype,"focusedName",void 0),t([ct({type:Number})],Ml.prototype,"index",void 0),t([ct({type:String})],Ml.prototype,"refresh",void 0);class Ol extends lt{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0,this.checked=!1}static get styles(){return r`
4169
4168
  :host {
4170
4169
  display: flex;
4171
4170
  flex-direction: column;
@@ -4184,7 +4183,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4184
4183
  }
4185
4184
  `}hasBadge(){return this.count>0}render(){return D`<slot
4186
4185
  class="${ee({selected:this.selected})}"
4187
- ></slot> `}}t([ct({type:String})],zl.prototype,"name",void 0),t([ct({type:String})],zl.prototype,"icon",void 0),t([ct({type:String})],zl.prototype,"selectionColor",void 0),t([ct({type:String})],zl.prototype,"selectionBackground",void 0),t([ct({type:Boolean})],zl.prototype,"selected",void 0),t([ct({type:Boolean})],zl.prototype,"notify",void 0),t([ct({type:Boolean})],zl.prototype,"hidden",void 0),t([ct({type:Number})],zl.prototype,"count",void 0);class Pl extends et{static get styles(){return r`
4186
+ ></slot> `}}t([ct({type:String})],Ol.prototype,"name",void 0),t([ct({type:String})],Ol.prototype,"icon",void 0),t([ct({type:String})],Ol.prototype,"selectionColor",void 0),t([ct({type:String})],Ol.prototype,"selectionBackground",void 0),t([ct({type:Boolean})],Ol.prototype,"selected",void 0),t([ct({type:Boolean})],Ol.prototype,"notify",void 0),t([ct({type:Boolean})],Ol.prototype,"hidden",void 0),t([ct({type:Number})],Ol.prototype,"count",void 0),t([ct({type:Boolean})],Ol.prototype,"checked",void 0);class zl extends et{static get styles(){return r`
4188
4187
  :host {
4189
4188
  display: inline-block;
4190
4189
  }
@@ -4268,7 +4267,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4268
4267
  <slot></slot>
4269
4268
  </div>
4270
4269
  </div>
4271
- `}}t([ct({type:Boolean})],Pl.prototype,"clickable",void 0),t([ct({type:Boolean})],Pl.prototype,"primary",void 0),t([ct({type:Boolean})],Pl.prototype,"secondary",void 0),t([ct({type:Boolean})],Pl.prototype,"tertiary",void 0),t([ct({type:Boolean})],Pl.prototype,"danger",void 0),t([ct({type:Boolean})],Pl.prototype,"dark",void 0),t([ct({type:Boolean})],Pl.prototype,"shadow",void 0),t([ct({type:String})],Pl.prototype,"icon",void 0),t([ct()],Pl.prototype,"backgroundColor",void 0),t([ct()],Pl.prototype,"textColor",void 0);class Il extends lt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4270
+ `}}t([ct({type:Boolean})],zl.prototype,"clickable",void 0),t([ct({type:Boolean})],zl.prototype,"primary",void 0),t([ct({type:Boolean})],zl.prototype,"secondary",void 0),t([ct({type:Boolean})],zl.prototype,"tertiary",void 0),t([ct({type:Boolean})],zl.prototype,"danger",void 0),t([ct({type:Boolean})],zl.prototype,"dark",void 0),t([ct({type:Boolean})],zl.prototype,"shadow",void 0),t([ct({type:String})],zl.prototype,"icon",void 0),t([ct()],zl.prototype,"backgroundColor",void 0),t([ct()],zl.prototype,"textColor",void 0);class Pl extends lt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4272
4271
  :host {
4273
4272
  display: flex;
4274
4273
  align-items: center;
@@ -4295,7 +4294,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4295
4294
  ${this.name?this.name:this.urn?this.urn.split(":")[1]:""}
4296
4295
  </div>
4297
4296
  <slot></slot>
4298
- `}}t([ct({type:String})],Il.prototype,"name",void 0),t([ct({type:String})],Il.prototype,"urn",void 0),t([ct({type:Number,attribute:"icon-size"})],Il.prototype,"size",void 0);class Dl extends lt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4297
+ `}}t([ct({type:String})],Pl.prototype,"name",void 0),t([ct({type:String})],Pl.prototype,"urn",void 0),t([ct({type:Number,attribute:"icon-size"})],Pl.prototype,"size",void 0);class Il extends lt{constructor(){super(...arguments),this.size=20}static get styles(){return r`
4299
4298
  :host {
4300
4299
  display: flex;
4301
4300
  align-items: center;
@@ -4322,7 +4321,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4322
4321
  height="${this.size}em"
4323
4322
  src="${this.prefix||window.static_url||"/static/"}img/schemes/${t}.svg"
4324
4323
  />
4325
- `}}t([ct({type:String})],Dl.prototype,"urn",void 0),t([ct({type:String})],Dl.prototype,"scheme",void 0),t([ct({type:Number})],Dl.prototype,"size",void 0);class Nl extends el{constructor(){super(...arguments),this.disabled=!1}static get styles(){return r`
4324
+ `}}t([ct({type:String})],Il.prototype,"urn",void 0),t([ct({type:String})],Il.prototype,"scheme",void 0),t([ct({type:Number})],Il.prototype,"size",void 0);class Dl extends tl{constructor(){super(...arguments),this.disabled=!1}static get styles(){return r`
4326
4325
  .field {
4327
4326
  display: flex;
4328
4327
  margin: 0.3em 0.3em;
@@ -4402,7 +4401,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4402
4401
  </div>
4403
4402
  </div>`:null}
4404
4403
  </div>
4405
- `}return super.render()}}t([ct({type:Boolean})],Nl.prototype,"system",void 0),t([ct({type:Boolean})],Nl.prototype,"dirty",void 0),t([ct({type:Boolean})],Nl.prototype,"showAll",void 0),t([ct({type:String})],Nl.prototype,"timezone",void 0),t([ct({type:String})],Nl.prototype,"role",void 0),t([ct({type:Boolean})],Nl.prototype,"disabled",void 0);class Rl extends lt{constructor(){super(...arguments),this.icon=navigator.clipboard?pt.copy:"",this.iconClass="",this.disabled=!1}static get styles(){return r`
4404
+ `}return super.render()}}t([ct({type:Boolean})],Dl.prototype,"system",void 0),t([ct({type:Boolean})],Dl.prototype,"dirty",void 0),t([ct({type:Boolean})],Dl.prototype,"showAll",void 0),t([ct({type:String})],Dl.prototype,"timezone",void 0),t([ct({type:String})],Dl.prototype,"role",void 0),t([ct({type:Boolean})],Dl.prototype,"disabled",void 0);class Nl extends lt{constructor(){super(...arguments),this.icon=navigator.clipboard?pt.copy:"",this.iconClass="",this.disabled=!1}static get styles(){return r`
4406
4405
  :host {
4407
4406
  --transition-speed: 0ms;
4408
4407
  }
@@ -4522,7 +4521,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4522
4521
  temba-datepicker {
4523
4522
  position: relative;
4524
4523
  }
4525
- `}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(Se.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.value=t.value,this.fireEvent("change")),this.icon=navigator.clipboard?"copy":""}handleChange(t){t.preventDefault(),t.stopPropagation()}handleInput(t){if("Enter"===t.key){t.currentTarget.blur()}}render(){return D`
4524
+ `}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(ke.ButtonClicked,{key:this.key,value:this.value}),t.preventDefault(),t.stopPropagation()}handleSubmit(){const t=this.shadowRoot.querySelector("temba-textinput, temba-datepicker");t.value!==this.value&&(this.value=t.value,this.fireEvent("change")),this.icon=navigator.clipboard?"copy":""}handleChange(t){t.preventDefault(),t.stopPropagation()}handleInput(t){if("Enter"===t.key){t.currentTarget.blur()}}render(){return D`
4526
4525
  <div
4527
4526
  class=${ee({wrapper:!0,set:!!this.value,unset:!this.value,disabled:this.disabled,mutable:!this.disabled})}
4528
4527
  >
@@ -4575,7 +4574,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4575
4574
  </temba-textinput>
4576
4575
  `}
4577
4576
  </div>
4578
- `}}t([ct({type:String})],Rl.prototype,"key",void 0),t([ct({type:String})],Rl.prototype,"value",void 0),t([ct({type:String})],Rl.prototype,"name",void 0),t([ct({type:String})],Rl.prototype,"type",void 0),t([ct({type:String})],Rl.prototype,"timezone",void 0),t([ct({type:String})],Rl.prototype,"icon",void 0),t([ct({type:String})],Rl.prototype,"iconClass",void 0),t([ct({type:Boolean})],Rl.prototype,"disabled",void 0);const Bl={stopped:{name:"Stopped"},blocked:{name:"Blocked"},archived:{name:"Archived"}};class ql extends el{constructor(){super(...arguments),this.hasMore=!1,this.expanded=!1}static get styles(){return r`
4577
+ `}}t([ct({type:String})],Nl.prototype,"key",void 0),t([ct({type:String})],Nl.prototype,"value",void 0),t([ct({type:String})],Nl.prototype,"name",void 0),t([ct({type:String})],Nl.prototype,"type",void 0),t([ct({type:String})],Nl.prototype,"timezone",void 0),t([ct({type:String})],Nl.prototype,"icon",void 0),t([ct({type:String})],Nl.prototype,"iconClass",void 0),t([ct({type:Boolean})],Nl.prototype,"disabled",void 0);const Rl={stopped:{name:"Stopped"},blocked:{name:"Blocked"},archived:{name:"Archived"}};class Bl extends tl{constructor(){super(...arguments),this.hasMore=!1,this.expanded=!1}static get styles(){return r`
4579
4578
  .wrapper {
4580
4579
  display: flex;
4581
4580
  flex-direction: column;
@@ -4644,7 +4643,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4644
4643
  .show-button temba-icon {
4645
4644
  border-radius: 9999px;
4646
4645
  }
4647
- `}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(ce(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=Bl[this.data.status];return D`
4646
+ `}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(ce(this.handleResized.bind(this),200)).observe(t)}}render(){if(this.data){const t=Rl[this.data.status];return D`
4648
4647
  <div
4649
4648
  class=${ee({wrapper:!0,"has-more":this.hasMore,expanded:this.expanded})}
4650
4649
  >
@@ -4709,7 +4708,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4709
4708
  ></temba-icon>
4710
4709
  </div>
4711
4710
  </div>
4712
- `}return null}}t([ct({type:Boolean})],ql.prototype,"hasMore",void 0),t([ct({type:Boolean})],ql.prototype,"expanded",void 0);const Ul={[we.CampaignEvent]:pt.campaign,[we.ScheduledBroadcast]:pt.message,[we.ScheduledTrigger]:pt.trigger};class Zl extends tl{static get styles(){return r`
4711
+ `}return null}}t([ct({type:Boolean})],Bl.prototype,"hasMore",void 0),t([ct({type:Boolean})],Bl.prototype,"expanded",void 0);const ql={[xe.CampaignEvent]:pt.campaign,[xe.ScheduledBroadcast]:pt.message,[xe.ScheduledTrigger]:pt.trigger};class Ul extends Qa{static get styles(){return r`
4713
4712
  :host {
4714
4713
  }
4715
4714
 
@@ -4813,7 +4812,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4813
4812
  .scheduled-by .name {
4814
4813
  flex-grow: 1;
4815
4814
  }
4816
- `}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)}handleEventClicked(t){this.fireCustomEvent(Se.Selection,t)}renderEvent(t){return D`
4815
+ `}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)}handleEventClicked(t){this.fireCustomEvent(ke.Selection,t)}renderEvent(t){return D`
4817
4816
  <div
4818
4817
  class="event ${t.type}"
4819
4818
  @click="${()=>this.handleEventClicked(t)}"
@@ -4836,8 +4835,8 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4836
4835
  <temba-icon name="${pt.campaign}"></temba-icon>
4837
4836
  <div class="name">${t.campaign.name}</div>
4838
4837
  </div>`:D`
4839
- ${t.type===we.ScheduledTrigger?D`<temba-icon
4840
- name="${Ul[t.type]}"
4838
+ ${t.type===xe.ScheduledTrigger?D`<temba-icon
4839
+ name="${ql[t.type]}"
4841
4840
  ></temba-icon>`:null}
4842
4841
  <div class="name">
4843
4842
  ${this.REPEAT_PERIOD[t.repeat_period]}
@@ -4859,7 +4858,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
4859
4858
  </div>
4860
4859
  `}render(){if(this.data)return this.data.length>0?D`
4861
4860
  ${this.data.map((t=>this.renderEvent(t)))}
4862
- `:D`<slot name="empty"></slot>`}}t([ct({type:String})],Zl.prototype,"contact",void 0),t([ct({type:Object,attribute:!1})],Zl.prototype,"data",void 0),t([ct({type:String})],Zl.prototype,"lang_weekly",void 0),t([ct({type:String})],Zl.prototype,"lang_daily",void 0),t([ct({type:String})],Zl.prototype,"lang_once",void 0);class Fl extends tl{constructor(){super(...arguments),this.clickable=!1,this.expandable=!1,this.expanded=!1}static get styles(){return r`
4861
+ `:D`<slot name="empty"></slot>`}}t([ct({type:String})],Ul.prototype,"contact",void 0),t([ct({type:Object,attribute:!1})],Ul.prototype,"data",void 0),t([ct({type:String})],Ul.prototype,"lang_weekly",void 0),t([ct({type:String})],Ul.prototype,"lang_daily",void 0),t([ct({type:String})],Ul.prototype,"lang_once",void 0);class Zl extends Qa{constructor(){super(...arguments),this.clickable=!1,this.expandable=!1,this.expanded=!1}static get styles(){return r`
4863
4862
  :host {
4864
4863
  }
4865
4864
 
@@ -5025,12 +5024,12 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5025
5024
  .details .toggle {
5026
5025
  padding-right: 0.5em;
5027
5026
  }
5028
- `}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==ke.Open&&e.status==ke.Closed?-1:e.status==ke.Open&&t.status==ke.Closed?1:t.status==ke.Closed&&e.status==ke.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}renderUser(t){return t?D`<div class="user">
5029
- <div class="avatar">${_e({user:t})}</div>
5027
+ `}prepareData(t){return t&&t.length&&t.sort(((t,e)=>t.status==we.Open&&e.status==we.Closed?-1:e.status==we.Open&&t.status==we.Closed?1:t.status==we.Closed&&e.status==we.Closed?new Date(e.closed_on).getTime()-new Date(t.closed_on).getTime():new Date(e.opened_on).getTime()-new Date(t.opened_on).getTime())),t}updated(t){super.updated(t),(t.has("contact")||t.has("ticket"))&&(this.contact?this.url=`/api/v2/tickets.json?contact=${this.contact}${this.ticket?"&ticket="+this.ticket:""}`:this.url=null)}renderUser(t){return t?D`<div class="user">
5028
+ <div class="avatar">${be({user:t})}</div>
5030
5029
  <div class="name">${(t=>t.first_name&&t.last_name?`${t.first_name} ${t.last_name}`:t.email)(t)}</div>
5031
5030
  </div>`:null}handleClose(t){ae("/api/v2/ticket_actions.json",{tickets:[t],action:"close"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleReopen(t){ae("/api/v2/ticket_actions.json",{tickets:[t],action:"reopen"}).then((()=>{this.refresh()})).catch((t=>{console.error(t)}))}handleTicketAssignment(t,e){const i=this.data.find((e=>e.uuid===t));if(!i.assignee||i.assignee.email!==e)return ae("/api/v2/ticket_actions.json",{tickets:[t],action:"assign",assignee:e}).then((()=>{this.refresh()})).catch((t=>{console.error(t)})),!0}renderTicket(t){const e=t.opened_on,i=this.store.getAssignableUsers(),n=i.find((t=>t.email===this.agent));return D`
5032
5031
  <div
5033
- @click=${()=>{this.clickable?this.fireCustomEvent(Se.ButtonClicked,{ticket:t}):this.expandable&&(this.expanded=!this.expanded)}}
5032
+ @click=${()=>{this.clickable?this.fireCustomEvent(ke.ButtonClicked,{ticket:t}):this.expandable&&(this.expanded=!this.expanded)}}
5034
5033
  class="ticket ${t.status} ${ee({clickable:this.clickable,expandable:this.expandable,expanded:this.expanded})}"
5035
5034
  >
5036
5035
  <div class="header">
@@ -5041,7 +5040,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5041
5040
  <temba-date value="${e}" display="duration"></temba-date>
5042
5041
  </div>
5043
5042
 
5044
- ${t.status===ke.Closed?D`<div class="reopen">
5043
+ ${t.status===we.Closed?D`<div class="reopen">
5045
5044
  <temba-button
5046
5045
  primary
5047
5046
  small
@@ -5060,7 +5059,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5060
5059
  <div slot="toggle" class="toggle">
5061
5060
  ${t.assignee?D`
5062
5061
  <div style="font-size:0.5em">
5063
- ${_e({name:t.assignee.name,position:"left"})}
5062
+ ${be({name:t.assignee.name,position:"left"})}
5064
5063
  </div>
5065
5064
  `:D`
5066
5065
  <temba-button
@@ -5074,7 +5073,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5074
5073
  <div
5075
5074
  slot="dropdown"
5076
5075
  class="dropdown"
5077
- @click=${t=>{ye(t)}}
5076
+ @click=${t=>{ve(t)}}
5078
5077
  >
5079
5078
  ${t.assignee?D`
5080
5079
  <div
@@ -5085,14 +5084,14 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5085
5084
  name="Unassign"
5086
5085
  primary
5087
5086
  small
5088
- @click=${e=>{ye(e),this.handleTicketAssignment(t.uuid,null)}}
5087
+ @click=${e=>{ve(e),this.handleTicketAssignment(t.uuid,null)}}
5089
5088
  ></temba-button>
5090
5089
  </div>
5091
5090
  `:null}
5092
5091
  ${!n||t.assignee&&n.email===t.assignee.email?null:D`
5093
5092
  <div
5094
5093
  class="current-user option-group"
5095
- @click=${e=>{ye(e),this.handleTicketAssignment(t.uuid,n.email)}}
5094
+ @click=${e=>{ve(e),this.handleTicketAssignment(t.uuid,n.email)}}
5096
5095
  >
5097
5096
  ${this.renderUser(n)}
5098
5097
  </div>
@@ -5100,7 +5099,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5100
5099
 
5101
5100
  <div class="options option-group">
5102
5101
  ${this.store.getAssignableUsers().map((e=>t.assignee&&e.email===t.assignee.email||e.email===this.agent?null:D`<div
5103
- @click=${i=>{ye(i),this.handleTicketAssignment(t.uuid,e.email)}}
5102
+ @click=${i=>{ve(i),this.handleTicketAssignment(t.uuid,e.email)}}
5104
5103
  >
5105
5104
  ${this.renderUser(e)}
5106
5105
  </div>`))}
@@ -5126,7 +5125,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5126
5125
  </div>
5127
5126
  <div class="body">${t.body}</div>
5128
5127
  </div>
5129
- `}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return D`${t}`}return D`<slot name="empty"></slot>`}}t([ct({type:String})],Fl.prototype,"agent",void 0),t([ct({type:String})],Fl.prototype,"contact",void 0),t([ct({type:String})],Fl.prototype,"ticket",void 0),t([ct({type:Boolean})],Fl.prototype,"clickable",void 0),t([ct({type:Boolean})],Fl.prototype,"expandable",void 0),t([ct({type:Boolean})],Fl.prototype,"expanded",void 0),t([ct({type:Object,attribute:!1})],Fl.prototype,"data",void 0);class Vl extends ut{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
5128
+ `}render(){if(this.data&&this.data.length>0){const t=this.data.map((t=>this.renderTicket(t)));return D`${t}`}return D`<slot name="empty"></slot>`}}t([ct({type:String})],Zl.prototype,"agent",void 0),t([ct({type:String})],Zl.prototype,"contact",void 0),t([ct({type:String})],Zl.prototype,"ticket",void 0),t([ct({type:Boolean})],Zl.prototype,"clickable",void 0),t([ct({type:Boolean})],Zl.prototype,"expandable",void 0),t([ct({type:Boolean})],Zl.prototype,"expanded",void 0),t([ct({type:Object,attribute:!1})],Zl.prototype,"data",void 0);class Fl extends ut{constructor(){super(...arguments),this.range=!1,this.min=0,this.max=100,this.circleX=0,this.grabbed=!1}static get styles(){return r`
5130
5129
  :host {
5131
5130
  display: block;
5132
5131
  }
@@ -5192,7 +5191,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5192
5191
  <div class="track" @mousedown=${this.handleTrackDown}></div>
5193
5192
  ${this.range?D`<div class="post">${this.max}</div>`:null}
5194
5193
  </div>
5195
- </div>`}}t([ct({type:Boolean})],Vl.prototype,"range",void 0),t([ct({type:Number})],Vl.prototype,"min",void 0),t([ct({type:Number})],Vl.prototype,"max",void 0);const jl="rgb(223, 65, 159)";class Hl extends fl{static get styles(){return r`
5194
+ </div>`}}t([ct({type:Boolean})],Fl.prototype,"range",void 0),t([ct({type:Number})],Fl.prototype,"min",void 0),t([ct({type:Number})],Fl.prototype,"max",void 0);const Vl="rgb(223, 65, 159)";class jl extends ml{static get styles(){return r`
5196
5195
  :host {
5197
5196
  overflow-y: auto !important;
5198
5197
  }
@@ -5213,10 +5212,10 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5213
5212
  style="--icon-color:#666;margin-left:0.5em"
5214
5213
  />`:"interrupted"==t.exit_type?e=D`<temba-icon
5215
5214
  name="x-octagon"
5216
- style="--icon-color:${jl};margin-left:0.5em"
5215
+ style="--icon-color:${Vl};margin-left:0.5em"
5217
5216
  />`:"expired"==t.exit_type?e=D`<temba-icon
5218
5217
  name="clock"
5219
- style="--icon-color:${jl};margin-left:0.5em"
5218
+ style="--icon-color:${Vl};margin-left:0.5em"
5220
5219
  />`:t.exit_type||(e=t.responded?D`<temba-icon
5221
5220
  name="activity"
5222
5221
  style="--icon-color:var(--color-primary-dark);margin-left:0.5em"
@@ -5305,7 +5304,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5305
5304
  <div style="margin-left:2em;flex-grow:1;display:flex">
5306
5305
  ${this.getIcon(this.selectedRun)}
5307
5306
  <div style="margin-left:0.5em">
5308
- ${ge(this.selectedRun.exit_type)}&nbsp;
5307
+ ${fe(this.selectedRun.exit_type)}&nbsp;
5309
5308
  </div>
5310
5309
  <temba-date
5311
5310
  value="${this.selectedRun.exited_on}"
@@ -5368,7 +5367,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5368
5367
  </div>
5369
5368
  `:null}
5370
5369
  </div>
5371
- </div>`}constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([ct({type:String})],Hl.prototype,"flow",void 0),t([ct({type:Object,attribute:!1})],Hl.prototype,"results",void 0),t([ct({type:Boolean})],Hl.prototype,"responses",void 0),t([ct({type:Object})],Hl.prototype,"resultPreview",void 0),t([ct({type:Object})],Hl.prototype,"selectedRun",void 0);class Wl extends tl{constructor(){super(...arguments),this.endpoint="/api/v2/flows.json?uuid="}prepareData(t){return t&&t.length>0&&(t=t[0]),t}updated(t){super.updated(t),t.has("flow")&&(this.flow?this.url=`${this.endpoint}${this.flow}`:this.url=null)}render(){if(this.data)return D`<div></div>`}}t([ct({type:String})],Wl.prototype,"flow",void 0),t([ct({type:Object,attribute:!1})],Wl.prototype,"data",void 0),t([ct({type:String})],Wl.prototype,"endpoint",void 0);class Gl extends el{constructor(){super(...arguments),this.size=20}static get styles(){return r`
5370
+ </div>`}constructor(){super(),this.responses=!0,this.resultKeys={},this.reverseRefresh=!1,this.valueKey="uuid",this.hideShadow=!0,this.createRenderOption()}}t([ct({type:String})],jl.prototype,"flow",void 0),t([ct({type:Object,attribute:!1})],jl.prototype,"results",void 0),t([ct({type:Boolean})],jl.prototype,"responses",void 0),t([ct({type:Object})],jl.prototype,"resultPreview",void 0),t([ct({type:Object})],jl.prototype,"selectedRun",void 0);class Hl extends Qa{constructor(){super(...arguments),this.endpoint="/api/v2/flows.json?uuid="}prepareData(t){return t&&t.length>0&&(t=t[0]),t}updated(t){super.updated(t),t.has("flow")&&(this.flow?this.url=`${this.endpoint}${this.flow}`:this.url=null)}render(){if(this.data)return D`<div></div>`}}t([ct({type:String})],Hl.prototype,"flow",void 0),t([ct({type:Object,attribute:!1})],Hl.prototype,"data",void 0),t([ct({type:String})],Hl.prototype,"endpoint",void 0);class Wl extends tl{constructor(){super(...arguments),this.size=20}static get styles(){return r`
5372
5371
  :host {
5373
5372
  display: flex;
5374
5373
  }
@@ -5381,7 +5380,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5381
5380
  name=${this.data.name||this.data.anon_display}
5382
5381
  urn=${this.data.urns.length>0?this.data.urns[0]:null}
5383
5382
  ></temba-contact-name>
5384
- <slot></slot>`:super.render()}}t([ct({type:Number,attribute:"icon-size"})],Gl.prototype,"size",void 0);class Kl extends ut{static get styles(){return r`
5383
+ <slot></slot>`:super.render()}}t([ct({type:Number,attribute:"icon-size"})],Wl.prototype,"size",void 0);class Gl extends ut{static get styles(){return r`
5385
5384
  :host {
5386
5385
  display: block;
5387
5386
  }
@@ -5489,7 +5488,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5489
5488
  margin: 0;
5490
5489
  padding: 0;
5491
5490
  }
5492
- `}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=ks.fromSQL(this.value).setZone(this.timezone);t.invalid&&(t=ks.fromISO(this.value).setZone(this.timezone)),this.datetime=t,this.value=this.datetime.toUTC().toISO()}}else this.datetime=ks.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()}handleBlur(t){this.time?(this.datetime=ks.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=ee({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),D`
5491
+ `}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=ws.fromSQL(this.value).setZone(this.timezone);t.invalid&&(t=ws.fromISO(this.value).setZone(this.timezone)),this.datetime=t,this.value=this.datetime.toUTC().toISO()}}else this.datetime=ws.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()}handleBlur(t){this.time?(this.datetime=ws.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=ee({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),D`
5493
5492
  <temba-field
5494
5493
  class=${ee({disabled:this.disabled})}
5495
5494
  name=${this.name}
@@ -5522,7 +5521,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5522
5521
  `:null}
5523
5522
  </div>
5524
5523
  </temba-field>
5525
- `}}t([ct({type:String})],Kl.prototype,"timezone",void 0),t([ct({type:String})],Kl.prototype,"timezoneFriendly",void 0),t([ct({type:Object})],Kl.prototype,"datetime",void 0),t([ct({type:Boolean})],Kl.prototype,"time",void 0);const Yl={text:"Text",numeric:"Number",number:"Number",datetime:"Date & Time",state:"State",ward:"Ward",district:"District"},Jl=(t,e)=>{if(!e)return!0;return(t.label+t.key+Yl[t.value_type]).toLowerCase().toLowerCase().indexOf(e)>-1};class Xl extends tl{constructor(){super(...arguments),this.otherFieldKeys=[],this.query=""}static get styles(){return r`
5524
+ `}}t([ct({type:String})],Gl.prototype,"timezone",void 0),t([ct({type:String})],Gl.prototype,"timezoneFriendly",void 0),t([ct({type:Object})],Gl.prototype,"datetime",void 0),t([ct({type:Boolean})],Gl.prototype,"time",void 0);const Kl={text:"Text",numeric:"Number",number:"Number",datetime:"Date & Time",state:"State",ward:"Ward",district:"District"},Yl=(t,e)=>{if(!e)return!0;return(t.label+t.key+Kl[t.value_type]).toLowerCase().toLowerCase().indexOf(e)>-1};class Jl extends Qa{constructor(){super(...arguments),this.otherFieldKeys=[],this.query=""}static get styles(){return r`
5526
5525
  :host {
5527
5526
  display: flex;
5528
5527
  flex-grow: 1;
@@ -5614,7 +5613,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5614
5613
  border-color: #e6e6e6;
5615
5614
  background: #fcfcfc;
5616
5615
  }
5617
- `}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&&Jl(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=>{Jl(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;ae(this.priorityEndpoint,e.getIds().reverse().reduce(((t,e,i)=>(t[e]=i,t)),{})).then((()=>{this.store.refreshFields()}))}handleOrderChanged(t){const e=t.detail,i=this.featuredFields[e.fromIdx];this.featuredFields[e.fromIdx]=this.featuredFields[e.toIdx],this.featuredFields[e.toIdx]=i,this.requestUpdate("featuredFields")}handleDragStart(t){this.draggingId=t.detail.id}handleDragStop(){this.draggingId=null}handleFieldAction(t){const e=t.target,i=e.dataset.key,n=e.dataset.action;this.fireCustomEvent(Se.Selection,{key:i,action:n})}handleSearch(t){this.query=(t.target.value||"").trim()}hasUsages(t){return t.usages.campaign_events+t.usages.flows+t.usages.groups>0}renderField(t){return D`
5616
+ `}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&&Yl(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=>{Yl(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;ae(this.priorityEndpoint,e.getIds().reverse().reduce(((t,e,i)=>(t[e]=i,t)),{})).then((()=>{this.store.refreshFields()}))}handleOrderChanged(t){const e=t.detail,i=this.featuredFields[e.fromIdx];this.featuredFields[e.fromIdx]=this.featuredFields[e.toIdx],this.featuredFields[e.toIdx]=i,this.requestUpdate("featuredFields")}handleDragStart(t){this.draggingId=t.detail.id}handleDragStop(){this.draggingId=null}handleFieldAction(t){const e=t.target,i=e.dataset.key,n=e.dataset.action;this.fireCustomEvent(ke.Selection,{key:i,action:n})}handleSearch(t){this.query=(t.target.value||"").trim()}hasUsages(t){return t.usages.campaign_events+t.usages.flows+t.usages.groups>0}renderField(t){return D`
5618
5617
  <div
5619
5618
  class="field sortable"
5620
5619
  id="${t.key}"
@@ -5654,7 +5653,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5654
5653
  >
5655
5654
  @fields.${t.key}
5656
5655
  </div>
5657
- <div>${Yl[t.value_type]}</div>
5656
+ <div>${Kl[t.value_type]}</div>
5658
5657
  <temba-icon
5659
5658
  style="pointer-events:none;color:#ccc;margin-left:0.3em;margin-right:-0.5em;opacity:0"
5660
5659
  name="delete_small"
@@ -5704,7 +5703,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5704
5703
  ${this.otherFieldKeys.map((t=>this.renderField(this.store.getContactField(t))))}
5705
5704
  </div>
5706
5705
  </div>
5707
- `:null}}t([ct({type:String,attribute:"priority-endpoint"})],Xl.prototype,"priorityEndpoint",void 0),t([ct({type:Object,attribute:!1})],Xl.prototype,"featuredFields",void 0),t([ct({type:Object,attribute:!1})],Xl.prototype,"otherFieldKeys",void 0),t([ct({type:String})],Xl.prototype,"draggingId",void 0),t([ct({type:String})],Xl.prototype,"query",void 0);class Ql extends lt{static get styles(){return r`
5706
+ `:null}}t([ct({type:String,attribute:"priority-endpoint"})],Jl.prototype,"priorityEndpoint",void 0),t([ct({type:Object,attribute:!1})],Jl.prototype,"featuredFields",void 0),t([ct({type:Object,attribute:!1})],Jl.prototype,"otherFieldKeys",void 0),t([ct({type:String})],Jl.prototype,"draggingId",void 0),t([ct({type:String})],Jl.prototype,"query",void 0);class Xl extends lt{static get styles(){return r`
5708
5707
  :host {
5709
5708
  margin: auto;
5710
5709
  }
@@ -5747,11 +5746,11 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5747
5746
  padding: 0.2em 0.5em;
5748
5747
  transition: all 300ms ease-in-out;
5749
5748
  }
5750
- `}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 n=i.getBoundingClientRect();return i.id!==this.ghostElement.id&&(t>this.yDown?e.top<n.bottom&&e.bottom>n.bottom:n.top<e.bottom&&n.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(Se.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,n=i.id;this.fireCustomEvent(Se.OrderChanged,{from:e,to:n,fromIdx:this.draggingIdx,toIdx:t}),this.draggingIdx=t,this.draggingId=n}}}handleMouseUp(){this.draggingId&&(this.fireCustomEvent(Se.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 D`
5749
+ `}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 n=i.getBoundingClientRect();return i.id!==this.ghostElement.id&&(t>this.yDown?e.top<n.bottom&&e.bottom>n.bottom:n.top<e.bottom&&n.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(ke.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,n=i.id;this.fireCustomEvent(ke.OrderChanged,{from:e,to:n,fromIdx:this.draggingIdx,toIdx:t}),this.draggingIdx=t,this.draggingId=n}}}handleMouseUp(){this.draggingId&&(this.fireCustomEvent(ke.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 D`
5751
5750
  <div class="container">
5752
5751
  <slot @mousedown=${this.handleMouseDown}></slot>
5753
5752
  </div>
5754
- `}}t([ct({type:String})],Ql.prototype,"draggingId",void 0);const th={"Temba-Content-Menu":"1","Temba-Spa":"1"};var eh;!function(t){t.LINK="link",t.JS="js",t.URL_POST="url_post",t.MODAX="modax",t.DIVIDER="divider"}(eh||(eh={}));class ih extends lt{constructor(){super(...arguments),this.buttons=[],this.items=[]}static get styles(){return r`
5753
+ `}}t([ct({type:String})],Xl.prototype,"draggingId",void 0);const Ql={"Temba-Content-Menu":"1","Temba-Spa":"1"};var th;!function(t){t.LINK="link",t.JS="js",t.URL_POST="url_post",t.MODAX="modax",t.DIVIDER="divider"}(th||(th={}));class eh extends lt{constructor(){super(...arguments),this.buttons=[],this.items=[]}static get styles(){return r`
5755
5754
  .container {
5756
5755
  --button-y: 0.4em;
5757
5756
  --button-x: 1em;
@@ -5798,7 +5797,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5798
5797
  .item:hover {
5799
5798
  color: var(--color-link-primary);
5800
5799
  }
5801
- `}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=th;e&&delete i["Temba-Spa"],te(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(Se.Loaded,{buttons:this.buttons,items:this.items})})).catch((t=>{console.error(t)}))}}refresh(){this.fetchContentMenu()}updated(t){super.updated(t),(t.has("endpoint")||t.has("legacy"))&&this.fetchContentMenu()}handleItemClicked(t,e){this.fireCustomEvent(Se.Selection,{item:t,event:e})}render(){return D`
5800
+ `}fetchContentMenu(){const t=this.endpoint;if(t){const e=this.legacy,i=Ql;e&&delete i["Temba-Spa"],te(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(ke.Loaded,{buttons:this.buttons,items:this.items})})).catch((t=>{console.error(t)}))}}refresh(){this.fetchContentMenu()}updated(t){super.updated(t),(t.has("endpoint")||t.has("legacy"))&&this.fetchContentMenu()}handleItemClicked(t,e){this.fireCustomEvent(ke.Selection,{item:t,event:e})}render(){return D`
5802
5801
  <div class="container">
5803
5802
  ${this.buttons.map((t=>D`<temba-button
5804
5803
  class="${t.primary?"primary_button_item":"button_item"}"
@@ -5817,7 +5816,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5817
5816
  <temba-icon name="menu" size="1.5"></temba-icon>
5818
5817
  </div>
5819
5818
  <div slot="dropdown" class="dropdown">
5820
- ${this.items.map((t=>t.type===eh.DIVIDER?D` <div class="divider"></div>`:D` <div
5819
+ ${this.items.map((t=>t.type===th.DIVIDER?D` <div class="divider"></div>`:D` <div
5821
5820
  class="item"
5822
5821
  name=${t.label}
5823
5822
  @click=${e=>this.handleItemClicked(t,e)}
@@ -5827,29 +5826,29 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5827
5826
  </div>
5828
5827
  </temba-dropdown>`:null}
5829
5828
  </div>
5830
- `}}t([ct({type:String})],ih.prototype,"endpoint",void 0),t([ct({type:Number})],ih.prototype,"legacy",void 0),t([ct({type:Array,attribute:!1})],ih.prototype,"buttons",void 0),t([ct({type:Array,attribute:!1})],ih.prototype,"items",void 0);const nh={date:ks.DATE_SHORT,datetime:ks.DATETIME_SHORT,time:ks.TIME_SIMPLE,timedate:"timedate",duration:"duration",relative:"relative",day:"LLL d"};class oh extends lt{constructor(){super(...arguments),this.display="date"}static get styles(){return r`
5829
+ `}}t([ct({type:String})],eh.prototype,"endpoint",void 0),t([ct({type:Number})],eh.prototype,"legacy",void 0),t([ct({type:Array,attribute:!1})],eh.prototype,"buttons",void 0),t([ct({type:Array,attribute:!1})],eh.prototype,"items",void 0);const ih={date:ws.DATE_SHORT,datetime:ws.DATETIME_SHORT,time:ws.TIME_SIMPLE,timedate:"timedate",duration:"duration",relative:"relative",day:"LLL d"};class nh extends lt{constructor(){super(...arguments),this.display="date"}static get styles(){return r`
5831
5830
  .date {
5832
5831
  display: block;
5833
5832
  overflow: hidden;
5834
5833
  text-overflow: ellipsis;
5835
5834
  white-space: nowrap;
5836
5835
  }
5837
- `}firstUpdated(t){super.firstUpdated(t),this.store=document.querySelector("temba-store")}updated(t){super.updated(t),t.has("value")&&(this.datetime=ks.fromISO(this.value))}connectedCallback(){super.connectedCallback()}render(){if(this.datetime&&this.store){this.datetime.setLocale(this.store.getLocale());let t="";if(this.display===nh.timedate){const e=Math.abs(this.datetime.diffNow().milliseconds/1e3/60/60);t=e<24?this.datetime.toLocaleString(nh.time):e<8760?this.datetime.toFormat(nh.day):this.datetime.toLocaleString(nh.date)}else if(this.display===nh.relative){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
5836
+ `}firstUpdated(t){super.firstUpdated(t),this.store=document.querySelector("temba-store")}updated(t){super.updated(t),t.has("value")&&(this.datetime=ws.fromISO(this.value))}connectedCallback(){super.connectedCallback()}render(){if(this.datetime&&this.store){this.datetime.setLocale(this.store.getLocale());let t="";if(this.display===ih.timedate){const e=Math.abs(this.datetime.diffNow().milliseconds/1e3/60/60);t=e<24?this.datetime.toLocaleString(ih.time):e<8760?this.datetime.toFormat(ih.day):this.datetime.toLocaleString(ih.date)}else if(this.display===ih.relative){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
5838
5837
  class="date"
5839
- title="${this.datetime.toLocaleString(nh.datetime)}"
5838
+ title="${this.datetime.toLocaleString(ih.datetime)}"
5840
5839
  >
5841
5840
  just now
5842
- </div>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===nh.duration){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
5841
+ </div>`;t=this.store.getShortDuration(this.datetime)}else if(this.display===ih.duration){if(Math.abs(this.datetime.diffNow().milliseconds/1e3/60)<1)return D`<div
5843
5842
  class="date"
5844
- title="${this.datetime.toLocaleString(nh.datetime)}"
5843
+ title="${this.datetime.toLocaleString(ih.datetime)}"
5845
5844
  >
5846
5845
  just now
5847
- </div>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===nh.day?this.datetime.toLocaleString(nh.day):this.datetime.toLocaleString(nh[this.display]);return D`<div
5846
+ </div>`;t=this.store.getShortDuration(this.datetime)}else t=this.display===ih.day?this.datetime.toLocaleString(ih.day):this.datetime.toLocaleString(ih[this.display]);return D`<div
5848
5847
  class="date"
5849
- title="${this.datetime.toLocaleString(nh.datetime)}"
5848
+ title="${this.datetime.toLocaleString(ih.datetime)}"
5850
5849
  >
5851
5850
  ${t}
5852
- </div>`}}}t([ct({type:String})],oh.prototype,"value",void 0),t([ct({type:String})],oh.prototype,"display",void 0),t([ct({type:Object,attribute:!1})],oh.prototype,"datetime",void 0);let sh=class extends lt{constructor(){super(...arguments),this.body=D`<temba-loading></temba-loading>`}static get styles(){return r``}updated(t){super.updated(t),t.has("endpoint")&&te(this.endpoint).then((t=>{this.body=Js(t.body)}))}render(){return D`${this.body}`}};t([ct({type:String})],sh.prototype,"endpoint",void 0),t([ct({attribute:!1})],sh.prototype,"body",void 0),sh=t([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("temba-remote")],sh);var rh=sh;class ah extends ut{static get styles(){return r`
5851
+ </div>`}}}t([ct({type:String})],nh.prototype,"value",void 0),t([ct({type:String})],nh.prototype,"display",void 0),t([ct({type:Object,attribute:!1})],nh.prototype,"datetime",void 0);let oh=class extends lt{constructor(){super(...arguments),this.body=D`<temba-loading></temba-loading>`}static get styles(){return r``}updated(t){super.updated(t),t.has("endpoint")&&te(this.endpoint).then((t=>{this.body=Ys(t.body)}))}render(){return D`${this.body}`}};t([ct({type:String})],oh.prototype,"endpoint",void 0),t([ct({attribute:!1})],oh.prototype,"body",void 0),oh=t([(t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e))("temba-remote")],oh);var sh=oh;class rh extends ut{static get styles(){return r`
5853
5852
  .container {
5854
5853
  display: flex;
5855
5854
  flex-direction: column;
@@ -5868,7 +5867,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5868
5867
  opacity: 0;
5869
5868
  pointer-events: none;
5870
5869
  position: absolute;
5871
- z-index: 2;
5872
5870
  height: 100%;
5873
5871
  width: 100%;
5874
5872
  bottom: 0;
@@ -6001,7 +5999,6 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6001
5999
  .language {
6002
6000
  margin-bottom: 0.6em;
6003
6001
  display: block;
6004
- z-index: 2;
6005
6002
  }
6006
6003
 
6007
6004
  .top-right {
@@ -6037,7 +6034,11 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6037
6034
  temba-loading {
6038
6035
  margin: auto 1em;
6039
6036
  }
6040
- `}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.currentText="",this.initialText="",this.accept="",this.endpoint=Jt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.failedAttachments=[],this.buttonName="Send",this.buttonDisabled=!0,this.buttonError="",this.langValues={},this.currentLanguage="und"}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs").getCurrentTab();t&&"attachment"==t.icon&&0==this.currentAttachments.length&&this.handleUploadFileIconClicked()}getEventHandlers(){return[{event:Se.ContextChanged,method:this.handleTabChanged}]}firstUpdated(t){super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{}),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.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"))){this.toggleButton();const t=this.currentText?this.currentText.trim():"";t||this.currentAttachments.length>0||this.currentQuickReplies.length>0?this.langValues[this.currentLanguage]={text:t,attachments:this.currentAttachments,quick_replies:this.currentQuickReplies.map((t=>t.value))}:delete this.langValues[this.currentLanguage],this.fireCustomEvent(Se.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}setFocusOnChatbox(){if(this.chatbox){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}}reset(){this.shadowRoot.querySelector(".chatbox").value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.failedAttachments=[],this.buttonError=""}handleQuickReplyChange(t){this.requestUpdate("currentQuickReplies")}handleChatboxChange(t){const e=t.target;this.currentText=e.value}handleDragEnter(t){this.highlight(t)}handleDragOver(t){this.highlight(t)}handleDragLeave(t){this.unhighlight(t)}handleDrop(t){if(this.canAcceptAttachments()){this.unhighlight(t);const e=t.dataTransfer;if(e){const t=e.files;this.uploadFiles(t)}}}preventDefaults(t){t.preventDefault(),t.stopPropagation()}highlight(t){this.canAcceptAttachments()&&(this.pendingDrop=!0,this.preventDefaults(t))}unhighlight(t){this.canAcceptAttachments()&&(this.pendingDrop=!1,this.preventDefaults(t))}handleUploadFileIconClicked(){this.dispatchEvent(new Event("change"))}handleUploadFileInputChanged(t){const e=t.target.files;this.uploadFiles(e)}canAcceptAttachments(){return this.attachments&&this.currentAttachments.length<this.maxAttachments}uploadFiles(t){let e=[];e=this.currentAttachments&&this.currentAttachments.length>0?[...t].filter((t=>{if(-1===this.currentAttachments.findIndex((e=>e.filename===t.name&&e.size===t.size)))return t})):[...t],e.map((t=>{this.uploadFile(t)}))}uploadFile(t){this.uploading=!0;const e=this.endpoint,i=new FormData;i.append("file",t),le(e,i).then((e=>{if(this.currentAttachments.length>=this.maxAttachments)this.addFailedAttachment(t,"Too many attachments");else{const t=e.json;t&&this.addCurrentAttachment(t)}})).catch((e=>{let i="";i=400===e.status?e.json.file[0]:"Server failure",console.error(i),this.addFailedAttachment(t,i)})).finally((()=>{this.uploading=!1}))}addCurrentAttachment(t){this.currentAttachments.push(t),this.requestUpdate("currentAttachments")}removeCurrentAttachment(t){this.currentAttachments=this.currentAttachments.filter((e=>e!==t)),this.requestUpdate("currentAttachments")}addFailedAttachment(t,e){const i={uuid:Math.random().toString(36).slice(2,6),content_type:t.type,filename:t.name,url:t.name,size:t.size,error:e};this.failedAttachments.push(i),this.requestUpdate("failedAttachments")}removeFailedAttachment(t){this.failedAttachments=this.failedAttachments.filter((e=>e!==t)),this.requestUpdate("failedAttachments")}handleRemoveFileClicked(t){const e=t.target,i=this.currentAttachments.find((({uuid:t})=>t===e.id));i&&this.removeCurrentAttachment(i);const n=this.failedAttachments.find((({uuid:t})=>t===e.id));n&&this.removeFailedAttachment(n)}toggleButton(){if(this.button){this.buttonError="";const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.chatbox&&this.attachments?this.buttonDisabled=t&&e:this.chatbox?this.buttonDisabled=t:this.attachments?this.buttonDisabled=e:this.buttonDisabled=!0}}handleSendClick(t){t.stopPropagation(),this.handleSend()}handleSendEnter(t){if(this.button&&"Enter"===t.key&&!t.shiftKey)if(this.completion){t.target.hasVisibleOptions()||(this.handleSend(),this.preventDefaults(t))}else this.handleSend(),this.preventDefaults(t)}handleSend(){if(!this.buttonDisabled){this.buttonDisabled=!0;const t=this.buttonName;this.fireCustomEvent(Se.ButtonClicked,{name:t})}}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.shadowRoot.querySelector("temba-tabs").index=-1}render(){return D`
6037
+
6038
+ .optins {
6039
+ padding: 1em;
6040
+ }
6041
+ `}constructor(){super(),this.index=1,this.maxAttachments=3,this.maxLength=640,this.currentText="",this.initialText="",this.accept="",this.endpoint=Jt,this.languages=[],this.currentAttachments=[],this.currentQuickReplies=[],this.currentOptin=[],this.optinEndpoint="/api/v2/optins.json",this.failedAttachments=[],this.buttonName="Send",this.buttonDisabled=!0,this.buttonError="",this.langValues={},this.currentLanguage="und"}isBaseLanguage(){return"und"==this.currentLanguage||this.currentLanguage==this.languages[0].iso}handleTabChanged(){const t=this.shadowRoot.querySelector("temba-tabs").getCurrentTab();t&&"attachment"==t.icon&&0==this.currentAttachments.length&&this.handleUploadFileIconClicked()}getEventHandlers(){return[{event:ke.ContextChanged,method:this.handleTabChanged}]}firstUpdated(t){super.firstUpdated(t),t.has("languages")&&this.languages.length>0&&(this.currentLanguage=this.languages[0].iso),t.has("value")&&(this.langValues=this.getDeserializedValue()||{}),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")){this.toggleButton();const t=this.currentText?this.currentText.trim():"";t||this.currentAttachments.length>0||this.currentQuickReplies.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}:delete this.langValues[this.currentLanguage],this.fireCustomEvent(ke.ContentChanged,this.langValues),this.requestUpdate("langValues"),this.setValue(this.langValues)}}setFocusOnChatbox(){if(this.chatbox){const t=this.shadowRoot.querySelector(".chatbox");t&&window.setTimeout((()=>{t.focus()}),0)}}reset(){this.shadowRoot.querySelector(".chatbox").value="",this.initialText="",this.currentText="",this.currentQuickReplies=[],this.currentAttachments=[],this.failedAttachments=[],this.buttonError=""}handleQuickReplyChange(t){this.requestUpdate("currentQuickReplies")}handleOptInChange(t){console.log("changed",this.currentOptin,t.target.values),this.currentOptin=t.target.values,this.requestUpdate("optIn")}handleChatboxChange(t){const e=t.target;this.currentText=e.value}handleDragEnter(t){this.highlight(t)}handleDragOver(t){this.highlight(t)}handleDragLeave(t){this.unhighlight(t)}handleDrop(t){if(this.canAcceptAttachments()){this.unhighlight(t);const e=t.dataTransfer;if(e){const t=e.files;this.uploadFiles(t)}}}preventDefaults(t){t.preventDefault(),t.stopPropagation()}highlight(t){this.canAcceptAttachments()&&(this.pendingDrop=!0,this.preventDefaults(t))}unhighlight(t){this.canAcceptAttachments()&&(this.pendingDrop=!1,this.preventDefaults(t))}handleUploadFileIconClicked(){this.dispatchEvent(new Event("change"))}handleUploadFileInputChanged(t){const e=t.target.files;this.uploadFiles(e)}canAcceptAttachments(){return this.attachments&&this.currentAttachments.length<this.maxAttachments}uploadFiles(t){let e=[];e=this.currentAttachments&&this.currentAttachments.length>0?[...t].filter((t=>{if(-1===this.currentAttachments.findIndex((e=>e.filename===t.name&&e.size===t.size)))return t})):[...t],e.map((t=>{this.uploadFile(t)}))}uploadFile(t){this.uploading=!0;const e=this.endpoint,i=new FormData;i.append("file",t),le(e,i).then((e=>{if(this.currentAttachments.length>=this.maxAttachments)this.addFailedAttachment(t,"Too many attachments");else{const t=e.json;t&&this.addCurrentAttachment(t)}})).catch((e=>{let i="";i=400===e.status?e.json.file[0]:"Server failure",console.error(i),this.addFailedAttachment(t,i)})).finally((()=>{this.uploading=!1}))}addCurrentAttachment(t){this.currentAttachments.push(t),this.requestUpdate("currentAttachments")}removeCurrentAttachment(t){this.currentAttachments=this.currentAttachments.filter((e=>e!==t)),this.requestUpdate("currentAttachments")}addFailedAttachment(t,e){const i={uuid:Math.random().toString(36).slice(2,6),content_type:t.type,filename:t.name,url:t.name,size:t.size,error:e};this.failedAttachments.push(i),this.requestUpdate("failedAttachments")}removeFailedAttachment(t){this.failedAttachments=this.failedAttachments.filter((e=>e!==t)),this.requestUpdate("failedAttachments")}handleRemoveFileClicked(t){const e=t.target,i=this.currentAttachments.find((({uuid:t})=>t===e.id));i&&this.removeCurrentAttachment(i);const n=this.failedAttachments.find((({uuid:t})=>t===e.id));n&&this.removeFailedAttachment(n)}toggleButton(){if(this.button){this.buttonError="";const t=0===this.currentText.trim().length,e=0===this.currentAttachments.length;this.chatbox&&this.attachments?this.buttonDisabled=t&&e:this.chatbox?this.buttonDisabled=t:this.attachments?this.buttonDisabled=e:this.buttonDisabled=!0}}handleSendClick(t){t.stopPropagation(),this.handleSend()}handleSendEnter(t){if(this.button&&"Enter"===t.key&&!t.shiftKey)if(this.completion){t.target.hasVisibleOptions()||(this.handleSend(),this.preventDefaults(t))}else this.handleSend(),this.preventDefaults(t)}handleSend(){if(!this.buttonDisabled){this.buttonDisabled=!0;const t=this.buttonName;this.fireCustomEvent(ke.ButtonClicked,{name:t})}}handleLanguageChange(t){const e=t.target;this.currentLanguage=e.values[0].iso}resetTabs(){this.shadowRoot.querySelector("temba-tabs").index=-1}render(){return D`
6041
6042
  <temba-field
6042
6043
  name=${this.name}
6043
6044
  .errors=${this.errors}
@@ -6118,18 +6119,18 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6118
6119
  </div>
6119
6120
  <div class="attachment-name">
6120
6121
  <span
6121
- title="${t.filename} (${ve(0,0)}) - Attachment failed - ${t.error}"
6122
+ title="${t.filename} (${ge(0,0)}) - Attachment failed - ${t.error}"
6122
6123
  >${e=t.filename,i=25,e.length>i?e.substring(0,i)+"...":e}
6123
- (${ve(0,0)}) - Attachment failed</span
6124
+ (${ge(0,0)}) - Attachment failed</span
6124
6125
  >
6125
6126
  </div>
6126
6127
  </div>`;var e,i}))}`:null}
6127
- `}getActions(){return D`
6128
+ `}getActions(){const t=this.optIns&&this.isBaseLanguage();return D`
6128
6129
  <temba-tabs
6129
6130
  embedded
6130
6131
  focusedname
6131
6132
  bottom
6132
- refresh="${this.currentAttachments.length}|${this.index}|${this.currentQuickReplies.length}"
6133
+ refresh="${this.currentAttachments.length}|${this.index}|${this.currentQuickReplies.length}|${t}|${this.currentOptin}"
6133
6134
  >
6134
6135
  ${this.attachments?D`<temba-tab
6135
6136
  name="Attachments"
@@ -6154,6 +6155,23 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6154
6155
  placeholder="Add Quick Reply"
6155
6156
  ></temba-select>
6156
6157
  </temba-tab>`:null}
6158
+ <temba-tab
6159
+ name="Opt-in"
6160
+ icon="channel_fba"
6161
+ ?hidden=${!t}
6162
+ ?checked=${this.currentOptin.length>0}
6163
+ >
6164
+ <temba-select
6165
+ @change=${this.handleOptInChange}
6166
+ .values=${this.currentOptin}
6167
+ endpoint="${this.optinEndpoint}"
6168
+ class="optins"
6169
+ searchable
6170
+ clearable
6171
+ placeholder="Select an opt-in to use for Facebook (optional)"
6172
+ ></temba-select>
6173
+ </temba-tab>
6174
+
6157
6175
  <div slot="tab-right" class="top-right">
6158
6176
  ${this.buttonError?D`<div class="send-error">${this.buttonError}</div>`:null}
6159
6177
  ${this.counter?this.getCounter():null}
@@ -6185,7 +6203,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6185
6203
  name=${this.buttonName}
6186
6204
  @click=${this.handleSendClick}
6187
6205
  ?disabled=${this.buttonDisabled}
6188
- ></temba-button>`}}t([ct({type:Number})],ah.prototype,"index",void 0),t([ct({type:Number})],ah.prototype,"maxAttachments",void 0),t([ct({type:Number})],ah.prototype,"maxLength",void 0),t([ct({type:Boolean})],ah.prototype,"completion",void 0),t([ct({type:Boolean})],ah.prototype,"chatbox",void 0),t([ct({type:Boolean})],ah.prototype,"attachments",void 0),t([ct({type:Boolean})],ah.prototype,"quickReplies",void 0),t([ct({type:Boolean})],ah.prototype,"counter",void 0),t([ct({type:Boolean})],ah.prototype,"pendingDrop",void 0),t([ct({type:Boolean})],ah.prototype,"button",void 0),t([ct({type:String})],ah.prototype,"currentText",void 0),t([ct({type:String})],ah.prototype,"initialText",void 0),t([ct({type:String})],ah.prototype,"accept",void 0),t([ct({type:String,attribute:!1})],ah.prototype,"endpoint",void 0),t([ct({type:Boolean,attribute:!1})],ah.prototype,"uploading",void 0),t([ct({type:Array})],ah.prototype,"languages",void 0),t([ct({type:Array})],ah.prototype,"currentAttachments",void 0),t([ct({type:Array})],ah.prototype,"currentQuickReplies",void 0),t([ct({type:Array,attribute:!1})],ah.prototype,"failedAttachments",void 0),t([ct({type:String})],ah.prototype,"buttonName",void 0),t([ct({type:Boolean,attribute:!1})],ah.prototype,"buttonDisabled",void 0),t([ct({type:String,attribute:!1})],ah.prototype,"buttonError",void 0),t([ct({type:Boolean,attribute:"widget_only"})],ah.prototype,"widgetOnly",void 0),t([ct({type:Array})],ah.prototype,"errors",void 0),t([ct({type:Object})],ah.prototype,"langValues",void 0),t([ct({type:String})],ah.prototype,"currentLanguage",void 0);class lh extends lt{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`
6206
+ ></temba-button>`}}t([ct({type:Number})],rh.prototype,"index",void 0),t([ct({type:Number})],rh.prototype,"maxAttachments",void 0),t([ct({type:Number})],rh.prototype,"maxLength",void 0),t([ct({type:Boolean})],rh.prototype,"completion",void 0),t([ct({type:Boolean})],rh.prototype,"chatbox",void 0),t([ct({type:Boolean})],rh.prototype,"attachments",void 0),t([ct({type:Boolean})],rh.prototype,"quickReplies",void 0),t([ct({type:Boolean})],rh.prototype,"optIns",void 0),t([ct({type:Boolean})],rh.prototype,"counter",void 0),t([ct({type:Boolean})],rh.prototype,"pendingDrop",void 0),t([ct({type:Boolean})],rh.prototype,"button",void 0),t([ct({type:String})],rh.prototype,"currentText",void 0),t([ct({type:String})],rh.prototype,"initialText",void 0),t([ct({type:String})],rh.prototype,"accept",void 0),t([ct({type:String,attribute:!1})],rh.prototype,"endpoint",void 0),t([ct({type:Boolean,attribute:!1})],rh.prototype,"uploading",void 0),t([ct({type:Array})],rh.prototype,"languages",void 0),t([ct({type:Array})],rh.prototype,"currentAttachments",void 0),t([ct({type:Array})],rh.prototype,"currentQuickReplies",void 0),t([ct({type:Array})],rh.prototype,"currentOptin",void 0),t([ct({type:String})],rh.prototype,"optinEndpoint",void 0),t([ct({type:Array,attribute:!1})],rh.prototype,"failedAttachments",void 0),t([ct({type:String})],rh.prototype,"buttonName",void 0),t([ct({type:Boolean,attribute:!1})],rh.prototype,"buttonDisabled",void 0),t([ct({type:String,attribute:!1})],rh.prototype,"buttonError",void 0),t([ct({type:Boolean,attribute:"widget_only"})],rh.prototype,"widgetOnly",void 0),t([ct({type:Array})],rh.prototype,"errors",void 0),t([ct({type:Object})],rh.prototype,"langValues",void 0),t([ct({type:String})],rh.prototype,"currentLanguage",void 0);class ah extends lt{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`
6189
6207
  :host {
6190
6208
  position: absolute;
6191
6209
  }
@@ -6225,7 +6243,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6225
6243
  ${this.show?this.ele:null}
6226
6244
  </div>
6227
6245
  </div>
6228
- `}}t([ct({type:Number})],lh.prototype,"animationTime",void 0),t([ct({type:Boolean})],lh.prototype,"show",void 0),t([ct({type:Boolean})],lh.prototype,"zoom",void 0),t([ct({type:Number})],lh.prototype,"zoomPct",void 0);class hh extends ut{constructor(){super(...arguments),this.expanded=!1,this.previewColor="#ffffff",this.labelColor="#ffffffee",this.selecting=!1,this.saturation=100,this.lightness=50,this.hex=""}static get styles(){return r`
6246
+ `}}t([ct({type:Number})],ah.prototype,"animationTime",void 0),t([ct({type:Boolean})],ah.prototype,"show",void 0),t([ct({type:Boolean})],ah.prototype,"zoom",void 0),t([ct({type:Number})],ah.prototype,"zoomPct",void 0);class lh extends ut{constructor(){super(...arguments),this.expanded=!1,this.previewColor="#ffffff",this.labelColor="#ffffffee",this.selecting=!1,this.saturation=100,this.lightness=50,this.hex=""}static get styles(){return r`
6229
6247
  :host {
6230
6248
  color: var(--color-text);
6231
6249
  display: inline-block;
@@ -6334,7 +6352,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6334
6352
  .color-picker:focus {
6335
6353
  outline: none;
6336
6354
  }
6337
- `}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=be(this.hue,this.saturation,this.lightness))}handleBlur(t){this.expanded&&(this.expanded=!1)}handleMouseOut(t){this.previewColor=this.value,this.hex=this.value}handleMouseMove(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,n=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-n/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.hex=be(this.hue,this.saturation,this.lightness)}}handlePreviewClick(t){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,n=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-n/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 D`
6355
+ `}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=ye(this.hue,this.saturation,this.lightness))}handleBlur(t){this.expanded&&(this.expanded=!1)}handleMouseOut(t){this.previewColor=this.value,this.hex=this.value}handleMouseMove(t){if(this.expanded){const e=t.target.getBoundingClientRect(),i=t.clientX-e.left,n=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-n/e.height*100,this.previewColor=`hsla(${this.hue}, ${this.saturation}%, ${this.lightness}%, 1)`,this.hex=ye(this.hue,this.saturation,this.lightness)}}handlePreviewClick(t){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,n=t.clientY-e.top;this.hue=i/e.width*360,this.lightness=100-n/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 D`
6338
6356
  <temba-field
6339
6357
  name=${this.name}
6340
6358
  .helpText=${this.helpText}
@@ -6370,7 +6388,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6370
6388
  </div>
6371
6389
  </div>
6372
6390
  </temba-field>
6373
- `}}t([ct({type:Boolean})],hh.prototype,"expanded",void 0),t([ct({type:String})],hh.prototype,"previewColor",void 0),t([ct({type:String})],hh.prototype,"labelColor",void 0),t([ct({type:Boolean})],hh.prototype,"selecting",void 0),t([ct({type:Number})],hh.prototype,"hue",void 0),t([ct({type:Number})],hh.prototype,"saturation",void 0),t([ct({type:Number})],hh.prototype,"lightness",void 0),t([ct({type:String})],hh.prototype,"hex",void 0);class ch extends lt{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(Se.Resized,{width:this.currentWidth})}render(){return D`
6391
+ `}}t([ct({type:Boolean})],lh.prototype,"expanded",void 0),t([ct({type:String})],lh.prototype,"previewColor",void 0),t([ct({type:String})],lh.prototype,"labelColor",void 0),t([ct({type:Boolean})],lh.prototype,"selecting",void 0),t([ct({type:Number})],lh.prototype,"hue",void 0),t([ct({type:Number})],lh.prototype,"saturation",void 0),t([ct({type:Number})],lh.prototype,"lightness",void 0),t([ct({type:String})],lh.prototype,"hex",void 0);class hh extends lt{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(ke.Resized,{width:this.currentWidth})}render(){return D`
6374
6392
  <div
6375
6393
  class=${ee({resizer:!0,resizing:this.resizing})}
6376
6394
  @mousedown="${this.startResize}"
@@ -6378,7 +6396,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6378
6396
  <div class=${ee({"resizer-handle":!0})}></div>
6379
6397
  </div>
6380
6398
  <slot></slot>
6381
- `}}ch.styles=r`
6399
+ `}}hh.styles=r`
6382
6400
  :host {
6383
6401
  display: block;
6384
6402
  position: relative;
@@ -6418,7 +6436,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6418
6436
  margin-right: var(--resizer-handle-size);
6419
6437
  background: red;
6420
6438
  }
6421
- `,t([ct({type:Number})],ch.prototype,"minWidth",void 0),t([ct({type:Number})],ch.prototype,"maxWidth",void 0),t([ct({type:Boolean})],ch.prototype,"resizing",void 0),t([ct({type:Number})],ch.prototype,"currentWidth",void 0);class dh extends lt{constructor(){super(...arguments),this.zoom=!0,this.zooming=!1}static get styles(){return r`
6439
+ `,t([ct({type:Number})],hh.prototype,"minWidth",void 0),t([ct({type:Number})],hh.prototype,"maxWidth",void 0),t([ct({type:Boolean})],hh.prototype,"resizing",void 0),t([ct({type:Number})],hh.prototype,"currentWidth",void 0);class ch extends lt{constructor(){super(...arguments),this.zoom=!0,this.zooming=!1}static get styles(){return r`
6422
6440
  :host {
6423
6441
  display: inline-block;
6424
6442
  }
@@ -6460,7 +6478,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6460
6478
  ${this.label}
6461
6479
  </div>
6462
6480
  </div>
6463
- `}}function uh(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([ct({type:String})],dh.prototype,"url",void 0),t([ct({type:String})],dh.prototype,"label",void 0),t([ct({type:Boolean})],dh.prototype,"zoom",void 0),t([ct({type:Boolean})],dh.prototype,"zooming",void 0),uh("temba-anchor",Ll),uh("temba-alert",bl),uh("temba-store",Gs),uh("temba-textinput",xt),uh("temba-datepicker",Kl),uh("temba-date",oh),uh("temba-completion",Ra),uh("temba-checkbox",mt),uh("temba-select",Na),uh("temba-options",Ks),uh("temba-loading",Va),uh("temba-lightbox",lh),uh("temba-button",Za),uh("temba-omnibox",Sl),uh("temba-tip",Cl),uh("temba-contact-name",Il),uh("temba-contact-name-fetch",Gl),uh("temba-contact-field",Rl),uh("temba-contact-fields",Nl),uh("temba-field-manager",Xl),uh("temba-urn",Dl),uh("temba-content-menu",ih),uh("temba-field",Fa),uh("temba-dialog",qa),uh("temba-modax",Ua),uh("temba-charcount",Qa),uh("temba-contact-history",ml),uh("temba-contact-chat",il),uh("temba-contact-details",class extends el{static get styles(){return r`
6481
+ `}}function dh(t,e){window.customElements.get(t)||window.customElements.define(t,e)}t([ct({type:String})],ch.prototype,"url",void 0),t([ct({type:String})],ch.prototype,"label",void 0),t([ct({type:Boolean})],ch.prototype,"zoom",void 0),t([ct({type:Boolean})],ch.prototype,"zooming",void 0),dh("temba-anchor",Al),dh("temba-alert",yl),dh("temba-store",Ws),dh("temba-textinput",xt),dh("temba-datepicker",Gl),dh("temba-date",nh),dh("temba-completion",Na),dh("temba-checkbox",mt),dh("temba-select",Da),dh("temba-options",Gs),dh("temba-loading",Fa),dh("temba-lightbox",ah),dh("temba-button",Ua),dh("temba-omnibox",kl),dh("temba-tip",$l),dh("temba-contact-name",Pl),dh("temba-contact-name-fetch",Wl),dh("temba-contact-field",Nl),dh("temba-contact-fields",Dl),dh("temba-field-manager",Jl),dh("temba-urn",Il),dh("temba-content-menu",eh),dh("temba-field",Za),dh("temba-dialog",Ba),dh("temba-modax",qa),dh("temba-charcount",Xa),dh("temba-contact-history",pl),dh("temba-contact-chat",el),dh("temba-contact-details",class extends tl{static get styles(){return r`
6464
6482
  .urn {
6465
6483
  display: flex;
6466
6484
  padding: 0.4em 1em 0.8em 1em;
@@ -6506,7 +6524,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6506
6524
  ${t.name}
6507
6525
  </temba-label>`))}
6508
6526
  </div>`:null}
6509
- ${this.data.urns.map((t=>{const e=t.split(":");let i=yl[e[0]];return i||(i=ge(e[0])),D`<temba-contact-field
6527
+ ${this.data.urns.map((t=>{const e=t.split(":");let i=vl[e[0]];return i||(i=fe(e[0])),D`<temba-contact-field
6510
6528
  name=${i}
6511
6529
  value=${e[1]}
6512
6530
  disabled
@@ -6514,7 +6532,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6514
6532
 
6515
6533
  <temba-contact-field
6516
6534
  name="Status"
6517
- value=${vl[this.data.status]}
6535
+ value=${gl[this.data.status]}
6518
6536
  disabled
6519
6537
  ></temba-contact-field>
6520
6538
  ${t?D`<temba-contact-field
@@ -6536,7 +6554,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6536
6554
  disabled
6537
6555
  ></temba-contact-field>
6538
6556
  </div>
6539
- `}}),uh("temba-ticket-list",gl),uh("temba-list",fl),uh("temba-sortable-list",Ql),uh("temba-run-list",Hl),uh("temba-flow-details",Wl),uh("temba-label",Pl),uh("temba-menu",Al),uh("temba-remote",rh),uh("temba-contact-search",_l),uh("temba-icon",xl),uh("temba-dropdown",Ml),uh("temba-tabs",Ol),uh("temba-tab",zl),uh("temba-contact-badges",ql),uh("temba-contact-pending",Zl),uh("temba-contact-tickets",Fl),uh("temba-slider",Vl),uh("temba-content-menu",ih),uh("temba-compose",ah),uh("temba-color-picker",hh),uh("temba-resizer",ch),uh("temba-thumbnail",dh);class ph extends et{static get styles(){return r`
6557
+ `}}),dh("temba-ticket-list",fl),dh("temba-list",ml),dh("temba-sortable-list",Xl),dh("temba-run-list",jl),dh("temba-flow-details",Hl),dh("temba-label",zl),dh("temba-menu",Tl),dh("temba-remote",sh),dh("temba-contact-search",bl),dh("temba-icon",_l),dh("temba-dropdown",Ll),dh("temba-tabs",Ml),dh("temba-tab",Ol),dh("temba-contact-badges",Bl),dh("temba-contact-pending",Ul),dh("temba-contact-tickets",Zl),dh("temba-slider",Fl),dh("temba-content-menu",eh),dh("temba-compose",rh),dh("temba-color-picker",lh),dh("temba-resizer",hh),dh("temba-thumbnail",ch);class uh extends et{static get styles(){return r`
6540
6558
  :host {
6541
6559
  line-height: normal;
6542
6560
  }
@@ -6744,7 +6762,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6744
6762
  ></temba-textinput>
6745
6763
  </div>
6746
6764
  </temba-dialog>
6747
- `}}t([ct({type:Array,attribute:!1})],ph.prototype,"path",void 0),t([ct()],ph.prototype,"endpoint",void 0),t([ct()],ph.prototype,"osmId",void 0),t([ct({type:Object})],ph.prototype,"hovered",void 0),t([ct({type:Object})],ph.prototype,"editFeature",void 0),t([ct({type:String,attribute:!1})],ph.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var mh={};!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function h(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||x("RequestAnimationFrame")||k,E=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,e,i){if(!i||S!==k)return S.call(window,s(t,e));t.call(e)}function C(t){t&&E.call(window,t)}var T=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:S,cancelFn:E,requestAnimFrame:$,cancelAnimFrame:C});function A(){}function M(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(M(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},A.include=function(t){return n(this.prototype,t),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=A.extend(O);function P(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof P?t:y(t)?new P(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new P(t.x,t.y):new P(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function q(t,e){return t instanceof B?t:new B(t,e)}function U(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 Z(t,e,i){return t instanceof U?t:y(t)&&"object"!=typeof t[0]?3===t.length?new U(t[0],t[1],t[2]):2===t.length?new U(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new U(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new U(t,e,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new P(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new P(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new P((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new P(this.min.x,this.max.y)},getTopRight:function(){return new P(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof P?D(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof U)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(Z(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new U(e.lat,e.lng),this._northEast=new U(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new U(e.lat-n,e.lng-o),new U(i.lat+n,i.lng+o))},getCenter:function(){return new U((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 U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(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 U||"lat"in t?Z(t):q(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(t,e){return!!t&&(t=Z(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,Z(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 U(this.lat,this.lng,this.alt)}};var F={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new U(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new B(new U(s.lat-n,s.lng-o),new U(r.lat-n,r.lng-o))}},V=n({},F,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),j=6378137,H={R:j,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new P(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new U((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=j*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function G(t,e,i,n){return new W(t,e,i,n)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new P((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,s,r,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,s=(r=t[i]).length;n<s;n++)l+=(n?"L":"M")+(a=r[n]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Mt("webkit"),ot=Mt("android"),st=Mt("android 2")||Mt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&Mt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Mt("chrome"),ct=Mt("gecko")&&!nt&&!lt&&!tt,dt=!ht&&Mt("safari"),ut=Mt("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!ut,bt="undefined"!=typeof orientation||Mt("mobile"),_t=bt&&nt,xt=bt&&gt,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),St=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Et=bt&&lt,$t=bt&&ct,Ct=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Tt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!J("svg").createSVGRect),Lt=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ot=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:St,mobileOpera:Et,mobileGecko:$t,retina:Ct,canvas:Tt,svg:At,vml:Lt}),zt=wt?"MSPointerDown":"pointerdown",Pt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,qt=0;function Ut(t,e,i,n){return"touchstart"===e?Ft(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Kt(t,i,n),this}function Zt(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,n,!1):"touchmove"===e?t.removeEventListener(Pt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(Dt,n,!1)),this}function Ft(t,e,i){var n=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Fe(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(zt,n,!1),Bt||(document.documentElement.addEventListener(zt,Vt,!0),document.documentElement.addEventListener(Pt,jt,!0),document.documentElement.addEventListener(It,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Bt=!0)}function Vt(t){Rt[t.pointerId]=t,qt++}function jt(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Pt,n,!1)}function Kt(t,e,i){var n=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(Dt,n,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function l(t){if(s&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Yt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Yt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function de(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var s=_e(t);be(t,(s?s+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new P(0,0);t.style[re]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ee(t,e){t._leaflet_pos=e,yt?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function $e(t){return t._leaflet_pos||new P(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Fe)},ie=function(){Ne(window,"selectstart",Fe)};else{var Ce=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Ce){var t=document.documentElement.style;ne=t[Ce],t[Ce]="none"}},ie=function(){Ce&&(document.documentElement.style[Ce]=ne,ne=void 0)}}function Te(){Ie(window,"dragstart",Fe)}function Ae(){Ne(window,"dragstart",Fe)}function Le(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Me(),oe=t,se=t.style.outline,t.style.outline="none",Ie(window,"keydown",Me))}function Me(){oe&&(oe.style.outline=se,oe=void 0,se=void 0,Ne(window,"keydown",Me))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Pe=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Se,setPosition:Ee,getPosition:$e,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Te,enableImageDrag:Ae,preventOutline:Le,restoreOutline:Me,getSizedParentNode:Oe,getScale:ze});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,n);return this}var De="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,n);else{for(var a in t[De])Be(t,a,t[De][a]);delete t[De]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[De]&&t[De][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ut(t,e,s,o):!St||"dblclick"!==e||!Qt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Xe(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&ot&&(s=function(t){Qe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Qt(t,s,o),t[De]=t[De]||{},t[De][o]=s}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[De]&&t[De][o];if(!s)return this;kt&&0===e.indexOf("touch")?Zt(t,e,o):!St||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,o),t[De][o]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function Ue(t){return Re(t,"mousewheel",qe),this}function Ze(t){return Ie(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function Fe(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return Fe(t),qe(t),this}function je(t,e){if(!e)return new P(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new P((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ge,Ke={};function Ye(t){Ke[t.type]=!0}function Je(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ge&&i-Ge;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?Ve(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:qe,disableScrollPropagation:Ue,disableClickPropagation:Ze,preventDefault:Fe,stop:Ve,getMousePosition:je,getWheelDelta:We,fakeStop:Ye,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=$e(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=$(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(),Ee(this._el,i),this.fire("step")},_complete:function(){C(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(Z(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!Et&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(Z(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=(t instanceof P?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=Z(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=o.distanceTo(n)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=u(0);function v(t){return a*(m(g)/m(g+c*t))}function y(t){return a*(m(g)*f(g+c*t)-p(g))/d}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-g)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=b(i)*x;i<=1?(this._flyToFrame=$(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-n.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-n.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new U(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(r,n)).getSize(),c=yt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(Z(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(Z(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(Z(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(Z(t),Z(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(t)))},mouseEventToContainerPoint:function(t){return je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(St?" leaflet-touch":"")+(Ct?" 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),Ee(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ee(this._mapPane,new P(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ee(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=$((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Xe(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Le(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Fe(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return $e(this._mapPane)||new P(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new N(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new P(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||($((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),$((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),si=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=de("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=de("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Ze(e),Ue(e);var n=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=de("a",t+"-toggle",e);o.href="#",o.title="Layers",St?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",n),this._separator=de("div",t+"-separator",n),this._overlaysList=de("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=de("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ze(s),Ie(s,"click",Ve),Ie(s,"click",o,this),Ie(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=de("div",e,i)),t.imperial&&(this._iScale=de("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Ze(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=li,oi.Scale=ci,oi.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:O},vi=St?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Le(this._element),Te(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new P(e.clientX,e.clientY),this._parentScale=ze(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new P(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Fe(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=$e(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,C(this._animRequest),this._lastEvent=t,this._animRequest=$(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ee(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);Ae(),ie(),this._moved&&this._moving&&(C(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Si(t=$i(t,i),i)}function wi(t,e,i){return Math.sqrt(Mi(t,e,i,!0))}function ki(t,e,i){return Mi(t,e,i)}function Si(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ei(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}function Ei(t,e,i,n,o){var s,r,a,l=0;for(r=n+1;r<=o-1;r++)(a=Mi(t[r],t[n],t[o],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ei(t,e,i,n,s),Ei(t,e,i,s,o))}function $i(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)Li(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}function Ci(t,e,i,n,o){var s,r,a,l=n?fi:Ai(t,i),h=Ai(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Ai(r=Ti(t,e,s=l||h,i,o),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ti(t,e,i,n,o){var s,r,a=e.x-t.x,l=e.y-t.y,h=n.min,c=n.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new P(s,r,o)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Li(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Mi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((o=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new P(s,r)}function Oi(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var Pi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ci,_getEdgeIntersection:Ti,_getBitCode:Ai,_sqClosestPointOnSegment:Mi,isFlat:Oi,_flat:zi});function Ii(t,e,i){var n,o,s,r,a,l,h,c,d,u=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Ai(t[o],e);for(r=0;r<4;r++){for(c=u[r],n=[],o=0,s=(h=t.length)-1;o<h;s=o++)a=t[o],l=t[s],a._code&c?l._code&c||((d=Ti(l,a,c,e,i))._code=Ai(d,e),n.push(d)):(l._code&c&&((d=Ti(l,a,c,e,i))._code=Ai(d,e),n.push(d)),n.push(a));t=n}return t}var Di=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new P(t.lng,t.lat)},unproject:function(t){return new U(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new U(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:H}),qi=n({},V,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return G(t,.5,-t,.5)}()}),Ui=n({},V,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Zi=n({},F,{projection:Ni,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});F.Earth=V,F.EPSG3395=qi,F.EPSG3857=K,F.EPSG900913=Y,F.EPSG4326=Ui,F.Simple=Zi;var Fi=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Vi=Fi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),ji=function(t,e){return new Vi(t,e)},Hi=Vi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Vi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=D(n),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Ct&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ki(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=$e(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ee(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(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&&(C(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=$e(e._icon),o=e._map.layerPointToLatLng(n);i&&Ee(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){C(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Fi.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=Z(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=Z(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ee(this._icon,t),this._shadow&&Ee(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Fi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=Z(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=Z(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=Z(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,s=this._mRadius/V.R/o,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function sn(t,e,i){return new on(t,e,i)}var rn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,s=Mi,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<n&&(n=d,o=s(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],s=a[t+1],(n+=i=o.distanceTo(s))>e)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=Z(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),n=0,o=t.length;n<o;n++)i?(e[n]=Z(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new P(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof U,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,s,r,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ci(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new rn(t,e)}rn._flat=zi;var ln=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],n=h[e],o=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*o,a+=(i.y+n.y)*o,s+=3*o;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof U&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new P(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(l=(e=this._parts[o]).length)-1;s<l;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function hn(t,e){return new ln(t,e)}var cn=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=dn(t,s);return r?(r.feature=vn(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function dn(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||un;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Xi(i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=c(a[o]),l.push(h?h(t,i):new Xi(i));return new Hi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===r.type?0:1,c),new rn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===r.type?1:2,c),new ln(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var d=dn({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function un(t){return new U(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?pn(t[s],e-1,i):(i||un)(t[s]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function fn(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?fn(t[s],e-1,i,n):mn(t[s],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new cn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),rn.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=vn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Fi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ee(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Sn(t,e,i){return new kn(t,e,i)}var En=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function $n(t,e,i){return new En(t,e,i)}var Cn=Fi.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=Z(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Fi||(i=e,e=t),e instanceof Hi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ee(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),Tn=Cn.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){Cn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",qe))},onRemove:function(t){Cn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",qe))},getEvents:function(){var t=Cn.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),Ze(i),Ue(this._contentNode),Ie(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=de("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,s)):ye(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ee(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add($e(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+n+l.x>h.x&&(c=s.x+n-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new Tn(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof Tn||(t=new Tn(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}}),Fi.include({bindPopup:function(t,e){return t instanceof Tn?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Tn(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ln=Cn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Cn.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){Cn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Cn.prototype.getEvents.call(this);return St&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ee(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Mn=function(t,e){return new Ln(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Ln||(t=new Ln(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Fi.include({bindTooltip:function(t,e){return t instanceof Ln?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ln(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),St&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var On=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zn(t){return new On(t)}Gi.Default=Yi;var Pn=Fi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof P?t:new P(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);xe(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(C(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new P(+o,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new P(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Se(t.el,o,n):Ee(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*n);return new N(o.subtract(s),o.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new P(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new P(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&$(s(this._tileReady,this,t,null,o)),Ee(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),C(this._fadeFrame),this._fadeFrame=$(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?$(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new P(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new Pn(t)}var Dn=Pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Ct&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",s(this._tileOnLoad,this,e,i)),Ie(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Ct?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Pn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Pn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new Dn(t,e)}var Rn=Dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var s=(e=m(this,e)).detectRetina&&Ct?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Ui?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Dn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}Dn.WMS=Rn,Nn.wms=Bn;var qn=Fi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=$e(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=o.multiplyBy(-i).add(n).add(o).subtract(r);yt?Se(this._container,a,i):Ee(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()}}),Un=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,ue(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Ct?2:1;Ee(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Ct&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],l[n?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Zn(t){return Tt?new Un(t):null}var Fn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Vn={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Fn("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Fn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Fn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Fn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},jn=Lt?Fn:J,Hn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ee(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=jn("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Wn(t){return At||Lt?new Hn(t):null}Lt&&Hn.include(Vn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Zn(t)||Wn(t)}});var Gn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Gn(t,e)}Hn.create=jn,Hn.pointsToPath=X,cn.geometryToLayer=dn,cn.coordsToLatLng=un,cn.coordsToLatLngs=pn,cn.latLngToCoords=mn,cn.latLngsToCoords=fn,cn.getFeature=gn,cn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Yn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ee(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ie(),Ae(),Ne(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Yn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=o.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),$((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Fe(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new P(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new P(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});St&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:St&&!st,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Fe(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=$(a,this,!0),Fe(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Yn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=si,t.Browser=Ot,t.Evented=z,t.Mixin=gi,t.Util=T,t.Class=A,t.Handler=mi,t.extend=n,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Pe,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Pi,t.PolyUtil=Di,t.Point=P,t.point=D,t.Bounds=N,t.bounds=R,t.Transformation=W,t.transformation=G,t.Projection=Bi,t.LatLng=U,t.latLng=Z,t.LatLngBounds=B,t.latLngBounds=q,t.CRS=F,t.GeoJSON=cn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Fi,t.LayerGroup=Vi,t.layerGroup=ji,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Sn,t.SVGOverlay=En,t.svgOverlay=$n,t.DivOverlay=Cn,t.Popup=Tn,t.popup=An,t.Tooltip=Ln,t.tooltip=Mn,t.Icon=Gi,t.icon=Ki,t.DivIcon=On,t.divIcon=zn,t.Marker=Xi,t.marker=Qi,t.TileLayer=Dn,t.tileLayer=Nn,t.GridLayer=Pn,t.gridLayer=In,t.SVG=Hn,t.svg=Wn,t.Renderer=qn,t.Canvas=Un,t.canvas=Zn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=sn,t.Polyline=rn,t.polyline=an,t.Polygon=ln,t.polygon=hn,t.Rectangle=Gn,t.rectangle=Kn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(mh);const fh={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},gh={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},vh=()=>fh;class yh extends et{static get styles(){return r`
6765
+ `}}t([ct({type:Array,attribute:!1})],uh.prototype,"path",void 0),t([ct()],uh.prototype,"endpoint",void 0),t([ct()],uh.prototype,"osmId",void 0),t([ct({type:Object})],uh.prototype,"hovered",void 0),t([ct({type:Object})],uh.prototype,"editFeature",void 0),t([ct({type:String,attribute:!1})],uh.prototype,"editFeatureAliases",void 0);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ph={};!function(t){var e="1.5.1+build.2e3e0ffb",i=Object.freeze;function n(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}Object.freeze=function(t){return t};var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function s(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function a(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function l(t,e,i){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(i,o),o=!1)},s=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(r,e),n=!0)},s}function h(t,e,i){var n=e[1],o=e[0],s=n-o;return t===n&&i?t:((t-o)%s+s)%s+o}function c(){return!1}function d(t,e){return e=void 0===e?6:e,+(Math.round(t+"e+"+e)+"e-"+e)}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function m(t,e){for(var i in t.hasOwnProperty("options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var g=/\{ *([\w_-]+) *\}/g;function v(t,e){return t.replace(g,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function b(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function k(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var S=window.requestAnimationFrame||x("RequestAnimationFrame")||k,E=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,e,i){if(!i||S!==k)return S.call(window,s(t,e));t.call(e)}function C(t){t&&E.call(window,t)}var T=(Object.freeze||Object)({freeze:i,extend:n,create:o,bind:s,lastId:r,stamp:a,throttle:l,wrapNum:h,falseFn:c,formatNum:d,trim:u,splitWords:p,setOptions:m,getParamString:f,template:v,isArray:y,indexOf:b,emptyImageUrl:_,requestFn:S,cancelFn:E,requestAnimFrame:$,cancelAnimFrame:C});function A(){}function M(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=e.__super__=this.prototype,s=o(i);for(var r in s.constructor=e,e.prototype=s,this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(n(e,t.statics),delete t.statics),t.includes&&(M(t.includes),n.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=n(o(s.options),t.options)),n(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},A.include=function(t){return n(this.prototype,t),this},A.mergeOptions=function(t){return n(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,s=(t=p(t)).length;o<s;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(n=[],this._events[t]=n),i===this&&(i=void 0);for(var o={fn:e,ctx:i},s=n,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(o)},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,s=n.length;o<s;o++){var r=n[o];if(r.ctx===i&&r.fn===e)return r.fn=c,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,s=n.length;o<s;o++)n[o].fn=c;delete this._events[t]}},fire:function(t,e,i){if(!this.listens(t,i))return this;var o=n({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var l=s[r];l.fn.call(l.ctx||this,o)}this._firingCount--}}return i&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var o=s((function(){this.off(t,e,i).off(t,o,i)}),this);return this.on(t,e,i).on(t,o,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[a(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[a(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,n({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=A.extend(O);function P(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function D(t,e,i){return t instanceof P?t:y(t)?new P(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new P(t.x,t.y):new P(t,e,i)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof N?t:new N(t,e)}function B(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function q(t,e){return t instanceof B?t:new B(t,e)}function U(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 Z(t,e,i){return t instanceof U?t:y(t)&&"object"!=typeof t[0]?3===t.length?new U(t[0],t[1],t[2]):2===t.length?new U(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new U(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new U(t,e,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(t){return this.clone()._add(D(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(D(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new P(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new P(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=D(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=D(t)).x===this.x&&t.y===this.y},contains:function(t){return t=D(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+d(this.x)+", "+d(this.y)+")"}},N.prototype={extend:function(t){return t=D(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new P((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new P(this.min.x,this.max.y)},getTopRight:function(){return new P(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof P?D(t):R(t))instanceof N?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.x<i.x,r=o.y>e.y&&n.y<i.y;return s&&r},isValid:function(){return!(!this.min||!this.max)}},B.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof U)e=t,i=t;else{if(!(t instanceof B))return t?this.extend(Z(t)||q(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new U(e.lat,e.lng),this._northEast=new U(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new B(new U(e.lat-n,e.lng-o),new U(i.lat+n,i.lng+o))},getCenter:function(){return new U((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 U(this.getNorth(),this.getWest())},getSouthEast:function(){return new U(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 U||"lat"in t?Z(t):q(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof B?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=q(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.lat<i.lat,r=o.lng>e.lng&&n.lng<i.lng;return s&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=q(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},U.prototype={equals:function(t,e){return!!t&&(t=Z(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,Z(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 U(this.lat,this.lng,this.alt)}};var F={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new N(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new U(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new B(new U(s.lat-n,s.lng-o),new U(r.lat-n,r.lng-o))}},V=n({},F,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(n)*Math.cos(o)*r*r,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),j=6378137,H={R:j,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new P(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new U((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=j*Math.PI;return new N([-t,-t],[t,t])}()};function W(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function G(t,e,i,n){return new W(t,e,i,n)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new P((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=n({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return G(t,.5,-t,.5)}()}),Y=n({},K,{code:"EPSG:900913"});function J(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,s,r,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,s=(r=t[i]).length;n<s;n++)l+=(n?"L":"M")+(a=r[n]).x+" "+a.y;l+=e?At?"z":"x":""}return l||"M0 0"}var Q=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=Mt("webkit"),ot=Mt("android"),st=Mt("android 2")||Mt("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&Mt("Google")&&rt<537&&!("AudioNode"in window),lt=!!window.opera,ht=Mt("chrome"),ct=Mt("gecko")&&!nt&&!lt&&!tt,dt=!ht&&Mt("safari"),ut=Mt("phantom"),pt="OTransition"in Q,mt=0===navigator.platform.indexOf("Win"),ft=tt&&"transition"in Q,gt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,vt="MozPerspective"in Q,yt=!window.L_DISABLE_3D&&(ft||gt||vt)&&!pt&&!ut,bt="undefined"!=typeof orientation||Mt("mobile"),_t=bt&&nt,xt=bt&&gt,wt=!window.PointerEvent&&window.MSPointerEvent,kt=!(!window.PointerEvent&&!wt),St=!window.L_NO_TOUCH&&(kt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Et=bt&&lt,$t=bt&&ct,Ct=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Tt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!J("svg").createSVGRect),Lt=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function Mt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Ot=(Object.freeze||Object)({ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:st,androidStock:at,opera:lt,chrome:ht,gecko:ct,safari:dt,phantom:ut,opera12:pt,win:mt,ie3d:ft,webkit3d:gt,gecko3d:vt,any3d:yt,mobile:bt,mobileWebkit:_t,mobileWebkit3d:xt,msPointer:wt,pointer:kt,touch:St,mobileOpera:Et,mobileGecko:$t,retina:Ct,canvas:Tt,svg:At,vml:Lt}),zt=wt?"MSPointerDown":"pointerdown",Pt=wt?"MSPointerMove":"pointermove",It=wt?"MSPointerUp":"pointerup",Dt=wt?"MSPointerCancel":"pointercancel",Nt=["INPUT","SELECT","OPTION"],Rt={},Bt=!1,qt=0;function Ut(t,e,i,n){return"touchstart"===e?Ft(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Kt(t,i,n),this}function Zt(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(zt,n,!1):"touchmove"===e?t.removeEventListener(Pt,n,!1):"touchend"===e&&(t.removeEventListener(It,n,!1),t.removeEventListener(Dt,n,!1)),this}function Ft(t,e,i){var n=s((function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(Nt.indexOf(t.target.tagName)<0))return;Fe(t)}Wt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(zt,n,!1),Bt||(document.documentElement.addEventListener(zt,Vt,!0),document.documentElement.addEventListener(Pt,jt,!0),document.documentElement.addEventListener(It,Ht,!0),document.documentElement.addEventListener(Dt,Ht,!0),Bt=!0)}function Vt(t){Rt[t.pointerId]=t,qt++}function jt(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Ht(t){delete Rt[t.pointerId],qt--}function Wt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&Wt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Pt,n,!1)}function Kt(t,e,i){var n=function(t){Wt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(It,n,!1),t.addEventListener(Dt,n,!1)}var Yt=wt?"MSPointerDown":kt?"pointerdown":"touchstart",Jt=wt?"MSPointerUp":kt?"pointerup":"touchend",Xt="_leaflet_";function Qt(t,e,i){var n,o,s=!1,r=250;function a(t){var e;if(kt){if(!it||"mouse"===t.pointerType)return;e=qt}else e=t.touches.length;if(!(e>1)){var i=Date.now(),a=i-(n||i);o=t.touches?t.touches[0]:t,s=a>0&&a<=r,n=i}}function l(t){if(s&&!o.cancelBubble){if(kt){if(!it||"mouse"===t.pointerType)return;var i,r,a={};for(r in o)i=o[r],a[r]=i&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Xt+Yt+i]=a,t[Xt+Jt+i]=l,t[Xt+"dblclick"+i]=e,t.addEventListener(Yt,a,!1),t.addEventListener(Jt,l,!1),t.addEventListener("dblclick",e,!1),this}function te(t,e){var i=t[Xt+Yt+e],n=t[Xt+Jt+e],o=t[Xt+"dblclick"+e];return t.removeEventListener(Yt,i,!1),t.removeEventListener(Jt,n,!1),it||t.removeEventListener("dblclick",o,!1),this}var ee,ie,ne,oe,se,re=ke(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ae=ke(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),le="webkitTransition"===ae||"OTransition"===ae?ae+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function ce(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function de(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function me(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ge(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function ve(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!ge(t,e)){var s=_e(t);be(t,(s?s+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):be(t,u((" "+_e(t)+" ").replace(" "+e+" "," ")))}function be(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function _e(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function xe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function ke(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Se(t,e,i){var n=e||new P(0,0);t.style[re]=(ft?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ee(t,e){t._leaflet_pos=e,yt?Se(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function $e(t){return t._leaflet_pos||new P(0,0)}if("onselectstart"in document)ee=function(){Ie(window,"selectstart",Fe)},ie=function(){Ne(window,"selectstart",Fe)};else{var Ce=ke(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ee=function(){if(Ce){var t=document.documentElement.style;ne=t[Ce],t[Ce]="none"}},ie=function(){Ce&&(document.documentElement.style[Ce]=ne,ne=void 0)}}function Te(){Ie(window,"dragstart",Fe)}function Ae(){Ne(window,"dragstart",Fe)}function Le(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Me(),oe=t,se=t.style.outline,t.style.outline="none",Ie(window,"keydown",Me))}function Me(){oe&&(oe.style.outline=se,oe=void 0,se=void 0,Ne(window,"keydown",Me))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Pe=(Object.freeze||Object)({TRANSFORM:re,TRANSITION:ae,TRANSITION_END:le,get:he,getStyle:ce,create:de,remove:ue,empty:pe,toFront:me,toBack:fe,hasClass:ge,addClass:ve,removeClass:ye,setClass:be,getClass:_e,setOpacity:xe,testProp:ke,setTransform:Se,setPosition:Ee,getPosition:$e,disableTextSelection:ee,enableTextSelection:ie,disableImageDrag:Te,enableImageDrag:Ae,preventOutline:Le,restoreOutline:Me,getSizedParentNode:Oe,getScale:ze});function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)Re(t,o,e[o],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)Re(t,e[s],i,n);return this}var De="_leaflet_events";function Ne(t,e,i,n){if("object"==typeof e)for(var o in e)Be(t,o,e[o],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)Be(t,e[s],i,n);else{for(var a in t[De])Be(t,a,t[De][a]);delete t[De]}return this}function Re(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):"");if(t[De]&&t[De][o])return this;var s=function(e){return i.call(n||t,e||window.event)},r=s;kt&&0===e.indexOf("touch")?Ut(t,e,s,o):!St||"dblclick"!==e||!Qt||kt&&ht?"addEventListener"in t?"mousewheel"===e?t.addEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):"mouseenter"===e||"mouseleave"===e?(s=function(e){e=e||window.event,Xe(t,e)&&r(e)},t.addEventListener("mouseenter"===e?"mouseover":"mouseout",s,!1)):("click"===e&&ot&&(s=function(t){Qe(t,r)}),t.addEventListener(e,s,!1)):"attachEvent"in t&&t.attachEvent("on"+e,s):Qt(t,s,o),t[De]=t[De]||{},t[De][o]=s}function Be(t,e,i,n){var o=e+a(i)+(n?"_"+a(n):""),s=t[De]&&t[De][o];if(!s)return this;kt&&0===e.indexOf("touch")?Zt(t,e,o):!St||"dblclick"!==e||!te||kt&&ht?"removeEventListener"in t?"mousewheel"===e?t.removeEventListener("onwheel"in t?"wheel":"mousewheel",s,!1):t.removeEventListener("mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s):te(t,o),t[De][o]=null}function qe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Je(t),this}function Ue(t){return Re(t,"mousewheel",qe),this}function Ze(t){return Ie(t,"mousedown touchstart dblclick",qe),Re(t,"click",Ye),this}function Fe(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return Fe(t),qe(t),this}function je(t,e){if(!e)return new P(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new P((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var He=mt&&ht?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function We(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/He:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ge,Ke={};function Ye(t){Ke[t.type]=!0}function Je(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}function Qe(t,e){var i=t.timeStamp||t.originalEvent&&t.originalEvent.timeStamp,n=Ge&&i-Ge;n&&n>100&&n<500||t.target._simulatedClick&&!t._simulated?Ve(t):(Ge=i,e(t))}var ti=(Object.freeze||Object)({on:Ie,off:Ne,stopPropagation:qe,disableScrollPropagation:Ue,disableClickPropagation:Ze,preventDefault:Fe,stop:Ve,getMousePosition:je,getWheelDelta:We,fakeStop:Ye,skipped:Je,isExternalTarget:Xe,addListener:Ie,removeListener:Ne}),ei=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=$e(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=$(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(),Ee(this._el,i),this.fire("step")},_complete:function(){C(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ii=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=s(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(Z(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ae&&yt&&!Et&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,le,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(Z(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=n({animate:i.animate},i.zoom),i.pan=n({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(yt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),s=(t instanceof P?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),r=this.containerPointToLatLng(o.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():q(t);var i=D(e.paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var s=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(r.add(a).divideBy(2).add(s),o),zoom:o}},fitBounds:function(t,e){if(!(t=q(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=D(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ei,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ve(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),s=this.getSize(),r=this._zoom;t=Z(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),l=a*this.getZoomScale(r,e),h=o.distanceTo(n)||1,c=1.42,d=c*c;function u(t){var e=(l*l-a*a+(t?-1:1)*d*d*h*h)/(2*(t?l:a)*d*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function p(t){return(Math.exp(t)-Math.exp(-t))/2}function m(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return p(t)/m(t)}var g=u(0);function v(t){return a*(m(g)/m(g+c*t))}function y(t){return a*(m(g)*f(g+c*t)-p(g))/d}function b(t){return 1-Math.pow(1-t,1.5)}var _=Date.now(),x=(u(1)-g)/c,w=i.duration?1e3*i.duration:1e3*x*.8;function k(){var i=(Date.now()-_)/w,s=b(i)*x;i<=1?(this._flyToFrame=$(k,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(y(s)/h)),r),this.getScaleZoom(a/v(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),k.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=q(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,q(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=D((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=D(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),s=this.project(o),r=this.project(t),a=this.getPixelBounds(),l=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),d=D(r.x+c.x,r.y+c.y);(r.x<h.min.x||r.x>h.max.x)&&(d.x=s.x-c.x,c.x>0?d.x+=l.x-i.x:d.x-=l.x-n.x),(r.y<h.min.y||r.y>h.max.y)&&(d.y=s.y-c.y,c.y>0?d.y+=l.y-i.y:d.y-=l.y-n.y),this.panTo(this.unproject(d),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=n({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=e.divideBy(2).round(),r=i.divideBy(2).round(),a=o.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=n({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=s(this._handleGeolocationResponse,this),i=s(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new U(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(C(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=de("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=q(t),i=D(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(r,n)).getSize(),c=yt?this.options.zoomSnap:1,d=l.x/h.x,u=l.y/h.y,p=e?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(Z(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(D(t),e)},layerPointToLatLng:function(t){var e=D(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(Z(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(Z(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(q(t))},distance:function(t,e){return this.options.crs.distance(Z(t),Z(e))},containerPointToLayerPoint:function(t){return D(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return D(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(D(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(t)))},mouseEventToContainerPoint:function(t){return je(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=a(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,ve(t,"leaflet-container"+(St?" leaflet-touch":"")+(Ct?" 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),Ee(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ve(t.markerPane,"leaflet-zoom-hide"),ve(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Ee(this._mapPane,new P(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return C(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ee(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[a(this._container)]=this;var e=t?Ne:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){C(this._resizeRequest),this._resizeRequest=$((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[a(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Xe(s,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Je(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Le(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if("click"===t.type){var o=n({},t);o.type="preclick",this._fireDOMEvent(o,o.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e))).length){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&Fe(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var l=0;l<i.length;l++)if(i[l].fire(e,r,!0),r.originalEvent._stopped||!1===i[l].options.bubblingMouseEvents&&-1!==b(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return $e(this._mapPane)||new P(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),s=new N(n.subtract(o),n.add(o)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new N(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),s=n.max.subtract(t.max);return new P(this._rebound(o.x,-s.x),this._rebound(o.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=yt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=de("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Se(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",(function(){var t=this.getCenter(),e=this.getZoom();Se(this._proxy,this.project(t,e),this.getZoomScale(e,1))}),this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),delete this._proxy},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||($((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ve(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),$((function(){this._moveEnd(!0)}),this))}});function ni(t,e){return new ii(t,e)}var oi=A.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return ve(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),si=function(t){return new oi(t)};ii.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=de("div",e+"control-container",this._container);function n(n,o){var s=e+n+" "+e+o;t[n+o]=de("div",s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(a(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ve(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ve(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=de("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Ze(e),Ue(e);var n=this._section=de("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=de("a",t+"-toggle",e);o.href="#",o.title="Layers",St?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=de("div",t+"-base",n),this._separator=de("div",t+"-separator",n),this._overlaysList=de("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&a(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(s((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(a(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+a(this),n),this._layerControlInputs.push(e),e.layerId=a(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ai=function(t,e,i){return new ri(t,e,i)},li=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=de("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=de("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),Ze(s),Ie(s,"click",Ve),Ie(s,"click",o,this),Ie(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ve(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ve(this._zoomInButton,e)}});ii.mergeOptions({zoomControl:!0}),ii.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new li,this.addControl(this.zoomControl))}));var hi=function(t){return new li(t)},ci=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=de("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=de("div",e,i)),t.imperial&&(this._iScale=de("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),di=function(t){return new ci(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=de("div","leaflet-control-attribution"),Ze(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ii.mergeOptions({attributionControl:!0}),ii.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=ri,oi.Zoom=li,oi.Scale=ci,oi.Attribution=ui,si.layers=ai,si.zoom=hi,si.scale=di,si.attribution=pi;var mi=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mi.addTo=function(t,e){return t.addHandler(e,this),this};var fi,gi={Events:O},vi=St?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},bi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},_i=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,vi,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(_i._dragging===this&&this.finishDrag(),Ne(this._dragStartTarget,vi,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim")&&!(_i._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(_i._dragging=this,this._preventOutline&&Le(this._element),Te(),ee(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new P(e.clientX,e.clientY),this._parentScale=ze(i),Ie(document,bi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new P(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Fe(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=$e(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,C(this._animRequest),this._lastEvent=t,this._animRequest=$(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ee(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi)Ne(document,bi[t],this._onMove,this),Ne(document,yi[t],this._onUp,this);Ae(),ie(),this._moved&&this._moving&&(C(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,_i._dragging=!1}});function xi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Si(t=$i(t,i),i)}function wi(t,e,i){return Math.sqrt(Mi(t,e,i,!0))}function ki(t,e,i){return Mi(t,e,i)}function Si(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ei(t,n,e,0,i-1);var o,s=[];for(o=0;o<i;o++)n[o]&&s.push(t[o]);return s}function Ei(t,e,i,n,o){var s,r,a,l=0;for(r=n+1;r<=o-1;r++)(a=Mi(t[r],t[n],t[o],!0))>l&&(s=r,l=a);l>i&&(e[s]=1,Ei(t,e,i,n,s),Ei(t,e,i,s,o))}function $i(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)Li(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<s-1&&i.push(t[s-1]),i}function Ci(t,e,i,n,o){var s,r,a,l=n?fi:Ai(t,i),h=Ai(e,i);for(fi=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Ai(r=Ti(t,e,s=l||h,i,o),i),s===l?(t=r,l=a):(e=r,h=a)}}function Ti(t,e,i,n,o){var s,r,a=e.x-t.x,l=e.y-t.y,h=n.min,c=n.max;return 8&i?(s=t.x+a*(c.y-t.y)/l,r=c.y):4&i?(s=t.x+a*(h.y-t.y)/l,r=h.y):2&i?(s=c.x,r=t.y+l*(c.x-t.x)/a):1&i&&(s=h.x,r=t.y+l*(h.x-t.x)/a),new P(s,r,o)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Li(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Mi(t,e,i,n){var o,s=e.x,r=e.y,a=i.x-s,l=i.y-r,h=a*a+l*l;return h>0&&((o=((t.x-s)*a+(t.y-r)*l)/h)>1?(s=i.x,r=i.y):o>0&&(s+=a*o,r+=l*o)),a=t.x-s,l=t.y-r,n?a*a+l*l:new P(s,r)}function Oi(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var Pi=(Object.freeze||Object)({simplify:xi,pointToSegmentDistance:wi,closestPointOnSegment:ki,clipSegment:Ci,_getEdgeIntersection:Ti,_getBitCode:Ai,_sqClosestPointOnSegment:Mi,isFlat:Oi,_flat:zi});function Ii(t,e,i){var n,o,s,r,a,l,h,c,d,u=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Ai(t[o],e);for(r=0;r<4;r++){for(c=u[r],n=[],o=0,s=(h=t.length)-1;o<h;s=o++)a=t[o],l=t[s],a._code&c?l._code&c||((d=Ti(l,a,c,e,i))._code=Ai(d,e),n.push(d)):(l._code&c&&((d=Ti(l,a,c,e,i))._code=Ai(d,e),n.push(d)),n.push(a));t=n}return t}var Di=(Object.freeze||Object)({clipPolygon:Ii}),Ni={project:function(t){return new P(t.lng,t.lat)},unproject:function(t){return new U(t.y,t.x)},bounds:new N([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=h=Math.PI/2-2*Math.atan(r*e)-a;return new U(a*i,t.x*i/n)}},Bi=(Object.freeze||Object)({LonLat:Ni,Mercator:Ri,SphericalMercator:H}),qi=n({},V,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return G(t,.5,-t,.5)}()}),Ui=n({},V,{code:"EPSG:4326",projection:Ni,transformation:G(1/180,1,-1/180,.5)}),Zi=n({},F,{projection:Ni,transformation:G(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});F.Earth=V,F.EPSG3395=qi,F.EPSG3857=K,F.EPSG900913=Y,F.EPSG4326=Ui,F.Simple=Zi;var Fi=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[a(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[a(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ii.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=a(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=a(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&a(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[a(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=a(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Vi=Fi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return a(t)}}),ji=function(t,e){return new Vi(t,e)},Hi=Vi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Vi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Vi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new B;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Wi=function(t){return new Hi(t)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=D(n),s=D("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Ct&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ki(t){return new Gi(t)}var Yi=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Yi.imagePath||(Yi.imagePath=this._detectIconPath()),(this.options.imagePath||Yi.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=de("div","leaflet-default-icon-path",document.body),e=ce(t,"background-image")||ce(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Ji=mi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new _i(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ve(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=$e(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));if(!l.contains(s)){var h=D((Math.max(l.max.x,s.x)-l.max.x)/(r.max.x-l.max.x)-(Math.min(l.min.x,s.x)-l.min.x)/(r.min.x-l.min.x),(Math.max(l.max.y,s.y)-l.max.y)/(r.max.y-l.max.y)-(Math.min(l.min.y,s.y)-l.min.y)/(r.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ee(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(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&&(C(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=$e(e._icon),o=e._map.layerPointToLatLng(n);i&&Ee(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){C(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Xi=Fi.extend({options:{icon:new Yi,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=Z(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=Z(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),ve(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),s=!1;o!==this._shadow&&(this._removeShadow(),s=!0),o&&(ve(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){Ee(this._icon,t),this._shadow&&Ee(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ve(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ji)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ji(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&xe(this._icon,t),this._shadow&&xe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Qi(t,e){return new Xi(t,e)}var tn=Fi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t.hasOwnProperty("weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),en=tn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=Z(t),this._radius=this.options.radius},setLatLng:function(t){return this._latlng=Z(t),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return tn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function nn(t,e){return new en(t,e)}var on=en.extend({initialize:function(t,e,i){if("number"==typeof e&&(e=n({},i,{radius:e})),m(this,e),this._latlng=Z(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new B(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:tn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,s=this._mRadius/V.R/o,r=i.project([e+s,t]),a=i.project([e-s,t]),l=r.add(a).divideBy(2),h=i.unproject(l).lat,c=Math.acos((Math.cos(s*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-i.project([h,t-c]).x,this._radiusY=l.y-r.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function sn(t,e,i){return new on(t,e,i)}var rn=tn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,s=Mi,r=0,a=this._parts.length;r<a;r++)for(var l=this._parts[r],h=1,c=l.length;h<c;h++){var d=s(t,e=l[h-1],i=l[h],!0);d<n&&(n=d,o=s(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a=this._rings[0],l=a.length;if(!l)return null;for(t=0,e=0;t<l-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<l-1;t++)if(o=a[t],s=a[t+1],(n+=i=o.distanceTo(s))>e)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=Z(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new B,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),n=0,o=t.length;n<o;n++)i?(e[n]=Z(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new P(t,t);this._pxBounds=new N([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof U,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,s,r,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ci(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(r[0]),r[1]===a[i+1]&&i!==s-2||(l[n].push(r[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=xi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=l)return!0;return!1}});function an(t,e){return new rn(t,e)}rn._flat=zi;var ln=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,s,r,a,l,h=this._rings[0],c=h.length;if(!c)return null;for(s=r=a=0,t=0,e=c-1;t<c;e=t++)i=h[t],n=h[e],o=i.y*n.x-n.y*i.x,r+=(i.x+n.x)*o,a+=(i.y+n.y)*o,s+=3*o;return l=0===s?h[0]:[r/s,a/s],this._map.layerPointToLatLng(l)},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof U&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new P(e,e);if(t=new N(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;o<s;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(l=(e=this._parts[o]).length)-1;s<l;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function hn(t,e){return new ln(t,e)}var cn=Hi.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=dn(t,s);return r?(r.feature=vn(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return t.options=n({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function dn(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,l=[],h=e&&e.pointToLayer,c=e&&e.coordsToLatLng||un;if(!a&&!r)return null;switch(r.type){case"Point":return i=c(a),h?h(t,i):new Xi(i);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=c(a[o]),l.push(h?h(t,i):new Xi(i));return new Hi(l);case"LineString":case"MultiLineString":return n=pn(a,"LineString"===r.type?0:1,c),new rn(n,e);case"Polygon":case"MultiPolygon":return n=pn(a,"Polygon"===r.type?1:2,c),new ln(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var d=dn({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);d&&l.push(d)}return new Hi(l);default:throw new Error("Invalid GeoJSON object.")}}function un(t){return new U(t[1],t[0],t[2])}function pn(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?pn(t[s],e-1,i):(i||un)(t[s]),o.push(n);return o}function mn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[d(t.lng,e),d(t.lat,e),d(t.alt,e)]:[d(t.lng,e),d(t.lat,e)]}function fn(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?fn(t[s],e-1,i,n):mn(t[s],n));return!e&&i&&o.push(o[0]),o}function gn(t,e){return t.feature?n({},t.feature,{geometry:e}):vn(e)}function vn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yn={toGeoJSON:function(t){return gn(this,{type:"Point",coordinates:mn(this.getLatLng(),t)})}};function bn(t,e){return new cn(t,e)}Xi.include(yn),on.include(yn),en.include(yn),rn.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return gn(this,{type:(e?"Multi":"")+"LineString",coordinates:fn(this._latlngs,e?1:0,!1,t)})}}),ln.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),n=fn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),gn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Vi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),gn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var s=vn(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),i?gn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var _n=bn,xn=Fi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=q(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ve(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&me(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=q(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:de("img");ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),this.options.className&&ve(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=s(this.fire,this,"load"),e.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,i,e)},_reset:function(){var t=this._image,e=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ee(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){xe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),wn=function(t,e,i){return new xn(t,e,i)},kn=xn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:de("video");if(ve(e,"leaflet-image-layer"),this._zoomAnimated&&ve(e,"leaflet-zoom-animated"),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=s(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&e.style.hasOwnProperty("objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop;for(var r=0;r<this._url.length;r++){var a=de("source");a.src=this._url[r],e.appendChild(a)}}}});function Sn(t,e,i){return new kn(t,e,i)}var En=xn.extend({_initImage:function(){var t=this._image=this._url;ve(t,"leaflet-image-layer"),this._zoomAnimated&&ve(t,"leaflet-zoom-animated"),t.onselectstart=c,t.onmousemove=c}});function $n(t,e,i){return new En(t,e,i)}var Cn=Fi.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=Z(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&me(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Fi||(i=e,e=t),e instanceof Hi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=D(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ee(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),Tn=Cn.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){Cn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof tn||this._source.on("preclick",qe))},onRemove:function(t){Cn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof tn||this._source.off("preclick",qe))},getEvents:function(){var t=Cn.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),Ze(i),Ue(this._contentNode),Ie(i,"contextmenu",qe),this._tipContainer=de("div",t+"-tip-container",e),this._tip=de("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=de("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,s="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",ve(t,s)):ye(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ee(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ce(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add($e(this._container));var s=t.layerPointToContainerPoint(o),r=D(this.options.autoPanPadding),a=D(this.options.autoPanPaddingTopLeft||r),l=D(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,d=0;s.x+n+l.x>h.x&&(c=s.x+n-h.x+l.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+l.y>h.y&&(d=s.y+i-h.y+l.y),s.y-d-a.y<0&&(d=s.y-a.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new Tn(t,e)};ii.mergeOptions({closePopupOnClick:!0}),ii.include({openPopup:function(t,e,i){return t instanceof Tn||(t=new Tn(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}}),Fi.include({bindPopup:function(t,e){return t instanceof Tn?(m(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Tn(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof tn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Ln=Cn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Cn.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){Cn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Cn.prototype.getEvents.call(this);return St&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=de("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),o=e.layerPointToContainerPoint(t),s=this.options.direction,r=i.offsetWidth,a=i.offsetHeight,l=D(this.options.offset),h=this._getAnchor();"top"===s?t=t.add(D(-r/2+l.x,-a+l.y+h.y,!0)):"bottom"===s?t=t.subtract(D(r/2-l.x,-l.y,!0)):"center"===s?t=t.subtract(D(r/2+l.x,a/2-h.y+l.y,!0)):"right"===s||"auto"===s&&o.x<n.x?(s="right",t=t.add(D(l.x+h.x,h.y-a/2+l.y,!0))):(s="left",t=t.subtract(D(r+h.x-l.x,a/2-h.y-l.y,!0))),ye(i,"leaflet-tooltip-right"),ye(i,"leaflet-tooltip-left"),ye(i,"leaflet-tooltip-top"),ye(i,"leaflet-tooltip-bottom"),ve(i,"leaflet-tooltip-"+s),Ee(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&xe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return D(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Mn=function(t,e){return new Ln(t,e)};ii.include({openTooltip:function(t,e,i){return t instanceof Ln||(t=new Ln(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Fi.include({bindTooltip:function(t,e){return t instanceof Ln?(m(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Ln(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),St&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ve(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var On=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=D(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zn(t){return new On(t)}Gi.Default=Yi;var Pn=Fi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:bt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(me(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=l(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof P?t:new P(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){xe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var s=Math.min(1,(t-o.loaded)/200);xe(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(C(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=de("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=de("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(t),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new P(+o,+s);a.z=+r;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),r>n&&this._retainParent(o,s,r,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new P(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=this._clampZoom(Math.round(e));(void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom)&&(o=void 0);var s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Se(t.el,o,n):Ee(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*n);return new N(o.subtract(s),o.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),s=o.getCenter(),r=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var c=this._tiles[h].coords;c.z===this._tileZoom&&l.contains(new P(c.x,c.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:r.push(p)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(u=0;u<r.length;u++)this._addTile(r[u],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return q(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new B(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new P(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ve(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,et&&this.options.opacity<1&&xe(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),s(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&$(s(this._tileReady,this,t,null,o)),Ee(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xe(i.el,0),C(this._fadeFrame),this._fadeFrame=$(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?$(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new P(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new N(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function In(t){return new Pn(t)}var Dn=Pn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Ct&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",s(this._tileOnLoad,this,e,i)),Ie(i,"error",s(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Ct?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return v(this._url,n(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(s(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=_,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",_),Pn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==_))return Pn.prototype._tileReady.call(this,t,e,i)}});function Nn(t,e){return new Dn(t,e)}var Rn=Dn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=n({},this.defaultWmsParams);for(var o in e)o in this.options||(i[o]=e[o]);var s=(e=m(this,e)).detectRetina&&Ct?2:1,r=this.getTileSize();i.width=r.x*s,i.height=r.y*s,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Dn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Ui?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Dn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return n(this.wmsParams,t),e||this.redraw(),this}});function Bn(t,e){return new Rn(t,e)}Dn.WMS=Rn,Nn.wms=Bn;var qn=Fi.extend({options:{padding:.1,tolerance:0},initialize:function(t){m(this,t),a(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ve(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=$e(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=o.multiplyBy(-i).add(n).add(o).subtract(r);yt?Se(this._container,a,i):Ee(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()}}),Un=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",l(this._onMouseMove,32,this),this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){C(this._redrawRequest),delete this._ctx,ue(this._container),Ne(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Ct?2:1;Ee(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Ct&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[a(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[a(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],l[n?"lineTo":"moveTo"](s.x,s.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&!this._map._draggableMoved(e)&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(ve(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Zn(t){return Tt?new Un(t):null}var Fn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Vn={_initContainer:function(){this._container=de("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(qn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Fn("shape");ve(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Fn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[a(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Fn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Fn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){me(t._container)},_bringToBack:function(t){fe(t._container)}},jn=Lt?Fn:J,Hn=qn.extend({getEvents:function(){var t=qn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ne(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){qn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ee(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=jn("path");t.options.className&&ve(e,t.options.className),t.options.interactive&&ve(e,"leaflet-interactive"),this._updateStyle(t),this._layers[a(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[a(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){me(t._path)},_bringToBack:function(t){fe(t._path)}});function Wn(t){return At||Lt?new Hn(t):null}Lt&&Hn.include(Vn),ii.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Zn(t)||Wn(t)}});var Gn=ln.extend({initialize:function(t,e){ln.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=q(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Gn(t,e)}Hn.create=jn,Hn.pointsToPath=X,cn.geometryToLayer=dn,cn.coordsToLatLng=un,cn.coordsToLatLngs=pn,cn.latLngToCoords=mn,cn.latLngsToCoords=fn,cn.getFeature=gn,cn.asFeature=vn,ii.mergeOptions({boxZoom:!0});var Yn=mi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),ee(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=de("div","leaflet-zoom-box",this._container),ve(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new N(this._point,this._startPoint),i=e.getSize();Ee(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ye(this._container,"leaflet-crosshair")),ie(),Ae(),Ne(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var e=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ii.addInitHook("addHandler","boxZoom",Yn),ii.mergeOptions({doubleClickZoom:!0});var Jn=mi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ii.addInitHook("addHandler","doubleClickZoom",Jn),ii.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=mi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new _i(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ve(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=q(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)<Math.abs(s+i)?o:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),s=(this._lastTime-this._times[0])/1e3,r=i.easeLinearity,a=o.multiplyBy(r/s),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),c=a.multiplyBy(h/l),d=h/(i.inertiaDeceleration*r),u=c.multiplyBy(-d/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),$((function(){e.panBy(u,{duration:d,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ii.addInitHook("addHandler","dragging",Xn),ii.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qn=mi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ne(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ne(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=D(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ii.addInitHook("addHandler","keyboard",Qn),ii.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=mi.extend({addHooks:function(){Ie(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ne(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=We(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(s(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,s=i?Math.ceil(o/i)*i:o,r=t._limitZoom(e+(this._delta>0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ii.addInitHook("addHandler","scrollWheelZoom",to),ii.mergeOptions({tap:!0,tapTolerance:15});var eo=mi.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Fe(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new P(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&ve(i,"leaflet-active"),this._holdTimeout=setTimeout(s((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ne(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new P(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});St&&!kt&&ii.addInitHook("addHandler","tap",eo),ii.mergeOptions({touchZoom:St&&!st,bounceAtZoomLimits:!0});var io=mi.extend({addHooks:function(){ve(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),Fe(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),C(this._animRequest);var a=s(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=$(a,this,!0),Fe(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,C(this._animRequest),Ne(document,"touchmove",this._onTouchMove),Ne(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ii.addInitHook("addHandler","touchZoom",io),ii.BoxZoom=Yn,ii.DoubleClickZoom=Jn,ii.Drag=Xn,ii.Keyboard=Qn,ii.ScrollWheelZoom=to,ii.Tap=eo,ii.TouchZoom=io,Object.freeze=i,t.version=e,t.Control=oi,t.control=si,t.Browser=Ot,t.Evented=z,t.Mixin=gi,t.Util=T,t.Class=A,t.Handler=mi,t.extend=n,t.bind=s,t.stamp=a,t.setOptions=m,t.DomEvent=ti,t.DomUtil=Pe,t.PosAnimation=ei,t.Draggable=_i,t.LineUtil=Pi,t.PolyUtil=Di,t.Point=P,t.point=D,t.Bounds=N,t.bounds=R,t.Transformation=W,t.transformation=G,t.Projection=Bi,t.LatLng=U,t.latLng=Z,t.LatLngBounds=B,t.latLngBounds=q,t.CRS=F,t.GeoJSON=cn,t.geoJSON=bn,t.geoJson=_n,t.Layer=Fi,t.LayerGroup=Vi,t.layerGroup=ji,t.FeatureGroup=Hi,t.featureGroup=Wi,t.ImageOverlay=xn,t.imageOverlay=wn,t.VideoOverlay=kn,t.videoOverlay=Sn,t.SVGOverlay=En,t.svgOverlay=$n,t.DivOverlay=Cn,t.Popup=Tn,t.popup=An,t.Tooltip=Ln,t.tooltip=Mn,t.Icon=Gi,t.icon=Ki,t.DivIcon=On,t.divIcon=zn,t.Marker=Xi,t.marker=Qi,t.TileLayer=Dn,t.tileLayer=Nn,t.GridLayer=Pn,t.gridLayer=In,t.SVG=Hn,t.svg=Wn,t.Renderer=qn,t.Canvas=Un,t.canvas=Zn,t.Path=tn,t.CircleMarker=en,t.circleMarker=nn,t.Circle=on,t.circle=sn,t.Polyline=rn,t.polyline=an,t.Polygon=ln,t.polygon=hn,t.Rectangle=Gn,t.rectangle=Kn,t.Map=ii,t.map=ni;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t}(ph);const mh={weight:1,opacity:1,color:"white",fillOpacity:.7,fillColor:"#2387ca"},fh={weight:3,color:"white",fillOpacity:1,fillColor:"#2387ca"},gh=()=>mh;class vh extends et{static get styles(){return r`
6748
6766
  :host {
6749
6767
  display: block;
6750
6768
  padding: 0px;
@@ -6779,10 +6797,10 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
6779
6797
  color: var(--color-link-primary);
6780
6798
  cursor: pointer;
6781
6799
  }
6782
- `}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(gh),this.hovered=e)},mouseout:t=>{t.target.setStyle(fh),this.hovered=null}})};te(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=mh.geoJSON(i.geometry,{style:vh,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(fh),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(gh)}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=mh.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?D`
6800
+ `}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(fh),this.hovered=e)},mouseout:t=>{t.target.setStyle(mh),this.hovered=null}})};te(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=ph.geoJSON(i.geometry,{style:gh,onEachFeature:t}),this.renderedMap.fitBounds(this.states.getBounds(),{}),this.states.addTo(this.renderedMap)}))}updated(t){if(t.has("hovered")&&(this.lastHovered&&this.lastHovered.setStyle(mh),this.hovered)){const t=this.paths[this.hovered.osm_id];this.lastHovered=t,t&&t.setStyle(fh)}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=ph.map(e,{attributionControl:!1,scrollWheelZoom:!1,zoomControl:!1}).setView([0,1],4),this.renderedMap.dragging.disable(),this.renderedMap.doubleClickZoom.disable(),this.refreshMap(),super.firstUpdated(t)}handleClickedBreadcrumb(t){this.osmId=t.currentTarget.getAttribute("data-osmid");const e=[];for(const t of this.path)if(e.push(t),t.osm_id===this.osmId){this.onFeatureClicked&&this.onFeatureClicked(t);break}this.path=e,this.refreshMap()}render(){return this.osmId?D`
6783
6801
  <link
6784
6802
  rel="stylesheet"
6785
6803
  href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
6786
6804
  />
6787
6805
  <div id="alias-map"></div>
6788
- `:D`<div>No osm map id</div>`}}t([ct()],yh.prototype,"feature",void 0),t([ct()],yh.prototype,"osmId",void 0),t([ct()],yh.prototype,"endpoint",void 0),t([ct()],yh.prototype,"onFeatureClicked",void 0),t([ct()],yh.prototype,"hovered",void 0),t([ct()],yh.prototype,"path",void 0),uh("leaflet-map",yh),uh("alias-editor",ph);
6806
+ `:D`<div>No osm map id</div>`}}t([ct()],vh.prototype,"feature",void 0),t([ct()],vh.prototype,"osmId",void 0),t([ct()],vh.prototype,"endpoint",void 0),t([ct()],vh.prototype,"onFeatureClicked",void 0),t([ct()],vh.prototype,"hovered",void 0),t([ct()],vh.prototype,"path",void 0),dh("leaflet-map",vh),dh("alias-editor",uh);