(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))f(h);new MutationObserver(h=>{for(const m of h)if(m.type==="childList")for(const _ of m.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&f(_)}).observe(document,{childList:!0,subtree:!0});function a(h){const m={};return h.integrity&&(m.integrity=h.integrity),h.referrerPolicy&&(m.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?m.credentials="include":h.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function f(h){if(h.ep)return;h.ep=!0;const m=a(h);fetch(h.href,m)}})();const Ci="eintervention_public_token",Fe="eintervention_public_client";function Qn(){return localStorage.getItem(Ci)||""}function to(r,c){localStorage.setItem(Ci,r),c&&localStorage.setItem(Fe,JSON.stringify(c))}function Es(){try{return JSON.parse(localStorage.getItem(Fe)||"null")}catch{return null}}function Ms(r){localStorage.setItem(Fe,JSON.stringify(r))}function zs(){localStorage.removeItem(Ci),localStorage.removeItem(Fe)}/*! Capacitor: https://capacitorjs.com/ - MIT License */const As=r=>{const c=new Map;c.set("web",{name:"web"});const a=r.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:c},f=(m,_)=>{a.platforms.set(m,_)},h=m=>{a.platforms.has(m)&&(a.currentPlatform=a.platforms.get(m))};return a.addPlatform=f,a.setPlatform=h,a},Os=r=>r.CapacitorPlatforms=As(r),eo=Os(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});eo.addPlatform;eo.setPlatform;var Qt;(function(r){r.Unimplemented="UNIMPLEMENTED",r.Unavailable="UNAVAILABLE"})(Qt||(Qt={}));class Pi extends Error{constructor(c,a,f){super(c),this.message=c,this.code=a,this.data=f}}const Is=r=>{var c,a;return r!=null&&r.androidBridge?"android":!((a=(c=r==null?void 0:r.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},Bs=r=>{var c,a,f,h,m;const _=r.CapacitorCustomPlatform||null,p=r.Capacitor||{},g=p.Plugins=p.Plugins||{},y=r.CapacitorPlatforms,b=()=>_!==null?_.name:Is(r),P=((c=y==null?void 0:y.currentPlatform)===null||c===void 0?void 0:c.getPlatform)||b,S=()=>P()!=="web",U=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.isNativePlatform)||S,tt=q=>{const V=At.get(q);return!!(V!=null&&V.platforms.has(P())||ot(q))},E=((f=y==null?void 0:y.currentPlatform)===null||f===void 0?void 0:f.isPluginAvailable)||tt,_t=q=>{var V;return(V=p.PluginHeaders)===null||V===void 0?void 0:V.find(vt=>vt.name===q)},ot=((h=y==null?void 0:y.currentPlatform)===null||h===void 0?void 0:h.getPluginHeader)||_t,zt=q=>r.console.error(q),lt=(q,V,vt)=>Promise.reject(`${vt} does not have an implementation of "${V}".`),At=new Map,qt=(q,V={})=>{const vt=At.get(q);if(vt)return console.warn(`Capacitor plugin "${q}" already registered. Cannot register plugins twice.`),vt.proxy;const gt=P(),K=ot(q);let G;const He=async()=>(!G&> in V?G=typeof V[gt]=="function"?G=await V[gt]():G=V[gt]:_!==null&&!G&&"web"in V&&(G=typeof V.web=="function"?G=await V.web():G=V.web),G),ft=(x,I)=>{var H,W;if(K){const R=K==null?void 0:K.methods.find(z=>I===z.name);if(R)return R.rtype==="promise"?z=>p.nativePromise(q,I.toString(),z):(z,O)=>p.nativeCallback(q,I.toString(),z,O);if(x)return(H=x[I])===null||H===void 0?void 0:H.bind(x)}else{if(x)return(W=x[I])===null||W===void 0?void 0:W.bind(x);throw new Pi(`"${q}" plugin is not implemented on ${gt}`,Qt.Unimplemented)}},ee=x=>{let I;const H=(...W)=>{const R=He().then(z=>{const O=ft(z,x);if(O){const rt=O(...W);return I=rt==null?void 0:rt.remove,rt}else throw new Pi(`"${q}.${x}()" is not implemented on ${gt}`,Qt.Unimplemented)});return x==="addListener"&&(R.remove=async()=>I()),R};return H.toString=()=>`${x.toString()}() { [capacitor code] }`,Object.defineProperty(H,"name",{value:x,writable:!1,configurable:!1}),H},nt=ee("addListener"),Ct=ee("removeListener"),k=(x,I)=>{const H=nt({eventName:x},I),W=async()=>{const z=await H;Ct({eventName:x,callbackId:z},I)},R=new Promise(z=>H.then(()=>z({remove:W})));return R.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await W()},R},Wt=new Proxy({},{get(x,I){switch(I){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return K?k:nt;case"removeListener":return Ct;default:return ee(I)}}});return g[q]=Wt,At.set(q,{name:q,proxy:Wt,platforms:new Set([...Object.keys(V),...K?[gt]:[]])}),Wt},te=((m=y==null?void 0:y.currentPlatform)===null||m===void 0?void 0:m.registerPlugin)||qt;return p.convertFileSrc||(p.convertFileSrc=q=>q),p.getPlatform=P,p.handleError=zt,p.isNativePlatform=U,p.isPluginAvailable=E,p.pluginMethodNoop=lt,p.registerPlugin=te,p.Exception=Pi,p.DEBUG=!!p.DEBUG,p.isLoggingEnabled=!!p.isLoggingEnabled,p.platform=p.getPlatform(),p.isNative=p.isNativePlatform(),p},Zs=r=>r.Capacitor=Bs(r),Q=Zs(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ki=Q.registerPlugin;Q.Plugins;class io{constructor(c){this.listeners={},this.retainedEventArguments={},this.windowListeners={},c&&(console.warn(`Capacitor WebPlugin "${c.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=c)}addListener(c,a){let f=!1;this.listeners[c]||(this.listeners[c]=[],f=!0),this.listeners[c].push(a);const m=this.windowListeners[c];m&&!m.registered&&this.addWindowListener(m),f&&this.sendRetainedArgumentsForEvent(c);const _=async()=>this.removeListener(c,a);return Promise.resolve({remove:_})}async removeAllListeners(){this.listeners={};for(const c in this.windowListeners)this.removeWindowListener(this.windowListeners[c]);this.windowListeners={}}notifyListeners(c,a,f){const h=this.listeners[c];if(!h){if(f){let m=this.retainedEventArguments[c];m||(m=[]),m.push(a),this.retainedEventArguments[c]=m}return}h.forEach(m=>m(a))}hasListeners(c){return!!this.listeners[c].length}registerWindowListener(c,a){this.windowListeners[a]={registered:!1,windowEventName:c,pluginEventName:a,handler:f=>{this.notifyListeners(a,f)}}}unimplemented(c="not implemented"){return new Q.Exception(c,Qt.Unimplemented)}unavailable(c="not available"){return new Q.Exception(c,Qt.Unavailable)}async removeListener(c,a){const f=this.listeners[c];if(!f)return;const h=f.indexOf(a);this.listeners[c].splice(h,1),this.listeners[c].length||this.removeWindowListener(this.windowListeners[c])}addWindowListener(c){window.addEventListener(c.windowEventName,c.handler),c.registered=!0}removeWindowListener(c){c&&(window.removeEventListener(c.windowEventName,c.handler),c.registered=!1)}sendRetainedArgumentsForEvent(c){const a=this.retainedEventArguments[c];a&&(delete this.retainedEventArguments[c],a.forEach(f=>{this.notifyListeners(c,f)}))}}const Fn=r=>encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Hn=r=>r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Ns extends io{async getCookies(){const c=document.cookie,a={};return c.split(";").forEach(f=>{if(f.length<=0)return;let[h,m]=f.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");h=Hn(h).trim(),m=Hn(m).trim(),a[h]=m}),a}async setCookie(c){try{const a=Fn(c.key),f=Fn(c.value),h=`; expires=${(c.expires||"").replace("expires=","")}`,m=(c.path||"/").replace("path=",""),_=c.url!=null&&c.url.length>0?`domain=${c.url}`:"";document.cookie=`${a}=${f||""}${h}; path=${m}; ${_};`}catch(a){return Promise.reject(a)}}async deleteCookie(c){try{document.cookie=`${c.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const c=document.cookie.split(";")||[];for(const a of c)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(c){return Promise.reject(c)}}async clearAllCookies(){try{await this.clearCookies()}catch(c){return Promise.reject(c)}}}ki("CapacitorCookies",{web:()=>new Ns});const Rs=async r=>new Promise((c,a)=>{const f=new FileReader;f.onload=()=>{const h=f.result;c(h.indexOf(",")>=0?h.split(",")[1]:h)},f.onerror=h=>a(h),f.readAsDataURL(r)}),Ds=(r={})=>{const c=Object.keys(r);return Object.keys(r).map(h=>h.toLocaleLowerCase()).reduce((h,m,_)=>(h[m]=r[c[_]],h),{})},Fs=(r,c=!0)=>r?Object.entries(r).reduce((f,h)=>{const[m,_]=h;let p,g;return Array.isArray(_)?(g="",_.forEach(y=>{p=c?encodeURIComponent(y):y,g+=`${m}=${p}&`}),g.slice(0,-1)):(p=c?encodeURIComponent(_):_,g=`${m}=${p}`),`${f}&${g}`},"").substr(1):null,Hs=(r,c={})=>{const a=Object.assign({method:r.method||"GET",headers:r.headers},c),h=Ds(r.headers)["content-type"]||"";if(typeof r.data=="string")a.body=r.data;else if(h.includes("application/x-www-form-urlencoded")){const m=new URLSearchParams;for(const[_,p]of Object.entries(r.data||{}))m.set(_,p);a.body=m.toString()}else if(h.includes("multipart/form-data")||r.data instanceof FormData){const m=new FormData;if(r.data instanceof FormData)r.data.forEach((p,g)=>{m.append(g,p)});else for(const p of Object.keys(r.data))m.append(p,r.data[p]);a.body=m;const _=new Headers(a.headers);_.delete("content-type"),a.headers=_}else(h.includes("application/json")||typeof r.data=="object")&&(a.body=JSON.stringify(r.data));return a};class qs extends io{async request(c){const a=Hs(c,c.webFetchExtra),f=Fs(c.params,c.shouldEncodeUrlParams),h=f?`${c.url}?${f}`:c.url,m=await fetch(h,a),_=m.headers.get("content-type")||"";let{responseType:p="text"}=m.ok?c:{};_.includes("application/json")&&(p="json");let g,y;switch(p){case"arraybuffer":case"blob":y=await m.blob(),g=await Rs(y);break;case"json":g=await m.json();break;case"document":case"text":default:g=await m.text()}const b={};return m.headers.forEach((P,S)=>{b[S]=P}),{data:g,headers:b,status:m.status,url:m.url}}async get(c){return this.request(Object.assign(Object.assign({},c),{method:"GET"}))}async post(c){return this.request(Object.assign(Object.assign({},c),{method:"POST"}))}async put(c){return this.request(Object.assign(Object.assign({},c),{method:"PUT"}))}async patch(c){return this.request(Object.assign(Object.assign({},c),{method:"PATCH"}))}async delete(c){return this.request(Object.assign(Object.assign({},c),{method:"DELETE"}))}}const Ws=ki("CapacitorHttp",{web:()=>new qs}),qn="eintervention_api_base",Wn="https://maintenance-back.insuite-ci.com/public/index.php".replace(/\/$/,""),js=new Set(["http://192.168.1.103/Insuite_backbones/public","http://192.168.1.79/Insuite_backbones/public","https://maintenance-back.insuite-ci.com/public"]);function Us(){const r=String(localStorage.getItem(qn)||"").trim().replace(/\/$/,"");return!r||js.has(r)?(localStorage.setItem(qn,Wn),Wn):r}function jn(r){return r.startsWith("http")?r:Us()+r}function Vs(){if(typeof(Q==null?void 0:Q.isNativePlatform)=="function")return Q.isNativePlatform();const r=typeof(Q==null?void 0:Q.getPlatform)=="function"?Q.getPlatform():"web";return r==="android"||r==="ios"}function Gs(r,c){var h;const a=Object.entries(c||{}),f=String(((h=a.find(([m])=>m.toLowerCase()==="content-type"))==null?void 0:h[1])||"");if(typeof r=="string"&&f.includes("application/json"))try{return JSON.parse(r)}catch{return null}return r}async function ct(r,c,a,f={}){const h={...f},m=Qn();if(m&&(h.Authorization=`Bearer ${m}`),Vs()&&!(a instanceof FormData)){let y=a;a instanceof URLSearchParams&&(y=a.toString());const b=await Ws.request({url:jn(c),method:r,headers:h,data:y}),P=Gs(b.data,b.headers);if(b.status<200||b.status>=300){const S=new Error("http_error");throw S.status=b.status,S.data=P,S}return P}const _=await fetch(jn(c),{method:r,headers:h,body:a}),g=(_.headers.get("content-type")||"").includes("application/json")?await _.json().catch(()=>null):await _.text().catch(()=>null);if(!_.ok){const y=new Error("http_error");throw y.status=_.status,y.data=g,y}return g}async function $s(r){const c=new URLSearchParams;return Object.entries(r||{}).forEach(([a,f])=>c.set(a,String(f??""))),ct("POST","/api/public/mobile/register",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function Ks(r){const c=new URLSearchParams;return Object.entries(r||{}).forEach(([a,f])=>c.set(a,String(f??""))),ct("POST","/api/public/mobile/login",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function Xs(r){const c=new URLSearchParams;return Object.entries(r||{}).forEach(([a,f])=>c.set(a,String(f??""))),ct("POST","/api/public/mobile/password/forgot",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function Ys(r){const c=new URLSearchParams;return Object.entries(r||{}).forEach(([a,f])=>c.set(a,String(f??""))),ct("POST","/api/public/mobile/password/reset",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function Js(){const r=await ct("GET","/api/public/mobile/me",void 0,{Accept:"application/json"});return r!=null&&r.ok&&r.client&&Ms(r.client),r}function Qs(r,c){const a=new FormData;return Object.entries(r||{}).forEach(([f,h])=>{a.set(f,String(h??""))}),(c||[]).forEach(f=>{f!=null&&f.file&&(a.append("photos[]",f.file),a.append("photo_comments[]",f.comment||""))}),a}async function tr(r){return ct("POST","/api/public/mobile/incidents/create",r,{Accept:"application/json"})}async function er(){return ct("GET","/api/public/mobile/incidents",void 0,{Accept:"application/json"})}async function ir(r){return ct("GET",`/api/public/mobile/incidents/detail?id=${encodeURIComponent(String(r||""))}`,void 0,{Accept:"application/json"})}async function nr(r){const c=new URLSearchParams;return Object.entries(r||{}).forEach(([a,f])=>c.set(a,String(f??""))),ct("POST","/api/public/mobile/incidents/remind",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function or(){return ct("GET","/api/public/mobile/notifications",void 0,{Accept:"application/json"})}async function sr(){return ct("GET","/api/public/mobile/notifications/unread-count",void 0,{Accept:"application/json"})}async function Un(r){const c=new URLSearchParams;return c.set("notification_id",String(r||"")),ct("POST","/api/public/mobile/notifications/read",c,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function rr(){return ct("POST","/api/public/mobile/notifications/read-all",new URLSearchParams,{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"})}async function ar(r,c){r.innerHTML=`
e-Intervention
Connexion client

Accéder à mon espace

Consultez vos déclarations, suivez la prise en charge et échangez avec le service intervention depuis votre espace client.

Vous n'avez pas encore de compte ? Créer un compte
`;const a=r.querySelector("#loginForm"),f=r.querySelector("#errorBox"),h=r.querySelector("#successBox");a.addEventListener("submit",async m=>{m.preventDefault(),f.hidden=!0,h.hidden=!0;const _=Object.fromEntries(new FormData(a).entries());try{const p=await Ks(_);if(!(p!=null&&p.ok)||!(p!=null&&p.token))throw new Error("login_failed");to(p.token,p.client),h.hidden=!1,h.textContent="Connexion établie.",c()}catch(p){f.hidden=!1,f.textContent=p!=null&&p.status?"Compte introuvable ou mot de passe invalide.":"Connexion impossible pour le moment. Vérifiez votre connexion réseau puis réessayez."}})}async function lr(r,c){r.innerHTML=`
e-Intervention
Mot de passe oublié

Réinitialiser l'accès client

Demandez un code de réinitialisation à partir de votre contact client ou de votre email, puis définissez un nouveau mot de passe.

Vous vous souvenez de votre mot de passe ? Retour à la connexion
`;const a=r.querySelector("#requestForm"),f=r.querySelector("#resetForm"),h=r.querySelector("#errorBox"),m=r.querySelector("#successBox");a.addEventListener("submit",async _=>{var g;_.preventDefault(),h.hidden=!0,m.hidden=!0;const p=String(new FormData(a).get("login")||"").trim();try{const y=await Xs({login:p});m.hidden=!1,m.textContent=y!=null&&y.masked_email?`Un code a été envoyé à ${y.masked_email}.`:"Un code de réinitialisation a été envoyé à votre adresse email.",f.hidden=!1,f.elements.login.value=p,f.scrollIntoView({behavior:"smooth",block:"nearest"})}catch(y){h.hidden=!1;const b=((g=y==null?void 0:y.data)==null?void 0:g.error)||"";b==="missing_reset_email"?h.textContent="Aucune adresse email n’est associée à ce compte. Contactez le support pour réinitialiser votre accès.":b==="account_not_found"?h.textContent="Aucun compte client actif ne correspond à cet identifiant.":h.textContent="Impossible d’envoyer le code de réinitialisation pour le moment."}}),f.addEventListener("submit",async _=>{var g;_.preventDefault(),h.hidden=!0,m.hidden=!0;const p=Object.fromEntries(new FormData(f).entries());try{await Ys(p),m.hidden=!1,m.textContent="Votre mot de passe a été réinitialisé. Vous pouvez maintenant vous connecter.",window.setTimeout(()=>c(),900)}catch(y){h.hidden=!1;const b=((g=y==null?void 0:y.data)==null?void 0:g.error)||"";b==="invalid_reset_code"?h.textContent="Le code saisi est invalide.":b==="reset_code_expired"?h.textContent="Le code de réinitialisation a expiré. Demandez-en un nouveau.":b==="weak_password"?h.textContent="Le nouveau mot de passe doit contenir au moins 6 caractères.":h.textContent="Impossible de réinitialiser le mot de passe pour le moment."}})}function cr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var _e={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */var ur=_e.exports,Vn;function hr(){return Vn||(Vn=1,(function(r,c){(function(a,f){f(c)})(ur,(function(a){var f="1.9.4";function h(t){var e,i,n,o;for(i=1,n=arguments.length;i"u"||!L||!L.Mixin)){t=lt(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(x(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(x(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Wt(this.x),this.y=Wt(this.y),this},distanceTo:function(t){t=x(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=x(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=x(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+S(this.x)+", "+S(this.y)+")"}};function x(t,e,i){return t instanceof k?t:lt(t)?new k(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function I(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=H(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,l=o.y>=e.y&&n.y<=i.y;return s&&l},overlaps:function(t){t=H(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,l=o.lng>=e.lng&&n.lng<=i.lng;return s&&l},overlaps:function(t){t=R(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,go=(function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",P,e),window.removeEventListener("testPassiveEventSupport",P,e)}catch{}return t})(),yo=(function(){return!!document.createElement("canvas").getContext})(),Ke=!!(document.createElementNS&&Mi("svg").createSVGRect),bo=!!Ke&&(function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),wo=!Ke&&(function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}})(),Po=navigator.platform.indexOf("Mac")===0,xo=navigator.platform.indexOf("Linux")===0;function yt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var T={ie:ye,ielt9:so,edge:Ai,webkit:Ve,android:Oi,android23:Ii,androidStock:ao,opera:Ge,chrome:Bi,gecko:Zi,safari:lo,phantom:Ni,opera12:Ri,win:co,ie3d:Di,webkit3d:$e,gecko3d:Fi,any3d:uo,mobile:ne,mobileWebkit:ho,mobileWebkit3d:fo,msPointer:Hi,pointer:qi,touch:po,touchNative:Wi,mobileOpera:mo,mobileGecko:_o,retina:vo,passiveEvents:go,canvas:yo,svg:Ke,vml:wo,inlineSvg:bo,mac:Po,linux:xo},ji=T.msPointer?"MSPointerDown":"pointerdown",Ui=T.msPointer?"MSPointerMove":"pointermove",Vi=T.msPointer?"MSPointerUp":"pointerup",Gi=T.msPointer?"MSPointerCancel":"pointercancel",Xe={touchstart:ji,touchmove:Ui,touchend:Vi,touchcancel:Gi},$i={touchstart:Eo,touchmove:be,touchend:be,touchcancel:be},jt={},Ki=!1;function Lo(t,e,i){return e==="touchstart"&&ko(),$i[e]?(i=$i[e].bind(this,i),t.addEventListener(Xe[e],i,!1),i):(console.warn("wrong event specified:",e),P)}function To(t,e,i){if(!Xe[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(Xe[e],i,!1)}function So(t){jt[t.pointerId]=t}function Co(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function Xi(t){delete jt[t.pointerId]}function ko(){Ki||(document.addEventListener(ji,So,!0),document.addEventListener(Ui,Co,!0),document.addEventListener(Vi,Xi,!0),document.addEventListener(Gi,Xi,!0),Ki=!0)}function be(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in jt)e.touches.push(jt[i]);e.changedTouches=[e],t(e)}}function Eo(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&it(e),be(t,e)}function Mo(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var zo=200;function Ao(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(s){if(s.detail!==1){n=s.detail;return}if(!(s.pointerType==="mouse"||s.sourceCapabilities&&!s.sourceCapabilities.firesTouchEvents)){var l=en(s);if(!(l.some(function(d){return d instanceof HTMLLabelElement&&d.attributes.for})&&!l.some(function(d){return d instanceof HTMLInputElement||d instanceof HTMLSelectElement}))){var u=Date.now();u-i<=zo?(n++,n===2&&e(Mo(s))):n=1,i=u}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function Oo(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var Ye=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),oe=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yi=oe==="webkitTransition"||oe==="OTransition"?oe+"End":"transitionend";function Ji(t){return typeof t=="string"?document.getElementById(t):t}function se(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function N(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function j(t){var e=t.parentNode;e&&e.removeChild(t)}function we(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ut(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Vt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Je(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=Pe(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function A(t,e){if(t.classList!==void 0)for(var i=tt(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function on(t){return T.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Zo:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function ui(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var No={__proto__:null,on:M,off:F,stopPropagation:Bt,disableScrollPropagation:ci,disableClickPropagation:ce,preventDefault:it,stop:Zt,getPropagationPath:en,getMousePosition:nn,getWheelDelta:on,isExternalTarget:ui,addListener:M,removeListener:F},sn=Ct.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=It(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=K(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,R(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=x(e.paddingTopLeft||e.padding||[0,0]),n=x(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),l=this.getPixelBounds(),u=H([l.min.add(i),l.max.subtract(n)]),d=u.getSize();if(!u.contains(s)){this._enforcingBounds=!0;var v=s.subtract(u.getCenter()),w=u.extend(s).getSize().subtract(d);o.x+=v.x<0?-w.x:w.x,o.y+=v.y<0?-w.y:w.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=h({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return!s.x&&!s.y?this:(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(_(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=h({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=_(this._handleGeolocationResponse,this),i=_(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new z(e,i),o=n.toBounds(t.coords.accuracy*2),s=this._locateOptions;if(s.setView){var l=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(l,s.maxZoom):l)}var u={latlng:n,bounds:o,timestamp:t.timestamp};for(var d in t.coords)typeof t.coords[d]=="number"&&(u[d]=t.coords[d]);this.fire("locationfound",u)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.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(),j(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(G(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)j(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=N("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new W(e,i)},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(t,e,i){t=R(t),i=x(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),l=t.getNorthWest(),u=t.getSouthEast(),d=this.getSize().subtract(i),v=H(this.project(u,n),this.project(l,n)).getSize(),w=T.any3d?this.options.zoomSnap:1,C=d.x/v.x,B=d.y/v.y,st=e?Math.max(C,B):Math.min(C,B);return n=this.getScaleZoom(st,n),w&&(n=Math.round(n/(w/100))*(w/100),n=e?Math.ceil(n/w)*w:Math.floor(n/w)*w),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new I(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(O(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(x(t),e)},layerPointToLatLng:function(t){var e=x(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(O(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(O(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,e){return this.options.crs.distance(O(t),O(e))},containerPointToLayerPoint:function(t){return x(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return x(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(x(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(O(t)))},mouseEventToContainerPoint:function(t){return nn(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=Ji(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");M(e,"scroll",this._onScroll,this),this._containerId=g(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&T.any3d,A(t,"leaflet-container"+(T.touch?" leaflet-touch":"")+(T.retina?" leaflet-retina":"")+(T.ielt9?" leaflet-oldie":"")+(T.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=se(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Y(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(A(t.markerPane,"leaflet-zoom-hide"),A(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Y(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return G(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Y(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[g(this._container)]=this;var e=t?F:M;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),T.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){G(this._resizeRequest),this._resizeRequest=K(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",s=t.target||t.srcElement,l=!1;s;){if(n=this._targets[g(s)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){l=!0;break}if(n&&n.listens(e,!0)&&(o&&!ui(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!l&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&oi(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=h({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],l=0;l0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=T.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){X(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=N("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=Ye,n=this._proxy.style[i];Ot(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){j(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ot(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(K(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,A(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(_(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&X(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 Ro(t,e){return new Z(t,e)}var pt=ft.extend({options:{position:"topright"},initialize:function(t){E(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return A(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(j(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ue=function(t){return new pt(t)};Z.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=N("div",e+"control-container",this._container);function n(o,s){var l=e+o+" "+e+s;t[o+s]=N("div",l,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)j(this._controlCorners[t]);j(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var rn=pt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(g(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+g(this),i),this._layerControlInputs.push(n),n.layerId=g(t.layer),M(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");e.appendChild(s),s.appendChild(n),s.appendChild(o);var l=t.overlay?this._overlaysList:this._baseLayersList;return l.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,i,n=[],o=[];this._handlingClick=!0;for(var s=t.length-1;s>=0;s--)e=t[s],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(s=0;s=0;o--)e=t[o],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,M(t,"click",it),this.expand();var e=this;setTimeout(function(){F(t,"click",it),e._preventClick=!1})}}),Do=function(t,e,i){return new rn(t,e,i)},hi=pt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=N("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=N("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),ce(s),M(s,"click",Zt),M(s,"click",o,this),M(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";X(this._zoomInButton,e),X(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(A(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(A(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Z.mergeOptions({zoomControl:!0}),Z.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new hi,this.addControl(this.zoomControl))});var Fo=function(t){return new hi(t)},an=pt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=N("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=N("div",e,i)),t.imperial&&(this._iScale=N("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,o;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),Ho=function(t){return new an(t)},qo='',di=pt.extend({options:{position:"bottomright",prefix:''+(T.inlineSvg?qo+" ":"")+"Leaflet"},initialize:function(t){E(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=N("div","leaflet-control-attribution"),ce(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});Z.mergeOptions({attributionControl:!0}),Z.addInitHook(function(){this.options.attributionControl&&new di().addTo(this)});var Wo=function(t){return new di(t)};pt.Layers=rn,pt.Zoom=hi,pt.Scale=an,pt.Attribution=di,ue.layers=Do,ue.zoom=Fo,ue.scale=Ho,ue.attribution=Wo;var wt=ft.extend({initialize:function(t){this._map=t},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}});wt.addTo=function(t,e){return t.addHandler(e,this),this};var jo={Events:nt},ln=T.touch?"touchstart mousedown":"mousedown",Et=Ct.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){E(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(M(this._dragStartTarget,ln,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Et._dragging===this&&this.finishDrag(!0),F(this._dragStartTarget,ln,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Je(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Et._dragging===this&&this.finishDrag();return}if(!(Et._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Et._dragging=this,this._preventOutline&&oi(this._element),ei(),re(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Qi(this._element);this._startPoint=new k(e.clientX,e.clientY),this._startPos=It(this._element),this._parentScale=si(i);var n=t.type==="mousedown";M(document,n?"mousemove":"touchmove",this._onMove,this),M(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new k(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)s&&(l=u,s=d);s>i&&(e[l]=1,pi(t,e,i,n,l),pi(t,e,i,l,o))}function $o(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function Ko(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function he(t,e,i,n){var o=e.x,s=e.y,l=i.x-o,u=i.y-s,d=l*l+u*u,v;return d>0&&(v=((t.x-o)*l+(t.y-s)*u)/d,v>1?(o=i.x,s=i.y):v>0&&(o+=l*v,s+=u*v)),l=t.x-o,u=t.y-s,n?l*l+u*u:new k(o,s)}function ht(t){return!lt(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function mn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ht(t)}function _n(t,e){var i,n,o,s,l,u,d,v;if(!t||t.length===0)throw new Error("latlngs not passed");ht(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var w=O([0,0]),C=R(t),B=C.getNorthWest().distanceTo(C.getSouthWest())*C.getNorthEast().distanceTo(C.getNorthWest());B<1700&&(w=fi(t));var st=t.length,et=[];for(i=0;in){d=(s-n)/o,v=[u.x-d*(u.x-l.x),u.y-d*(u.y-l.y)];break}var at=e.unproject(x(v));return O([at.lat+w.lat,at.lng+w.lng])}var Xo={__proto__:null,simplify:hn,pointToSegmentDistance:dn,closestPointOnSegment:Vo,clipSegment:pn,_getEdgeIntersection:Se,_getBitCode:Nt,_sqClosestPointOnSegment:he,isFlat:ht,_flat:mn,polylineCenter:_n},mi={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new z(t.y,t.x)},bounds:new I([-180,-90],[180,90])},_i={R:6378137,R_MINOR:6356752314245179e-9,bounds:new I([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),l=s*Math.sin(n),u=Math.tan(Math.PI/4-n/2)/Math.pow((1-l)/(1+l),s/2);return n=-i*Math.log(Math.max(u,1e-10)),new k(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),s=Math.exp(-t.y/i),l=Math.PI/2-2*Math.atan(s),u=0,d=.1,v;u<15&&Math.abs(d)>1e-7;u++)v=o*Math.sin(l),v=Math.pow((1-v)/(1+v),o/2),d=Math.PI/2-2*Math.atan(s*v)-l,l+=d;return new z(l*e,t.x*e/i)}},Yo={__proto__:null,LonLat:mi,Mercator:_i,SphericalMercator:qe},Jo=h({},kt,{code:"EPSG:3395",projection:_i,transformation:(function(){var t=.5/(Math.PI*_i.R);return ie(t,.5,-t,.5)})()}),vn=h({},kt,{code:"EPSG:4326",projection:mi,transformation:ie(1/180,1,-1/180,.5)}),Qo=h({},rt,{projection:mi,transformation:ie(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});rt.Earth=kt,rt.EPSG3395=Jo,rt.EPSG3857=je,rt.EPSG900913=oo,rt.EPSG4326=vn,rt.Simple=Qo;var mt=Ct.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[g(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[g(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});Z.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=g(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=g(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return g(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?lt(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Lt.prototype._setLatLngs.call(this,t),ht(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ht(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new k(e,e);if(t=new I(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,o=this._rings.length,s;nt.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||Lt.prototype._containsPoint.call(this,t,!0)}});function as(t,e){return new Kt(t,e)}var Tt=xt.extend({initialize:function(t,e){E(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=lt(t)?t:t.features,i,n,o;if(e){for(i=0,n=e.length;i0&&o.push(o[0].slice()),o}function Xt(t,e){return t.feature?h({},t.feature,{geometry:e}):Ae(e)}function Ae(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var bi={toGeoJSON:function(t){return Xt(this,{type:"Point",coordinates:yi(this.getLatLng(),t)})}};Ce.include(bi),vi.include(bi),ke.include(bi),Lt.include({toGeoJSON:function(t){var e=!ht(this._latlngs),i=ze(this._latlngs,e?1:0,!1,t);return Xt(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),Kt.include({toGeoJSON:function(t){var e=!ht(this._latlngs),i=e&&!ht(this._latlngs[0]),n=ze(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Xt(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Gt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Xt(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var s=o.toGeoJSON(t);if(i)n.push(s.geometry);else{var l=Ae(s);l.type==="FeatureCollection"?n.push.apply(n,l.features):n.push(l)}}}),i?Xt(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function bn(t,e){return new Tt(t,e)}var ls=bn,Oe=mt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=R(e),E(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(A(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){j(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ut(this._image),this},bringToBack:function(){return this._map&&Vt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:N("img");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=P,e.onmousemove=P,e.onload=_(this.fire,this,"load"),e.onerror=_(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ot(this._image,i,e)},_reset:function(){var t=this._image,e=new I(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Y(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ut(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 t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),cs=function(t,e,i){return new Oe(t,e,i)},wn=Oe.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:N("video");if(A(e,"leaflet-image-layer"),this._zoomAnimated&&A(e,"leaflet-zoom-animated"),this.options.className&&A(e,this.options.className),e.onselectstart=P,e.onmousemove=P,e.onloadeddata=_(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o0?n:[e.src];return}lt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;so?(e.height=o+"px",A(t,s)):X(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Y(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(se(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new k(this._containerLeft,-i-this._containerBottom);o._add(It(this._container));var s=t.layerPointToContainerPoint(o),l=x(this.options.autoPanPadding),u=x(this.options.autoPanPaddingTopLeft||l),d=x(this.options.autoPanPaddingBottomRight||l),v=t.getSize(),w=0,C=0;s.x+n+d.x>v.x&&(w=s.x+n-v.x+d.x),s.x-w-u.x<0&&(w=s.x-u.x),s.y+i+d.y>v.y&&(C=s.y+i-v.y+d.y),s.y-C-u.y<0&&(C=s.y-u.y),(w||C)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([w,C]))}},_getAnchor:function(){return x(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),ds=function(t,e){return new Ie(t,e)};Z.mergeOptions({closePopupOnClick:!0}),Z.include({openPopup:function(t,e,i){return this._initOverlay(Ie,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),mt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ie,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof xt||(this._popup._source=this),this._popup._prepareOpen(t||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(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){Zt(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Mt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Be=Pt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Pt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Pt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Pt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=N("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+g(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),l=n.layerPointToContainerPoint(t),u=this.options.direction,d=o.offsetWidth,v=o.offsetHeight,w=x(this.options.offset),C=this._getAnchor();u==="top"?(e=d/2,i=v):u==="bottom"?(e=d/2,i=0):u==="center"?(e=d/2,i=v/2):u==="right"?(e=0,i=v/2):u==="left"?(e=d,i=v/2):l.xthis.options.maxZoom||in?this._retainParent(o,s,l,n):!1)},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var l=new k(o,s);l.z=i+1;var u=this._tileCoordsToKey(l),d=this._tiles[u];if(d&&d.active){d.retain=!0;continue}else d&&d.loaded&&(d.retain=!0);i+1this.options.maxZoom||this.options.minZoom!==void 0&&o1){this._setView(t,i);return}for(var C=o.min.y;C<=o.max.y;C++)for(var B=o.min.x;B<=o.max.x;B++){var st=new k(B,C);if(st.z=this._tileZoom,!!this._isValidTile(st)){var et=this._tiles[this._tileCoordsToKey(st)];et?et.current=!0:l.push(st)}}if(l.sort(function(at,Jt){return at.distanceTo(s)-Jt.distanceTo(s)}),l.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dt=document.createDocumentFragment();for(B=0;Bi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),l=e.unproject(o,t.z);return[s,l]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new W(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new k(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(j(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){A(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=P,t.onmousemove=P,T.ielt9&&this.options.opacity<1&&ut(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),_(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&K(_(this._tileReady,this,t,null,o)),Y(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(ut(i.el,0),G(this._fadeFrame),this._fadeFrame=K(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(A(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),T.ielt9||!this._map._fadeAnimated?K(this._pruneTiles,this):setTimeout(_(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new k(this._wrapX?b(t.x,this._wrapX):t.x,this._wrapY?b(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new I(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function ms(t){return new fe(t)}var Yt=fe.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=E(this,e),e.detectRetina&&T.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return M(i,"load",_(this._tileOnLoad,this,e,i)),M(i,"error",_(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:T.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return zt(this._url,h(e,this.options))},_tileOnLoad:function(t,e){T.ielt9?setTimeout(_(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=P,e.onerror=P,!e.complete)){e.src=qt;var i=this._tiles[t].coords;j(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",qt),fe.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===qt))return fe.prototype._tileReady.call(this,t,e,i)}});function Ln(t,e){return new Yt(t,e)}var Tn=Yt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=h({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=E(this,e);var o=e.detectRetina&&T.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Yt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=H(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,l=(this._wmsVersion>=1.3&&this._crs===vn?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),u=Yt.prototype.getTileUrl.call(this,t);return u+_t(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+l},setParams:function(t,e){return h(this.wmsParams,t),e||this.redraw(),this}});function _s(t,e){return new Tn(t,e)}Yt.WMS=Tn,Ln.wms=_s;var St=mt.extend({options:{padding:.1},initialize:function(t){E(this,t),g(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),A(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));T.any3d?Ot(this._container,s,i):Y(this._container,s)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new I(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Sn=St.extend({options:{tolerance:0},getEvents:function(){var t=St.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){St.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");M(t,"mousemove",this._onMouseMove,this),M(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),M(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){G(this._redrawRequest),delete this._ctx,j(this._container),F(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){St.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=T.retina?2:1;Y(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",T.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){St.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[g(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[g(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,o;for(o=0;o')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),vs={_initContainer:function(){this._container=N("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(St.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=pe("shape");A(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=pe("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[g(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;j(e),t.removeInteractiveTarget(e),delete this._layers[g(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=pe("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=lt(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=pe("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){Ut(t._container)},_bringToBack:function(t){Vt(t._container)}},Ze=T.vml?pe:Mi,me=St.extend({_initContainer:function(){this._container=Ze("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ze("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){j(this._container),F(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){St.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Y(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Ze("path");t.options.className&&A(e,t.options.className),t.options.interactive&&A(e,"leaflet-interactive"),this._updateStyle(t),this._layers[g(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){j(t._path),t.removeInteractiveTarget(t._path),delete this._layers[g(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,zi(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,o="a"+i+","+n+" 0 1,0 ",s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+i*2+",0 "+o+-i*2+",0 ";this._setPath(t,s)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Ut(t._path)},_bringToBack:function(t){Vt(t._path)}});T.vml&&me.include(vs);function kn(t){return T.svg||T.vml?new me(t):null}Z.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Cn(t)||kn(t)}});var En=Kt.extend({initialize:function(t,e){Kt.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=R(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function gs(t,e){return new En(t,e)}me.create=Ze,me.pointsToPath=zi,Tt.geometryToLayer=Ee,Tt.coordsToLatLng=gi,Tt.coordsToLatLngs=Me,Tt.latLngToCoords=yi,Tt.latLngsToCoords=ze,Tt.getFeature=Xt,Tt.asFeature=Ae,Z.mergeOptions({boxZoom:!0});var Mn=wt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){M(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){F(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){j(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(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),re(),ei(),this._startPoint=this._map.mouseEventToContainerPoint(t),M(document,{contextmenu:Zt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=N("div","leaflet-zoom-box",this._container),A(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new I(this._point,this._startPoint),i=e.getSize();Y(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(j(this._box),X(this._container,"leaflet-crosshair")),ae(),ii(),F(document,{contextmenu:Zt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(_(this._resetState,this),0);var e=new W(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Z.addInitHook("addHandler","boxZoom",Mn),Z.mergeOptions({doubleClickZoom:!0});var zn=wt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});Z.addInitHook("addHandler","doubleClickZoom",zn),Z.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var An=wt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Et(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}A(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){X(this._map._container,"leaflet-grab"),X(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=R(this._map.options.maxBounds);this._offsetLimit=H(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,l=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,l&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+l):t.setZoomAround(this._lastMousePos,e+l))}});Z.addInitHook("addHandler","scrollWheelZoom",In);var ys=600;Z.mergeOptions({tapHold:T.touchNative&&T.safari&&T.mobile,tapTolerance:15});var Bn=wt.extend({addHooks:function(){M(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){F(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new k(e.clientX,e.clientY),this._holdTimeout=setTimeout(_(function(){this._cancel(),this._isTapValid()&&(M(document,"touchend",it),M(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),ys),M(document,"touchend touchcancel contextmenu",this._cancel,this),M(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){F(document,"touchend",it),F(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),F(document,"touchend touchcancel contextmenu",this._cancel,this),F(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new k(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});Z.addInitHook("addHandler","tapHold",Bn),Z.mergeOptions({touchZoom:T.touch,bounceAtZoomLimits:!0});var Zn=wt.extend({addHooks:function(){A(this._map._container,"leaflet-touch-zoom"),M(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){X(this._map._container,"leaflet-touch-zoom"),F(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),M(document,"touchmove",this._onTouchMove,this),M(document,"touchend touchcancel",this._onTouchEnd,this),it(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(o===1&&s.x===0&&s.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),G(this._animRequest);var l=_(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=K(l,this,!0),it(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,G(this._animRequest),F(document,"touchmove",this._onTouchMove,this),F(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))}});Z.addInitHook("addHandler","touchZoom",Zn),Z.BoxZoom=Mn,Z.DoubleClickZoom=zn,Z.Drag=An,Z.Keyboard=On,Z.ScrollWheelZoom=In,Z.TapHold=Bn,Z.TouchZoom=Zn,a.Bounds=I,a.Browser=T,a.CRS=rt,a.Canvas=Sn,a.Circle=vi,a.CircleMarker=ke,a.Class=ft,a.Control=pt,a.DivIcon=xn,a.DivOverlay=Pt,a.DomEvent=No,a.DomUtil=Bo,a.Draggable=Et,a.Evented=Ct,a.FeatureGroup=xt,a.GeoJSON=Tt,a.GridLayer=fe,a.Handler=wt,a.Icon=$t,a.ImageOverlay=Oe,a.LatLng=z,a.LatLngBounds=W,a.Layer=mt,a.LayerGroup=Gt,a.LineUtil=Xo,a.Map=Z,a.Marker=Ce,a.Mixin=jo,a.Path=Mt,a.Point=k,a.PolyUtil=Uo,a.Polygon=Kt,a.Polyline=Lt,a.Popup=Ie,a.PosAnimation=sn,a.Projection=Yo,a.Rectangle=En,a.Renderer=St,a.SVG=me,a.SVGOverlay=Pn,a.TileLayer=Yt,a.Tooltip=Be,a.Transformation=We,a.Util=He,a.VideoOverlay=wn,a.bind=_,a.bounds=H,a.canvas=Cn,a.circle=ss,a.circleMarker=os,a.control=ue,a.divIcon=ps,a.extend=h,a.featureGroup=es,a.geoJSON=bn,a.geoJson=ls,a.gridLayer=ms,a.icon=is,a.imageOverlay=cs,a.latLng=O,a.latLngBounds=R,a.layerGroup=ts,a.map=Ro,a.marker=ns,a.point=x,a.polygon=as,a.polyline=rs,a.popup=ds,a.rectangle=gs,a.setOptions=E,a.stamp=g,a.svg=kn,a.svgOverlay=hs,a.tileLayer=Ln,a.tooltip=fs,a.transformation=ie,a.version=f,a.videoOverlay=us;var bs=window.L;a.noConflict=function(){return window.L=bs,this},window.L=a}))})(_e,_e.exports)),_e.exports}var dr=hr();const xi=cr(dr),fr="modulepreload",pr=function(r){return"/"+r},Gn={},mr=function(c,a,f){let h=Promise.resolve();if(a&&a.length>0){let _=function(y){return Promise.all(y.map(b=>Promise.resolve(b).then(P=>({status:"fulfilled",value:P}),P=>({status:"rejected",reason:P}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));h=_(a.map(y=>{if(y=pr(y),y in Gn)return;Gn[y]=!0;const b=y.endsWith(".css"),P=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${P}`))return;const S=document.createElement("link");if(S.rel=b?"stylesheet":fr,b||(S.as="script"),S.crossOrigin="",S.href=y,g&&S.setAttribute("nonce",g),document.head.appendChild(S),b)return new Promise((U,tt)=>{S.addEventListener("load",U),S.addEventListener("error",()=>tt(new Error(`Unable to preload CSS for ${y}`)))})}))}function m(_){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=_,window.dispatchEvent(p),!p.defaultPrevented)throw _}return h.then(_=>{for(const p of _||[])p.status==="rejected"&&m(p.reason);return c().catch(m)})},$n=ki("Geolocation",{web:()=>mr(()=>import("./web-ExNvtpt5.js"),[]).then(r=>new r.GeolocationWeb)});function _r(){if(typeof(Q==null?void 0:Q.isNativePlatform)=="function")return Q.isNativePlatform();const r=typeof(Q==null?void 0:Q.getPlatform)=="function"?Q.getPlatform():"web";return r==="android"||r==="ios"}async function no(){if(_r()){const r=await $n.requestPermissions();if((r.location||r.coarseLocation||"denied")!=="granted"){const f=new Error("geolocation_permission_denied");throw f.code="geolocation_permission_denied",f}const a=await $n.getCurrentPosition({enableHighAccuracy:!0,timeout:15e3,maximumAge:0});return{latitude:a.coords.latitude,longitude:a.coords.longitude}}return await new Promise((r,c)=>{navigator.geolocation.getCurrentPosition(a=>{r({latitude:a.coords.latitude,longitude:a.coords.longitude})},a=>{c(a)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})})}let Ht=null,ve=null;function vr(){Ht&&Ht.remove(),Ht=null,ve=null}function Kn(r,c,a,f){vr(),Ht=xi.map(r,{zoomControl:!1}).setView([c,a],15),xi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap"}).addTo(Ht),ve=xi.marker([c,a],{draggable:!0}).addTo(Ht),ve.on("dragend",()=>{const h=ve.getLatLng();f(h.lat,h.lng)}),Ht.on("click",h=>{ve.setLatLng(h.latlng),f(h.latlng.lat,h.latlng.lng)})}async function gr(r,c){r.innerHTML=`
e-Intervention
Création d'espace client

Créer mon compte

Enregistrez votre abonnement, votre contact et votre localisation pour déclarer vos incidents depuis l'application.

Vous avez déjà un compte ? Se connecter
Position géographique domicile
Touchez la carte ou utilisez votre position actuelle.
`;const a=r.querySelector("#onboardingForm"),f=r.querySelector("#errorBox"),h=r.querySelector("#homeLat"),m=r.querySelector("#homeLng"),_=r.querySelector("#homeMap"),p=(g,y)=>{h.value=String(g.toFixed(7)),m.value=String(y.toFixed(7))};p(5.3599517,-4.0082563),Kn(_,Number(h.value),Number(m.value),p),r.querySelector("#btnLocate").addEventListener("click",async()=>{f.hidden=!0;try{const g=await no();p(g.latitude,g.longitude),Kn(_,g.latitude,g.longitude,p)}catch(g){f.hidden=!1,f.textContent=(g==null?void 0:g.code)==="geolocation_permission_denied"?"La permission de localisation a été refusée. Autorisez la position dans Android puis réessayez.":"Impossible de récupérer la position actuelle. Vérifiez le GPS et les autorisations de localisation."}}),a.addEventListener("submit",async g=>{g.preventDefault(),f.hidden=!0;const y=Object.fromEntries(new FormData(a).entries());try{const b=await $s(y);if(!(b!=null&&b.ok)||!(b!=null&&b.token))throw new Error("register_failed");to(b.token,b.client),c()}catch(b){f.hidden=!1,(b==null?void 0:b.status)===409?f.textContent="Cet email est déjà utilisé par un autre compte client.":(b==null?void 0:b.status)===400?f.textContent="Certaines informations sont invalides ou incomplètes. Vérifiez le formulaire puis réessayez.":(b==null?void 0:b.status)===404||(b==null?void 0:b.status)>=500?f.textContent="Le service de création de compte n'est pas disponible sur ce serveur pour le moment.":f.textContent="Connexion impossible pour le moment. Vérifiez votre connexion réseau puis réessayez."}})}function yr(r){return{soumis:"Soumise",prise_en_charge:"Prise en charge",assigne_technicien:"Technicien assigné",en_cours:"En cours",resolu:"Résolue",ferme:"Fermée"}[r]||r||"—"}function br(r){const c=new Set(["resolu","ferme"]),a=r.length,f=r.filter(m=>c.has(String(m.status||"").toLowerCase())).length,h=a-f;return{total:a,inProgress:h,treated:f}}function wr(r){return r.total?Math.round(r.treated/r.total*100):0}function Pr(r){const c=String(r||"").toLowerCase();return c==="resolu"||c==="ferme"?"is-treated":c==="prise_en_charge"||c==="assigne_technicien"||c==="en_cours"?"is-progress":"is-pending"}async function xr(r,{client:c,incidents:a=[],unreadCount:f=0}){var y,b;const h=a.slice(0,3),m=br(a),_=wr(m),p=((y=h[0])==null?void 0:y.updated_at)||((b=h[0])==null?void 0:b.created_at)||null,g=Rt(((c==null?void 0:c.full_name)||"").split(" ")[0]||"client");r.innerHTML=`
Bonjour ${g}

Tableau de bord e-Intervention

Visualisez l'état de vos demandes FTTH, suivez leur prise en charge et accédez rapidement à l'action client la plus utile.

${_}% traités

${m.treated} incident(s) clôturé(s) ou résolu(s) sur ${m.total} déclaré(s).

${f} notification(s) non lue(s) ${Rt(p?Xn(p):"Aucune mise à jour")}

Tableau de bord incidents

Trois indicateurs prioritaires pour piloter votre espace client en un coup d'oeil.

Nombre total d'incidents ${m.total} Toutes vos demandes enregistrées dans e-Intervention
Incidents en cours ${m.inProgress} Demandes en attente, prises en charge ou en traitement
Incidents traités ${m.treated} Demandes résolues ou fermées
Progression globale ${_}%

Le taux de résolution reflète la part de vos demandes déjà traitées par les équipes.

Tendance actuelle ${m.inProgress>m.treated?"Suivi en cours":"Traitement maîtrisé"}

${m.inProgress>m.treated?"Vos demandes actives sont encore majoritaires et progressent dans le circuit de prise en charge.":"La majorité de vos demandes ont déjà été résolues ou fermées."}

Dernières déclarations

Les statuts ci-dessous sont mis à jour depuis le module Maintenance FTTH B2B.

Tout voir
${h.length?h.map(P=>`
${Rt(P.subject||"Incident client")} ${Rt(yr(P.status))}
${Rt(P.ref_code||"FTTH-"+P.ticket_id)} ${Number(P.photo_count||0)} photo(s) ${Rt(Xn(P.created_at))}
`).join(""):'
Aucune demande soumise pour le moment.
'}
`}function Xn(r){if(!r)return"—";const c=new Date(String(r).replace(" ","T"));return Number.isNaN(c.getTime())?r:c.toLocaleString("fr-FR",{dateStyle:"medium",timeStyle:"short"})}function Rt(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}async function Lr(r,{client:c,onSuccess:a}){r.innerHTML=`
Déclaration client

Nouvel incident e-Intervention

Ajoutez votre description, joignez plusieurs photos et laissez un commentaire par photo.

Votre position actuelle sera transmise si disponible. Votre domicile enregistré complète automatiquement le dossier FTTH.
Astuce: utilisez le GPS du téléphone si vous déclarez depuis le site concerné.
Vous pouvez joindre plusieurs photos. Un commentaire sera demandé pour chacune.
`;const f=r.querySelector("#incidentError"),h=r.querySelector("#incidentSuccess"),m=r.querySelector("#incidentForm"),_=r.querySelector("#incidentPhotos"),p=r.querySelector("#photoCommentList"),g=r.querySelector("#submittedLat"),y=r.querySelector("#submittedLng");let b=[];r.querySelector("#btnLocateIncident").addEventListener("click",async()=>{f.hidden=!0;try{const S=await no();g.value=String(S.latitude.toFixed(7)),y.value=String(S.longitude.toFixed(7))}catch(S){f.hidden=!1,f.textContent=(S==null?void 0:S.code)==="geolocation_permission_denied"?"La permission de localisation a été refusée. Autorisez-la dans Android puis réessayez.":"Impossible de récupérer la position actuelle. Vérifiez le GPS et les autorisations de localisation."}}),_.addEventListener("change",()=>{b=Array.from(_.files||[]).map((S,U)=>({file:S,comment:"",key:`${S.name}-${U}`})),P()});function P(){if(!b.length){p.innerHTML="";return}p.innerHTML=b.map((S,U)=>`
Photo ${U+1} ${Li(S.file.name)}
`).join(""),p.querySelectorAll('[data-role="photo-comment"]').forEach(S=>{S.addEventListener("input",U=>{const tt=Number(U.currentTarget.dataset.index||0);b[tt]&&(b[tt].comment=U.currentTarget.value)})})}m.addEventListener("submit",async S=>{S.preventDefault(),f.hidden=!0,h.hidden=!0;const U=Object.fromEntries(new FormData(m).entries()),tt=Qs(U,b);try{const E=await tr(tt);if(!(E!=null&&E.ok))throw new Error("incident_failed");m.reset(),b=[],P(),h.hidden=!1,h.textContent="Votre déclaration a été transmise au service client. Vous recevrez les notifications de prise en charge dans votre espace.",a==null||a()}catch(E){f.hidden=!1,f.textContent=E!=null&&E.status?"La demande n'a pas pu être transmise. Vérifiez les champs du formulaire.":"Serveur e-Intervention injoignable. Vérifiez le réseau de l'appareil."}})}function Li(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Tr(r){return{soumis:"Soumise",prise_en_charge:"Prise en charge",assigne_technicien:"Technicien assigné",en_cours:"En cours",resolu:"Résolue",ferme:"Fermée"}[r]||r||"—"}async function Sr(r,{incidents:c=[]}){r.innerHTML=`
Traçabilité client

Historique de vos déclarations

Retrouvez ici vos incidents, les tickets FTTH liés et le niveau de prise en charge opérateur.

`}function Cr(r){if(!r)return"—";const c=new Date(String(r).replace(" ","T"));return Number.isNaN(c.getTime())?r:c.toLocaleString("fr-FR",{dateStyle:"medium",timeStyle:"short"})}function Dt(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function kr(r){return{soumis:"Soumise",prise_en_charge:"Prise en charge",assigne_technicien:"Technicien assigné",en_cours:"En cours",resolu:"Résolue",ferme:"Fermée"}[r]||r||"—"}async function Er(r,{incidentId:c,incidents:a=[],fetchIncidentDetail:f}){var m;if(!c){r.innerHTML='
Demande introuvable.
';return}r.innerHTML=`
Suivi détaillé

Détail de votre demande

Retrouvez ici toutes les informations transmises, l’état de prise en charge et les pièces jointes envoyées.

Retour à l’historique
Chargement du détail…
`;const h=a.find(_=>Number(_.id||0)===c)||null;try{const _=await f(c),p=(_==null?void 0:_.incident)||h,g=(_==null?void 0:_.photos)||[];let y=(_==null?void 0:_.followups)||[];const b=String(((m=_==null?void 0:_.support)==null?void 0:m.email)||"").trim(),P=!["resolu","ferme"].includes(String((p==null?void 0:p.status)||""));if(!p){r.innerHTML='
Demande introuvable.
';return}r.innerHTML=`
Suivi détaillé

${$(p.subject||"Incident client")}

${$(p.description||"Aucun commentaire détaillé transmis.")}

Retour à l’historique
Référence ticket ${$(p.ref_code||"FTTH-"+p.ticket_id)} Identifiant FTTH associé à votre demande
Statut actuel ${$(kr(p.status))} ${$(p.updated_at?"Mis à jour le "+ge(p.updated_at):"En attente de mise à jour")}
Photos envoyées ${Number(((_==null?void 0:_.photos)||[]).length||p.photo_count||0)} Pièces jointes enregistrées lors de la déclaration

Actions sur la demande

Relancez votre dossier ou contactez le support si vous avez besoin d'un complément de prise en charge.

${b?` Contacter le support `:` Créer une nouvelle demande `}

Informations de prise en charge

Les équipes utilisent ces informations pour qualifier et traiter votre demande.

Adresse client${$(p.client_address||"Adresse à confirmer")}
Nature d’intervention${$(p.nature_intervention||"Maintenance FTTH B2B")}
Date de création${$(ge(p.created_at))}
Dernière mise à jour${$(ge(p.updated_at||p.created_at))}
${p.operator_notes?`
Note opérateur

${$(p.operator_notes)}

`:""}

Historique des relances

Retrouvez ici les relances que vous avez déjà transmises au support pour cette demande.

${Yn(y)}

Photos et commentaires

Chaque pièce jointe correspond à une photo ou un commentaire transmis lors de votre déclaration.

${g.length?g.map((E,_t)=>`
${E.photo_url?`Photo ${_t+1}`:""}
Photo ${_t+1} ${$(ge(E.created_at))}

${$(E.comment||"Aucun commentaire sur cette photo.")}

`).join(""):'
Aucune photo enregistrée sur cette demande.
'}
`;const S=r.querySelector("#btnRemind"),U=r.querySelector("#detailActionFeedback"),tt=r.querySelector("#followupTimeline");S==null||S.addEventListener("click",async()=>{var _t;if(!P)return;const E=window.prompt("Précisez si besoin le motif de votre relance.","Merci de revenir vers moi sur cette demande.");if(E!==null){S.disabled=!0;try{const ot=await nr({incident_id:c,message:E});U.hidden=!1,U.innerHTML=`
${$((ot==null?void 0:ot.message)||"Votre relance a été envoyée au support.")}
`;const zt=ot==null?void 0:ot.followup;zt&&tt&&(y=[zt,...y],tt.innerHTML=Yn(y))}catch(ot){U.hidden=!1,U.innerHTML=`
${$(((_t=ot==null?void 0:ot.data)==null?void 0:_t.error)==="incident_closed"?"Cette demande est déjà clôturée.":"Impossible de transmettre la relance pour le moment.")}
`}finally{S.disabled=!1}}})}catch{if(!h){r.innerHTML='
Impossible de charger le détail de cette demande.
';return}r.innerHTML=`
Suivi détaillé

${$(h.subject||"Incident client")}

${$(h.description||"Aucun commentaire détaillé transmis.")}

Retour à l’historique
Le détail enrichi est momentanément indisponible, mais votre demande reste visible dans l’historique.
`}}function ge(r){if(!r)return"—";const c=new Date(String(r).replace(" ","T"));return Number.isNaN(c.getTime())?r:c.toLocaleString("fr-FR",{dateStyle:"medium",timeStyle:"short"})}function $(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Yn(r){return r.length?r.map(c=>`
Relance client ${$(ge(c.created_at))}

${$(c.message||"Relance demandée depuis l'application client.")}

`).join(""):'
Aucune relance envoyée pour le moment.
'}let Ft=null;const D={items:[],unreadCount:0,panelOpen:!1};function Mr(){const r=(location.hash||"#/login").slice(1),[c,a]=r.split("?");return{path:c||"/login",params:new URLSearchParams(a||"")}}function zr(r){return r==="/incident"?{fallbackHash:"#/history",label:"Retour"}:r==="/declare"||r==="/history"?{fallbackHash:"#/dashboard",label:"Retour"}:null}function Ar(r,c){var h;const a=zr(r),f=document.getElementById("app");return f.innerHTML=`
${a?` `:""}
e-Intervention
Espace client FTTH public
Espace client actif
`,Ft=f,(h=f.querySelector("#btnBack"))==null||h.addEventListener("click",()=>{if(window.history.length>1){window.history.back();return}a!=null&&a.fallbackHash&&(location.hash=a.fallbackHash)}),f.querySelector("#btnLogout").addEventListener("click",()=>{zs(),location.hash="#/login"}),f.querySelector("#btnNotifications").addEventListener("click",()=>{const m=f.querySelector("#notificationPanel");D.panelOpen=!D.panelOpen,m.hidden=!D.panelOpen}),f}function Ti(r,c){const a=r==null?void 0:r.querySelector(".public-badge");a&&(a.textContent=String(c),a.hidden=c<=0)}function Re(r){const c=r==null?void 0:r.querySelector("#notificationPanel");c&&(c.hidden=!D.panelOpen)}function De(r,c){var a;r.innerHTML=`

Notifications

Messages de prise en charge et de suivi.

${c.length?c.map(f=>`
${Si(f.title)}

${Si(f.body||"")}

${Si(Br(f.created_at))}
${f.is_read?'Lu':''}
`).join(""):'
Aucune notification pour le moment.
'}
`,(a=r.querySelector("#btnReadAll"))==null||a.addEventListener("click",async()=>{await rr(),D.items=D.items.map(f=>({...f,is_read:1})),D.unreadCount=0,De(r,D.items),Ti(Ft,D.unreadCount),Re(Ft)}),r.querySelectorAll('[data-action="mark-read"]').forEach(f=>{f.addEventListener("click",async h=>{const m=h.currentTarget.closest("[data-notification-id]"),_=Number((m==null?void 0:m.dataset.notificationId)||0);if(_<=0)return;const p=await Un(_);D.items=D.items.map(g=>Number(g.id||0)===_?{...g,is_read:1}:g),D.unreadCount=Number((p==null?void 0:p.unread)??Math.max(0,D.unreadCount-1)),De(r,D.items),Ti(Ft,D.unreadCount),Re(Ft)})}),r.querySelectorAll("[data-notification-id]").forEach(f=>{f.addEventListener("click",async h=>{if(h.target.closest("button"))return;const m=Number(f.dataset.notificationId||0),_=D.items.find(p=>Number(p.id||0)===m);if(_&&!_.is_read&&m>0){const p=await Un(m);D.items=D.items.map(g=>Number(g.id||0)===m?{...g,is_read:1}:g),D.unreadCount=Number((p==null?void 0:p.unread)??Math.max(0,D.unreadCount-1)),De(r,D.items),Ti(Ft,D.unreadCount),Re(Ft)}_!=null&&_.url&&(location.hash=_.url.startsWith("#")?_.url:`#${_.url}`)})})}async function Jn(){const{path:r,params:c}=Mr(),a=Qn();if(!a&&r!=="/login"&&r!=="/register"&&r!=="/forgot-password"){location.hash="#/login";return}if(a&&(r==="/login"||r==="/register"||r==="/forgot-password")){location.hash="#/dashboard";return}if(r==="/login"){const P=document.getElementById("app");P.innerHTML="",await ar(P,()=>{location.hash="#/dashboard"});return}if(r==="/register"){const P=document.getElementById("app");P.innerHTML="",await gr(P,()=>{location.hash="#/dashboard"});return}if(r==="/forgot-password"){const P=document.getElementById("app");P.innerHTML="",await lr(P,()=>{location.hash="#/login"});return}const[f,h,m,_]=await Promise.all([Js(),er(),or(),sr()]),p=(f==null?void 0:f.client)||Es(),g=(h==null?void 0:h.items)||[];D.items=(m==null?void 0:m.notifications)||[],D.unreadCount=Number((_==null?void 0:_.unread)||0);const y=Ar(r,D.unreadCount);y.querySelector("#clientChip").textContent=`${(p==null?void 0:p.full_name)||"Client"} • ${(p==null?void 0:p.subscription_number)||"abonnement"}`,De(y.querySelector("#notificationPanel"),D.items),Re(y);const b=y.querySelector("#view");if(r==="/dashboard"){await xr(b,{client:p,incidents:g,unreadCount:D.unreadCount});return}if(r==="/declare"){await Lr(b,{client:p,onSuccess:async()=>{location.hash="#/history"}});return}if(r==="/history"){await Sr(b,{incidents:g});return}if(r==="/incident"){const P=Number(c.get("id")||0);await Er(b,{incidentId:P,incidents:g,fetchIncidentDetail:ir});return}location.hash="#/dashboard"}function Or(){window.addEventListener("hashchange",Jn),Ir().then(Jn)}async function Ir(){const r=document.getElementById("app");r.innerHTML=`
e-Intervention
Déclaration client et suivi intelligent des interventions
`,await new Promise(c=>window.setTimeout(c,1400))}function Br(r){if(!r)return"—";const c=new Date(String(r).replace(" ","T"));return Number.isNaN(c.getTime())?r:c.toLocaleString("fr-FR",{dateStyle:"medium",timeStyle:"short"})}function Si(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}Or();export{io as W};