lua-cli 3.0.2 → 3.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web/app.js CHANGED
@@ -83,8 +83,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
83
83
  `}),n}function MR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}var Xm,zG,OR=A(()=>{Wm();Ym();T5();vR();Xm={}.hasOwnProperty,zG={}});function tf(e,t){let n=IR(e,t),r=n.one(e,void 0),a=kR(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&("children"in i,i.children.push({type:"text",value:`
84
84
  `},a)),i}var DR=A(()=>{NR();OR()});var HR=A(()=>{DR()});function nf(e,t){return e&&"run"in e?async function(n,r){let a=tf(n,{file:r,...t});await e.run(a,r)}:function(n,r){return tf(n,{file:r,...e||t})}}var BR=A(()=>{HR()});var FR=A(()=>{BR()});function Jm(e){if(e)throw e}var VR=A(()=>{});var KR=ur((Hle,qR)=>{"use strict";var rf=Object.prototype.hasOwnProperty,GR=Object.prototype.toString,zR=Object.defineProperty,jR=Object.getOwnPropertyDescriptor,UR=function(t){return typeof Array.isArray=="function"?Array.isArray(t):GR.call(t)==="[object Array]"},ZR=function(t){if(!t||GR.call(t)!=="[object Object]")return!1;var n=rf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&rf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||rf.call(t,a)},$R=function(t,n){zR&&n.name==="__proto__"?zR(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},WR=function(t,n){if(n==="__proto__")if(rf.call(t,n)){if(jR)return jR(t,n).value}else return;return t[n]};qR.exports=function e(){var t,n,r,a,i,s,u=arguments[0],c=1,d=arguments.length,p=!1;for(typeof u=="boolean"&&(p=u,u=arguments[1]||{},c=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});c<d;++c)if(t=arguments[c],t!=null)for(n in t)r=WR(u,n),a=WR(t,n),u!==a&&(p&&a&&(ZR(a)||(i=UR(a)))?(i?(i=!1,s=r&&UR(r)?r:[]):s=r&&ZR(r)?r:{},$R(u,{name:n,newValue:e(p,s,a)})):typeof a<"u"&&$R(u,{name:n,newValue:a}));return u}});function G1(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var YR=A(()=>{});function Qm(){let e=[],t={run:n,use:r};return t;function n(...a){let i=-1,s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...a);function u(c,...d){let p=e[++i],h=-1;if(c){s(c);return}for(;++h<a.length;)(d[h]===null||d[h]===void 0)&&(d[h]=a[h]);a=d,p?XR(p,u)(...d):s(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function XR(e,t){let n;return r;function r(...s){let u=e.length>s.length,c;u&&s.push(a);try{c=e.apply(this,s)}catch(d){let p=d;if(u&&n)throw p;return a(p)}u||(c&&c.then&&typeof c.then=="function"?c.then(i,a):c instanceof Error?a(c):i(c))}function a(s,...u){n||(n=!0,t(s,...u))}function i(s){a(null,s)}}var JR=A(()=>{});var QR=A(()=>{JR()});function WG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');q1(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),u>-1&&(e.codePointAt(a)===t.codePointAt(u--)?u<0&&(r=a):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function GG(e){if(q1(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qG(e){q1(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){let u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function KG(...e){let t=-1,n;for(;++t<e.length;)q1(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YG(n)}function YG(e){q1(e);let t=e.codePointAt(0)===47,n=XG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XG(e,t){let n="",r=0,a=-1,i=0,s=-1,u,c;for(;++s<=e.length;){if(s<e.length)u=e.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(a===s-1||i===1))if(a!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else u===46&&i>-1?i++:i=-1}return n}function q1(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var oo,eT=A(()=>{oo={basename:WG,dirname:GG,extname:qG,join:KG,sep:"/"}});function JG(){return"/"}var tT,nT=A(()=>{tT={cwd:JG}});function Ru(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var e9=A(()=>{});function rT(e){if(typeof e=="string")e=new URL(e);else if(!Ru(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return QG(e)}function QG(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let r=t.codePointAt(n+2);if(r===70||r===102){let a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}var aT=A(()=>{e9();e9()});function n9(e,t){if(e&&e.includes(oo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+oo.sep+"`")}function r9(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function oT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var t9,sl,iT=A(()=>{um();eT();nT();aT();t9=["history","path","basename","stem","extname","dirname"],sl=class{constructor(t){let n;t?Ru(t)?n={path:t}:typeof t=="string"||eq(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<t9.length;){let i=t9[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)t9.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?oo.basename(this.path):void 0}set basename(t){r9(t,"basename"),n9(t,"basename"),this.path=oo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?oo.dirname(this.path):void 0}set dirname(t){oT(this.basename,"dirname"),this.path=oo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?oo.extname(this.path):void 0}set extname(t){if(n9(t,"extname"),oT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=oo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ru(t)&&(t=rT(t)),r9(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?oo.basename(this.path,this.extname):void 0}set stem(t){r9(t,"stem"),n9(t,"stem"),this.path=oo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){let a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){let a=new pn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var a9=A(()=>{iT()});var sT,lT=A(()=>{sT=(function(e){let r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i})});function o9(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function i9(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function s9(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uT(e){if(!G1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function af(e){return nq(e)?e:new sl(e)}function nq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rq(e){return typeof e=="string"||aq(e)}function aq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var of,tq,l9,u9,dT=A(()=>{VR();of=Z(KR(),1);YR();QR();a9();lT();tq={}.hasOwnProperty,l9=class e extends sT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Qm()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,of.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(s9("data",this.frozen),this.namespace[t]=n,this):tq.call(this.namespace,t)&&this.namespace[t]||void 0:t?(s9("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=af(t),r=this.parser||this.Parser;return o9("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),o9("process",this.parser||this.Parser),i9("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){let u=af(t),c=r.parse(u);r.run(c,u,function(p,h,m){if(p||!h||!m)return d(p);let g=h,b=r.stringify(g,m);rq(b)?m.value=b:m.result=b,d(p,m)});function d(p,h){p||!h?s(p):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),o9("processSync",this.parser||this.Parser),i9("processSync",this.compiler||this.Compiler),this.process(t,a),cT("processSync","process",n),r;function a(i,s){n=!0,Jm(i),r=s}}run(t,n,r){uT(t),this.freeze();let a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,u){let c=af(n);a.run(t,c,d);function d(p,h,m){let g=h||t;p?u(p):s?s(g):r(void 0,g,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),cT("runSync","run",r),a;function i(s,u){Jm(s),a=u,r=!0}}stringify(t,n){this.freeze();let r=af(n),a=this.compiler||this.Compiler;return i9("stringify",a),uT(t),a(t,r)}use(t,...n){let r=this.attachers,a=this.namespace;if(s9("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){let[p,...h]=d;c(p,h)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(a.settings=(0,of.default)(!0,a.settings,d.settings))}function u(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){let h=d[p];i(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,p){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===d){m=h;break}if(m===-1)r.push([d,...p]);else if(p.length>0){let[g,...b]=p,C=r[m][1];G1(C)&&G1(g)&&(g=(0,of.default)(!0,C,g)),r[m]=[d,g,...b]}}}},u9=new l9().freeze()});var fT=A(()=>{dT()});function K1(e){let t=lq(e),n=uq(e);return cq(t.runSync(t.parse(n),n),e)}function lq(e){let t=e.rehypePlugins||pT,n=e.remarkPlugins||pT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hT}:hT;return u9().use(G5).use(n).use(nf,r).use(t)}function uq(e){let t=e.children||"",n=new sl;return typeof t=="string"?n.value=t:(""+t,void 0),n}function cq(e,t){let n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,u=t.unwrapDisallowed,c=t.urlTransform||gT;for(let p of sq)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+oq+p.id,void 0);return n&&i&&void 0,W1(e,d),dm(e,{Fragment:Tu.Fragment,components:a,ignoreInvalidStyle:!0,jsx:Tu.jsx,jsxs:Tu.jsxs,passKeys:!0,passNode:!0});function d(p,h,m){if(p.type==="raw"&&m&&typeof h=="number")return s?m.children.splice(h,1):m.children[h]={type:"text",value:p.value},h;if(p.type==="element"){let g;for(g in B1)if(Object.hasOwn(B1,g)&&Object.hasOwn(p.properties,g)){let b=p.properties[g],C=B1[g];(C===null||C.includes(p.tagName))&&(p.properties[g]=c(String(b||""),g,p))}}if(p.type==="element"){let g=n?!n.includes(p.tagName):i?i.includes(p.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(p,h,m)),g&&m&&typeof h=="number")return u&&p.children?m.children.splice(h,1,...p.children):m.children.splice(h,1),h}}}function gT(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||iq.test(e.slice(0,t))?e:""}var Tu,mT,oq,pT,hT,iq,sq,vT=A(()=>{aP();iP();Tu=Z(ke(),1),mT=Z(Se(),1);CE();FR();fT();Ym();a9();oq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pT=[],hT={allowDangerousHtml:!0},iq=/^(https?|ircs?|mailto|xmpp)$/i,sq=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}]});var yT=A(()=>{vT()});var PT,ET,c9,RT,dq,lf,fq,pq,hq,_T,sf,mq,d9,ST,CT,ko,uf,kT,gq,vq,yq,Cq,wq,pe,f9,xq,bq,_q,Sq,kq,Nq,Pq,Eq,Rq,Tq,Lq,Aq,fa,Mq,Iq,Oq,Dq,Hq,Bq,Fq,Vq,zq,jq,Uq,Zq,$q,NT,Wq,Gq,qq,Kq,Yq,Xq,Jq,Qq,eK,tK,nK,rK,aK,oK,iK,sK,lK,wT,xT,uK,bT,cK,dK,fK,pK,TT,LT=A(()=>{PT=Z(Se(),1),ET=Z(Se(),1);Wc();c9=Z(Se(),1);Wc();RT=Z(Se(),1),dq=Object.create,lf=Object.defineProperty,fq=Object.defineProperties,pq=Object.getOwnPropertyDescriptor,hq=Object.getOwnPropertyDescriptors,_T=Object.getOwnPropertyNames,sf=Object.getOwnPropertySymbols,mq=Object.getPrototypeOf,d9=Object.prototype.hasOwnProperty,ST=Object.prototype.propertyIsEnumerable,CT=(e,t,n)=>t in e?lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ko=(e,t)=>{for(var n in t||(t={}))d9.call(t,n)&&CT(e,n,t[n]);if(sf)for(var n of sf(t))ST.call(t,n)&&CT(e,n,t[n]);return e},uf=(e,t)=>fq(e,hq(t)),kT=(e,t)=>{var n={};for(var r in e)d9.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sf)for(var r of sf(e))t.indexOf(r)<0&&ST.call(e,r)&&(n[r]=e[r]);return n},gq=(e,t)=>function(){return t||(0,e[_T(e)[0]])((t={exports:{}}).exports,t),t.exports},vq=(e,t)=>{for(var n in t)lf(e,n,{get:t[n],enumerable:!0})},yq=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _T(t))!d9.call(e,a)&&a!==n&&lf(e,a,{get:()=>t[a],enumerable:!(r=pq(t,a))||r.enumerable});return e},Cq=(e,t,n)=>(n=e!=null?dq(mq(e)):{},yq(t||!e||!e.__esModule?lf(n,"default",{value:e,enumerable:!0}):n,e)),wq=gq({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,i={},s={util:{encode:function b(C){return C instanceof u?new u(C.type,b(C.content),C.alias):Array.isArray(C)?C.map(b):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(b){return Object.prototype.toString.call(b).slice(8,-1)},objId:function(b){return b.__id||Object.defineProperty(b,"__id",{value:++a}),b.__id},clone:function b(C,S){S=S||{};var v,x;switch(s.util.type(C)){case"Object":if(x=s.util.objId(C),S[x])return S[x];v={},S[x]=v;for(var _ in C)C.hasOwnProperty(_)&&(v[_]=b(C[_],S));return v;case"Array":return x=s.util.objId(C),S[x]?S[x]:(v=[],S[x]=v,C.forEach(function(N,T){v[T]=b(N,S)}),v);default:return C}},getLanguage:function(b){for(;b;){var C=r.exec(b.className);if(C)return C[1].toLowerCase();b=b.parentElement}return"none"},setLanguage:function(b,C){b.className=b.className.replace(RegExp(r,"gi"),""),b.classList.add("language-"+C)},isActive:function(b,C,S){for(var v="no-"+C;b;){var x=b.classList;if(x.contains(C))return!0;if(x.contains(v))return!1;b=b.parentElement}return!!S}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(b,C){var S=s.util.clone(s.languages[b]);for(var v in C)S[v]=C[v];return S},insertBefore:function(b,C,S,v){v=v||s.languages;var x=v[b],_={};for(var N in x)if(x.hasOwnProperty(N)){if(N==C)for(var T in S)S.hasOwnProperty(T)&&(_[T]=S[T]);S.hasOwnProperty(N)||(_[N]=x[N])}var P=v[b];return v[b]=_,s.languages.DFS(s.languages,function(R,O){O===P&&R!=b&&(this[R]=_)}),_},DFS:function b(C,S,v,x){x=x||{};var _=s.util.objId;for(var N in C)if(C.hasOwnProperty(N)){S.call(C,N,C[N],v||N);var T=C[N],P=s.util.type(T);P==="Object"&&!x[_(T)]?(x[_(T)]=!0,b(T,S,null,x)):P==="Array"&&!x[_(T)]&&(x[_(T)]=!0,b(T,S,N,x))}}},plugins:{},highlight:function(b,C,S){var v={code:b,grammar:C,language:S};if(s.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=s.tokenize(v.code,v.grammar),s.hooks.run("after-tokenize",v),u.stringify(s.util.encode(v.tokens),v.language)},tokenize:function(b,C){var S=C.rest;if(S){for(var v in S)C[v]=S[v];delete C.rest}var x=new p;return h(x,x.head,b),d(b,x,C,x.head,0),g(x)},hooks:{all:{},add:function(b,C){var S=s.hooks.all;S[b]=S[b]||[],S[b].push(C)},run:function(b,C){var S=s.hooks.all[b];if(!(!S||!S.length))for(var v=0,x;x=S[v++];)x(C)}},Token:u};function u(b,C,S,v){this.type=b,this.content=C,this.alias=S,this.length=(v||"").length|0}u.stringify=function b(C,S){if(typeof C=="string")return C;if(Array.isArray(C)){var v="";return C.forEach(function(P){v+=b(P,S)}),v}var x={type:C.type,content:b(C.content,S),tag:"span",classes:["token",C.type],attributes:{},language:S},_=C.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(x.classes,_):x.classes.push(_)),s.hooks.run("wrap",x);var N="";for(var T in x.attributes)N+=" "+T+'="'+(x.attributes[T]||"").replace(/"/g,"&quot;")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+N+">"+x.content+"</"+x.tag+">"};function c(b,C,S,v){b.lastIndex=C;var x=b.exec(S);if(x&&v&&x[1]){var _=x[1].length;x.index+=_,x[0]=x[0].slice(_)}return x}function d(b,C,S,v,x,_){for(var N in S)if(!(!S.hasOwnProperty(N)||!S[N])){var T=S[N];T=Array.isArray(T)?T:[T];for(var P=0;P<T.length;++P){if(_&&_.cause==N+","+P)return;var R=T[P],O=R.inside,B=!!R.lookbehind,z=!!R.greedy,V=R.alias;if(z&&!R.pattern.global){var H=R.pattern.toString().match(/[imsuy]*$/)[0];R.pattern=RegExp(R.pattern.source,H+"g")}for(var U=R.pattern||R,$=v.next,X=x;$!==C.tail&&!(_&&X>=_.reach);X+=$.value.length,$=$.next){var W=$.value;if(C.length>b.length)return;if(!(W instanceof u)){var oe=1,J;if(z){if(J=c(U,X,b,B),!J||J.index>=b.length)break;var Ee=J.index,K=J.index+J[0].length,M=X;for(M+=$.value.length;Ee>=M;)$=$.next,M+=$.value.length;if(M-=$.value.length,X=M,$.value instanceof u)continue;for(var ve=$;ve!==C.tail&&(M<K||typeof ve.value=="string");ve=ve.next)oe++,M+=ve.value.length;oe--,W=b.slice(X,M),J.index-=X}else if(J=c(U,0,W,B),!J)continue;var Ee=J.index,I=J[0],ne=W.slice(0,Ee),ze=W.slice(Ee+I.length),ye=X+W.length;_&&ye>_.reach&&(_.reach=ye);var fe=$.prev;ne&&(fe=h(C,fe,ne),X+=ne.length),m(C,fe,oe);var de=new u(N,O?s.tokenize(I,O):I,V,I);if($=h(C,fe,de),ze&&h(C,$,ze),oe>1){var he={cause:N+","+P,reach:ye};d(b,C,S,$.prev,X,he),_&&he.reach>_.reach&&(_.reach=he.reach)}}}}}}function p(){var b={value:null,prev:null,next:null},C={value:null,prev:b,next:null};b.next=C,this.head=b,this.tail=C,this.length=0}function h(b,C,S){var v=C.next,x={value:S,prev:C,next:v};return C.next=x,v.prev=x,b.length++,x}function m(b,C,S){for(var v=C.next,x=0;x<S&&v!==b.tail;x++)v=v.next;C.next=v,v.prev=C,b.length-=x}function g(b){for(var C=[],S=b.head.next;S!==b.tail;)C.push(S.value),S=S.next;return C}return s})();t.exports=n,n.default=n}}),pe=Cq(wq());pe.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},pe.languages.markup.tag.inside["attr-value"].inside.entity=pe.languages.markup.entity,pe.languages.markup.doctype.inside["internal-subset"].inside=pe.languages.markup,pe.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(pe.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:pe.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:pe.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},pe.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(pe.languages.markup.tag,"addAttribute",{value:function(e,t){pe.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:pe.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),pe.languages.html=pe.languages.markup,pe.languages.mathml=pe.languages.markup,pe.languages.svg=pe.languages.markup,pe.languages.xml=pe.languages.extend("markup",{}),pe.languages.ssml=pe.languages.xml,pe.languages.atom=pe.languages.xml,pe.languages.rss=pe.languages.xml,(function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),a={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":a}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":a}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(pe),pe.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},pe.languages.javascript=pe.languages.extend("clike",{"class-name":[pe.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),pe.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,pe.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:pe.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:pe.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:pe.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:pe.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:pe.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),pe.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:pe.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),pe.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),pe.languages.markup&&(pe.languages.markup.tag.addInlined("script","javascript"),pe.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),pe.languages.js=pe.languages.javascript,pe.languages.actionscript=pe.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),pe.languages.actionscript["class-name"].alias="function",delete pe.languages.actionscript.parameter,delete pe.languages.actionscript["literal-property"],pe.languages.markup&&pe.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:pe.languages.markup}}),(function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(pe),(function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(a){var i=function(h){h.inside||(h.inside={}),h.inside.rest=r},s="doc-comment";if(u=e.languages[a]){var u,c=u[s];if((c=c||(u=e.languages.insertBefore(a,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(c=u[s]={pattern:c}),Array.isArray(c))for(var d=0,p=c.length;d<p;d++)c[d]instanceof RegExp&&(c[d]={pattern:c[d]}),i(c[d]);else i(c)}})}}),t.addSupport(["java","javascript","php"],t)})(pe),(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(pe),(function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})})(pe),(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(u,c){c=(c||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return u});return RegExp(d,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+a+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(pe),(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(d){return d=d.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+i+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+i+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(p){d!==p&&(e.languages.markdown[d].inside.content.inside[p]=e.languages.markdown[p])})}),e.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function p(h){if(h&&typeof h!="string")for(var m=0,g=h.length;m<g;m++){var b,C=h[m];C.type!=="code"?p(C.content):(b=C.content[1],C=C.content[3],b&&C&&b.type==="code-language"&&C.type==="code-block"&&typeof b.content=="string"&&(b=b.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),b="language-"+(b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase()),C.alias?typeof C.alias=="string"?C.alias=[C.alias,b]:C.alias.push(b):C.alias=[b]))}})(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var p="",h=0,m=d.classes.length;h<m;h++){var g=d.classes[h],g=/language-(.+)/.exec(g);if(g){p=g[1];break}}var b,C=e.languages[p];C?d.content=e.highlight((function(S){return S=S.replace(s,""),S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(v,x){var _;return(x=x.toLowerCase())[0]==="#"?(_=x[1]==="x"?parseInt(x.slice(2),16):Number(x.slice(1)),c(_)):u[x]||v})})(d.content),C,p):p&&p!=="none"&&e.plugins.autoloader&&(b="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=b,e.plugins.autoloader.loadLanguages(p,function(){var S=document.getElementById(b);S&&(S.innerHTML=e.highlight(S.textContent,e.languages[p],p))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),u={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(pe),pe.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:pe.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},pe.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(b){return typeof b!="string"&&b.type!=="comment"&&b.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var a=[];if(h(["definition-mutation","punctuation"])&&p(1).content==="("){n+=2;var i=m(/^\($/,/^\)$/);if(i===-1)continue;for(;n<i;n++){var s=p(0);s.type==="variable"&&(g(s,"variable-input"),a.push(s.content))}n=i+1}if(h(["punctuation","property-query"])&&p(0).content==="{"&&(n++,g(p(0),"property-mutation"),0<a.length)){var u=m(/^\{$/,/^\}$/);if(u!==-1)for(var c=n;c<u;c++){var d=t[c];d.type==="variable"&&0<=a.indexOf(d.content)&&g(d,"variable-input")}}}}function p(b){return t[n+b]}function h(b,C){C=C||0;for(var S=0;S<b.length;S++){var v=p(S+C);if(!v||v.type!==b[S])return}return 1}function m(b,C){for(var S=1,v=n;v<t.length;v++){var x=t[v],_=x.content;if(x.type==="punctuation"&&typeof _=="string"){if(b.test(_))S++;else if(C.test(_)&&--S===0)return v}}return-1}function g(b,C){var S=b.alias;S?Array.isArray(S)||(b.alias=S=[S]):b.alias=S=[],S.push(C)}}),pe.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],i=r.pattern.source;function s(h,m){if(e.languages[h])return{pattern:RegExp("((?:"+m+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function u(h,m,g){return h={code:h,grammar:m,language:g},e.hooks.run("before-tokenize",h),h.tokens=e.tokenize(h.code,h.grammar),e.hooks.run("after-tokenize",h),h.tokens}function c(h,m,g){var S=e.tokenize(h,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),b=0,C={},S=u(S.map(function(x){if(typeof x=="string")return x;for(var _,N,x=x.content;h.indexOf((N=b++,_="___"+g.toUpperCase()+"_"+N+"___"))!==-1;);return C[_]=x,_}).join(""),m,g),v=Object.keys(C);return b=0,(function x(_){for(var N=0;N<_.length;N++){if(b>=v.length)return;var T,P,R,O,B,z,V,H=_[N];typeof H=="string"||typeof H.content=="string"?(T=v[b],(V=(z=typeof H=="string"?H:H.content).indexOf(T))!==-1&&(++b,P=z.substring(0,V),B=C[T],R=void 0,(O={})["interpolation-punctuation"]=a,(O=e.tokenize(B,O)).length===3&&((R=[1,1]).push.apply(R,u(O[1],e.languages.javascript,"javascript")),O.splice.apply(O,R)),R=new e.Token("interpolation",O,r.alias,B),O=z.substring(V+T.length),B=[],P&&B.push(P),B.push(R),O&&(x(z=[O]),B.push.apply(B,z)),typeof H=="string"?(_.splice.apply(_,[N,1].concat(B)),N+=B.length-1):H.content=B)):(V=H.content,Array.isArray(V)?x(V):x([V]))}})(S),new e.Token(g,S,"language-"+g,h)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(h){return typeof h=="string"?h:Array.isArray(h)?h.map(p).join(""):p(h.content)}e.hooks.add("after-tokenize",function(h){h.language in d&&(function m(g){for(var b=0,C=g.length;b<C;b++){var S,v,x,_=g[b];typeof _!="string"&&(S=_.content,Array.isArray(S)?_.type==="template-string"?(_=S[1],S.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(v=p(_),_=_.alias,_=Array.isArray(_)?_[0]:_,x=e.languages[_])&&(S[1]=c(v,x,_))):m(S):typeof S!="string"&&m([S]))}})(h.tokens)})})(pe),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(pe),(function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(pe),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(pe),pe.languages.n4js=pe.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),pe.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),pe.languages.n4jsd=pe.languages.n4js,(function(e){function t(s,u){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),u)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)==="RegExp"?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(pe),(function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,a=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(c,d){return c=c.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return a}),RegExp(c,d)}a=i(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(c){for(var d=[],p=0;p<c.length;p++){var h=c[p],m=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===u(h.content[0].content[1])&&d.pop():h.content[h.content.length-1].content!=="/>"&&d.push({tagName:u(h.content[0].content[1]),openedBraces:0}):0<d.length&&h.type==="punctuation"&&h.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?d[d.length-1].openedBraces--:m=!0),(m||typeof h=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(m=u(h),p<c.length-1&&(typeof c[p+1]=="string"||c[p+1].type==="plain-text")&&(m+=u(c[p+1]),c.splice(p+1,1)),0<p&&(typeof c[p-1]=="string"||c[p-1].type==="plain-text")&&(m=u(c[p-1])+m,c.splice(p-1,1),p--),c[p]=new e.Token("plain-text",m,null,m)),h.content&&typeof h.content!="string"&&s(h.content)}}var u=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(u).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||s(c.tokens)})})(pe),(function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0})(pe),pe.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},pe.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=pe.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(pe),pe.languages.c=pe.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),pe.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),pe.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},pe.languages.c.string],char:pe.languages.c.char,comment:pe.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:pe.languages.c}}}}),pe.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete pe.languages.c.boolean,pe.languages.objectivec=pe.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete pe.languages.objectivec["class-name"],pe.languages.objc=pe.languages.objectivec,pe.languages.reason=pe.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),pe.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete pe.languages.reason.function,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(pe),pe.languages.go=pe.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),pe.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete pe.languages.go["class-name"],(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(pe),pe.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},pe.languages.python["string-interpolation"].inside.interpolation.inside.rest=pe.languages.python,pe.languages.py=pe.languages.python,pe.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},pe.languages.webmanifest=pe.languages.json;f9={};vq(f9,{dracula:()=>bq,duotoneDark:()=>Sq,duotoneLight:()=>Nq,github:()=>Eq,gruvboxMaterialDark:()=>rK,gruvboxMaterialLight:()=>oK,jettwaveDark:()=>Kq,jettwaveLight:()=>Xq,nightOwl:()=>Tq,nightOwlLight:()=>Aq,oceanicNext:()=>Iq,okaidia:()=>Dq,oneDark:()=>Qq,oneLight:()=>tK,palenight:()=>Bq,shadesOfPurple:()=>Vq,synthwave84:()=>jq,ultramin:()=>Zq,vsDark:()=>NT,vsLight:()=>Gq});xq={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},bq=xq,_q={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Sq=_q,kq={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Nq=kq,Pq={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Eq=Pq,Rq={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Tq=Rq,Lq={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Aq=Lq,fa={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},Mq={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:fa.keyword}},{types:["attr-value"],style:{color:fa.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:fa.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:fa.primitive}},{types:["boolean"],style:{color:fa.boolean}},{types:["tag"],style:{color:fa.tag}},{types:["string"],style:{color:fa.string}},{types:["punctuation"],style:{color:fa.string}},{types:["selector","char","builtin","inserted"],style:{color:fa.char}},{types:["function"],style:{color:fa.function}},{types:["operator","entity","url","variable"],style:{color:fa.variable}},{types:["keyword"],style:{color:fa.keyword}},{types:["atrule","class-name"],style:{color:fa.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Iq=Mq,Oq={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Dq=Oq,Hq={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Bq=Hq,Fq={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},Vq=Fq,zq={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},jq=zq,Uq={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Zq=Uq,$q={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},NT=$q,Wq={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Gq=Wq,qq={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kq=qq,Yq={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Xq=Yq,Jq={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Qq=Jq,eK={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},tK=eK,nK={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},rK=nK,aK={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},oK=aK,iK=e=>(0,ET.useCallback)(t=>{var n=t,{className:r,style:a,line:i}=n,s=kT(n,["className","style","line"]);let u=uf(ko({},s),{className:c2("token-line",r)});return typeof e=="object"&&"plain"in e&&(u.style=e.plain),typeof a=="object"&&(u.style=ko(ko({},u.style||{}),a)),u},[e]),sK=e=>{let t=(0,c9.useCallback)(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(a=>e[a]))}},[e]);return(0,c9.useCallback)(n=>{var r=n,{token:a,className:i,style:s}=r,u=kT(r,["token","className","style"]);let c=uf(ko({},u),{className:c2("token",...a.types,i),children:a.content,style:t(a)});return s!=null&&(c.style=ko(ko({},c.style||{}),s)),c},[t])},lK=/\r\n|\r|\n/,wT=e=>{e.length===0?e.push({types:["plain"],content:`
85
85
  `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
86
- `,e[0].empty=!0)},xT=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},uK=e=>{let t=[[]],n=[e],r=[0],a=[e.length],i=0,s=0,u=[],c=[u];for(;s>-1;){for(;(i=r[s]++)<a[s];){let d,p=t[s],m=n[s][i];if(typeof m=="string"?(p=s>0?p:["plain"],d=m):(p=xT(p,m.type),m.alias&&(p=xT(p,m.alias)),d=m.content),typeof d!="string"){s++,t.push(p),n.push(d),r.push(0),a.push(d.length);continue}let g=d.split(lK),b=g.length;u.push({types:p,content:g[0]});for(let C=1;C<b;C++)wT(u),c.push(u=[]),u.push({types:p,content:g[C]})}s--,t.pop(),n.pop(),r.pop(),a.pop()}return wT(u),c},bT=uK,cK=({prism:e,code:t,grammar:n,language:r})=>(0,RT.useMemo)(()=>{if(n==null)return bT([t]);let a={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",a),bT(a.tokens)},[t,n,r,e]),dK=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((a,i)=>{let{languages:s,style:u}=i;return s&&!s.includes(t)||i.types.forEach(c=>{let d=ko(ko({},a[c]),u);a[c]=d}),a},{});return r.root=n,r.plain=uf(ko({},n),{backgroundColor:void 0}),r},fK=dK,pK=({children:e,language:t,code:n,theme:r,prism:a})=>{let i=t.toLowerCase(),s=fK(r,i),u=iK(s),c=sK(s),d=a.languages[i],p=cK({prism:a,language:i,code:n,grammar:d});return e({tokens:p,className:`prism-code language-${i}`,style:s!=null?s.root:{},getLineProps:u,getTokenProps:c})},TT=e=>(0,PT.createElement)(pK,uf(ko({},e),{prism:e.prism||pe,theme:e.theme||NT,code:e.code,language:e.language}));});function df(e,t){let n=(0,cf.useRef)(t);(0,cf.useEffect)(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}var cf,p9=A(()=>{cf=Z(Se(),1)});function h9(e){return Object.freeze({__version:AT,map:e})}function m9(e,t){return Object.freeze({...e,...t})}function X1(){let e=(0,ff.useContext)(g9);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}var ff,AT,g9,Y1,J1=A(()=>{ff=Z(Se(),1),AT=1;g9=(0,ff.createContext)(null),Y1=g9.Provider});function IT(e){function t(n,r){let{instance:a,context:i}=e(n).current;return(0,Yr.useImperativeHandle)(r,()=>a),n.children==null?null:Yr.default.createElement(Y1,{value:i},n.children)}return(0,Yr.forwardRef)(t)}function OT(e){function t(n,r){let[a,i]=(0,Yr.useState)(!1),{instance:s}=e(n,i).current;(0,Yr.useImperativeHandle)(r,()=>s),(0,Yr.useEffect)(function(){a&&s.update()},[s,a,n.children]);let u=s._contentNode;return u?(0,MT.createPortal)(n.children,u):null}return(0,Yr.forwardRef)(t)}function DT(e){function t(n,r){let{instance:a}=e(n).current;return(0,Yr.useImperativeHandle)(r,()=>a),null}return(0,Yr.forwardRef)(t)}var Yr,MT,HT=A(()=>{Yr=Z(Se(),1),MT=Z(ks(),1);J1()});function hf(e,t){let n=(0,pf.useRef)();(0,pf.useEffect)(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}var pf,v9=A(()=>{pf=Z(Se(),1)});function ll(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}var mf=A(()=>{});function BT(e,t){return function(r,a){let i=X1(),s=e(ll(r,i),i);return df(i.map,r.attribution),hf(s.current,r.eventHandlers),t(s.current,i,r,a),s}}var FT=A(()=>{p9();J1();v9();mf()});var Q1=ur((gf,VT)=>{(function(e,t){typeof gf=="object"&&typeof VT<"u"?t(gf):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.leaflet={}))})(gf,(function(e){"use strict";var t="1.9.4";function n(o){var l,f,w,k;for(f=1,w=arguments.length;f<w;f++){k=arguments[f];for(l in k)o[l]=k[l]}return o}var r=Object.create||(function(){function o(){}return function(l){return o.prototype=l,new o}})();function a(o,l){var f=Array.prototype.slice;if(o.bind)return o.bind.apply(o,f.call(arguments,1));var w=f.call(arguments,2);return function(){return o.apply(l,w.length?w.concat(f.call(arguments)):arguments)}}var i=0;function s(o){return"_leaflet_id"in o||(o._leaflet_id=++i),o._leaflet_id}function u(o,l,f){var w,k,E,F;return F=function(){w=!1,k&&(E.apply(f,k),k=!1)},E=function(){w?k=arguments:(o.apply(f,arguments),setTimeout(F,l),w=!0)},E}function c(o,l,f){var w=l[1],k=l[0],E=w-k;return o===w&&f?o:((o-k)%E+E)%E+k}function d(){return!1}function p(o,l){if(l===!1)return o;var f=Math.pow(10,l===void 0?6:l);return Math.round(o*f)/f}function h(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function m(o){return h(o).split(/\s+/)}function g(o,l){Object.prototype.hasOwnProperty.call(o,"options")||(o.options=o.options?r(o.options):{});for(var f in l)o.options[f]=l[f];return o.options}function b(o,l,f){var w=[];for(var k in o)w.push(encodeURIComponent(f?k.toUpperCase():k)+"="+encodeURIComponent(o[k]));return(!l||l.indexOf("?")===-1?"?":"&")+w.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function S(o,l){return o.replace(C,function(f,w){var k=l[w];if(k===void 0)throw new Error("No value provided for variable "+f);return typeof k=="function"&&(k=k(l)),k})}var v=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function x(o,l){for(var f=0;f<o.length;f++)if(o[f]===l)return f;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(o){return window["webkit"+o]||window["moz"+o]||window["ms"+o]}var T=0;function P(o){var l=+new Date,f=Math.max(0,16-(l-T));return T=l+f,window.setTimeout(o,f)}var R=window.requestAnimationFrame||N("RequestAnimationFrame")||P,O=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(o){window.clearTimeout(o)};function B(o,l,f){if(f&&R===P)o.call(l);else return R.call(window,a(o,l))}function z(o){o&&O.call(window,o)}var V={__proto__:null,extend:n,create:r,bind:a,get lastId(){return i},stamp:s,throttle:u,wrapNum:c,falseFn:d,formatNum:p,trim:h,splitWords:m,setOptions:g,getParamString:b,template:S,isArray:v,indexOf:x,emptyImageUrl:_,requestFn:R,cancelFn:O,requestAnimFrame:B,cancelAnimFrame:z};function H(){}H.extend=function(o){var l=function(){g(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=l.__super__=this.prototype,w=r(f);w.constructor=l,l.prototype=w;for(var k in this)Object.prototype.hasOwnProperty.call(this,k)&&k!=="prototype"&&k!=="__super__"&&(l[k]=this[k]);return o.statics&&n(l,o.statics),o.includes&&(U(o.includes),n.apply(null,[w].concat(o.includes))),n(w,o),delete w.statics,delete w.includes,w.options&&(w.options=f.options?r(f.options):{},n(w.options,o.options)),w._initHooks=[],w.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var E=0,F=w._initHooks.length;E<F;E++)w._initHooks[E].call(this)}},l},H.include=function(o){var l=this.prototype.options;return n(this.prototype,o),o.options&&(this.prototype.options=l,this.mergeOptions(o.options)),this},H.mergeOptions=function(o){return n(this.prototype.options,o),this},H.addInitHook=function(o){var l=Array.prototype.slice.call(arguments,1),f=typeof o=="function"?o:function(){this[o].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function U(o){if(!(typeof L>"u"||!L||!L.Mixin)){o=v(o)?o:[o];for(var l=0;l<o.length;l++)o[l]===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)}}var $={on:function(o,l,f){if(typeof o=="object")for(var w in o)this._on(w,o[w],l);else{o=m(o);for(var k=0,E=o.length;k<E;k++)this._on(o[k],l,f)}return this},off:function(o,l,f){if(!arguments.length)delete this._events;else if(typeof o=="object")for(var w in o)this._off(w,o[w],l);else{o=m(o);for(var k=arguments.length===1,E=0,F=o.length;E<F;E++)k?this._off(o[E]):this._off(o[E],l,f)}return this},_on:function(o,l,f,w){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(o,l,f)===!1){f===this&&(f=void 0);var k={fn:l,ctx:f};w&&(k.once=!0),this._events=this._events||{},this._events[o]=this._events[o]||[],this._events[o].push(k)}},_off:function(o,l,f){var w,k,E;if(this._events&&(w=this._events[o],!!w)){if(arguments.length===1){if(this._firingCount)for(k=0,E=w.length;k<E;k++)w[k].fn=d;delete this._events[o];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var F=this._listens(o,l,f);if(F!==!1){var Y=w[F];this._firingCount&&(Y.fn=d,this._events[o]=w=w.slice()),w.splice(F,1)}}},fire:function(o,l,f){if(!this.listens(o,f))return this;var w=n({},l,{type:o,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var k=this._events[o];if(k){this._firingCount=this._firingCount+1||1;for(var E=0,F=k.length;E<F;E++){var Y=k[E],ee=Y.fn;Y.once&&this.off(o,ee,Y.ctx),ee.call(Y.ctx||this,w)}this._firingCount--}}return f&&this._propagateEvent(w),this},listens:function(o,l,f,w){typeof o!="string"&&console.warn('"string" type argument expected');var k=l;typeof l!="function"&&(w=!!l,k=void 0,f=void 0);var E=this._events&&this._events[o];if(E&&E.length&&this._listens(o,k,f)!==!1)return!0;if(w){for(var F in this._eventParents)if(this._eventParents[F].listens(o,l,f,w))return!0}return!1},_listens:function(o,l,f){if(!this._events)return!1;var w=this._events[o]||[];if(!l)return!!w.length;f===this&&(f=void 0);for(var k=0,E=w.length;k<E;k++)if(w[k].fn===l&&w[k].ctx===f)return k;return!1},once:function(o,l,f){if(typeof o=="object")for(var w in o)this._on(w,o[w],l,!0);else{o=m(o);for(var k=0,E=o.length;k<E;k++)this._on(o[k],l,f,!0)}return this},addEventParent:function(o){return this._eventParents=this._eventParents||{},this._eventParents[s(o)]=o,this},removeEventParent:function(o){return this._eventParents&&delete this._eventParents[s(o)],this},_propagateEvent:function(o){for(var l in this._eventParents)this._eventParents[l].fire(o.type,n({layer:o.target,propagatedFrom:o.target},o),!0)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var X=H.extend($);function W(o,l,f){this.x=f?Math.round(o):o,this.y=f?Math.round(l):l}var oe=Math.trunc||function(o){return o>0?Math.floor(o):Math.ceil(o)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(o){return this.clone()._add(J(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(J(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new W(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new W(this.x/o.x,this.y/o.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=oe(this.x),this.y=oe(this.y),this},distanceTo:function(o){o=J(o);var l=o.x-this.x,f=o.y-this.y;return Math.sqrt(l*l+f*f)},equals:function(o){return o=J(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=J(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function J(o,l,f){return o instanceof W?o:v(o)?new W(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new W(o.x,o.y):new W(o,l,f)}function K(o,l){if(o)for(var f=l?[o,l]:o,w=0,k=f.length;w<k;w++)this.extend(f[w])}K.prototype={extend:function(o){var l,f;if(!o)return this;if(o instanceof W||typeof o[0]=="number"||"x"in o)l=f=J(o);else if(o=M(o),l=o.min,f=o.max,!l||!f)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=f.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(f.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(f.y,this.max.y)),this},getCenter:function(o){return J((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,o)},getBottomLeft:function(){return J(this.min.x,this.max.y)},getTopRight:function(){return J(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(o){var l,f;return typeof o[0]=="number"||o instanceof W?o=J(o):o=M(o),o instanceof K?(l=o.min,f=o.max):l=f=o,l.x>=this.min.x&&f.x<=this.max.x&&l.y>=this.min.y&&f.y<=this.max.y},intersects:function(o){o=M(o);var l=this.min,f=this.max,w=o.min,k=o.max,E=k.x>=l.x&&w.x<=f.x,F=k.y>=l.y&&w.y<=f.y;return E&&F},overlaps:function(o){o=M(o);var l=this.min,f=this.max,w=o.min,k=o.max,E=k.x>l.x&&w.x<f.x,F=k.y>l.y&&w.y<f.y;return E&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(o){var l=this.min,f=this.max,w=Math.abs(l.x-f.x)*o,k=Math.abs(l.y-f.y)*o;return M(J(l.x-w,l.y-k),J(f.x+w,f.y+k))},equals:function(o){return o?(o=M(o),this.min.equals(o.getTopLeft())&&this.max.equals(o.getBottomRight())):!1}};function M(o,l){return!o||o instanceof K?o:new K(o,l)}function ve(o,l){if(o)for(var f=l?[o,l]:o,w=0,k=f.length;w<k;w++)this.extend(f[w])}ve.prototype={extend:function(o){var l=this._southWest,f=this._northEast,w,k;if(o instanceof I)w=o,k=o;else if(o instanceof ve){if(w=o._southWest,k=o._northEast,!w||!k)return this}else return o?this.extend(ne(o)||Ee(o)):this;return!l&&!f?(this._southWest=new I(w.lat,w.lng),this._northEast=new I(k.lat,k.lng)):(l.lat=Math.min(w.lat,l.lat),l.lng=Math.min(w.lng,l.lng),f.lat=Math.max(k.lat,f.lat),f.lng=Math.max(k.lng,f.lng)),this},pad:function(o){var l=this._southWest,f=this._northEast,w=Math.abs(l.lat-f.lat)*o,k=Math.abs(l.lng-f.lng)*o;return new ve(new I(l.lat-w,l.lng-k),new I(f.lat+w,f.lng+k))},getCenter:function(){return new I((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 I(this.getNorth(),this.getWest())},getSouthEast:function(){return new I(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(o){typeof o[0]=="number"||o instanceof I||"lat"in o?o=ne(o):o=Ee(o);var l=this._southWest,f=this._northEast,w,k;return o instanceof ve?(w=o.getSouthWest(),k=o.getNorthEast()):w=k=o,w.lat>=l.lat&&k.lat<=f.lat&&w.lng>=l.lng&&k.lng<=f.lng},intersects:function(o){o=Ee(o);var l=this._southWest,f=this._northEast,w=o.getSouthWest(),k=o.getNorthEast(),E=k.lat>=l.lat&&w.lat<=f.lat,F=k.lng>=l.lng&&w.lng<=f.lng;return E&&F},overlaps:function(o){o=Ee(o);var l=this._southWest,f=this._northEast,w=o.getSouthWest(),k=o.getNorthEast(),E=k.lat>l.lat&&w.lat<f.lat,F=k.lng>l.lng&&w.lng<f.lng;return E&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(o,l){return o?(o=Ee(o),this._southWest.equals(o.getSouthWest(),l)&&this._northEast.equals(o.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Ee(o,l){return o instanceof ve?o:new ve(o,l)}function I(o,l,f){if(isNaN(o)||isNaN(l))throw new Error("Invalid LatLng object: ("+o+", "+l+")");this.lat=+o,this.lng=+l,f!==void 0&&(this.alt=+f)}I.prototype={equals:function(o,l){if(!o)return!1;o=ne(o);var f=Math.max(Math.abs(this.lat-o.lat),Math.abs(this.lng-o.lng));return f<=(l===void 0?1e-9:l)},toString:function(o){return"LatLng("+p(this.lat,o)+", "+p(this.lng,o)+")"},distanceTo:function(o){return ye.distance(this,ne(o))},wrap:function(){return ye.wrapLatLng(this)},toBounds:function(o){var l=180*o/40075017,f=l/Math.cos(Math.PI/180*this.lat);return Ee([this.lat-l,this.lng-f],[this.lat+l,this.lng+f])},clone:function(){return new I(this.lat,this.lng,this.alt)}};function ne(o,l,f){return o instanceof I?o:v(o)&&typeof o[0]!="object"?o.length===3?new I(o[0],o[1],o[2]):o.length===2?new I(o[0],o[1]):null:o==null?o:typeof o=="object"&&"lat"in o?new I(o.lat,"lng"in o?o.lng:o.lon,o.alt):l===void 0?null:new I(o,l,f)}var ze={latLngToPoint:function(o,l){var f=this.projection.project(o),w=this.scale(l);return this.transformation._transform(f,w)},pointToLatLng:function(o,l){var f=this.scale(l),w=this.transformation.untransform(o,f);return this.projection.unproject(w)},project:function(o){return this.projection.project(o)},unproject:function(o){return this.projection.unproject(o)},scale:function(o){return 256*Math.pow(2,o)},zoom:function(o){return Math.log(o/256)/Math.LN2},getProjectedBounds:function(o){if(this.infinite)return null;var l=this.projection.bounds,f=this.scale(o),w=this.transformation.transform(l.min,f),k=this.transformation.transform(l.max,f);return new K(w,k)},infinite:!1,wrapLatLng:function(o){var l=this.wrapLng?c(o.lng,this.wrapLng,!0):o.lng,f=this.wrapLat?c(o.lat,this.wrapLat,!0):o.lat,w=o.alt;return new I(f,l,w)},wrapLatLngBounds:function(o){var l=o.getCenter(),f=this.wrapLatLng(l),w=l.lat-f.lat,k=l.lng-f.lng;if(w===0&&k===0)return o;var E=o.getSouthWest(),F=o.getNorthEast(),Y=new I(E.lat-w,E.lng-k),ee=new I(F.lat-w,F.lng-k);return new ve(Y,ee)}},ye=n({},ze,{wrapLng:[-180,180],R:6371e3,distance:function(o,l){var f=Math.PI/180,w=o.lat*f,k=l.lat*f,E=Math.sin((l.lat-o.lat)*f/2),F=Math.sin((l.lng-o.lng)*f/2),Y=E*E+Math.cos(w)*Math.cos(k)*F*F,ee=2*Math.atan2(Math.sqrt(Y),Math.sqrt(1-Y));return this.R*ee}}),fe=6378137,de={R:fe,MAX_LATITUDE:85.0511287798,project:function(o){var l=Math.PI/180,f=this.MAX_LATITUDE,w=Math.max(Math.min(f,o.lat),-f),k=Math.sin(w*l);return new W(this.R*o.lng*l,this.R*Math.log((1+k)/(1-k))/2)},unproject:function(o){var l=180/Math.PI;return new I((2*Math.atan(Math.exp(o.y/this.R))-Math.PI/2)*l,o.x*l/this.R)},bounds:(function(){var o=fe*Math.PI;return new K([-o,-o],[o,o])})()};function he(o,l,f,w){if(v(o)){this._a=o[0],this._b=o[1],this._c=o[2],this._d=o[3];return}this._a=o,this._b=l,this._c=f,this._d=w}he.prototype={transform:function(o,l){return this._transform(o.clone(),l)},_transform:function(o,l){return l=l||1,o.x=l*(this._a*o.x+this._b),o.y=l*(this._c*o.y+this._d),o},untransform:function(o,l){return l=l||1,new W((o.x/l-this._b)/this._a,(o.y/l-this._d)/this._c)}};function Ne(o,l,f,w){return new he(o,l,f,w)}var D=n({},ye,{code:"EPSG:3857",projection:de,transformation:(function(){var o=.5/(Math.PI*de.R);return Ne(o,.5,-o,.5)})()}),te=n({},D,{code:"EPSG:900913"});function ce(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function ge(o,l){var f="",w,k,E,F,Y,ee;for(w=0,E=o.length;w<E;w++){for(Y=o[w],k=0,F=Y.length;k<F;k++)ee=Y[k],f+=(k?"L":"M")+ee.x+" "+ee.y;f+=l?qe.svg?"z":"x":""}return f||"M0 0"}var ie=document.documentElement.style,Q="ActiveXObject"in window,se=Q&&!document.addEventListener,re="msLaunchUri"in navigator&&!("documentMode"in document),xe=lo("webkit"),Ye=lo("android"),xt=lo("android 2")||lo("android 3"),Tt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Cn=Ye&&lo("Google")&&Tt<537&&!("AudioNode"in window),sn=!!window.opera,wn=!re&&lo("chrome"),ae=lo("gecko")&&!xe&&!sn&&!Q,_e=!wn&&lo("safari"),Je=lo("phantom"),at="OTransition"in ie,mt=navigator.platform.indexOf("Win")===0,xn=Q&&"transition"in ie,Jn="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!xt,$t="MozPerspective"in ie,ta=!window.L_DISABLE_3D&&(xn||Jn||$t)&&!at&&!Je,xr=typeof orientation<"u"||lo("mobile"),Qn=xr&&xe,so=xr&&Jn,Or=!window.PointerEvent&&window.MSPointerEvent,Fu=!!(window.PointerEvent||Or),gd="ontouchstart"in window||!!window.TouchEvent,vd=!window.L_NO_TOUCH&&(gd||Fu),yd=xr&&sn,Cd=xr&&ae,Hf=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,wd=(function(){var o=!1;try{var l=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",d,l),window.removeEventListener("testPassiveEventSupport",d,l)}catch{}return o})(),xd=(function(){return!!document.createElement("canvas").getContext})(),Vu=!!(document.createElementNS&&ce("svg").createSVGRect),UA=!!Vu&&(function(){var o=document.createElement("div");return o.innerHTML="<svg/>",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ZA=!Vu&&(function(){try{var o=document.createElement("div");o.innerHTML='<v:shape adj="1"/>';var l=o.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}})(),$A=navigator.platform.indexOf("Mac")===0,WA=navigator.platform.indexOf("Linux")===0;function lo(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var qe={ie:Q,ielt9:se,edge:re,webkit:xe,android:Ye,android23:xt,androidStock:Cn,opera:sn,chrome:wn,gecko:ae,safari:_e,phantom:Je,opera12:at,win:mt,ie3d:xn,webkit3d:Jn,gecko3d:$t,any3d:ta,mobile:xr,mobileWebkit:Qn,mobileWebkit3d:so,msPointer:Or,pointer:Fu,touch:vd,touchNative:gd,mobileOpera:yd,mobileGecko:Cd,retina:Hf,passiveEvents:wd,canvas:xd,svg:Vu,vml:ZA,inlineSvg:UA,mac:$A,linux:WA},T7=qe.msPointer?"MSPointerDown":"pointerdown",L7=qe.msPointer?"MSPointerMove":"pointermove",A7=qe.msPointer?"MSPointerUp":"pointerup",M7=qe.msPointer?"MSPointerCancel":"pointercancel",Bf={touchstart:T7,touchmove:L7,touchend:A7,touchcancel:M7},I7={touchstart:JA,touchmove:bd,touchend:bd,touchcancel:bd},gl={},O7=!1;function GA(o,l,f){return l==="touchstart"&&XA(),I7[l]?(f=I7[l].bind(this,f),o.addEventListener(Bf[l],f,!1),f):(console.warn("wrong event specified:",l),d)}function qA(o,l,f){if(!Bf[l]){console.warn("wrong event specified:",l);return}o.removeEventListener(Bf[l],f,!1)}function KA(o){gl[o.pointerId]=o}function YA(o){gl[o.pointerId]&&(gl[o.pointerId]=o)}function D7(o){delete gl[o.pointerId]}function XA(){O7||(document.addEventListener(T7,KA,!0),document.addEventListener(L7,YA,!0),document.addEventListener(A7,D7,!0),document.addEventListener(M7,D7,!0),O7=!0)}function bd(o,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var f in gl)l.touches.push(gl[f]);l.changedTouches=[l],o(l)}}function JA(o,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&er(l),bd(o,l)}function QA(o){var l={},f,w;for(w in o)f=o[w],l[w]=f&&f.bind?f.bind(o):f;return o=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var eM=200;function tM(o,l){o.addEventListener("dblclick",l);var f=0,w;function k(E){if(E.detail!==1){w=E.detail;return}if(!(E.pointerType==="mouse"||E.sourceCapabilities&&!E.sourceCapabilities.firesTouchEvents)){var F=z7(E);if(!(F.some(function(ee){return ee instanceof HTMLLabelElement&&ee.attributes.for})&&!F.some(function(ee){return ee instanceof HTMLInputElement||ee instanceof HTMLSelectElement}))){var Y=Date.now();Y-f<=eM?(w++,w===2&&l(QA(E))):w=1,f=Y}}}return o.addEventListener("click",k),{dblclick:l,simDblclick:k}}function nM(o,l){o.removeEventListener("dblclick",l.dblclick),o.removeEventListener("click",l.simDblclick)}var Ff=kd(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zu=kd(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),H7=zu==="webkitTransition"||zu==="OTransition"?zu+"End":"transitionend";function B7(o){return typeof o=="string"?document.getElementById(o):o}function ju(o,l){var f=o.style[l]||o.currentStyle&&o.currentStyle[l];if((!f||f==="auto")&&document.defaultView){var w=document.defaultView.getComputedStyle(o,null);f=w?w[l]:null}return f==="auto"?null:f}function Nt(o,l,f){var w=document.createElement(o);return w.className=l||"",f&&f.appendChild(w),w}function Qt(o){var l=o.parentNode;l&&l.removeChild(o)}function _d(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function vl(o){var l=o.parentNode;l&&l.lastChild!==o&&l.appendChild(o)}function yl(o){var l=o.parentNode;l&&l.firstChild!==o&&l.insertBefore(o,l.firstChild)}function Vf(o,l){if(o.classList!==void 0)return o.classList.contains(l);var f=Sd(o);return f.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(f)}function ft(o,l){if(o.classList!==void 0)for(var f=m(l),w=0,k=f.length;w<k;w++)o.classList.add(f[w]);else if(!Vf(o,l)){var E=Sd(o);zf(o,(E?E+" ":"")+l)}}function cn(o,l){o.classList!==void 0?o.classList.remove(l):zf(o,h((" "+Sd(o)+" ").replace(" "+l+" "," ")))}function zf(o,l){o.className.baseVal===void 0?o.className=l:o.className.baseVal=l}function Sd(o){return o.correspondingElement&&(o=o.correspondingElement),o.className.baseVal===void 0?o.className:o.className.baseVal}function ga(o,l){"opacity"in o.style?o.style.opacity=l:"filter"in o.style&&rM(o,l)}function rM(o,l){var f=!1,w="DXImageTransform.Microsoft.Alpha";try{f=o.filters.item(w)}catch{if(l===1)return}l=Math.round(l*100),f?(f.Enabled=l!==100,f.Opacity=l):o.style.filter+=" progid:"+w+"(opacity="+l+")"}function kd(o){for(var l=document.documentElement.style,f=0;f<o.length;f++)if(o[f]in l)return o[f];return!1}function os(o,l,f){var w=l||new W(0,0);o.style[Ff]=(qe.ie3d?"translate("+w.x+"px,"+w.y+"px)":"translate3d("+w.x+"px,"+w.y+"px,0)")+(f?" scale("+f+")":"")}function bn(o,l){o._leaflet_pos=l,qe.any3d?os(o,l):(o.style.left=l.x+"px",o.style.top=l.y+"px")}function is(o){return o._leaflet_pos||new W(0,0)}var Uu,Zu,jf;if("onselectstart"in document)Uu=function(){ut(window,"selectstart",er)},Zu=function(){Ht(window,"selectstart",er)};else{var $u=kd(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Uu=function(){if($u){var o=document.documentElement.style;jf=o[$u],o[$u]="none"}},Zu=function(){$u&&(document.documentElement.style[$u]=jf,jf=void 0)}}function Uf(){ut(window,"dragstart",er)}function Zf(){Ht(window,"dragstart",er)}var Nd,$f;function Wf(o){for(;o.tabIndex===-1;)o=o.parentNode;o.style&&(Pd(),Nd=o,$f=o.style.outlineStyle,o.style.outlineStyle="none",ut(window,"keydown",Pd))}function Pd(){Nd&&(Nd.style.outlineStyle=$f,Nd=void 0,$f=void 0,Ht(window,"keydown",Pd))}function F7(o){do o=o.parentNode;while((!o.offsetWidth||!o.offsetHeight)&&o!==document.body);return o}function Gf(o){var l=o.getBoundingClientRect();return{x:l.width/o.offsetWidth||1,y:l.height/o.offsetHeight||1,boundingClientRect:l}}var aM={__proto__:null,TRANSFORM:Ff,TRANSITION:zu,TRANSITION_END:H7,get:B7,getStyle:ju,create:Nt,remove:Qt,empty:_d,toFront:vl,toBack:yl,hasClass:Vf,addClass:ft,removeClass:cn,setClass:zf,getClass:Sd,setOpacity:ga,testProp:kd,setTransform:os,setPosition:bn,getPosition:is,get disableTextSelection(){return Uu},get enableTextSelection(){return Zu},disableImageDrag:Uf,enableImageDrag:Zf,preventOutline:Wf,restoreOutline:Pd,getSizedParentNode:F7,getScale:Gf};function ut(o,l,f,w){if(l&&typeof l=="object")for(var k in l)Kf(o,k,l[k],f);else{l=m(l);for(var E=0,F=l.length;E<F;E++)Kf(o,l[E],f,w)}return this}var uo="_leaflet_events";function Ht(o,l,f,w){if(arguments.length===1)V7(o),delete o[uo];else if(l&&typeof l=="object")for(var k in l)Yf(o,k,l[k],f);else if(l=m(l),arguments.length===2)V7(o,function(Y){return x(l,Y)!==-1});else for(var E=0,F=l.length;E<F;E++)Yf(o,l[E],f,w);return this}function V7(o,l){for(var f in o[uo]){var w=f.split(/\d/)[0];(!l||l(w))&&Yf(o,w,null,null,f)}}var qf={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Kf(o,l,f,w){var k=l+s(f)+(w?"_"+s(w):"");if(o[uo]&&o[uo][k])return this;var E=function(Y){return f.call(w||o,Y||window.event)},F=E;!qe.touchNative&&qe.pointer&&l.indexOf("touch")===0?E=GA(o,l,E):qe.touch&&l==="dblclick"?E=tM(o,E):"addEventListener"in o?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?o.addEventListener(qf[l]||l,E,qe.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(E=function(Y){Y=Y||window.event,Jf(o,Y)&&F(Y)},o.addEventListener(qf[l],E,!1)):o.addEventListener(l,F,!1):o.attachEvent("on"+l,E),o[uo]=o[uo]||{},o[uo][k]=E}function Yf(o,l,f,w,k){k=k||l+s(f)+(w?"_"+s(w):"");var E=o[uo]&&o[uo][k];if(!E)return this;!qe.touchNative&&qe.pointer&&l.indexOf("touch")===0?qA(o,l,E):qe.touch&&l==="dblclick"?nM(o,E):"removeEventListener"in o?o.removeEventListener(qf[l]||l,E,!1):o.detachEvent("on"+l,E),o[uo][k]=null}function ss(o){return o.stopPropagation?o.stopPropagation():o.originalEvent?o.originalEvent._stopped=!0:o.cancelBubble=!0,this}function Xf(o){return Kf(o,"wheel",ss),this}function Wu(o){return ut(o,"mousedown touchstart dblclick contextmenu",ss),o._leaflet_disable_click=!0,this}function er(o){return o.preventDefault?o.preventDefault():o.returnValue=!1,this}function ls(o){return er(o),ss(o),this}function z7(o){if(o.composedPath)return o.composedPath();for(var l=[],f=o.target;f;)l.push(f),f=f.parentNode;return l}function j7(o,l){if(!l)return new W(o.clientX,o.clientY);var f=Gf(l),w=f.boundingClientRect;return new W((o.clientX-w.left)/f.x-l.clientLeft,(o.clientY-w.top)/f.y-l.clientTop)}var oM=qe.linux&&qe.chrome?window.devicePixelRatio:qe.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function U7(o){return qe.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/oM:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function Jf(o,l){var f=l.relatedTarget;if(!f)return!0;try{for(;f&&f!==o;)f=f.parentNode}catch{return!1}return f!==o}var iM={__proto__:null,on:ut,off:Ht,stopPropagation:ss,disableScrollPropagation:Xf,disableClickPropagation:Wu,preventDefault:er,stop:ls,getPropagationPath:z7,getMousePosition:j7,getWheelDelta:U7,isExternalTarget:Jf,addListener:ut,removeListener:Ht},Z7=X.extend({run:function(o,l,f,w){this.stop(),this._el=o,this._inProgress=!0,this._duration=f||.25,this._easeOutPower=1/Math.max(w||.5,.2),this._startPos=is(o),this._offset=l.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=B(this._animate,this),this._step()},_step:function(o){var l=+new Date-this._startTime,f=this._duration*1e3;l<f?this._runFrame(this._easeOut(l/f),o):(this._runFrame(1),this._complete())},_runFrame:function(o,l){var f=this._startPos.add(this._offset.multiplyBy(o));l&&f._round(),bn(this._el,f),this.fire("step")},_complete:function(){z(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(o){return 1-Math.pow(1-o,this._easeOutPower)}}),bt=X.extend({options:{crs:D,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(o,l){l=g(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(o),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(ne(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=zu&&qe.any3d&&!qe.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ut(this._proxy,H7,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(o,l,f){if(l=l===void 0?this._zoom:this._limitZoom(l),o=this._limitCenter(ne(o),l,this.options.maxBounds),f=f||{},this._stop(),this._loaded&&!f.reset&&f!==!0){f.animate!==void 0&&(f.zoom=n({animate:f.animate},f.zoom),f.pan=n({animate:f.animate,duration:f.duration},f.pan));var w=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(o,l,f.zoom):this._tryAnimatedPan(o,f.pan);if(w)return clearTimeout(this._sizeTimer),this}return this._resetView(o,l,f.pan&&f.pan.noMoveStart),this},setZoom:function(o,l){return this._loaded?this.setView(this.getCenter(),o,{zoom:l}):(this._zoom=o,this)},zoomIn:function(o,l){return o=o||(qe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+o,l)},zoomOut:function(o,l){return o=o||(qe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-o,l)},setZoomAround:function(o,l,f){var w=this.getZoomScale(l),k=this.getSize().divideBy(2),E=o instanceof W?o:this.latLngToContainerPoint(o),F=E.subtract(k).multiplyBy(1-1/w),Y=this.containerPointToLatLng(k.add(F));return this.setView(Y,l,{zoom:f})},_getBoundsCenterZoom:function(o,l){l=l||{},o=o.getBounds?o.getBounds():Ee(o);var f=J(l.paddingTopLeft||l.padding||[0,0]),w=J(l.paddingBottomRight||l.padding||[0,0]),k=this.getBoundsZoom(o,!1,f.add(w));if(k=typeof l.maxZoom=="number"?Math.min(l.maxZoom,k):k,k===1/0)return{center:o.getCenter(),zoom:k};var E=w.subtract(f).divideBy(2),F=this.project(o.getSouthWest(),k),Y=this.project(o.getNorthEast(),k),ee=this.unproject(F.add(Y).divideBy(2).add(E),k);return{center:ee,zoom:k}},fitBounds:function(o,l){if(o=Ee(o),!o.isValid())throw new Error("Bounds are not valid.");var f=this._getBoundsCenterZoom(o,l);return this.setView(f.center,f.zoom,l)},fitWorld:function(o){return this.fitBounds([[-90,-180],[90,180]],o)},panTo:function(o,l){return this.setView(o,this._zoom,{pan:l})},panBy:function(o,l){if(o=J(o).round(),l=l||{},!o.x&&!o.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(o))return this._resetView(this.unproject(this.project(this.getCenter()).add(o)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Z7,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){ft(this._mapPane,"leaflet-pan-anim");var f=this._getMapPanePos().subtract(o).round();this._panAnim.run(this._mapPane,f,l.duration||.25,l.easeLinearity)}else this._rawPanBy(o),this.fire("move").fire("moveend");return this},flyTo:function(o,l,f){if(f=f||{},f.animate===!1||!qe.any3d)return this.setView(o,l,f);this._stop();var w=this.project(this.getCenter()),k=this.project(o),E=this.getSize(),F=this._zoom;o=ne(o),l=l===void 0?F:l;var Y=Math.max(E.x,E.y),ee=Y*this.getZoomScale(F,l),me=k.distanceTo(w)||1,He=1.42,nt=He*He;function gt(_n){var Fd=_n?-1:1,qM=_n?ee:Y,KM=ee*ee-Y*Y+Fd*nt*nt*me*me,YM=2*qM*nt*me,up=KM/YM,S8=Math.sqrt(up*up+1)-up,XM=S8<1e-9?-18:Math.log(S8);return XM}function br(_n){return(Math.exp(_n)-Math.exp(-_n))/2}function zn(_n){return(Math.exp(_n)+Math.exp(-_n))/2}function ya(_n){return br(_n)/zn(_n)}var Dr=gt(0);function Sl(_n){return Y*(zn(Dr)/zn(Dr+He*_n))}function ZM(_n){return Y*(zn(Dr)*ya(Dr+He*_n)-br(Dr))/nt}function $M(_n){return 1-Math.pow(1-_n,1.5)}var WM=Date.now(),b8=(gt(1)-Dr)/He,GM=f.duration?1e3*f.duration:1e3*b8*.8;function _8(){var _n=(Date.now()-WM)/GM,Fd=$M(_n)*b8;_n<=1?(this._flyToFrame=B(_8,this),this._move(this.unproject(w.add(k.subtract(w).multiplyBy(ZM(Fd)/me)),F),this.getScaleZoom(Y/Sl(Fd),F),{flyTo:!0})):this._move(o,l)._moveEnd(!0)}return this._moveStart(!0,f.noMoveStart),_8.call(this),this},flyToBounds:function(o,l){var f=this._getBoundsCenterZoom(o,l);return this.flyTo(f.center,f.zoom,l)},setMaxBounds:function(o){return o=Ee(o),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),o.isValid()?(this.options.maxBounds=o,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(o){var l=this.options.minZoom;return this.options.minZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(o):this},setMaxZoom:function(o){var l=this.options.maxZoom;return this.options.maxZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,l){this._enforcingBounds=!0;var f=this.getCenter(),w=this._limitCenter(f,this._zoom,Ee(o));return f.equals(w)||this.panTo(w,l),this._enforcingBounds=!1,this},panInside:function(o,l){l=l||{};var f=J(l.paddingTopLeft||l.padding||[0,0]),w=J(l.paddingBottomRight||l.padding||[0,0]),k=this.project(this.getCenter()),E=this.project(o),F=this.getPixelBounds(),Y=M([F.min.add(f),F.max.subtract(w)]),ee=Y.getSize();if(!Y.contains(E)){this._enforcingBounds=!0;var me=E.subtract(Y.getCenter()),He=Y.extend(E).getSize().subtract(ee);k.x+=me.x<0?-He.x:He.x,k.y+=me.y<0?-He.y:He.y,this.panTo(this.unproject(k),l),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=n({animate:!1,pan:!0},o===!0?{animate:!0}:o);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var f=this.getSize(),w=l.divideBy(2).round(),k=f.divideBy(2).round(),E=w.subtract(k);return!E.x&&!E.y?this:(o.animate&&o.pan?this.panBy(E):(o.pan&&this._rawPanBy(E),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:f}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=n({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),f=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,f,o):navigator.geolocation.getCurrentPosition(l,f,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var l=o.code,f=o.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+f+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var l=o.coords.latitude,f=o.coords.longitude,w=new I(l,f),k=w.toBounds(o.coords.accuracy*2),E=this._locateOptions;if(E.setView){var F=this.getBoundsZoom(k);this.setView(w,E.maxZoom?Math.min(F,E.maxZoom):F)}var Y={latlng:w,bounds:k,timestamp:o.timestamp};for(var ee in o.coords)typeof o.coords[ee]=="number"&&(Y[ee]=o.coords[ee]);this.fire("locationfound",Y)}},addHandler:function(o,l){if(!l)return this;var f=this[o]=new l(this);return this._handlers.push(f),this.options[o]&&f.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),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{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(z(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)Qt(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,l){var f="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),w=Nt("div",f,l||this._mapPane);return o&&(this._panes[o]=w),w},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),l=this.unproject(o.getBottomLeft()),f=this.unproject(o.getTopRight());return new ve(l,f)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,l,f){o=Ee(o),f=J(f||[0,0]);var w=this.getZoom()||0,k=this.getMinZoom(),E=this.getMaxZoom(),F=o.getNorthWest(),Y=o.getSouthEast(),ee=this.getSize().subtract(f),me=M(this.project(Y,w),this.project(F,w)).getSize(),He=qe.any3d?this.options.zoomSnap:1,nt=ee.x/me.x,gt=ee.y/me.y,br=l?Math.max(nt,gt):Math.min(nt,gt);return w=this.getScaleZoom(br,w),He&&(w=Math.round(w/(He/100))*(He/100),w=l?Math.ceil(w/He)*He:Math.floor(w/He)*He),Math.max(k,Math.min(E,w))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,l){var f=this._getTopLeftPoint(o,l);return new K(f,f.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,l){var f=this.options.crs;return l=l===void 0?this._zoom:l,f.scale(o)/f.scale(l)},getScaleZoom:function(o,l){var f=this.options.crs;l=l===void 0?this._zoom:l;var w=f.zoom(o*f.scale(l));return isNaN(w)?1/0:w},project:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(ne(o),l)},unproject:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(J(o),l)},layerPointToLatLng:function(o){var l=J(o).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(o){var l=this.project(ne(o))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(ne(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds(Ee(o))},distance:function(o,l){return this.options.crs.distance(ne(o),ne(l))},containerPointToLayerPoint:function(o){return J(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return J(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var l=this.containerPointToLayerPoint(J(o));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ne(o)))},mouseEventToContainerPoint:function(o){return j7(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var l=this._container=B7(o);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ut(l,"scroll",this._onScroll,this),this._containerId=s(l)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&qe.any3d,ft(o,"leaflet-container"+(qe.touch?" leaflet-touch":"")+(qe.retina?" leaflet-retina":"")+(qe.ielt9?" leaflet-oldie":"")+(qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=ju(o,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),bn(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ft(o.markerPane,"leaflet-zoom-hide"),ft(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,l,f){bn(this._mapPane,new W(0,0));var w=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var k=this._zoom!==l;this._moveStart(k,f)._move(o,l)._moveEnd(k),this.fire("viewreset"),w&&this.fire("load")},_moveStart:function(o,l){return o&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(o,l,f,w){l===void 0&&(l=this._zoom);var k=this._zoom!==l;return this._zoom=l,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),w?f&&f.pinch&&this.fire("zoom",f):((k||f&&f.pinch)&&this.fire("zoom",f),this.fire("move",f)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return z(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){bn(this._mapPane,this._getMapPanePos().subtract(o))},_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(o){this._targets={},this._targets[s(this._container)]=this;var l=o?Ht:ut;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),qe.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){z(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,l){for(var f=[],w,k=l==="mouseout"||l==="mouseover",E=o.target||o.srcElement,F=!1;E;){if(w=this._targets[s(E)],w&&(l==="click"||l==="preclick")&&this._draggableMoved(w)){F=!0;break}if(w&&w.listens(l,!0)&&(k&&!Jf(E,o)||(f.push(w),k))||E===this._container)break;E=E.parentNode}return!f.length&&!F&&!k&&this.listens(l,!0)&&(f=[this]),f},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var l=o.target||o.srcElement;if(!(!this._loaded||l._leaflet_disable_events||o.type==="click"&&this._isClickDisabled(l))){var f=o.type;f==="mousedown"&&Wf(l),this._fireDOMEvent(o,f)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,l,f){if(o.type==="click"){var w=n({},o);w.type="preclick",this._fireDOMEvent(w,w.type,f)}var k=this._findEventTargets(o,l);if(f){for(var E=[],F=0;F<f.length;F++)f[F].listens(l,!0)&&E.push(f[F]);k=E.concat(k)}if(k.length){l==="contextmenu"&&er(o);var Y=k[0],ee={originalEvent:o};if(o.type!=="keypress"&&o.type!=="keydown"&&o.type!=="keyup"){var me=Y.getLatLng&&(!Y._radius||Y._radius<=10);ee.containerPoint=me?this.latLngToContainerPoint(Y.getLatLng()):this.mouseEventToContainerPoint(o),ee.layerPoint=this.containerPointToLayerPoint(ee.containerPoint),ee.latlng=me?Y.getLatLng():this.layerPointToLatLng(ee.layerPoint)}for(F=0;F<k.length;F++)if(k[F].fire(l,ee,!0),ee.originalEvent._stopped||k[F].options.bubblingMouseEvents===!1&&x(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(o){return o=o.dragging&&o.dragging.enabled()?o:this,o.dragging&&o.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var o=0,l=this._handlers.length;o<l;o++)this._handlers[o].disable()},whenReady:function(o,l){return this._loaded?o.call(l||this,{target:this}):this.on("load",o,l),this},_getMapPanePos:function(){return is(this._mapPane)||new W(0,0)},_moved:function(){var o=this._getMapPanePos();return o&&!o.equals([0,0])},_getTopLeftPoint:function(o,l){var f=o&&l!==void 0?this._getNewPixelOrigin(o,l):this.getPixelOrigin();return f.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(o,l){var f=this.getSize()._divideBy(2);return this.project(o,l)._subtract(f)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(o,l,f){var w=this._getNewPixelOrigin(f,l);return this.project(o,l)._subtract(w)},_latLngBoundsToNewLayerBounds:function(o,l,f){var w=this._getNewPixelOrigin(f,l);return M([this.project(o.getSouthWest(),l)._subtract(w),this.project(o.getNorthWest(),l)._subtract(w),this.project(o.getSouthEast(),l)._subtract(w),this.project(o.getNorthEast(),l)._subtract(w)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(o){return this.latLngToLayerPoint(o).subtract(this._getCenterLayerPoint())},_limitCenter:function(o,l,f){if(!f)return o;var w=this.project(o,l),k=this.getSize().divideBy(2),E=new K(w.subtract(k),w.add(k)),F=this._getBoundsOffset(E,f,l);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?o:this.unproject(w.add(F),l)},_limitOffset:function(o,l){if(!l)return o;var f=this.getPixelBounds(),w=new K(f.min.add(o),f.max.add(o));return o.add(this._getBoundsOffset(w,l))},_getBoundsOffset:function(o,l,f){var w=M(this.project(l.getNorthEast(),f),this.project(l.getSouthWest(),f)),k=w.min.subtract(o.min),E=w.max.subtract(o.max),F=this._rebound(k.x,-E.x),Y=this._rebound(k.y,-E.y);return new W(F,Y)},_rebound:function(o,l){return o+l>0?Math.round(o-l)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(l))},_limitZoom:function(o){var l=this.getMinZoom(),f=this.getMaxZoom(),w=qe.any3d?this.options.zoomSnap:1;return w&&(o=Math.round(o/w)*w),Math.max(l,Math.min(f,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){cn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,l){var f=this._getCenterOffset(o)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(f)?!1:(this.panBy(f,l),!0)},_createAnimProxy:function(){var o=this._proxy=Nt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(l){var f=Ff,w=this._proxy.style[f];os(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),w===this._proxy.style[f]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),l=this.getZoom();os(this._proxy,this.project(o,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,l,f){if(this._animatingZoom)return!0;if(f=f||{},!this._zoomAnimated||f.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var w=this.getZoomScale(l),k=this._getCenterOffset(o)._divideBy(1-1/w);return f.animate!==!0&&!this.getSize().contains(k)?!1:(B(function(){this._moveStart(!0,f.noMoveStart||!1)._animateZoom(o,l,!0)},this),!0)},_animateZoom:function(o,l,f,w){this._mapPane&&(f&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=l,ft(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:l,noUpdate:w}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&cn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function sM(o,l){return new bt(o,l)}var Fa=H.extend({options:{position:"topright"},initialize:function(o){g(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var l=this._map;return l&&l.removeControl(this),this.options.position=o,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var l=this._container=this.onAdd(o),f=this.getPosition(),w=o._controlCorners[f];return ft(l,"leaflet-control"),f.indexOf("bottom")!==-1?w.insertBefore(l,w.firstChild):w.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),Gu=function(o){return new Fa(o)};bt.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},l="leaflet-",f=this._controlContainer=Nt("div",l+"control-container",this._container);function w(k,E){var F=l+k+" "+l+E;o[k+E]=Nt("div",F,f)}w("top","left"),w("top","right"),w("bottom","left"),w("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)Qt(this._controlCorners[o]);Qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $7=Fa.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,l,f,w){return f<w?-1:w<f?1:0}},initialize:function(o,l,f){g(this,f),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var w in o)this._addLayer(o[w],w);for(w in l)this._addLayer(l[w],w,!0)},onAdd:function(o){this._initLayout(),this._update(),this._map=o,o.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(o){return Fa.prototype.addTo.call(this,o),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(o,l){return this._addLayer(o,l),this._map?this._update():this},addOverlay:function(o,l){return this._addLayer(o,l,!0),this._map?this._update():this},removeLayer:function(o){o.off("add remove",this._onLayerChange,this);var l=this._getLayer(s(o));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){ft(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var o=this._map.getSize().y-(this._container.offsetTop+50);return o<this._section.clientHeight?(ft(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=o+"px"):cn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return cn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var o="leaflet-control-layers",l=this._container=Nt("div",o),f=this.options.collapsed;l.setAttribute("aria-haspopup",!0),Wu(l),Xf(l);var w=this._section=Nt("section",o+"-list");f&&(this._map.on("click",this.collapse,this),ut(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var k=this._layersLink=Nt("a",o+"-toggle",l);k.href="#",k.title="Layers",k.setAttribute("role","button"),ut(k,{keydown:function(E){E.keyCode===13&&this._expandSafely()},click:function(E){er(E),this._expandSafely()}},this),f||this.expand(),this._baseLayersList=Nt("div",o+"-base",w),this._separator=Nt("div",o+"-separator",w),this._overlaysList=Nt("div",o+"-overlays",w),l.appendChild(w)},_getLayer:function(o){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&s(this._layers[l].layer)===o)return this._layers[l]},_addLayer:function(o,l,f){this._map&&o.on("add remove",this._onLayerChange,this),this._layers.push({layer:o,name:l,overlay:f}),this.options.sortLayers&&this._layers.sort(a(function(w,k){return this.options.sortFunction(w.layer,k.layer,w.name,k.name)},this)),this.options.autoZIndex&&o.setZIndex&&(this._lastZIndex++,o.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;_d(this._baseLayersList),_d(this._overlaysList),this._layerControlInputs=[];var o,l,f,w,k=0;for(f=0;f<this._layers.length;f++)w=this._layers[f],this._addItem(w),l=l||w.overlay,o=o||!w.overlay,k+=w.overlay?0:1;return this.options.hideSingleBase&&(o=o&&k>1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=l&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var l=this._getLayer(s(o.target)),f=l.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;f&&this._map.fire(f,l)},_createRadioElement:function(o,l){var f='<input type="radio" class="leaflet-control-layers-selector" name="'+o+'"'+(l?' checked="checked"':"")+"/>",w=document.createElement("div");return w.innerHTML=f,w.firstChild},_addItem:function(o){var l=document.createElement("label"),f=this._map.hasLayer(o.layer),w;o.overlay?(w=document.createElement("input"),w.type="checkbox",w.className="leaflet-control-layers-selector",w.defaultChecked=f):w=this._createRadioElement("leaflet-base-layers_"+s(this),f),this._layerControlInputs.push(w),w.layerId=s(o.layer),ut(w,"click",this._onInputClick,this);var k=document.createElement("span");k.innerHTML=" "+o.name;var E=document.createElement("span");l.appendChild(E),E.appendChild(w),E.appendChild(k);var F=o.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,l,f,w=[],k=[];this._handlingClick=!0;for(var E=o.length-1;E>=0;E--)l=o[E],f=this._getLayer(l.layerId).layer,l.checked?w.push(f):l.checked||k.push(f);for(E=0;E<k.length;E++)this._map.hasLayer(k[E])&&this._map.removeLayer(k[E]);for(E=0;E<w.length;E++)this._map.hasLayer(w[E])||this._map.addLayer(w[E]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var o=this._layerControlInputs,l,f,w=this._map.getZoom(),k=o.length-1;k>=0;k--)l=o[k],f=this._getLayer(l.layerId).layer,l.disabled=f.options.minZoom!==void 0&&w<f.options.minZoom||f.options.maxZoom!==void 0&&w>f.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,ut(o,"click",er),this.expand();var l=this;setTimeout(function(){Ht(o,"click",er),l._preventClick=!1})}}),lM=function(o,l,f){return new $7(o,l,f)},Qf=Fa.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(o){var l="leaflet-control-zoom",f=Nt("div",l+" leaflet-bar"),w=this.options;return this._zoomInButton=this._createButton(w.zoomInText,w.zoomInTitle,l+"-in",f,this._zoomIn),this._zoomOutButton=this._createButton(w.zoomOutText,w.zoomOutTitle,l+"-out",f,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),f},onRemove:function(o){o.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(o){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(o.shiftKey?3:1))},_zoomOut:function(o){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,l,f,w,k){var E=Nt("a",f,w);return E.innerHTML=o,E.href="#",E.title=l,E.setAttribute("role","button"),E.setAttribute("aria-label",l),Wu(E),ut(E,"click",ls),ut(E,"click",k,this),ut(E,"click",this._refocusOnMap,this),E},_updateDisabled:function(){var o=this._map,l="leaflet-disabled";cn(this._zoomInButton,l),cn(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(ft(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(ft(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});bt.mergeOptions({zoomControl:!0}),bt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Qf,this.addControl(this.zoomControl))});var uM=function(o){return new Qf(o)},W7=Fa.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var l="leaflet-control-scale",f=Nt("div",l),w=this.options;return this._addScales(w,l+"-line",f),o.on(w.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),f},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,l,f){o.metric&&(this._mScale=Nt("div",l,f)),o.imperial&&(this._iScale=Nt("div",l,f))},_update:function(){var o=this._map,l=o.getSize().y/2,f=o.distance(o.containerPointToLatLng([0,l]),o.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(f)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var l=this._getRoundNum(o),f=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,f,l/o)},_updateImperial:function(o){var l=o*3.2808399,f,w,k;l>5280?(f=l/5280,w=this._getRoundNum(f),this._updateScale(this._iScale,w+" mi",w/f)):(k=this._getRoundNum(l),this._updateScale(this._iScale,k+" ft",k/l))},_updateScale:function(o,l,f){o.style.width=Math.round(this.options.maxWidth*f)+"px",o.innerHTML=l},_getRoundNum:function(o){var l=Math.pow(10,(Math.floor(o)+"").length-1),f=o/l;return f=f>=10?10:f>=5?5:f>=3?3:f>=2?2:1,l*f}}),cM=function(o){return new W7(o)},dM='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',ep=Fa.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(qe.inlineSvg?dM+" ":"")+"Leaflet</a>"},initialize:function(o){g(this,o),this._attributions={}},onAdd:function(o){o.attributionControl=this,this._container=Nt("div","leaflet-control-attribution"),Wu(this._container);for(var l in o._layers)o._layers[l].getAttribution&&this.addAttribution(o._layers[l].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var l in this._attributions)this._attributions[l]&&o.push(l);var f=[];this.options.prefix&&f.push(this.options.prefix),o.length&&f.push(o.join(", ")),this._container.innerHTML=f.join(' <span aria-hidden="true">|</span> ')}}});bt.mergeOptions({attributionControl:!0}),bt.addInitHook(function(){this.options.attributionControl&&new ep().addTo(this)});var fM=function(o){return new ep(o)};Fa.Layers=$7,Fa.Zoom=Qf,Fa.Scale=W7,Fa.Attribution=ep,Gu.layers=lM,Gu.zoom=uM,Gu.scale=cM,Gu.attribution=fM;var co=H.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});co.addTo=function(o,l){return o.addHandler(l,this),this};var pM={Events:$},G7=qe.touch?"touchstart mousedown":"mousedown",ii=X.extend({options:{clickTolerance:3},initialize:function(o,l,f,w){g(this,w),this._element=o,this._dragStartTarget=l||o,this._preventOutline=f},enable:function(){this._enabled||(ut(this._dragStartTarget,G7,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ii._dragging===this&&this.finishDrag(!0),Ht(this._dragStartTarget,G7,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!Vf(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){ii._dragging===this&&this.finishDrag();return}if(!(ii._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(ii._dragging=this,this._preventOutline&&Wf(this._element),Uf(),Uu(),!this._moving)){this.fire("down");var l=o.touches?o.touches[0]:o,f=F7(this._element);this._startPoint=new W(l.clientX,l.clientY),this._startPos=is(this._element),this._parentScale=Gf(f);var w=o.type==="mousedown";ut(document,w?"mousemove":"touchmove",this._onMove,this),ut(document,w?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var l=o.touches&&o.touches.length===1?o.touches[0]:o,f=new W(l.clientX,l.clientY)._subtract(this._startPoint);!f.x&&!f.y||Math.abs(f.x)+Math.abs(f.y)<this.options.clickTolerance||(f.x/=this._parentScale.x,f.y/=this._parentScale.y,er(o),this._moved||(this.fire("dragstart"),this._moved=!0,ft(document.body,"leaflet-dragging"),this._lastTarget=o.target||o.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ft(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(f),this._moving=!0,this._lastEvent=o,this._updatePosition())}},_updatePosition:function(){var o={originalEvent:this._lastEvent};this.fire("predrag",o),bn(this._element,this._newPos),this.fire("drag",o)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(o){cn(document.body,"leaflet-dragging"),this._lastTarget&&(cn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ht(document,"mousemove touchmove",this._onMove,this),Ht(document,"mouseup touchend touchcancel",this._onUp,this),Zf(),Zu();var l=this._moved&&this._moving;this._moving=!1,ii._dragging=!1,l&&this.fire("dragend",{noInertia:o,distance:this._newPos.distanceTo(this._startPos)})}});function q7(o,l,f){var w,k=[1,4,2,8],E,F,Y,ee,me,He,nt,gt;for(E=0,He=o.length;E<He;E++)o[E]._code=us(o[E],l);for(Y=0;Y<4;Y++){for(nt=k[Y],w=[],E=0,He=o.length,F=He-1;E<He;F=E++)ee=o[E],me=o[F],ee._code&nt?me._code&nt||(gt=Ed(me,ee,nt,l,f),gt._code=us(gt,l),w.push(gt)):(me._code&nt&&(gt=Ed(me,ee,nt,l,f),gt._code=us(gt,l),w.push(gt)),w.push(ee));o=w}return o}function K7(o,l){var f,w,k,E,F,Y,ee,me,He;if(!o||o.length===0)throw new Error("latlngs not passed");va(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var nt=ne([0,0]),gt=Ee(o),br=gt.getNorthWest().distanceTo(gt.getSouthWest())*gt.getNorthEast().distanceTo(gt.getNorthWest());br<1700&&(nt=tp(o));var zn=o.length,ya=[];for(f=0;f<zn;f++){var Dr=ne(o[f]);ya.push(l.project(ne([Dr.lat-nt.lat,Dr.lng-nt.lng])))}for(Y=ee=me=0,f=0,w=zn-1;f<zn;w=f++)k=ya[f],E=ya[w],F=k.y*E.x-E.y*k.x,ee+=(k.x+E.x)*F,me+=(k.y+E.y)*F,Y+=F*3;Y===0?He=ya[0]:He=[ee/Y,me/Y];var Sl=l.unproject(J(He));return ne([Sl.lat+nt.lat,Sl.lng+nt.lng])}function tp(o){for(var l=0,f=0,w=0,k=0;k<o.length;k++){var E=ne(o[k]);l+=E.lat,f+=E.lng,w++}return ne([l/w,f/w])}var hM={__proto__:null,clipPolygon:q7,polygonCenter:K7,centroid:tp};function Y7(o,l){if(!l||!o.length)return o.slice();var f=l*l;return o=vM(o,f),o=gM(o,f),o}function X7(o,l,f){return Math.sqrt(qu(o,l,f,!0))}function mM(o,l,f){return qu(o,l,f)}function gM(o,l){var f=o.length,w=typeof Uint8Array<"u"?Uint8Array:Array,k=new w(f);k[0]=k[f-1]=1,np(o,k,l,0,f-1);var E,F=[];for(E=0;E<f;E++)k[E]&&F.push(o[E]);return F}function np(o,l,f,w,k){var E=0,F,Y,ee;for(Y=w+1;Y<=k-1;Y++)ee=qu(o[Y],o[w],o[k],!0),ee>E&&(F=Y,E=ee);E>f&&(l[F]=1,np(o,l,f,w,F),np(o,l,f,F,k))}function vM(o,l){for(var f=[o[0]],w=1,k=0,E=o.length;w<E;w++)yM(o[w],o[k])>l&&(f.push(o[w]),k=w);return k<E-1&&f.push(o[E-1]),f}var J7;function Q7(o,l,f,w,k){var E=w?J7:us(o,f),F=us(l,f),Y,ee,me;for(J7=F;;){if(!(E|F))return[o,l];if(E&F)return!1;Y=E||F,ee=Ed(o,l,Y,f,k),me=us(ee,f),Y===E?(o=ee,E=me):(l=ee,F=me)}}function Ed(o,l,f,w,k){var E=l.x-o.x,F=l.y-o.y,Y=w.min,ee=w.max,me,He;return f&8?(me=o.x+E*(ee.y-o.y)/F,He=ee.y):f&4?(me=o.x+E*(Y.y-o.y)/F,He=Y.y):f&2?(me=ee.x,He=o.y+F*(ee.x-o.x)/E):f&1&&(me=Y.x,He=o.y+F*(Y.x-o.x)/E),new W(me,He,k)}function us(o,l){var f=0;return o.x<l.min.x?f|=1:o.x>l.max.x&&(f|=2),o.y<l.min.y?f|=4:o.y>l.max.y&&(f|=8),f}function yM(o,l){var f=l.x-o.x,w=l.y-o.y;return f*f+w*w}function qu(o,l,f,w){var k=l.x,E=l.y,F=f.x-k,Y=f.y-E,ee=F*F+Y*Y,me;return ee>0&&(me=((o.x-k)*F+(o.y-E)*Y)/ee,me>1?(k=f.x,E=f.y):me>0&&(k+=F*me,E+=Y*me)),F=o.x-k,Y=o.y-E,w?F*F+Y*Y:new W(k,E)}function va(o){return!v(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function e8(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),va(o)}function t8(o,l){var f,w,k,E,F,Y,ee,me;if(!o||o.length===0)throw new Error("latlngs not passed");va(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var He=ne([0,0]),nt=Ee(o),gt=nt.getNorthWest().distanceTo(nt.getSouthWest())*nt.getNorthEast().distanceTo(nt.getNorthWest());gt<1700&&(He=tp(o));var br=o.length,zn=[];for(f=0;f<br;f++){var ya=ne(o[f]);zn.push(l.project(ne([ya.lat-He.lat,ya.lng-He.lng])))}for(f=0,w=0;f<br-1;f++)w+=zn[f].distanceTo(zn[f+1])/2;if(w===0)me=zn[0];else for(f=0,E=0;f<br-1;f++)if(F=zn[f],Y=zn[f+1],k=F.distanceTo(Y),E+=k,E>w){ee=(E-w)/k,me=[Y.x-ee*(Y.x-F.x),Y.y-ee*(Y.y-F.y)];break}var Dr=l.unproject(J(me));return ne([Dr.lat+He.lat,Dr.lng+He.lng])}var CM={__proto__:null,simplify:Y7,pointToSegmentDistance:X7,closestPointOnSegment:mM,clipSegment:Q7,_getEdgeIntersection:Ed,_getBitCode:us,_sqClosestPointOnSegment:qu,isFlat:va,_flat:e8,polylineCenter:t8},rp={project:function(o){return new W(o.lng,o.lat)},unproject:function(o){return new I(o.y,o.x)},bounds:new K([-180,-90],[180,90])},ap={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var l=Math.PI/180,f=this.R,w=o.lat*l,k=this.R_MINOR/f,E=Math.sqrt(1-k*k),F=E*Math.sin(w),Y=Math.tan(Math.PI/4-w/2)/Math.pow((1-F)/(1+F),E/2);return w=-f*Math.log(Math.max(Y,1e-10)),new W(o.lng*l*f,w)},unproject:function(o){for(var l=180/Math.PI,f=this.R,w=this.R_MINOR/f,k=Math.sqrt(1-w*w),E=Math.exp(-o.y/f),F=Math.PI/2-2*Math.atan(E),Y=0,ee=.1,me;Y<15&&Math.abs(ee)>1e-7;Y++)me=k*Math.sin(F),me=Math.pow((1-me)/(1+me),k/2),ee=Math.PI/2-2*Math.atan(E*me)-F,F+=ee;return new I(F*l,o.x*l/f)}},wM={__proto__:null,LonLat:rp,Mercator:ap,SphericalMercator:de},xM=n({},ye,{code:"EPSG:3395",projection:ap,transformation:(function(){var o=.5/(Math.PI*ap.R);return Ne(o,.5,-o,.5)})()}),n8=n({},ye,{code:"EPSG:4326",projection:rp,transformation:Ne(1/180,1,-1/180,.5)}),bM=n({},ze,{projection:rp,transformation:Ne(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,l){var f=l.lng-o.lng,w=l.lat-o.lat;return Math.sqrt(f*f+w*w)},infinite:!0});ze.Earth=ye,ze.EPSG3395=xM,ze.EPSG3857=D,ze.EPSG900913=te,ze.EPSG4326=n8,ze.Simple=bM;var Va=X.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[s(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[s(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var l=o.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var f=this.getEvents();l.on(f,this),this.once("remove",function(){l.off(f,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});bt.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var l=s(o);return this._layers[l]?this:(this._layers[l]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var l=s(o);return this._layers[l]?(this._loaded&&o.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return s(o)in this._layers},eachLayer:function(o,l){for(var f in this._layers)o.call(l,this._layers[f]);return this},_addLayers:function(o){o=o?v(o)?o:[o]:[];for(var l=0,f=o.length;l<f;l++)this.addLayer(o[l])},_addZoomLimit:function(o){(!isNaN(o.options.maxZoom)||!isNaN(o.options.minZoom))&&(this._zoomBoundLayers[s(o)]=o,this._updateZoomLevels())},_removeZoomLimit:function(o){var l=s(o);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var o=1/0,l=-1/0,f=this._getZoomSpan();for(var w in this._zoomBoundLayers){var k=this._zoomBoundLayers[w].options;o=k.minZoom===void 0?o:Math.min(o,k.minZoom),l=k.maxZoom===void 0?l:Math.max(l,k.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=o===1/0?void 0:o,f!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Cl=Va.extend({initialize:function(o,l){g(this,l),this._layers={};var f,w;if(o)for(f=0,w=o.length;f<w;f++)this.addLayer(o[f])},addLayer:function(o){var l=this.getLayerId(o);return this._layers[l]=o,this._map&&this._map.addLayer(o),this},removeLayer:function(o){var l=o in this._layers?o:this.getLayerId(o);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(o){var l=typeof o=="number"?o:this.getLayerId(o);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(o){var l=Array.prototype.slice.call(arguments,1),f,w;for(f in this._layers)w=this._layers[f],w[o]&&w[o].apply(w,l);return this},onAdd:function(o){this.eachLayer(o.addLayer,o)},onRemove:function(o){this.eachLayer(o.removeLayer,o)},eachLayer:function(o,l){for(var f in this._layers)o.call(l,this._layers[f]);return this},getLayer:function(o){return this._layers[o]},getLayers:function(){var o=[];return this.eachLayer(o.push,o),o},setZIndex:function(o){return this.invoke("setZIndex",o)},getLayerId:function(o){return s(o)}}),_M=function(o,l){return new Cl(o,l)},No=Cl.extend({addLayer:function(o){return this.hasLayer(o)?this:(o.addEventParent(this),Cl.prototype.addLayer.call(this,o),this.fire("layeradd",{layer:o}))},removeLayer:function(o){return this.hasLayer(o)?(o in this._layers&&(o=this._layers[o]),o.removeEventParent(this),Cl.prototype.removeLayer.call(this,o),this.fire("layerremove",{layer:o})):this},setStyle:function(o){return this.invoke("setStyle",o)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var o=new ve;for(var l in this._layers){var f=this._layers[l];o.extend(f.getBounds?f.getBounds():f.getLatLng())}return o}}),SM=function(o,l){return new No(o,l)},wl=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(o){g(this,o)},createIcon:function(o){return this._createIcon("icon",o)},createShadow:function(o){return this._createIcon("shadow",o)},_createIcon:function(o,l){var f=this._getIconUrl(o);if(!f){if(o==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var w=this._createImg(f,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(w,o),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),w},_setIconStyles:function(o,l){var f=this.options,w=f[l+"Size"];typeof w=="number"&&(w=[w,w]);var k=J(w),E=J(l==="shadow"&&f.shadowAnchor||f.iconAnchor||k&&k.divideBy(2,!0));o.className="leaflet-marker-"+l+" "+(f.className||""),E&&(o.style.marginLeft=-E.x+"px",o.style.marginTop=-E.y+"px"),k&&(o.style.width=k.x+"px",o.style.height=k.y+"px")},_createImg:function(o,l){return l=l||document.createElement("img"),l.src=o,l},_getIconUrl:function(o){return qe.retina&&this.options[o+"RetinaUrl"]||this.options[o+"Url"]}});function kM(o){return new wl(o)}var Ku=wl.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(o){return typeof Ku.imagePath!="string"&&(Ku.imagePath=this._detectIconPath()),(this.options.imagePath||Ku.imagePath)+wl.prototype._getIconUrl.call(this,o)},_stripUrl:function(o){var l=function(f,w,k){var E=w.exec(f);return E&&E[k]};return o=l(o,/^url\((['"])?(.+)\1\)$/,2),o&&l(o,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var o=Nt("div","leaflet-default-icon-path",document.body),l=ju(o,"background-image")||ju(o,"backgroundImage");if(document.body.removeChild(o),l=this._stripUrl(l),l)return l;var f=document.querySelector('link[href$="leaflet.css"]');return f?f.href.substring(0,f.href.length-11-1):""}}),r8=co.extend({initialize:function(o){this._marker=o},addHooks:function(){var o=this._marker._icon;this._draggable||(this._draggable=new ii(o,o,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ft(o,"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&&cn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(o){var l=this._marker,f=l._map,w=this._marker.options.autoPanSpeed,k=this._marker.options.autoPanPadding,E=is(l._icon),F=f.getPixelBounds(),Y=f.getPixelOrigin(),ee=M(F.min._subtract(Y).add(k),F.max._subtract(Y).subtract(k));if(!ee.contains(E)){var me=J((Math.max(ee.max.x,E.x)-ee.max.x)/(F.max.x-ee.max.x)-(Math.min(ee.min.x,E.x)-ee.min.x)/(F.min.x-ee.min.x),(Math.max(ee.max.y,E.y)-ee.max.y)/(F.max.y-ee.max.y)-(Math.min(ee.min.y,E.y)-ee.min.y)/(F.min.y-ee.min.y)).multiplyBy(w);f.panBy(me,{animate:!1}),this._draggable._newPos._add(me),this._draggable._startPos._add(me),bn(l._icon,this._draggable._newPos),this._onDrag(o),this._panRequest=B(this._adjustPan.bind(this,o))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(o){this._marker.options.autoPan&&(z(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,o)))},_onDrag:function(o){var l=this._marker,f=l._shadow,w=is(l._icon),k=l._map.layerPointToLatLng(w);f&&bn(f,w),l._latlng=k,o.latlng=k,o.oldLatLng=this._oldLatLng,l.fire("move",o).fire("drag",o)},_onDragEnd:function(o){z(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",o)}}),Rd=Va.extend({options:{icon:new Ku,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(o,l){g(this,l),this._latlng=ne(o)},onAdd:function(o){this._zoomAnimated=this._zoomAnimated&&o.options.markerZoomAnimation,this._zoomAnimated&&o.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(o){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&o.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(o){var l=this._latlng;return this._latlng=ne(o),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(o){return this.options.zIndexOffset=o,this.update()},getIcon:function(){return this.options.icon},setIcon:function(o){return this.options.icon=o,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 o=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(o)}return this},_initIcon:function(){var o=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),f=o.icon.createIcon(this._icon),w=!1;f!==this._icon&&(this._icon&&this._removeIcon(),w=!0,o.title&&(f.title=o.title),f.tagName==="IMG"&&(f.alt=o.alt||"")),ft(f,l),o.keyboard&&(f.tabIndex="0",f.setAttribute("role","button")),this._icon=f,o.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ut(f,"focus",this._panOnFocus,this);var k=o.icon.createShadow(this._shadow),E=!1;k!==this._shadow&&(this._removeShadow(),E=!0),k&&(ft(k,l),k.alt=""),this._shadow=k,o.opacity<1&&this._updateOpacity(),w&&this.getPane().appendChild(this._icon),this._initInteraction(),k&&E&&this.getPane(o.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ht(this._icon,"focus",this._panOnFocus,this),Qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Qt(this._shadow),this._shadow=null},_setPos:function(o){this._icon&&bn(this._icon,o),this._shadow&&bn(this._shadow,o),this._zIndex=o.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(o){this._icon&&(this._icon.style.zIndex=this._zIndex+o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(ft(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),r8)){var o=this.options.draggable;this.dragging&&(o=this.dragging.enabled(),this.dragging.disable()),this.dragging=new r8(this),o&&this.dragging.enable()}},setOpacity:function(o){return this.options.opacity=o,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var o=this.options.opacity;this._icon&&ga(this._icon,o),this._shadow&&ga(this._shadow,o)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var o=this._map;if(o){var l=this.options.icon.options,f=l.iconSize?J(l.iconSize):J(0,0),w=l.iconAnchor?J(l.iconAnchor):J(0,0);o.panInside(this._latlng,{paddingTopLeft:w,paddingBottomRight:f.subtract(w)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function NM(o,l){return new Rd(o,l)}var si=Va.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(o){this._renderer=o.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(o){return g(this,o),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&o&&Object.prototype.hasOwnProperty.call(o,"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||0)}}),Td=si.extend({options:{fill:!0,radius:10},initialize:function(o,l){g(this,l),this._latlng=ne(o),this._radius=this.options.radius},setLatLng:function(o){var l=this._latlng;return this._latlng=ne(o),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(o){return this.options.radius=this._radius=o,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var l=o&&o.radius||this._radius;return si.prototype.setStyle.call(this,o),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var o=this._radius,l=this._radiusY||o,f=this._clickTolerance(),w=[o+f,l+f];this._pxBounds=new K(this._point.subtract(w),this._point.add(w))},_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(o){return o.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function PM(o,l){return new Td(o,l)}var op=Td.extend({initialize:function(o,l,f){if(typeof l=="number"&&(l=n({},f,{radius:l})),g(this,l),this._latlng=ne(o),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(o){return this._mRadius=o,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var o=[this._radius,this._radiusY||this._radius];return new ve(this._map.layerPointToLatLng(this._point.subtract(o)),this._map.layerPointToLatLng(this._point.add(o)))},setStyle:si.prototype.setStyle,_project:function(){var o=this._latlng.lng,l=this._latlng.lat,f=this._map,w=f.options.crs;if(w.distance===ye.distance){var k=Math.PI/180,E=this._mRadius/ye.R/k,F=f.project([l+E,o]),Y=f.project([l-E,o]),ee=F.add(Y).divideBy(2),me=f.unproject(ee).lat,He=Math.acos((Math.cos(E*k)-Math.sin(l*k)*Math.sin(me*k))/(Math.cos(l*k)*Math.cos(me*k)))/k;(isNaN(He)||He===0)&&(He=E/Math.cos(Math.PI/180*l)),this._point=ee.subtract(f.getPixelOrigin()),this._radius=isNaN(He)?0:ee.x-f.project([me,o-He]).x,this._radiusY=ee.y-F.y}else{var nt=w.unproject(w.project(this._latlng).subtract([this._mRadius,0]));this._point=f.latLngToLayerPoint(this._latlng),this._radius=this._point.x-f.latLngToLayerPoint(nt).x}this._updateBounds()}});function EM(o,l,f){return new op(o,l,f)}var Po=si.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,l){g(this,l),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(o){return this._setLatLngs(o),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(o){for(var l=1/0,f=null,w=qu,k,E,F=0,Y=this._parts.length;F<Y;F++)for(var ee=this._parts[F],me=1,He=ee.length;me<He;me++){k=ee[me-1],E=ee[me];var nt=w(o,k,E,!0);nt<l&&(l=nt,f=w(o,k,E))}return f&&(f.distance=Math.sqrt(l)),f},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return t8(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(o,l){return l=l||this._defaultShape(),o=ne(o),l.push(o),this._bounds.extend(o),this.redraw()},_setLatLngs:function(o){this._bounds=new ve,this._latlngs=this._convertLatLngs(o)},_defaultShape:function(){return va(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(o){for(var l=[],f=va(o),w=0,k=o.length;w<k;w++)f?(l[w]=ne(o[w]),this._bounds.extend(l[w])):l[w]=this._convertLatLngs(o[w]);return l},_project:function(){var o=new K;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,o),this._bounds.isValid()&&o.isValid()&&(this._rawPxBounds=o,this._updateBounds())},_updateBounds:function(){var o=this._clickTolerance(),l=new W(o,o);this._rawPxBounds&&(this._pxBounds=new K([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(o,l,f){var w=o[0]instanceof I,k=o.length,E,F;if(w){for(F=[],E=0;E<k;E++)F[E]=this._map.latLngToLayerPoint(o[E]),f.extend(F[E]);l.push(F)}else for(E=0;E<k;E++)this._projectLatlngs(o[E],l,f)},_clipPoints:function(){var o=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,f,w,k,E,F,Y,ee;for(f=0,k=0,E=this._rings.length;f<E;f++)for(ee=this._rings[f],w=0,F=ee.length;w<F-1;w++)Y=Q7(ee[w],ee[w+1],o,w,!0),Y&&(l[k]=l[k]||[],l[k].push(Y[0]),(Y[1]!==ee[w+1]||w===F-2)&&(l[k].push(Y[1]),k++))}},_simplifyPoints:function(){for(var o=this._parts,l=this.options.smoothFactor,f=0,w=o.length;f<w;f++)o[f]=Y7(o[f],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(o,l){var f,w,k,E,F,Y,ee=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(f=0,E=this._parts.length;f<E;f++)for(Y=this._parts[f],w=0,F=Y.length,k=F-1;w<F;k=w++)if(!(!l&&w===0)&&X7(o,Y[k],Y[w])<=ee)return!0;return!1}});function RM(o,l){return new Po(o,l)}Po._flat=e8;var xl=Po.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()");return K7(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(o){var l=Po.prototype._convertLatLngs.call(this,o),f=l.length;return f>=2&&l[0]instanceof I&&l[0].equals(l[f-1])&&l.pop(),l},_setLatLngs:function(o){Po.prototype._setLatLngs.call(this,o),va(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return va(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,l=this.options.weight,f=new W(l,l);if(o=new K(o.min.subtract(f),o.max.add(f)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var w=0,k=this._rings.length,E;w<k;w++)E=q7(this._rings[w],o,!0),E.length&&this._parts.push(E)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(o){var l=!1,f,w,k,E,F,Y,ee,me;if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(E=0,ee=this._parts.length;E<ee;E++)for(f=this._parts[E],F=0,me=f.length,Y=me-1;F<me;Y=F++)w=f[F],k=f[Y],w.y>o.y!=k.y>o.y&&o.x<(k.x-w.x)*(o.y-w.y)/(k.y-w.y)+w.x&&(l=!l);return l||Po.prototype._containsPoint.call(this,o,!0)}});function TM(o,l){return new xl(o,l)}var Eo=No.extend({initialize:function(o,l){g(this,l),this._layers={},o&&this.addData(o)},addData:function(o){var l=v(o)?o:o.features,f,w,k;if(l){for(f=0,w=l.length;f<w;f++)k=l[f],(k.geometries||k.geometry||k.features||k.coordinates)&&this.addData(k);return this}var E=this.options;if(E.filter&&!E.filter(o))return this;var F=Ld(o,E);return F?(F.feature=Id(o),F.defaultOptions=F.options,this.resetStyle(F),E.onEachFeature&&E.onEachFeature(o,F),this.addLayer(F)):this},resetStyle:function(o){return o===void 0?this.eachLayer(this.resetStyle,this):(o.options=n({},o.defaultOptions),this._setLayerStyle(o,this.options.style),this)},setStyle:function(o){return this.eachLayer(function(l){this._setLayerStyle(l,o)},this)},_setLayerStyle:function(o,l){o.setStyle&&(typeof l=="function"&&(l=l(o.feature)),o.setStyle(l))}});function Ld(o,l){var f=o.type==="Feature"?o.geometry:o,w=f?f.coordinates:null,k=[],E=l&&l.pointToLayer,F=l&&l.coordsToLatLng||ip,Y,ee,me,He;if(!w&&!f)return null;switch(f.type){case"Point":return Y=F(w),a8(E,o,Y,l);case"MultiPoint":for(me=0,He=w.length;me<He;me++)Y=F(w[me]),k.push(a8(E,o,Y,l));return new No(k);case"LineString":case"MultiLineString":return ee=Ad(w,f.type==="LineString"?0:1,F),new Po(ee,l);case"Polygon":case"MultiPolygon":return ee=Ad(w,f.type==="Polygon"?1:2,F),new xl(ee,l);case"GeometryCollection":for(me=0,He=f.geometries.length;me<He;me++){var nt=Ld({geometry:f.geometries[me],type:"Feature",properties:o.properties},l);nt&&k.push(nt)}return new No(k);case"FeatureCollection":for(me=0,He=f.features.length;me<He;me++){var gt=Ld(f.features[me],l);gt&&k.push(gt)}return new No(k);default:throw new Error("Invalid GeoJSON object.")}}function a8(o,l,f,w){return o?o(l,f):new Rd(f,w&&w.markersInheritOptions&&w)}function ip(o){return new I(o[1],o[0],o[2])}function Ad(o,l,f){for(var w=[],k=0,E=o.length,F;k<E;k++)F=l?Ad(o[k],l-1,f):(f||ip)(o[k]),w.push(F);return w}function sp(o,l){return o=ne(o),o.alt!==void 0?[p(o.lng,l),p(o.lat,l),p(o.alt,l)]:[p(o.lng,l),p(o.lat,l)]}function Md(o,l,f,w){for(var k=[],E=0,F=o.length;E<F;E++)k.push(l?Md(o[E],va(o[E])?0:l-1,f,w):sp(o[E],w));return!l&&f&&k.length>0&&k.push(k[0].slice()),k}function bl(o,l){return o.feature?n({},o.feature,{geometry:l}):Id(l)}function Id(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var lp={toGeoJSON:function(o){return bl(this,{type:"Point",coordinates:sp(this.getLatLng(),o)})}};Rd.include(lp),op.include(lp),Td.include(lp),Po.include({toGeoJSON:function(o){var l=!va(this._latlngs),f=Md(this._latlngs,l?1:0,!1,o);return bl(this,{type:(l?"Multi":"")+"LineString",coordinates:f})}}),xl.include({toGeoJSON:function(o){var l=!va(this._latlngs),f=l&&!va(this._latlngs[0]),w=Md(this._latlngs,f?2:l?1:0,!0,o);return l||(w=[w]),bl(this,{type:(f?"Multi":"")+"Polygon",coordinates:w})}}),Cl.include({toMultiPoint:function(o){var l=[];return this.eachLayer(function(f){l.push(f.toGeoJSON(o).geometry.coordinates)}),bl(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(o){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(o);var f=l==="GeometryCollection",w=[];return this.eachLayer(function(k){if(k.toGeoJSON){var E=k.toGeoJSON(o);if(f)w.push(E.geometry);else{var F=Id(E);F.type==="FeatureCollection"?w.push.apply(w,F.features):w.push(F)}}}),f?bl(this,{geometries:w,type:"GeometryCollection"}):{type:"FeatureCollection",features:w}}});function o8(o,l){return new Eo(o,l)}var LM=o8,Od=Va.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,l,f){this._url=o,this._bounds=Ee(l),g(this,f)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ft(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&vl(this._image),this},bringToBack:function(){return this._map&&yl(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=Ee(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",l=this._image=o?this._url:Nt("img");if(ft(l,"leaflet-image-layer"),this._zoomAnimated&&ft(l,"leaflet-zoom-animated"),this.options.className&&ft(l,this.options.className),l.onselectstart=d,l.onmousemove=d,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(o){var l=this._map.getZoomScale(o.zoom),f=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;os(this._image,f,l)},_reset:function(){var o=this._image,l=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),f=l.getSize();bn(o,l.min),o.style.width=f.x+"px",o.style.height=f.y+"px"},_updateOpacity:function(){ga(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),AM=function(o,l,f){return new Od(o,l,f)},i8=Od.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",l=this._image=o?this._url:Nt("video");if(ft(l,"leaflet-image-layer"),this._zoomAnimated&&ft(l,"leaflet-zoom-animated"),this.options.className&&ft(l,this.options.className),l.onselectstart=d,l.onmousemove=d,l.onloadeddata=a(this.fire,this,"load"),o){for(var f=l.getElementsByTagName("source"),w=[],k=0;k<f.length;k++)w.push(f[k].src);this._url=f.length>0?w:[l.src];return}v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var E=0;E<this._url.length;E++){var F=Nt("source");F.src=this._url[E],l.appendChild(F)}}});function MM(o,l,f){return new i8(o,l,f)}var s8=Od.extend({_initImage:function(){var o=this._image=this._url;ft(o,"leaflet-image-layer"),this._zoomAnimated&&ft(o,"leaflet-zoom-animated"),this.options.className&&ft(o,this.options.className),o.onselectstart=d,o.onmousemove=d}});function IM(o,l,f){return new s8(o,l,f)}var fo=Va.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(o,l){o&&(o instanceof I||v(o))?(this._latlng=ne(o),g(this,l)):(g(this,o),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(o){return o=arguments.length?o:this._source._map,o.hasLayer(this)||o.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(o){return this._map?this.close():(arguments.length?this._source=o:o=this._source,this._prepareOpen(),this.openOn(o._map)),this},onAdd:function(o){this._zoomAnimated=o._zoomAnimated,this._container||this._initLayout(),o._fadeAnimated&&ga(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),o._fadeAnimated&&ga(this._container,1),this.bringToFront(),this.options.interactive&&(ft(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(o){o._fadeAnimated?(ga(this._container,0),this._removeTimeout=setTimeout(a(Qt,void 0,this._container),200)):Qt(this._container),this.options.interactive&&(cn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(o){return this._latlng=ne(o),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(o){return this._content=o,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 o={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&vl(this._container),this},bringToBack:function(){return this._map&&yl(this._container),this},_prepareOpen:function(o){var l=this._source;if(!l._map)return!1;if(l instanceof No){l=null;var f=this._source._layers;for(var w in f)if(f[w]._map){l=f[w];break}if(!l)return!1;this._source=l}if(!o)if(l.getCenter)o=l.getCenter();else if(l.getLatLng)o=l.getLatLng();else if(l.getBounds)o=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(o),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var o=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")o.innerHTML=l;else{for(;o.hasChildNodes();)o.removeChild(o.firstChild);o.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var o=this._map.latLngToLayerPoint(this._latlng),l=J(this.options.offset),f=this._getAnchor();this._zoomAnimated?bn(this._container,o.add(f)):l=l.add(o).add(f);var w=this._containerBottom=-l.y,k=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=w+"px",this._container.style.left=k+"px"}},_getAnchor:function(){return[0,0]}});bt.include({_initOverlay:function(o,l,f,w){var k=l;return k instanceof o||(k=new o(w).setContent(l)),f&&k.setLatLng(f),k}}),Va.include({_initOverlay:function(o,l,f,w){var k=f;return k instanceof o?(g(k,w),k._source=this):(k=l&&!w?l:new o(w,this),k.setContent(f)),k}});var Dd=fo.extend({options:{pane:"popupPane",offset:[0,7],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(o){return o=arguments.length?o:this._source._map,!o.hasLayer(this)&&o._popup&&o._popup.options.autoClose&&o.removeLayer(o._popup),o._popup=this,fo.prototype.openOn.call(this,o)},onAdd:function(o){fo.prototype.onAdd.call(this,o),o.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof si||this._source.on("preclick",ss))},onRemove:function(o){fo.prototype.onRemove.call(this,o),o.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof si||this._source.off("preclick",ss))},getEvents:function(){var o=fo.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(o.preclick=this.close),this.options.keepInView&&(o.moveend=this._adjustPan),o},_initLayout:function(){var o="leaflet-popup",l=this._container=Nt("div",o+" "+(this.options.className||"")+" leaflet-zoom-animated"),f=this._wrapper=Nt("div",o+"-content-wrapper",l);if(this._contentNode=Nt("div",o+"-content",f),Wu(l),Xf(this._contentNode),ut(l,"contextmenu",ss),this._tipContainer=Nt("div",o+"-tip-container",l),this._tip=Nt("div",o+"-tip",this._tipContainer),this.options.closeButton){var w=this._closeButton=Nt("a",o+"-close-button",l);w.setAttribute("role","button"),w.setAttribute("aria-label","Close popup"),w.href="#close",w.innerHTML='<span aria-hidden="true">&#215;</span>',ut(w,"click",function(k){er(k),this.close()},this)}},_updateLayout:function(){var o=this._contentNode,l=o.style;l.width="",l.whiteSpace="nowrap";var f=o.offsetWidth;f=Math.min(f,this.options.maxWidth),f=Math.max(f,this.options.minWidth),l.width=f+1+"px",l.whiteSpace="",l.height="";var w=o.offsetHeight,k=this.options.maxHeight,E="leaflet-popup-scrolled";k&&w>k?(l.height=k+"px",ft(o,E)):cn(o,E),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),f=this._getAnchor();bn(this._container,l.add(f))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,l=parseInt(ju(this._container,"marginBottom"),10)||0,f=this._container.offsetHeight+l,w=this._containerWidth,k=new W(this._containerLeft,-f-this._containerBottom);k._add(is(this._container));var E=o.layerPointToContainerPoint(k),F=J(this.options.autoPanPadding),Y=J(this.options.autoPanPaddingTopLeft||F),ee=J(this.options.autoPanPaddingBottomRight||F),me=o.getSize(),He=0,nt=0;E.x+w+ee.x>me.x&&(He=E.x+w-me.x+ee.x),E.x-He-Y.x<0&&(He=E.x-Y.x),E.y+f+ee.y>me.y&&(nt=E.y+f-me.y+ee.y),E.y-nt-Y.y<0&&(nt=E.y-Y.y),(He||nt)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([He,nt]))}},_getAnchor:function(){return J(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),OM=function(o,l){return new Dd(o,l)};bt.mergeOptions({closePopupOnClick:!0}),bt.include({openPopup:function(o,l,f){return this._initOverlay(Dd,o,l,f).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),Va.include({bindPopup:function(o,l){return this._popup=this._initOverlay(Dd,this._popup,o,l),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(o){return this._popup&&(this instanceof No||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){ls(o);var l=o.layer||o.target;if(this._popup._source===l&&!(l instanceof si)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=l,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var Hd=fo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){fo.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){fo.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=fo.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",l=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Nt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var l,f,w=this._map,k=this._container,E=w.latLngToContainerPoint(w.getCenter()),F=w.layerPointToContainerPoint(o),Y=this.options.direction,ee=k.offsetWidth,me=k.offsetHeight,He=J(this.options.offset),nt=this._getAnchor();Y==="top"?(l=ee/2,f=me):Y==="bottom"?(l=ee/2,f=0):Y==="center"?(l=ee/2,f=me/2):Y==="right"?(l=0,f=me/2):Y==="left"?(l=ee,f=me/2):F.x<E.x?(Y="right",l=0,f=me/2):(Y="left",l=ee+(He.x+nt.x)*2,f=me/2),o=o.subtract(J(l,f,!0)).add(He).add(nt),cn(k,"leaflet-tooltip-right"),cn(k,"leaflet-tooltip-left"),cn(k,"leaflet-tooltip-top"),cn(k,"leaflet-tooltip-bottom"),ft(k,"leaflet-tooltip-"+Y),bn(k,o)},_updatePosition:function(){var o=this._map.latLngToLayerPoint(this._latlng);this._setPosition(o)},setOpacity:function(o){this.options.opacity=o,this._container&&ga(this._container,o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center);this._setPosition(l)},_getAnchor:function(){return J(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),DM=function(o,l){return new Hd(o,l)};bt.include({openTooltip:function(o,l,f){return this._initOverlay(Hd,o,l,f).openOn(this),this},closeTooltip:function(o){return o.close(),this}}),Va.include({bindTooltip:function(o,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Hd,this._tooltip,o,l),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(o){if(!(!o&&this._tooltipHandlersAdded)){var l=o?"off":"on",f={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?f.add=this._openTooltip:(f.mouseover=this._openTooltip,f.mouseout=this.closeTooltip,f.click=this._openTooltip,this._map?this._addFocusListeners():f.add=this._addFocusListeners),this._tooltip.options.sticky&&(f.mousemove=this._moveTooltip),this[l](f),this._tooltipHandlersAdded=!o}},openTooltip:function(o){return this._tooltip&&(this instanceof No||(this._tooltip._source=this),this._tooltip._prepareOpen(o)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(o){return this._tooltip&&this._tooltip.setContent(o),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&(ut(l,"focus",function(){this._tooltip._source=o,this.openTooltip()},this),ut(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(o){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(o)});return}this._tooltip._source=o.layer||o.target,this.openTooltip(this._tooltip.options.sticky?o.latlng:void 0)}},_moveTooltip:function(o){var l=o.latlng,f,w;this._tooltip.options.sticky&&o.originalEvent&&(f=this._map.mouseEventToContainerPoint(o.originalEvent),w=this._map.containerPointToLayerPoint(f),l=this._map.layerPointToLatLng(w)),this._tooltip.setLatLng(l)}});var l8=wl.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(o){var l=o&&o.tagName==="DIV"?o:document.createElement("div"),f=this.options;if(f.html instanceof Element?(_d(l),l.appendChild(f.html)):l.innerHTML=f.html!==!1?f.html:"",f.bgPos){var w=J(f.bgPos);l.style.backgroundPosition=-w.x+"px "+-w.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function HM(o){return new l8(o)}wl.Default=Ku;var Yu=Va.extend({options:{tileSize:256,opacity:1,updateWhenIdle:qe.mobile,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(o){g(this,o)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(o){o._addZoomLimit(this)},onRemove:function(o){this._removeAllTiles(),Qt(this._container),o._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(vl(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(yl(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(o){return this.options.opacity=o,this._updateOpacity(),this},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var o=this._clampZoom(this._map.getZoom());o!==this._tileZoom&&(this._tileZoom=o,this._updateLevels()),this._update()}return this},getEvents:function(){var o={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),o.move=this._onMove),this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},createTile:function(){return document.createElement("div")},getTileSize:function(){var o=this.options.tileSize;return o instanceof W?o:new W(o,o)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(o){for(var l=this.getPane().children,f=-o(-1/0,1/0),w=0,k=l.length,E;w<k;w++)E=l[w].style.zIndex,l[w]!==this._container&&E&&(f=o(f,+E));isFinite(f)&&(this.options.zIndex=f+o(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!qe.ielt9){ga(this._container,this.options.opacity);var o=+new Date,l=!1,f=!1;for(var w in this._tiles){var k=this._tiles[w];if(!(!k.current||!k.loaded)){var E=Math.min(1,(o-k.loaded)/200);ga(k.el,E),E<1?l=!0:(k.active?f=!0:this._onOpaqueTile(k),k.active=!0)}}f&&!this._noPrune&&this._pruneTiles(),l&&(z(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:d,_initContainer:function(){this._container||(this._container=Nt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,l=this.options.maxZoom;if(o!==void 0){for(var f in this._levels)f=Number(f),this._levels[f].el.children.length||f===o?(this._levels[f].el.style.zIndex=l-Math.abs(o-f),this._onUpdateLevel(f)):(Qt(this._levels[f].el),this._removeTilesAtZoom(f),this._onRemoveLevel(f),delete this._levels[f]);var w=this._levels[o],k=this._map;return w||(w=this._levels[o]={},w.el=Nt("div","leaflet-tile-container leaflet-zoom-animated",this._container),w.el.style.zIndex=l,w.origin=k.project(k.unproject(k.getPixelOrigin()),o).round(),w.zoom=o,this._setZoomTransform(w,k.getCenter(),k.getZoom()),d(w.el.offsetWidth),this._onCreateLevel(w)),this._level=w,w}},_onUpdateLevel:d,_onRemoveLevel:d,_onCreateLevel:d,_pruneTiles:function(){if(this._map){var o,l,f=this._map.getZoom();if(f>this.options.maxZoom||f<this.options.minZoom){this._removeAllTiles();return}for(o in this._tiles)l=this._tiles[o],l.retain=l.current;for(o in this._tiles)if(l=this._tiles[o],l.current&&!l.active){var w=l.coords;this._retainParent(w.x,w.y,w.z,w.z-5)||this._retainChildren(w.x,w.y,w.z,w.z+2)}for(o in this._tiles)this._tiles[o].retain||this._removeTile(o)}},_removeTilesAtZoom:function(o){for(var l in this._tiles)this._tiles[l].coords.z===o&&this._removeTile(l)},_removeAllTiles:function(){for(var o in this._tiles)this._removeTile(o)},_invalidateAll:function(){for(var o in this._levels)Qt(this._levels[o].el),this._onRemoveLevel(Number(o)),delete this._levels[o];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(o,l,f,w){var k=Math.floor(o/2),E=Math.floor(l/2),F=f-1,Y=new W(+k,+E);Y.z=+F;var ee=this._tileCoordsToKey(Y),me=this._tiles[ee];return me&&me.active?(me.retain=!0,!0):(me&&me.loaded&&(me.retain=!0),F>w?this._retainParent(k,E,F,w):!1)},_retainChildren:function(o,l,f,w){for(var k=2*o;k<2*o+2;k++)for(var E=2*l;E<2*l+2;E++){var F=new W(k,E);F.z=f+1;var Y=this._tileCoordsToKey(F),ee=this._tiles[Y];if(ee&&ee.active){ee.retain=!0;continue}else ee&&ee.loaded&&(ee.retain=!0);f+1<w&&this._retainChildren(k,E,f+1,w)}},_resetView:function(o){var l=o&&(o.pinch||o.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(o){this._setView(o.center,o.zoom,!0,o.noUpdate)},_clampZoom:function(o){var l=this.options;return l.minNativeZoom!==void 0&&o<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<o?l.maxNativeZoom:o},_setView:function(o,l,f,w){var k=Math.round(l);this.options.maxZoom!==void 0&&k>this.options.maxZoom||this.options.minZoom!==void 0&&k<this.options.minZoom?k=void 0:k=this._clampZoom(k);var E=this.options.updateWhenZooming&&k!==this._tileZoom;(!w||E)&&(this._tileZoom=k,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),k!==void 0&&this._update(o),f||this._pruneTiles(),this._noPrune=!!f),this._setZoomTransforms(o,l)},_setZoomTransforms:function(o,l){for(var f in this._levels)this._setZoomTransform(this._levels[f],o,l)},_setZoomTransform:function(o,l,f){var w=this._map.getZoomScale(f,o.zoom),k=o.origin.multiplyBy(w).subtract(this._map._getNewPixelOrigin(l,f)).round();qe.any3d?os(o.el,k,w):bn(o.el,k)},_resetGrid:function(){var o=this._map,l=o.options.crs,f=this._tileSize=this.getTileSize(),w=this._tileZoom,k=this._map.getPixelWorldBounds(this._tileZoom);k&&(this._globalTileRange=this._pxBoundsToTileRange(k)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(o.project([0,l.wrapLng[0]],w).x/f.x),Math.ceil(o.project([0,l.wrapLng[1]],w).x/f.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(o.project([l.wrapLat[0],0],w).y/f.x),Math.ceil(o.project([l.wrapLat[1],0],w).y/f.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(o){var l=this._map,f=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),w=l.getZoomScale(f,this._tileZoom),k=l.project(o,this._tileZoom).floor(),E=l.getSize().divideBy(w*2);return new K(k.subtract(E),k.add(E))},_update:function(o){var l=this._map;if(l){var f=this._clampZoom(l.getZoom());if(o===void 0&&(o=l.getCenter()),this._tileZoom!==void 0){var w=this._getTiledPixelBounds(o),k=this._pxBoundsToTileRange(w),E=k.getCenter(),F=[],Y=this.options.keepBuffer,ee=new K(k.getBottomLeft().subtract([Y,-Y]),k.getTopRight().add([Y,-Y]));if(!(isFinite(k.min.x)&&isFinite(k.min.y)&&isFinite(k.max.x)&&isFinite(k.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var me in this._tiles){var He=this._tiles[me].coords;(He.z!==this._tileZoom||!ee.contains(new W(He.x,He.y)))&&(this._tiles[me].current=!1)}if(Math.abs(f-this._tileZoom)>1){this._setView(o,f);return}for(var nt=k.min.y;nt<=k.max.y;nt++)for(var gt=k.min.x;gt<=k.max.x;gt++){var br=new W(gt,nt);if(br.z=this._tileZoom,!!this._isValidTile(br)){var zn=this._tiles[this._tileCoordsToKey(br)];zn?zn.current=!0:F.push(br)}}if(F.sort(function(Dr,Sl){return Dr.distanceTo(E)-Sl.distanceTo(E)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ya=document.createDocumentFragment();for(gt=0;gt<F.length;gt++)this._addTile(F[gt],ya);this._level.el.appendChild(ya)}}}},_isValidTile:function(o){var l=this._map.options.crs;if(!l.infinite){var f=this._globalTileRange;if(!l.wrapLng&&(o.x<f.min.x||o.x>f.max.x)||!l.wrapLat&&(o.y<f.min.y||o.y>f.max.y))return!1}if(!this.options.bounds)return!0;var w=this._tileCoordsToBounds(o);return Ee(this.options.bounds).overlaps(w)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var l=this._map,f=this.getTileSize(),w=o.scaleBy(f),k=w.add(f),E=l.unproject(w,o.z),F=l.unproject(k,o.z);return[E,F]},_tileCoordsToBounds:function(o){var l=this._tileCoordsToNwSe(o),f=new ve(l[0],l[1]);return this.options.noWrap||(f=this._map.wrapLatLngBounds(f)),f},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var l=o.split(":"),f=new W(+l[0],+l[1]);return f.z=+l[2],f},_removeTile:function(o){var l=this._tiles[o];l&&(Qt(l.el),delete this._tiles[o],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){ft(o,"leaflet-tile");var l=this.getTileSize();o.style.width=l.x+"px",o.style.height=l.y+"px",o.onselectstart=d,o.onmousemove=d,qe.ielt9&&this.options.opacity<1&&ga(o,this.options.opacity)},_addTile:function(o,l){var f=this._getTilePos(o),w=this._tileCoordsToKey(o),k=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(k),this.createTile.length<2&&B(a(this._tileReady,this,o,null,k)),bn(k,f),this._tiles[w]={el:k,coords:o,current:!0},l.appendChild(k),this.fire("tileloadstart",{tile:k,coords:o})},_tileReady:function(o,l,f){l&&this.fire("tileerror",{error:l,tile:f,coords:o});var w=this._tileCoordsToKey(o);f=this._tiles[w],f&&(f.loaded=+new Date,this._map._fadeAnimated?(ga(f.el,0),z(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(f.active=!0,this._pruneTiles()),l||(ft(f.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:f.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),qe.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var l=new W(this._wrapX?c(o.x,this._wrapX):o.x,this._wrapY?c(o.y,this._wrapY):o.y);return l.z=o.z,l},_pxBoundsToTileRange:function(o){var l=this.getTileSize();return new K(o.min.unscaleBy(l).floor(),o.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function BM(o){return new Yu(o)}var _l=Yu.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,l){this._url=o,l=g(this,l),l.detectRetina&&qe.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,l){return this._url===o&&l===void 0&&(l=!0),this._url=o,l||this.redraw(),this},createTile:function(o,l){var f=document.createElement("img");return ut(f,"load",a(this._tileOnLoad,this,l,f)),ut(f,"error",a(this._tileOnError,this,l,f)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(f.referrerPolicy=this.options.referrerPolicy),f.alt="",f.src=this.getTileUrl(o),f},getTileUrl:function(o){var l={r:qe.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var f=this._globalTileRange.max.y-o.y;this.options.tms&&(l.y=f),l["-y"]=f}return S(this._url,n(l,this.options))},_tileOnLoad:function(o,l){qe.ielt9?setTimeout(a(o,this,null,l),0):o(null,l)},_tileOnError:function(o,l,f){var w=this.options.errorTileUrl;w&&l.getAttribute("src")!==w&&(l.src=w),o(f,l)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,l=this.options.maxZoom,f=this.options.zoomReverse,w=this.options.zoomOffset;return f&&(o=l-o),o+w},_getSubdomain:function(o){var l=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var o,l;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(l=this._tiles[o].el,l.onload=d,l.onerror=d,!l.complete)){l.src=_;var f=this._tiles[o].coords;Qt(l),delete this._tiles[o],this.fire("tileabort",{tile:l,coords:f})}},_removeTile:function(o){var l=this._tiles[o];if(l)return l.el.setAttribute("src",_),Yu.prototype._removeTile.call(this,o)},_tileReady:function(o,l,f){if(!(!this._map||f&&f.getAttribute("src")===_))return Yu.prototype._tileReady.call(this,o,l,f)}});function u8(o,l){return new _l(o,l)}var c8=_l.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,l){this._url=o;var f=n({},this.defaultWmsParams);for(var w in l)w in this.options||(f[w]=l[w]);l=g(this,l);var k=l.detectRetina&&qe.retina?2:1,E=this.getTileSize();f.width=E.x*k,f.height=E.y*k,this.wmsParams=f},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,_l.prototype.onAdd.call(this,o)},getTileUrl:function(o){var l=this._tileCoordsToNwSe(o),f=this._crs,w=M(f.project(l[0]),f.project(l[1])),k=w.min,E=w.max,F=(this._wmsVersion>=1.3&&this._crs===n8?[k.y,k.x,E.y,E.x]:[k.x,k.y,E.x,E.y]).join(","),Y=_l.prototype.getTileUrl.call(this,o);return Y+b(this.wmsParams,Y,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(o,l){return n(this.wmsParams,o),l||this.redraw(),this}});function FM(o,l){return new c8(o,l)}_l.WMS=c8,u8.wms=FM;var Ro=Va.extend({options:{padding:.1},initialize:function(o){g(this,o),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ft(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 o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,l){var f=this._map.getZoomScale(l,this._zoom),w=this._map.getSize().multiplyBy(.5+this.options.padding),k=this._map.project(this._center,l),E=w.multiplyBy(-f).add(k).subtract(this._map._getNewPixelOrigin(o,l));qe.any3d?os(this._container,E,f):bn(this._container,E)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,l=this._map.getSize(),f=this._map.containerPointToLayerPoint(l.multiplyBy(-o)).round();this._bounds=new K(f,f.add(l.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),d8=Ro.extend({options:{tolerance:0},getEvents:function(){var o=Ro.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ro.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");ut(o,"mousemove",this._onMouseMove,this),ut(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ut(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){z(this._redrawRequest),delete this._ctx,Qt(this._container),Ht(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var l in this._layers)o=this._layers[l],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ro.prototype._update.call(this);var o=this._bounds,l=this._container,f=o.getSize(),w=qe.retina?2:1;bn(l,o.min),l.width=w*f.x,l.height=w*f.y,l.style.width=f.x+"px",l.style.height=f.y+"px",qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){Ro.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[s(o)]=o;var l=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var l=o._order,f=l.next,w=l.prev;f?f.prev=w:this._drawLast=w,w?w.next=f:this._drawFirst=f,delete o._order,delete this._layers[s(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var l=o.options.dashArray.split(/[, ]+/),f=[],w,k;for(k=0;k<l.length;k++){if(w=Number(l[k]),isNaN(w))return;f.push(w)}o.options._dashArray=f}else o.options._dashArray=o.options.dashArray},_requestRedraw:function(o){this._map&&(this._extendRedrawBounds(o),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(o){if(o._pxBounds){var l=(o.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new K,this._redrawBounds.extend(o._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(o._pxBounds.max.add([l,l]))}},_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 o=this._redrawBounds;if(o){var l=o.getSize();this._ctx.clearRect(o.min.x,o.min.y,l.x,l.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var o,l=this._redrawBounds;if(this._ctx.save(),l){var f=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,f.x,f.y),this._ctx.clip()}this._drawing=!0;for(var w=this._drawFirst;w;w=w.next)o=w.layer,(!l||o._pxBounds&&o._pxBounds.intersects(l))&&o._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(o,l){if(this._drawing){var f,w,k,E,F=o._parts,Y=F.length,ee=this._ctx;if(Y){for(ee.beginPath(),f=0;f<Y;f++){for(w=0,k=F[f].length;w<k;w++)E=F[f][w],ee[w?"lineTo":"moveTo"](E.x,E.y);l&&ee.closePath()}this._fillStroke(ee,o)}}},_updateCircle:function(o){if(!(!this._drawing||o._empty())){var l=o._point,f=this._ctx,w=Math.max(Math.round(o._radius),1),k=(Math.max(Math.round(o._radiusY),1)||w)/w;k!==1&&(f.save(),f.scale(1,k)),f.beginPath(),f.arc(l.x,l.y/k,w,0,Math.PI*2,!1),k!==1&&f.restore(),this._fillStroke(f,o)}},_fillStroke:function(o,l){var f=l.options;f.fill&&(o.globalAlpha=f.fillOpacity,o.fillStyle=f.fillColor||f.color,o.fill(f.fillRule||"evenodd")),f.stroke&&f.weight!==0&&(o.setLineDash&&o.setLineDash(l.options&&l.options._dashArray||[]),o.globalAlpha=f.opacity,o.lineWidth=f.weight,o.strokeStyle=f.color,o.lineCap=f.lineCap,o.lineJoin=f.lineJoin,o.stroke())},_onClick:function(o){for(var l=this._map.mouseEventToLayerPoint(o),f,w,k=this._drawFirst;k;k=k.next)f=k.layer,f.options.interactive&&f._containsPoint(l)&&(!(o.type==="click"||o.type==="preclick")||!this._map._draggableMoved(f))&&(w=f);this._fireEvent(w?[w]:!1,o)},_onMouseMove:function(o){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(o);this._handleMouseHover(o,l)}},_handleMouseOut:function(o){var l=this._hoveredLayer;l&&(cn(this._container,"leaflet-interactive"),this._fireEvent([l],o,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(o,l){if(!this._mouseHoverThrottled){for(var f,w,k=this._drawFirst;k;k=k.next)f=k.layer,f.options.interactive&&f._containsPoint(l)&&(w=f);w!==this._hoveredLayer&&(this._handleMouseOut(o),w&&(ft(this._container,"leaflet-interactive"),this._fireEvent([w],o,"mouseover"),this._hoveredLayer=w)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,o),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(o,l,f){this._map._fireDOMEvent(l,f||l.type,o)},_bringToFront:function(o){var l=o._order;if(l){var f=l.next,w=l.prev;if(f)f.prev=w;else return;w?w.next=f:f&&(this._drawFirst=f),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(o)}},_bringToBack:function(o){var l=o._order;if(l){var f=l.next,w=l.prev;if(w)w.next=f;else return;f?f.prev=w:w&&(this._drawLast=w),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(o)}}});function f8(o){return qe.canvas?new d8(o):null}var Xu=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(o){return document.createElement("<lvml:"+o+' class="lvml">')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),VM={_initContainer:function(){this._container=Nt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ro.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var l=o._container=Xu("shape");ft(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",o._path=Xu("path"),l.appendChild(o._path),this._updateStyle(o),this._layers[s(o)]=o},_addPath:function(o){var l=o._container;this._container.appendChild(l),o.options.interactive&&o.addInteractiveTarget(l)},_removePath:function(o){var l=o._container;Qt(l),o.removeInteractiveTarget(l),delete this._layers[s(o)]},_updateStyle:function(o){var l=o._stroke,f=o._fill,w=o.options,k=o._container;k.stroked=!!w.stroke,k.filled=!!w.fill,w.stroke?(l||(l=o._stroke=Xu("stroke")),k.appendChild(l),l.weight=w.weight+"px",l.color=w.color,l.opacity=w.opacity,w.dashArray?l.dashStyle=v(w.dashArray)?w.dashArray.join(" "):w.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=w.lineCap.replace("butt","flat"),l.joinstyle=w.lineJoin):l&&(k.removeChild(l),o._stroke=null),w.fill?(f||(f=o._fill=Xu("fill")),k.appendChild(f),f.color=w.fillColor||w.color,f.opacity=w.fillOpacity):f&&(k.removeChild(f),o._fill=null)},_updateCircle:function(o){var l=o._point.round(),f=Math.round(o._radius),w=Math.round(o._radiusY||f);this._setPath(o,o._empty()?"M0 0":"AL "+l.x+","+l.y+" "+f+","+w+" 0,"+65535*360)},_setPath:function(o,l){o._path.v=l},_bringToFront:function(o){vl(o._container)},_bringToBack:function(o){yl(o._container)}},Bd=qe.vml?Xu:ce,Ju=Ro.extend({_initContainer:function(){this._container=Bd("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Bd("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Qt(this._container),Ht(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ro.prototype._update.call(this);var o=this._bounds,l=o.getSize(),f=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,f.setAttribute("width",l.x),f.setAttribute("height",l.y)),bn(f,o.min),f.setAttribute("viewBox",[o.min.x,o.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(o){var l=o._path=Bd("path");o.options.className&&ft(l,o.options.className),o.options.interactive&&ft(l,"leaflet-interactive"),this._updateStyle(o),this._layers[s(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){Qt(o._path),o.removeInteractiveTarget(o._path),delete this._layers[s(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var l=o._path,f=o.options;l&&(f.stroke?(l.setAttribute("stroke",f.color),l.setAttribute("stroke-opacity",f.opacity),l.setAttribute("stroke-width",f.weight),l.setAttribute("stroke-linecap",f.lineCap),l.setAttribute("stroke-linejoin",f.lineJoin),f.dashArray?l.setAttribute("stroke-dasharray",f.dashArray):l.removeAttribute("stroke-dasharray"),f.dashOffset?l.setAttribute("stroke-dashoffset",f.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),f.fill?(l.setAttribute("fill",f.fillColor||f.color),l.setAttribute("fill-opacity",f.fillOpacity),l.setAttribute("fill-rule",f.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(o,l){this._setPath(o,ge(o._parts,l))},_updateCircle:function(o){var l=o._point,f=Math.max(Math.round(o._radius),1),w=Math.max(Math.round(o._radiusY),1)||f,k="a"+f+","+w+" 0 1,0 ",E=o._empty()?"M0 0":"M"+(l.x-f)+","+l.y+k+f*2+",0 "+k+-f*2+",0 ";this._setPath(o,E)},_setPath:function(o,l){o._path.setAttribute("d",l)},_bringToFront:function(o){vl(o._path)},_bringToBack:function(o){yl(o._path)}});qe.vml&&Ju.include(VM);function p8(o){return qe.svg||qe.vml?new Ju(o):null}bt.include({getRenderer:function(o){var l=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var l=this._paneRenderers[o];return l===void 0&&(l=this._createRenderer({pane:o}),this._paneRenderers[o]=l),l},_createRenderer:function(o){return this.options.preferCanvas&&f8(o)||p8(o)}});var h8=xl.extend({initialize:function(o,l){xl.prototype.initialize.call(this,this._boundsToLatLngs(o),l)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=Ee(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function zM(o,l){return new h8(o,l)}Ju.create=Bd,Ju.pointsToPath=ge,Eo.geometryToLayer=Ld,Eo.coordsToLatLng=ip,Eo.coordsToLatLngs=Ad,Eo.latLngToCoords=sp,Eo.latLngsToCoords=Md,Eo.getFeature=bl,Eo.asFeature=Id,bt.mergeOptions({boxZoom:!0});var m8=co.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){ut(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ht(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Uu(),Uf(),this._startPoint=this._map.mouseEventToContainerPoint(o),ut(document,{contextmenu:ls,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=Nt("div","leaflet-zoom-box",this._container),ft(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var l=new K(this._point,this._startPoint),f=l.getSize();bn(this._box,l.min),this._box.style.width=f.x+"px",this._box.style.height=f.y+"px"},_finish:function(){this._moved&&(Qt(this._box),cn(this._container,"leaflet-crosshair")),Zu(),Zf(),Ht(document,{contextmenu:ls,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new ve(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});bt.addInitHook("addHandler","boxZoom",m8),bt.mergeOptions({doubleClickZoom:!0});var g8=co.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var l=this._map,f=l.getZoom(),w=l.options.zoomDelta,k=o.originalEvent.shiftKey?f-w:f+w;l.options.doubleClickZoom==="center"?l.setZoom(k):l.setZoomAround(o.containerPoint,k)}});bt.addInitHook("addHandler","doubleClickZoom",g8),bt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var v8=co.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new ii(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}ft(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){cn(this._map._container,"leaflet-grab"),cn(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 o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=Ee(this._map.options.maxBounds);this._offsetLimit=M(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var l=this._lastTime=+new Date,f=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(f),this._times.push(l),this._prunePositions(l)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,l){return o-(o-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;o.x<l.min.x&&(o.x=this._viscousLimit(o.x,l.min.x)),o.y<l.min.y&&(o.y=this._viscousLimit(o.y,l.min.y)),o.x>l.max.x&&(o.x=this._viscousLimit(o.x,l.max.x)),o.y>l.max.y&&(o.y=this._viscousLimit(o.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,l=Math.round(o/2),f=this._initialWorldOffset,w=this._draggable._newPos.x,k=(w-l+f)%o+l-f,E=(w+l+f)%o-l-f,F=Math.abs(k+f)<Math.abs(E+f)?k:E;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(o){var l=this._map,f=l.options,w=!f.inertia||o.noInertia||this._times.length<2;if(l.fire("dragend",o),w)l.fire("moveend");else{this._prunePositions(+new Date);var k=this._lastPos.subtract(this._positions[0]),E=(this._lastTime-this._times[0])/1e3,F=f.easeLinearity,Y=k.multiplyBy(F/E),ee=Y.distanceTo([0,0]),me=Math.min(f.inertiaMaxSpeed,ee),He=Y.multiplyBy(me/ee),nt=me/(f.inertiaDeceleration*F),gt=He.multiplyBy(-nt/2).round();!gt.x&&!gt.y?l.fire("moveend"):(gt=l._limitOffset(gt,l.options.maxBounds),B(function(){l.panBy(gt,{duration:nt,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});bt.addInitHook("addHandler","dragging",v8),bt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var y8=co.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(o){this._map=o,this._setPanDelta(o.options.keyboardPanDelta),this._setZoomDelta(o.options.zoomDelta)},addHooks:function(){var o=this._map._container;o.tabIndex<=0&&(o.tabIndex="0"),ut(o,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ht(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 o=document.body,l=document.documentElement,f=o.scrollTop||l.scrollTop,w=o.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(w,f)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(o){var l=this._panKeys={},f=this.keyCodes,w,k;for(w=0,k=f.left.length;w<k;w++)l[f.left[w]]=[-1*o,0];for(w=0,k=f.right.length;w<k;w++)l[f.right[w]]=[o,0];for(w=0,k=f.down.length;w<k;w++)l[f.down[w]]=[0,o];for(w=0,k=f.up.length;w<k;w++)l[f.up[w]]=[0,-1*o]},_setZoomDelta:function(o){var l=this._zoomKeys={},f=this.keyCodes,w,k;for(w=0,k=f.zoomIn.length;w<k;w++)l[f.zoomIn[w]]=o;for(w=0,k=f.zoomOut.length;w<k;w++)l[f.zoomOut[w]]=-o},_addHooks:function(){ut(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ht(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(o){if(!(o.altKey||o.ctrlKey||o.metaKey)){var l=o.keyCode,f=this._map,w;if(l in this._panKeys){if(!f._panAnim||!f._panAnim._inProgress)if(w=this._panKeys[l],o.shiftKey&&(w=J(w).multiplyBy(3)),f.options.maxBounds&&(w=f._limitOffset(J(w),f.options.maxBounds)),f.options.worldCopyJump){var k=f.wrapLatLng(f.unproject(f.project(f.getCenter()).add(w)));f.panTo(k)}else f.panBy(w)}else if(l in this._zoomKeys)f.setZoom(f.getZoom()+(o.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&f._popup&&f._popup.options.closeOnEscapeKey)f.closePopup();else return;ls(o)}}});bt.addInitHook("addHandler","keyboard",y8),bt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var C8=co.extend({addHooks:function(){ut(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ht(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(o){var l=U7(o),f=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(o),this._startTime||(this._startTime=+new Date);var w=Math.max(f-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),w),ls(o)},_performZoom:function(){var o=this._map,l=o.getZoom(),f=this._map.options.zoomSnap||0;o._stop();var w=this._delta/(this._map.options.wheelPxPerZoomLevel*4),k=4*Math.log(2/(1+Math.exp(-Math.abs(w))))/Math.LN2,E=f?Math.ceil(k/f)*f:k,F=o._limitZoom(l+(this._delta>0?E:-E))-l;this._delta=0,this._startTime=null,F&&(o.options.scrollWheelZoom==="center"?o.setZoom(l+F):o.setZoomAround(this._lastMousePos,l+F))}});bt.addInitHook("addHandler","scrollWheelZoom",C8);var jM=600;bt.mergeOptions({tapHold:qe.touchNative&&qe.safari&&qe.mobile,tapTolerance:15});var w8=co.extend({addHooks:function(){ut(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ht(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var l=o.touches[0];this._startPos=this._newPos=new W(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(ut(document,"touchend",er),ut(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),jM),ut(document,"touchend touchcancel contextmenu",this._cancel,this),ut(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){Ht(document,"touchend",er),Ht(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),Ht(document,"touchend touchcancel contextmenu",this._cancel,this),Ht(document,"touchmove",this._onMove,this)},_onMove:function(o){var l=o.touches[0];this._newPos=new W(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,l){var f=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});f._simulated=!0,l.target.dispatchEvent(f)}});bt.addInitHook("addHandler","tapHold",w8),bt.mergeOptions({touchZoom:qe.touch,bounceAtZoomLimits:!0});var x8=co.extend({addHooks:function(){ft(this._map._container,"leaflet-touch-zoom"),ut(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){cn(this._map._container,"leaflet-touch-zoom"),Ht(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var l=this._map;if(!(!o.touches||o.touches.length!==2||l._animatingZoom||this._zooming)){var f=l.mouseEventToContainerPoint(o.touches[0]),w=l.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(f.add(w)._divideBy(2))),this._startDist=f.distanceTo(w),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),ut(document,"touchmove",this._onTouchMove,this),ut(document,"touchend touchcancel",this._onTouchEnd,this),er(o)}},_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var l=this._map,f=l.mouseEventToContainerPoint(o.touches[0]),w=l.mouseEventToContainerPoint(o.touches[1]),k=f.distanceTo(w)/this._startDist;if(this._zoom=l.getScaleZoom(k,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&k<1||this._zoom>l.getMaxZoom()&&k>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,k===1)return}else{var E=f._add(w)._divideBy(2)._subtract(this._centerPoint);if(k===1&&E.x===0&&E.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(E),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),z(this._animRequest);var F=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(F,this,!0),er(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,z(this._animRequest),Ht(document,"touchmove",this._onTouchMove,this),Ht(document,"touchend touchcancel",this._onTouchEnd,this),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))}});bt.addInitHook("addHandler","touchZoom",x8),bt.BoxZoom=m8,bt.DoubleClickZoom=g8,bt.Drag=v8,bt.Keyboard=y8,bt.ScrollWheelZoom=C8,bt.TapHold=w8,bt.TouchZoom=x8,e.Bounds=K,e.Browser=qe,e.CRS=ze,e.Canvas=d8,e.Circle=op,e.CircleMarker=Td,e.Class=H,e.Control=Fa,e.DivIcon=l8,e.DivOverlay=fo,e.DomEvent=iM,e.DomUtil=aM,e.Draggable=ii,e.Evented=X,e.FeatureGroup=No,e.GeoJSON=Eo,e.GridLayer=Yu,e.Handler=co,e.Icon=wl,e.ImageOverlay=Od,e.LatLng=I,e.LatLngBounds=ve,e.Layer=Va,e.LayerGroup=Cl,e.LineUtil=CM,e.Map=bt,e.Marker=Rd,e.Mixin=pM,e.Path=si,e.Point=W,e.PolyUtil=hM,e.Polygon=xl,e.Polyline=Po,e.Popup=Dd,e.PosAnimation=Z7,e.Projection=wM,e.Rectangle=h8,e.Renderer=Ro,e.SVG=Ju,e.SVGOverlay=s8,e.TileLayer=_l,e.Tooltip=Hd,e.Transformation=he,e.Util=V,e.VideoOverlay=i8,e.bind=a,e.bounds=M,e.canvas=f8,e.circle=EM,e.circleMarker=PM,e.control=Gu,e.divIcon=HM,e.extend=n,e.featureGroup=SM,e.geoJSON=o8,e.geoJson=LM,e.gridLayer=BM,e.icon=kM,e.imageOverlay=AM,e.latLng=ne,e.latLngBounds=Ee,e.layerGroup=_M,e.map=sM,e.marker=NM,e.point=J,e.polygon=TM,e.polyline=RM,e.popup=OM,e.rectangle=zM,e.setOptions=g,e.stamp=s,e.svg=p8,e.svgOverlay=IM,e.tileLayer=u8,e.tooltip=DM,e.transformation=Ne,e.version=t,e.videoOverlay=MM;var UM=window.L;e.noConflict=function(){return window.L=UM,this},window.L=e}))});function Qi(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function ed(e,t){return t==null?function(r,a){let i=(0,Lu.useRef)();return i.current||(i.current=e(r,a)),i}:function(r,a){let i=(0,Lu.useRef)();i.current||(i.current=e(r,a));let s=(0,Lu.useRef)(r),{instance:u}=i.current;return(0,Lu.useEffect)(function(){s.current!==r&&(t(u,r,s.current),s.current=r)},[u,r,a]),i}}var Lu,y9=A(()=>{Lu=Z(Se(),1)});function hK(e,t){(0,zT.useEffect)(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function C9(e){return function(n){let r=X1(),a=e(ll(n,r),r);return df(r.map,n.attribution),hf(a.current,n.eventHandlers),hK(a.current,r),a}}var zT,jT=A(()=>{zT=Z(Se(),1);p9();J1();v9();mf()});function w9(e,t){let n=ed(e,t),r=C9(n);return IT(r)}function x9(e,t){let n=ed(e),r=BT(n,t);return OT(r)}function b9(e,t){let n=ed(e,t),r=C9(n);return DT(r)}var UT=A(()=>{HT();y9();jT();FT()});function _9(e,t,n){let{opacity:r,zIndex:a}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),a!=null&&a!==n.zIndex&&e.setZIndex(a)}var ZT=A(()=>{});var td=A(()=>{J1();y9();UT();ZT();mf()});function S9(){return S9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S9.apply(this,arguments)}function mK({bounds:e,boundsOptions:t,center:n,children:r,className:a,id:i,placeholder:s,style:u,whenReady:c,zoom:d,...p},h){let[m]=(0,Xr.useState)({className:a,id:i,style:u}),[g,b]=(0,Xr.useState)(null);(0,Xr.useImperativeHandle)(h,()=>g?.map??null,[g]);let C=(0,Xr.useCallback)(v=>{if(v!==null&&g===null){let x=new $T.Map(v,p);n!=null&&d!=null?x.setView(n,d):e!=null&&x.fitBounds(e,t),c!=null&&x.whenReady(c),b(h9(x))}},[]);(0,Xr.useEffect)(()=>()=>{g?.map.remove()},[g]);let S=g?Xr.default.createElement(Y1,{value:g},r):s??null;return Xr.default.createElement("div",S9({},m,{ref:C}),S)}var $T,Xr,k9,WT=A(()=>{td();$T=Z(Q1(),1),Xr=Z(Se(),1);k9=(0,Xr.forwardRef)(mK)});var GT,N9,qT=A(()=>{td();GT=Z(Q1(),1),N9=w9(function({position:t,...n},r){let a=new GT.Marker(t,n);return Qi(a,m9(r,{overlayContainer:a}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())})});var KT,YT,P9,XT=A(()=>{td();KT=Z(Q1(),1),YT=Z(Se(),1),P9=x9(function(t,n){let r=new KT.Popup(t,n.overlayContainer);return Qi(r,n)},function(t,n,{position:r},a){(0,YT.useEffect)(function(){let{instance:s}=t;function u(d){d.popup===s&&(s.update(),a(!0))}function c(d){d.popup===s&&a(!1)}return n.map.on({popupopen:u,popupclose:c}),n.overlayContainer==null?(r!=null&&s.setLatLng(r),s.openOn(n.map)):n.overlayContainer.bindPopup(s),function(){n.map.off({popupopen:u,popupclose:c}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(s)}},[t,n,a,r])})});var JT,E9,QT=A(()=>{td();JT=Z(Q1(),1),E9=b9(function({url:t,...n},r){let a=new JT.TileLayer(t,ll(n,r));return Qi(a,r)},function(t,n,r){_9(t,n,r);let{url:a}=n;a!=null&&a!==r.url&&t.setUrl(a)})});var eL=A(()=>{WT();qT();XT();QT()});function gK({url:e,alt:t,open:n,onClose:r}){return(0,G.jsxs)(z4,{open:n,onOpenChange:r,children:[(0,G.jsx)(o1,{children:(0,G.jsx)(x5,{})}),(0,G.jsx)(w5,{className:"lua:w-full lua:fixed lua:inset-0 lua:h-full lua:max-w-none lua:p-0 lua:bg-transparent lua:shadow-none lua:translate-x-0 lua:translate-y-0 lua:m-0 lua:rounded-none",showClose:!1,children:(0,G.jsxs)("div",{className:"lua:relative lua:w-full lua:h-full",children:[(0,G.jsx)("button",{onClick:r,className:"lua:cursor-pointer lua:absolute lua:top-4 lua:left-4 lua:z-10 lua:p-2 lua:bg-black/50 lua:rounded-full lua:hover:bg-black/70 lua:transition-colors",children:(0,G.jsx)(qr,{color:"white",className:"lua:w-6 lua:h-6"})}),(0,G.jsx)("div",{className:"lua:w-full lua:h-full lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("img",{src:e,alt:t,className:"sm:lua:aspect-[16/9] lua:object-contain lua:rounded-none sm:lua:rounded-lg"})})]})})]})}function vK({images:e,initialIndex:t=0,open:n,onClose:r}){let[a,i]=(0,$e.useState)(),[s,u]=(0,$e.useState)(0);return(0,$e.useEffect)(()=>{if(!a)return;t>0&&t<e.length&&(a.scrollTo(t),u(t));let c=()=>{u(a.selectedScrollSnap())};return a.on("select",c),c(),()=>{a?.off("select",c)}},[a,t,e.length]),(0,G.jsxs)(z4,{open:n,onOpenChange:r,children:[(0,G.jsx)(o1,{children:(0,G.jsx)(x5,{})}),(0,G.jsx)(w5,{className:"lua:w-full lua:m-0",showClose:!1,children:(0,G.jsxs)("div",{className:"lua:relative lua:w-full lua:h-full",children:[(0,G.jsx)("button",{onClick:r,className:"lua:cursor-pointer lua:absolute lua:top-4 lua:left-4 lua:z-10 lua:p-2 lua:bg-black/50 lua:rounded-full lua:hover:bg-black/70 lua:transition-colors",children:(0,G.jsx)(qr,{color:"white",className:"lua:w-6 lua:h-6"})}),e.length>1&&(0,G.jsxs)("div",{className:"lua:absolute lua:top-4 lua:right-4 lua:z-10 lua:px-3 lua:py-1 lua:bg-black/50 lua:rounded-full lua:text-white lua:text-sm",children:[s+1," / ",e.length]}),(0,G.jsx)("div",{className:"lua:w-full lua:h-full lua:flex lua:items-center lua:justify-center lua:px-16",children:(0,G.jsxs)(D4,{setApi:i,className:"lua:w-full lua:max-w-5xl",opts:{align:"center",loop:e.length>1},children:[(0,G.jsx)(H4,{children:e.map((c,d)=>(0,G.jsx)(B4,{className:"lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("img",{src:c.src,alt:c.alt||`Image ${d+1}`,className:"lua:max-w-full lua:max-h-screen lua:object-contain lua:rounded-none sm:lua:rounded-lg",draggable:!1})},d))}),e.length>1&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F4,{className:"lua:left-4 lua:bg-black/50 lua:border-none lua:text-white lua:hover:bg-black/70 lua:hover:text-white-white/70"}),(0,G.jsx)(V4,{className:"lua:right-4 lua:bg-black/50 lua:border-none lua:text-white lua:hover:bg-black/70 lua:hover:text-white-white/70"})]})]})})]})})]})}function yK({children:e,language:t=""}){let[n,r]=(0,$e.useState)(!1),a=typeof e=="string"?e:String(e),i=t||"javascript";return(0,G.jsxs)("div",{className:"lua:relative lua:my-4 lua:rounded-lg lua:overflow-hidden lua:mx-4 lua:sm:mx-5 lua:grid",children:[(0,G.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:bg-gray-800 lua:text-gray-200 lua:px-4 lua:py-2",children:[(0,G.jsx)("span",{className:"lua:text-xs lua:font-mono",children:i}),(0,G.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),2e3)},className:"lua:text-xs lua:bg-gray-700 lua:hover:bg-gray-600 lua:rounded lua:px-2 lua:py-1 lua:transition-colors","aria-label":"Copy code",children:n?"Copied!":"Copy"})]}),(0,G.jsx)(TT,{theme:f9.vsDark,code:a,language:i,children:({className:s,style:u,tokens:c,getLineProps:d,getTokenProps:p})=>(0,G.jsx)("pre",{className:`${s} lua:p-4 lua:overflow-x-auto`,style:u,children:c.map((h,m)=>(0,G.jsx)("div",{...d({line:h}),children:h.map((g,b)=>(0,G.jsx)("span",{...p({token:g})},b))},m))})})]})}function wK(e){let t=new URL(e,"http://lua"),n=decodeURIComponent(t.pathname),r={};for(let[a,i]of t.searchParams.entries())r[a]=decodeURIComponent(i);return{pathname:n,queryParams:r}}function xK(e){let t=e.match(/\[navigate\]\(([^)]+)\)/);return t?t[1]:null}function NK(e){return{icon:()=>null}}function tL({documents:e}){return e.map(t=>{let n=NK(new File([],"",{type:t.mimeType})).icon;return(0,G.jsx)("a",{"data-testid":"chat-file-message",href:t.url,target:"_blank",rel:"noopener noreferrer",className:"chat-file-message lua:mx-4 lua:sm:mx-5",children:(0,G.jsx)("div",{className:"lua:flex lua:flex-col lua:gap-8",children:(0,G.jsxs)("div",{className:"chat-file-card lua:flex lua:items-center lua:justify-start lua:p-3 lua:border lua:border-gray-200 lua:rounded-lg lua:bg-white lua:w-80",children:[(0,G.jsx)(n,{className:"lua:w-12 lua:h-12 lua:text-gray-500"}),(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1 lua:pl-2",children:[t.fileName||"File",(0,G.jsx)("span",{className:"lua:text-gray-500 lua:text-sm",children:t.mimeType})]})]})})},t.url)})}function PK(e){let t=[],n=e.split(`
87
- `).filter(r=>r.trim()!=="");for(let r of n){let a=/\[([^\]]+)\]\(([^)]+)\)\s+filename:([^\s]+)\s+mime:([^\s]+)/g,i;for(;(i=a.exec(r))!==null;){let[,s,u,c,d]=i;t.push({fileName:s.trim(),url:u.trim(),filename:c.trim(),mimeType:d.trim()})}}return t}function EK({message:e}){return(0,G.jsx)("div",{className:"chat-audio-message lua:flex lua:flex-col lua:mx-4 lua:sm:mx-5","data-testid":"audio-preview",children:(0,G.jsx)("div",{className:"chat-audio-container audio-playback-container lua:relative",children:(0,G.jsxs)("div",{className:"chat-audio-controls lua:flex lua:items-center lua:gap-2 lua:min-w-full",children:[(0,G.jsx)("audio",{src:e.url,controls:!0,className:"chat-audio-player lua:h-8",style:{backgroundColor:"transparent",border:"none"}}),e.isUploading&&(0,G.jsx)("div",{className:"chat-audio-upload-overlay lua:absolute lua:inset-0 lua:bg-black lua:bg-opacity-50 lua:rounded-lg lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("div",{className:"lua:text-white lua:text-sm",children:"Uploading..."})})]})})})}function rL({url:e}){return(0,G.jsxs)(Ce,{onClick:t=>{if(t.preventDefault(),/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){window.open(e,"_blank","noopener,noreferrer");return}let n=500,r=600,a=window.screen.width/2-n/2,i=window.screen.height/2-r/2,s=window.open(e,"Payment",`width=${n},height=${r},left=${a},top=${i},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);(!s||s.closed||typeof s.closed>"u")&&window.open(e,"_blank","noopener,noreferrer")},className:"chat-payment-button lua:rounded-xl",children:[(0,G.jsx)(I4,{size:16}),(0,G.jsx)("span",{children:"Open payment"})]})}function sL(e){let t=e.match(/!\[([^\]]+)\]\(([^)]+)\)/);if(!t)return null;let[,n,r]=t;return{text:n,url:r}}function IK(e){return e.replace(/([^\n]):::/g,`$1
86
+ `,e[0].empty=!0)},xT=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},uK=e=>{let t=[[]],n=[e],r=[0],a=[e.length],i=0,s=0,u=[],c=[u];for(;s>-1;){for(;(i=r[s]++)<a[s];){let d,p=t[s],m=n[s][i];if(typeof m=="string"?(p=s>0?p:["plain"],d=m):(p=xT(p,m.type),m.alias&&(p=xT(p,m.alias)),d=m.content),typeof d!="string"){s++,t.push(p),n.push(d),r.push(0),a.push(d.length);continue}let g=d.split(lK),b=g.length;u.push({types:p,content:g[0]});for(let C=1;C<b;C++)wT(u),c.push(u=[]),u.push({types:p,content:g[C]})}s--,t.pop(),n.pop(),r.pop(),a.pop()}return wT(u),c},bT=uK,cK=({prism:e,code:t,grammar:n,language:r})=>(0,RT.useMemo)(()=>{if(n==null)return bT([t]);let a={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",a),bT(a.tokens)},[t,n,r,e]),dK=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((a,i)=>{let{languages:s,style:u}=i;return s&&!s.includes(t)||i.types.forEach(c=>{let d=ko(ko({},a[c]),u);a[c]=d}),a},{});return r.root=n,r.plain=uf(ko({},n),{backgroundColor:void 0}),r},fK=dK,pK=({children:e,language:t,code:n,theme:r,prism:a})=>{let i=t.toLowerCase(),s=fK(r,i),u=iK(s),c=sK(s),d=a.languages[i],p=cK({prism:a,language:i,code:n,grammar:d});return e({tokens:p,className:`prism-code language-${i}`,style:s!=null?s.root:{},getLineProps:u,getTokenProps:c})},TT=e=>(0,PT.createElement)(pK,uf(ko({},e),{prism:e.prism||pe,theme:e.theme||NT,code:e.code,language:e.language}));});function df(e,t){let n=(0,cf.useRef)(t);(0,cf.useEffect)(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}var cf,p9=A(()=>{cf=Z(Se(),1)});function h9(e){return Object.freeze({__version:AT,map:e})}function m9(e,t){return Object.freeze({...e,...t})}function X1(){let e=(0,ff.useContext)(g9);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}var ff,AT,g9,Y1,J1=A(()=>{ff=Z(Se(),1),AT=1;g9=(0,ff.createContext)(null),Y1=g9.Provider});function IT(e){function t(n,r){let{instance:a,context:i}=e(n).current;return(0,Yr.useImperativeHandle)(r,()=>a),n.children==null?null:Yr.default.createElement(Y1,{value:i},n.children)}return(0,Yr.forwardRef)(t)}function OT(e){function t(n,r){let[a,i]=(0,Yr.useState)(!1),{instance:s}=e(n,i).current;(0,Yr.useImperativeHandle)(r,()=>s),(0,Yr.useEffect)(function(){a&&s.update()},[s,a,n.children]);let u=s._contentNode;return u?(0,MT.createPortal)(n.children,u):null}return(0,Yr.forwardRef)(t)}function DT(e){function t(n,r){let{instance:a}=e(n).current;return(0,Yr.useImperativeHandle)(r,()=>a),null}return(0,Yr.forwardRef)(t)}var Yr,MT,HT=A(()=>{Yr=Z(Se(),1),MT=Z(ks(),1);J1()});function hf(e,t){let n=(0,pf.useRef)();(0,pf.useEffect)(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}var pf,v9=A(()=>{pf=Z(Se(),1)});function ll(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}var mf=A(()=>{});function BT(e,t){return function(r,a){let i=X1(),s=e(ll(r,i),i);return df(i.map,r.attribution),hf(s.current,r.eventHandlers),t(s.current,i,r,a),s}}var FT=A(()=>{p9();J1();v9();mf()});var Q1=ur((gf,VT)=>{(function(e,t){typeof gf=="object"&&typeof VT<"u"?t(gf):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.leaflet={}))})(gf,(function(e){"use strict";var t="1.9.4";function n(o){var l,f,w,k;for(f=1,w=arguments.length;f<w;f++){k=arguments[f];for(l in k)o[l]=k[l]}return o}var r=Object.create||(function(){function o(){}return function(l){return o.prototype=l,new o}})();function a(o,l){var f=Array.prototype.slice;if(o.bind)return o.bind.apply(o,f.call(arguments,1));var w=f.call(arguments,2);return function(){return o.apply(l,w.length?w.concat(f.call(arguments)):arguments)}}var i=0;function s(o){return"_leaflet_id"in o||(o._leaflet_id=++i),o._leaflet_id}function u(o,l,f){var w,k,E,F;return F=function(){w=!1,k&&(E.apply(f,k),k=!1)},E=function(){w?k=arguments:(o.apply(f,arguments),setTimeout(F,l),w=!0)},E}function c(o,l,f){var w=l[1],k=l[0],E=w-k;return o===w&&f?o:((o-k)%E+E)%E+k}function d(){return!1}function p(o,l){if(l===!1)return o;var f=Math.pow(10,l===void 0?6:l);return Math.round(o*f)/f}function h(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function m(o){return h(o).split(/\s+/)}function g(o,l){Object.prototype.hasOwnProperty.call(o,"options")||(o.options=o.options?r(o.options):{});for(var f in l)o.options[f]=l[f];return o.options}function b(o,l,f){var w=[];for(var k in o)w.push(encodeURIComponent(f?k.toUpperCase():k)+"="+encodeURIComponent(o[k]));return(!l||l.indexOf("?")===-1?"?":"&")+w.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function S(o,l){return o.replace(C,function(f,w){var k=l[w];if(k===void 0)throw new Error("No value provided for variable "+f);return typeof k=="function"&&(k=k(l)),k})}var v=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function x(o,l){for(var f=0;f<o.length;f++)if(o[f]===l)return f;return-1}var _="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(o){return window["webkit"+o]||window["moz"+o]||window["ms"+o]}var T=0;function P(o){var l=+new Date,f=Math.max(0,16-(l-T));return T=l+f,window.setTimeout(o,f)}var R=window.requestAnimationFrame||N("RequestAnimationFrame")||P,O=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(o){window.clearTimeout(o)};function B(o,l,f){if(f&&R===P)o.call(l);else return R.call(window,a(o,l))}function z(o){o&&O.call(window,o)}var V={__proto__:null,extend:n,create:r,bind:a,get lastId(){return i},stamp:s,throttle:u,wrapNum:c,falseFn:d,formatNum:p,trim:h,splitWords:m,setOptions:g,getParamString:b,template:S,isArray:v,indexOf:x,emptyImageUrl:_,requestFn:R,cancelFn:O,requestAnimFrame:B,cancelAnimFrame:z};function H(){}H.extend=function(o){var l=function(){g(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},f=l.__super__=this.prototype,w=r(f);w.constructor=l,l.prototype=w;for(var k in this)Object.prototype.hasOwnProperty.call(this,k)&&k!=="prototype"&&k!=="__super__"&&(l[k]=this[k]);return o.statics&&n(l,o.statics),o.includes&&(U(o.includes),n.apply(null,[w].concat(o.includes))),n(w,o),delete w.statics,delete w.includes,w.options&&(w.options=f.options?r(f.options):{},n(w.options,o.options)),w._initHooks=[],w.callInitHooks=function(){if(!this._initHooksCalled){f.callInitHooks&&f.callInitHooks.call(this),this._initHooksCalled=!0;for(var E=0,F=w._initHooks.length;E<F;E++)w._initHooks[E].call(this)}},l},H.include=function(o){var l=this.prototype.options;return n(this.prototype,o),o.options&&(this.prototype.options=l,this.mergeOptions(o.options)),this},H.mergeOptions=function(o){return n(this.prototype.options,o),this},H.addInitHook=function(o){var l=Array.prototype.slice.call(arguments,1),f=typeof o=="function"?o:function(){this[o].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(f),this};function U(o){if(!(typeof L>"u"||!L||!L.Mixin)){o=v(o)?o:[o];for(var l=0;l<o.length;l++)o[l]===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)}}var $={on:function(o,l,f){if(typeof o=="object")for(var w in o)this._on(w,o[w],l);else{o=m(o);for(var k=0,E=o.length;k<E;k++)this._on(o[k],l,f)}return this},off:function(o,l,f){if(!arguments.length)delete this._events;else if(typeof o=="object")for(var w in o)this._off(w,o[w],l);else{o=m(o);for(var k=arguments.length===1,E=0,F=o.length;E<F;E++)k?this._off(o[E]):this._off(o[E],l,f)}return this},_on:function(o,l,f,w){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(o,l,f)===!1){f===this&&(f=void 0);var k={fn:l,ctx:f};w&&(k.once=!0),this._events=this._events||{},this._events[o]=this._events[o]||[],this._events[o].push(k)}},_off:function(o,l,f){var w,k,E;if(this._events&&(w=this._events[o],!!w)){if(arguments.length===1){if(this._firingCount)for(k=0,E=w.length;k<E;k++)w[k].fn=d;delete this._events[o];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var F=this._listens(o,l,f);if(F!==!1){var Y=w[F];this._firingCount&&(Y.fn=d,this._events[o]=w=w.slice()),w.splice(F,1)}}},fire:function(o,l,f){if(!this.listens(o,f))return this;var w=n({},l,{type:o,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var k=this._events[o];if(k){this._firingCount=this._firingCount+1||1;for(var E=0,F=k.length;E<F;E++){var Y=k[E],ee=Y.fn;Y.once&&this.off(o,ee,Y.ctx),ee.call(Y.ctx||this,w)}this._firingCount--}}return f&&this._propagateEvent(w),this},listens:function(o,l,f,w){typeof o!="string"&&console.warn('"string" type argument expected');var k=l;typeof l!="function"&&(w=!!l,k=void 0,f=void 0);var E=this._events&&this._events[o];if(E&&E.length&&this._listens(o,k,f)!==!1)return!0;if(w){for(var F in this._eventParents)if(this._eventParents[F].listens(o,l,f,w))return!0}return!1},_listens:function(o,l,f){if(!this._events)return!1;var w=this._events[o]||[];if(!l)return!!w.length;f===this&&(f=void 0);for(var k=0,E=w.length;k<E;k++)if(w[k].fn===l&&w[k].ctx===f)return k;return!1},once:function(o,l,f){if(typeof o=="object")for(var w in o)this._on(w,o[w],l,!0);else{o=m(o);for(var k=0,E=o.length;k<E;k++)this._on(o[k],l,f,!0)}return this},addEventParent:function(o){return this._eventParents=this._eventParents||{},this._eventParents[s(o)]=o,this},removeEventParent:function(o){return this._eventParents&&delete this._eventParents[s(o)],this},_propagateEvent:function(o){for(var l in this._eventParents)this._eventParents[l].fire(o.type,n({layer:o.target,propagatedFrom:o.target},o),!0)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var X=H.extend($);function W(o,l,f){this.x=f?Math.round(o):o,this.y=f?Math.round(l):l}var oe=Math.trunc||function(o){return o>0?Math.floor(o):Math.ceil(o)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(o){return this.clone()._add(J(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(J(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new W(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new W(this.x/o.x,this.y/o.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=oe(this.x),this.y=oe(this.y),this},distanceTo:function(o){o=J(o);var l=o.x-this.x,f=o.y-this.y;return Math.sqrt(l*l+f*f)},equals:function(o){return o=J(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=J(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function J(o,l,f){return o instanceof W?o:v(o)?new W(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new W(o.x,o.y):new W(o,l,f)}function K(o,l){if(o)for(var f=l?[o,l]:o,w=0,k=f.length;w<k;w++)this.extend(f[w])}K.prototype={extend:function(o){var l,f;if(!o)return this;if(o instanceof W||typeof o[0]=="number"||"x"in o)l=f=J(o);else if(o=M(o),l=o.min,f=o.max,!l||!f)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=f.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(f.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(f.y,this.max.y)),this},getCenter:function(o){return J((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,o)},getBottomLeft:function(){return J(this.min.x,this.max.y)},getTopRight:function(){return J(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(o){var l,f;return typeof o[0]=="number"||o instanceof W?o=J(o):o=M(o),o instanceof K?(l=o.min,f=o.max):l=f=o,l.x>=this.min.x&&f.x<=this.max.x&&l.y>=this.min.y&&f.y<=this.max.y},intersects:function(o){o=M(o);var l=this.min,f=this.max,w=o.min,k=o.max,E=k.x>=l.x&&w.x<=f.x,F=k.y>=l.y&&w.y<=f.y;return E&&F},overlaps:function(o){o=M(o);var l=this.min,f=this.max,w=o.min,k=o.max,E=k.x>l.x&&w.x<f.x,F=k.y>l.y&&w.y<f.y;return E&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(o){var l=this.min,f=this.max,w=Math.abs(l.x-f.x)*o,k=Math.abs(l.y-f.y)*o;return M(J(l.x-w,l.y-k),J(f.x+w,f.y+k))},equals:function(o){return o?(o=M(o),this.min.equals(o.getTopLeft())&&this.max.equals(o.getBottomRight())):!1}};function M(o,l){return!o||o instanceof K?o:new K(o,l)}function ve(o,l){if(o)for(var f=l?[o,l]:o,w=0,k=f.length;w<k;w++)this.extend(f[w])}ve.prototype={extend:function(o){var l=this._southWest,f=this._northEast,w,k;if(o instanceof I)w=o,k=o;else if(o instanceof ve){if(w=o._southWest,k=o._northEast,!w||!k)return this}else return o?this.extend(ne(o)||Ee(o)):this;return!l&&!f?(this._southWest=new I(w.lat,w.lng),this._northEast=new I(k.lat,k.lng)):(l.lat=Math.min(w.lat,l.lat),l.lng=Math.min(w.lng,l.lng),f.lat=Math.max(k.lat,f.lat),f.lng=Math.max(k.lng,f.lng)),this},pad:function(o){var l=this._southWest,f=this._northEast,w=Math.abs(l.lat-f.lat)*o,k=Math.abs(l.lng-f.lng)*o;return new ve(new I(l.lat-w,l.lng-k),new I(f.lat+w,f.lng+k))},getCenter:function(){return new I((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 I(this.getNorth(),this.getWest())},getSouthEast:function(){return new I(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(o){typeof o[0]=="number"||o instanceof I||"lat"in o?o=ne(o):o=Ee(o);var l=this._southWest,f=this._northEast,w,k;return o instanceof ve?(w=o.getSouthWest(),k=o.getNorthEast()):w=k=o,w.lat>=l.lat&&k.lat<=f.lat&&w.lng>=l.lng&&k.lng<=f.lng},intersects:function(o){o=Ee(o);var l=this._southWest,f=this._northEast,w=o.getSouthWest(),k=o.getNorthEast(),E=k.lat>=l.lat&&w.lat<=f.lat,F=k.lng>=l.lng&&w.lng<=f.lng;return E&&F},overlaps:function(o){o=Ee(o);var l=this._southWest,f=this._northEast,w=o.getSouthWest(),k=o.getNorthEast(),E=k.lat>l.lat&&w.lat<f.lat,F=k.lng>l.lng&&w.lng<f.lng;return E&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(o,l){return o?(o=Ee(o),this._southWest.equals(o.getSouthWest(),l)&&this._northEast.equals(o.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Ee(o,l){return o instanceof ve?o:new ve(o,l)}function I(o,l,f){if(isNaN(o)||isNaN(l))throw new Error("Invalid LatLng object: ("+o+", "+l+")");this.lat=+o,this.lng=+l,f!==void 0&&(this.alt=+f)}I.prototype={equals:function(o,l){if(!o)return!1;o=ne(o);var f=Math.max(Math.abs(this.lat-o.lat),Math.abs(this.lng-o.lng));return f<=(l===void 0?1e-9:l)},toString:function(o){return"LatLng("+p(this.lat,o)+", "+p(this.lng,o)+")"},distanceTo:function(o){return ye.distance(this,ne(o))},wrap:function(){return ye.wrapLatLng(this)},toBounds:function(o){var l=180*o/40075017,f=l/Math.cos(Math.PI/180*this.lat);return Ee([this.lat-l,this.lng-f],[this.lat+l,this.lng+f])},clone:function(){return new I(this.lat,this.lng,this.alt)}};function ne(o,l,f){return o instanceof I?o:v(o)&&typeof o[0]!="object"?o.length===3?new I(o[0],o[1],o[2]):o.length===2?new I(o[0],o[1]):null:o==null?o:typeof o=="object"&&"lat"in o?new I(o.lat,"lng"in o?o.lng:o.lon,o.alt):l===void 0?null:new I(o,l,f)}var ze={latLngToPoint:function(o,l){var f=this.projection.project(o),w=this.scale(l);return this.transformation._transform(f,w)},pointToLatLng:function(o,l){var f=this.scale(l),w=this.transformation.untransform(o,f);return this.projection.unproject(w)},project:function(o){return this.projection.project(o)},unproject:function(o){return this.projection.unproject(o)},scale:function(o){return 256*Math.pow(2,o)},zoom:function(o){return Math.log(o/256)/Math.LN2},getProjectedBounds:function(o){if(this.infinite)return null;var l=this.projection.bounds,f=this.scale(o),w=this.transformation.transform(l.min,f),k=this.transformation.transform(l.max,f);return new K(w,k)},infinite:!1,wrapLatLng:function(o){var l=this.wrapLng?c(o.lng,this.wrapLng,!0):o.lng,f=this.wrapLat?c(o.lat,this.wrapLat,!0):o.lat,w=o.alt;return new I(f,l,w)},wrapLatLngBounds:function(o){var l=o.getCenter(),f=this.wrapLatLng(l),w=l.lat-f.lat,k=l.lng-f.lng;if(w===0&&k===0)return o;var E=o.getSouthWest(),F=o.getNorthEast(),Y=new I(E.lat-w,E.lng-k),ee=new I(F.lat-w,F.lng-k);return new ve(Y,ee)}},ye=n({},ze,{wrapLng:[-180,180],R:6371e3,distance:function(o,l){var f=Math.PI/180,w=o.lat*f,k=l.lat*f,E=Math.sin((l.lat-o.lat)*f/2),F=Math.sin((l.lng-o.lng)*f/2),Y=E*E+Math.cos(w)*Math.cos(k)*F*F,ee=2*Math.atan2(Math.sqrt(Y),Math.sqrt(1-Y));return this.R*ee}}),fe=6378137,de={R:fe,MAX_LATITUDE:85.0511287798,project:function(o){var l=Math.PI/180,f=this.MAX_LATITUDE,w=Math.max(Math.min(f,o.lat),-f),k=Math.sin(w*l);return new W(this.R*o.lng*l,this.R*Math.log((1+k)/(1-k))/2)},unproject:function(o){var l=180/Math.PI;return new I((2*Math.atan(Math.exp(o.y/this.R))-Math.PI/2)*l,o.x*l/this.R)},bounds:(function(){var o=fe*Math.PI;return new K([-o,-o],[o,o])})()};function he(o,l,f,w){if(v(o)){this._a=o[0],this._b=o[1],this._c=o[2],this._d=o[3];return}this._a=o,this._b=l,this._c=f,this._d=w}he.prototype={transform:function(o,l){return this._transform(o.clone(),l)},_transform:function(o,l){return l=l||1,o.x=l*(this._a*o.x+this._b),o.y=l*(this._c*o.y+this._d),o},untransform:function(o,l){return l=l||1,new W((o.x/l-this._b)/this._a,(o.y/l-this._d)/this._c)}};function Ne(o,l,f,w){return new he(o,l,f,w)}var D=n({},ye,{code:"EPSG:3857",projection:de,transformation:(function(){var o=.5/(Math.PI*de.R);return Ne(o,.5,-o,.5)})()}),te=n({},D,{code:"EPSG:900913"});function ce(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function ge(o,l){var f="",w,k,E,F,Y,ee;for(w=0,E=o.length;w<E;w++){for(Y=o[w],k=0,F=Y.length;k<F;k++)ee=Y[k],f+=(k?"L":"M")+ee.x+" "+ee.y;f+=l?qe.svg?"z":"x":""}return f||"M0 0"}var ie=document.documentElement.style,Q="ActiveXObject"in window,se=Q&&!document.addEventListener,re="msLaunchUri"in navigator&&!("documentMode"in document),xe=lo("webkit"),Ye=lo("android"),xt=lo("android 2")||lo("android 3"),Tt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Cn=Ye&&lo("Google")&&Tt<537&&!("AudioNode"in window),sn=!!window.opera,wn=!re&&lo("chrome"),ae=lo("gecko")&&!xe&&!sn&&!Q,_e=!wn&&lo("safari"),Je=lo("phantom"),at="OTransition"in ie,mt=navigator.platform.indexOf("Win")===0,xn=Q&&"transition"in ie,Jn="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!xt,$t="MozPerspective"in ie,ta=!window.L_DISABLE_3D&&(xn||Jn||$t)&&!at&&!Je,xr=typeof orientation<"u"||lo("mobile"),Qn=xr&&xe,so=xr&&Jn,Or=!window.PointerEvent&&window.MSPointerEvent,Fu=!!(window.PointerEvent||Or),gd="ontouchstart"in window||!!window.TouchEvent,vd=!window.L_NO_TOUCH&&(gd||Fu),yd=xr&&sn,Cd=xr&&ae,Hf=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,wd=(function(){var o=!1;try{var l=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",d,l),window.removeEventListener("testPassiveEventSupport",d,l)}catch{}return o})(),xd=(function(){return!!document.createElement("canvas").getContext})(),Vu=!!(document.createElementNS&&ce("svg").createSVGRect),UA=!!Vu&&(function(){var o=document.createElement("div");return o.innerHTML="<svg/>",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ZA=!Vu&&(function(){try{var o=document.createElement("div");o.innerHTML='<v:shape adj="1"/>';var l=o.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}})(),$A=navigator.platform.indexOf("Mac")===0,WA=navigator.platform.indexOf("Linux")===0;function lo(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var qe={ie:Q,ielt9:se,edge:re,webkit:xe,android:Ye,android23:xt,androidStock:Cn,opera:sn,chrome:wn,gecko:ae,safari:_e,phantom:Je,opera12:at,win:mt,ie3d:xn,webkit3d:Jn,gecko3d:$t,any3d:ta,mobile:xr,mobileWebkit:Qn,mobileWebkit3d:so,msPointer:Or,pointer:Fu,touch:vd,touchNative:gd,mobileOpera:yd,mobileGecko:Cd,retina:Hf,passiveEvents:wd,canvas:xd,svg:Vu,vml:ZA,inlineSvg:UA,mac:$A,linux:WA},T7=qe.msPointer?"MSPointerDown":"pointerdown",L7=qe.msPointer?"MSPointerMove":"pointermove",A7=qe.msPointer?"MSPointerUp":"pointerup",M7=qe.msPointer?"MSPointerCancel":"pointercancel",Bf={touchstart:T7,touchmove:L7,touchend:A7,touchcancel:M7},I7={touchstart:JA,touchmove:bd,touchend:bd,touchcancel:bd},gl={},O7=!1;function GA(o,l,f){return l==="touchstart"&&XA(),I7[l]?(f=I7[l].bind(this,f),o.addEventListener(Bf[l],f,!1),f):(console.warn("wrong event specified:",l),d)}function qA(o,l,f){if(!Bf[l]){console.warn("wrong event specified:",l);return}o.removeEventListener(Bf[l],f,!1)}function KA(o){gl[o.pointerId]=o}function YA(o){gl[o.pointerId]&&(gl[o.pointerId]=o)}function D7(o){delete gl[o.pointerId]}function XA(){O7||(document.addEventListener(T7,KA,!0),document.addEventListener(L7,YA,!0),document.addEventListener(A7,D7,!0),document.addEventListener(M7,D7,!0),O7=!0)}function bd(o,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var f in gl)l.touches.push(gl[f]);l.changedTouches=[l],o(l)}}function JA(o,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&er(l),bd(o,l)}function QA(o){var l={},f,w;for(w in o)f=o[w],l[w]=f&&f.bind?f.bind(o):f;return o=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var eM=200;function tM(o,l){o.addEventListener("dblclick",l);var f=0,w;function k(E){if(E.detail!==1){w=E.detail;return}if(!(E.pointerType==="mouse"||E.sourceCapabilities&&!E.sourceCapabilities.firesTouchEvents)){var F=z7(E);if(!(F.some(function(ee){return ee instanceof HTMLLabelElement&&ee.attributes.for})&&!F.some(function(ee){return ee instanceof HTMLInputElement||ee instanceof HTMLSelectElement}))){var Y=Date.now();Y-f<=eM?(w++,w===2&&l(QA(E))):w=1,f=Y}}}return o.addEventListener("click",k),{dblclick:l,simDblclick:k}}function nM(o,l){o.removeEventListener("dblclick",l.dblclick),o.removeEventListener("click",l.simDblclick)}var Ff=kd(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),zu=kd(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),H7=zu==="webkitTransition"||zu==="OTransition"?zu+"End":"transitionend";function B7(o){return typeof o=="string"?document.getElementById(o):o}function ju(o,l){var f=o.style[l]||o.currentStyle&&o.currentStyle[l];if((!f||f==="auto")&&document.defaultView){var w=document.defaultView.getComputedStyle(o,null);f=w?w[l]:null}return f==="auto"?null:f}function Nt(o,l,f){var w=document.createElement(o);return w.className=l||"",f&&f.appendChild(w),w}function Qt(o){var l=o.parentNode;l&&l.removeChild(o)}function _d(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function vl(o){var l=o.parentNode;l&&l.lastChild!==o&&l.appendChild(o)}function yl(o){var l=o.parentNode;l&&l.firstChild!==o&&l.insertBefore(o,l.firstChild)}function Vf(o,l){if(o.classList!==void 0)return o.classList.contains(l);var f=Sd(o);return f.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(f)}function ft(o,l){if(o.classList!==void 0)for(var f=m(l),w=0,k=f.length;w<k;w++)o.classList.add(f[w]);else if(!Vf(o,l)){var E=Sd(o);zf(o,(E?E+" ":"")+l)}}function cn(o,l){o.classList!==void 0?o.classList.remove(l):zf(o,h((" "+Sd(o)+" ").replace(" "+l+" "," ")))}function zf(o,l){o.className.baseVal===void 0?o.className=l:o.className.baseVal=l}function Sd(o){return o.correspondingElement&&(o=o.correspondingElement),o.className.baseVal===void 0?o.className:o.className.baseVal}function ga(o,l){"opacity"in o.style?o.style.opacity=l:"filter"in o.style&&rM(o,l)}function rM(o,l){var f=!1,w="DXImageTransform.Microsoft.Alpha";try{f=o.filters.item(w)}catch{if(l===1)return}l=Math.round(l*100),f?(f.Enabled=l!==100,f.Opacity=l):o.style.filter+=" progid:"+w+"(opacity="+l+")"}function kd(o){for(var l=document.documentElement.style,f=0;f<o.length;f++)if(o[f]in l)return o[f];return!1}function os(o,l,f){var w=l||new W(0,0);o.style[Ff]=(qe.ie3d?"translate("+w.x+"px,"+w.y+"px)":"translate3d("+w.x+"px,"+w.y+"px,0)")+(f?" scale("+f+")":"")}function bn(o,l){o._leaflet_pos=l,qe.any3d?os(o,l):(o.style.left=l.x+"px",o.style.top=l.y+"px")}function is(o){return o._leaflet_pos||new W(0,0)}var Uu,Zu,jf;if("onselectstart"in document)Uu=function(){ut(window,"selectstart",er)},Zu=function(){Ht(window,"selectstart",er)};else{var $u=kd(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Uu=function(){if($u){var o=document.documentElement.style;jf=o[$u],o[$u]="none"}},Zu=function(){$u&&(document.documentElement.style[$u]=jf,jf=void 0)}}function Uf(){ut(window,"dragstart",er)}function Zf(){Ht(window,"dragstart",er)}var Nd,$f;function Wf(o){for(;o.tabIndex===-1;)o=o.parentNode;o.style&&(Pd(),Nd=o,$f=o.style.outlineStyle,o.style.outlineStyle="none",ut(window,"keydown",Pd))}function Pd(){Nd&&(Nd.style.outlineStyle=$f,Nd=void 0,$f=void 0,Ht(window,"keydown",Pd))}function F7(o){do o=o.parentNode;while((!o.offsetWidth||!o.offsetHeight)&&o!==document.body);return o}function Gf(o){var l=o.getBoundingClientRect();return{x:l.width/o.offsetWidth||1,y:l.height/o.offsetHeight||1,boundingClientRect:l}}var aM={__proto__:null,TRANSFORM:Ff,TRANSITION:zu,TRANSITION_END:H7,get:B7,getStyle:ju,create:Nt,remove:Qt,empty:_d,toFront:vl,toBack:yl,hasClass:Vf,addClass:ft,removeClass:cn,setClass:zf,getClass:Sd,setOpacity:ga,testProp:kd,setTransform:os,setPosition:bn,getPosition:is,get disableTextSelection(){return Uu},get enableTextSelection(){return Zu},disableImageDrag:Uf,enableImageDrag:Zf,preventOutline:Wf,restoreOutline:Pd,getSizedParentNode:F7,getScale:Gf};function ut(o,l,f,w){if(l&&typeof l=="object")for(var k in l)Kf(o,k,l[k],f);else{l=m(l);for(var E=0,F=l.length;E<F;E++)Kf(o,l[E],f,w)}return this}var uo="_leaflet_events";function Ht(o,l,f,w){if(arguments.length===1)V7(o),delete o[uo];else if(l&&typeof l=="object")for(var k in l)Yf(o,k,l[k],f);else if(l=m(l),arguments.length===2)V7(o,function(Y){return x(l,Y)!==-1});else for(var E=0,F=l.length;E<F;E++)Yf(o,l[E],f,w);return this}function V7(o,l){for(var f in o[uo]){var w=f.split(/\d/)[0];(!l||l(w))&&Yf(o,w,null,null,f)}}var qf={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Kf(o,l,f,w){var k=l+s(f)+(w?"_"+s(w):"");if(o[uo]&&o[uo][k])return this;var E=function(Y){return f.call(w||o,Y||window.event)},F=E;!qe.touchNative&&qe.pointer&&l.indexOf("touch")===0?E=GA(o,l,E):qe.touch&&l==="dblclick"?E=tM(o,E):"addEventListener"in o?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?o.addEventListener(qf[l]||l,E,qe.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(E=function(Y){Y=Y||window.event,Jf(o,Y)&&F(Y)},o.addEventListener(qf[l],E,!1)):o.addEventListener(l,F,!1):o.attachEvent("on"+l,E),o[uo]=o[uo]||{},o[uo][k]=E}function Yf(o,l,f,w,k){k=k||l+s(f)+(w?"_"+s(w):"");var E=o[uo]&&o[uo][k];if(!E)return this;!qe.touchNative&&qe.pointer&&l.indexOf("touch")===0?qA(o,l,E):qe.touch&&l==="dblclick"?nM(o,E):"removeEventListener"in o?o.removeEventListener(qf[l]||l,E,!1):o.detachEvent("on"+l,E),o[uo][k]=null}function ss(o){return o.stopPropagation?o.stopPropagation():o.originalEvent?o.originalEvent._stopped=!0:o.cancelBubble=!0,this}function Xf(o){return Kf(o,"wheel",ss),this}function Wu(o){return ut(o,"mousedown touchstart dblclick contextmenu",ss),o._leaflet_disable_click=!0,this}function er(o){return o.preventDefault?o.preventDefault():o.returnValue=!1,this}function ls(o){return er(o),ss(o),this}function z7(o){if(o.composedPath)return o.composedPath();for(var l=[],f=o.target;f;)l.push(f),f=f.parentNode;return l}function j7(o,l){if(!l)return new W(o.clientX,o.clientY);var f=Gf(l),w=f.boundingClientRect;return new W((o.clientX-w.left)/f.x-l.clientLeft,(o.clientY-w.top)/f.y-l.clientTop)}var oM=qe.linux&&qe.chrome?window.devicePixelRatio:qe.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function U7(o){return qe.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/oM:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function Jf(o,l){var f=l.relatedTarget;if(!f)return!0;try{for(;f&&f!==o;)f=f.parentNode}catch{return!1}return f!==o}var iM={__proto__:null,on:ut,off:Ht,stopPropagation:ss,disableScrollPropagation:Xf,disableClickPropagation:Wu,preventDefault:er,stop:ls,getPropagationPath:z7,getMousePosition:j7,getWheelDelta:U7,isExternalTarget:Jf,addListener:ut,removeListener:Ht},Z7=X.extend({run:function(o,l,f,w){this.stop(),this._el=o,this._inProgress=!0,this._duration=f||.25,this._easeOutPower=1/Math.max(w||.5,.2),this._startPos=is(o),this._offset=l.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=B(this._animate,this),this._step()},_step:function(o){var l=+new Date-this._startTime,f=this._duration*1e3;l<f?this._runFrame(this._easeOut(l/f),o):(this._runFrame(1),this._complete())},_runFrame:function(o,l){var f=this._startPos.add(this._offset.multiplyBy(o));l&&f._round(),bn(this._el,f),this.fire("step")},_complete:function(){z(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(o){return 1-Math.pow(1-o,this._easeOutPower)}}),bt=X.extend({options:{crs:D,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(o,l){l=g(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(o),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(ne(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=zu&&qe.any3d&&!qe.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ut(this._proxy,H7,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(o,l,f){if(l=l===void 0?this._zoom:this._limitZoom(l),o=this._limitCenter(ne(o),l,this.options.maxBounds),f=f||{},this._stop(),this._loaded&&!f.reset&&f!==!0){f.animate!==void 0&&(f.zoom=n({animate:f.animate},f.zoom),f.pan=n({animate:f.animate,duration:f.duration},f.pan));var w=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(o,l,f.zoom):this._tryAnimatedPan(o,f.pan);if(w)return clearTimeout(this._sizeTimer),this}return this._resetView(o,l,f.pan&&f.pan.noMoveStart),this},setZoom:function(o,l){return this._loaded?this.setView(this.getCenter(),o,{zoom:l}):(this._zoom=o,this)},zoomIn:function(o,l){return o=o||(qe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+o,l)},zoomOut:function(o,l){return o=o||(qe.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-o,l)},setZoomAround:function(o,l,f){var w=this.getZoomScale(l),k=this.getSize().divideBy(2),E=o instanceof W?o:this.latLngToContainerPoint(o),F=E.subtract(k).multiplyBy(1-1/w),Y=this.containerPointToLatLng(k.add(F));return this.setView(Y,l,{zoom:f})},_getBoundsCenterZoom:function(o,l){l=l||{},o=o.getBounds?o.getBounds():Ee(o);var f=J(l.paddingTopLeft||l.padding||[0,0]),w=J(l.paddingBottomRight||l.padding||[0,0]),k=this.getBoundsZoom(o,!1,f.add(w));if(k=typeof l.maxZoom=="number"?Math.min(l.maxZoom,k):k,k===1/0)return{center:o.getCenter(),zoom:k};var E=w.subtract(f).divideBy(2),F=this.project(o.getSouthWest(),k),Y=this.project(o.getNorthEast(),k),ee=this.unproject(F.add(Y).divideBy(2).add(E),k);return{center:ee,zoom:k}},fitBounds:function(o,l){if(o=Ee(o),!o.isValid())throw new Error("Bounds are not valid.");var f=this._getBoundsCenterZoom(o,l);return this.setView(f.center,f.zoom,l)},fitWorld:function(o){return this.fitBounds([[-90,-180],[90,180]],o)},panTo:function(o,l){return this.setView(o,this._zoom,{pan:l})},panBy:function(o,l){if(o=J(o).round(),l=l||{},!o.x&&!o.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(o))return this._resetView(this.unproject(this.project(this.getCenter()).add(o)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Z7,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){ft(this._mapPane,"leaflet-pan-anim");var f=this._getMapPanePos().subtract(o).round();this._panAnim.run(this._mapPane,f,l.duration||.25,l.easeLinearity)}else this._rawPanBy(o),this.fire("move").fire("moveend");return this},flyTo:function(o,l,f){if(f=f||{},f.animate===!1||!qe.any3d)return this.setView(o,l,f);this._stop();var w=this.project(this.getCenter()),k=this.project(o),E=this.getSize(),F=this._zoom;o=ne(o),l=l===void 0?F:l;var Y=Math.max(E.x,E.y),ee=Y*this.getZoomScale(F,l),me=k.distanceTo(w)||1,He=1.42,nt=He*He;function gt(_n){var Fd=_n?-1:1,qM=_n?ee:Y,KM=ee*ee-Y*Y+Fd*nt*nt*me*me,YM=2*qM*nt*me,up=KM/YM,S8=Math.sqrt(up*up+1)-up,XM=S8<1e-9?-18:Math.log(S8);return XM}function br(_n){return(Math.exp(_n)-Math.exp(-_n))/2}function zn(_n){return(Math.exp(_n)+Math.exp(-_n))/2}function ya(_n){return br(_n)/zn(_n)}var Dr=gt(0);function Sl(_n){return Y*(zn(Dr)/zn(Dr+He*_n))}function ZM(_n){return Y*(zn(Dr)*ya(Dr+He*_n)-br(Dr))/nt}function $M(_n){return 1-Math.pow(1-_n,1.5)}var WM=Date.now(),b8=(gt(1)-Dr)/He,GM=f.duration?1e3*f.duration:1e3*b8*.8;function _8(){var _n=(Date.now()-WM)/GM,Fd=$M(_n)*b8;_n<=1?(this._flyToFrame=B(_8,this),this._move(this.unproject(w.add(k.subtract(w).multiplyBy(ZM(Fd)/me)),F),this.getScaleZoom(Y/Sl(Fd),F),{flyTo:!0})):this._move(o,l)._moveEnd(!0)}return this._moveStart(!0,f.noMoveStart),_8.call(this),this},flyToBounds:function(o,l){var f=this._getBoundsCenterZoom(o,l);return this.flyTo(f.center,f.zoom,l)},setMaxBounds:function(o){return o=Ee(o),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),o.isValid()?(this.options.maxBounds=o,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(o){var l=this.options.minZoom;return this.options.minZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(o):this},setMaxZoom:function(o){var l=this.options.maxZoom;return this.options.maxZoom=o,this._loaded&&l!==o&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,l){this._enforcingBounds=!0;var f=this.getCenter(),w=this._limitCenter(f,this._zoom,Ee(o));return f.equals(w)||this.panTo(w,l),this._enforcingBounds=!1,this},panInside:function(o,l){l=l||{};var f=J(l.paddingTopLeft||l.padding||[0,0]),w=J(l.paddingBottomRight||l.padding||[0,0]),k=this.project(this.getCenter()),E=this.project(o),F=this.getPixelBounds(),Y=M([F.min.add(f),F.max.subtract(w)]),ee=Y.getSize();if(!Y.contains(E)){this._enforcingBounds=!0;var me=E.subtract(Y.getCenter()),He=Y.extend(E).getSize().subtract(ee);k.x+=me.x<0?-He.x:He.x,k.y+=me.y<0?-He.y:He.y,this.panTo(this.unproject(k),l),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=n({animate:!1,pan:!0},o===!0?{animate:!0}:o);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var f=this.getSize(),w=l.divideBy(2).round(),k=f.divideBy(2).round(),E=w.subtract(k);return!E.x&&!E.y?this:(o.animate&&o.pan?this.panBy(E):(o.pan&&this._rawPanBy(E),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:f}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=n({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),f=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,f,o):navigator.geolocation.getCurrentPosition(l,f,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var l=o.code,f=o.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+f+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var l=o.coords.latitude,f=o.coords.longitude,w=new I(l,f),k=w.toBounds(o.coords.accuracy*2),E=this._locateOptions;if(E.setView){var F=this.getBoundsZoom(k);this.setView(w,E.maxZoom?Math.min(F,E.maxZoom):F)}var Y={latlng:w,bounds:k,timestamp:o.timestamp};for(var ee in o.coords)typeof o.coords[ee]=="number"&&(Y[ee]=o.coords[ee]);this.fire("locationfound",Y)}},addHandler:function(o,l){if(!l)return this;var f=this[o]=new l(this);return this._handlers.push(f),this.options[o]&&f.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),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{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(z(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)Qt(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,l){var f="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),w=Nt("div",f,l||this._mapPane);return o&&(this._panes[o]=w),w},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),l=this.unproject(o.getBottomLeft()),f=this.unproject(o.getTopRight());return new ve(l,f)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,l,f){o=Ee(o),f=J(f||[0,0]);var w=this.getZoom()||0,k=this.getMinZoom(),E=this.getMaxZoom(),F=o.getNorthWest(),Y=o.getSouthEast(),ee=this.getSize().subtract(f),me=M(this.project(Y,w),this.project(F,w)).getSize(),He=qe.any3d?this.options.zoomSnap:1,nt=ee.x/me.x,gt=ee.y/me.y,br=l?Math.max(nt,gt):Math.min(nt,gt);return w=this.getScaleZoom(br,w),He&&(w=Math.round(w/(He/100))*(He/100),w=l?Math.ceil(w/He)*He:Math.floor(w/He)*He),Math.max(k,Math.min(E,w))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,l){var f=this._getTopLeftPoint(o,l);return new K(f,f.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,l){var f=this.options.crs;return l=l===void 0?this._zoom:l,f.scale(o)/f.scale(l)},getScaleZoom:function(o,l){var f=this.options.crs;l=l===void 0?this._zoom:l;var w=f.zoom(o*f.scale(l));return isNaN(w)?1/0:w},project:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(ne(o),l)},unproject:function(o,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(J(o),l)},layerPointToLatLng:function(o){var l=J(o).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(o){var l=this.project(ne(o))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(ne(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds(Ee(o))},distance:function(o,l){return this.options.crs.distance(ne(o),ne(l))},containerPointToLayerPoint:function(o){return J(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return J(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var l=this.containerPointToLayerPoint(J(o));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ne(o)))},mouseEventToContainerPoint:function(o){return j7(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var l=this._container=B7(o);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ut(l,"scroll",this._onScroll,this),this._containerId=s(l)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&qe.any3d,ft(o,"leaflet-container"+(qe.touch?" leaflet-touch":"")+(qe.retina?" leaflet-retina":"")+(qe.ielt9?" leaflet-oldie":"")+(qe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=ju(o,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),bn(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ft(o.markerPane,"leaflet-zoom-hide"),ft(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,l,f){bn(this._mapPane,new W(0,0));var w=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var k=this._zoom!==l;this._moveStart(k,f)._move(o,l)._moveEnd(k),this.fire("viewreset"),w&&this.fire("load")},_moveStart:function(o,l){return o&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(o,l,f,w){l===void 0&&(l=this._zoom);var k=this._zoom!==l;return this._zoom=l,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),w?f&&f.pinch&&this.fire("zoom",f):((k||f&&f.pinch)&&this.fire("zoom",f),this.fire("move",f)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return z(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){bn(this._mapPane,this._getMapPanePos().subtract(o))},_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(o){this._targets={},this._targets[s(this._container)]=this;var l=o?Ht:ut;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),qe.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){z(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,l){for(var f=[],w,k=l==="mouseout"||l==="mouseover",E=o.target||o.srcElement,F=!1;E;){if(w=this._targets[s(E)],w&&(l==="click"||l==="preclick")&&this._draggableMoved(w)){F=!0;break}if(w&&w.listens(l,!0)&&(k&&!Jf(E,o)||(f.push(w),k))||E===this._container)break;E=E.parentNode}return!f.length&&!F&&!k&&this.listens(l,!0)&&(f=[this]),f},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var l=o.target||o.srcElement;if(!(!this._loaded||l._leaflet_disable_events||o.type==="click"&&this._isClickDisabled(l))){var f=o.type;f==="mousedown"&&Wf(l),this._fireDOMEvent(o,f)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,l,f){if(o.type==="click"){var w=n({},o);w.type="preclick",this._fireDOMEvent(w,w.type,f)}var k=this._findEventTargets(o,l);if(f){for(var E=[],F=0;F<f.length;F++)f[F].listens(l,!0)&&E.push(f[F]);k=E.concat(k)}if(k.length){l==="contextmenu"&&er(o);var Y=k[0],ee={originalEvent:o};if(o.type!=="keypress"&&o.type!=="keydown"&&o.type!=="keyup"){var me=Y.getLatLng&&(!Y._radius||Y._radius<=10);ee.containerPoint=me?this.latLngToContainerPoint(Y.getLatLng()):this.mouseEventToContainerPoint(o),ee.layerPoint=this.containerPointToLayerPoint(ee.containerPoint),ee.latlng=me?Y.getLatLng():this.layerPointToLatLng(ee.layerPoint)}for(F=0;F<k.length;F++)if(k[F].fire(l,ee,!0),ee.originalEvent._stopped||k[F].options.bubblingMouseEvents===!1&&x(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(o){return o=o.dragging&&o.dragging.enabled()?o:this,o.dragging&&o.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var o=0,l=this._handlers.length;o<l;o++)this._handlers[o].disable()},whenReady:function(o,l){return this._loaded?o.call(l||this,{target:this}):this.on("load",o,l),this},_getMapPanePos:function(){return is(this._mapPane)||new W(0,0)},_moved:function(){var o=this._getMapPanePos();return o&&!o.equals([0,0])},_getTopLeftPoint:function(o,l){var f=o&&l!==void 0?this._getNewPixelOrigin(o,l):this.getPixelOrigin();return f.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(o,l){var f=this.getSize()._divideBy(2);return this.project(o,l)._subtract(f)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(o,l,f){var w=this._getNewPixelOrigin(f,l);return this.project(o,l)._subtract(w)},_latLngBoundsToNewLayerBounds:function(o,l,f){var w=this._getNewPixelOrigin(f,l);return M([this.project(o.getSouthWest(),l)._subtract(w),this.project(o.getNorthWest(),l)._subtract(w),this.project(o.getSouthEast(),l)._subtract(w),this.project(o.getNorthEast(),l)._subtract(w)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(o){return this.latLngToLayerPoint(o).subtract(this._getCenterLayerPoint())},_limitCenter:function(o,l,f){if(!f)return o;var w=this.project(o,l),k=this.getSize().divideBy(2),E=new K(w.subtract(k),w.add(k)),F=this._getBoundsOffset(E,f,l);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?o:this.unproject(w.add(F),l)},_limitOffset:function(o,l){if(!l)return o;var f=this.getPixelBounds(),w=new K(f.min.add(o),f.max.add(o));return o.add(this._getBoundsOffset(w,l))},_getBoundsOffset:function(o,l,f){var w=M(this.project(l.getNorthEast(),f),this.project(l.getSouthWest(),f)),k=w.min.subtract(o.min),E=w.max.subtract(o.max),F=this._rebound(k.x,-E.x),Y=this._rebound(k.y,-E.y);return new W(F,Y)},_rebound:function(o,l){return o+l>0?Math.round(o-l)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(l))},_limitZoom:function(o){var l=this.getMinZoom(),f=this.getMaxZoom(),w=qe.any3d?this.options.zoomSnap:1;return w&&(o=Math.round(o/w)*w),Math.max(l,Math.min(f,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){cn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,l){var f=this._getCenterOffset(o)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(f)?!1:(this.panBy(f,l),!0)},_createAnimProxy:function(){var o=this._proxy=Nt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(l){var f=Ff,w=this._proxy.style[f];os(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),w===this._proxy.style[f]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),l=this.getZoom();os(this._proxy,this.project(o,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,l,f){if(this._animatingZoom)return!0;if(f=f||{},!this._zoomAnimated||f.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var w=this.getZoomScale(l),k=this._getCenterOffset(o)._divideBy(1-1/w);return f.animate!==!0&&!this.getSize().contains(k)?!1:(B(function(){this._moveStart(!0,f.noMoveStart||!1)._animateZoom(o,l,!0)},this),!0)},_animateZoom:function(o,l,f,w){this._mapPane&&(f&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=l,ft(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:l,noUpdate:w}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&cn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function sM(o,l){return new bt(o,l)}var Fa=H.extend({options:{position:"topright"},initialize:function(o){g(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var l=this._map;return l&&l.removeControl(this),this.options.position=o,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var l=this._container=this.onAdd(o),f=this.getPosition(),w=o._controlCorners[f];return ft(l,"leaflet-control"),f.indexOf("bottom")!==-1?w.insertBefore(l,w.firstChild):w.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),Gu=function(o){return new Fa(o)};bt.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},l="leaflet-",f=this._controlContainer=Nt("div",l+"control-container",this._container);function w(k,E){var F=l+k+" "+l+E;o[k+E]=Nt("div",F,f)}w("top","left"),w("top","right"),w("bottom","left"),w("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)Qt(this._controlCorners[o]);Qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $7=Fa.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,l,f,w){return f<w?-1:w<f?1:0}},initialize:function(o,l,f){g(this,f),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var w in o)this._addLayer(o[w],w);for(w in l)this._addLayer(l[w],w,!0)},onAdd:function(o){this._initLayout(),this._update(),this._map=o,o.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(o){return Fa.prototype.addTo.call(this,o),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(o,l){return this._addLayer(o,l),this._map?this._update():this},addOverlay:function(o,l){return this._addLayer(o,l,!0),this._map?this._update():this},removeLayer:function(o){o.off("add remove",this._onLayerChange,this);var l=this._getLayer(s(o));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){ft(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var o=this._map.getSize().y-(this._container.offsetTop+50);return o<this._section.clientHeight?(ft(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=o+"px"):cn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return cn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var o="leaflet-control-layers",l=this._container=Nt("div",o),f=this.options.collapsed;l.setAttribute("aria-haspopup",!0),Wu(l),Xf(l);var w=this._section=Nt("section",o+"-list");f&&(this._map.on("click",this.collapse,this),ut(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var k=this._layersLink=Nt("a",o+"-toggle",l);k.href="#",k.title="Layers",k.setAttribute("role","button"),ut(k,{keydown:function(E){E.keyCode===13&&this._expandSafely()},click:function(E){er(E),this._expandSafely()}},this),f||this.expand(),this._baseLayersList=Nt("div",o+"-base",w),this._separator=Nt("div",o+"-separator",w),this._overlaysList=Nt("div",o+"-overlays",w),l.appendChild(w)},_getLayer:function(o){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&s(this._layers[l].layer)===o)return this._layers[l]},_addLayer:function(o,l,f){this._map&&o.on("add remove",this._onLayerChange,this),this._layers.push({layer:o,name:l,overlay:f}),this.options.sortLayers&&this._layers.sort(a(function(w,k){return this.options.sortFunction(w.layer,k.layer,w.name,k.name)},this)),this.options.autoZIndex&&o.setZIndex&&(this._lastZIndex++,o.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;_d(this._baseLayersList),_d(this._overlaysList),this._layerControlInputs=[];var o,l,f,w,k=0;for(f=0;f<this._layers.length;f++)w=this._layers[f],this._addItem(w),l=l||w.overlay,o=o||!w.overlay,k+=w.overlay?0:1;return this.options.hideSingleBase&&(o=o&&k>1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=l&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var l=this._getLayer(s(o.target)),f=l.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;f&&this._map.fire(f,l)},_createRadioElement:function(o,l){var f='<input type="radio" class="leaflet-control-layers-selector" name="'+o+'"'+(l?' checked="checked"':"")+"/>",w=document.createElement("div");return w.innerHTML=f,w.firstChild},_addItem:function(o){var l=document.createElement("label"),f=this._map.hasLayer(o.layer),w;o.overlay?(w=document.createElement("input"),w.type="checkbox",w.className="leaflet-control-layers-selector",w.defaultChecked=f):w=this._createRadioElement("leaflet-base-layers_"+s(this),f),this._layerControlInputs.push(w),w.layerId=s(o.layer),ut(w,"click",this._onInputClick,this);var k=document.createElement("span");k.innerHTML=" "+o.name;var E=document.createElement("span");l.appendChild(E),E.appendChild(w),E.appendChild(k);var F=o.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,l,f,w=[],k=[];this._handlingClick=!0;for(var E=o.length-1;E>=0;E--)l=o[E],f=this._getLayer(l.layerId).layer,l.checked?w.push(f):l.checked||k.push(f);for(E=0;E<k.length;E++)this._map.hasLayer(k[E])&&this._map.removeLayer(k[E]);for(E=0;E<w.length;E++)this._map.hasLayer(w[E])||this._map.addLayer(w[E]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var o=this._layerControlInputs,l,f,w=this._map.getZoom(),k=o.length-1;k>=0;k--)l=o[k],f=this._getLayer(l.layerId).layer,l.disabled=f.options.minZoom!==void 0&&w<f.options.minZoom||f.options.maxZoom!==void 0&&w>f.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,ut(o,"click",er),this.expand();var l=this;setTimeout(function(){Ht(o,"click",er),l._preventClick=!1})}}),lM=function(o,l,f){return new $7(o,l,f)},Qf=Fa.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(o){var l="leaflet-control-zoom",f=Nt("div",l+" leaflet-bar"),w=this.options;return this._zoomInButton=this._createButton(w.zoomInText,w.zoomInTitle,l+"-in",f,this._zoomIn),this._zoomOutButton=this._createButton(w.zoomOutText,w.zoomOutTitle,l+"-out",f,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),f},onRemove:function(o){o.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(o){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(o.shiftKey?3:1))},_zoomOut:function(o){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,l,f,w,k){var E=Nt("a",f,w);return E.innerHTML=o,E.href="#",E.title=l,E.setAttribute("role","button"),E.setAttribute("aria-label",l),Wu(E),ut(E,"click",ls),ut(E,"click",k,this),ut(E,"click",this._refocusOnMap,this),E},_updateDisabled:function(){var o=this._map,l="leaflet-disabled";cn(this._zoomInButton,l),cn(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(ft(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(ft(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});bt.mergeOptions({zoomControl:!0}),bt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Qf,this.addControl(this.zoomControl))});var uM=function(o){return new Qf(o)},W7=Fa.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var l="leaflet-control-scale",f=Nt("div",l),w=this.options;return this._addScales(w,l+"-line",f),o.on(w.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),f},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,l,f){o.metric&&(this._mScale=Nt("div",l,f)),o.imperial&&(this._iScale=Nt("div",l,f))},_update:function(){var o=this._map,l=o.getSize().y/2,f=o.distance(o.containerPointToLatLng([0,l]),o.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(f)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var l=this._getRoundNum(o),f=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,f,l/o)},_updateImperial:function(o){var l=o*3.2808399,f,w,k;l>5280?(f=l/5280,w=this._getRoundNum(f),this._updateScale(this._iScale,w+" mi",w/f)):(k=this._getRoundNum(l),this._updateScale(this._iScale,k+" ft",k/l))},_updateScale:function(o,l,f){o.style.width=Math.round(this.options.maxWidth*f)+"px",o.innerHTML=l},_getRoundNum:function(o){var l=Math.pow(10,(Math.floor(o)+"").length-1),f=o/l;return f=f>=10?10:f>=5?5:f>=3?3:f>=2?2:1,l*f}}),cM=function(o){return new W7(o)},dM='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',ep=Fa.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(qe.inlineSvg?dM+" ":"")+"Leaflet</a>"},initialize:function(o){g(this,o),this._attributions={}},onAdd:function(o){o.attributionControl=this,this._container=Nt("div","leaflet-control-attribution"),Wu(this._container);for(var l in o._layers)o._layers[l].getAttribution&&this.addAttribution(o._layers[l].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var l in this._attributions)this._attributions[l]&&o.push(l);var f=[];this.options.prefix&&f.push(this.options.prefix),o.length&&f.push(o.join(", ")),this._container.innerHTML=f.join(' <span aria-hidden="true">|</span> ')}}});bt.mergeOptions({attributionControl:!0}),bt.addInitHook(function(){this.options.attributionControl&&new ep().addTo(this)});var fM=function(o){return new ep(o)};Fa.Layers=$7,Fa.Zoom=Qf,Fa.Scale=W7,Fa.Attribution=ep,Gu.layers=lM,Gu.zoom=uM,Gu.scale=cM,Gu.attribution=fM;var co=H.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});co.addTo=function(o,l){return o.addHandler(l,this),this};var pM={Events:$},G7=qe.touch?"touchstart mousedown":"mousedown",ii=X.extend({options:{clickTolerance:3},initialize:function(o,l,f,w){g(this,w),this._element=o,this._dragStartTarget=l||o,this._preventOutline=f},enable:function(){this._enabled||(ut(this._dragStartTarget,G7,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ii._dragging===this&&this.finishDrag(!0),Ht(this._dragStartTarget,G7,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!Vf(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){ii._dragging===this&&this.finishDrag();return}if(!(ii._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(ii._dragging=this,this._preventOutline&&Wf(this._element),Uf(),Uu(),!this._moving)){this.fire("down");var l=o.touches?o.touches[0]:o,f=F7(this._element);this._startPoint=new W(l.clientX,l.clientY),this._startPos=is(this._element),this._parentScale=Gf(f);var w=o.type==="mousedown";ut(document,w?"mousemove":"touchmove",this._onMove,this),ut(document,w?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var l=o.touches&&o.touches.length===1?o.touches[0]:o,f=new W(l.clientX,l.clientY)._subtract(this._startPoint);!f.x&&!f.y||Math.abs(f.x)+Math.abs(f.y)<this.options.clickTolerance||(f.x/=this._parentScale.x,f.y/=this._parentScale.y,er(o),this._moved||(this.fire("dragstart"),this._moved=!0,ft(document.body,"leaflet-dragging"),this._lastTarget=o.target||o.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ft(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(f),this._moving=!0,this._lastEvent=o,this._updatePosition())}},_updatePosition:function(){var o={originalEvent:this._lastEvent};this.fire("predrag",o),bn(this._element,this._newPos),this.fire("drag",o)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(o){cn(document.body,"leaflet-dragging"),this._lastTarget&&(cn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ht(document,"mousemove touchmove",this._onMove,this),Ht(document,"mouseup touchend touchcancel",this._onUp,this),Zf(),Zu();var l=this._moved&&this._moving;this._moving=!1,ii._dragging=!1,l&&this.fire("dragend",{noInertia:o,distance:this._newPos.distanceTo(this._startPos)})}});function q7(o,l,f){var w,k=[1,4,2,8],E,F,Y,ee,me,He,nt,gt;for(E=0,He=o.length;E<He;E++)o[E]._code=us(o[E],l);for(Y=0;Y<4;Y++){for(nt=k[Y],w=[],E=0,He=o.length,F=He-1;E<He;F=E++)ee=o[E],me=o[F],ee._code&nt?me._code&nt||(gt=Ed(me,ee,nt,l,f),gt._code=us(gt,l),w.push(gt)):(me._code&nt&&(gt=Ed(me,ee,nt,l,f),gt._code=us(gt,l),w.push(gt)),w.push(ee));o=w}return o}function K7(o,l){var f,w,k,E,F,Y,ee,me,He;if(!o||o.length===0)throw new Error("latlngs not passed");va(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var nt=ne([0,0]),gt=Ee(o),br=gt.getNorthWest().distanceTo(gt.getSouthWest())*gt.getNorthEast().distanceTo(gt.getNorthWest());br<1700&&(nt=tp(o));var zn=o.length,ya=[];for(f=0;f<zn;f++){var Dr=ne(o[f]);ya.push(l.project(ne([Dr.lat-nt.lat,Dr.lng-nt.lng])))}for(Y=ee=me=0,f=0,w=zn-1;f<zn;w=f++)k=ya[f],E=ya[w],F=k.y*E.x-E.y*k.x,ee+=(k.x+E.x)*F,me+=(k.y+E.y)*F,Y+=F*3;Y===0?He=ya[0]:He=[ee/Y,me/Y];var Sl=l.unproject(J(He));return ne([Sl.lat+nt.lat,Sl.lng+nt.lng])}function tp(o){for(var l=0,f=0,w=0,k=0;k<o.length;k++){var E=ne(o[k]);l+=E.lat,f+=E.lng,w++}return ne([l/w,f/w])}var hM={__proto__:null,clipPolygon:q7,polygonCenter:K7,centroid:tp};function Y7(o,l){if(!l||!o.length)return o.slice();var f=l*l;return o=vM(o,f),o=gM(o,f),o}function X7(o,l,f){return Math.sqrt(qu(o,l,f,!0))}function mM(o,l,f){return qu(o,l,f)}function gM(o,l){var f=o.length,w=typeof Uint8Array<"u"?Uint8Array:Array,k=new w(f);k[0]=k[f-1]=1,np(o,k,l,0,f-1);var E,F=[];for(E=0;E<f;E++)k[E]&&F.push(o[E]);return F}function np(o,l,f,w,k){var E=0,F,Y,ee;for(Y=w+1;Y<=k-1;Y++)ee=qu(o[Y],o[w],o[k],!0),ee>E&&(F=Y,E=ee);E>f&&(l[F]=1,np(o,l,f,w,F),np(o,l,f,F,k))}function vM(o,l){for(var f=[o[0]],w=1,k=0,E=o.length;w<E;w++)yM(o[w],o[k])>l&&(f.push(o[w]),k=w);return k<E-1&&f.push(o[E-1]),f}var J7;function Q7(o,l,f,w,k){var E=w?J7:us(o,f),F=us(l,f),Y,ee,me;for(J7=F;;){if(!(E|F))return[o,l];if(E&F)return!1;Y=E||F,ee=Ed(o,l,Y,f,k),me=us(ee,f),Y===E?(o=ee,E=me):(l=ee,F=me)}}function Ed(o,l,f,w,k){var E=l.x-o.x,F=l.y-o.y,Y=w.min,ee=w.max,me,He;return f&8?(me=o.x+E*(ee.y-o.y)/F,He=ee.y):f&4?(me=o.x+E*(Y.y-o.y)/F,He=Y.y):f&2?(me=ee.x,He=o.y+F*(ee.x-o.x)/E):f&1&&(me=Y.x,He=o.y+F*(Y.x-o.x)/E),new W(me,He,k)}function us(o,l){var f=0;return o.x<l.min.x?f|=1:o.x>l.max.x&&(f|=2),o.y<l.min.y?f|=4:o.y>l.max.y&&(f|=8),f}function yM(o,l){var f=l.x-o.x,w=l.y-o.y;return f*f+w*w}function qu(o,l,f,w){var k=l.x,E=l.y,F=f.x-k,Y=f.y-E,ee=F*F+Y*Y,me;return ee>0&&(me=((o.x-k)*F+(o.y-E)*Y)/ee,me>1?(k=f.x,E=f.y):me>0&&(k+=F*me,E+=Y*me)),F=o.x-k,Y=o.y-E,w?F*F+Y*Y:new W(k,E)}function va(o){return!v(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function e8(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),va(o)}function t8(o,l){var f,w,k,E,F,Y,ee,me;if(!o||o.length===0)throw new Error("latlngs not passed");va(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var He=ne([0,0]),nt=Ee(o),gt=nt.getNorthWest().distanceTo(nt.getSouthWest())*nt.getNorthEast().distanceTo(nt.getNorthWest());gt<1700&&(He=tp(o));var br=o.length,zn=[];for(f=0;f<br;f++){var ya=ne(o[f]);zn.push(l.project(ne([ya.lat-He.lat,ya.lng-He.lng])))}for(f=0,w=0;f<br-1;f++)w+=zn[f].distanceTo(zn[f+1])/2;if(w===0)me=zn[0];else for(f=0,E=0;f<br-1;f++)if(F=zn[f],Y=zn[f+1],k=F.distanceTo(Y),E+=k,E>w){ee=(E-w)/k,me=[Y.x-ee*(Y.x-F.x),Y.y-ee*(Y.y-F.y)];break}var Dr=l.unproject(J(me));return ne([Dr.lat+He.lat,Dr.lng+He.lng])}var CM={__proto__:null,simplify:Y7,pointToSegmentDistance:X7,closestPointOnSegment:mM,clipSegment:Q7,_getEdgeIntersection:Ed,_getBitCode:us,_sqClosestPointOnSegment:qu,isFlat:va,_flat:e8,polylineCenter:t8},rp={project:function(o){return new W(o.lng,o.lat)},unproject:function(o){return new I(o.y,o.x)},bounds:new K([-180,-90],[180,90])},ap={R:6378137,R_MINOR:6356752314245179e-9,bounds:new K([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var l=Math.PI/180,f=this.R,w=o.lat*l,k=this.R_MINOR/f,E=Math.sqrt(1-k*k),F=E*Math.sin(w),Y=Math.tan(Math.PI/4-w/2)/Math.pow((1-F)/(1+F),E/2);return w=-f*Math.log(Math.max(Y,1e-10)),new W(o.lng*l*f,w)},unproject:function(o){for(var l=180/Math.PI,f=this.R,w=this.R_MINOR/f,k=Math.sqrt(1-w*w),E=Math.exp(-o.y/f),F=Math.PI/2-2*Math.atan(E),Y=0,ee=.1,me;Y<15&&Math.abs(ee)>1e-7;Y++)me=k*Math.sin(F),me=Math.pow((1-me)/(1+me),k/2),ee=Math.PI/2-2*Math.atan(E*me)-F,F+=ee;return new I(F*l,o.x*l/f)}},wM={__proto__:null,LonLat:rp,Mercator:ap,SphericalMercator:de},xM=n({},ye,{code:"EPSG:3395",projection:ap,transformation:(function(){var o=.5/(Math.PI*ap.R);return Ne(o,.5,-o,.5)})()}),n8=n({},ye,{code:"EPSG:4326",projection:rp,transformation:Ne(1/180,1,-1/180,.5)}),bM=n({},ze,{projection:rp,transformation:Ne(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,l){var f=l.lng-o.lng,w=l.lat-o.lat;return Math.sqrt(f*f+w*w)},infinite:!0});ze.Earth=ye,ze.EPSG3395=xM,ze.EPSG3857=D,ze.EPSG900913=te,ze.EPSG4326=n8,ze.Simple=bM;var Va=X.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[s(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[s(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var l=o.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var f=this.getEvents();l.on(f,this),this.once("remove",function(){l.off(f,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});bt.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var l=s(o);return this._layers[l]?this:(this._layers[l]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var l=s(o);return this._layers[l]?(this._loaded&&o.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return s(o)in this._layers},eachLayer:function(o,l){for(var f in this._layers)o.call(l,this._layers[f]);return this},_addLayers:function(o){o=o?v(o)?o:[o]:[];for(var l=0,f=o.length;l<f;l++)this.addLayer(o[l])},_addZoomLimit:function(o){(!isNaN(o.options.maxZoom)||!isNaN(o.options.minZoom))&&(this._zoomBoundLayers[s(o)]=o,this._updateZoomLevels())},_removeZoomLimit:function(o){var l=s(o);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var o=1/0,l=-1/0,f=this._getZoomSpan();for(var w in this._zoomBoundLayers){var k=this._zoomBoundLayers[w].options;o=k.minZoom===void 0?o:Math.min(o,k.minZoom),l=k.maxZoom===void 0?l:Math.max(l,k.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=o===1/0?void 0:o,f!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Cl=Va.extend({initialize:function(o,l){g(this,l),this._layers={};var f,w;if(o)for(f=0,w=o.length;f<w;f++)this.addLayer(o[f])},addLayer:function(o){var l=this.getLayerId(o);return this._layers[l]=o,this._map&&this._map.addLayer(o),this},removeLayer:function(o){var l=o in this._layers?o:this.getLayerId(o);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(o){var l=typeof o=="number"?o:this.getLayerId(o);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(o){var l=Array.prototype.slice.call(arguments,1),f,w;for(f in this._layers)w=this._layers[f],w[o]&&w[o].apply(w,l);return this},onAdd:function(o){this.eachLayer(o.addLayer,o)},onRemove:function(o){this.eachLayer(o.removeLayer,o)},eachLayer:function(o,l){for(var f in this._layers)o.call(l,this._layers[f]);return this},getLayer:function(o){return this._layers[o]},getLayers:function(){var o=[];return this.eachLayer(o.push,o),o},setZIndex:function(o){return this.invoke("setZIndex",o)},getLayerId:function(o){return s(o)}}),_M=function(o,l){return new Cl(o,l)},No=Cl.extend({addLayer:function(o){return this.hasLayer(o)?this:(o.addEventParent(this),Cl.prototype.addLayer.call(this,o),this.fire("layeradd",{layer:o}))},removeLayer:function(o){return this.hasLayer(o)?(o in this._layers&&(o=this._layers[o]),o.removeEventParent(this),Cl.prototype.removeLayer.call(this,o),this.fire("layerremove",{layer:o})):this},setStyle:function(o){return this.invoke("setStyle",o)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var o=new ve;for(var l in this._layers){var f=this._layers[l];o.extend(f.getBounds?f.getBounds():f.getLatLng())}return o}}),SM=function(o,l){return new No(o,l)},wl=H.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(o){g(this,o)},createIcon:function(o){return this._createIcon("icon",o)},createShadow:function(o){return this._createIcon("shadow",o)},_createIcon:function(o,l){var f=this._getIconUrl(o);if(!f){if(o==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var w=this._createImg(f,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(w,o),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),w},_setIconStyles:function(o,l){var f=this.options,w=f[l+"Size"];typeof w=="number"&&(w=[w,w]);var k=J(w),E=J(l==="shadow"&&f.shadowAnchor||f.iconAnchor||k&&k.divideBy(2,!0));o.className="leaflet-marker-"+l+" "+(f.className||""),E&&(o.style.marginLeft=-E.x+"px",o.style.marginTop=-E.y+"px"),k&&(o.style.width=k.x+"px",o.style.height=k.y+"px")},_createImg:function(o,l){return l=l||document.createElement("img"),l.src=o,l},_getIconUrl:function(o){return qe.retina&&this.options[o+"RetinaUrl"]||this.options[o+"Url"]}});function kM(o){return new wl(o)}var Ku=wl.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(o){return typeof Ku.imagePath!="string"&&(Ku.imagePath=this._detectIconPath()),(this.options.imagePath||Ku.imagePath)+wl.prototype._getIconUrl.call(this,o)},_stripUrl:function(o){var l=function(f,w,k){var E=w.exec(f);return E&&E[k]};return o=l(o,/^url\((['"])?(.+)\1\)$/,2),o&&l(o,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var o=Nt("div","leaflet-default-icon-path",document.body),l=ju(o,"background-image")||ju(o,"backgroundImage");if(document.body.removeChild(o),l=this._stripUrl(l),l)return l;var f=document.querySelector('link[href$="leaflet.css"]');return f?f.href.substring(0,f.href.length-11-1):""}}),r8=co.extend({initialize:function(o){this._marker=o},addHooks:function(){var o=this._marker._icon;this._draggable||(this._draggable=new ii(o,o,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ft(o,"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&&cn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(o){var l=this._marker,f=l._map,w=this._marker.options.autoPanSpeed,k=this._marker.options.autoPanPadding,E=is(l._icon),F=f.getPixelBounds(),Y=f.getPixelOrigin(),ee=M(F.min._subtract(Y).add(k),F.max._subtract(Y).subtract(k));if(!ee.contains(E)){var me=J((Math.max(ee.max.x,E.x)-ee.max.x)/(F.max.x-ee.max.x)-(Math.min(ee.min.x,E.x)-ee.min.x)/(F.min.x-ee.min.x),(Math.max(ee.max.y,E.y)-ee.max.y)/(F.max.y-ee.max.y)-(Math.min(ee.min.y,E.y)-ee.min.y)/(F.min.y-ee.min.y)).multiplyBy(w);f.panBy(me,{animate:!1}),this._draggable._newPos._add(me),this._draggable._startPos._add(me),bn(l._icon,this._draggable._newPos),this._onDrag(o),this._panRequest=B(this._adjustPan.bind(this,o))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(o){this._marker.options.autoPan&&(z(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,o)))},_onDrag:function(o){var l=this._marker,f=l._shadow,w=is(l._icon),k=l._map.layerPointToLatLng(w);f&&bn(f,w),l._latlng=k,o.latlng=k,o.oldLatLng=this._oldLatLng,l.fire("move",o).fire("drag",o)},_onDragEnd:function(o){z(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",o)}}),Rd=Va.extend({options:{icon:new Ku,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(o,l){g(this,l),this._latlng=ne(o)},onAdd:function(o){this._zoomAnimated=this._zoomAnimated&&o.options.markerZoomAnimation,this._zoomAnimated&&o.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(o){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&o.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(o){var l=this._latlng;return this._latlng=ne(o),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(o){return this.options.zIndexOffset=o,this.update()},getIcon:function(){return this.options.icon},setIcon:function(o){return this.options.icon=o,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 o=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(o)}return this},_initIcon:function(){var o=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),f=o.icon.createIcon(this._icon),w=!1;f!==this._icon&&(this._icon&&this._removeIcon(),w=!0,o.title&&(f.title=o.title),f.tagName==="IMG"&&(f.alt=o.alt||"")),ft(f,l),o.keyboard&&(f.tabIndex="0",f.setAttribute("role","button")),this._icon=f,o.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ut(f,"focus",this._panOnFocus,this);var k=o.icon.createShadow(this._shadow),E=!1;k!==this._shadow&&(this._removeShadow(),E=!0),k&&(ft(k,l),k.alt=""),this._shadow=k,o.opacity<1&&this._updateOpacity(),w&&this.getPane().appendChild(this._icon),this._initInteraction(),k&&E&&this.getPane(o.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ht(this._icon,"focus",this._panOnFocus,this),Qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Qt(this._shadow),this._shadow=null},_setPos:function(o){this._icon&&bn(this._icon,o),this._shadow&&bn(this._shadow,o),this._zIndex=o.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(o){this._icon&&(this._icon.style.zIndex=this._zIndex+o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(ft(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),r8)){var o=this.options.draggable;this.dragging&&(o=this.dragging.enabled(),this.dragging.disable()),this.dragging=new r8(this),o&&this.dragging.enable()}},setOpacity:function(o){return this.options.opacity=o,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var o=this.options.opacity;this._icon&&ga(this._icon,o),this._shadow&&ga(this._shadow,o)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var o=this._map;if(o){var l=this.options.icon.options,f=l.iconSize?J(l.iconSize):J(0,0),w=l.iconAnchor?J(l.iconAnchor):J(0,0);o.panInside(this._latlng,{paddingTopLeft:w,paddingBottomRight:f.subtract(w)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function NM(o,l){return new Rd(o,l)}var si=Va.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(o){this._renderer=o.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(o){return g(this,o),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&o&&Object.prototype.hasOwnProperty.call(o,"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||0)}}),Td=si.extend({options:{fill:!0,radius:10},initialize:function(o,l){g(this,l),this._latlng=ne(o),this._radius=this.options.radius},setLatLng:function(o){var l=this._latlng;return this._latlng=ne(o),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(o){return this.options.radius=this._radius=o,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var l=o&&o.radius||this._radius;return si.prototype.setStyle.call(this,o),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var o=this._radius,l=this._radiusY||o,f=this._clickTolerance(),w=[o+f,l+f];this._pxBounds=new K(this._point.subtract(w),this._point.add(w))},_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(o){return o.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function PM(o,l){return new Td(o,l)}var op=Td.extend({initialize:function(o,l,f){if(typeof l=="number"&&(l=n({},f,{radius:l})),g(this,l),this._latlng=ne(o),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(o){return this._mRadius=o,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var o=[this._radius,this._radiusY||this._radius];return new ve(this._map.layerPointToLatLng(this._point.subtract(o)),this._map.layerPointToLatLng(this._point.add(o)))},setStyle:si.prototype.setStyle,_project:function(){var o=this._latlng.lng,l=this._latlng.lat,f=this._map,w=f.options.crs;if(w.distance===ye.distance){var k=Math.PI/180,E=this._mRadius/ye.R/k,F=f.project([l+E,o]),Y=f.project([l-E,o]),ee=F.add(Y).divideBy(2),me=f.unproject(ee).lat,He=Math.acos((Math.cos(E*k)-Math.sin(l*k)*Math.sin(me*k))/(Math.cos(l*k)*Math.cos(me*k)))/k;(isNaN(He)||He===0)&&(He=E/Math.cos(Math.PI/180*l)),this._point=ee.subtract(f.getPixelOrigin()),this._radius=isNaN(He)?0:ee.x-f.project([me,o-He]).x,this._radiusY=ee.y-F.y}else{var nt=w.unproject(w.project(this._latlng).subtract([this._mRadius,0]));this._point=f.latLngToLayerPoint(this._latlng),this._radius=this._point.x-f.latLngToLayerPoint(nt).x}this._updateBounds()}});function EM(o,l,f){return new op(o,l,f)}var Po=si.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,l){g(this,l),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(o){return this._setLatLngs(o),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(o){for(var l=1/0,f=null,w=qu,k,E,F=0,Y=this._parts.length;F<Y;F++)for(var ee=this._parts[F],me=1,He=ee.length;me<He;me++){k=ee[me-1],E=ee[me];var nt=w(o,k,E,!0);nt<l&&(l=nt,f=w(o,k,E))}return f&&(f.distance=Math.sqrt(l)),f},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return t8(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(o,l){return l=l||this._defaultShape(),o=ne(o),l.push(o),this._bounds.extend(o),this.redraw()},_setLatLngs:function(o){this._bounds=new ve,this._latlngs=this._convertLatLngs(o)},_defaultShape:function(){return va(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(o){for(var l=[],f=va(o),w=0,k=o.length;w<k;w++)f?(l[w]=ne(o[w]),this._bounds.extend(l[w])):l[w]=this._convertLatLngs(o[w]);return l},_project:function(){var o=new K;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,o),this._bounds.isValid()&&o.isValid()&&(this._rawPxBounds=o,this._updateBounds())},_updateBounds:function(){var o=this._clickTolerance(),l=new W(o,o);this._rawPxBounds&&(this._pxBounds=new K([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(o,l,f){var w=o[0]instanceof I,k=o.length,E,F;if(w){for(F=[],E=0;E<k;E++)F[E]=this._map.latLngToLayerPoint(o[E]),f.extend(F[E]);l.push(F)}else for(E=0;E<k;E++)this._projectLatlngs(o[E],l,f)},_clipPoints:function(){var o=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,f,w,k,E,F,Y,ee;for(f=0,k=0,E=this._rings.length;f<E;f++)for(ee=this._rings[f],w=0,F=ee.length;w<F-1;w++)Y=Q7(ee[w],ee[w+1],o,w,!0),Y&&(l[k]=l[k]||[],l[k].push(Y[0]),(Y[1]!==ee[w+1]||w===F-2)&&(l[k].push(Y[1]),k++))}},_simplifyPoints:function(){for(var o=this._parts,l=this.options.smoothFactor,f=0,w=o.length;f<w;f++)o[f]=Y7(o[f],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(o,l){var f,w,k,E,F,Y,ee=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(f=0,E=this._parts.length;f<E;f++)for(Y=this._parts[f],w=0,F=Y.length,k=F-1;w<F;k=w++)if(!(!l&&w===0)&&X7(o,Y[k],Y[w])<=ee)return!0;return!1}});function RM(o,l){return new Po(o,l)}Po._flat=e8;var xl=Po.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()");return K7(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(o){var l=Po.prototype._convertLatLngs.call(this,o),f=l.length;return f>=2&&l[0]instanceof I&&l[0].equals(l[f-1])&&l.pop(),l},_setLatLngs:function(o){Po.prototype._setLatLngs.call(this,o),va(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return va(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,l=this.options.weight,f=new W(l,l);if(o=new K(o.min.subtract(f),o.max.add(f)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var w=0,k=this._rings.length,E;w<k;w++)E=q7(this._rings[w],o,!0),E.length&&this._parts.push(E)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(o){var l=!1,f,w,k,E,F,Y,ee,me;if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(E=0,ee=this._parts.length;E<ee;E++)for(f=this._parts[E],F=0,me=f.length,Y=me-1;F<me;Y=F++)w=f[F],k=f[Y],w.y>o.y!=k.y>o.y&&o.x<(k.x-w.x)*(o.y-w.y)/(k.y-w.y)+w.x&&(l=!l);return l||Po.prototype._containsPoint.call(this,o,!0)}});function TM(o,l){return new xl(o,l)}var Eo=No.extend({initialize:function(o,l){g(this,l),this._layers={},o&&this.addData(o)},addData:function(o){var l=v(o)?o:o.features,f,w,k;if(l){for(f=0,w=l.length;f<w;f++)k=l[f],(k.geometries||k.geometry||k.features||k.coordinates)&&this.addData(k);return this}var E=this.options;if(E.filter&&!E.filter(o))return this;var F=Ld(o,E);return F?(F.feature=Id(o),F.defaultOptions=F.options,this.resetStyle(F),E.onEachFeature&&E.onEachFeature(o,F),this.addLayer(F)):this},resetStyle:function(o){return o===void 0?this.eachLayer(this.resetStyle,this):(o.options=n({},o.defaultOptions),this._setLayerStyle(o,this.options.style),this)},setStyle:function(o){return this.eachLayer(function(l){this._setLayerStyle(l,o)},this)},_setLayerStyle:function(o,l){o.setStyle&&(typeof l=="function"&&(l=l(o.feature)),o.setStyle(l))}});function Ld(o,l){var f=o.type==="Feature"?o.geometry:o,w=f?f.coordinates:null,k=[],E=l&&l.pointToLayer,F=l&&l.coordsToLatLng||ip,Y,ee,me,He;if(!w&&!f)return null;switch(f.type){case"Point":return Y=F(w),a8(E,o,Y,l);case"MultiPoint":for(me=0,He=w.length;me<He;me++)Y=F(w[me]),k.push(a8(E,o,Y,l));return new No(k);case"LineString":case"MultiLineString":return ee=Ad(w,f.type==="LineString"?0:1,F),new Po(ee,l);case"Polygon":case"MultiPolygon":return ee=Ad(w,f.type==="Polygon"?1:2,F),new xl(ee,l);case"GeometryCollection":for(me=0,He=f.geometries.length;me<He;me++){var nt=Ld({geometry:f.geometries[me],type:"Feature",properties:o.properties},l);nt&&k.push(nt)}return new No(k);case"FeatureCollection":for(me=0,He=f.features.length;me<He;me++){var gt=Ld(f.features[me],l);gt&&k.push(gt)}return new No(k);default:throw new Error("Invalid GeoJSON object.")}}function a8(o,l,f,w){return o?o(l,f):new Rd(f,w&&w.markersInheritOptions&&w)}function ip(o){return new I(o[1],o[0],o[2])}function Ad(o,l,f){for(var w=[],k=0,E=o.length,F;k<E;k++)F=l?Ad(o[k],l-1,f):(f||ip)(o[k]),w.push(F);return w}function sp(o,l){return o=ne(o),o.alt!==void 0?[p(o.lng,l),p(o.lat,l),p(o.alt,l)]:[p(o.lng,l),p(o.lat,l)]}function Md(o,l,f,w){for(var k=[],E=0,F=o.length;E<F;E++)k.push(l?Md(o[E],va(o[E])?0:l-1,f,w):sp(o[E],w));return!l&&f&&k.length>0&&k.push(k[0].slice()),k}function bl(o,l){return o.feature?n({},o.feature,{geometry:l}):Id(l)}function Id(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var lp={toGeoJSON:function(o){return bl(this,{type:"Point",coordinates:sp(this.getLatLng(),o)})}};Rd.include(lp),op.include(lp),Td.include(lp),Po.include({toGeoJSON:function(o){var l=!va(this._latlngs),f=Md(this._latlngs,l?1:0,!1,o);return bl(this,{type:(l?"Multi":"")+"LineString",coordinates:f})}}),xl.include({toGeoJSON:function(o){var l=!va(this._latlngs),f=l&&!va(this._latlngs[0]),w=Md(this._latlngs,f?2:l?1:0,!0,o);return l||(w=[w]),bl(this,{type:(f?"Multi":"")+"Polygon",coordinates:w})}}),Cl.include({toMultiPoint:function(o){var l=[];return this.eachLayer(function(f){l.push(f.toGeoJSON(o).geometry.coordinates)}),bl(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(o){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(o);var f=l==="GeometryCollection",w=[];return this.eachLayer(function(k){if(k.toGeoJSON){var E=k.toGeoJSON(o);if(f)w.push(E.geometry);else{var F=Id(E);F.type==="FeatureCollection"?w.push.apply(w,F.features):w.push(F)}}}),f?bl(this,{geometries:w,type:"GeometryCollection"}):{type:"FeatureCollection",features:w}}});function o8(o,l){return new Eo(o,l)}var LM=o8,Od=Va.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,l,f){this._url=o,this._bounds=Ee(l),g(this,f)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ft(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&vl(this._image),this},bringToBack:function(){return this._map&&yl(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=Ee(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",l=this._image=o?this._url:Nt("img");if(ft(l,"leaflet-image-layer"),this._zoomAnimated&&ft(l,"leaflet-zoom-animated"),this.options.className&&ft(l,this.options.className),l.onselectstart=d,l.onmousemove=d,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(o){var l=this._map.getZoomScale(o.zoom),f=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;os(this._image,f,l)},_reset:function(){var o=this._image,l=new K(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),f=l.getSize();bn(o,l.min),o.style.width=f.x+"px",o.style.height=f.y+"px"},_updateOpacity:function(){ga(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),AM=function(o,l,f){return new Od(o,l,f)},i8=Od.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",l=this._image=o?this._url:Nt("video");if(ft(l,"leaflet-image-layer"),this._zoomAnimated&&ft(l,"leaflet-zoom-animated"),this.options.className&&ft(l,this.options.className),l.onselectstart=d,l.onmousemove=d,l.onloadeddata=a(this.fire,this,"load"),o){for(var f=l.getElementsByTagName("source"),w=[],k=0;k<f.length;k++)w.push(f[k].src);this._url=f.length>0?w:[l.src];return}v(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var E=0;E<this._url.length;E++){var F=Nt("source");F.src=this._url[E],l.appendChild(F)}}});function MM(o,l,f){return new i8(o,l,f)}var s8=Od.extend({_initImage:function(){var o=this._image=this._url;ft(o,"leaflet-image-layer"),this._zoomAnimated&&ft(o,"leaflet-zoom-animated"),this.options.className&&ft(o,this.options.className),o.onselectstart=d,o.onmousemove=d}});function IM(o,l,f){return new s8(o,l,f)}var fo=Va.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(o,l){o&&(o instanceof I||v(o))?(this._latlng=ne(o),g(this,l)):(g(this,o),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(o){return o=arguments.length?o:this._source._map,o.hasLayer(this)||o.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(o){return this._map?this.close():(arguments.length?this._source=o:o=this._source,this._prepareOpen(),this.openOn(o._map)),this},onAdd:function(o){this._zoomAnimated=o._zoomAnimated,this._container||this._initLayout(),o._fadeAnimated&&ga(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),o._fadeAnimated&&ga(this._container,1),this.bringToFront(),this.options.interactive&&(ft(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(o){o._fadeAnimated?(ga(this._container,0),this._removeTimeout=setTimeout(a(Qt,void 0,this._container),200)):Qt(this._container),this.options.interactive&&(cn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(o){return this._latlng=ne(o),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(o){return this._content=o,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 o={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&vl(this._container),this},bringToBack:function(){return this._map&&yl(this._container),this},_prepareOpen:function(o){var l=this._source;if(!l._map)return!1;if(l instanceof No){l=null;var f=this._source._layers;for(var w in f)if(f[w]._map){l=f[w];break}if(!l)return!1;this._source=l}if(!o)if(l.getCenter)o=l.getCenter();else if(l.getLatLng)o=l.getLatLng();else if(l.getBounds)o=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(o),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var o=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")o.innerHTML=l;else{for(;o.hasChildNodes();)o.removeChild(o.firstChild);o.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var o=this._map.latLngToLayerPoint(this._latlng),l=J(this.options.offset),f=this._getAnchor();this._zoomAnimated?bn(this._container,o.add(f)):l=l.add(o).add(f);var w=this._containerBottom=-l.y,k=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=w+"px",this._container.style.left=k+"px"}},_getAnchor:function(){return[0,0]}});bt.include({_initOverlay:function(o,l,f,w){var k=l;return k instanceof o||(k=new o(w).setContent(l)),f&&k.setLatLng(f),k}}),Va.include({_initOverlay:function(o,l,f,w){var k=f;return k instanceof o?(g(k,w),k._source=this):(k=l&&!w?l:new o(w,this),k.setContent(f)),k}});var Dd=fo.extend({options:{pane:"popupPane",offset:[0,7],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(o){return o=arguments.length?o:this._source._map,!o.hasLayer(this)&&o._popup&&o._popup.options.autoClose&&o.removeLayer(o._popup),o._popup=this,fo.prototype.openOn.call(this,o)},onAdd:function(o){fo.prototype.onAdd.call(this,o),o.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof si||this._source.on("preclick",ss))},onRemove:function(o){fo.prototype.onRemove.call(this,o),o.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof si||this._source.off("preclick",ss))},getEvents:function(){var o=fo.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(o.preclick=this.close),this.options.keepInView&&(o.moveend=this._adjustPan),o},_initLayout:function(){var o="leaflet-popup",l=this._container=Nt("div",o+" "+(this.options.className||"")+" leaflet-zoom-animated"),f=this._wrapper=Nt("div",o+"-content-wrapper",l);if(this._contentNode=Nt("div",o+"-content",f),Wu(l),Xf(this._contentNode),ut(l,"contextmenu",ss),this._tipContainer=Nt("div",o+"-tip-container",l),this._tip=Nt("div",o+"-tip",this._tipContainer),this.options.closeButton){var w=this._closeButton=Nt("a",o+"-close-button",l);w.setAttribute("role","button"),w.setAttribute("aria-label","Close popup"),w.href="#close",w.innerHTML='<span aria-hidden="true">&#215;</span>',ut(w,"click",function(k){er(k),this.close()},this)}},_updateLayout:function(){var o=this._contentNode,l=o.style;l.width="",l.whiteSpace="nowrap";var f=o.offsetWidth;f=Math.min(f,this.options.maxWidth),f=Math.max(f,this.options.minWidth),l.width=f+1+"px",l.whiteSpace="",l.height="";var w=o.offsetHeight,k=this.options.maxHeight,E="leaflet-popup-scrolled";k&&w>k?(l.height=k+"px",ft(o,E)):cn(o,E),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),f=this._getAnchor();bn(this._container,l.add(f))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,l=parseInt(ju(this._container,"marginBottom"),10)||0,f=this._container.offsetHeight+l,w=this._containerWidth,k=new W(this._containerLeft,-f-this._containerBottom);k._add(is(this._container));var E=o.layerPointToContainerPoint(k),F=J(this.options.autoPanPadding),Y=J(this.options.autoPanPaddingTopLeft||F),ee=J(this.options.autoPanPaddingBottomRight||F),me=o.getSize(),He=0,nt=0;E.x+w+ee.x>me.x&&(He=E.x+w-me.x+ee.x),E.x-He-Y.x<0&&(He=E.x-Y.x),E.y+f+ee.y>me.y&&(nt=E.y+f-me.y+ee.y),E.y-nt-Y.y<0&&(nt=E.y-Y.y),(He||nt)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([He,nt]))}},_getAnchor:function(){return J(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),OM=function(o,l){return new Dd(o,l)};bt.mergeOptions({closePopupOnClick:!0}),bt.include({openPopup:function(o,l,f){return this._initOverlay(Dd,o,l,f).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),Va.include({bindPopup:function(o,l){return this._popup=this._initOverlay(Dd,this._popup,o,l),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(o){return this._popup&&(this instanceof No||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){ls(o);var l=o.layer||o.target;if(this._popup._source===l&&!(l instanceof si)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=l,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var Hd=fo.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){fo.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){fo.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=fo.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",l=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Nt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var l,f,w=this._map,k=this._container,E=w.latLngToContainerPoint(w.getCenter()),F=w.layerPointToContainerPoint(o),Y=this.options.direction,ee=k.offsetWidth,me=k.offsetHeight,He=J(this.options.offset),nt=this._getAnchor();Y==="top"?(l=ee/2,f=me):Y==="bottom"?(l=ee/2,f=0):Y==="center"?(l=ee/2,f=me/2):Y==="right"?(l=0,f=me/2):Y==="left"?(l=ee,f=me/2):F.x<E.x?(Y="right",l=0,f=me/2):(Y="left",l=ee+(He.x+nt.x)*2,f=me/2),o=o.subtract(J(l,f,!0)).add(He).add(nt),cn(k,"leaflet-tooltip-right"),cn(k,"leaflet-tooltip-left"),cn(k,"leaflet-tooltip-top"),cn(k,"leaflet-tooltip-bottom"),ft(k,"leaflet-tooltip-"+Y),bn(k,o)},_updatePosition:function(){var o=this._map.latLngToLayerPoint(this._latlng);this._setPosition(o)},setOpacity:function(o){this.options.opacity=o,this._container&&ga(this._container,o)},_animateZoom:function(o){var l=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center);this._setPosition(l)},_getAnchor:function(){return J(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),DM=function(o,l){return new Hd(o,l)};bt.include({openTooltip:function(o,l,f){return this._initOverlay(Hd,o,l,f).openOn(this),this},closeTooltip:function(o){return o.close(),this}}),Va.include({bindTooltip:function(o,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Hd,this._tooltip,o,l),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(o){if(!(!o&&this._tooltipHandlersAdded)){var l=o?"off":"on",f={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?f.add=this._openTooltip:(f.mouseover=this._openTooltip,f.mouseout=this.closeTooltip,f.click=this._openTooltip,this._map?this._addFocusListeners():f.add=this._addFocusListeners),this._tooltip.options.sticky&&(f.mousemove=this._moveTooltip),this[l](f),this._tooltipHandlersAdded=!o}},openTooltip:function(o){return this._tooltip&&(this instanceof No||(this._tooltip._source=this),this._tooltip._prepareOpen(o)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(o){return this._tooltip&&this._tooltip.setContent(o),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&(ut(l,"focus",function(){this._tooltip._source=o,this.openTooltip()},this),ut(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(o){var l=typeof o.getElement=="function"&&o.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(o){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(o)});return}this._tooltip._source=o.layer||o.target,this.openTooltip(this._tooltip.options.sticky?o.latlng:void 0)}},_moveTooltip:function(o){var l=o.latlng,f,w;this._tooltip.options.sticky&&o.originalEvent&&(f=this._map.mouseEventToContainerPoint(o.originalEvent),w=this._map.containerPointToLayerPoint(f),l=this._map.layerPointToLatLng(w)),this._tooltip.setLatLng(l)}});var l8=wl.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(o){var l=o&&o.tagName==="DIV"?o:document.createElement("div"),f=this.options;if(f.html instanceof Element?(_d(l),l.appendChild(f.html)):l.innerHTML=f.html!==!1?f.html:"",f.bgPos){var w=J(f.bgPos);l.style.backgroundPosition=-w.x+"px "+-w.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function HM(o){return new l8(o)}wl.Default=Ku;var Yu=Va.extend({options:{tileSize:256,opacity:1,updateWhenIdle:qe.mobile,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(o){g(this,o)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(o){o._addZoomLimit(this)},onRemove:function(o){this._removeAllTiles(),Qt(this._container),o._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(vl(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(yl(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(o){return this.options.opacity=o,this._updateOpacity(),this},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var o=this._clampZoom(this._map.getZoom());o!==this._tileZoom&&(this._tileZoom=o,this._updateLevels()),this._update()}return this},getEvents:function(){var o={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),o.move=this._onMove),this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},createTile:function(){return document.createElement("div")},getTileSize:function(){var o=this.options.tileSize;return o instanceof W?o:new W(o,o)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(o){for(var l=this.getPane().children,f=-o(-1/0,1/0),w=0,k=l.length,E;w<k;w++)E=l[w].style.zIndex,l[w]!==this._container&&E&&(f=o(f,+E));isFinite(f)&&(this.options.zIndex=f+o(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!qe.ielt9){ga(this._container,this.options.opacity);var o=+new Date,l=!1,f=!1;for(var w in this._tiles){var k=this._tiles[w];if(!(!k.current||!k.loaded)){var E=Math.min(1,(o-k.loaded)/200);ga(k.el,E),E<1?l=!0:(k.active?f=!0:this._onOpaqueTile(k),k.active=!0)}}f&&!this._noPrune&&this._pruneTiles(),l&&(z(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:d,_initContainer:function(){this._container||(this._container=Nt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,l=this.options.maxZoom;if(o!==void 0){for(var f in this._levels)f=Number(f),this._levels[f].el.children.length||f===o?(this._levels[f].el.style.zIndex=l-Math.abs(o-f),this._onUpdateLevel(f)):(Qt(this._levels[f].el),this._removeTilesAtZoom(f),this._onRemoveLevel(f),delete this._levels[f]);var w=this._levels[o],k=this._map;return w||(w=this._levels[o]={},w.el=Nt("div","leaflet-tile-container leaflet-zoom-animated",this._container),w.el.style.zIndex=l,w.origin=k.project(k.unproject(k.getPixelOrigin()),o).round(),w.zoom=o,this._setZoomTransform(w,k.getCenter(),k.getZoom()),d(w.el.offsetWidth),this._onCreateLevel(w)),this._level=w,w}},_onUpdateLevel:d,_onRemoveLevel:d,_onCreateLevel:d,_pruneTiles:function(){if(this._map){var o,l,f=this._map.getZoom();if(f>this.options.maxZoom||f<this.options.minZoom){this._removeAllTiles();return}for(o in this._tiles)l=this._tiles[o],l.retain=l.current;for(o in this._tiles)if(l=this._tiles[o],l.current&&!l.active){var w=l.coords;this._retainParent(w.x,w.y,w.z,w.z-5)||this._retainChildren(w.x,w.y,w.z,w.z+2)}for(o in this._tiles)this._tiles[o].retain||this._removeTile(o)}},_removeTilesAtZoom:function(o){for(var l in this._tiles)this._tiles[l].coords.z===o&&this._removeTile(l)},_removeAllTiles:function(){for(var o in this._tiles)this._removeTile(o)},_invalidateAll:function(){for(var o in this._levels)Qt(this._levels[o].el),this._onRemoveLevel(Number(o)),delete this._levels[o];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(o,l,f,w){var k=Math.floor(o/2),E=Math.floor(l/2),F=f-1,Y=new W(+k,+E);Y.z=+F;var ee=this._tileCoordsToKey(Y),me=this._tiles[ee];return me&&me.active?(me.retain=!0,!0):(me&&me.loaded&&(me.retain=!0),F>w?this._retainParent(k,E,F,w):!1)},_retainChildren:function(o,l,f,w){for(var k=2*o;k<2*o+2;k++)for(var E=2*l;E<2*l+2;E++){var F=new W(k,E);F.z=f+1;var Y=this._tileCoordsToKey(F),ee=this._tiles[Y];if(ee&&ee.active){ee.retain=!0;continue}else ee&&ee.loaded&&(ee.retain=!0);f+1<w&&this._retainChildren(k,E,f+1,w)}},_resetView:function(o){var l=o&&(o.pinch||o.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(o){this._setView(o.center,o.zoom,!0,o.noUpdate)},_clampZoom:function(o){var l=this.options;return l.minNativeZoom!==void 0&&o<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<o?l.maxNativeZoom:o},_setView:function(o,l,f,w){var k=Math.round(l);this.options.maxZoom!==void 0&&k>this.options.maxZoom||this.options.minZoom!==void 0&&k<this.options.minZoom?k=void 0:k=this._clampZoom(k);var E=this.options.updateWhenZooming&&k!==this._tileZoom;(!w||E)&&(this._tileZoom=k,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),k!==void 0&&this._update(o),f||this._pruneTiles(),this._noPrune=!!f),this._setZoomTransforms(o,l)},_setZoomTransforms:function(o,l){for(var f in this._levels)this._setZoomTransform(this._levels[f],o,l)},_setZoomTransform:function(o,l,f){var w=this._map.getZoomScale(f,o.zoom),k=o.origin.multiplyBy(w).subtract(this._map._getNewPixelOrigin(l,f)).round();qe.any3d?os(o.el,k,w):bn(o.el,k)},_resetGrid:function(){var o=this._map,l=o.options.crs,f=this._tileSize=this.getTileSize(),w=this._tileZoom,k=this._map.getPixelWorldBounds(this._tileZoom);k&&(this._globalTileRange=this._pxBoundsToTileRange(k)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(o.project([0,l.wrapLng[0]],w).x/f.x),Math.ceil(o.project([0,l.wrapLng[1]],w).x/f.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(o.project([l.wrapLat[0],0],w).y/f.x),Math.ceil(o.project([l.wrapLat[1],0],w).y/f.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(o){var l=this._map,f=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),w=l.getZoomScale(f,this._tileZoom),k=l.project(o,this._tileZoom).floor(),E=l.getSize().divideBy(w*2);return new K(k.subtract(E),k.add(E))},_update:function(o){var l=this._map;if(l){var f=this._clampZoom(l.getZoom());if(o===void 0&&(o=l.getCenter()),this._tileZoom!==void 0){var w=this._getTiledPixelBounds(o),k=this._pxBoundsToTileRange(w),E=k.getCenter(),F=[],Y=this.options.keepBuffer,ee=new K(k.getBottomLeft().subtract([Y,-Y]),k.getTopRight().add([Y,-Y]));if(!(isFinite(k.min.x)&&isFinite(k.min.y)&&isFinite(k.max.x)&&isFinite(k.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var me in this._tiles){var He=this._tiles[me].coords;(He.z!==this._tileZoom||!ee.contains(new W(He.x,He.y)))&&(this._tiles[me].current=!1)}if(Math.abs(f-this._tileZoom)>1){this._setView(o,f);return}for(var nt=k.min.y;nt<=k.max.y;nt++)for(var gt=k.min.x;gt<=k.max.x;gt++){var br=new W(gt,nt);if(br.z=this._tileZoom,!!this._isValidTile(br)){var zn=this._tiles[this._tileCoordsToKey(br)];zn?zn.current=!0:F.push(br)}}if(F.sort(function(Dr,Sl){return Dr.distanceTo(E)-Sl.distanceTo(E)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ya=document.createDocumentFragment();for(gt=0;gt<F.length;gt++)this._addTile(F[gt],ya);this._level.el.appendChild(ya)}}}},_isValidTile:function(o){var l=this._map.options.crs;if(!l.infinite){var f=this._globalTileRange;if(!l.wrapLng&&(o.x<f.min.x||o.x>f.max.x)||!l.wrapLat&&(o.y<f.min.y||o.y>f.max.y))return!1}if(!this.options.bounds)return!0;var w=this._tileCoordsToBounds(o);return Ee(this.options.bounds).overlaps(w)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var l=this._map,f=this.getTileSize(),w=o.scaleBy(f),k=w.add(f),E=l.unproject(w,o.z),F=l.unproject(k,o.z);return[E,F]},_tileCoordsToBounds:function(o){var l=this._tileCoordsToNwSe(o),f=new ve(l[0],l[1]);return this.options.noWrap||(f=this._map.wrapLatLngBounds(f)),f},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var l=o.split(":"),f=new W(+l[0],+l[1]);return f.z=+l[2],f},_removeTile:function(o){var l=this._tiles[o];l&&(Qt(l.el),delete this._tiles[o],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){ft(o,"leaflet-tile");var l=this.getTileSize();o.style.width=l.x+"px",o.style.height=l.y+"px",o.onselectstart=d,o.onmousemove=d,qe.ielt9&&this.options.opacity<1&&ga(o,this.options.opacity)},_addTile:function(o,l){var f=this._getTilePos(o),w=this._tileCoordsToKey(o),k=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(k),this.createTile.length<2&&B(a(this._tileReady,this,o,null,k)),bn(k,f),this._tiles[w]={el:k,coords:o,current:!0},l.appendChild(k),this.fire("tileloadstart",{tile:k,coords:o})},_tileReady:function(o,l,f){l&&this.fire("tileerror",{error:l,tile:f,coords:o});var w=this._tileCoordsToKey(o);f=this._tiles[w],f&&(f.loaded=+new Date,this._map._fadeAnimated?(ga(f.el,0),z(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(f.active=!0,this._pruneTiles()),l||(ft(f.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:f.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),qe.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var l=new W(this._wrapX?c(o.x,this._wrapX):o.x,this._wrapY?c(o.y,this._wrapY):o.y);return l.z=o.z,l},_pxBoundsToTileRange:function(o){var l=this.getTileSize();return new K(o.min.unscaleBy(l).floor(),o.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function BM(o){return new Yu(o)}var _l=Yu.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,l){this._url=o,l=g(this,l),l.detectRetina&&qe.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,l){return this._url===o&&l===void 0&&(l=!0),this._url=o,l||this.redraw(),this},createTile:function(o,l){var f=document.createElement("img");return ut(f,"load",a(this._tileOnLoad,this,l,f)),ut(f,"error",a(this._tileOnError,this,l,f)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(f.referrerPolicy=this.options.referrerPolicy),f.alt="",f.src=this.getTileUrl(o),f},getTileUrl:function(o){var l={r:qe.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var f=this._globalTileRange.max.y-o.y;this.options.tms&&(l.y=f),l["-y"]=f}return S(this._url,n(l,this.options))},_tileOnLoad:function(o,l){qe.ielt9?setTimeout(a(o,this,null,l),0):o(null,l)},_tileOnError:function(o,l,f){var w=this.options.errorTileUrl;w&&l.getAttribute("src")!==w&&(l.src=w),o(f,l)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,l=this.options.maxZoom,f=this.options.zoomReverse,w=this.options.zoomOffset;return f&&(o=l-o),o+w},_getSubdomain:function(o){var l=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var o,l;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(l=this._tiles[o].el,l.onload=d,l.onerror=d,!l.complete)){l.src=_;var f=this._tiles[o].coords;Qt(l),delete this._tiles[o],this.fire("tileabort",{tile:l,coords:f})}},_removeTile:function(o){var l=this._tiles[o];if(l)return l.el.setAttribute("src",_),Yu.prototype._removeTile.call(this,o)},_tileReady:function(o,l,f){if(!(!this._map||f&&f.getAttribute("src")===_))return Yu.prototype._tileReady.call(this,o,l,f)}});function u8(o,l){return new _l(o,l)}var c8=_l.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,l){this._url=o;var f=n({},this.defaultWmsParams);for(var w in l)w in this.options||(f[w]=l[w]);l=g(this,l);var k=l.detectRetina&&qe.retina?2:1,E=this.getTileSize();f.width=E.x*k,f.height=E.y*k,this.wmsParams=f},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,_l.prototype.onAdd.call(this,o)},getTileUrl:function(o){var l=this._tileCoordsToNwSe(o),f=this._crs,w=M(f.project(l[0]),f.project(l[1])),k=w.min,E=w.max,F=(this._wmsVersion>=1.3&&this._crs===n8?[k.y,k.x,E.y,E.x]:[k.x,k.y,E.x,E.y]).join(","),Y=_l.prototype.getTileUrl.call(this,o);return Y+b(this.wmsParams,Y,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(o,l){return n(this.wmsParams,o),l||this.redraw(),this}});function FM(o,l){return new c8(o,l)}_l.WMS=c8,u8.wms=FM;var Ro=Va.extend({options:{padding:.1},initialize:function(o){g(this,o),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ft(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 o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,l){var f=this._map.getZoomScale(l,this._zoom),w=this._map.getSize().multiplyBy(.5+this.options.padding),k=this._map.project(this._center,l),E=w.multiplyBy(-f).add(k).subtract(this._map._getNewPixelOrigin(o,l));qe.any3d?os(this._container,E,f):bn(this._container,E)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,l=this._map.getSize(),f=this._map.containerPointToLayerPoint(l.multiplyBy(-o)).round();this._bounds=new K(f,f.add(l.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),d8=Ro.extend({options:{tolerance:0},getEvents:function(){var o=Ro.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Ro.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");ut(o,"mousemove",this._onMouseMove,this),ut(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ut(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){z(this._redrawRequest),delete this._ctx,Qt(this._container),Ht(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var l in this._layers)o=this._layers[l],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ro.prototype._update.call(this);var o=this._bounds,l=this._container,f=o.getSize(),w=qe.retina?2:1;bn(l,o.min),l.width=w*f.x,l.height=w*f.y,l.style.width=f.x+"px",l.style.height=f.y+"px",qe.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){Ro.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[s(o)]=o;var l=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var l=o._order,f=l.next,w=l.prev;f?f.prev=w:this._drawLast=w,w?w.next=f:this._drawFirst=f,delete o._order,delete this._layers[s(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var l=o.options.dashArray.split(/[, ]+/),f=[],w,k;for(k=0;k<l.length;k++){if(w=Number(l[k]),isNaN(w))return;f.push(w)}o.options._dashArray=f}else o.options._dashArray=o.options.dashArray},_requestRedraw:function(o){this._map&&(this._extendRedrawBounds(o),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(o){if(o._pxBounds){var l=(o.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new K,this._redrawBounds.extend(o._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(o._pxBounds.max.add([l,l]))}},_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 o=this._redrawBounds;if(o){var l=o.getSize();this._ctx.clearRect(o.min.x,o.min.y,l.x,l.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var o,l=this._redrawBounds;if(this._ctx.save(),l){var f=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,f.x,f.y),this._ctx.clip()}this._drawing=!0;for(var w=this._drawFirst;w;w=w.next)o=w.layer,(!l||o._pxBounds&&o._pxBounds.intersects(l))&&o._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(o,l){if(this._drawing){var f,w,k,E,F=o._parts,Y=F.length,ee=this._ctx;if(Y){for(ee.beginPath(),f=0;f<Y;f++){for(w=0,k=F[f].length;w<k;w++)E=F[f][w],ee[w?"lineTo":"moveTo"](E.x,E.y);l&&ee.closePath()}this._fillStroke(ee,o)}}},_updateCircle:function(o){if(!(!this._drawing||o._empty())){var l=o._point,f=this._ctx,w=Math.max(Math.round(o._radius),1),k=(Math.max(Math.round(o._radiusY),1)||w)/w;k!==1&&(f.save(),f.scale(1,k)),f.beginPath(),f.arc(l.x,l.y/k,w,0,Math.PI*2,!1),k!==1&&f.restore(),this._fillStroke(f,o)}},_fillStroke:function(o,l){var f=l.options;f.fill&&(o.globalAlpha=f.fillOpacity,o.fillStyle=f.fillColor||f.color,o.fill(f.fillRule||"evenodd")),f.stroke&&f.weight!==0&&(o.setLineDash&&o.setLineDash(l.options&&l.options._dashArray||[]),o.globalAlpha=f.opacity,o.lineWidth=f.weight,o.strokeStyle=f.color,o.lineCap=f.lineCap,o.lineJoin=f.lineJoin,o.stroke())},_onClick:function(o){for(var l=this._map.mouseEventToLayerPoint(o),f,w,k=this._drawFirst;k;k=k.next)f=k.layer,f.options.interactive&&f._containsPoint(l)&&(!(o.type==="click"||o.type==="preclick")||!this._map._draggableMoved(f))&&(w=f);this._fireEvent(w?[w]:!1,o)},_onMouseMove:function(o){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(o);this._handleMouseHover(o,l)}},_handleMouseOut:function(o){var l=this._hoveredLayer;l&&(cn(this._container,"leaflet-interactive"),this._fireEvent([l],o,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(o,l){if(!this._mouseHoverThrottled){for(var f,w,k=this._drawFirst;k;k=k.next)f=k.layer,f.options.interactive&&f._containsPoint(l)&&(w=f);w!==this._hoveredLayer&&(this._handleMouseOut(o),w&&(ft(this._container,"leaflet-interactive"),this._fireEvent([w],o,"mouseover"),this._hoveredLayer=w)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,o),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(o,l,f){this._map._fireDOMEvent(l,f||l.type,o)},_bringToFront:function(o){var l=o._order;if(l){var f=l.next,w=l.prev;if(f)f.prev=w;else return;w?w.next=f:f&&(this._drawFirst=f),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(o)}},_bringToBack:function(o){var l=o._order;if(l){var f=l.next,w=l.prev;if(w)w.next=f;else return;f?f.prev=w:w&&(this._drawLast=w),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(o)}}});function f8(o){return qe.canvas?new d8(o):null}var Xu=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(o){return document.createElement("<lvml:"+o+' class="lvml">')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),VM={_initContainer:function(){this._container=Nt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Ro.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var l=o._container=Xu("shape");ft(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",o._path=Xu("path"),l.appendChild(o._path),this._updateStyle(o),this._layers[s(o)]=o},_addPath:function(o){var l=o._container;this._container.appendChild(l),o.options.interactive&&o.addInteractiveTarget(l)},_removePath:function(o){var l=o._container;Qt(l),o.removeInteractiveTarget(l),delete this._layers[s(o)]},_updateStyle:function(o){var l=o._stroke,f=o._fill,w=o.options,k=o._container;k.stroked=!!w.stroke,k.filled=!!w.fill,w.stroke?(l||(l=o._stroke=Xu("stroke")),k.appendChild(l),l.weight=w.weight+"px",l.color=w.color,l.opacity=w.opacity,w.dashArray?l.dashStyle=v(w.dashArray)?w.dashArray.join(" "):w.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=w.lineCap.replace("butt","flat"),l.joinstyle=w.lineJoin):l&&(k.removeChild(l),o._stroke=null),w.fill?(f||(f=o._fill=Xu("fill")),k.appendChild(f),f.color=w.fillColor||w.color,f.opacity=w.fillOpacity):f&&(k.removeChild(f),o._fill=null)},_updateCircle:function(o){var l=o._point.round(),f=Math.round(o._radius),w=Math.round(o._radiusY||f);this._setPath(o,o._empty()?"M0 0":"AL "+l.x+","+l.y+" "+f+","+w+" 0,"+65535*360)},_setPath:function(o,l){o._path.v=l},_bringToFront:function(o){vl(o._container)},_bringToBack:function(o){yl(o._container)}},Bd=qe.vml?Xu:ce,Ju=Ro.extend({_initContainer:function(){this._container=Bd("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Bd("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Qt(this._container),Ht(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Ro.prototype._update.call(this);var o=this._bounds,l=o.getSize(),f=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,f.setAttribute("width",l.x),f.setAttribute("height",l.y)),bn(f,o.min),f.setAttribute("viewBox",[o.min.x,o.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(o){var l=o._path=Bd("path");o.options.className&&ft(l,o.options.className),o.options.interactive&&ft(l,"leaflet-interactive"),this._updateStyle(o),this._layers[s(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){Qt(o._path),o.removeInteractiveTarget(o._path),delete this._layers[s(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var l=o._path,f=o.options;l&&(f.stroke?(l.setAttribute("stroke",f.color),l.setAttribute("stroke-opacity",f.opacity),l.setAttribute("stroke-width",f.weight),l.setAttribute("stroke-linecap",f.lineCap),l.setAttribute("stroke-linejoin",f.lineJoin),f.dashArray?l.setAttribute("stroke-dasharray",f.dashArray):l.removeAttribute("stroke-dasharray"),f.dashOffset?l.setAttribute("stroke-dashoffset",f.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),f.fill?(l.setAttribute("fill",f.fillColor||f.color),l.setAttribute("fill-opacity",f.fillOpacity),l.setAttribute("fill-rule",f.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(o,l){this._setPath(o,ge(o._parts,l))},_updateCircle:function(o){var l=o._point,f=Math.max(Math.round(o._radius),1),w=Math.max(Math.round(o._radiusY),1)||f,k="a"+f+","+w+" 0 1,0 ",E=o._empty()?"M0 0":"M"+(l.x-f)+","+l.y+k+f*2+",0 "+k+-f*2+",0 ";this._setPath(o,E)},_setPath:function(o,l){o._path.setAttribute("d",l)},_bringToFront:function(o){vl(o._path)},_bringToBack:function(o){yl(o._path)}});qe.vml&&Ju.include(VM);function p8(o){return qe.svg||qe.vml?new Ju(o):null}bt.include({getRenderer:function(o){var l=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var l=this._paneRenderers[o];return l===void 0&&(l=this._createRenderer({pane:o}),this._paneRenderers[o]=l),l},_createRenderer:function(o){return this.options.preferCanvas&&f8(o)||p8(o)}});var h8=xl.extend({initialize:function(o,l){xl.prototype.initialize.call(this,this._boundsToLatLngs(o),l)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=Ee(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function zM(o,l){return new h8(o,l)}Ju.create=Bd,Ju.pointsToPath=ge,Eo.geometryToLayer=Ld,Eo.coordsToLatLng=ip,Eo.coordsToLatLngs=Ad,Eo.latLngToCoords=sp,Eo.latLngsToCoords=Md,Eo.getFeature=bl,Eo.asFeature=Id,bt.mergeOptions({boxZoom:!0});var m8=co.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){ut(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ht(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Qt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Uu(),Uf(),this._startPoint=this._map.mouseEventToContainerPoint(o),ut(document,{contextmenu:ls,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=Nt("div","leaflet-zoom-box",this._container),ft(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var l=new K(this._point,this._startPoint),f=l.getSize();bn(this._box,l.min),this._box.style.width=f.x+"px",this._box.style.height=f.y+"px"},_finish:function(){this._moved&&(Qt(this._box),cn(this._container,"leaflet-crosshair")),Zu(),Zf(),Ht(document,{contextmenu:ls,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new ve(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});bt.addInitHook("addHandler","boxZoom",m8),bt.mergeOptions({doubleClickZoom:!0});var g8=co.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var l=this._map,f=l.getZoom(),w=l.options.zoomDelta,k=o.originalEvent.shiftKey?f-w:f+w;l.options.doubleClickZoom==="center"?l.setZoom(k):l.setZoomAround(o.containerPoint,k)}});bt.addInitHook("addHandler","doubleClickZoom",g8),bt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var v8=co.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new ii(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}ft(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){cn(this._map._container,"leaflet-grab"),cn(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 o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=Ee(this._map.options.maxBounds);this._offsetLimit=M(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var l=this._lastTime=+new Date,f=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(f),this._times.push(l),this._prunePositions(l)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,l){return o-(o-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;o.x<l.min.x&&(o.x=this._viscousLimit(o.x,l.min.x)),o.y<l.min.y&&(o.y=this._viscousLimit(o.y,l.min.y)),o.x>l.max.x&&(o.x=this._viscousLimit(o.x,l.max.x)),o.y>l.max.y&&(o.y=this._viscousLimit(o.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,l=Math.round(o/2),f=this._initialWorldOffset,w=this._draggable._newPos.x,k=(w-l+f)%o+l-f,E=(w+l+f)%o-l-f,F=Math.abs(k+f)<Math.abs(E+f)?k:E;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(o){var l=this._map,f=l.options,w=!f.inertia||o.noInertia||this._times.length<2;if(l.fire("dragend",o),w)l.fire("moveend");else{this._prunePositions(+new Date);var k=this._lastPos.subtract(this._positions[0]),E=(this._lastTime-this._times[0])/1e3,F=f.easeLinearity,Y=k.multiplyBy(F/E),ee=Y.distanceTo([0,0]),me=Math.min(f.inertiaMaxSpeed,ee),He=Y.multiplyBy(me/ee),nt=me/(f.inertiaDeceleration*F),gt=He.multiplyBy(-nt/2).round();!gt.x&&!gt.y?l.fire("moveend"):(gt=l._limitOffset(gt,l.options.maxBounds),B(function(){l.panBy(gt,{duration:nt,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});bt.addInitHook("addHandler","dragging",v8),bt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var y8=co.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(o){this._map=o,this._setPanDelta(o.options.keyboardPanDelta),this._setZoomDelta(o.options.zoomDelta)},addHooks:function(){var o=this._map._container;o.tabIndex<=0&&(o.tabIndex="0"),ut(o,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ht(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 o=document.body,l=document.documentElement,f=o.scrollTop||l.scrollTop,w=o.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(w,f)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(o){var l=this._panKeys={},f=this.keyCodes,w,k;for(w=0,k=f.left.length;w<k;w++)l[f.left[w]]=[-1*o,0];for(w=0,k=f.right.length;w<k;w++)l[f.right[w]]=[o,0];for(w=0,k=f.down.length;w<k;w++)l[f.down[w]]=[0,o];for(w=0,k=f.up.length;w<k;w++)l[f.up[w]]=[0,-1*o]},_setZoomDelta:function(o){var l=this._zoomKeys={},f=this.keyCodes,w,k;for(w=0,k=f.zoomIn.length;w<k;w++)l[f.zoomIn[w]]=o;for(w=0,k=f.zoomOut.length;w<k;w++)l[f.zoomOut[w]]=-o},_addHooks:function(){ut(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ht(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(o){if(!(o.altKey||o.ctrlKey||o.metaKey)){var l=o.keyCode,f=this._map,w;if(l in this._panKeys){if(!f._panAnim||!f._panAnim._inProgress)if(w=this._panKeys[l],o.shiftKey&&(w=J(w).multiplyBy(3)),f.options.maxBounds&&(w=f._limitOffset(J(w),f.options.maxBounds)),f.options.worldCopyJump){var k=f.wrapLatLng(f.unproject(f.project(f.getCenter()).add(w)));f.panTo(k)}else f.panBy(w)}else if(l in this._zoomKeys)f.setZoom(f.getZoom()+(o.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&f._popup&&f._popup.options.closeOnEscapeKey)f.closePopup();else return;ls(o)}}});bt.addInitHook("addHandler","keyboard",y8),bt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var C8=co.extend({addHooks:function(){ut(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ht(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(o){var l=U7(o),f=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(o),this._startTime||(this._startTime=+new Date);var w=Math.max(f-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),w),ls(o)},_performZoom:function(){var o=this._map,l=o.getZoom(),f=this._map.options.zoomSnap||0;o._stop();var w=this._delta/(this._map.options.wheelPxPerZoomLevel*4),k=4*Math.log(2/(1+Math.exp(-Math.abs(w))))/Math.LN2,E=f?Math.ceil(k/f)*f:k,F=o._limitZoom(l+(this._delta>0?E:-E))-l;this._delta=0,this._startTime=null,F&&(o.options.scrollWheelZoom==="center"?o.setZoom(l+F):o.setZoomAround(this._lastMousePos,l+F))}});bt.addInitHook("addHandler","scrollWheelZoom",C8);var jM=600;bt.mergeOptions({tapHold:qe.touchNative&&qe.safari&&qe.mobile,tapTolerance:15});var w8=co.extend({addHooks:function(){ut(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ht(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var l=o.touches[0];this._startPos=this._newPos=new W(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(ut(document,"touchend",er),ut(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),jM),ut(document,"touchend touchcancel contextmenu",this._cancel,this),ut(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){Ht(document,"touchend",er),Ht(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),Ht(document,"touchend touchcancel contextmenu",this._cancel,this),Ht(document,"touchmove",this._onMove,this)},_onMove:function(o){var l=o.touches[0];this._newPos=new W(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,l){var f=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});f._simulated=!0,l.target.dispatchEvent(f)}});bt.addInitHook("addHandler","tapHold",w8),bt.mergeOptions({touchZoom:qe.touch,bounceAtZoomLimits:!0});var x8=co.extend({addHooks:function(){ft(this._map._container,"leaflet-touch-zoom"),ut(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){cn(this._map._container,"leaflet-touch-zoom"),Ht(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var l=this._map;if(!(!o.touches||o.touches.length!==2||l._animatingZoom||this._zooming)){var f=l.mouseEventToContainerPoint(o.touches[0]),w=l.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(f.add(w)._divideBy(2))),this._startDist=f.distanceTo(w),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),ut(document,"touchmove",this._onTouchMove,this),ut(document,"touchend touchcancel",this._onTouchEnd,this),er(o)}},_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var l=this._map,f=l.mouseEventToContainerPoint(o.touches[0]),w=l.mouseEventToContainerPoint(o.touches[1]),k=f.distanceTo(w)/this._startDist;if(this._zoom=l.getScaleZoom(k,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&k<1||this._zoom>l.getMaxZoom()&&k>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,k===1)return}else{var E=f._add(w)._divideBy(2)._subtract(this._centerPoint);if(k===1&&E.x===0&&E.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(E),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),z(this._animRequest);var F=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(F,this,!0),er(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,z(this._animRequest),Ht(document,"touchmove",this._onTouchMove,this),Ht(document,"touchend touchcancel",this._onTouchEnd,this),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))}});bt.addInitHook("addHandler","touchZoom",x8),bt.BoxZoom=m8,bt.DoubleClickZoom=g8,bt.Drag=v8,bt.Keyboard=y8,bt.ScrollWheelZoom=C8,bt.TapHold=w8,bt.TouchZoom=x8,e.Bounds=K,e.Browser=qe,e.CRS=ze,e.Canvas=d8,e.Circle=op,e.CircleMarker=Td,e.Class=H,e.Control=Fa,e.DivIcon=l8,e.DivOverlay=fo,e.DomEvent=iM,e.DomUtil=aM,e.Draggable=ii,e.Evented=X,e.FeatureGroup=No,e.GeoJSON=Eo,e.GridLayer=Yu,e.Handler=co,e.Icon=wl,e.ImageOverlay=Od,e.LatLng=I,e.LatLngBounds=ve,e.Layer=Va,e.LayerGroup=Cl,e.LineUtil=CM,e.Map=bt,e.Marker=Rd,e.Mixin=pM,e.Path=si,e.Point=W,e.PolyUtil=hM,e.Polygon=xl,e.Polyline=Po,e.Popup=Dd,e.PosAnimation=Z7,e.Projection=wM,e.Rectangle=h8,e.Renderer=Ro,e.SVG=Ju,e.SVGOverlay=s8,e.TileLayer=_l,e.Tooltip=Hd,e.Transformation=he,e.Util=V,e.VideoOverlay=i8,e.bind=a,e.bounds=M,e.canvas=f8,e.circle=EM,e.circleMarker=PM,e.control=Gu,e.divIcon=HM,e.extend=n,e.featureGroup=SM,e.geoJSON=o8,e.geoJson=LM,e.gridLayer=BM,e.icon=kM,e.imageOverlay=AM,e.latLng=ne,e.latLngBounds=Ee,e.layerGroup=_M,e.map=sM,e.marker=NM,e.point=J,e.polygon=TM,e.polyline=RM,e.popup=OM,e.rectangle=zM,e.setOptions=g,e.stamp=s,e.svg=p8,e.svgOverlay=IM,e.tileLayer=u8,e.tooltip=DM,e.transformation=Ne,e.version=t,e.videoOverlay=MM;var UM=window.L;e.noConflict=function(){return window.L=UM,this},window.L=e}))});function Qi(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function ed(e,t){return t==null?function(r,a){let i=(0,Lu.useRef)();return i.current||(i.current=e(r,a)),i}:function(r,a){let i=(0,Lu.useRef)();i.current||(i.current=e(r,a));let s=(0,Lu.useRef)(r),{instance:u}=i.current;return(0,Lu.useEffect)(function(){s.current!==r&&(t(u,r,s.current),s.current=r)},[u,r,a]),i}}var Lu,y9=A(()=>{Lu=Z(Se(),1)});function hK(e,t){(0,zT.useEffect)(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function C9(e){return function(n){let r=X1(),a=e(ll(n,r),r);return df(r.map,n.attribution),hf(a.current,n.eventHandlers),hK(a.current,r),a}}var zT,jT=A(()=>{zT=Z(Se(),1);p9();J1();v9();mf()});function w9(e,t){let n=ed(e,t),r=C9(n);return IT(r)}function x9(e,t){let n=ed(e),r=BT(n,t);return OT(r)}function b9(e,t){let n=ed(e,t),r=C9(n);return DT(r)}var UT=A(()=>{HT();y9();jT();FT()});function _9(e,t,n){let{opacity:r,zIndex:a}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),a!=null&&a!==n.zIndex&&e.setZIndex(a)}var ZT=A(()=>{});var td=A(()=>{J1();y9();UT();ZT();mf()});function S9(){return S9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S9.apply(this,arguments)}function mK({bounds:e,boundsOptions:t,center:n,children:r,className:a,id:i,placeholder:s,style:u,whenReady:c,zoom:d,...p},h){let[m]=(0,Xr.useState)({className:a,id:i,style:u}),[g,b]=(0,Xr.useState)(null);(0,Xr.useImperativeHandle)(h,()=>g?.map??null,[g]);let C=(0,Xr.useCallback)(v=>{if(v!==null&&g===null){let x=new $T.Map(v,p);n!=null&&d!=null?x.setView(n,d):e!=null&&x.fitBounds(e,t),c!=null&&x.whenReady(c),b(h9(x))}},[]);(0,Xr.useEffect)(()=>()=>{g?.map.remove()},[g]);let S=g?Xr.default.createElement(Y1,{value:g},r):s??null;return Xr.default.createElement("div",S9({},m,{ref:C}),S)}var $T,Xr,k9,WT=A(()=>{td();$T=Z(Q1(),1),Xr=Z(Se(),1);k9=(0,Xr.forwardRef)(mK)});var GT,N9,qT=A(()=>{td();GT=Z(Q1(),1),N9=w9(function({position:t,...n},r){let a=new GT.Marker(t,n);return Qi(a,m9(r,{overlayContainer:a}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())})});var KT,YT,P9,XT=A(()=>{td();KT=Z(Q1(),1),YT=Z(Se(),1),P9=x9(function(t,n){let r=new KT.Popup(t,n.overlayContainer);return Qi(r,n)},function(t,n,{position:r},a){(0,YT.useEffect)(function(){let{instance:s}=t;function u(d){d.popup===s&&(s.update(),a(!0))}function c(d){d.popup===s&&a(!1)}return n.map.on({popupopen:u,popupclose:c}),n.overlayContainer==null?(r!=null&&s.setLatLng(r),s.openOn(n.map)):n.overlayContainer.bindPopup(s),function(){n.map.off({popupopen:u,popupclose:c}),n.overlayContainer?.unbindPopup(),n.map.removeLayer(s)}},[t,n,a,r])})});var JT,E9,QT=A(()=>{td();JT=Z(Q1(),1),E9=b9(function({url:t,...n},r){let a=new JT.TileLayer(t,ll(n,r));return Qi(a,r)},function(t,n,r){_9(t,n,r);let{url:a}=n;a!=null&&a!==r.url&&t.setUrl(a)})});var eL=A(()=>{WT();qT();XT();QT()});function gK({url:e,alt:t,open:n,onClose:r}){return(0,G.jsxs)(z4,{open:n,onOpenChange:r,children:[(0,G.jsx)(o1,{children:(0,G.jsx)(x5,{})}),(0,G.jsx)(w5,{className:"lua:w-full lua:fixed lua:inset-0 lua:h-full lua:max-w-none lua:p-0 lua:bg-transparent lua:shadow-none lua:translate-x-0 lua:translate-y-0 lua:m-0 lua:rounded-none",showClose:!1,children:(0,G.jsxs)("div",{className:"lua:relative lua:w-full lua:h-full",children:[(0,G.jsx)("button",{onClick:r,className:"lua:cursor-pointer lua:absolute lua:top-4 lua:left-4 lua:z-10 lua:p-2 lua:bg-black/50 lua:rounded-full lua:hover:bg-black/70 lua:transition-colors",children:(0,G.jsx)(qr,{color:"white",className:"lua:w-6 lua:h-6"})}),(0,G.jsx)("div",{className:"lua:w-full lua:h-full lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("img",{src:e,alt:t,className:"sm:lua:aspect-[16/9] lua:object-contain lua:rounded-none sm:lua:rounded-lg"})})]})})]})}function vK({images:e,initialIndex:t=0,open:n,onClose:r}){let[a,i]=(0,$e.useState)(),[s,u]=(0,$e.useState)(0);return(0,$e.useEffect)(()=>{if(!a)return;t>0&&t<e.length&&(a.scrollTo(t),u(t));let c=()=>{u(a.selectedScrollSnap())};return a.on("select",c),c(),()=>{a?.off("select",c)}},[a,t,e.length]),(0,G.jsxs)(z4,{open:n,onOpenChange:r,children:[(0,G.jsx)(o1,{children:(0,G.jsx)(x5,{})}),(0,G.jsx)(w5,{className:"lua:w-full lua:m-0",showClose:!1,children:(0,G.jsxs)("div",{className:"lua:relative lua:w-full lua:h-full",children:[(0,G.jsx)("button",{onClick:r,className:"lua:cursor-pointer lua:absolute lua:top-4 lua:left-4 lua:z-10 lua:p-2 lua:bg-black/50 lua:rounded-full lua:hover:bg-black/70 lua:transition-colors",children:(0,G.jsx)(qr,{color:"white",className:"lua:w-6 lua:h-6"})}),e.length>1&&(0,G.jsxs)("div",{className:"lua:absolute lua:top-4 lua:right-4 lua:z-10 lua:px-3 lua:py-1 lua:bg-black/50 lua:rounded-full lua:text-white lua:text-sm",children:[s+1," / ",e.length]}),(0,G.jsx)("div",{className:"lua:w-full lua:h-full lua:flex lua:items-center lua:justify-center lua:px-16",children:(0,G.jsxs)(D4,{setApi:i,className:"lua:w-full lua:max-w-5xl",opts:{align:"center",loop:e.length>1},children:[(0,G.jsx)(H4,{children:e.map((c,d)=>(0,G.jsx)(B4,{className:"lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("img",{src:c.src,alt:c.alt||`Image ${d+1}`,className:"lua:max-w-full lua:max-h-screen lua:object-contain lua:rounded-none sm:lua:rounded-lg",draggable:!1})},d))}),e.length>1&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F4,{className:"lua:left-4 lua:bg-black/50 lua:border-none lua:text-white lua:hover:bg-black/70 lua:hover:text-white-white/70"}),(0,G.jsx)(V4,{className:"lua:right-4 lua:bg-black/50 lua:border-none lua:text-white lua:hover:bg-black/70 lua:hover:text-white-white/70"})]})]})})]})})]})}function yK({children:e,language:t=""}){let[n,r]=(0,$e.useState)(!1),a=typeof e=="string"?e:String(e),i=t||"javascript";return(0,G.jsxs)("div",{className:"lua:relative lua:my-4 lua:rounded-lg lua:overflow-hidden lua:mx-4 lua:sm:mx-5 lua:grid",children:[(0,G.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:bg-gray-800 lua:text-gray-200 lua:px-4 lua:py-2",children:[(0,G.jsx)("span",{className:"lua:text-xs lua:font-mono",children:i}),(0,G.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),2e3)},className:"lua:text-xs lua:bg-gray-700 lua:hover:bg-gray-600 lua:rounded lua:px-2 lua:py-1 lua:transition-colors","aria-label":"Copy code",children:n?"Copied!":"Copy"})]}),(0,G.jsx)(TT,{theme:f9.vsDark,code:a,language:i,children:({className:s,style:u,tokens:c,getLineProps:d,getTokenProps:p})=>(0,G.jsx)("pre",{className:`${s} lua:p-4 lua:overflow-x-auto`,style:u,children:c.map((h,m)=>(0,G.jsx)("div",{...d({line:h}),children:h.map((g,b)=>(0,G.jsx)("span",{...p({token:g})},b))},m))})})]})}function wK(e){let t=new URL(e,"http://lua"),n=decodeURIComponent(t.pathname),r={};for(let[a,i]of t.searchParams.entries())r[a]=decodeURIComponent(i);return{pathname:n,queryParams:r}}function xK(e){let t=e.match(/\[navigate\]\(([^)]+)\)/);return t?t[1]:null}function NK(e){return{icon:()=>null}}function tL({documents:e}){return e.map(t=>{let n=NK(new File([],"",{type:t.mediaType})).icon;return(0,G.jsx)("a",{"data-testid":"chat-file-message",href:t.url,target:"_blank",rel:"noopener noreferrer",className:"chat-file-message lua:mx-4 lua:sm:mx-5",children:(0,G.jsx)("div",{className:"lua:flex lua:flex-col lua:gap-8",children:(0,G.jsxs)("div",{className:"chat-file-card lua:flex lua:items-center lua:justify-start lua:p-3 lua:border lua:border-gray-200 lua:rounded-lg lua:bg-white lua:w-80",children:[(0,G.jsx)(n,{className:"lua:w-12 lua:h-12 lua:text-gray-500"}),(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1 lua:pl-2",children:[t.fileName||"File",(0,G.jsx)("span",{className:"lua:text-gray-500 lua:text-sm",children:t.mediaType})]})]})})},t.url)})}function PK(e){let t=[],n=e.split(`
87
+ `).filter(r=>r.trim()!=="");for(let r of n){let a=/\[([^\]]+)\]\(([^)]+)\)\s+filename:([^\s]+)\s+mime:([^\s]+)/g,i;for(;(i=a.exec(r))!==null;){let[,s,u,c,d]=i;t.push({fileName:s.trim(),url:u.trim(),filename:c.trim(),mediaType:d.trim()})}}return t}function EK({message:e}){return(0,G.jsx)("div",{className:"chat-audio-message lua:flex lua:flex-col lua:mx-4 lua:sm:mx-5","data-testid":"audio-preview",children:(0,G.jsx)("div",{className:"chat-audio-container audio-playback-container lua:relative",children:(0,G.jsxs)("div",{className:"chat-audio-controls lua:flex lua:items-center lua:gap-2 lua:min-w-full",children:[(0,G.jsx)("audio",{src:e.url,controls:!0,className:"chat-audio-player lua:h-8",style:{backgroundColor:"transparent",border:"none"}}),e.isUploading&&(0,G.jsx)("div",{className:"chat-audio-upload-overlay lua:absolute lua:inset-0 lua:bg-black lua:bg-opacity-50 lua:rounded-lg lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("div",{className:"lua:text-white lua:text-sm",children:"Uploading..."})})]})})})}function rL({url:e}){return(0,G.jsxs)(Ce,{onClick:t=>{if(t.preventDefault(),/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){window.open(e,"_blank","noopener,noreferrer");return}let n=500,r=600,a=window.screen.width/2-n/2,i=window.screen.height/2-r/2,s=window.open(e,"Payment",`width=${n},height=${r},left=${a},top=${i},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);(!s||s.closed||typeof s.closed>"u")&&window.open(e,"_blank","noopener,noreferrer")},className:"chat-payment-button lua:rounded-xl",children:[(0,G.jsx)(I4,{size:16}),(0,G.jsx)("span",{children:"Open payment"})]})}function sL(e){let t=e.match(/!\[([^\]]+)\]\(([^)]+)\)/);if(!t)return null;let[,n,r]=t;return{text:n,url:r}}function IK(e){return e.replace(/([^\n]):::/g,`$1
88
88
  :::`)}function uL({images:e}){let[t,n]=(0,$e.useState)(!1),[r,a]=(0,$e.useState)(0),i=(0,$e.useRef)(null),[s,u]=(0,$e.useState)(!1),[c,d]=(0,$e.useState)(0),[p,h]=(0,$e.useState)(0),[m,g]=(0,$e.useState)(0),b=(0,$e.useCallback)(_=>{i.current&&(u(!0),d(_.pageX-i.current.offsetLeft),h(i.current.scrollLeft),g(0),_.preventDefault())},[]),C=(0,$e.useCallback)(_=>{if(!s||!i.current)return;_.preventDefault();let N=_.pageX-i.current.offsetLeft,T=(N-c)*2;i.current.scrollLeft=p-T,g(Math.abs(N-c))},[s,c,p]),S=(0,$e.useCallback)(()=>{u(!1)},[]),v=(0,$e.useCallback)(()=>{u(!1)},[]),x=(0,$e.useCallback)((_,N)=>{if(m>5){N.preventDefault();return}a(_),n(!0)},[m]);return(0,G.jsxs)("div",{"data-testid":"image-carousel-message",className:"chat-image-carousel-message lua:w-full",children:[(0,G.jsx)("div",{ref:i,className:"chat-image-carousel markdown-image-carousel",style:{cursor:s?"grabbing":"grab"},onMouseDown:b,onMouseMove:C,onMouseUp:S,onMouseLeave:v,onDragStart:_=>{_.preventDefault(),_.stopPropagation()},onDragOver:_=>{_.preventDefault(),_.stopPropagation()},children:e.map((_,N)=>(0,G.jsx)("div",{className:"chat-carousel-image-item markdown-image-item",onClick:T=>x(N,T),children:(0,G.jsx)("img",{src:_.src,alt:_.alt,draggable:!1,style:{userSelect:"none"}})},_.src))}),(0,G.jsx)(vK,{images:e,initialIndex:r,open:t,onClose:()=>n(!1)})]})}function HK({message:e}){let[t,n]=(0,$e.useState)(!1);return e.url?(0,G.jsxs)("div",{"data-testid":"image-message",className:"chat-image-message lua:flex lua:flex-col lua:w-3/5 lua:mx-4 lua:sm:mx-5",children:[(0,G.jsxs)("div",{className:"chat-image-container lua:relative",children:[(0,G.jsx)("img",{src:e.url,alt:e.content,className:"chat-image lua:rounded-lg lua:w-full lua:cursor-pointer",onClick:()=>n(!0)}),e.isUploading&&(0,G.jsx)("div",{className:"chat-image-upload-overlay lua:absolute lua:inset-0 lua:bg-black lua:bg-opacity-50 lua:rounded-lg lua:flex lua:items-center lua:justify-center",children:(0,G.jsxs)("div",{className:"lua:text-white lua:text-sm",children:["Uploading..."," ",e.uploadProgress?Math.round(e.uploadProgress):0,"%"]})})]}),!e.isUploading&&e.content.length>0&&(0,G.jsx)("div",{className:"chat-image-caption lua:w-full lua:bg-gray-100 lua:text-gray-800 lua:rounded-2xl lua:px-4 lua:p-3 lua:mt-8",children:e.content}),(0,G.jsx)(gK,{url:e.url,alt:e.content,open:t,onClose:()=>n(!1)})]}):null}function BK({url:e,luaApiUrl:t,authToken:n,disablePreviewOnLinks:r}){let[a,i]=(0,$e.useState)(null),[s,u]=(0,$e.useState)(!0),[c,d]=(0,$e.useState)(null);return(0,$e.useEffect)(()=>{e&&t&&!r&&(async()=>{try{u(!0),d(null);let p=n;if(!p)throw new Error("No auth token available");let h=await fetch(`${t}/chat/url-metadata?url=${encodeURIComponent(e)}`,{headers:{Authorization:`Bearer ${p}`}});if(!h.ok)throw new Error(`Failed to fetch preview: ${h.status}`);let m=await h.json();i(m)}catch(p){console.error("Error fetching link preview:",p),d(p instanceof Error?p.message:"Failed to load preview")}finally{u(!1)}})()},[e,t]),r?(0,G.jsx)("div",{className:"lua:mb-5 lua:mx-[-30px]",children:(0,G.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:(0,G.jsx)(Ce,{variant:"muted",children:e})})}):s?(0,G.jsxs)("div",{className:"lua:animate-pulse",children:[(0,G.jsx)("div",{className:"lua:bg-gray-300 lua:h-4 lua:w-3/4 lua:mb-2 lua:rounded"}),(0,G.jsx)("div",{className:"lua:bg-gray-300 lua:h-3 lua:w-1/2 lua:rounded"})]}):c||!a?(0,G.jsx)("div",{className:"lua:mb-5 lua:mx-[-30px]",children:(0,G.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:(0,G.jsx)(Ce,{variant:"muted",children:e})})}):(0,G.jsxs)("a",{href:a.url||e,target:"_blank",rel:"noopener noreferrer",className:"lua:block lua:border lua:border-gray-200 lua:rounded-lg lua:p-3 lua:hover:bg-gray-50 lua:transition-colors lua:no-underline lua:max-w-sm",children:[a.image&&(0,G.jsx)("img",{src:a.image,alt:a.title,className:"lua:w-full lua:h-32 lua:object-cover lua:rounded lua:mb-2",onError:p=>{p.currentTarget.style.display="none"}}),(0,G.jsx)("div",{className:"lua:text-sm lua:font-medium lua:text-gray-900 lua:mb-1 lua:line-clamp-2",children:a.title}),a.description&&(0,G.jsx)("div",{className:"lua:text-xs lua:text-gray-600 lua:line-clamp-2",children:a.description}),(0,G.jsx)("div",{className:"lua:text-xs lua:text-gray-400 lua:mt-1 lua:truncate",children:new URL(a.url||e).hostname})]})}function cL({links:e,luaApiUrl:t,authToken:n,disablePreviewOnLinks:r}){return(0,G.jsx)("div",{"data-testid":"link-list-message",className:"chat-link-list-message lua:w-full",children:(0,G.jsx)("div",{className:"chat-links-container lua:space-y-2 lua:mx-4 lua:sm:mx-5",children:e.map(a=>(0,G.jsx)(BK,{url:a,luaApiUrl:t,authToken:n,disablePreviewOnLinks:r},a))})})}function FK({location:e}){let t=[e.latitude,e.longitude];return(0,G.jsx)("div",{className:"lua:w-full lua:h-48 lua:rounded-lg lua:overflow-hidden lua:border lua:border-gray-200",children:(0,G.jsxs)(k9,{center:t,zoom:15,scrollWheelZoom:!1,className:"lua:w-full lua:h-full",children:[(0,G.jsx)(E9,{attribution:'\xA9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,G.jsx)(N9,{position:t,children:e.address&&(0,G.jsx)(P9,{children:(0,G.jsx)("div",{children:e.address})})})]})})}function VK({location:e}){return(0,G.jsx)("div",{className:"lua:w-full lua:h-full lua:bg-gray-200 lua:rounded-lg lua:flex lua:items-center lua:justify-center lua:flex-col",children:e.address&&(0,G.jsx)(FK,{location:e})})}function zK({location:e}){return(0,G.jsx)("div",{className:"lua:w-full lua:h-60 lua:rounded-lg","data-testid":"location-preview",children:(0,G.jsx)(VK,{location:e})})}function jK({message:e}){return(0,G.jsx)("div",{"data-testid":"location-message",className:"chat-location-message lua:flex lua:flex-col lua:w-11/12 sm:lua:w-3/5 lua:bg-gray-100 lua:text-gray-800 lua:rounded-2xl lua:p-3 lua:mx-4 lua:sm:mx-5",children:(0,G.jsxs)("div",{className:"chat-location-preview-container location-preview-container lua:relative",children:[e.location&&(0,G.jsx)(zK,{location:e.location}),e.isUploading&&(0,G.jsx)("div",{className:"chat-location-upload-overlay lua:absolute lua:inset-0 lua:bg-black lua:bg-opacity-50 lua:rounded-lg lua:flex lua:items-center lua:justify-center",children:(0,G.jsx)("div",{className:"lua:text-white lua:text-sm",children:"Sharing location..."})}),(0,G.jsxs)("div",{className:"chat-location-info lua:flex lua:items-center lua:gap-2 lua:mt-3",children:[(0,G.jsx)(O4,{fill:"black"}),(0,G.jsx)("div",{className:"lua:flex-1",children:(0,G.jsx)("div",{className:"lua:text-sm",children:e.content})})]})]})})}function dL({url:e,onNavigate:t}){let[n,r]=(0,$e.useState)(!1);return(0,$e.useEffect)(()=>{if(t&&!n){r(!0);let a=pL(e);t(a.pathname,{...a.queryParams&&{query:a.queryParams}})}},[n,t]),null}function UK({message:e}){return(0,G.jsxs)("div",{"data-testid":"video-message",className:"chat-video-message lua:flex lua:flex-col lua:w-3/5 lua:mx-4 lua:sm:mx-5",children:[(0,G.jsxs)("div",{className:"chat-video-container lua:relative",children:[(0,G.jsx)("video",{src:e.url,controls:!0,className:"chat-video lua:rounded-lg lua:w-full"}),e.isUploading&&(0,G.jsx)("div",{className:"chat-video-upload-overlay lua:absolute lua:inset-0 lua:bg-black lua:bg-opacity-50 lua:rounded-lg lua:flex lua:items-center lua:justify-center",children:(0,G.jsxs)("div",{className:"lua:text-white lua:text-sm",children:["Uploading..."," ",e.uploadProgress?Math.round(e.uploadProgress):0,"%"]})})]}),!e.isUploading&&e.content&&(0,G.jsx)("div",{className:"chat-video-caption lua:w-full lua:bg-gray-100 lua:text-gray-800 lua:rounded-2xl lua:px-4 lua:p-3 lua:mt-8",children:e.content})]})}function ZK(e){return new Date(e).toLocaleTimeString()}function $K(e){return{icon:()=>null}}function vf({children:e}){let[t,n]=(0,$e.useState)([]),[r,a]=(0,$e.useState)(""),[i,s]=(0,$e.useState)(null),[u,c]=(0,$e.useState)(!1),[d]=(0,$e.useState)(new Map),p=(0,$e.useCallback)(m=>{if(!d.has(m)){let g=URL.createObjectURL(m);d.set(m,g)}return d.get(m)},[d]),h=(0,$e.useCallback)(m=>{let g=d.get(m);g&&(URL.revokeObjectURL(g),d.delete(m))},[d]);return(0,$e.useEffect)(()=>()=>{t.forEach(m=>{m.url&&m.url.startsWith("blob:")&&URL.revokeObjectURL(m.url)}),d.forEach(m=>URL.revokeObjectURL(m))},[t,d]),(0,G.jsx)(mL.Provider,{value:{messages:t,setMessages:n},children:(0,G.jsx)(L9.Provider,{value:{inputMessage:r,setInputMessage:a},children:(0,G.jsx)(gL.Provider,{value:{loadingMessage:i,setLoadingMessage:s},children:(0,G.jsx)(vL.Provider,{value:{hasUnreadMessages:u,setHasUnreadMessages:c},children:(0,G.jsx)(yL.Provider,{value:{getFileUrl:p,removeFileUrl:h},children:e})})})})})}function WK(){let e=(0,$e.useContext)(L9);if(e===void 0)throw new Error("useInput must be used within a ChatProvider");return e}function nd(){let e=(0,$e.useContext)(mL),t=(0,$e.useContext)(L9),n=(0,$e.useContext)(gL),r=(0,$e.useContext)(vL),a=(0,$e.useContext)(yL);if(e===void 0||t===void 0||n===void 0||r===void 0||a===void 0)throw new Error("useChat must be used within a ChatProvider");return{...e,...t,...n,...r,...a}}function CL(){let{loadingMessage:e}=nd();return e?(0,G.jsxs)("div",{className:"chat-loading-message lua:flex lua:items-center lua:gap-2 lua:mx-4 lua:sm:mx-5",children:[(0,G.jsx)(y5,{size:24,className:"chat-loading-logo lua:w-6 lua:h-6 lua:rounded-full lua:flex-shrink-0 lua:animate-spin",style:{animationDuration:"3s"}}),(0,G.jsx)("div",{className:"chat-loading-text lua:text-sm lua:opacity-40",children:e||"Lua is typing..."})]}):null}function wL({buttons:e,onClick:t}){return(0,G.jsx)("div",{className:"chat-action-message lua:w-full",children:(0,G.jsx)("div",{className:"chat-action-buttons lua:flex lua:gap-2 lua:flex-wrap lua:mx-4 lua:sm:mx-5",children:e.map((n,r)=>(0,G.jsx)(Ce,{variant:"tertiary",className:"chat-action-button lua:font-normal lua:rounded-lg lua:py-2 lua:h-auto",onClick:()=>t(n.text),children:n.text},r))})})}var $e,G,Jr,CK,fL,pL,bK,_K,R9,SK,kK,nL,RK,aL,TK,oL,LK,iL,AK,lL,T9,MK,OK,DK,hL,mL,L9,gL,vL,yL,xL,bce,yf=A(()=>{jt();$e=Z(Se(),1),G=Z(ke(),1);I2();yT();LT();eL();Jr={p:"lua:mb-2 lua:last:mb-0 lua:mx-4 lua:sm:mx-5 lua-paragraph-markdown",h1:"lua:text-2xl lua:font-bold lua:mb-2 lua:mx-4 lua:sm:mx-5",h2:"lua:text-xl lua:font-semibold lua:mb-2 lua:text-gray-700 lua:mx-4 lua:sm:mx-5",h3:"lua:text-lg lua:font-medium lua:mb-2 lua:mx-4 lua:sm:mx-5",h4:"lua:mx-4 lua:sm:mx-5",ul:"lua:list-disc lua:pl-6 lua:mb-4",ol:"lua:list-decimal lua:pl-6 lua:mb-4 lua:mx-4 lua:sm:mx-5",li:"lua:mb-1 lua:mx-4 lua:sm:mx-5",a:"lua:text-blue-500 lua:hover:underline",blockquote:"lua:border-l-4 lua:border-gray-200 lua:pl-4 lua:italic lua:my-4",pre:"lua:contents lua:bg-gray-100 lua:rounded lua:px-1 lua:text-gray-700 lua:mx-4 lua:sm:mx-5",code:"lua:bg-gray-100 lua:rounded lua:px-1 lua:mx-4 lua:sm:mx-5",img:"lua:max-w-full lua:h-auto lua:rounded-lg lua:mb-2",table:"lua:min-w-full lua:border lua:border-gray-200 lua:my-4",th:"lua:bg-gray-100 lua:border lua:border-gray-200 lua:px-4 lua:py-2",td:"lua:border lua:border-gray-200 lua:px-4 lua:py-2"},CK=e=>({code({children:t,className:n,...r}){let a=n?.replace("language-","")||"";return typeof t=="string"&&!t.includes(`
89
89
  `)?(0,G.jsx)("code",{className:Jr.code,...r,children:t}):(0,G.jsx)(yK,{language:a,className:n,children:t})},p({children:t,...n}){return(0,G.jsx)("p",{className:Jr.p,...n,children:t})},h1({children:t,...n}){return(0,G.jsx)("h1",{className:Jr.h1,...n,children:t})},h2({children:t,...n}){return(0,G.jsx)("h2",{className:Jr.h2,...n,children:t})},h3({children:t,...n}){return(0,G.jsx)("h3",{className:Jr.h3,...n,children:t})},h4({children:t,...n}){return(0,G.jsx)("h4",{className:Jr.h4,...n,children:t})},img({src:t,alt:n}){return(0,G.jsx)("img",{src:t,alt:n,className:"lua:w-full lua:h-48 lua:object-cover lua:rounded-lg lua:mb-3"})},ul({children:t,...n}){return(0,G.jsx)("ul",{className:Jr.ul,...n,children:t})},ol({children:t,...n}){return(0,G.jsx)("ol",{className:Jr.ol,...n,children:t})},li({children:t,...n}){return(0,G.jsx)("li",{className:`${Jr.li} cursor-pointer hover:bg-gray-50 rounded px-2 -mx-2 transition-colors`,onClick:()=>e(t),...n,children:t})},a({href:t,children:n,...r}){return(0,G.jsx)("a",{href:t,className:Jr.a,target:"_blank",rel:"noopener noreferrer",...r,children:n})},blockquote({children:t,...n}){return(0,G.jsx)("blockquote",{className:Jr.blockquote,...n,children:t})},pre({children:t}){return(0,G.jsx)(G.Fragment,{children:t})},table({children:t,...n}){return(0,G.jsx)("table",{className:Jr.table,...n,children:t})},th({children:t,...n}){return(0,G.jsx)("th",{className:Jr.th,...n,children:t})},td({children:t,...n}){return(0,G.jsx)("td",{className:Jr.td,...n,children:t})}}),fL=CK;pL=wK;bK=xK,_K=(0,$e.memo)(function({block:e,onCardClick:t,onListItemClick:n,onNavigate:r}){let a=e.content.match(/^#\s+(.+)$/m),i=e.content.match(/!\[.*?]\((.*)\)/),s=a?a[1]:"",u=i?i[1]:null,c=bK(e.content),d=e.content.replace(/^#\s+.+$/m,"").replace(/!\[.*?]\(.*?\)/g,"").replace(/\[.*?]\(.*?\)/g,"").trim(),p=fL(n);return(0,G.jsxs)("div",{onClick:()=>{if(r&&c){let h=pL(c);r(h.pathname,{...h.queryParams&&{query:h.queryParams}})}else t(e.content)},className:"chat-list-item group",children:[(0,G.jsx)("div",{className:"lua:absolute lua:inset-0 lua:bg-blue-500 lua:opacity-0 group-hover:lua:opacity-5 lua:rounded-lg lua:transition-opacity lua:duration-200"}),(0,G.jsxs)("div",{className:"chat-list-item-content",children:[u?(0,G.jsx)("div",{className:"chat-list-item-image-wrapper",children:(0,G.jsx)("img",{className:"chat-list-item-image",src:u,alt:s})}):null,(0,G.jsxs)("div",{className:"content-container",children:[(0,G.jsx)("h1",{className:"lua:text-base lua:leading-6 lua:font-semibold lua:text-gray-900 lua:mb-0",children:s}),(0,G.jsx)("div",{className:"lua:text-sm lua:leading-6 lua:font-normal lua:text-gray-600",children:(0,G.jsx)(K1,{components:p,children:d})})]})]})]})}),R9=_K,SK=(0,$e.memo)(function({group:e,onCardClick:t,onListItemClick:n,onNavigate:r}){return(0,G.jsx)("div",{className:"lua:w-full",children:(0,G.jsx)("div",{className:"chat-list-item-container",children:e.map((a,i)=>(0,G.jsx)(R9,{block:a,onCardClick:t,onListItemClick:n,onNavigate:r},i))})})}),kK=SK;nL=PK;RK=e=>e.split(`
90
90
  `).filter(t=>t.trim()).filter(t=>t.trim().startsWith("-")).map(t=>({text:t.trim().substring(1).trim(),onClick:t.trim().substring(1).trim()})),aL=RK,TK=e=>{let t=/!\[(.*?)\]\((.*)\)/g,n=[],r;for(;(r=t.exec(e))!==null;)r[1]&&r[2]&&n.push({alt:r[1],src:r[2]});return n},oL=TK,LK=e=>{let t=/\[.*?\]\((.*?)\)/g,n=[],r;for(;(r=t.exec(e))!==null;)r[1]&&n.push(r[1]);return n},iL=LK;AK=e=>{let t=/\[.*?\]\((.*?)\)/,n=e.match(t);return n?n[1]:null},lL=AK,T9=e=>typeof e=="string"?e:Array.isArray(e)?e.map(T9).join(""):typeof e=="object"&&e!==null&&"props"in e?T9(e.props.children):"",MK=T9;OK=e=>{e=e.replace(/\\n/g,`
@@ -97,7 +97,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
97
97
  `:C?c+=_+`
98
98
  `:S?d+=_+`
99
99
  `:n+=_+`
100
- `}return p?t.push({type:"list-item",content:r.trim(),isComplete:!1}):h?t.push({type:"payment",content:a.trim(),isComplete:!1}):m?t.push({type:"actions",content:i.trim(),isComplete:!1}):g?t.push({type:"images",content:s.trim(),isComplete:!1}):b?t.push({type:"links",content:u.trim(),isComplete:!1}):C?t.push({type:"navigate",content:c.trim(),isComplete:!1}):S?t.push({type:"documents",content:d.trim(),isComplete:!1}):n.trim()&&t.push({type:"text",content:n.trim()}),t},DK=OK;hL=(0,$e.memo)(function({message:e,onSelect:t,luaApiUrl:n,authToken:r,disablePreviewOnLinks:a=!1,onNavigate:i}){let s=(0,$e.useCallback)(d=>{let p=d.match(/^#\s+(.+)$/m),h=d.match(/^##\s+(.+)$/m),m=p?p[1]:"",g=h?h[1]:"",b=`${m}. ${g}`;t&&t(b)},[t]),u=(0,$e.useCallback)(d=>{if(!t)return;let p=MK(d).trim();t(p)},[t]),c=(0,$e.useCallback)(()=>{if(e.type==="location")return(0,G.jsx)(jK,{message:e});if(e.mimeType?.startsWith("video"))return e.url?(0,G.jsx)(UK,{message:{url:e.url,content:e.content||"",isUploading:e.isUploading,uploadProgress:e.uploadProgress}}):null;if(e.mimeType?.startsWith("image"))return e.url?(0,G.jsx)(HK,{message:{url:e.url,content:e.content||"",isUploading:e.isUploading,uploadProgress:e.uploadProgress}}):null;if(e.mimeType?.startsWith("audio"))return(0,G.jsx)(EK,{message:e});if(e.type==="file"&&e.mimeType){let h=$K(new File([],"",{type:e.mimeType})).icon;return(0,G.jsx)("a",{"data-testid":"chat-file-message",href:e.url,target:"_blank",rel:"noopener noreferrer",className:"chat-file-message lua:mx-4 lua:sm:mx-5",children:(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-8",children:[(0,G.jsxs)("div",{className:"chat-file-card lua:flex lua:items-center lua:justify-start lua:p-3 lua:border lua:border-gray-200 lua:rounded-lg lua:bg-white lua:w-80",children:[(0,G.jsx)(h,{className:"lua:w-12 lua:h-12 lua:text-gray-500"}),(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1 lua:pl-2",children:["File",(0,G.jsx)("span",{className:"lua:text-gray-500 lua:text-sm",children:e.mimeType})]})]}),e.content&&(0,G.jsx)("div",{className:"chat-file-content lua:bg-gray-100 lua:rounded-2xl lua:px-4 lua:py-2 lua:w-80",children:(0,G.jsx)("div",{className:"lua:text-sm lua:text-gray-900",children:e.content})})]})})}if(e.role==="user")return e.content;if(e.content==="...")return null;let d=DK(e.content),p=fL(u);return(0,G.jsx)("div",{className:"chat-markdown-content lua:prose lua:prose-sm lua:max-w-none",children:(0,G.jsx)("div",{className:"lua:flex lua:flex-wrap lua:gap-4",children:(()=>{if(d.filter(h=>h.type==="list-item").length>1){let h=[],m=[];return d.forEach(g=>{g.type==="list-item"?m.push(g):(m.length>0&&(h.push(m),m=[]),h.push([g]))}),m.length>0&&h.push(m),h.map((g,b)=>g.length>1&&g[0].type==="list-item"?(0,G.jsx)(kK,{group:g,onCardClick:s,onListItemClick:u,onNavigate:i},b):g.map((C,S)=>{if(C.type==="list-item")return(0,G.jsx)(R9,{block:C,onCardClick:s,onListItemClick:u,onNavigate:i},S);if(C.type==="actions")return aL(C.content).length>0&&C.isComplete,null;if(C.type==="images"){let v=oL(C.content);if(v.length>0)return(0,G.jsx)(uL,{images:v},S)}if(C.type==="links"){let v=iL(C.content);return v.length>0&&C.isComplete?(0,G.jsx)(cL,{links:v,luaApiUrl:n||"",authToken:r||"",disablePreviewOnLinks:a},S):null}if(C.type==="navigate"){let v=sL(C.content);return v&&C.isComplete?(0,G.jsx)(dL,{text:v.text,url:v.url,onNavigate:i},S):null}if(C.type==="documents"){let v=nL(C.content);return(0,G.jsx)(tL,{documents:v},S)}if(C.type==="payment"){let v=lL(C.content);return v?(0,G.jsx)("div",{className:"chat-payment-message lua:w-full lua:mx-4 lua:sm:mx-5",children:(0,G.jsx)(rL,{url:v})},S):null}return(0,G.jsx)("div",{className:"chat-markdown-block lua:w-full",children:(0,G.jsx)(K1,{components:p,children:C.content})},S)}))}return d.map((h,m)=>{if(h.type==="list-item")return(0,G.jsx)(R9,{block:h,onCardClick:s,onListItemClick:u,onNavigate:i},m);if(h.type==="actions")return aL(h.content).length>0&&h.isComplete,null;if(h.type==="images"){let g=oL(h.content);if(g.length>0)return(0,G.jsx)(uL,{images:g},m)}if(h.type==="navigate"){let g=sL(h.content);return g&&h.isComplete?(0,G.jsx)(dL,{text:g.text,url:g.url,onNavigate:i},m):null}if(h.type==="documents"){let g=nL(h.content);return(0,G.jsx)(tL,{documents:g},m)}if(h.type==="links"){let g=iL(h.content);return g.length>0&&h.isComplete?(0,G.jsx)(cL,{links:g,luaApiUrl:n||"",authToken:r||"",disablePreviewOnLinks:a},m):null}if(h.type==="payment"){let g=lL(h.content);return g?(0,G.jsx)("div",{className:"chat-payment-message lua:w-full lua:mx-4 lua:sm:mx-5 lua:mb-5",children:(0,G.jsx)(rL,{url:g})},m):null}return(0,G.jsx)("div",{className:"chat-markdown-block lua:w-full",children:(0,G.jsx)(K1,{components:p,children:h.content})},m)})})()})})},[e,s,u]);return(0,G.jsxs)("div",{className:`chat-message-container lua:flex lua:flex-col ${e.role==="user"?"lua:items-end":"lua:items-start"} lua:gap-1`,children:[(0,G.jsxs)("div",{className:`lua:flex ${e.role==="user"?"lua:justify-end":"lua:justify-start"} lua:items-start lua:gap-2 lua:w-full`,children:[!["file","image","video","tool","location"].includes(e.type||"")&&e.content!=="..."&&(0,G.jsx)("div",{className:`chat-message-bubble ${e.role==="user"?"chat-message-bubble-user lua:max-w-full md:lua:max-w-3/5 lua:bg-gray-100 lua:text-gray-800 lua:rounded-2xl lua:px-4 lua:py-3 lua:mx-4 lua:sm:mx-5 lua:whitespace-pre-wrap":"chat-message-bubble-agent lua:w-full lua:bg-white lua:text-gray-800 lua:rounded-lg lua:py-3 lua:rounded-bl-none"}`,style:{wordBreak:"break-word"},children:c()}),["file","image","video","location"].includes(e.type||"")&&c()]}),(0,G.jsx)("div",{className:`lua-message-timestamp lua:text-xs lua:text-gray-400 lua:px-1 ${e.role==="user"?"lua:mr-4 sm:lua:mr-5":"lua:ml-4 sm:lua:ml-5"}`,children:ZK(e.createdAt)})]})}),mL=(0,$e.createContext)(void 0),L9=(0,$e.createContext)(void 0),gL=(0,$e.createContext)(void 0),vL=(0,$e.createContext)(void 0),yL=(0,$e.createContext)(void 0);xL=e=>{let t="::: actions",n=e.indexOf(t);if(n===-1)return[];let r=e.indexOf(":::",n+t.length);return r===-1?[]:e.slice(n+t.length,r).trim().replace(/\\n/g,`
100
+ `}return p?t.push({type:"list-item",content:r.trim(),isComplete:!1}):h?t.push({type:"payment",content:a.trim(),isComplete:!1}):m?t.push({type:"actions",content:i.trim(),isComplete:!1}):g?t.push({type:"images",content:s.trim(),isComplete:!1}):b?t.push({type:"links",content:u.trim(),isComplete:!1}):C?t.push({type:"navigate",content:c.trim(),isComplete:!1}):S?t.push({type:"documents",content:d.trim(),isComplete:!1}):n.trim()&&t.push({type:"text",content:n.trim()}),t},DK=OK;hL=(0,$e.memo)(function({message:e,onSelect:t,luaApiUrl:n,authToken:r,disablePreviewOnLinks:a=!1,onNavigate:i}){let s=(0,$e.useCallback)(d=>{let p=d.match(/^#\s+(.+)$/m),h=d.match(/^##\s+(.+)$/m),m=p?p[1]:"",g=h?h[1]:"",b=`${m}. ${g}`;t&&t(b)},[t]),u=(0,$e.useCallback)(d=>{if(!t)return;let p=MK(d).trim();t(p)},[t]),c=(0,$e.useCallback)(()=>{if(e.type==="location")return(0,G.jsx)(jK,{message:e});if(e.mediaType?.startsWith("video"))return e.url?(0,G.jsx)(UK,{message:{url:e.url,content:e.content||"",isUploading:e.isUploading,uploadProgress:e.uploadProgress}}):null;if(e.mediaType?.startsWith("image"))return e.url?(0,G.jsx)(HK,{message:{url:e.url,content:e.content||"",isUploading:e.isUploading,uploadProgress:e.uploadProgress}}):null;if(e.mediaType?.startsWith("audio"))return(0,G.jsx)(EK,{message:e});if(e.type==="file"&&e.mediaType){let h=$K(new File([],"",{type:e.mediaType})).icon;return(0,G.jsx)("a",{"data-testid":"chat-file-message",href:e.url,target:"_blank",rel:"noopener noreferrer",className:"chat-file-message lua:mx-4 lua:sm:mx-5",children:(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-8",children:[(0,G.jsxs)("div",{className:"chat-file-card lua:flex lua:items-center lua:justify-start lua:p-3 lua:border lua:border-gray-200 lua:rounded-lg lua:bg-white lua:w-80",children:[(0,G.jsx)(h,{className:"lua:w-12 lua:h-12 lua:text-gray-500"}),(0,G.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1 lua:pl-2",children:["File",(0,G.jsx)("span",{className:"lua:text-gray-500 lua:text-sm",children:e.mediaType})]})]}),e.content&&(0,G.jsx)("div",{className:"chat-file-content lua:bg-gray-100 lua:rounded-2xl lua:px-4 lua:py-2 lua:w-80",children:(0,G.jsx)("div",{className:"lua:text-sm lua:text-gray-900",children:e.content})})]})})}if(e.role==="user")return e.content;if(e.content==="...")return null;let d=DK(e.content),p=fL(u);return(0,G.jsx)("div",{className:"chat-markdown-content lua:prose lua:prose-sm lua:max-w-none",children:(0,G.jsx)("div",{className:"lua:flex lua:flex-wrap lua:gap-4",children:(()=>{if(d.filter(h=>h.type==="list-item").length>1){let h=[],m=[];return d.forEach(g=>{g.type==="list-item"?m.push(g):(m.length>0&&(h.push(m),m=[]),h.push([g]))}),m.length>0&&h.push(m),h.map((g,b)=>g.length>1&&g[0].type==="list-item"?(0,G.jsx)(kK,{group:g,onCardClick:s,onListItemClick:u,onNavigate:i},b):g.map((C,S)=>{if(C.type==="list-item")return(0,G.jsx)(R9,{block:C,onCardClick:s,onListItemClick:u,onNavigate:i},S);if(C.type==="actions")return aL(C.content).length>0&&C.isComplete,null;if(C.type==="images"){let v=oL(C.content);if(v.length>0)return(0,G.jsx)(uL,{images:v},S)}if(C.type==="links"){let v=iL(C.content);return v.length>0&&C.isComplete?(0,G.jsx)(cL,{links:v,luaApiUrl:n||"",authToken:r||"",disablePreviewOnLinks:a},S):null}if(C.type==="navigate"){let v=sL(C.content);return v&&C.isComplete?(0,G.jsx)(dL,{text:v.text,url:v.url,onNavigate:i},S):null}if(C.type==="documents"){let v=nL(C.content);return(0,G.jsx)(tL,{documents:v},S)}if(C.type==="payment"){let v=lL(C.content);return v?(0,G.jsx)("div",{className:"chat-payment-message lua:w-full lua:mx-4 lua:sm:mx-5",children:(0,G.jsx)(rL,{url:v})},S):null}return(0,G.jsx)("div",{className:"chat-markdown-block lua:w-full",children:(0,G.jsx)(K1,{components:p,children:C.content})},S)}))}return d.map((h,m)=>{if(h.type==="list-item")return(0,G.jsx)(R9,{block:h,onCardClick:s,onListItemClick:u,onNavigate:i},m);if(h.type==="actions")return aL(h.content).length>0&&h.isComplete,null;if(h.type==="images"){let g=oL(h.content);if(g.length>0)return(0,G.jsx)(uL,{images:g},m)}if(h.type==="navigate"){let g=sL(h.content);return g&&h.isComplete?(0,G.jsx)(dL,{text:g.text,url:g.url,onNavigate:i},m):null}if(h.type==="documents"){let g=nL(h.content);return(0,G.jsx)(tL,{documents:g},m)}if(h.type==="links"){let g=iL(h.content);return g.length>0&&h.isComplete?(0,G.jsx)(cL,{links:g,luaApiUrl:n||"",authToken:r||"",disablePreviewOnLinks:a},m):null}if(h.type==="payment"){let g=lL(h.content);return g?(0,G.jsx)("div",{className:"chat-payment-message lua:w-full lua:mx-4 lua:sm:mx-5 lua:mb-5",children:(0,G.jsx)(rL,{url:g})},m):null}return(0,G.jsx)("div",{className:"chat-markdown-block lua:w-full",children:(0,G.jsx)(K1,{components:p,children:h.content})},m)})})()})})},[e,s,u]);return(0,G.jsxs)("div",{className:`chat-message-container lua:flex lua:flex-col ${e.role==="user"?"lua:items-end":"lua:items-start"} lua:gap-1`,children:[(0,G.jsxs)("div",{className:`lua:flex ${e.role==="user"?"lua:justify-end":"lua:justify-start"} lua:items-start lua:gap-2 lua:w-full`,children:[!["file","image","video","tool","location"].includes(e.type||"")&&e.content!=="..."&&(0,G.jsx)("div",{className:`chat-message-bubble ${e.role==="user"?"chat-message-bubble-user lua:max-w-full md:lua:max-w-3/5 lua:bg-gray-100 lua:text-gray-800 lua:rounded-2xl lua:px-4 lua:py-3 lua:mx-4 lua:sm:mx-5 lua:whitespace-pre-wrap":"chat-message-bubble-agent lua:w-full lua:bg-white lua:text-gray-800 lua:rounded-lg lua:py-3 lua:rounded-bl-none"}`,style:{wordBreak:"break-word"},children:c()}),["file","image","video","location"].includes(e.type||"")&&c()]}),(0,G.jsx)("div",{className:`lua-message-timestamp lua:text-xs lua:text-gray-400 lua:px-1 ${e.role==="user"?"lua:mr-4 sm:lua:mr-5":"lua:ml-4 sm:lua:ml-5"}`,children:ZK(e.createdAt)})]})}),mL=(0,$e.createContext)(void 0),L9=(0,$e.createContext)(void 0),gL=(0,$e.createContext)(void 0),vL=(0,$e.createContext)(void 0),yL=(0,$e.createContext)(void 0);xL=e=>{let t="::: actions",n=e.indexOf(t);if(n===-1)return[];let r=e.indexOf(":::",n+t.length);return r===-1?[]:e.slice(n+t.length,r).trim().replace(/\\n/g,`
101
101
  `).split(`
102
102
  `).map(a=>a.trim()).filter(a=>a&&a.startsWith("-")).map(a=>({text:a.replace(/^-[\s]?/,"").trim(),onClick:a.replace(/^-[\s]?/,"").trim()}))},bce=(0,$e.memo)(function({onSend:e,disabled:t=!1,onFilePaste:n}){let{inputMessage:r,setInputMessage:a}=WK(),[i,s]=(0,$e.useState)(!1),u=(0,$e.useRef)(null);(0,$e.useEffect)(()=>{let p=()=>{s(window.matchMedia("(max-width: 768px)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[]),(0,$e.useEffect)(()=>{let p=u.current;p&&(t||(p.style.height="auto",p.style.height=`${p.scrollHeight}px`))},[r]);let c=p=>{if(p.key==="Enter"){if(i||p.shiftKey||p.metaKey||p.ctrlKey)return;p.preventDefault(),e()}},d=(0,$e.useCallback)(p=>{let{items:h}=p.clipboardData;if(!h||!n)return;let m=[];for(let g=0;g<h.length;g++){let b=h[g];if(b.kind==="file"){let C=b.getAsFile();C&&m.push(C)}}m.length>0&&(p.preventDefault(),n(m))},[n]);return(0,G.jsxs)("div",{className:"lua:flex lua:gap-3 lua:py-2 lua:px-3 lua:items-start",children:[(0,G.jsx)(y5,{size:32,className:"lua:w-8 lua:h-8 lua:rounded-full lua:flex-shrink-0 lua:m-1"}),(0,G.jsx)("div",{className:"lua:flex-1 lua:flex",children:(0,G.jsx)("textarea",{ref:u,disabled:t,value:r,onChange:p=>a(p.target.value),onKeyDown:c,onPaste:d,placeholder:t?"This conversation's chat window has already been closed":"Reply to user",className:`lua:w-full lua:pl-0 lua:pr-4 lua:py-2 lua:resize-none lua:overflow-y-auto lua:border-none lua:focus:outline-none lua:focus:ring-0 lua:text-gray-700 lua:min-h-10 lua:max-h-48 lua:bg-white${t?" lua:cursor-not-allowed lua:h-14":""}`,rows:1})})]})})});var _t,tt,A9,Be,ir=A(()=>{"use strict";_t={LUA_API:"https://api.heylua.ai",DEV_SERVER:"https://api.heylua.ai",LOCAL_DEV:""},tt={CHAT_GENERATE:e=>`${_t.LUA_API}/chat/generate/${e}?channel=dev`,TOOLS_TEST:e=>`${_t.LUA_API}/tools/test/${e}`,CHAT_HISTORY:e=>`${_t.LUA_API}/chat/history/${e}`,AGENT_TYPES:`${_t.LUA_API}/agents/self-serve/types`,CREATE_AGENT:`${_t.LUA_API}/agents/self-serve/create`,AGENT_DETAILS:e=>`${_t.LUA_API}/admin/agents/${e}`,SKILL_VERSIONS:(e,t)=>`${_t.DEV_SERVER}/developer/skills/${e}/${t}/versions`,PERSONA_VERSIONS:e=>`${_t.LUA_API}/developer/agents/${e}/persona/versions`,DEPLOY_PERSONA_VERSION:(e,t)=>`${_t.LUA_API}/developer/agents/${e}/persona/version/${t}`,AGENT_RESOURCES:e=>`${_t.LUA_API}/admin/agents/${e}/resources`,AGENT_RESOURCE:(e,t)=>`${_t.LUA_API}/admin/agents/${e}/resources/${t}`,AGENT_SKILLS:e=>`${_t.LUA_API}/developer/skills/${e}`,ACTIVATE_SKILL:(e,t)=>`${_t.LUA_API}/developer/skills/${e}/${t}`,PUBLISH_SKILL_VERSION:(e,t,n)=>`${_t.LUA_API}/developer/skills/${e}/${t}/${n}/publish`,PRODUCTION_LOGS:e=>`${_t.LUA_API}/developer/agents/${e}/logs`,PRODUCTION_ENV:e=>`${_t.LUA_API}/developer/agents/${e}/env`,AGENT_PRODUCTS:e=>`${_t.LOCAL_DEV}/api/products`,AGENT_PRODUCT:(e,t)=>`${_t.LOCAL_DEV}/api/products/${t}`,SEARCH_PRODUCTS:e=>`${_t.LOCAL_DEV}/api/products/search`,AGENT_BASKETS:e=>`${_t.LOCAL_DEV}/api/baskets`,AGENT_BASKET:(e,t)=>`${_t.LOCAL_DEV}/api/baskets/${t}`,AGENT_ORDERS:e=>`${_t.LOCAL_DEV}/api/orders`,AGENT_ORDER:(e,t)=>`${_t.LOCAL_DEV}/api/orders/${t}`,CREATE_SKILL:e=>`${_t.DEV_SERVER}/developer/skills/${e}`,DEVELOPER_LOGS:(e,t)=>`${_t.DEV_SERVER}/developer/skills/${e}/${t}/logs`,USER_DATA:e=>`${_t.DEV_SERVER}/developer/user/data/agent/${e}`,LOCAL_CHAT:`${_t.LOCAL_DEV}/chat`,LOCAL_PERSONA:`${_t.LOCAL_DEV}/persona`,LOCAL_TOOLS:`${_t.LOCAL_DEV}/tools`,LOCAL_TOOLS_TEST:`${_t.LOCAL_DEV}/tools/test`,LOCAL_ENV:`${_t.LOCAL_DEV}/env`},A9=class{constructor(t=""){this.baseUrl=t}async getAllSkillOverrides(){try{let n=await(await fetch("/api/skills")).json();return n.success&&n.skills&&Array.isArray(n.skills)?n.skills.map(r=>({skillId:r.skillId,sandboxId:r.sandboxId||r.skillId})).filter(r=>r.skillId&&r.sandboxId):[]}catch(t){return console.error("Error getting skill overrides:",t),[]}}async sendChatMessage(t,n,r,a,i,s){try{let u=await this.getAllSkillOverrides(),c=u.length>0?u:[{skillId:r,sandboxId:a}],d={messages:[{type:"text",text:t}],navigate:!0,skillOverride:c,...s&&{personaOverride:s}},p=await fetch(tt.CHAT_GENERATE(n),{method:"POST",headers:{"Content-Type":"application/json",Authorization:i},body:JSON.stringify(d)});if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return{success:!0,text:(await p.json()).text||"No response received"}}catch(u){return console.error("Chat API error:",u),{success:!1,error:u instanceof Error?u.message:"Unknown error occurred"}}}async sendProductionChatMessage(t,n,r){try{let a={messages:[{type:"text",text:t}],navigate:!0,skillOverride:[]},i=await fetch(tt.CHAT_GENERATE(n),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(a)});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,text:(await i.json()).text||"No response received"}}catch(a){return console.error("Production chat API error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async sendLocalChatMessage(t,n){try{let r=await fetch(tt.LOCAL_CHAT,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,persona:n})});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Local chat API error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async loadPersona(){try{let t=await fetch(tt.LOCAL_PERSONA);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Load persona error:",t),{success:!1,error:t instanceof Error?t.message:"Failed to load persona"}}}async savePersona(t){try{let n=await fetch(tt.LOCAL_PERSONA,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({persona:t})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Save persona error:",n),{success:!1,error:n instanceof Error?n.message:"Failed to save persona"}}}async loadTools(){try{let t=await fetch(tt.LOCAL_TOOLS);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Load tools error:",t),{success:!1,error:t instanceof Error?t.message:"Failed to load tools"}}}async testTool(t,n,r,a,i,s){try{let u={toolName:t,inputs:n,skillOverride:[{skillId:a,sandboxId:i}]},c=await fetch(tt.TOOLS_TEST(r),{method:"POST",headers:{"Content-Type":"application/json",Authorization:s},body:JSON.stringify(u)});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json();return{success:!0,result:d.result||d}}catch(u){return console.error("Tool test error:",u),{success:!1,error:u instanceof Error?u.message:"Unknown error occurred"}}}async getSkillVersions(t,n,r){try{let a=await fetch(tt.SKILL_VERSIONS(n,t),{method:"GET",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,versions:(await a.json()).versions||[]}}catch(a){return console.error("Error fetching skill versions:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async getPersonaVersions(t,n){try{let r=await fetch(`${_t.DEV_SERVER}/developer/agents/${t}/persona/versions`,{method:"GET",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return{success:!0,versions:(await r.json()).versions||[]}}catch(r){return console.error("Error fetching persona versions:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async getProductionPersonaVersions(t,n){try{let r=await fetch(tt.PERSONA_VERSIONS(t),{method:"GET",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return{success:!0,versions:(await r.json()).versions||[]}}catch(r){return console.error("Error fetching production persona versions:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async deployPersonaVersion(t,n,r){try{let a=await fetch(tt.DEPLOY_PERSONA_VERSION(t,r),{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({})});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("Error deploying persona version:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async createPersonaVersion(t,n,r){try{let a=await fetch(`${_t.DEV_SERVER}/developer/agents/${t}/persona/version`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({persona:r})});if(!a.ok){let s=await a.text();throw new Error(`HTTP error! status: ${a.status}, message: ${s}`)}return{success:!0,data:await a.json()}}catch(a){return console.error("Error creating persona version:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async createSkillVersion(t,n,r,a){try{let i=await fetch(`${_t.DEV_SERVER}/developer/skills/${n}/${t}/version`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok){let u=await i.text();throw new Error(`HTTP error! status: ${i.status}, message: ${u}`)}return{success:!0,data:await i.json()}}catch(i){return console.error("Error creating skill version:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async loadEnvContent(){try{let t=await fetch(tt.LOCAL_ENV);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.json()}catch(t){return console.error("Load env error:",t),{success:!1,error:t instanceof Error?t.message:"Failed to load environment variables"}}}async saveEnvContent(t){try{let n=await fetch(tt.LOCAL_ENV,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Save env error:",n),{success:!1,error:n instanceof Error?n.message:"Failed to save environment variables"}}}async testLocalTool(t,n){try{let r=await fetch(tt.LOCAL_TOOLS_TEST,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolName:t,inputs:n})});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){return console.error("Local tool test error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async loadChatHistory(t,n){try{console.log("ApiService: Loading chat history with API key:",t,"agentId:",n);let r=await fetch(tt.CHAT_HISTORY(n),{method:"GET",headers:{accept:"*/*",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Response status:",r.status),console.log("ApiService: Response headers:",r.headers),!r.ok){let i=await r.text();throw console.error("ApiService: HTTP error response:",i),new Error(`HTTP error! status: ${r.status}`)}let a=await r.json();return console.log("ApiService: Received data:",a),{success:!0,data:a}}catch(r){return console.error("ApiService: Chat history load error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async clearChatHistory(t,n){try{console.log("ApiService: Clearing chat history with API key:",t,"agentId:",n);let r=await fetch(tt.CHAT_HISTORY(n),{method:"DELETE",headers:{accept:"*/*",Authorization:`Bearer ${t}`}});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return{success:!0}}catch(r){return console.error("Clear chat history error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async clearSandboxLogs(t,n,r){try{console.log("ApiService: Clearing sandbox logs with API key:",t,"agentId:",n,"sandboxId:",r);let a=await fetch(tt.DEVELOPER_LOGS(n,r),{method:"DELETE",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Clear logs response status:",a.status),!a.ok){let s=await a.text();throw console.error("ApiService: HTTP error response:",s),new Error(`HTTP error! status: ${a.status}`)}let i=await a.json();return console.log("ApiService: Clear logs response:",i),{success:!0,data:i}}catch(a){return console.error("ApiService: Clear sandbox logs error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async loadAllSandboxLogs(t,n,r=20){try{let a=await this.getAllSkillOverrides();if(a.length===0)return{success:!0,data:{logs:[]}};let i=a.map(async c=>{try{let d=await this.loadSandboxLogs(t,n,c.sandboxId,r);return d.success&&d.data&&d.data.logs?d.data.logs.map(p=>({...p,skillName:c.skillId,sandboxId:c.sandboxId})):[]}catch(d){return console.error(`Error loading logs for skill ${c.skillId}:`,d),[]}});return{success:!0,data:{logs:(await Promise.all(i)).flat().sort((c,d)=>new Date(d.timestamp).getTime()-new Date(c.timestamp).getTime()).slice(0,r)}}}catch(a){return console.error("Error loading all sandbox logs:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred",data:{logs:[]}}}}async loadSandboxLogs(t,n,r,a=20){try{console.log("ApiService: Loading sandbox logs with API key:",t,"agentId:",n,"sandboxId:",r);let i=await fetch(`${tt.DEVELOPER_LOGS(n,r)}?limit=${a}`,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Logs response status:",i.status),!i.ok){let u=await i.text();throw console.error("ApiService: HTTP error response:",u),new Error(`HTTP error! status: ${i.status}`)}let s=await i.json();return console.log("ApiService: Received logs data:",s),{success:!0,data:s}}catch(i){return console.error("ApiService: Sandbox logs load error:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async loadUserData(t,n){try{console.log("ApiService: Loading user data with API key:",t,"agentId:",n),console.log("ApiService: API key length:",t?.length),console.log("ApiService: API key starts with:",t?.substring(0,10));let r=await fetch(tt.USER_DATA(n),{method:"GET",headers:{accept:"*/*",Authorization:`Bearer ${t}`}});if(console.log("ApiService: User data response status:",r.status),console.log("ApiService: Response headers:",Object.fromEntries(r.headers.entries())),!r.ok){let i=await r.text();if(console.error("ApiService: HTTP error response:",i),r.status===401){console.log("ApiService: Trying alternative authentication method...");let s=await fetch(tt.USER_DATA(n),{method:"GET",headers:{accept:"*/*",Authorization:t}});if(s.ok){let u=await s.json();return console.log("ApiService: Alternative auth successful:",u),{success:!0,data:u}}}throw new Error(`HTTP error! status: ${r.status}`)}let a=await r.json();return console.log("ApiService: Received user data:",a),{success:!0,data:a}}catch(r){return console.error("ApiService: User data load error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async saveUserData(t,n,r){return this.updateUserData(t,n,r)}async getUserData(t,n){return this.loadUserData(t,n)}async updateUserData(t,n,r){try{console.log("ApiService: Updating user data with API key:",t,"agentId:",n,"data:",r);let a=await fetch(tt.USER_DATA(n),{method:"PUT",headers:{accept:"*/*",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(console.log("ApiService: Update user data response status:",a.status),!a.ok){let s=await a.text();throw console.error("ApiService: HTTP error response:",s),new Error(`HTTP error! status: ${a.status}`)}let i=await a.json();return console.log("ApiService: Updated user data response:",i),{success:!0,data:i}}catch(a){return console.error("ApiService: Update user data error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async loadResources(t,n){try{console.log("ApiService: Loading resources with API key:",t,"agentId:",n);let r=await fetch(tt.AGENT_RESOURCES(n),{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Resources response status:",r.status),!r.ok)throw new Error(`HTTP error! status: ${r.status}`);let a=await r.json();return console.log("ApiService: Resources data:",a),{success:!0,data:a||[]}}catch(r){return console.error("ApiService: Error loading resources:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async createResource(t,n,r){try{let a=await fetch(tt.AGENT_RESOURCES(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("Error creating resource:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async updateResource(t,n,r,a){try{let i=await fetch(tt.AGENT_RESOURCE(n,r),{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(i){return console.error("Error updating resource:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async deleteResource(t,n,r){try{let a=await fetch(tt.AGENT_RESOURCE(n,r),{method:"DELETE",headers:{accept:"*/*",Authorization:`Bearer ${t}`}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0}}catch(a){return console.error("Error deleting resource:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async clearUserData(t,n){try{console.log("ApiService: Clearing user data with API key:",t,"agentId:",n);let r=await fetch(tt.USER_DATA(n),{method:"DELETE",headers:{accept:"*/*",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Clear user data response status:",r.status),!r.ok){let i=await r.text();throw console.error("ApiService: HTTP error response:",i),new Error(`HTTP error! status: ${r.status}`)}let a=await r.json();return console.log("ApiService: Clear user data response:",a),{success:!0,data:a}}catch(r){return console.error("ApiService: Clear user data error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async createSkill(t,n,r){try{let a=await fetch(tt.CREATE_SKILL(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({name:r.name,description:r.description||`A Lua skill for ${r.name}`,context:r.context||""})});if(!a.ok){let s=await a.text();return{success:!1,error:{message:`HTTP ${a.status}: ${s}`}}}return{success:!0,data:await a.json()}}catch(a){return{success:!1,error:{message:a instanceof Error?a.message:"Unknown error"}}}}async getAgentTypes(t){try{let n=await fetch(tt.AGENT_TYPES,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){return console.error("Error fetching agent types:",n),[]}}async createAgent(t,n){try{let r=await fetch(tt.CREATE_AGENT,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(n)});return r.ok?{success:!0,data:await r.json()}:{success:!1,error:await r.json()}}catch(r){return{success:!1,error:{message:r instanceof Error?r.message:"Unknown error"}}}}async getAgentDetails(t,n){try{let r=await fetch(tt.AGENT_DETAILS(n),{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return r.ok?{success:!0,data:await r.json()}:{success:!1,error:await r.json()}}catch(r){return{success:!1,error:{message:r instanceof Error?r.message:"Unknown error"}}}}async getSkills(t,n){try{console.log("ApiService: Loading skills with API key:",t,"agentId:",n);let r=await fetch(tt.AGENT_SKILLS(n),{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Skills response status:",r.status),!r.ok){let i=await r.text();throw console.error("ApiService: HTTP error response:",i),new Error(`HTTP error! status: ${r.status}`)}let a=await r.json();return console.log("ApiService: Received skills data:",a),{success:!0,skills:a.skills||[]}}catch(r){return console.error("ApiService: Skills load error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async activateSkill(t,n,r,a){try{console.log(`ApiService: ${a?"Activating":"Deactivating"} skill:`,r,"for agent:",n);let i=await fetch(tt.ACTIVATE_SKILL(n,r),{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({active:a})});if(console.log("ApiService: Activate skill response status:",i.status),!i.ok){let u=await i.text();throw console.error("ApiService: HTTP error response:",u),new Error(`HTTP error! status: ${i.status}`)}let s=await i.json();return console.log("ApiService: Activate skill response:",s),{success:!0,data:s}}catch(i){return console.error("ApiService: Activate skill error:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async publishSkillVersion(t,n,r,a){try{console.log("ApiService: Publishing skill version:",a,"for skill:",r,"agent:",n);let i=await fetch(tt.PUBLISH_SKILL_VERSION(n,r,a),{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Publish skill version response status:",i.status),!i.ok){let u=await i.text();throw console.error("ApiService: HTTP error response:",u),new Error(`HTTP error! status: ${i.status}`)}let s=await i.json();return console.log("ApiService: Publish skill version response:",s),{success:!0,data:s}}catch(i){return console.error("ApiService: Publish skill version error:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async loadProductionLogs(t,n,r=1,a=100){try{console.log("ApiService: Loading production logs with API key:",t,"agentId:",n,"page:",r,"limit:",a);let i=await fetch(`${tt.PRODUCTION_LOGS(n)}?page=${r}&limit=${a}`,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Production logs response status:",i.status),!i.ok){let u=await i.text();throw console.error("ApiService: HTTP error response:",u),new Error(`HTTP error! status: ${i.status}`)}let s=await i.json();return console.log("ApiService: Production logs response:",s),{success:!0,logs:s.logs||[],pagination:s.pagination}}catch(i){return console.error("ApiService: Production logs error:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async loadProductionEnv(t,n){try{console.log("ApiService: Loading production env with API key:",t,"agentId:",n);let r=await fetch(tt.PRODUCTION_ENV(n),{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(console.log("ApiService: Production env response status:",r.status),!r.ok){let i=await r.text();throw console.error("ApiService: HTTP error response:",i),new Error(`HTTP error! status: ${r.status}`)}let a=await r.json();return console.log("ApiService: Production env response:",a),{success:!0,data:a}}catch(r){return console.error("ApiService: Production env error:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}}async updateProductionEnv(t,n,r){try{console.log("ApiService: Updating production env with API key:",t,"agentId:",n,"data:",r);let a=await fetch(tt.PRODUCTION_ENV(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(console.log("ApiService: Update production env response status:",a.status),!a.ok){let s=await a.text();throw console.error("ApiService: HTTP error response:",s),new Error(`HTTP error! status: ${a.status}`)}let i=await a.json();return console.log("ApiService: Update production env response:",i),{success:!0,data:i}}catch(a){return console.error("ApiService: Update production env error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async getProducts(t,n,r=1,a=20){try{console.log("ApiService: Loading products with API key:",t,"agentId:",n);let i=await fetch(`${tt.AGENT_PRODUCTS(n)}?page=${r}&limit=${a}`,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(i){return console.error("ApiService: Products load error:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async createProduct(t,n,r){try{let a=await fetch(tt.AGENT_PRODUCTS(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("ApiService: Create product error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async updateProduct(t,n,r){try{let a=await fetch(tt.AGENT_PRODUCTS(n),{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("ApiService: Update product error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async deleteProduct(t,n,r){try{let a=await fetch(tt.AGENT_PRODUCT(n,r),{method:"DELETE",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("ApiService: Delete product error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async searchProducts(t,n,r){try{let a=await fetch(`${tt.SEARCH_PRODUCTS(n)}?searchQuery=${encodeURIComponent(r)}`,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return console.error("ApiService: Search products error:",a),{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async getBaskets(t,n,r){try{let a=r?`${tt.AGENT_BASKETS(n)}?status=${r}`:tt.AGENT_BASKETS(n),i=await fetch(a,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async createBasket(t,n,r){try{let a=await fetch(tt.AGENT_BASKETS(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async updateBasket(t,n,r,a){try{let i=await fetch(tt.AGENT_BASKET(n,r),{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async deleteBasket(t,n,r){try{let a=await fetch(tt.AGENT_BASKET(n,r),{method:"DELETE",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async getOrders(t,n,r){try{let a=r?`${tt.AGENT_ORDERS(n)}?status=${r}`:tt.AGENT_ORDERS(n),i=await fetch(a,{method:"GET",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async createOrder(t,n,r){try{let a=await fetch(tt.AGENT_ORDERS(n),{method:"POST",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}async updateOrderStatus(t,n,r,a){try{let i=await fetch(`${tt.AGENT_ORDER(n,r)}/status`,{method:"PUT",headers:{accept:"application/json",Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({status:a})});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return{success:!0,data:await i.json()}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}}async deleteOrder(t,n,r){try{let a=await fetch(tt.AGENT_ORDER(n,r),{method:"DELETE",headers:{accept:"application/json",Authorization:`Bearer ${t}`}});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{success:!0,data:await a.json()}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error occurred"}}}},Be=new A9});var es,Cf,M9=A(()=>{"use strict";yf();es=Z(ke()),Cf=({messages:e,isLoading:t,onActionClick:n,className:r="chat-messages",ariaLabel:a="Chat messages"})=>{let i=e.map(s=>({id:s.id,role:s.sender,content:s.text,type:"text",createdAt:s.timestamp.toISOString()}));return console.log("luaMessages",i),(0,es.jsx)("div",{className:`${r} lua:relative lua:bg-gray-100`,role:"log","aria-live":"polite","aria-label":a,tabIndex:0,children:(0,es.jsxs)("div",{className:"lua:bg-white lua:p-3 lua:rounded-lg lua:space-y-4 lua:flex lua:flex-col",children:[i.map(s=>{let u=xL(s.content);return(0,es.jsxs)("div",{children:[(0,es.jsx)(hL,{message:s,onSelect:n}),u.length>0&&(0,es.jsx)(wL,{buttons:u,onClick:n})]},s.id)}),t&&(0,es.jsx)(CL,{})]})})}});var ul,En,GK,I9,bL=A(()=>{"use strict";ul=Z(Se());yf();ir();M9();jt();En=Z(ke()),GK=({apiKey:e,agentId:t,skillId:n,sandboxId:r,persona:a,sharedChatMessages:i,onSharedSendMessage:s,onSharedClearHistory:u,isChatLoading:c,setIsChatLoading:d})=>{let{messages:p,setMessages:h}=nd(),[m,g]=(0,ul.useState)(""),b=(0,ul.useRef)(null),C=()=>{b.current?.scrollIntoView({behavior:"smooth"})};(0,ul.useEffect)(()=>{C()},[p]),(0,ul.useEffect)(()=>{if(i.length===0){let N={id:"welcome",role:"assistant",content:"\u{1F44B} Welcome! Start chatting to test your Lua skill. Your messages will be sent to the sandbox environment.",type:"text",createdAt:new Date().toISOString()};h([N])}},[i,h]);let S=N=>{v(N)},v=async N=>{if(!N.trim())return;let T={id:Date.now().toString(),text:N,sender:"user",timestamp:new Date};s(T),g(""),d(!0);try{let P=await Be.sendLocalChatMessage(N,a),R={id:(Date.now()+1).toString(),text:P.success?P.text||"No response received":`\u274C ${P.error||"Failed to send message"}`,sender:"assistant",timestamp:new Date};s(R)}catch(P){let R={id:(Date.now()+2).toString(),text:`\u274C Error: ${P instanceof Error?P.message:"Unknown error"}`,sender:"assistant",timestamp:new Date};s(R)}finally{d(!1)}};return(0,En.jsxs)("section",{className:"chat-container",role:"region","aria-label":"Chat interface",children:[(0,En.jsxs)("header",{className:"chat-header lua:bg-white lua:border-b",children:[(0,En.jsx)("div",{className:"chat-header-content",children:(0,En.jsxs)("div",{children:[(0,En.jsx)("h2",{children:"Chat to your Agent [Sandbox]"}),(0,En.jsx)("p",{className:"lua:text-gray-700",children:"Test your sandbox skill in real-time"})]})}),(0,En.jsx)(Xe,{variant:"muted",size:"small",onClick:u,disabled:c,title:"Clear chat history","aria-label":"Clear chat history",children:(0,En.jsx)(Bn,{size:18})})]}),(0,En.jsx)(Cf,{messages:i,isLoading:c,onActionClick:S,ariaLabel:"Chat messages"}),(0,En.jsx)("div",{ref:b}),(0,En.jsx)("div",{className:"chat-input-container",children:(0,En.jsxs)("form",{className:"chat-input-form",onSubmit:N=>{N.preventDefault(),v(m)},role:"form","aria-label":"Send message",children:[(0,En.jsx)("label",{htmlFor:"chat-input",className:"sr-only",children:"Type your message"}),(0,En.jsx)("input",{type:"text",id:"chat-input",name:"chatMessage",className:"chat-input",value:m,onChange:N=>g(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),v(m))},placeholder:"Type your message...",disabled:c,autoComplete:"off","aria-describedby":"chat-input-help"}),(0,En.jsx)("div",{id:"chat-input-help",className:"sr-only",children:"Press Enter to send, Shift+Enter for new line"}),(0,En.jsx)("button",{type:"submit",className:"send-button",disabled:c||!m.trim(),"aria-label":c?"Sending message...":"Send message",children:c?"Sending...":"Send"})]})})]})},I9=e=>(0,En.jsx)(vf,{children:(0,En.jsx)(GK,{...e})})});var ts,Dt,Mr=A(()=>{"use strict";jt();ts=Z(ke()),Dt=({title:e,onBack:t,children:n,className:r=""})=>(0,ts.jsxs)("div",{className:`lua:flex lua:items-center lua:justify-between lua:pb-2 lua:px-5 lua:py-4 lua:border-b lua:border-gray-200 ${r}`,children:[(0,ts.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-3",children:[t&&(0,ts.jsx)(Xe,{variant:"outline",size:"small",onClick:t,"aria-label":"Back",children:(0,ts.jsx)(Xo,{})}),(0,ts.jsx)("h3",{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:e})]}),n&&(0,ts.jsx)("div",{className:"lua:flex lua:items-center lua:gap-2",children:n})]})});var Ba,Ze,O9,D9=A(()=>{"use strict";Ba=Z(Se());jt();ir();Mr();Ze=Z(ke()),O9=({persona:e,onSavePersona:t,apiKey:n,agentId:r})=>{let[a,i]=(0,Ba.useState)(e),[s,u]=(0,Ba.useState)(!1),[c,d]=(0,Ba.useState)([]),[p,h]=(0,Ba.useState)(!1),[m,g]=(0,Ba.useState)("current"),[b,C]=(0,Ba.useState)(null),[S,v]=(0,Ba.useState)(!1),[x,_]=(0,Ba.useState)(!1);(0,Ba.useEffect)(()=>{i(e)},[e]),(0,Ba.useEffect)(()=>{N()},[]);let N=async()=>{h(!0);try{let H=await Be.getPersonaVersions(r,n);if(H.success&&H.versions){let U=H.versions.sort(($,X)=>X.createdDate-$.createdDate);d(U)}else console.error("Failed to load persona versions:",H.error),d([])}catch(H){console.error("Error loading persona versions:",H),d([])}finally{h(!1)}},T=H=>{g(H),b&&C(null)},P=H=>{C(H)},R=()=>{C(null)},O=()=>{if(!a.trim()){alert("Please enter a persona before creating a version");return}_(!0)},B=async()=>{v(!0);try{let H=await Be.createPersonaVersion(r,n,a.trim());if(H.success)console.log("\u2705 Persona version created successfully:",H.data),await N(),g("versions"),alert("\u2705 Persona version created successfully! You can deploy it from the Production tab.");else throw new Error(H.error||"Failed to create persona version")}catch(H){console.error("\u274C Error creating persona version:",H),alert(`\u274C Failed to create persona version: ${H instanceof Error?H.message:"Unknown error"}`)}finally{v(!1),_(!1)}},z=()=>{_(!1)},V=async()=>{let H=a.trim();if(!H){alert("Persona cannot be empty");return}u(!0);try{await t(H)&&i(H)}finally{u(!1)}};return b?(0,Ze.jsxs)("div",{className:"lua:space-y-4",children:[(0,Ze.jsx)(Dt,{title:`Persona v${b.version}`,onBack:R,children:b.isCurrent?(0,Ze.jsx)(Lt,{variant:"secondary",children:"Active (Deployed)"}):(0,Ze.jsx)(Lt,{children:"Available"})}),(0,Ze.jsxs)(Ae,{className:"lua:p-4 lua:bg-white lua:border lua:border-gray-200 lua:rounded-lg",children:[(0,Ze.jsxs)("div",{className:"lua:grid lua:grid-cols-1 md:lua:grid-cols-3 lua:gap-4 lua:mb-4",children:[(0,Ze.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ze.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Created By"}),(0,Ze.jsx)("span",{className:"lua:text-sm lua:text-gray-900",children:b.createdBy})]}),(0,Ze.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ze.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Status"}),(0,Ze.jsx)("span",{className:"lua:text-sm lua:text-gray-900",children:b.isCurrent?"Active (Deployed)":"Available"})]}),(0,Ze.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ze.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Created Date"}),(0,Ze.jsx)("span",{className:"lua:text-sm lua:text-gray-900",children:new Date(b.createdDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("h4",{className:"lua:text-base lua:font-medium lua:text-gray-900 lua:mb-2",children:"Persona Content"}),(0,Ze.jsx)(Ae,{className:"lua:p-3 lua:bg-gray-50 lua:border lua:border-gray-200 lua:text-sm lua:text-gray-900 lua:whitespace-pre-wrap",children:b.persona})]})]})]}):(0,Ze.jsxs)("div",{className:"lua:pb-24",children:[(0,Ze.jsxs)(Dt,{title:"Agent Persona",children:[(0,Ze.jsx)(Ce,{onClick:O,disabled:S||!a.trim(),loading:S,"aria-label":"Create new persona version",startAdornment:(0,Ze.jsx)(Xt,{}),children:"Create version"}),(0,Ze.jsx)(Ce,{variant:"secondary",onClick:V,disabled:s,loading:s,"aria-label":"Save persona to YAML",children:"Save"})]}),(0,Ze.jsxs)("div",{className:"lua:px-5 lua:py-4 lua:px-5 lua:py-4 lua:space-y-4",children:[(0,Ze.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2 ",children:[(0,Ze.jsx)(Ce,{variant:m==="current"?"primary":"secondary",onClick:()=>T("current"),children:"Current"}),(0,Ze.jsxs)(Ce,{variant:m==="versions"?"primary":"secondary",onClick:()=>T("versions"),children:["Versions (",c.length,")"]})]}),m==="current"?(0,Ze.jsx)("div",{children:(0,Ze.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-3",children:[(0,Ze.jsx)("h4",{className:"lua:text-base lua:font-medium lua:text-gray-900",children:"Edit Current Persona"}),(0,Ze.jsx)(Ia,{value:a,onChange:H=>i(H.target.value),placeholder:"Enter agent persona...",className:"lua:min-h-48"}),(0,Ze.jsxs)("div",{className:"lua:-mx-4 lua:px-4 lua:mt-3 lua:py-2 lua:bg-gray-50 lua:border-t lua:border-gray-200 lua:rounded-b-lg lua:text-sm lua:text-gray-700 lua:sticky lua:bottom-0",children:["This persona is stored in your ",(0,Ze.jsx)("code",{children:"lua.skill.yaml"})," file and used for local development."]})]})}):(0,Ze.jsx)(Ae,{className:"lua:p-0 lua:bg-white lua:border lua:border-gray-200 lua:rounded-lg",children:p?(0,Ze.jsx)("div",{className:"lua:p-6 lua:flex lua:items-center lua:justify-center",children:(0,Ze.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"})}):c.length>0?(0,Ze.jsx)("div",{className:"lua:divide-y lua:divide-gray-200",children:c.map((H,U)=>(0,Ze.jsxs)("button",{className:"lua:w-full lua:text-left lua:p-3 lua:flex lua:items-center lua:justify-between hover:lua:bg-gray-50",onClick:()=>P(H),children:[(0,Ze.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ze.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,Ze.jsxs)("span",{className:"lua:text-sm lua:font-medium lua:text-gray-900",children:["v",H.version]}),(0,Ze.jsx)(Lt,{variant:H.isCurrent?"secondary":"default",children:H.isCurrent?"Active":"Available"})]}),(0,Ze.jsx)("span",{className:"lua:text-xs lua:text-gray-600",children:new Date(H.createdDate).toLocaleDateString()})]}),(0,Ze.jsx)("span",{className:"lua:text-gray-400",children:"\u2192"})]},U))}):(0,Ze.jsxs)("div",{className:"lua:p-8 lua:items-center lua:flex lua:flex-col",children:[(0,Ze.jsx)(Js,{className:"lua:text-3xl lua:mb-2"}),(0,Ze.jsx)("div",{className:"lua:text-base lua:font-medium lua:text-gray-900",children:"No persona versions found"}),(0,Ze.jsx)("div",{className:"lua:text-sm lua:text-gray-600",children:"Persona versions will appear here when available"})]})}),x&&(0,Ze.jsx)("div",{className:"lua:fixed lua:inset-0 lua:bg-black/30 lua:flex lua:items-center lua:justify-center",children:(0,Ze.jsxs)("div",{className:"lua:bg-white lua:rounded-lg lua:shadow-lg lua:border lua:border-gray-200 lua:w-full lua:max-w-lg lua:p-4",children:[(0,Ze.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:mb-2",children:[(0,Ze.jsx)("h3",{className:"lua:text-base lua:font-semibold lua:text-gray-900",children:"Create Persona Version"}),(0,Ze.jsx)(Ce,{variant:"tertiary",size:"small",onClick:z,"aria-label":"Close",children:"\u2715"})]}),(0,Ze.jsxs)("div",{className:"lua:space-y-3",children:[(0,Ze.jsx)("p",{className:"lua:text-sm lua:text-gray-700",children:"This will create a new persona version that can be deployed to production."}),(0,Ze.jsxs)("p",{className:"lua:text-sm lua:text-gray-700",children:[(0,Ze.jsx)("strong",{children:"Note:"})," The version will be created but not automatically released. You can deploy it from the Production tab."]}),(0,Ze.jsxs)("div",{className:"lua:space-y-2",children:[(0,Ze.jsx)("h4",{className:"lua:text-sm lua:font-medium lua:text-gray-900",children:"Persona Content:"}),(0,Ze.jsxs)(Ae,{className:"lua:p-3 lua:bg-gray-50 lua:border lua:border-gray-200 lua:text-sm lua:text-gray-900",children:[a.substring(0,300),a.length>300?"...":""]})]})]}),(0,Ze.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-end lua:gap-2 lua:mt-4",children:[(0,Ze.jsx)(Ce,{variant:"secondary",onClick:z,disabled:S,children:"Cancel"}),(0,Ze.jsx)(Ce,{onClick:B,disabled:S,children:S?"Creating...":"Create version"})]})]})})]})]})}});var Yn,q,H9,B9=A(()=>{"use strict";Yn=Z(Se());ir();jt();q=Z(ke()),H9=({apiKey:e,agentId:t,skillId:n,sandboxId:r})=>{let[a,i]=(0,Yn.useState)([]),[s,u]=(0,Yn.useState)(null),[c,d]=(0,Yn.useState)(null),[p,h]=(0,Yn.useState)([]),[m,g]=(0,Yn.useState)(!1),[b,C]=(0,Yn.useState)("current"),[S,v]=(0,Yn.useState)(!1),[x,_]=(0,Yn.useState)(!1),[N,T]=(0,Yn.useState)(""),[P,R]=(0,Yn.useState)({}),[O,B]=(0,Yn.useState)(null),[z,V]=(0,Yn.useState)(!0),[H,U]=(0,Yn.useState)(!1),[$,X]=(0,Yn.useState)(null),[W,oe]=(0,Yn.useState)([]);(0,Yn.useEffect)(()=>{J(),K()},[]);let J=async()=>{V(!0),X(null);try{console.log("Loading skills from /api/skills...");let Q=await fetch("/api/skills");if(console.log("Skills API response status:",Q.status),!Q.ok)throw new Error(`HTTP ${Q.status}: ${Q.statusText}`);let se=await Q.json();console.log("Skills API response data:",se),se.success&&se.skills&&Array.isArray(se.skills)?(console.log("Skills loaded successfully:",se.skills),i(se.skills),X(null)):(console.error("Failed to load skills:",se.error),X(se.error||"Failed to load skills - invalid data format"),i([]))}catch(Q){console.error("Error loading skills:",Q),X(Q instanceof Error?Q.message:"Failed to load skills"),i([])}finally{V(!1)}},K=async()=>{try{let se=await(await fetch("/tools")).json();if(se.success&&se.tools){let re=[];Array.isArray(se.tools)?re=se.tools:typeof se.tools=="object"&&(re=Object.entries(se.tools).map(([xe,Ye])=>({name:xe,...Ye}))),oe(re)}else console.error("Failed to load tools:",se.error),oe([])}catch(Q){console.error("Error loading tools:",Q),oe([])}},M=Q=>{let se={};Q.inputSchema.properties&&Object.keys(Q.inputSchema.properties).forEach(re=>{let xe=Q.inputSchema.properties[re];se[re]=ve(xe)}),R(se)},ve=Q=>{if(Q.type==="object"&&Q.properties){let se={};return Object.keys(Q.properties).forEach(re=>{se[re]=ve(Q.properties[re])}),se}else return Q.type==="number"?0:Q.type==="boolean"?!1:""},Ee=Q=>{let se=W.find(re=>re.name===Q);se&&(d(se),M(se),B(null))},I=async Q=>{g(!0);try{let se=await Be.getSkillVersions(Q.skillId,t,e);if(se.success&&se.versions){let re=se.versions.sort((xe,Ye)=>new Date(Ye.createdDate||Ye.createdAt).getTime()-new Date(xe.createdDate||xe.createdAt).getTime());h(re)}else console.error("Failed to load skill versions:",se.error),h([])}catch(se){console.error("Error loading skill versions:",se),h([])}finally{g(!1)}},ne=Q=>{let se=a.find(re=>re.name===Q);se&&(u(Q),C("current"),I(se))},ze=()=>{u(null),C("current"),h([]),d(null),B(null)},ye=Q=>{C(Q),c&&(d(null),B(null))},fe=()=>{d(null),B(null)},de=async()=>{if(!s)return;let Q=a.find(re=>re.name===s);if(!Q)return;p.some(re=>re.version===Q.version)?(T(Q.version),_(!0)):await he(Q.version)},he=async Q=>{if(!s)return;let se=a.find(re=>re.name===s);if(se){v(!0);try{let xe=await(await fetch("/tools")).json();if(!xe.success||!xe.tools)throw new Error("Failed to load current tools data");let Ye=[];Array.isArray(xe.tools)?Ye=xe.tools:typeof xe.tools=="object"&&(Ye=Object.entries(xe.tools).map(([sn,wn])=>({name:sn,description:wn.description||"",inputSchema:wn.inputSchema||{type:"object"},execute:wn.execute||""})));let xt=Ye.filter(sn=>se.tools.includes(sn.name)),Tt={name:se.name,version:Q,description:se.description,context:se.context,tools:xt};console.log("Creating version with data:",Tt);let Cn=await Be.createSkillVersion(se.skillId,t,e,Tt);if(Cn.success)console.log("\u2705 Version created successfully:",Cn.data),await I(se),alert(`\u2705 Version ${Q} created successfully!`);else throw new Error(Cn.error||"Failed to create version")}catch(re){console.error("\u274C Error creating version:",re),alert(`\u274C Failed to create version: ${re instanceof Error?re.message:"Unknown error"}`)}finally{v(!1),_(!1)}}},Ne=async()=>{if(!N.trim()){alert("Please enter a version number");return}if(p.some(se=>se.version===N.trim())){alert("This version already exists. Please enter a different version number.");return}await he(N.trim())},D=()=>{_(!1),T("")},te=(Q,se,re)=>{R(xe=>re?{...xe,[Q]:{...xe[Q],[re]:se}}:{...xe,[Q]:se})},ce=async()=>{if(c){U(!0),B(null);try{let Q=ge(P,c.inputSchema),se=await Be.testLocalTool(c.name,Q);B(se)}catch(Q){B({success:!1,error:Q instanceof Error?Q.message:"Unknown error occurred"})}finally{U(!1)}}},ge=(Q,se)=>{let re={};for(let[xe,Ye]of Object.entries(Q))if(Ye&&typeof Ye=="object"&&!Array.isArray(Ye)){let xt=se.properties?.[xe];if(xt&&xt.type==="object"&&xt.properties){let Tt=ge(Ye,xt);Object.keys(Tt).length>0&&(re[xe]=Tt)}else re[xe]=Ye}else{let xt=se.properties?.[xe];if((!se.required||!se.required.includes(xe))&&(Ye===""||Ye===null||Ye===void 0))continue;re[xe]=Ye}return re},ie=(Q,se,re)=>{let xe=re?P[Q]?.[re]||"":P[Q]||"",Ye=re?se.required?.includes(re):c?.inputSchema.required?.includes(Q);if(se.type==="object"&&se.properties)return(0,q.jsxs)("div",{className:"lua:space-y-4 lua:p-4 lua:bg-gray-50 lua:rounded-lg",children:[(0,q.jsx)("div",{className:"lua:font-medium lua:text-gray-700",children:Q}),(0,q.jsx)("div",{className:"lua:space-y-4",children:Object.entries(se.properties).map(([xt,Tt])=>(0,q.jsxs)("div",{className:"lua:space-y-2",children:[(0,q.jsxs)("label",{className:"lua:block lua:text-sm lua:font-medium lua:text-gray-700",children:[xt,se.required?.includes(xt)&&(0,q.jsx)("span",{className:"lua:text-red-500 lua:ml-1",children:"*"})]}),ie(Q,Tt,xt),Tt.description&&(0,q.jsx)("p",{className:"lua:text-sm lua:text-gray-500",children:Tt.description})]},xt))})]});switch(se.type){case"number":return(0,q.jsx)(Pt,{type:"number",value:xe,onChange:xt=>te(Q,parseFloat(xt.target.value)||0,re),placeholder:se.description||`Enter ${re||Q}`,required:Ye,className:"lua:w-full"});case"boolean":return(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:space-x-2",children:[(0,q.jsx)("input",{type:"checkbox",checked:xe,onChange:xt=>te(Q,xt.target.checked,re),className:"lua:w-4 lua:h-4 lua:text-blue-600 lua:bg-gray-100 lua:border-gray-300 lua:rounded"}),(0,q.jsx)("span",{className:"lua:text-sm lua:text-gray-700",children:xe?"Yes":"No"})]});case"string":default:return(0,q.jsx)(Pt,{type:"text",value:xe,onChange:xt=>te(Q,xt.target.value,re),placeholder:se.description||`Enter ${re||Q}`,required:Ye,className:"lua:w-full"})}};if(z)return(0,q.jsx)("div",{className:"lua:h-full lua:flex lua:items-center lua:justify-center lua:bg-white",children:(0,q.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"})});if(c)return(0,q.jsx)("div",{className:"lua:h-full lua:flex lua:flex-col lua:bg-white",children:(0,q.jsxs)(Ae,{className:"lua:border-0 lua:shadow-none lua:h-full lua:flex lua:flex-col",children:[(0,q.jsx)(ca,{className:"lua:bg-gray-50 lua:border-b lua:border-gray-200",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-4",children:[(0,q.jsx)(Xe,{variant:"outline",size:"small",onClick:fe,title:"Back to skill",children:(0,q.jsx)(Xo,{size:18})}),(0,q.jsx)(Gr,{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:c.name})]})}),(0,q.jsx)(Ke,{className:"lua:flex-1 lua:overflow-y-auto lua:p-6",children:(0,q.jsxs)("div",{className:"lua:space-y-6",children:[(0,q.jsx)("div",{className:"lua:bg-gray-50 lua:p-4 lua:rounded-lg",children:(0,q.jsx)("p",{className:"lua:text-gray-700",children:c.description})}),(0,q.jsxs)("div",{children:[(0,q.jsx)("h4",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-4",children:"Input Parameters"}),Object.keys(c.inputSchema.properties||{}).length>0?(0,q.jsx)("div",{className:"lua:space-y-4",children:Object.entries(c.inputSchema.properties).map(([Q,se])=>(0,q.jsxs)("div",{className:"lua:space-y-2",children:[(0,q.jsxs)("label",{className:"lua:block lua:text-sm lua:font-medium lua:text-gray-700",children:[Q,c.inputSchema.required?.includes(Q)&&(0,q.jsx)("span",{className:"lua:text-red-500 lua:ml-1",children:"*"})]}),ie(Q,se),se.description&&(0,q.jsx)("p",{className:"lua:text-sm lua:text-gray-500",children:se.description})]},Q))}):(0,q.jsx)("p",{className:"lua:text-gray-500 lua:italic",children:"This tool requires no input parameters."})]}),(0,q.jsx)("div",{className:"lua:flex lua:justify-end",children:(0,q.jsx)(Ce,{onClick:ce,disabled:H,children:H?"Testing...":"Test Tool"})}),O&&(0,q.jsxs)("div",{className:"lua:space-y-3",children:[(0,q.jsx)("h4",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"Test Result"}),(0,q.jsx)(Ae,{className:O.success?"lua:border-green-200 lua:bg-green-50":"lua:border-red-200 lua:bg-red-50",children:(0,q.jsx)(Ke,{className:"lua:p-4",children:O.success?(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2 lua:mb-3",children:[(0,q.jsx)("span",{className:"lua:text-green-600",children:"\u2705"}),(0,q.jsx)("span",{className:"lua:font-medium lua:text-green-800",children:"Success"})]}),(0,q.jsx)("pre",{className:"lua:bg-white lua:p-3 lua:rounded lua:border lua:text-sm lua:overflow-x-auto",children:JSON.stringify(O.result,null,2)})]}):(0,q.jsxs)("div",{children:[(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2 lua:mb-3",children:[(0,q.jsx)("span",{className:"lua:text-red-600",children:"\u274C"}),(0,q.jsx)("span",{className:"lua:font-medium lua:text-red-800",children:"Error"})]}),(0,q.jsx)("div",{className:"lua:text-red-700",children:O.error})]})})})]})]})})]})});if(s){let Q=a.find(se=>se.name===s);return Q?(0,q.jsxs)("div",{className:"lua:h-full lua:flex lua:flex-col lua:bg-white",children:[(0,q.jsxs)(Ae,{className:"lua:border-0 lua:shadow-none lua:h-full lua:flex lua:flex-col",children:[(0,q.jsx)(ca,{className:"lua:bg-gray-50 lua:border-b lua:border-gray-200",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between",children:[(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-4",children:[(0,q.jsx)(Xe,{variant:"outline",size:"small",onClick:ze,children:(0,q.jsx)(Xo,{})}),(0,q.jsx)(Gr,{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:Q.name})]}),(0,q.jsx)(Ce,{onClick:de,disabled:S,variant:"primary",size:"default",title:"Create new version",children:S?"Creating...":"Create Version"})]})}),(0,q.jsx)(Ke,{className:"lua:flex-1 lua:overflow-hidden lua:p-0",children:(0,q.jsxs)(Wi,{value:b,onValueChange:se=>ye(se),className:"lua:h-full lua:flex lua:flex-col",children:[(0,q.jsxs)(Yo,{className:"lua:grid lua:w-full lua:grid-cols-2 lua:bg-gray-100 lua:rounded-none",children:[(0,q.jsx)(fn,{value:"current",className:"lua:data-[state=active]:bg-white lua:data-[state=active]:shadow-sm",children:"Current"}),(0,q.jsxs)(fn,{value:"versions",className:"lua:data-[state=active]:bg-white lua:data-[state=active]:shadow-sm",children:["Versions (",p.length,")"]})]}),(0,q.jsx)(gr,{value:"current",className:"lua:flex-1 lua:overflow-y-auto lua:p-6 lua:mt-0",children:(0,q.jsxs)("div",{className:"lua:space-y-6",children:[(0,q.jsxs)("div",{className:"lua:space-y-4",children:[(0,q.jsxs)("div",{className:"lua:flex lua:gap-4",children:[(0,q.jsxs)(Lt,{variant:"secondary",className:"lua:bg-blue-100 lua:text-blue-800",children:["v",Q.version]}),(0,q.jsxs)(Lt,{variant:"secondary",className:"lua:bg-green-100 lua:text-green-800",children:[Q.tools.length," tools"]})]}),Q.description&&(0,q.jsxs)("div",{children:[(0,q.jsx)("h5",{className:"lua:text-sm lua:font-medium lua:text-gray-900 lua:mb-2",children:"Description"}),(0,q.jsx)("p",{className:"lua:text-gray-700 lua:bg-gray-50 lua:p-3 lua:rounded-lg",children:Q.description})]}),Q.context&&(0,q.jsxs)("div",{children:[(0,q.jsx)("h5",{className:"lua:text-sm lua:font-medium lua:text-gray-900 lua:mb-2",children:"Context"}),(0,q.jsx)("p",{className:"lua:text-gray-700 lua:bg-gray-50 lua:p-3 lua:rounded-lg",children:Q.context})]})]}),(0,q.jsxs)("div",{children:[(0,q.jsxs)("h5",{className:"lua:text-sm lua:font-medium lua:text-gray-900 lua:mb-4",children:["Available Tools (",Q.tools.length,")"]}),Q.tools&&Q.tools.length>0?(0,q.jsx)("div",{className:"lua:grid lua:grid-cols-1 lua:gap-3 lua:sm:grid-cols-2 lua:lg:grid-cols-3",children:Q.tools.map((se,re)=>(0,q.jsx)(Ae,{className:"lua:cursor-pointer lua:transition-all lua:hover:shadow-md lua:border-gray-200 lua:hover:border-gray-300",onClick:()=>Ee(se),children:(0,q.jsx)(Ke,{className:"lua:p-4",children:(0,q.jsxs)("div",{className:"lua:space-y-2",children:[(0,q.jsx)("h4",{className:"lua:font-medium lua:text-gray-900",children:se}),(0,q.jsx)(Lt,{variant:"outline",className:"lua:text-xs",children:Q.name})]})})},re))}):(0,q.jsxs)("div",{className:"lua:text-center lua:py-8",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u{1F527}"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"No tools in this skill"}),(0,q.jsx)("p",{className:"lua:text-gray-500",children:"This skill doesn't have any tools defined"})]})]}),(0,q.jsx)("div",{className:"lua:bg-blue-50 lua:border lua:border-blue-200 lua:rounded-lg lua:p-4",children:(0,q.jsx)("p",{className:"lua:text-sm lua:text-blue-800",children:"This skill is compiled from your local code and updates automatically when you make changes. Use the tools above to test your skill's functionality."})})]})}),(0,q.jsx)(gr,{value:"versions",className:"lua:flex-1 lua:overflow-y-auto lua:p-6 lua:mt-0",children:m?(0,q.jsx)("div",{className:"lua:flex lua:items-center lua:justify-center lua:py-8",children:(0,q.jsxs)("div",{className:"lua:text-center",children:[(0,q.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"}),(0,q.jsx)("p",{className:"lua:text-gray-600",children:"Loading versions..."})]})}):p.length>0?(0,q.jsx)("div",{className:"lua:space-y-3",children:p.map((se,re)=>(0,q.jsx)(Ae,{className:`lua:cursor-pointer lua:transition-all lua:hover:shadow-md ${se.status==="deployed"?"lua:border-green-200 lua:bg-green-50":"lua:border-gray-200 lua:hover:border-gray-300"}`,onClick:()=>{console.log("Selected version:",se.version)},children:(0,q.jsx)(Ke,{className:"lua:p-4",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between",children:[(0,q.jsxs)("div",{className:"lua:space-y-1",children:[(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,q.jsxs)("span",{className:"lua:font-medium lua:text-gray-900",children:["v",se.version]}),(0,q.jsx)(Lt,{variant:se.status==="deployed"?"default":"secondary",className:se.status==="deployed"?"lua:bg-green-100 lua:text-green-800":"lua:bg-gray-100 lua:text-gray-800",children:se.status})]}),(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-4 lua:text-sm lua:text-gray-500",children:[(0,q.jsx)("span",{children:new Date(se.createdDate||se.createdAt).toLocaleDateString()}),(0,q.jsxs)("span",{children:["by"," ",se.createdByEmail||se.createdBy]})]})]}),(0,q.jsx)("div",{className:"lua:text-gray-400",children:"\u2192"})]})})},re))}):(0,q.jsxs)("div",{className:"lua:text-center lua:py-8",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u{1F4E6}"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"No versions found"}),(0,q.jsx)("p",{className:"lua:text-gray-500",children:"Create your first version to get started"})]})})]})})]}),x&&(0,q.jsx)("div",{className:"lua:fixed lua:inset-0 lua:bg-black/30 lua:flex lua:items-center lua:justify-center lua:z-50",children:(0,q.jsxs)(Ae,{className:"lua:w-full lua:max-w-md lua:mx-4 lua:bg-white lua:rounded-lg lua:shadow-lg",children:[(0,q.jsx)(ca,{children:(0,q.jsx)(Gr,{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:"Create New Version"})}),(0,q.jsxs)(Ke,{className:"lua:space-y-4",children:[(0,q.jsxs)("p",{className:"lua:text-gray-700",children:["Version"," ",(0,q.jsx)("strong",{children:a.find(se=>se.name===s)?.version})," ","already exists."]}),(0,q.jsx)("p",{className:"lua:text-gray-700",children:"Please enter a new version number:"}),(0,q.jsx)(Pt,{type:"text",value:N,onChange:se=>T(se.target.value),placeholder:"e.g., 1.0.1",autoFocus:!0,className:"lua:w-full"})]}),(0,q.jsxs)("div",{className:"lua:flex lua:justify-end lua:gap-3 lua:p-6 lua:pt-0",children:[(0,q.jsx)(Ce,{variant:"outline",onClick:D,disabled:S,children:"Cancel"}),(0,q.jsx)(Ce,{variant:"primary",onClick:Ne,disabled:S||!N.trim(),children:S?"Creating...":"Create Version"})]})]})})]}):(0,q.jsx)("div",{className:"lua:h-full lua:flex lua:flex-col lua:bg-white",children:(0,q.jsxs)(Ae,{className:"lua:border-0 lua:shadow-none lua:h-full lua:flex lua:flex-col",children:[(0,q.jsx)(ca,{className:"lua:bg-gray-50 lua:border-b lua:border-gray-200",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-4",children:[(0,q.jsx)(Xe,{variant:"outline",size:"small",onClick:ze,children:(0,q.jsx)(Xo,{})}),(0,q.jsx)(Gr,{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:"Skill Not Found"})]})}),(0,q.jsx)(Ke,{className:"lua:flex-1 lua:flex lua:items-center lua:justify-center",children:(0,q.jsxs)("div",{className:"lua:text-center",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u274C"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"Skill not found"}),(0,q.jsx)("p",{className:"lua:text-gray-500",children:"The selected skill could not be loaded"})]})})]})})}return(0,q.jsx)("div",{className:"lua:h-full lua:flex lua:flex-col lua:bg-white",children:(0,q.jsxs)(Ae,{className:"lua:border-0 lua:shadow-none lua:h-full lua:flex lua:flex-col",children:[(0,q.jsx)("div",{className:"lua:bg-white lua:border-b lua:border-gray-200 lua:px-5 lua:py-3 lua:flex lua:items-center lua:justify-between lua:shrink-0",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:flex-1",children:[(0,q.jsx)(Gr,{className:"lua:text-lg lua:font-semibold lua:text-gray-900",children:"Available Skills"}),(0,q.jsx)(Xe,{variant:"outline",size:"small",onClick:J,title:"Refresh skills",children:(0,q.jsx)(Hn,{size:18})})]})}),(0,q.jsx)(Ke,{className:"lua:flex-1 lua:overflow-y-auto lua:p-6",children:$?(0,q.jsxs)("div",{className:"lua:text-center lua:py-8",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u274C"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"Error loading skills"}),(0,q.jsx)("p",{className:"lua:text-gray-500 lua:mb-4",children:$}),(0,q.jsx)(Ce,{variant:"primary",onClick:J,children:"Retry"})]}):a.length===0?(0,q.jsxs)("div",{className:"lua:text-center lua:py-8",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u2699\uFE0F"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"No skills found"}),(0,q.jsx)("p",{className:"lua:text-gray-500",children:"Skills will appear here when available in your project"})]}):Array.isArray(a)&&a.length>0?(0,q.jsx)("div",{className:"lua:space-y-3",children:a.map(Q=>(0,q.jsx)(Ae,{className:"lua:cursor-pointer lua:transition-all lua:hover:shadow-md lua:border-gray-200 lua:hover:border-gray-300",onClick:()=>ne(Q.name),children:(0,q.jsx)(Ke,{className:"lua:p-4",children:(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between",children:[(0,q.jsxs)("div",{className:"lua:space-y-2 lua:flex-1",children:[(0,q.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,q.jsx)("h4",{className:"lua:font-medium lua:text-gray-900",children:Q.name}),(0,q.jsxs)(Lt,{variant:"secondary",className:"lua:bg-blue-100 lua:text-blue-800",children:["v",Q.version]}),(0,q.jsxs)(Lt,{variant:"outline",className:"lua:bg-green-100 lua:text-green-800",children:[Q.tools.length," tools"]})]}),Q.description&&(0,q.jsx)("p",{className:"lua:text-sm lua:text-gray-600 lua:line-clamp-2",children:Q.description})]}),(0,q.jsx)("div",{className:"lua:text-gray-400 lua:ml-4",children:"\u2192"})]})})},Q.name))}):(0,q.jsxs)("div",{className:"lua:text-center lua:py-8",children:[(0,q.jsx)("div",{className:"lua:text-4xl lua:mb-4",children:"\u2699\uFE0F"}),(0,q.jsx)("h3",{className:"lua:text-lg lua:font-medium lua:text-gray-900 lua:mb-2",children:"No skills available"}),(0,q.jsx)("p",{className:"lua:text-gray-500",children:"No valid skills data received"})]})})]})})}});var mn,Ie,rd,wf=A(()=>{"use strict";mn=Z(Se());ir();jt();Ie=Z(ke()),rd=({apiKey:e,agentId:t,isProduction:n=!1,onHeaderChange:r})=>{let[a,i]=(0,mn.useState)([]),[s,u]=(0,mn.useState)(!0),[c,d]=(0,mn.useState)(""),[p,h]=(0,mn.useState)([]),[m,g]=(0,mn.useState)(null),[b,C]=(0,mn.useState)(!1),[S,v]=(0,mn.useState)(!1),[x,_]=(0,mn.useState)({}),[N,T]=(0,mn.useState)(null),[P,R]=(0,mn.useState)(null),[O,B]=(0,mn.useState)(!1),[z,V]=(0,mn.useState)(!1),[H,U]=(0,mn.useState)(1),[$,X]=(0,mn.useState)(1),[W,oe]=(0,mn.useState)(0);(0,mn.useEffect)(()=>{J()},[m,S,b,O,z,x]),(0,mn.useEffect)(()=>{K()},[e,t,H]);let J=()=>{if(!r)return;let D;m&&!b?D=(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(Ce,{variant:"secondary",onClick:I,disabled:z,title:"Edit product",startAdornment:(0,Ie.jsx)(Qo,{}),children:"Edit"}),(0,Ie.jsx)(Ce,{variant:"destructive",onClick:ze,disabled:z,title:"Delete product",startAdornment:(0,Ie.jsx)(Bn,{}),loading:z,children:"Delete"})]}):b||S?D=(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(Ce,{variant:"secondary",onClick:ye,disabled:O,title:"Cancel",startAdornment:(0,Ie.jsx)(qr,{}),children:"Cancel"}),(0,Ie.jsx)(Ce,{onClick:ne,disabled:O,title:S?"Create product":"Save changes",loading:O,children:S?"Create":"Save"})]}):D=(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(Ce,{onClick:Ee,title:"Create new product",startAdornment:(0,Ie.jsx)(Xt,{}),children:"Add Product"}),(0,Ie.jsx)(Xe,{variant:"tertiary",size:"small",onClick:K,title:"Refresh products","aria-label":"Refresh products",disabled:s,children:(0,Ie.jsx)(Hn,{size:18})})]}),r({title:"",actions:D})};console.log("products",a),(0,mn.useEffect)(()=>{if(c.trim()){let D=a.filter(te=>Object.values(te).some(ce=>String(ce).toLowerCase().includes(c.toLowerCase())));h(D)}else h(a)},[a,c]),(0,mn.useEffect)(()=>{if(N||P){let D=setTimeout(()=>{T(null),R(null)},5e3);return()=>clearTimeout(D)}},[N,P]);let K=async()=>{u(!0);try{let D=await Be.getProducts(e,t,H,20);D.success&&D.data?(i(D.data.data.products||[]),X(D.data.pagination?.totalPages||1),oe(D.data.pagination?.totalCount||0)):(console.error("Failed to load products:",D.error),i([]),T("Failed to load products"))}catch(D){console.error("Error loading products:",D),i([]),T("Failed to load products")}finally{u(!1)}},M=async()=>{if(!c.trim()){h(a);return}try{let D=await Be.searchProducts(e,t,c);D.success&&D.data?h(D.data.data||[]):T("Search failed")}catch(D){console.error("Search error:",D),T("Search failed")}},ve=D=>{g(D),_({...D}),C(!1)},Ee=()=>{g(null),_({id:"",name:"",description:"",price:""}),v(!0),C(!0)},I=()=>{C(!0)},ne=async()=>{if(!x.id||!x.id.toString().trim()){T("Product ID is required. Please fill in the ID field.");return}if(!x.name||!x.name.toString().trim()){T("Product name is required. Please fill in the name field.");return}B(!0);try{let D;S?D=await Be.createProduct(e,t,x):D=await Be.updateProduct(e,t,x),D.success?(R(S?"Product created successfully":"Product updated successfully"),C(!1),v(!1),g(D.data?.product||x),await K()):T(`Failed to ${S?"create":"update"} product: ${D.error||"Unknown error"}`)}catch(D){T(`Failed to ${S?"create":"update"} product: ${D.message||"Unknown error"}`)}finally{B(!1)}},ze=async()=>{if(!(!m||!m.id)&&confirm(`Are you sure you want to delete "${m.name||m.id}"?`)){V(!0);try{(await Be.deleteProduct(e,t,m.id)).success?(R("Product deleted successfully"),g(null),await K()):T("Failed to delete product")}catch(D){console.error("Delete error:",D),T("Failed to delete product")}finally{V(!1)}}},ye=()=>{C(!1),v(!1),m?_({...m}):g(null)},fe=()=>{g(null),C(!1),v(!1)},de=(D,te)=>{_(ce=>({...ce,[D]:te}))},he=()=>{let D=["id","name","description","price"],te=new Set([...D,...Object.keys(x)]);return(0,Ie.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Ie.jsxs)(Ke,{className:"lua:space-y-4",children:[Array.from(te).map(ce=>(0,Ie.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ie.jsx)("label",{htmlFor:`product-${ce}`,className:"lua:text-sm lua:font-medium lua:text-gray-700",children:ce}),(0,Ie.jsx)(Pt,{id:`product-${ce}`,type:ce==="price"?"number":"text",value:x[ce]||"",onChange:ge=>de(ce,ge.target.value),placeholder:`Enter ${ce}...`,disabled:O,required:ce==="id",className:"lua:w-full"})]},ce)),(0,Ie.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ie.jsx)("label",{htmlFor:"add-field",className:"lua:text-sm lua:font-medium lua:text-gray-700",children:"Add Custom Field"}),(0,Ie.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,Ie.jsx)(Pt,{id:"add-field-key",type:"text",placeholder:"Field name",onKeyPress:ce=>{if(ce.key==="Enter"){let ge=ce.target.value.trim();ge&&!x.hasOwnProperty(ge)&&(de(ge,""),ce.target.value="")}},className:"lua:flex-1"}),(0,Ie.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Press Enter to add"})]})]})]})})},Ne=()=>S?he():m?b?he():(0,Ie.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Ie.jsx)(Ke,{className:"lua:space-y-4",children:Object.entries(m).map(([D,te])=>(0,Ie.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Ie.jsx)("div",{className:"lua:text-sm lua:font-medium lua:text-gray-700",children:D}),(0,Ie.jsx)("div",{className:"lua:text-sm lua:text-gray-900 lua:bg-gray-50 lua:p-2 lua:rounded lua:border",children:String(te)})]},D))})}):null;return s&&a.length===0?(0,Ie.jsx)("div",{className:"lua:flex lua:flex-1 lua:bg-white lua:overflow-hidden lua:h-full",children:(0,Ie.jsx)("div",{className:"lua:flex lua:flex-col lua:items-center lua:justify-center lua:h-full lua:w-full lua:gap-4 lua:min-h-full",children:(0,Ie.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"})})}):(0,Ie.jsxs)("div",{className:"lua:flex lua:flex-col lua:h-full lua:bg-gray-50",children:[N&&(0,Ie.jsx)("div",{className:"lua:bg-red-50 lua:border lua:border-red-200 lua:text-red-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:N}),P&&(0,Ie.jsx)("div",{className:"lua:bg-green-50 lua:border lua:border-green-200 lua:text-green-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:P}),(0,Ie.jsx)("div",{className:"lua:flex-1 lua:overflow-hidden lua:p-4",children:m||S?Ne():(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("div",{className:"lua:mb-4",children:(0,Ie.jsx)("div",{className:"lua:max-w-md",children:(0,Ie.jsx)(Pt,{type:"text",placeholder:"Search products...",value:c,onChange:D=>d(D.target.value),className:"lua:w-full",startAdornment:(0,Ie.jsx)(Oa,{onClick:M})})})}),(0,Ie.jsx)("div",{className:"lua:space-y-2 lua:flex-1 lua:overflow-y-auto",children:p.length>0?p.map(D=>(0,Ie.jsx)(Ae,{className:"lua:cursor-pointer lua:hover:shadow-md lua:transition-shadow lua:border lua:border-gray-200 lua:rounded-lg lua:p-4",onClick:()=>ve(D),children:(0,Ie.jsxs)(Ke,{className:"lua:flex lua:items-center lua:justify-between",children:[(0,Ie.jsxs)("div",{className:"lua:flex-1 lua:min-w-0",children:[(0,Ie.jsx)("div",{className:"lua:text-lg lua:font-semibold lua:text-gray-900 lua:truncate",children:D.name||D.id}),(0,Ie.jsx)("div",{className:"lua:text-sm lua:text-gray-600 lua:truncate",children:D.description||"No description"}),(0,Ie.jsxs)("div",{className:"lua:text-xs lua:text-gray-500 lua:mt-1",children:["ID: ",D.id,D.price&&(0,Ie.jsxs)("span",{children:[" \u2022 Price: ",D.price]})]})]}),(0,Ie.jsx)("div",{className:"lua:text-gray-400 lua:ml-4",children:"\u2192"})]})},D.id)):c?(0,Ie.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Ie.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,Ie.jsx)(Oa,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,Ie.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No products found"}),(0,Ie.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Try a different search term"})]})}):(0,Ie.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Ie.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,Ie.jsx)(Xs,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,Ie.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No products yet"}),(0,Ie.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Create your first product to get started"})]})})}),$>1&&(0,Ie.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:mt-4 lua:pt-4 lua:border-t lua:border-gray-200",children:[(0,Ie.jsxs)("div",{className:"lua:text-sm lua:text-gray-700",children:["Page ",H," of ",$]}),(0,Ie.jsxs)("div",{className:"lua:flex lua:gap-2",children:[(0,Ie.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.max(1,D-1)),disabled:H<=1||s,children:"\u2190"}),(0,Ie.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.min($,D+1)),disabled:H>=$||s,children:"\u2192"})]})]})]})})]})}});var gn,Oe,xf,F9=A(()=>{"use strict";gn=Z(Se());ir();jt();Oe=Z(ke()),xf=({apiKey:e,agentId:t,isProduction:n=!1,onHeaderChange:r})=>{let[a,i]=(0,gn.useState)([]),[s,u]=(0,gn.useState)(!0),[c,d]=(0,gn.useState)(""),[p,h]=(0,gn.useState)([]),[m,g]=(0,gn.useState)(null),[b,C]=(0,gn.useState)(!1),[S,v]=(0,gn.useState)(!1),[x,_]=(0,gn.useState)({}),[N,T]=(0,gn.useState)(null),[P,R]=(0,gn.useState)(null),[O,B]=(0,gn.useState)(!1),[z,V]=(0,gn.useState)(!1),[H,U]=(0,gn.useState)(1),[$,X]=(0,gn.useState)(1),[W,oe]=(0,gn.useState)(0);(0,gn.useEffect)(()=>{J()},[m,S,b,O,z,x]),(0,gn.useEffect)(()=>{K()},[e,t,H]);let J=()=>{if(!r)return;let D;m&&!b?D=(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(Ce,{variant:"secondary",onClick:I,disabled:z,title:"Edit basket",startAdornment:(0,Oe.jsx)(Qo,{}),children:"Edit"}),(0,Oe.jsx)(Ce,{variant:"destructive",onClick:ze,disabled:z,title:"Delete basket",startAdornment:(0,Oe.jsx)(Bn,{}),loading:z,children:"Delete"})]}):b||S?D=(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(Ce,{variant:"secondary",onClick:ye,disabled:O,title:"Cancel",startAdornment:(0,Oe.jsx)(qr,{}),children:"Cancel"}),(0,Oe.jsx)(Ce,{onClick:ne,disabled:O,title:S?"Create basket":"Save changes",loading:O,children:S?"Create":"Save"})]}):D=(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(Ce,{onClick:Ee,title:"Create new basket",startAdornment:(0,Oe.jsx)(Xt,{}),children:"Add Basket"}),(0,Oe.jsx)(Xe,{variant:"tertiary",size:"small",onClick:K,title:"Refresh baskets","aria-label":"Refresh baskets",disabled:s,children:(0,Oe.jsx)(Hn,{size:18})})]}),r({title:"",actions:D})};(0,gn.useEffect)(()=>{if(c.trim()){let D=a.filter(te=>Object.values(te).some(ce=>String(ce).toLowerCase().includes(c.toLowerCase())));h(D)}else h(a)},[a,c]),(0,gn.useEffect)(()=>{if(N||P){let D=setTimeout(()=>{T(null),R(null)},5e3);return()=>clearTimeout(D)}},[N,P]);let K=async()=>{u(!0);try{let D=await Be.getBaskets(e,t);D.success&&D.data?(i(D.data.data||D.data||[]),oe(Array.isArray(D.data)?D.data.length:D.data.data?.length||0)):(console.error("Failed to load baskets:",D.error),i([]),T("Failed to load baskets"))}catch(D){console.error("Error loading baskets:",D),i([]),T("Failed to load baskets")}finally{u(!1)}},M=async()=>{if(!c.trim()){h(a);return}let D=a.filter(te=>Object.values(te).some(ce=>String(ce).toLowerCase().includes(c.toLowerCase())));h(D)},ve=D=>{g(D),_({...D}),C(!1)},Ee=()=>{g(null),_({currency:"USD",metadata:{}}),v(!0),C(!0)},I=()=>{C(!0)},ne=async()=>{if(!x.currency||!x.currency.toString().trim()){T("Currency is required. Please fill in the currency field.");return}B(!0);try{let D;S?D=await Be.createBasket(e,t,x):D=await Be.updateBasket(e,t,m.id,x),D.success?(R(S?"Basket created successfully":"Basket updated successfully"),C(!1),v(!1),g(D.data||x),await K()):T(`Failed to ${S?"create":"update"} basket: ${D.error||"Unknown error"}`)}catch(D){console.error("\u274C Save error:",D),T(`Failed to ${S?"create":"update"} product: ${D.message||"Unknown error"}`)}finally{B(!1)}},ze=async()=>{if(!(!m||!m.id)&&confirm("Are you sure you want to delete this basket?")){V(!0);try{(await Be.deleteBasket(e,t,m.id)).success?(R("Basket deleted successfully"),g(null),await K()):T("Failed to delete basket")}catch(D){console.error("Delete error:",D),T("Failed to delete basket")}finally{V(!1)}}},ye=()=>{C(!1),v(!1),m?_({...m}):g(null)},fe=()=>{g(null),C(!1),v(!1)},de=(D,te)=>{_(ce=>({...ce,[D]:te}))},he=()=>{let D=["currency","metadata"],te=new Set([...D,...Object.keys(x)]);return(0,Oe.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Oe.jsxs)(Ke,{className:"lua:space-y-4",children:[Array.from(te).map(ce=>(0,Oe.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Oe.jsx)("label",{htmlFor:`basket-${ce}`,className:"lua:text-sm lua:font-medium lua:text-gray-700",children:ce}),(0,Oe.jsx)(Pt,{id:`basket-${ce}`,type:ce==="price"?"number":"text",value:x[ce]||"",onChange:ge=>de(ce,ge.target.value),placeholder:`Enter ${ce}...`,disabled:O,required:ce==="currency",className:"lua:w-full"})]},ce)),(0,Oe.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Oe.jsx)("label",{htmlFor:"add-field",className:"lua:text-sm lua:font-medium lua:text-gray-700",children:"Add Custom Field"}),(0,Oe.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,Oe.jsx)(Pt,{id:"add-field-key",type:"text",placeholder:"Field name",onKeyPress:ce=>{if(ce.key==="Enter"){let ge=ce.target.value.trim();ge&&!x.hasOwnProperty(ge)&&(de(ge,""),ce.target.value="")}},className:"lua:flex-1"}),(0,Oe.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Press Enter to add"})]})]})]})})},Ne=()=>S?he():m?b?he():(0,Oe.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Oe.jsx)(Ke,{className:"lua:space-y-4",children:Object.entries(m).map(([D,te])=>(0,Oe.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,Oe.jsx)("div",{className:"lua:text-sm lua:font-medium lua:text-gray-700",children:D}),(0,Oe.jsx)("div",{className:"lua:text-sm lua:text-gray-900 lua:bg-gray-50 lua:p-2 lua:rounded lua:border lua:whitespace-pre-wrap",children:typeof te=="object"?JSON.stringify(te,null,2):String(te)})]},D))})}):null;return s&&a.length===0?(0,Oe.jsx)("div",{className:"lua:flex lua:flex-1 lua:bg-white lua:overflow-hidden lua:h-full",children:(0,Oe.jsx)("div",{className:"lua:flex lua:flex-col lua:items-center lua:justify-center lua:h-full lua:w-full lua:gap-4 lua:min-h-full",children:(0,Oe.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"})})}):(0,Oe.jsxs)("div",{className:"lua:flex lua:flex-col lua:h-full lua:bg-gray-50",children:[N&&(0,Oe.jsx)("div",{className:"lua:bg-red-50 lua:border lua:border-red-200 lua:text-red-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:N}),P&&(0,Oe.jsx)("div",{className:"lua:bg-green-50 lua:border lua:border-green-200 lua:text-green-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:P}),(0,Oe.jsx)("div",{className:"lua:flex-1 lua:overflow-hidden lua:p-4",children:m||S?Ne():(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)("div",{className:"lua:mb-4",children:(0,Oe.jsx)("div",{className:"lua:max-w-md",children:(0,Oe.jsx)(Pt,{type:"text",placeholder:"Search baskets...",value:c,onChange:D=>d(D.target.value),className:"lua:w-full",startAdornment:(0,Oe.jsx)(Oa,{onClick:M})})})}),(0,Oe.jsx)("div",{className:"lua:space-y-2 lua:flex-1 lua:overflow-y-auto",children:p.length>0?p.map(D=>(0,Oe.jsx)(Ae,{className:"lua:cursor-pointer lua:hover:shadow-md lua:transition-shadow lua:border lua:border-gray-200 lua:rounded-lg lua:p-4",onClick:()=>ve(D),children:(0,Oe.jsxs)(Ke,{className:"lua:flex lua:items-center lua:justify-between",children:[(0,Oe.jsxs)("div",{className:"lua:flex-1 lua:min-w-0",children:[(0,Oe.jsxs)("div",{className:"lua:text-lg lua:font-semibold lua:text-gray-900 lua:truncate",children:["Basket ",D.id.substring(0,8)]}),(0,Oe.jsxs)("div",{className:"lua:text-sm lua:text-gray-600 lua:truncate",children:[D.status||"active"," \u2022"," ",D.currency||"USD"]}),(0,Oe.jsxs)("div",{className:"lua:text-xs lua:text-gray-500 lua:mt-1",children:["Items: ",D.itemCount||0,D.totalAmount&&(0,Oe.jsxs)("span",{children:[" \u2022 Total: ",D.totalAmount]})]})]}),(0,Oe.jsx)("div",{className:"lua:text-gray-400 lua:ml-4",children:"\u2192"})]})},D.id)):c?(0,Oe.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Oe.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,Oe.jsx)(Oa,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,Oe.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No baskets found"}),(0,Oe.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Try a different search term"})]})}):(0,Oe.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,Oe.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,Oe.jsx)(ei,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,Oe.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No baskets yet"}),(0,Oe.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Create your first basket to get started"})]})})}),$>1&&(0,Oe.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:mt-4 lua:pt-4 lua:border-t lua:border-gray-200",children:[(0,Oe.jsxs)("div",{className:"lua:text-sm lua:text-gray-700",children:["Page ",H," of ",$]}),(0,Oe.jsxs)("div",{className:"lua:flex lua:gap-2",children:[(0,Oe.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.max(1,D-1)),disabled:H<=1||s,children:"\u2190"}),(0,Oe.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.min($,D+1)),disabled:H>=$||s,children:"\u2192"})]})]})]})})]})}});var vn,De,bf,V9=A(()=>{"use strict";vn=Z(Se());ir();jt();De=Z(ke()),bf=({apiKey:e,agentId:t,isProduction:n=!1,onHeaderChange:r})=>{let[a,i]=(0,vn.useState)([]),[s,u]=(0,vn.useState)(!0),[c,d]=(0,vn.useState)(""),[p,h]=(0,vn.useState)([]),[m,g]=(0,vn.useState)(null),[b,C]=(0,vn.useState)(!1),[S,v]=(0,vn.useState)(!1),[x,_]=(0,vn.useState)({}),[N,T]=(0,vn.useState)(null),[P,R]=(0,vn.useState)(null),[O,B]=(0,vn.useState)(!1),[z,V]=(0,vn.useState)(!1),[H,U]=(0,vn.useState)(1),[$,X]=(0,vn.useState)(1),[W,oe]=(0,vn.useState)(0);(0,vn.useEffect)(()=>{J()},[m,S,b,O,z,x]),(0,vn.useEffect)(()=>{K()},[e,t,H]);let J=()=>{if(!r)return;let D;m&&!b?D=(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(Ce,{variant:"secondary",onClick:I,disabled:z,title:"Edit order",startAdornment:(0,De.jsx)(Qo,{}),children:"Edit"}),(0,De.jsx)(Ce,{variant:"destructive",onClick:ze,disabled:z,title:"Delete order",startAdornment:(0,De.jsx)(Bn,{}),loading:z,children:"Delete"})]}):b||S?D=(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(Ce,{variant:"secondary",onClick:ye,disabled:O,title:"Cancel",startAdornment:(0,De.jsx)(qr,{}),children:"Cancel"}),(0,De.jsx)(Ce,{onClick:ne,disabled:O,title:S?"Create order":"Save changes",loading:O,children:S?"Create":"Save"})]}):D=(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(Ce,{onClick:Ee,title:"Create new order",startAdornment:(0,De.jsx)(Xt,{}),children:"Add Order"}),(0,De.jsx)(Xe,{variant:"tertiary",size:"small",onClick:K,title:"Refresh orders","aria-label":"Refresh orders",disabled:s,children:(0,De.jsx)(Hn,{size:18})})]}),r({title:"",actions:D})};(0,vn.useEffect)(()=>{if(c.trim()){let D=a.filter(te=>Object.values(te).some(ce=>String(ce).toLowerCase().includes(c.toLowerCase())));h(D)}else h(a)},[a,c]),(0,vn.useEffect)(()=>{if(N||P){let D=setTimeout(()=>{T(null),R(null)},5e3);return()=>clearTimeout(D)}},[N,P]);let K=async()=>{u(!0);try{let D=await Be.getOrders(e,t);D.success&&D.data?(i(D.data.data||[]),X(D.data.pagination?.totalPages||1),oe(D.data.pagination?.totalCount||0)):(console.error("Failed to load orders:",D.error),i([]),T("Failed to load orders"))}catch(D){console.error("Error loading orders:",D),i([]),T("Failed to load orders")}finally{u(!1)}},M=async()=>{if(!c.trim()){h(a);return}try{let D=await Be.searchOrders(e,t,c);D.success&&D.data?h(D.data.data||[]):T("Search failed")}catch(D){console.error("Search error:",D),T("Search failed")}},ve=D=>{g(D),_({...D}),C(!1)},Ee=()=>{g(null),_({basketId:"",data:{}}),v(!0),C(!0)},I=()=>{C(!0)},ne=async()=>{if(!x.basketId||!x.basketId.toString().trim()){T("Basket ID is required. Please fill in the basket ID field.");return}B(!0);try{let D;S?D=await Be.createOrder(e,t,x):D=await Be.updateOrderStatus(e,t,m.id,x.status||"pending"),D.success?(console.log("\u2705 Save successful"),R(S?"Order created successfully":"Order updated successfully"),C(!1),v(!1),g(D.data?.order||x),await K()):(console.error("\u274C Save failed:",D.error),T(`Failed to ${S?"create":"update"} order: ${D.error||"Unknown error"}`))}catch(D){console.error("\u274C Save error:",D),T(`Failed to ${S?"create":"update"} order: ${D.message||"Unknown error"}`)}finally{B(!1)}},ze=async()=>{if(!(!m||!m.id)&&confirm(`Are you sure you want to delete "${m.name||m.id}"?`)){V(!0);try{(await Be.deleteOrder(e,t,m.id)).success?(R("Order deleted successfully"),g(null),await K()):T("Failed to delete order")}catch(D){console.error("Delete error:",D),T("Failed to delete order")}finally{V(!1)}}},ye=()=>{C(!1),v(!1),m?_({...m}):g(null)},fe=()=>{g(null),C(!1),v(!1)},de=(D,te)=>{_(ce=>({...ce,[D]:te}))},he=()=>{let D=["basketId","status","data"],te=new Set([...D,...Object.keys(x)]);return(0,De.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,De.jsxs)(Ke,{className:"lua:space-y-4",children:[Array.from(te).map(ce=>(0,De.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,De.jsx)("label",{htmlFor:`order-${ce}`,className:"lua:text-sm lua:font-medium lua:text-gray-700",children:ce}),(0,De.jsx)(Pt,{id:`order-${ce}`,type:ce==="price"?"number":"text",value:x[ce]||"",onChange:ge=>de(ce,ge.target.value),placeholder:`Enter ${ce}...`,disabled:O,required:ce==="basketId",className:"lua:w-full"})]},ce)),(0,De.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,De.jsx)("label",{htmlFor:"add-field",className:"lua:text-sm lua:font-medium lua:text-gray-700",children:"Add Custom Field"}),(0,De.jsxs)("div",{className:"lua:flex lua:items-center lua:gap-2",children:[(0,De.jsx)(Pt,{id:"add-field-key",type:"text",placeholder:"Field name",onKeyPress:ce=>{if(ce.key==="Enter"){let ge=ce.target.value.trim();ge&&!x.hasOwnProperty(ge)&&(de(ge,""),ce.target.value="")}},className:"lua:flex-1"}),(0,De.jsx)("span",{className:"lua:text-xs lua:text-gray-500",children:"Press Enter to add"})]})]})]})})},Ne=()=>S?he():m?b?he():(0,De.jsx)(Ae,{className:"lua:p-6 lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,De.jsx)(Ke,{className:"lua:space-y-4",children:Object.entries(m).map(([D,te])=>(0,De.jsxs)("div",{className:"lua:flex lua:flex-col lua:gap-1",children:[(0,De.jsx)("div",{className:"lua:text-sm lua:font-medium lua:text-gray-700",children:D}),(0,De.jsx)("div",{className:"lua:text-sm lua:text-gray-900 lua:bg-gray-50 lua:p-2 lua:rounded lua:border lua:whitespace-pre-wrap",children:typeof te=="object"?JSON.stringify(te,null,2):String(te)})]},D))})}):null;return s&&a.length===0?(0,De.jsx)("div",{className:"lua:flex lua:flex-1 lua:bg-white lua:overflow-hidden lua:h-full",children:(0,De.jsx)("div",{className:"lua:flex lua:flex-col lua:items-center lua:justify-center lua:h-full lua:w-full lua:gap-4 lua:min-h-full",children:(0,De.jsx)(pt,{className:"lua:h-8 lua:w-8 lua:animate-spin"})})}):(0,De.jsxs)("div",{className:"lua:flex lua:flex-col lua:h-full lua:bg-gray-50",children:[N&&(0,De.jsx)("div",{className:"lua:bg-red-50 lua:border lua:border-red-200 lua:text-red-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:N}),P&&(0,De.jsx)("div",{className:"lua:bg-green-50 lua:border lua:border-green-200 lua:text-green-700 lua:px-4 lua:py-3 lua:rounded lua:mb-4 lua:mx-4 lua:mt-4",children:P}),(0,De.jsx)("div",{className:"lua:flex-1 lua:overflow-hidden lua:p-4",children:m||S?Ne():(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)("div",{className:"lua:mb-4",children:(0,De.jsx)("div",{className:"lua:max-w-md",children:(0,De.jsx)(Pt,{type:"text",placeholder:"Search orders...",value:c,onChange:D=>d(D.target.value),className:"lua:w-full",startAdornment:(0,De.jsx)(Oa,{onClick:M})})})}),(0,De.jsx)("div",{className:"lua:space-y-2 lua:flex-1 lua:overflow-y-auto",children:p.length>0?p.map(D=>(0,De.jsx)(Ae,{className:"lua:cursor-pointer lua:hover:shadow-md lua:transition-shadow lua:border lua:border-gray-200 lua:rounded-lg lua:p-4",onClick:()=>ve(D),children:(0,De.jsxs)(Ke,{className:"lua:flex lua:items-center lua:justify-between",children:[(0,De.jsxs)("div",{className:"lua:flex-1 lua:min-w-0",children:[(0,De.jsx)("div",{className:"lua:text-lg lua:font-semibold lua:text-gray-900 lua:truncate",children:D.name||D.id}),(0,De.jsx)("div",{className:"lua:text-sm lua:text-gray-600 lua:truncate",children:D.description||"No description"}),(0,De.jsxs)("div",{className:"lua:text-xs lua:text-gray-500 lua:mt-1",children:["ID: ",D.id,D.price&&(0,De.jsxs)("span",{children:[" \u2022 Price: ",D.price]})]})]}),(0,De.jsx)("div",{className:"lua:text-gray-400 lua:ml-4",children:"\u2192"})]})},D.id)):c?(0,De.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,De.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,De.jsx)(Oa,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,De.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No orders found"}),(0,De.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Try a different search term"})]})}):(0,De.jsx)(Ae,{className:"lua:p-8 lua:text-center lua:bg-white lua:rounded-lg lua:border lua:border-gray-200",children:(0,De.jsxs)(Ke,{className:"lua:flex lua:flex-col lua:items-center lua:gap-3",children:[(0,De.jsx)(ei,{className:"lua:h-12 lua:w-12 lua:text-gray-400"}),(0,De.jsx)("div",{className:"lua:text-lg lua:font-medium lua:text-gray-900",children:"No orders yet"}),(0,De.jsx)("div",{className:"lua:text-sm lua:text-gray-500",children:"Create your first order to get started"})]})})}),$>1&&(0,De.jsxs)("div",{className:"lua:flex lua:items-center lua:justify-between lua:mt-4 lua:pt-4 lua:border-t lua:border-gray-200",children:[(0,De.jsxs)("div",{className:"lua:text-sm lua:text-gray-700",children:["Page ",H," of ",$]}),(0,De.jsxs)("div",{className:"lua:flex lua:gap-2",children:[(0,De.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.max(1,D-1)),disabled:H<=1||s,children:"\u2190"}),(0,De.jsx)(Ce,{variant:"secondary",size:"small",onClick:()=>U(D=>Math.min($,D+1)),disabled:H>=$||s,children:"\u2192"})]})]})]})})]})}});var yr,Pe,_f,z9=A(()=>{"use strict";yr=Z(Se());jt();Pe=Z(ke()),_f=({apiKey:e,agentId:t,isProduction:n=!1,onHeaderChange:r})=>{let[a,i]=(0,yr.useState)([]),[s,u]=(0,yr.useState)(!1),[c,d]=(0,yr.useState)(null),[p,h]=(0,yr.useState)(!1),[m,g]=(0,yr.useState)(!1),[b,C]=(0,yr.useState)({collection:"",data:"{}",searchText:""}),[S,v]=(0,yr.useState)(null),[x,_]=(0,yr.useState)(null),[N,T]=(0,yr.useState)(!1),[P,R]=(0,yr.useState)(!1),[O,B]=(0,yr.useState)(""),[z,V]=(0,yr.useState)(""),[H,U]=(0,yr.useState)(!1);(0,yr.useEffect)(()=>{$()},[c,m,p,N,P,b]);let $=()=>{if(!r)return;let ne;c&&!p?ne=(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsx)(Ce,{variant:"outline",onClick:W,disabled:P,className:"lua:mr-2",children:"\u270F\uFE0F Edit"})}):p||m?ne=(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ce,{variant:"secondary",onClick:J,loading:N,children:"Cancel"}),(0,Pe.jsx)(Ce,{onClick:oe,disabled:N,children:m?"Create":"Save"})]}):ne=(0,Pe.jsx)(Pe.Fragment,{children:(0,Pe.jsx)(Ce,{onClick:X,startAdornment:(0,Pe.jsx)(Xt,{}),children:"Add entry"})}),r({title:"",actions:ne})},X=()=>{d(null),C({collection:"",data:`{
103
103
  "title": "",