Files
turftracker/frontend/dist/assets/index-9FS9bw8D.js
2026-04-09 13:19:47 -05:00

277 lines
929 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Equipment-CTLZqt7C.js","assets/MagnifyingGlassIcon-DIIDUrHz.js","assets/Products-BYbbRN4N.js","assets/Applications-Dk6lLrM6.js","assets/PlayIcon-CoXqSH0y.js","assets/Mowing-B8nXiqFU.js","assets/AdminDashboard-ZjlQm83Z.js","assets/UsersIcon-DAyxbQQr.js","assets/AdminUsers-DBAyiX-x.js","assets/ExclamationTriangleIcon-BZPGBcaI.js","assets/AdminProducts-Dw06v4jS.js","assets/ArrowUpIcon-cULW2MO5.js","assets/AdminEquipment-I7Ze0qiC.js"])))=>i.map(i=>d[i]);
function wP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var EP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function YD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var t1={exports:{}},np={},e1={exports:{}},ee={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Nf=Symbol.for("react.element"),SP=Symbol.for("react.portal"),CP=Symbol.for("react.fragment"),NP=Symbol.for("react.strict_mode"),PP=Symbol.for("react.profiler"),bP=Symbol.for("react.provider"),LP=Symbol.for("react.context"),IP=Symbol.for("react.forward_ref"),TP=Symbol.for("react.suspense"),OP=Symbol.for("react.memo"),RP=Symbol.for("react.lazy"),s0=Symbol.iterator;function MP(e){return e===null||typeof e!="object"?null:(e=s0&&e[s0]||e["@@iterator"],typeof e=="function"?e:null)}var n1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},r1=Object.assign,i1={};function ju(e,t,n){this.props=e,this.context=t,this.refs=i1,this.updater=n||n1}ju.prototype.isReactComponent={};ju.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ju.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function s1(){}s1.prototype=ju.prototype;function Fv(e,t,n){this.props=e,this.context=t,this.refs=i1,this.updater=n||n1}var jv=Fv.prototype=new s1;jv.constructor=Fv;r1(jv,ju.prototype);jv.isPureReactComponent=!0;var o0=Array.isArray,o1=Object.prototype.hasOwnProperty,zv={current:null},a1={key:!0,ref:!0,__self:!0,__source:!0};function l1(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)o1.call(t,r)&&!a1.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),f=0;f<l;f++)c[f]=arguments[f+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Nf,type:e,key:s,ref:a,props:i,_owner:zv.current}}function AP(e,t){return{$$typeof:Nf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Bv(e){return typeof e=="object"&&e!==null&&e.$$typeof===Nf}function DP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var a0=/\/+/g;function Sg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?DP(""+e.key):t.toString(36)}function Uh(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Nf:case SP:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Sg(a,0):r,o0(i)?(n="",e!=null&&(n=e.replace(a0,"$&/")+"/"),Uh(i,t,n,"",function(f){return f})):i!=null&&(Bv(i)&&(i=AP(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(a0,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",o0(e))for(var l=0;l<e.length;l++){s=e[l];var c=r+Sg(s,l);a+=Uh(s,t,n,c,i)}else if(c=MP(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=r+Sg(s,l++),a+=Uh(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function gh(e,t,n){if(e==null)return e;var r=[],i=0;return Uh(e,r,"","",function(s){return t.call(n,s,i++)}),r}function kP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Dr={current:null},Vh={transition:null},FP={ReactCurrentDispatcher:Dr,ReactCurrentBatchConfig:Vh,ReactCurrentOwner:zv};function u1(){throw Error("act(...) is not supported in production builds of React.")}ee.Children={map:gh,forEach:function(e,t,n){gh(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gh(e,function(){t++}),t},toArray:function(e){return gh(e,function(t){return t})||[]},only:function(e){if(!Bv(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ee.Component=ju;ee.Fragment=CP;ee.Profiler=PP;ee.PureComponent=Fv;ee.StrictMode=NP;ee.Suspense=TP;ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FP;ee.act=u1;ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=r1({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=zv.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)o1.call(t,c)&&!a1.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var f=0;f<c;f++)l[f]=arguments[f+2];r.children=l}return{$$typeof:Nf,type:e.type,key:i,ref:s,props:r,_owner:a}};ee.createContext=function(e){return e={$$typeof:LP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:bP,_context:e},e.Consumer=e};ee.createElement=l1;ee.createFactory=function(e){var t=l1.bind(null,e);return t.type=e,t};ee.createRef=function(){return{current:null}};ee.forwardRef=function(e){return{$$typeof:IP,render:e}};ee.isValidElement=Bv;ee.lazy=function(e){return{$$typeof:RP,_payload:{_status:-1,_result:e},_init:kP}};ee.memo=function(e,t){return{$$typeof:OP,type:e,compare:t===void 0?null:t}};ee.startTransition=function(e){var t=Vh.transition;Vh.transition={};try{e()}finally{Vh.transition=t}};ee.unstable_act=u1;ee.useCallback=function(e,t){return Dr.current.useCallback(e,t)};ee.useContext=function(e){return Dr.current.useContext(e)};ee.useDebugValue=function(){};ee.useDeferredValue=function(e){return Dr.current.useDeferredValue(e)};ee.useEffect=function(e,t){return Dr.current.useEffect(e,t)};ee.useId=function(){return Dr.current.useId()};ee.useImperativeHandle=function(e,t,n){return Dr.current.useImperativeHandle(e,t,n)};ee.useInsertionEffect=function(e,t){return Dr.current.useInsertionEffect(e,t)};ee.useLayoutEffect=function(e,t){return Dr.current.useLayoutEffect(e,t)};ee.useMemo=function(e,t){return Dr.current.useMemo(e,t)};ee.useReducer=function(e,t,n){return Dr.current.useReducer(e,t,n)};ee.useRef=function(e){return Dr.current.useRef(e)};ee.useState=function(e){return Dr.current.useState(e)};ee.useSyncExternalStore=function(e,t,n){return Dr.current.useSyncExternalStore(e,t,n)};ee.useTransition=function(){return Dr.current.useTransition()};ee.version="18.3.1";e1.exports=ee;var P=e1.exports;const ye=$w(P),jP=wP({__proto__:null,default:ye},[P]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zP=P,BP=Symbol.for("react.element"),UP=Symbol.for("react.fragment"),VP=Object.prototype.hasOwnProperty,GP=zP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qP={key:!0,ref:!0,__self:!0,__source:!0};function c1(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)VP.call(t,r)&&!qP.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:BP,type:e,key:s,ref:a,props:i,_owner:GP.current}}np.Fragment=UP;np.jsx=c1;np.jsxs=c1;t1.exports=np;var p=t1.exports,dm={},f1={exports:{}},mi={},h1={exports:{}},d1={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(z,at){var tt=z.length;z.push(at);t:for(;0<tt;){var vt=tt-1>>>1,Lt=z[vt];if(0<i(Lt,at))z[vt]=at,z[tt]=Lt,tt=vt;else break t}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var at=z[0],tt=z.pop();if(tt!==at){z[0]=tt;t:for(var vt=0,Lt=z.length,ct=Lt>>>1;vt<ct;){var ht=2*(vt+1)-1,_t=z[ht],wt=ht+1,Gt=z[wt];if(0>i(_t,tt))wt<Lt&&0>i(Gt,_t)?(z[vt]=Gt,z[wt]=tt,vt=wt):(z[vt]=_t,z[ht]=tt,vt=ht);else if(wt<Lt&&0>i(Gt,tt))z[vt]=Gt,z[wt]=tt,vt=wt;else break t}}return at}function i(z,at){var tt=z.sortIndex-at.sortIndex;return tt!==0?tt:z.id-at.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],f=[],g=1,d=null,v=3,y=!1,x=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(z){for(var at=n(f);at!==null;){if(at.callback===null)r(f);else if(at.startTime<=z)r(f),at.sortIndex=at.expirationTime,t(c,at);else break;at=n(f)}}function I(z){if(S=!1,N(z),!x)if(n(c)!==null)x=!0,it(R);else{var at=n(f);at!==null&&yt(I,at.startTime-z)}}function R(z,at){x=!1,S&&(S=!1,E(q),q=-1),y=!0;var tt=v;try{for(N(at),d=n(c);d!==null&&(!(d.expirationTime>at)||z&&!J());){var vt=d.callback;if(typeof vt=="function"){d.callback=null,v=d.priorityLevel;var Lt=vt(d.expirationTime<=at);at=e.unstable_now(),typeof Lt=="function"?d.callback=Lt:d===n(c)&&r(c),N(at)}else r(c);d=n(c)}if(d!==null)var ct=!0;else{var ht=n(f);ht!==null&&yt(I,ht.startTime-at),ct=!1}return ct}finally{d=null,v=tt,y=!1}}var A=!1,B=null,q=-1,Q=5,Y=-1;function J(){return!(e.unstable_now()-Y<Q)}function W(){if(B!==null){var z=e.unstable_now();Y=z;var at=!0;try{at=B(!0,z)}finally{at?$():(A=!1,B=null)}}else A=!1}var $;if(typeof w=="function")$=function(){w(W)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,ut=D.port2;D.port1.onmessage=W,$=function(){ut.postMessage(null)}}else $=function(){C(W,0)};function it(z){B=z,A||(A=!0,$())}function yt(z,at){q=C(function(){z(e.unstable_now())},at)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,it(R))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var at=3;break;default:at=v}var tt=v;v=at;try{return z()}finally{v=tt}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,at){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var tt=v;v=z;try{return at()}finally{v=tt}},e.unstable_scheduleCallback=function(z,at,tt){var vt=e.unstable_now();switch(typeof tt=="object"&&tt!==null?(tt=tt.delay,tt=typeof tt=="number"&&0<tt?vt+tt:vt):tt=vt,z){case 1:var Lt=-1;break;case 2:Lt=250;break;case 5:Lt=1073741823;break;case 4:Lt=1e4;break;default:Lt=5e3}return Lt=tt+Lt,z={id:g++,callback:at,priorityLevel:z,startTime:tt,expirationTime:Lt,sortIndex:-1},tt>vt?(z.sortIndex=tt,t(f,z),n(c)===null&&z===n(f)&&(S?(E(q),q=-1):S=!0,yt(I,tt-vt))):(z.sortIndex=Lt,t(c,z),x||y||(x=!0,it(R))),z},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(z){var at=v;return function(){var tt=v;v=at;try{return z.apply(this,arguments)}finally{v=tt}}}})(d1);h1.exports=d1;var HP=h1.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ZP=P,li=HP;function ot(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p1=new Set,Gc={};function El(e,t){lu(e,t),lu(e+"Capture",t)}function lu(e,t){for(Gc[e]=t,e=0;e<t.length;e++)p1.add(t[e])}var go=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pm=Object.prototype.hasOwnProperty,WP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,l0={},u0={};function XP(e){return pm.call(u0,e)?!0:pm.call(l0,e)?!1:WP.test(e)?u0[e]=!0:(l0[e]=!0,!1)}function YP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function KP(e,t,n,r){if(t===null||typeof t>"u"||YP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function kr(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new kr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rr[t]=new kr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new kr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new kr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rr[e]=new kr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new kr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new kr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new kr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new kr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uv=/[\-:]([a-z])/g;function Vv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uv,Vv);rr[t]=new kr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Uv,Vv);rr[t]=new kr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Uv,Vv);rr[t]=new kr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new kr(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new kr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new kr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gv(e,t,n,r){var i=rr.hasOwnProperty(t)?rr[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(KP(t,n,i,r)&&(n=null),r||i===null?XP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Io=ZP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,mh=Symbol.for("react.element"),Gl=Symbol.for("react.portal"),ql=Symbol.for("react.fragment"),qv=Symbol.for("react.strict_mode"),gm=Symbol.for("react.profiler"),g1=Symbol.for("react.provider"),m1=Symbol.for("react.context"),Hv=Symbol.for("react.forward_ref"),mm=Symbol.for("react.suspense"),vm=Symbol.for("react.suspense_list"),Zv=Symbol.for("react.memo"),Bo=Symbol.for("react.lazy"),v1=Symbol.for("react.offscreen"),c0=Symbol.iterator;function cc(e){return e===null||typeof e!="object"?null:(e=c0&&e[c0]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,Cg;function Ec(e){if(Cg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Cg=t&&t[1]||""}return`
`+Cg+e}var Ng=!1;function Pg(e,t){if(!e||Ng)return"";Ng=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var r=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){r=f}e.call(t.prototype)}else{try{throw Error()}catch(f){r=f}e()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var i=f.stack.split(`
`),s=r.stack.split(`
`),a=i.length-1,l=s.length-1;1<=a&&0<=l&&i[a]!==s[l];)l--;for(;1<=a&&0<=l;a--,l--)if(i[a]!==s[l]){if(a!==1||l!==1)do if(a--,l--,0>l||i[a]!==s[l]){var c=`
`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Ng=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ec(e):""}function QP(e){switch(e.tag){case 5:return Ec(e.type);case 16:return Ec("Lazy");case 13:return Ec("Suspense");case 19:return Ec("SuspenseList");case 0:case 2:case 15:return e=Pg(e.type,!1),e;case 11:return e=Pg(e.type.render,!1),e;case 1:return e=Pg(e.type,!0),e;default:return""}}function ym(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ql:return"Fragment";case Gl:return"Portal";case gm:return"Profiler";case qv:return"StrictMode";case mm:return"Suspense";case vm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case m1:return(e.displayName||"Context")+".Consumer";case g1:return(e._context.displayName||"Context")+".Provider";case Hv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zv:return t=e.displayName||null,t!==null?t:ym(e.type)||"Memo";case Bo:t=e._payload,e=e._init;try{return ym(e(t))}catch{}}return null}function JP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ym(t);case 8:return t===qv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function y1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $P(e){var t=y1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vh(e){e._valueTracker||(e._valueTracker=$P(e))}function _1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=y1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ud(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _m(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function f0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function x1(e,t){t=t.checked,t!=null&&Gv(e,"checked",t,!1)}function xm(e,t){x1(e,t);var n=fa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wm(e,t.type,n):t.hasOwnProperty("defaultValue")&&wm(e,t.type,fa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function h0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wm(e,t,n){(t!=="number"||ud(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Sc=Array.isArray;function nu(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fa(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Em(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ot(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function d0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ot(92));if(Sc(n)){if(1<n.length)throw Error(ot(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fa(n)}}function w1(e,t){var n=fa(t.value),r=fa(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function p0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function E1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Sm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?E1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yh,S1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(yh=yh||document.createElement("div"),yh.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=yh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ic={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tb=["Webkit","ms","Moz","O"];Object.keys(Ic).forEach(function(e){tb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ic[t]=Ic[e]})});function C1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ic.hasOwnProperty(e)&&Ic[e]?(""+t).trim():t+"px"}function N1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=C1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var eb=Xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cm(e,t){if(t){if(eb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ot(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ot(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ot(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ot(62))}}function Nm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pm=null;function Wv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bm=null,ru=null,iu=null;function g0(e){if(e=Lf(e)){if(typeof bm!="function")throw Error(ot(280));var t=e.stateNode;t&&(t=ap(t),bm(e.stateNode,e.type,t))}}function P1(e){ru?iu?iu.push(e):iu=[e]:ru=e}function b1(){if(ru){var e=ru,t=iu;if(iu=ru=null,g0(e),t)for(e=0;e<t.length;e++)g0(t[e])}}function L1(e,t){return e(t)}function I1(){}var bg=!1;function T1(e,t,n){if(bg)return e(t,n);bg=!0;try{return L1(e,t,n)}finally{bg=!1,(ru!==null||iu!==null)&&(I1(),b1())}}function Hc(e,t){var n=e.stateNode;if(n===null)return null;var r=ap(n);if(r===null)return null;n=r[t];t:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break t;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ot(231,t,typeof n));return n}var Lm=!1;if(go)try{var fc={};Object.defineProperty(fc,"passive",{get:function(){Lm=!0}}),window.addEventListener("test",fc,fc),window.removeEventListener("test",fc,fc)}catch{Lm=!1}function nb(e,t,n,r,i,s,a,l,c){var f=Array.prototype.slice.call(arguments,3);try{t.apply(n,f)}catch(g){this.onError(g)}}var Tc=!1,cd=null,fd=!1,Im=null,rb={onError:function(e){Tc=!0,cd=e}};function ib(e,t,n,r,i,s,a,l,c){Tc=!1,cd=null,nb.apply(rb,arguments)}function sb(e,t,n,r,i,s,a,l,c){if(ib.apply(this,arguments),Tc){if(Tc){var f=cd;Tc=!1,cd=null}else throw Error(ot(198));fd||(fd=!0,Im=f)}}function Sl(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function O1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m0(e){if(Sl(e)!==e)throw Error(ot(188))}function ob(e){var t=e.alternate;if(!t){if(t=Sl(e),t===null)throw Error(ot(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return m0(i),e;if(s===r)return m0(i),t;s=s.sibling}throw Error(ot(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(ot(189))}}if(n.alternate!==r)throw Error(ot(190))}if(n.tag!==3)throw Error(ot(188));return n.stateNode.current===n?e:t}function R1(e){return e=ob(e),e!==null?M1(e):null}function M1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=M1(e);if(t!==null)return t;e=e.sibling}return null}var A1=li.unstable_scheduleCallback,v0=li.unstable_cancelCallback,ab=li.unstable_shouldYield,lb=li.unstable_requestPaint,nn=li.unstable_now,ub=li.unstable_getCurrentPriorityLevel,Xv=li.unstable_ImmediatePriority,D1=li.unstable_UserBlockingPriority,hd=li.unstable_NormalPriority,cb=li.unstable_LowPriority,k1=li.unstable_IdlePriority,rp=null,Vs=null;function fb(e){if(Vs&&typeof Vs.onCommitFiberRoot=="function")try{Vs.onCommitFiberRoot(rp,e,void 0,(e.current.flags&128)===128)}catch{}}var hs=Math.clz32?Math.clz32:pb,hb=Math.log,db=Math.LN2;function pb(e){return e>>>=0,e===0?32:31-(hb(e)/db|0)|0}var _h=64,xh=4194304;function Cc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~i;l!==0?r=Cc(l):(s&=a,s!==0&&(r=Cc(s)))}else a=n&~i,a!==0?r=Cc(a):s!==0&&(r=Cc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-hs(t),i=1<<n,r|=e[n],t&=~i;return r}function gb(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mb(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-hs(s),l=1<<a,c=i[a];c===-1?(!(l&n)||l&r)&&(i[a]=gb(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function Tm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function F1(){var e=_h;return _h<<=1,!(_h&4194240)&&(_h=64),e}function Lg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hs(t),e[t]=n}function vb(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-hs(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Yv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hs(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var pe=0;function j1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var z1,Kv,B1,U1,V1,Om=!1,wh=[],$o=null,ta=null,ea=null,Zc=new Map,Wc=new Map,Go=[],yb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function y0(e,t){switch(e){case"focusin":case"focusout":$o=null;break;case"dragenter":case"dragleave":ta=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":Zc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wc.delete(t.pointerId)}}function hc(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Lf(t),t!==null&&Kv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function _b(e,t,n,r,i){switch(t){case"focusin":return $o=hc($o,e,t,n,r,i),!0;case"dragenter":return ta=hc(ta,e,t,n,r,i),!0;case"mouseover":return ea=hc(ea,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Zc.set(s,hc(Zc.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Wc.set(s,hc(Wc.get(s)||null,e,t,n,r,i)),!0}return!1}function G1(e){var t=Wa(e.target);if(t!==null){var n=Sl(t);if(n!==null){if(t=n.tag,t===13){if(t=O1(n),t!==null){e.blockedOn=t,V1(e.priority,function(){B1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pm=r,n.target.dispatchEvent(r),Pm=null}else return t=Lf(n),t!==null&&Kv(t),e.blockedOn=n,!1;t.shift()}return!0}function _0(e,t,n){Gh(e)&&n.delete(t)}function xb(){Om=!1,$o!==null&&Gh($o)&&($o=null),ta!==null&&Gh(ta)&&(ta=null),ea!==null&&Gh(ea)&&(ea=null),Zc.forEach(_0),Wc.forEach(_0)}function dc(e,t){e.blockedOn===t&&(e.blockedOn=null,Om||(Om=!0,li.unstable_scheduleCallback(li.unstable_NormalPriority,xb)))}function Xc(e){function t(i){return dc(i,e)}if(0<wh.length){dc(wh[0],e);for(var n=1;n<wh.length;n++){var r=wh[n];r.blockedOn===e&&(r.blockedOn=null)}}for($o!==null&&dc($o,e),ta!==null&&dc(ta,e),ea!==null&&dc(ea,e),Zc.forEach(t),Wc.forEach(t),n=0;n<Go.length;n++)r=Go[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Go.length&&(n=Go[0],n.blockedOn===null);)G1(n),n.blockedOn===null&&Go.shift()}var su=Io.ReactCurrentBatchConfig,pd=!0;function wb(e,t,n,r){var i=pe,s=su.transition;su.transition=null;try{pe=1,Qv(e,t,n,r)}finally{pe=i,su.transition=s}}function Eb(e,t,n,r){var i=pe,s=su.transition;su.transition=null;try{pe=4,Qv(e,t,n,r)}finally{pe=i,su.transition=s}}function Qv(e,t,n,r){if(pd){var i=Rm(e,t,n,r);if(i===null)jg(e,t,r,gd,n),y0(e,r);else if(_b(i,e,t,n,r))r.stopPropagation();else if(y0(e,r),t&4&&-1<yb.indexOf(e)){for(;i!==null;){var s=Lf(i);if(s!==null&&z1(s),s=Rm(e,t,n,r),s===null&&jg(e,t,r,gd,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else jg(e,t,r,null,n)}}var gd=null;function Rm(e,t,n,r){if(gd=null,e=Wv(r),e=Wa(e),e!==null)if(t=Sl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=O1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gd=e,null}function q1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ub()){case Xv:return 1;case D1:return 4;case hd:case cb:return 16;case k1:return 536870912;default:return 16}default:return 16}}var Yo=null,Jv=null,qh=null;function H1(){if(qh)return qh;var e,t=Jv,n=t.length,r,i="value"in Yo?Yo.value:Yo.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return qh=i.slice(e,1<r?1-r:void 0)}function Hh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Eh(){return!0}function x0(){return!1}function vi(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Eh:x0,this.isPropagationStopped=x0,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Eh)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Eh)},persist:function(){},isPersistent:Eh}),t}var zu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$v=vi(zu),bf=Xe({},zu,{view:0,detail:0}),Sb=vi(bf),Ig,Tg,pc,ip=Xe({},bf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ty,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==pc&&(pc&&e.type==="mousemove"?(Ig=e.screenX-pc.screenX,Tg=e.screenY-pc.screenY):Tg=Ig=0,pc=e),Ig)},movementY:function(e){return"movementY"in e?e.movementY:Tg}}),w0=vi(ip),Cb=Xe({},ip,{dataTransfer:0}),Nb=vi(Cb),Pb=Xe({},bf,{relatedTarget:0}),Og=vi(Pb),bb=Xe({},zu,{animationName:0,elapsedTime:0,pseudoElement:0}),Lb=vi(bb),Ib=Xe({},zu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tb=vi(Ib),Ob=Xe({},zu,{data:0}),E0=vi(Ob),Rb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ab={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Db(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ab[e])?!!t[e]:!1}function ty(){return Db}var kb=Xe({},bf,{key:function(e){if(e.key){var t=Rb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ty,charCode:function(e){return e.type==="keypress"?Hh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fb=vi(kb),jb=Xe({},ip,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S0=vi(jb),zb=Xe({},bf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ty}),Bb=vi(zb),Ub=Xe({},zu,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vb=vi(Ub),Gb=Xe({},ip,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qb=vi(Gb),Hb=[9,13,27,32],ey=go&&"CompositionEvent"in window,Oc=null;go&&"documentMode"in document&&(Oc=document.documentMode);var Zb=go&&"TextEvent"in window&&!Oc,Z1=go&&(!ey||Oc&&8<Oc&&11>=Oc),C0=" ",N0=!1;function W1(e,t){switch(e){case"keyup":return Hb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hl=!1;function Wb(e,t){switch(e){case"compositionend":return X1(t);case"keypress":return t.which!==32?null:(N0=!0,C0);case"textInput":return e=t.data,e===C0&&N0?null:e;default:return null}}function Xb(e,t){if(Hl)return e==="compositionend"||!ey&&W1(e,t)?(e=H1(),qh=Jv=Yo=null,Hl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Z1&&t.locale!=="ko"?null:t.data;default:return null}}var Yb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function P0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yb[e.type]:t==="textarea"}function Y1(e,t,n,r){P1(r),t=md(t,"onChange"),0<t.length&&(n=new $v("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Rc=null,Yc=null;function Kb(e){oE(e,0)}function sp(e){var t=Xl(e);if(_1(t))return e}function Qb(e,t){if(e==="change")return t}var K1=!1;if(go){var Rg;if(go){var Mg="oninput"in document;if(!Mg){var b0=document.createElement("div");b0.setAttribute("oninput","return;"),Mg=typeof b0.oninput=="function"}Rg=Mg}else Rg=!1;K1=Rg&&(!document.documentMode||9<document.documentMode)}function L0(){Rc&&(Rc.detachEvent("onpropertychange",Q1),Yc=Rc=null)}function Q1(e){if(e.propertyName==="value"&&sp(Yc)){var t=[];Y1(t,Yc,e,Wv(e)),T1(Kb,t)}}function Jb(e,t,n){e==="focusin"?(L0(),Rc=t,Yc=n,Rc.attachEvent("onpropertychange",Q1)):e==="focusout"&&L0()}function $b(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sp(Yc)}function tL(e,t){if(e==="click")return sp(t)}function eL(e,t){if(e==="input"||e==="change")return sp(t)}function nL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ms=typeof Object.is=="function"?Object.is:nL;function Kc(e,t){if(ms(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!pm.call(t,i)||!ms(e[i],t[i]))return!1}return!0}function I0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function T0(e,t){var n=I0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=I0(n)}}function J1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?J1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $1(){for(var e=window,t=ud();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ud(e.document)}return t}function ny(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rL(e){var t=$1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&J1(n.ownerDocument.documentElement,n)){if(r!==null&&ny(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=T0(n,s);var a=T0(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var iL=go&&"documentMode"in document&&11>=document.documentMode,Zl=null,Mm=null,Mc=null,Am=!1;function O0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Am||Zl==null||Zl!==ud(r)||(r=Zl,"selectionStart"in r&&ny(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mc&&Kc(Mc,r)||(Mc=r,r=md(Mm,"onSelect"),0<r.length&&(t=new $v("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zl)))}function Sh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Wl={animationend:Sh("Animation","AnimationEnd"),animationiteration:Sh("Animation","AnimationIteration"),animationstart:Sh("Animation","AnimationStart"),transitionend:Sh("Transition","TransitionEnd")},Ag={},tE={};go&&(tE=document.createElement("div").style,"AnimationEvent"in window||(delete Wl.animationend.animation,delete Wl.animationiteration.animation,delete Wl.animationstart.animation),"TransitionEvent"in window||delete Wl.transitionend.transition);function op(e){if(Ag[e])return Ag[e];if(!Wl[e])return e;var t=Wl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tE)return Ag[e]=t[n];return e}var eE=op("animationend"),nE=op("animationiteration"),rE=op("animationstart"),iE=op("transitionend"),sE=new Map,R0="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Sa(e,t){sE.set(e,t),El(t,[e])}for(var Dg=0;Dg<R0.length;Dg++){var kg=R0[Dg],sL=kg.toLowerCase(),oL=kg[0].toUpperCase()+kg.slice(1);Sa(sL,"on"+oL)}Sa(eE,"onAnimationEnd");Sa(nE,"onAnimationIteration");Sa(rE,"onAnimationStart");Sa("dblclick","onDoubleClick");Sa("focusin","onFocus");Sa("focusout","onBlur");Sa(iE,"onTransitionEnd");lu("onMouseEnter",["mouseout","mouseover"]);lu("onMouseLeave",["mouseout","mouseover"]);lu("onPointerEnter",["pointerout","pointerover"]);lu("onPointerLeave",["pointerout","pointerover"]);El("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));El("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));El("onBeforeInput",["compositionend","keypress","textInput","paste"]);El("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));El("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));El("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),aL=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nc));function M0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,sb(r,t,void 0,e),e.currentTarget=null}function oE(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;t:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,f=l.currentTarget;if(l=l.listener,c!==s&&i.isPropagationStopped())break t;M0(i,l,f),s=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,f=l.currentTarget,l=l.listener,c!==s&&i.isPropagationStopped())break t;M0(i,l,f),s=c}}}if(fd)throw e=Im,fd=!1,Im=null,e}function Le(e,t){var n=t[zm];n===void 0&&(n=t[zm]=new Set);var r=e+"__bubble";n.has(r)||(aE(t,e,2,!1),n.add(r))}function Fg(e,t,n){var r=0;t&&(r|=4),aE(n,e,r,t)}var Ch="_reactListening"+Math.random().toString(36).slice(2);function Qc(e){if(!e[Ch]){e[Ch]=!0,p1.forEach(function(n){n!=="selectionchange"&&(aL.has(n)||Fg(n,!1,e),Fg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ch]||(t[Ch]=!0,Fg("selectionchange",!1,t))}}function aE(e,t,n,r){switch(q1(t)){case 1:var i=wb;break;case 4:i=Eb;break;default:i=Qv}n=i.bind(null,t,n,e),i=void 0,!Lm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jg(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)t:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;l!==null;){if(a=Wa(l),a===null)return;if(c=a.tag,c===5||c===6){r=s=a;continue t}l=l.parentNode}}r=r.return}T1(function(){var f=s,g=Wv(n),d=[];t:{var v=sE.get(e);if(v!==void 0){var y=$v,x=e;switch(e){case"keypress":if(Hh(n)===0)break t;case"keydown":case"keyup":y=Fb;break;case"focusin":x="focus",y=Og;break;case"focusout":x="blur",y=Og;break;case"beforeblur":case"afterblur":y=Og;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=w0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Nb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Bb;break;case eE:case nE:case rE:y=Lb;break;case iE:y=Vb;break;case"scroll":y=Sb;break;case"wheel":y=qb;break;case"copy":case"cut":case"paste":y=Tb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=S0}var S=(t&4)!==0,C=!S&&e==="scroll",E=S?v!==null?v+"Capture":null:v;S=[];for(var w=f,N;w!==null;){N=w;var I=N.stateNode;if(N.tag===5&&I!==null&&(N=I,E!==null&&(I=Hc(w,E),I!=null&&S.push(Jc(w,I,N)))),C)break;w=w.return}0<S.length&&(v=new y(v,x,null,n,g),d.push({event:v,listeners:S}))}}if(!(t&7)){t:{if(v=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",v&&n!==Pm&&(x=n.relatedTarget||n.fromElement)&&(Wa(x)||x[mo]))break t;if((y||v)&&(v=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=f,x=x?Wa(x):null,x!==null&&(C=Sl(x),x!==C||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=f),y!==x)){if(S=w0,I="onMouseLeave",E="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(S=S0,I="onPointerLeave",E="onPointerEnter",w="pointer"),C=y==null?v:Xl(y),N=x==null?v:Xl(x),v=new S(I,w+"leave",y,n,g),v.target=C,v.relatedTarget=N,I=null,Wa(g)===f&&(S=new S(E,w+"enter",x,n,g),S.target=N,S.relatedTarget=C,I=S),C=I,y&&x)e:{for(S=y,E=x,w=0,N=S;N;N=zl(N))w++;for(N=0,I=E;I;I=zl(I))N++;for(;0<w-N;)S=zl(S),w--;for(;0<N-w;)E=zl(E),N--;for(;w--;){if(S===E||E!==null&&S===E.alternate)break e;S=zl(S),E=zl(E)}S=null}else S=null;y!==null&&A0(d,v,y,S,!1),x!==null&&C!==null&&A0(d,C,x,S,!0)}}t:{if(v=f?Xl(f):window,y=v.nodeName&&v.nodeName.toLowerCase(),y==="select"||y==="input"&&v.type==="file")var R=Qb;else if(P0(v))if(K1)R=eL;else{R=$b;var A=Jb}else(y=v.nodeName)&&y.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(R=tL);if(R&&(R=R(e,f))){Y1(d,R,n,g);break t}A&&A(e,v,f),e==="focusout"&&(A=v._wrapperState)&&A.controlled&&v.type==="number"&&wm(v,"number",v.value)}switch(A=f?Xl(f):window,e){case"focusin":(P0(A)||A.contentEditable==="true")&&(Zl=A,Mm=f,Mc=null);break;case"focusout":Mc=Mm=Zl=null;break;case"mousedown":Am=!0;break;case"contextmenu":case"mouseup":case"dragend":Am=!1,O0(d,n,g);break;case"selectionchange":if(iL)break;case"keydown":case"keyup":O0(d,n,g)}var B;if(ey)t:{switch(e){case"compositionstart":var q="onCompositionStart";break t;case"compositionend":q="onCompositionEnd";break t;case"compositionupdate":q="onCompositionUpdate";break t}q=void 0}else Hl?W1(e,n)&&(q="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(q="onCompositionStart");q&&(Z1&&n.locale!=="ko"&&(Hl||q!=="onCompositionStart"?q==="onCompositionEnd"&&Hl&&(B=H1()):(Yo=g,Jv="value"in Yo?Yo.value:Yo.textContent,Hl=!0)),A=md(f,q),0<A.length&&(q=new E0(q,e,null,n,g),d.push({event:q,listeners:A}),B?q.data=B:(B=X1(n),B!==null&&(q.data=B)))),(B=Zb?Wb(e,n):Xb(e,n))&&(f=md(f,"onBeforeInput"),0<f.length&&(g=new E0("onBeforeInput","beforeinput",null,n,g),d.push({event:g,listeners:f}),g.data=B))}oE(d,t)})}function Jc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function md(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Hc(e,n),s!=null&&r.unshift(Jc(e,s,i)),s=Hc(e,t),s!=null&&r.push(Jc(e,s,i))),e=e.return}return r}function zl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function A0(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,f=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&f!==null&&(l=f,i?(c=Hc(n,s),c!=null&&a.unshift(Jc(n,c,l))):i||(c=Hc(n,s),c!=null&&a.push(Jc(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var lL=/\r\n?/g,uL=/\u0000|\uFFFD/g;function D0(e){return(typeof e=="string"?e:""+e).replace(lL,`
`).replace(uL,"")}function Nh(e,t,n){if(t=D0(t),D0(e)!==t&&n)throw Error(ot(425))}function vd(){}var Dm=null,km=null;function Fm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jm=typeof setTimeout=="function"?setTimeout:void 0,cL=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,fL=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(e){return k0.resolve(null).then(e).catch(hL)}:jm;function hL(e){setTimeout(function(){throw e})}function zg(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Xc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Xc(t)}function na(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function F0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Bu=Math.random().toString(36).slice(2),zs="__reactFiber$"+Bu,$c="__reactProps$"+Bu,mo="__reactContainer$"+Bu,zm="__reactEvents$"+Bu,dL="__reactListeners$"+Bu,pL="__reactHandles$"+Bu;function Wa(e){var t=e[zs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mo]||n[zs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=F0(e);e!==null;){if(n=e[zs])return n;e=F0(e)}return t}e=n,n=e.parentNode}return null}function Lf(e){return e=e[zs]||e[mo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ot(33))}function ap(e){return e[$c]||null}var Bm=[],Yl=-1;function Ca(e){return{current:e}}function Te(e){0>Yl||(e.current=Bm[Yl],Bm[Yl]=null,Yl--)}function Ne(e,t){Yl++,Bm[Yl]=e.current,e.current=t}var ha={},pr=Ca(ha),Gr=Ca(!1),rl=ha;function uu(e,t){var n=e.type.contextTypes;if(!n)return ha;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function qr(e){return e=e.childContextTypes,e!=null}function yd(){Te(Gr),Te(pr)}function j0(e,t,n){if(pr.current!==ha)throw Error(ot(168));Ne(pr,t),Ne(Gr,n)}function lE(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ot(108,JP(e)||"Unknown",i));return Xe({},n,r)}function _d(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ha,rl=pr.current,Ne(pr,e),Ne(Gr,Gr.current),!0}function z0(e,t,n){var r=e.stateNode;if(!r)throw Error(ot(169));n?(e=lE(e,t,rl),r.__reactInternalMemoizedMergedChildContext=e,Te(Gr),Te(pr),Ne(pr,e)):Te(Gr),Ne(Gr,n)}var oo=null,lp=!1,Bg=!1;function uE(e){oo===null?oo=[e]:oo.push(e)}function gL(e){lp=!0,uE(e)}function Na(){if(!Bg&&oo!==null){Bg=!0;var e=0,t=pe;try{var n=oo;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}oo=null,lp=!1}catch(i){throw oo!==null&&(oo=oo.slice(e+1)),A1(Xv,Na),i}finally{pe=t,Bg=!1}}return null}var Kl=[],Ql=0,xd=null,wd=0,Oi=[],Ri=0,il=null,ao=1,lo="";function qa(e,t){Kl[Ql++]=wd,Kl[Ql++]=xd,xd=e,wd=t}function cE(e,t,n){Oi[Ri++]=ao,Oi[Ri++]=lo,Oi[Ri++]=il,il=e;var r=ao;e=lo;var i=32-hs(r)-1;r&=~(1<<i),n+=1;var s=32-hs(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,ao=1<<32-hs(t)+i|n<<i|r,lo=s+e}else ao=1<<s|n<<i|r,lo=e}function ry(e){e.return!==null&&(qa(e,1),cE(e,1,0))}function iy(e){for(;e===xd;)xd=Kl[--Ql],Kl[Ql]=null,wd=Kl[--Ql],Kl[Ql]=null;for(;e===il;)il=Oi[--Ri],Oi[Ri]=null,lo=Oi[--Ri],Oi[Ri]=null,ao=Oi[--Ri],Oi[Ri]=null}var si=null,ii=null,ke=!1,as=null;function fE(e,t){var n=Ai(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function B0(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,si=e,ii=na(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,si=e,ii=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=il!==null?{id:ao,overflow:lo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ai(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,si=e,ii=null,!0):!1;default:return!1}}function Um(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vm(e){if(ke){var t=ii;if(t){var n=t;if(!B0(e,t)){if(Um(e))throw Error(ot(418));t=na(n.nextSibling);var r=si;t&&B0(e,t)?fE(r,n):(e.flags=e.flags&-4097|2,ke=!1,si=e)}}else{if(Um(e))throw Error(ot(418));e.flags=e.flags&-4097|2,ke=!1,si=e}}}function U0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;si=e}function Ph(e){if(e!==si)return!1;if(!ke)return U0(e),ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fm(e.type,e.memoizedProps)),t&&(t=ii)){if(Um(e))throw hE(),Error(ot(418));for(;t;)fE(e,t),t=na(t.nextSibling)}if(U0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ot(317));t:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ii=na(e.nextSibling);break t}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ii=null}}else ii=si?na(e.stateNode.nextSibling):null;return!0}function hE(){for(var e=ii;e;)e=na(e.nextSibling)}function cu(){ii=si=null,ke=!1}function sy(e){as===null?as=[e]:as.push(e)}var mL=Io.ReactCurrentBatchConfig;function gc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ot(309));var r=n.stateNode}if(!r)throw Error(ot(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var l=i.refs;a===null?delete l[s]:l[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(ot(284));if(!n._owner)throw Error(ot(290,e))}return e}function bh(e,t){throw e=Object.prototype.toString.call(t),Error(ot(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function V0(e){var t=e._init;return t(e._payload)}function dE(e){function t(E,w){if(e){var N=E.deletions;N===null?(E.deletions=[w],E.flags|=16):N.push(w)}}function n(E,w){if(!e)return null;for(;w!==null;)t(E,w),w=w.sibling;return null}function r(E,w){for(E=new Map;w!==null;)w.key!==null?E.set(w.key,w):E.set(w.index,w),w=w.sibling;return E}function i(E,w){return E=oa(E,w),E.index=0,E.sibling=null,E}function s(E,w,N){return E.index=N,e?(N=E.alternate,N!==null?(N=N.index,N<w?(E.flags|=2,w):N):(E.flags|=2,w)):(E.flags|=1048576,w)}function a(E){return e&&E.alternate===null&&(E.flags|=2),E}function l(E,w,N,I){return w===null||w.tag!==6?(w=Wg(N,E.mode,I),w.return=E,w):(w=i(w,N),w.return=E,w)}function c(E,w,N,I){var R=N.type;return R===ql?g(E,w,N.props.children,I,N.key):w!==null&&(w.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Bo&&V0(R)===w.type)?(I=i(w,N.props),I.ref=gc(E,w,N),I.return=E,I):(I=Jh(N.type,N.key,N.props,null,E.mode,I),I.ref=gc(E,w,N),I.return=E,I)}function f(E,w,N,I){return w===null||w.tag!==4||w.stateNode.containerInfo!==N.containerInfo||w.stateNode.implementation!==N.implementation?(w=Xg(N,E.mode,I),w.return=E,w):(w=i(w,N.children||[]),w.return=E,w)}function g(E,w,N,I,R){return w===null||w.tag!==7?(w=el(N,E.mode,I,R),w.return=E,w):(w=i(w,N),w.return=E,w)}function d(E,w,N){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Wg(""+w,E.mode,N),w.return=E,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case mh:return N=Jh(w.type,w.key,w.props,null,E.mode,N),N.ref=gc(E,null,w),N.return=E,N;case Gl:return w=Xg(w,E.mode,N),w.return=E,w;case Bo:var I=w._init;return d(E,I(w._payload),N)}if(Sc(w)||cc(w))return w=el(w,E.mode,N,null),w.return=E,w;bh(E,w)}return null}function v(E,w,N,I){var R=w!==null?w.key:null;if(typeof N=="string"&&N!==""||typeof N=="number")return R!==null?null:l(E,w,""+N,I);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case mh:return N.key===R?c(E,w,N,I):null;case Gl:return N.key===R?f(E,w,N,I):null;case Bo:return R=N._init,v(E,w,R(N._payload),I)}if(Sc(N)||cc(N))return R!==null?null:g(E,w,N,I,null);bh(E,N)}return null}function y(E,w,N,I,R){if(typeof I=="string"&&I!==""||typeof I=="number")return E=E.get(N)||null,l(w,E,""+I,R);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case mh:return E=E.get(I.key===null?N:I.key)||null,c(w,E,I,R);case Gl:return E=E.get(I.key===null?N:I.key)||null,f(w,E,I,R);case Bo:var A=I._init;return y(E,w,N,A(I._payload),R)}if(Sc(I)||cc(I))return E=E.get(N)||null,g(w,E,I,R,null);bh(w,I)}return null}function x(E,w,N,I){for(var R=null,A=null,B=w,q=w=0,Q=null;B!==null&&q<N.length;q++){B.index>q?(Q=B,B=null):Q=B.sibling;var Y=v(E,B,N[q],I);if(Y===null){B===null&&(B=Q);break}e&&B&&Y.alternate===null&&t(E,B),w=s(Y,w,q),A===null?R=Y:A.sibling=Y,A=Y,B=Q}if(q===N.length)return n(E,B),ke&&qa(E,q),R;if(B===null){for(;q<N.length;q++)B=d(E,N[q],I),B!==null&&(w=s(B,w,q),A===null?R=B:A.sibling=B,A=B);return ke&&qa(E,q),R}for(B=r(E,B);q<N.length;q++)Q=y(B,E,q,N[q],I),Q!==null&&(e&&Q.alternate!==null&&B.delete(Q.key===null?q:Q.key),w=s(Q,w,q),A===null?R=Q:A.sibling=Q,A=Q);return e&&B.forEach(function(J){return t(E,J)}),ke&&qa(E,q),R}function S(E,w,N,I){var R=cc(N);if(typeof R!="function")throw Error(ot(150));if(N=R.call(N),N==null)throw Error(ot(151));for(var A=R=null,B=w,q=w=0,Q=null,Y=N.next();B!==null&&!Y.done;q++,Y=N.next()){B.index>q?(Q=B,B=null):Q=B.sibling;var J=v(E,B,Y.value,I);if(J===null){B===null&&(B=Q);break}e&&B&&J.alternate===null&&t(E,B),w=s(J,w,q),A===null?R=J:A.sibling=J,A=J,B=Q}if(Y.done)return n(E,B),ke&&qa(E,q),R;if(B===null){for(;!Y.done;q++,Y=N.next())Y=d(E,Y.value,I),Y!==null&&(w=s(Y,w,q),A===null?R=Y:A.sibling=Y,A=Y);return ke&&qa(E,q),R}for(B=r(E,B);!Y.done;q++,Y=N.next())Y=y(B,E,q,Y.value,I),Y!==null&&(e&&Y.alternate!==null&&B.delete(Y.key===null?q:Y.key),w=s(Y,w,q),A===null?R=Y:A.sibling=Y,A=Y);return e&&B.forEach(function(W){return t(E,W)}),ke&&qa(E,q),R}function C(E,w,N,I){if(typeof N=="object"&&N!==null&&N.type===ql&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case mh:t:{for(var R=N.key,A=w;A!==null;){if(A.key===R){if(R=N.type,R===ql){if(A.tag===7){n(E,A.sibling),w=i(A,N.props.children),w.return=E,E=w;break t}}else if(A.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Bo&&V0(R)===A.type){n(E,A.sibling),w=i(A,N.props),w.ref=gc(E,A,N),w.return=E,E=w;break t}n(E,A);break}else t(E,A);A=A.sibling}N.type===ql?(w=el(N.props.children,E.mode,I,N.key),w.return=E,E=w):(I=Jh(N.type,N.key,N.props,null,E.mode,I),I.ref=gc(E,w,N),I.return=E,E=I)}return a(E);case Gl:t:{for(A=N.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===N.containerInfo&&w.stateNode.implementation===N.implementation){n(E,w.sibling),w=i(w,N.children||[]),w.return=E,E=w;break t}else{n(E,w);break}else t(E,w);w=w.sibling}w=Xg(N,E.mode,I),w.return=E,E=w}return a(E);case Bo:return A=N._init,C(E,w,A(N._payload),I)}if(Sc(N))return x(E,w,N,I);if(cc(N))return S(E,w,N,I);bh(E,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,w!==null&&w.tag===6?(n(E,w.sibling),w=i(w,N),w.return=E,E=w):(n(E,w),w=Wg(N,E.mode,I),w.return=E,E=w),a(E)):n(E,w)}return C}var fu=dE(!0),pE=dE(!1),Ed=Ca(null),Sd=null,Jl=null,oy=null;function ay(){oy=Jl=Sd=null}function ly(e){var t=Ed.current;Te(Ed),e._currentValue=t}function Gm(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ou(e,t){Sd=e,oy=Jl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vr=!0),e.firstContext=null)}function ji(e){var t=e._currentValue;if(oy!==e)if(e={context:e,memoizedValue:t,next:null},Jl===null){if(Sd===null)throw Error(ot(308));Jl=e,Sd.dependencies={lanes:0,firstContext:e}}else Jl=Jl.next=e;return t}var Xa=null;function uy(e){Xa===null?Xa=[e]:Xa.push(e)}function gE(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,uy(t)):(n.next=i.next,i.next=n),t.interleaved=n,vo(e,r)}function vo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Uo=!1;function cy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mE(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,vo(e,n)}return i=r.interleaved,i===null?(t.next=t,uy(r)):(t.next=i.next,i.next=t),r.interleaved=t,vo(e,n)}function Zh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yv(e,n)}}function G0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Cd(e,t,n,r){var i=e.updateQueue;Uo=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,f=c.next;c.next=null,a===null?s=f:a.next=f,a=c;var g=e.alternate;g!==null&&(g=g.updateQueue,l=g.lastBaseUpdate,l!==a&&(l===null?g.firstBaseUpdate=f:l.next=f,g.lastBaseUpdate=c))}if(s!==null){var d=i.baseState;a=0,g=f=c=null,l=s;do{var v=l.lane,y=l.eventTime;if((r&v)===v){g!==null&&(g=g.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var x=e,S=l;switch(v=t,y=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){d=x.call(y,d,v);break t}d=x;break t;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,v=typeof x=="function"?x.call(y,d,v):x,v==null)break t;d=Xe({},d,v);break t;case 2:Uo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,v=i.effects,v===null?i.effects=[l]:v.push(l))}else y={eventTime:y,lane:v,tag:l.tag,payload:l.payload,callback:l.callback,next:null},g===null?(f=g=y,c=d):g=g.next=y,a|=v;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;v=l,l=v.next,v.next=null,i.lastBaseUpdate=v,i.shared.pending=null}}while(!0);if(g===null&&(c=d),i.baseState=c,i.firstBaseUpdate=f,i.lastBaseUpdate=g,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);ol|=a,e.lanes=a,e.memoizedState=d}}function q0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ot(191,i));i.call(r)}}}var If={},Gs=Ca(If),tf=Ca(If),ef=Ca(If);function Ya(e){if(e===If)throw Error(ot(174));return e}function fy(e,t){switch(Ne(ef,t),Ne(tf,e),Ne(Gs,If),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Sm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Sm(t,e)}Te(Gs),Ne(Gs,t)}function hu(){Te(Gs),Te(tf),Te(ef)}function vE(e){Ya(ef.current);var t=Ya(Gs.current),n=Sm(t,e.type);t!==n&&(Ne(tf,e),Ne(Gs,n))}function hy(e){tf.current===e&&(Te(Gs),Te(tf))}var Ve=Ca(0);function Nd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ug=[];function dy(){for(var e=0;e<Ug.length;e++)Ug[e]._workInProgressVersionPrimary=null;Ug.length=0}var Wh=Io.ReactCurrentDispatcher,Vg=Io.ReactCurrentBatchConfig,sl=0,We=null,In=null,jn=null,Pd=!1,Ac=!1,nf=0,vL=0;function lr(){throw Error(ot(321))}function py(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ms(e[n],t[n]))return!1;return!0}function gy(e,t,n,r,i,s){if(sl=s,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wh.current=e===null||e.memoizedState===null?wL:EL,e=n(r,i),Ac){s=0;do{if(Ac=!1,nf=0,25<=s)throw Error(ot(301));s+=1,jn=In=null,t.updateQueue=null,Wh.current=SL,e=n(r,i)}while(Ac)}if(Wh.current=bd,t=In!==null&&In.next!==null,sl=0,jn=In=We=null,Pd=!1,t)throw Error(ot(300));return e}function my(){var e=nf!==0;return nf=0,e}function As(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?We.memoizedState=jn=e:jn=jn.next=e,jn}function zi(){if(In===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=In.next;var t=jn===null?We.memoizedState:jn.next;if(t!==null)jn=t,In=e;else{if(e===null)throw Error(ot(310));In=e,e={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},jn===null?We.memoizedState=jn=e:jn=jn.next=e}return jn}function rf(e,t){return typeof t=="function"?t(e):t}function Gg(e){var t=zi(),n=t.queue;if(n===null)throw Error(ot(311));n.lastRenderedReducer=e;var r=In,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=a=null,c=null,f=s;do{var g=f.lane;if((sl&g)===g)c!==null&&(c=c.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:e(r,f.action);else{var d={lane:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(l=c=d,a=r):c=c.next=d,We.lanes|=g,ol|=g}f=f.next}while(f!==null&&f!==s);c===null?a=r:c.next=l,ms(r,t.memoizedState)||(Vr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,We.lanes|=s,ol|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function qg(e){var t=zi(),n=t.queue;if(n===null)throw Error(ot(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);ms(s,t.memoizedState)||(Vr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function yE(){}function _E(e,t){var n=We,r=zi(),i=t(),s=!ms(r.memoizedState,i);if(s&&(r.memoizedState=i,Vr=!0),r=r.queue,vy(EE.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||jn!==null&&jn.memoizedState.tag&1){if(n.flags|=2048,sf(9,wE.bind(null,n,r,i,t),void 0,null),Gn===null)throw Error(ot(349));sl&30||xE(n,t,i)}return i}function xE(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wE(e,t,n,r){t.value=n,t.getSnapshot=r,SE(t)&&CE(e)}function EE(e,t,n){return n(function(){SE(t)&&CE(e)})}function SE(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ms(e,n)}catch{return!0}}function CE(e){var t=vo(e,1);t!==null&&ds(t,e,1,-1)}function H0(e){var t=As();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rf,lastRenderedState:e},t.queue=e,e=e.dispatch=xL.bind(null,We,e),[t.memoizedState,e]}function sf(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function NE(){return zi().memoizedState}function Xh(e,t,n,r){var i=As();We.flags|=e,i.memoizedState=sf(1|t,n,void 0,r===void 0?null:r)}function up(e,t,n,r){var i=zi();r=r===void 0?null:r;var s=void 0;if(In!==null){var a=In.memoizedState;if(s=a.destroy,r!==null&&py(r,a.deps)){i.memoizedState=sf(t,n,s,r);return}}We.flags|=e,i.memoizedState=sf(1|t,n,s,r)}function Z0(e,t){return Xh(8390656,8,e,t)}function vy(e,t){return up(2048,8,e,t)}function PE(e,t){return up(4,2,e,t)}function bE(e,t){return up(4,4,e,t)}function LE(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function IE(e,t,n){return n=n!=null?n.concat([e]):null,up(4,4,LE.bind(null,t,e),n)}function yy(){}function TE(e,t){var n=zi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&py(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function OE(e,t){var n=zi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&py(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function RE(e,t,n){return sl&21?(ms(n,t)||(n=F1(),We.lanes|=n,ol|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vr=!0),e.memoizedState=n)}function yL(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=Vg.transition;Vg.transition={};try{e(!1),t()}finally{pe=n,Vg.transition=r}}function ME(){return zi().memoizedState}function _L(e,t,n){var r=sa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},AE(e))DE(t,n);else if(n=gE(e,t,n,r),n!==null){var i=Lr();ds(n,e,r,i),kE(n,t,r)}}function xL(e,t,n){var r=sa(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(AE(e))DE(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(i.hasEagerState=!0,i.eagerState=l,ms(l,a)){var c=t.interleaved;c===null?(i.next=i,uy(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=gE(e,t,i,r),n!==null&&(i=Lr(),ds(n,e,r,i),kE(n,t,r))}}function AE(e){var t=e.alternate;return e===We||t!==null&&t===We}function DE(e,t){Ac=Pd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kE(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yv(e,n)}}var bd={readContext:ji,useCallback:lr,useContext:lr,useEffect:lr,useImperativeHandle:lr,useInsertionEffect:lr,useLayoutEffect:lr,useMemo:lr,useReducer:lr,useRef:lr,useState:lr,useDebugValue:lr,useDeferredValue:lr,useTransition:lr,useMutableSource:lr,useSyncExternalStore:lr,useId:lr,unstable_isNewReconciler:!1},wL={readContext:ji,useCallback:function(e,t){return As().memoizedState=[e,t===void 0?null:t],e},useContext:ji,useEffect:Z0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xh(4194308,4,LE.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xh(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xh(4,2,e,t)},useMemo:function(e,t){var n=As();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=As();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_L.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=As();return e={current:e},t.memoizedState=e},useState:H0,useDebugValue:yy,useDeferredValue:function(e){return As().memoizedState=e},useTransition:function(){var e=H0(!1),t=e[0];return e=yL.bind(null,e[1]),As().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,i=As();if(ke){if(n===void 0)throw Error(ot(407));n=n()}else{if(n=t(),Gn===null)throw Error(ot(349));sl&30||xE(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Z0(EE.bind(null,r,s,e),[e]),r.flags|=2048,sf(9,wE.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=As(),t=Gn.identifierPrefix;if(ke){var n=lo,r=ao;n=(r&~(1<<32-hs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nf++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vL++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},EL={readContext:ji,useCallback:TE,useContext:ji,useEffect:vy,useImperativeHandle:IE,useInsertionEffect:PE,useLayoutEffect:bE,useMemo:OE,useReducer:Gg,useRef:NE,useState:function(){return Gg(rf)},useDebugValue:yy,useDeferredValue:function(e){var t=zi();return RE(t,In.memoizedState,e)},useTransition:function(){var e=Gg(rf)[0],t=zi().memoizedState;return[e,t]},useMutableSource:yE,useSyncExternalStore:_E,useId:ME,unstable_isNewReconciler:!1},SL={readContext:ji,useCallback:TE,useContext:ji,useEffect:vy,useImperativeHandle:IE,useInsertionEffect:PE,useLayoutEffect:bE,useMemo:OE,useReducer:qg,useRef:NE,useState:function(){return qg(rf)},useDebugValue:yy,useDeferredValue:function(e){var t=zi();return In===null?t.memoizedState=e:RE(t,In.memoizedState,e)},useTransition:function(){var e=qg(rf)[0],t=zi().memoizedState;return[e,t]},useMutableSource:yE,useSyncExternalStore:_E,useId:ME,unstable_isNewReconciler:!1};function ss(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cp={isMounted:function(e){return(e=e._reactInternals)?Sl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Lr(),i=sa(e),s=co(r,i);s.payload=t,n!=null&&(s.callback=n),t=ra(e,s,i),t!==null&&(ds(t,e,i,r),Zh(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Lr(),i=sa(e),s=co(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ra(e,s,i),t!==null&&(ds(t,e,i,r),Zh(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Lr(),r=sa(e),i=co(n,r);i.tag=2,t!=null&&(i.callback=t),t=ra(e,i,r),t!==null&&(ds(t,e,r,n),Zh(t,e,r))}};function W0(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!Kc(n,r)||!Kc(i,s):!0}function FE(e,t,n){var r=!1,i=ha,s=t.contextType;return typeof s=="object"&&s!==null?s=ji(s):(i=qr(t)?rl:pr.current,r=t.contextTypes,s=(r=r!=null)?uu(e,i):ha),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function X0(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&cp.enqueueReplaceState(t,t.state,null)}function Hm(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},cy(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=ji(s):(s=qr(t)?rl:pr.current,i.context=uu(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(qm(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&cp.enqueueReplaceState(i,i.state,null),Cd(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function du(e,t){try{var n="",r=t;do n+=QP(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Hg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Zm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var CL=typeof WeakMap=="function"?WeakMap:Map;function jE(e,t,n){n=co(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Id||(Id=!0,nv=r),Zm(e,t)},n}function zE(e,t,n){n=co(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Zm(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Zm(e,t),typeof r!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Y0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new CL;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=jL.bind(null,e,t,n),t.then(e,e))}function K0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Q0(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=co(-1,1),t.tag=2,ra(n,t,1))),n.lanes|=1),e)}var NL=Io.ReactCurrentOwner,Vr=!1;function Nr(e,t,n,r){t.child=e===null?pE(t,null,n,r):fu(t,e.child,n,r)}function J0(e,t,n,r,i){n=n.render;var s=t.ref;return ou(t,i),r=gy(e,t,n,r,s,i),n=my(),e!==null&&!Vr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,yo(e,t,i)):(ke&&n&&ry(t),t.flags|=1,Nr(e,t,r,i),t.child)}function $0(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Py(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,BE(e,t,s,r,i)):(e=Jh(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Kc,n(a,r)&&e.ref===t.ref)return yo(e,t,i)}return t.flags|=1,e=oa(s,r),e.ref=t.ref,e.return=t,t.child=e}function BE(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Kc(s,r)&&e.ref===t.ref)if(Vr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Vr=!0);else return t.lanes=e.lanes,yo(e,t,i)}return Wm(e,t,n,r,i)}function UE(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(tu,ri),ri|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(tu,ri),ri|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ne(tu,ri),ri|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ne(tu,ri),ri|=r;return Nr(e,t,i,n),t.child}function VE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wm(e,t,n,r,i){var s=qr(n)?rl:pr.current;return s=uu(t,s),ou(t,i),n=gy(e,t,n,r,s,i),r=my(),e!==null&&!Vr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,yo(e,t,i)):(ke&&r&&ry(t),t.flags|=1,Nr(e,t,n,i),t.child)}function tx(e,t,n,r,i){if(qr(n)){var s=!0;_d(t)}else s=!1;if(ou(t,i),t.stateNode===null)Yh(e,t),FE(t,n,r),Hm(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,f=n.contextType;typeof f=="object"&&f!==null?f=ji(f):(f=qr(n)?rl:pr.current,f=uu(t,f));var g=n.getDerivedStateFromProps,d=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==f)&&X0(t,a,r,f),Uo=!1;var v=t.memoizedState;a.state=v,Cd(t,r,a,i),c=t.memoizedState,l!==r||v!==c||Gr.current||Uo?(typeof g=="function"&&(qm(t,n,g,r),c=t.memoizedState),(l=Uo||W0(t,n,l,r,v,c,f))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=f,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mE(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:ss(t.type,l),a.props=f,d=t.pendingProps,v=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=ji(c):(c=qr(n)?rl:pr.current,c=uu(t,c));var y=n.getDerivedStateFromProps;(g=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==d||v!==c)&&X0(t,a,r,c),Uo=!1,v=t.memoizedState,a.state=v,Cd(t,r,a,i);var x=t.memoizedState;l!==d||v!==x||Gr.current||Uo?(typeof y=="function"&&(qm(t,n,y,r),x=t.memoizedState),(f=Uo||W0(t,n,f,r,v,x,c)||!1)?(g||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,x,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,x,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),a.props=r,a.state=x,a.context=c,r=f):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),r=!1)}return Xm(e,t,n,r,s,i)}function Xm(e,t,n,r,i,s){VE(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&z0(t,n,!1),yo(e,t,s);r=t.stateNode,NL.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=fu(t,e.child,null,s),t.child=fu(t,null,l,s)):Nr(e,t,l,s),t.memoizedState=r.state,i&&z0(t,n,!0),t.child}function GE(e){var t=e.stateNode;t.pendingContext?j0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&j0(e,t.context,!1),fy(e,t.containerInfo)}function ex(e,t,n,r,i){return cu(),sy(i),t.flags|=256,Nr(e,t,n,r),t.child}var Ym={dehydrated:null,treeContext:null,retryLane:0};function Km(e){return{baseLanes:e,cachePool:null,transitions:null}}function qE(e,t,n){var r=t.pendingProps,i=Ve.current,s=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ne(Ve,i&1),e===null)return Vm(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=dp(a,r,0,null),e=el(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Km(n),t.memoizedState=Ym,e):_y(t,a));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return PL(e,t,a,r,l,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=oa(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=oa(l,s):(s=el(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?Km(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=Ym,r}return s=e.child,e=s.sibling,r=oa(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function _y(e,t){return t=dp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Lh(e,t,n,r){return r!==null&&sy(r),fu(t,e.child,null,n),e=_y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PL(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Hg(Error(ot(422))),Lh(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=dp({mode:"visible",children:r.children},i,0,null),s=el(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&fu(t,e.child,null,a),t.child.memoizedState=Km(a),t.memoizedState=Ym,s);if(!(t.mode&1))return Lh(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(ot(419)),r=Hg(s,r,void 0),Lh(e,t,a,r)}if(l=(a&e.childLanes)!==0,Vr||l){if(r=Gn,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,vo(e,i),ds(r,e,i,-1))}return Ny(),r=Hg(Error(ot(421))),Lh(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=zL.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ii=na(i.nextSibling),si=t,ke=!0,as=null,e!==null&&(Oi[Ri++]=ao,Oi[Ri++]=lo,Oi[Ri++]=il,ao=e.id,lo=e.overflow,il=t),t=_y(t,r.children),t.flags|=4096,t)}function nx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gm(e.return,t,n)}function Zg(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function HE(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nr(e,t,r.children,n),r=Ve.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)t:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nx(e,n,t);else if(e.tag===19)nx(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ne(Ve,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Nd(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Zg(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Nd(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Zg(t,!0,n,null,s);break;case"together":Zg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ol|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ot(153));if(t.child!==null){for(e=t.child,n=oa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bL(e,t,n){switch(t.tag){case 3:GE(t),cu();break;case 5:vE(t);break;case 1:qr(t.type)&&_d(t);break;case 4:fy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ne(Ed,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne(Ve,Ve.current&1),t.flags|=128,null):n&t.child.childLanes?qE(e,t,n):(Ne(Ve,Ve.current&1),e=yo(e,t,n),e!==null?e.sibling:null);Ne(Ve,Ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return HE(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ne(Ve,Ve.current),r)break;return null;case 22:case 23:return t.lanes=0,UE(e,t,n)}return yo(e,t,n)}var ZE,Qm,WE,XE;ZE=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Qm=function(){};WE=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ya(Gs.current);var s=null;switch(n){case"input":i=_m(e,i),r=_m(e,r),s=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),s=[];break;case"textarea":i=Em(e,i),r=Em(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vd)}Cm(n,r);var a;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Gc.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(l=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&c!==l&&(c!=null||l!=null))if(f==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(f,n)),n=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Gc.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&Le("scroll",e),s||l===c||(s=[])):(s=s||[]).push(f,c))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}};XE=function(e,t,n,r){n!==r&&(t.flags|=4)};function mc(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ur(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function LL(e,t,n){var r=t.pendingProps;switch(iy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(t),null;case 1:return qr(t.type)&&yd(),ur(t),null;case 3:return r=t.stateNode,hu(),Te(Gr),Te(pr),dy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ph(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,as!==null&&(sv(as),as=null))),Qm(e,t),ur(t),null;case 5:hy(t);var i=Ya(ef.current);if(n=t.type,e!==null&&t.stateNode!=null)WE(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ot(166));return ur(t),null}if(e=Ya(Gs.current),Ph(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[zs]=t,r[$c]=s,e=(t.mode&1)!==0,n){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(i=0;i<Nc.length;i++)Le(Nc[i],r);break;case"source":Le("error",r);break;case"img":case"image":case"link":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"input":f0(r,s),Le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Le("invalid",r);break;case"textarea":d0(r,s),Le("invalid",r)}Cm(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var l=s[a];a==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&Nh(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Nh(r.textContent,l,e),i=["children",""+l]):Gc.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&Le("scroll",r)}switch(n){case"input":vh(r),h0(r,s,!0);break;case"textarea":vh(r),p0(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=vd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=E1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[zs]=t,e[$c]=r,ZE(e,t,!1,!1),t.stateNode=e;t:{switch(a=Nm(n,r),n){case"dialog":Le("cancel",e),Le("close",e),i=r;break;case"iframe":case"object":case"embed":Le("load",e),i=r;break;case"video":case"audio":for(i=0;i<Nc.length;i++)Le(Nc[i],e);i=r;break;case"source":Le("error",e),i=r;break;case"img":case"image":case"link":Le("error",e),Le("load",e),i=r;break;case"details":Le("toggle",e),i=r;break;case"input":f0(e,r),i=_m(e,r),Le("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),Le("invalid",e);break;case"textarea":d0(e,r),i=Em(e,r),Le("invalid",e);break;default:i=r}Cm(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?N1(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&S1(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&qc(e,c):typeof c=="number"&&qc(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Gc.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Le("scroll",e):c!=null&&Gv(e,s,c,a))}switch(n){case"input":vh(e),h0(e,r,!1);break;case"textarea":vh(e),p0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fa(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?nu(e,!!r.multiple,s,!1):r.defaultValue!=null&&nu(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=vd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ur(t),null;case 6:if(e&&t.stateNode!=null)XE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ot(166));if(n=Ya(ef.current),Ya(Gs.current),Ph(t)){if(r=t.stateNode,n=t.memoizedProps,r[zs]=t,(s=r.nodeValue!==n)&&(e=si,e!==null))switch(e.tag){case 3:Nh(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nh(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[zs]=t,t.stateNode=r}return ur(t),null;case 13:if(Te(Ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ke&&ii!==null&&t.mode&1&&!(t.flags&128))hE(),cu(),t.flags|=98560,s=!1;else if(s=Ph(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(ot(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ot(317));s[zs]=t}else cu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ur(t),s=!1}else as!==null&&(sv(as),as=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ve.current&1?On===0&&(On=3):Ny())),t.updateQueue!==null&&(t.flags|=4),ur(t),null);case 4:return hu(),Qm(e,t),e===null&&Qc(t.stateNode.containerInfo),ur(t),null;case 10:return ly(t.type._context),ur(t),null;case 17:return qr(t.type)&&yd(),ur(t),null;case 19:if(Te(Ve),s=t.memoizedState,s===null)return ur(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)mc(s,!1);else{if(On!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Nd(e),a!==null){for(t.flags|=128,mc(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ne(Ve,Ve.current&1|2),t.child}e=e.sibling}s.tail!==null&&nn()>pu&&(t.flags|=128,r=!0,mc(s,!1),t.lanes=4194304)}else{if(!r)if(e=Nd(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!ke)return ur(t),null}else 2*nn()-s.renderingStartTime>pu&&n!==1073741824&&(t.flags|=128,r=!0,mc(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nn(),t.sibling=null,n=Ve.current,Ne(Ve,r?n&1|2:n&1),t):(ur(t),null);case 22:case 23:return Cy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ri&1073741824&&(ur(t),t.subtreeFlags&6&&(t.flags|=8192)):ur(t),null;case 24:return null;case 25:return null}throw Error(ot(156,t.tag))}function IL(e,t){switch(iy(t),t.tag){case 1:return qr(t.type)&&yd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hu(),Te(Gr),Te(pr),dy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return hy(t),null;case 13:if(Te(Ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ot(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Ve),null;case 4:return hu(),null;case 10:return ly(t.type._context),null;case 22:case 23:return Cy(),null;case 24:return null;default:return null}}var Ih=!1,fr=!1,TL=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function $l(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function Jm(e,t,n){try{n()}catch(r){Qe(e,t,r)}}var rx=!1;function OL(e,t){if(Dm=pd,e=$1(),ny(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var a=0,l=-1,c=-1,f=0,g=0,d=e,v=null;e:for(;;){for(var y;d!==n||i!==0&&d.nodeType!==3||(l=a+i),d!==s||r!==0&&d.nodeType!==3||(c=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(y=d.firstChild)!==null;)v=d,d=y;for(;;){if(d===e)break e;if(v===n&&++f===i&&(l=a),v===s&&++g===r&&(c=a),(y=d.nextSibling)!==null)break;d=v,v=d.parentNode}d=y}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(km={focusedElem:e,selectionRange:n},pd=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){t=Ct;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,C=x.memoizedState,E=t.stateNode,w=E.getSnapshotBeforeUpdate(t.elementType===t.type?S:ss(t.type,S),C);E.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var N=t.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ot(163))}}catch(I){Qe(t,t.return,I)}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}return x=rx,rx=!1,x}function Dc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Jm(t,n,s)}i=i.next}while(i!==r)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $m(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function YE(e){var t=e.alternate;t!==null&&(e.alternate=null,YE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zs],delete t[$c],delete t[zm],delete t[dL],delete t[pL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function KE(e){return e.tag===5||e.tag===3||e.tag===4}function ix(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||KE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vd));else if(r!==4&&(e=e.child,e!==null))for(tv(e,t,n),e=e.sibling;e!==null;)tv(e,t,n),e=e.sibling}function ev(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ev(e,t,n),e=e.sibling;e!==null;)ev(e,t,n),e=e.sibling}var Qn=null,os=!1;function Fo(e,t,n){for(n=n.child;n!==null;)QE(e,t,n),n=n.sibling}function QE(e,t,n){if(Vs&&typeof Vs.onCommitFiberUnmount=="function")try{Vs.onCommitFiberUnmount(rp,n)}catch{}switch(n.tag){case 5:fr||$l(n,t);case 6:var r=Qn,i=os;Qn=null,Fo(e,t,n),Qn=r,os=i,Qn!==null&&(os?(e=Qn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qn.removeChild(n.stateNode));break;case 18:Qn!==null&&(os?(e=Qn,n=n.stateNode,e.nodeType===8?zg(e.parentNode,n):e.nodeType===1&&zg(e,n),Xc(e)):zg(Qn,n.stateNode));break;case 4:r=Qn,i=os,Qn=n.stateNode.containerInfo,os=!0,Fo(e,t,n),Qn=r,os=i;break;case 0:case 11:case 14:case 15:if(!fr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Jm(n,t,a),i=i.next}while(i!==r)}Fo(e,t,n);break;case 1:if(!fr&&($l(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Qe(n,t,l)}Fo(e,t,n);break;case 21:Fo(e,t,n);break;case 22:n.mode&1?(fr=(r=fr)||n.memoizedState!==null,Fo(e,t,n),fr=r):Fo(e,t,n);break;default:Fo(e,t,n)}}function sx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new TL),t.forEach(function(r){var i=BL.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function rs(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,l=a;t:for(;l!==null;){switch(l.tag){case 5:Qn=l.stateNode,os=!1;break t;case 3:Qn=l.stateNode.containerInfo,os=!0;break t;case 4:Qn=l.stateNode.containerInfo,os=!0;break t}l=l.return}if(Qn===null)throw Error(ot(160));QE(s,a,i),Qn=null,os=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(f){Qe(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)JE(t,e),t=t.sibling}function JE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(rs(t,e),Rs(e),r&4){try{Dc(3,e,e.return),fp(3,e)}catch(S){Qe(e,e.return,S)}try{Dc(5,e,e.return)}catch(S){Qe(e,e.return,S)}}break;case 1:rs(t,e),Rs(e),r&512&&n!==null&&$l(n,n.return);break;case 5:if(rs(t,e),Rs(e),r&512&&n!==null&&$l(n,n.return),e.flags&32){var i=e.stateNode;try{qc(i,"")}catch(S){Qe(e,e.return,S)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&x1(i,s),Nm(l,a);var f=Nm(l,s);for(a=0;a<c.length;a+=2){var g=c[a],d=c[a+1];g==="style"?N1(i,d):g==="dangerouslySetInnerHTML"?S1(i,d):g==="children"?qc(i,d):Gv(i,g,d,f)}switch(l){case"input":xm(i,s);break;case"textarea":w1(i,s);break;case"select":var v=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var y=s.value;y!=null?nu(i,!!s.multiple,y,!1):v!==!!s.multiple&&(s.defaultValue!=null?nu(i,!!s.multiple,s.defaultValue,!0):nu(i,!!s.multiple,s.multiple?[]:"",!1))}i[$c]=s}catch(S){Qe(e,e.return,S)}}break;case 6:if(rs(t,e),Rs(e),r&4){if(e.stateNode===null)throw Error(ot(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(S){Qe(e,e.return,S)}}break;case 3:if(rs(t,e),Rs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Xc(t.containerInfo)}catch(S){Qe(e,e.return,S)}break;case 4:rs(t,e),Rs(e);break;case 13:rs(t,e),Rs(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Ey=nn())),r&4&&sx(e);break;case 22:if(g=n!==null&&n.memoizedState!==null,e.mode&1?(fr=(f=fr)||g,rs(t,e),fr=f):rs(t,e),Rs(e),r&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(Ct=e,g=e.child;g!==null;){for(d=Ct=g;Ct!==null;){switch(v=Ct,y=v.child,v.tag){case 0:case 11:case 14:case 15:Dc(4,v,v.return);break;case 1:$l(v,v.return);var x=v.stateNode;if(typeof x.componentWillUnmount=="function"){r=v,n=v.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(S){Qe(r,n,S)}}break;case 5:$l(v,v.return);break;case 22:if(v.memoizedState!==null){ax(d);continue}}y!==null?(y.return=v,Ct=y):ax(d)}g=g.sibling}t:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{i=d.stateNode,f?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=d.stateNode,c=d.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=C1("display",a))}catch(S){Qe(e,e.return,S)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(S){Qe(e,e.return,S)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break t;for(;d.sibling===null;){if(d.return===null||d.return===e)break t;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:rs(t,e),Rs(e),r&4&&sx(e);break;case 21:break;default:rs(t,e),Rs(e)}}function Rs(e){var t=e.flags;if(t&2){try{t:{for(var n=e.return;n!==null;){if(KE(n)){var r=n;break t}n=n.return}throw Error(ot(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(qc(i,""),r.flags&=-33);var s=ix(e);ev(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,l=ix(e);tv(e,l,a);break;default:throw Error(ot(161))}}catch(c){Qe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function RL(e,t,n){Ct=e,$E(e)}function $E(e,t,n){for(var r=(e.mode&1)!==0;Ct!==null;){var i=Ct,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Ih;if(!a){var l=i.alternate,c=l!==null&&l.memoizedState!==null||fr;l=Ih;var f=fr;if(Ih=a,(fr=c)&&!f)for(Ct=i;Ct!==null;)a=Ct,c=a.child,a.tag===22&&a.memoizedState!==null?lx(i):c!==null?(c.return=a,Ct=c):lx(i);for(;s!==null;)Ct=s,$E(s),s=s.sibling;Ct=i,Ih=l,fr=f}ox(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Ct=s):ox(e)}}function ox(e){for(;Ct!==null;){var t=Ct;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:fr||fp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!fr)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ss(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&q0(t,s,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}q0(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var g=f.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&Xc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ot(163))}fr||t.flags&512&&$m(t)}catch(v){Qe(t,t.return,v)}}if(t===e){Ct=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ct=n;break}Ct=t.return}}function ax(e){for(;Ct!==null;){var t=Ct;if(t===e){Ct=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ct=n;break}Ct=t.return}}function lx(e){for(;Ct!==null;){var t=Ct;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fp(4,t)}catch(c){Qe(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Qe(t,i,c)}}var s=t.return;try{$m(t)}catch(c){Qe(t,s,c)}break;case 5:var a=t.return;try{$m(t)}catch(c){Qe(t,a,c)}}}catch(c){Qe(t,t.return,c)}if(t===e){Ct=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ct=l;break}Ct=t.return}}var ML=Math.ceil,Ld=Io.ReactCurrentDispatcher,xy=Io.ReactCurrentOwner,Di=Io.ReactCurrentBatchConfig,ae=0,Gn=null,yn=null,nr=0,ri=0,tu=Ca(0),On=0,of=null,ol=0,hp=0,wy=0,kc=null,Ur=null,Ey=0,pu=1/0,so=null,Id=!1,nv=null,ia=null,Th=!1,Ko=null,Td=0,Fc=0,rv=null,Kh=-1,Qh=0;function Lr(){return ae&6?nn():Kh!==-1?Kh:Kh=nn()}function sa(e){return e.mode&1?ae&2&&nr!==0?nr&-nr:mL.transition!==null?(Qh===0&&(Qh=F1()),Qh):(e=pe,e!==0||(e=window.event,e=e===void 0?16:q1(e.type)),e):1}function ds(e,t,n,r){if(50<Fc)throw Fc=0,rv=null,Error(ot(185));Pf(e,n,r),(!(ae&2)||e!==Gn)&&(e===Gn&&(!(ae&2)&&(hp|=n),On===4&&qo(e,nr)),Hr(e,r),n===1&&ae===0&&!(t.mode&1)&&(pu=nn()+500,lp&&Na()))}function Hr(e,t){var n=e.callbackNode;mb(e,t);var r=dd(e,e===Gn?nr:0);if(r===0)n!==null&&v0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&v0(n),t===1)e.tag===0?gL(ux.bind(null,e)):uE(ux.bind(null,e)),fL(function(){!(ae&6)&&Na()}),n=null;else{switch(j1(r)){case 1:n=Xv;break;case 4:n=D1;break;case 16:n=hd;break;case 536870912:n=k1;break;default:n=hd}n=aS(n,tS.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tS(e,t){if(Kh=-1,Qh=0,ae&6)throw Error(ot(327));var n=e.callbackNode;if(au()&&e.callbackNode!==n)return null;var r=dd(e,e===Gn?nr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Od(e,r);else{t=r;var i=ae;ae|=2;var s=nS();(Gn!==e||nr!==t)&&(so=null,pu=nn()+500,tl(e,t));do try{kL();break}catch(l){eS(e,l)}while(!0);ay(),Ld.current=s,ae=i,yn!==null?t=0:(Gn=null,nr=0,t=On)}if(t!==0){if(t===2&&(i=Tm(e),i!==0&&(r=i,t=iv(e,i))),t===1)throw n=of,tl(e,0),qo(e,r),Hr(e,nn()),n;if(t===6)qo(e,r);else{if(i=e.current.alternate,!(r&30)&&!AL(i)&&(t=Od(e,r),t===2&&(s=Tm(e),s!==0&&(r=s,t=iv(e,s))),t===1))throw n=of,tl(e,0),qo(e,r),Hr(e,nn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ot(345));case 2:Ha(e,Ur,so);break;case 3:if(qo(e,r),(r&130023424)===r&&(t=Ey+500-nn(),10<t)){if(dd(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Lr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=jm(Ha.bind(null,e,Ur,so),t);break}Ha(e,Ur,so);break;case 4:if(qo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-hs(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ML(r/1960))-r,10<r){e.timeoutHandle=jm(Ha.bind(null,e,Ur,so),r);break}Ha(e,Ur,so);break;case 5:Ha(e,Ur,so);break;default:throw Error(ot(329))}}}return Hr(e,nn()),e.callbackNode===n?tS.bind(null,e):null}function iv(e,t){var n=kc;return e.current.memoizedState.isDehydrated&&(tl(e,t).flags|=256),e=Od(e,t),e!==2&&(t=Ur,Ur=n,t!==null&&sv(t)),e}function sv(e){Ur===null?Ur=e:Ur.push.apply(Ur,e)}function AL(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!ms(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qo(e,t){for(t&=~wy,t&=~hp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hs(t),r=1<<n;e[n]=-1,t&=~r}}function ux(e){if(ae&6)throw Error(ot(327));au();var t=dd(e,0);if(!(t&1))return Hr(e,nn()),null;var n=Od(e,t);if(e.tag!==0&&n===2){var r=Tm(e);r!==0&&(t=r,n=iv(e,r))}if(n===1)throw n=of,tl(e,0),qo(e,t),Hr(e,nn()),n;if(n===6)throw Error(ot(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ha(e,Ur,so),Hr(e,nn()),null}function Sy(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(pu=nn()+500,lp&&Na())}}function al(e){Ko!==null&&Ko.tag===0&&!(ae&6)&&au();var t=ae;ae|=1;var n=Di.transition,r=pe;try{if(Di.transition=null,pe=1,e)return e()}finally{pe=r,Di.transition=n,ae=t,!(ae&6)&&Na()}}function Cy(){ri=tu.current,Te(tu)}function tl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cL(n)),yn!==null)for(n=yn.return;n!==null;){var r=n;switch(iy(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&yd();break;case 3:hu(),Te(Gr),Te(pr),dy();break;case 5:hy(r);break;case 4:hu();break;case 13:Te(Ve);break;case 19:Te(Ve);break;case 10:ly(r.type._context);break;case 22:case 23:Cy()}n=n.return}if(Gn=e,yn=e=oa(e.current,null),nr=ri=t,On=0,of=null,wy=hp=ol=0,Ur=kc=null,Xa!==null){for(t=0;t<Xa.length;t++)if(n=Xa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}Xa=null}return e}function eS(e,t){do{var n=yn;try{if(ay(),Wh.current=bd,Pd){for(var r=We.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pd=!1}if(sl=0,jn=In=We=null,Ac=!1,nf=0,xy.current=null,n===null||n.return===null){On=1,of=t,yn=null;break}t:{var s=e,a=n.return,l=n,c=t;if(t=nr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,g=l,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var v=g.alternate;v?(g.updateQueue=v.updateQueue,g.memoizedState=v.memoizedState,g.lanes=v.lanes):(g.updateQueue=null,g.memoizedState=null)}var y=K0(a);if(y!==null){y.flags&=-257,Q0(y,a,l,s,t),y.mode&1&&Y0(s,f,t),t=y,c=f;var x=t.updateQueue;if(x===null){var S=new Set;S.add(c),t.updateQueue=S}else x.add(c);break t}else{if(!(t&1)){Y0(s,f,t),Ny();break t}c=Error(ot(426))}}else if(ke&&l.mode&1){var C=K0(a);if(C!==null){!(C.flags&65536)&&(C.flags|=256),Q0(C,a,l,s,t),sy(du(c,l));break t}}s=c=du(c,l),On!==4&&(On=2),kc===null?kc=[s]:kc.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var E=jE(s,c,t);G0(s,E);break t;case 1:l=c;var w=s.type,N=s.stateNode;if(!(s.flags&128)&&(typeof w.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(ia===null||!ia.has(N)))){s.flags|=65536,t&=-t,s.lanes|=t;var I=zE(s,l,t);G0(s,I);break t}}s=s.return}while(s!==null)}iS(n)}catch(R){t=R,yn===n&&n!==null&&(yn=n=n.return);continue}break}while(!0)}function nS(){var e=Ld.current;return Ld.current=bd,e===null?bd:e}function Ny(){(On===0||On===3||On===2)&&(On=4),Gn===null||!(ol&268435455)&&!(hp&268435455)||qo(Gn,nr)}function Od(e,t){var n=ae;ae|=2;var r=nS();(Gn!==e||nr!==t)&&(so=null,tl(e,t));do try{DL();break}catch(i){eS(e,i)}while(!0);if(ay(),ae=n,Ld.current=r,yn!==null)throw Error(ot(261));return Gn=null,nr=0,On}function DL(){for(;yn!==null;)rS(yn)}function kL(){for(;yn!==null&&!ab();)rS(yn)}function rS(e){var t=oS(e.alternate,e,ri);e.memoizedProps=e.pendingProps,t===null?iS(e):yn=t,xy.current=null}function iS(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=IL(n,t),n!==null){n.flags&=32767,yn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{On=6,yn=null;return}}else if(n=LL(n,t,ri),n!==null){yn=n;return}if(t=t.sibling,t!==null){yn=t;return}yn=t=e}while(t!==null);On===0&&(On=5)}function Ha(e,t,n){var r=pe,i=Di.transition;try{Di.transition=null,pe=1,FL(e,t,n,r)}finally{Di.transition=i,pe=r}return null}function FL(e,t,n,r){do au();while(Ko!==null);if(ae&6)throw Error(ot(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ot(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(vb(e,s),e===Gn&&(yn=Gn=null,nr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Th||(Th=!0,aS(hd,function(){return au(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Di.transition,Di.transition=null;var a=pe;pe=1;var l=ae;ae|=4,xy.current=null,OL(e,n),JE(n,e),rL(km),pd=!!Dm,km=Dm=null,e.current=n,RL(n),lb(),ae=l,pe=a,Di.transition=s}else e.current=n;if(Th&&(Th=!1,Ko=e,Td=i),s=e.pendingLanes,s===0&&(ia=null),fb(n.stateNode),Hr(e,nn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Id)throw Id=!1,e=nv,nv=null,e;return Td&1&&e.tag!==0&&au(),s=e.pendingLanes,s&1?e===rv?Fc++:(Fc=0,rv=e):Fc=0,Na(),null}function au(){if(Ko!==null){var e=j1(Td),t=Di.transition,n=pe;try{if(Di.transition=null,pe=16>e?16:e,Ko===null)var r=!1;else{if(e=Ko,Ko=null,Td=0,ae&6)throw Error(ot(331));var i=ae;for(ae|=4,Ct=e.current;Ct!==null;){var s=Ct,a=s.child;if(Ct.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var f=l[c];for(Ct=f;Ct!==null;){var g=Ct;switch(g.tag){case 0:case 11:case 15:Dc(8,g,s)}var d=g.child;if(d!==null)d.return=g,Ct=d;else for(;Ct!==null;){g=Ct;var v=g.sibling,y=g.return;if(YE(g),g===f){Ct=null;break}if(v!==null){v.return=y,Ct=v;break}Ct=y}}}var x=s.alternate;if(x!==null){var S=x.child;if(S!==null){x.child=null;do{var C=S.sibling;S.sibling=null,S=C}while(S!==null)}}Ct=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Ct=a;else t:for(;Ct!==null;){if(s=Ct,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Dc(9,s,s.return)}var E=s.sibling;if(E!==null){E.return=s.return,Ct=E;break t}Ct=s.return}}var w=e.current;for(Ct=w;Ct!==null;){a=Ct;var N=a.child;if(a.subtreeFlags&2064&&N!==null)N.return=a,Ct=N;else t:for(a=w;Ct!==null;){if(l=Ct,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:fp(9,l)}}catch(R){Qe(l,l.return,R)}if(l===a){Ct=null;break t}var I=l.sibling;if(I!==null){I.return=l.return,Ct=I;break t}Ct=l.return}}if(ae=i,Na(),Vs&&typeof Vs.onPostCommitFiberRoot=="function")try{Vs.onPostCommitFiberRoot(rp,e)}catch{}r=!0}return r}finally{pe=n,Di.transition=t}}return!1}function cx(e,t,n){t=du(n,t),t=jE(e,t,1),e=ra(e,t,1),t=Lr(),e!==null&&(Pf(e,1,t),Hr(e,t))}function Qe(e,t,n){if(e.tag===3)cx(e,e,n);else for(;t!==null;){if(t.tag===3){cx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ia===null||!ia.has(r))){e=du(n,e),e=zE(t,e,1),t=ra(t,e,1),e=Lr(),t!==null&&(Pf(t,1,e),Hr(t,e));break}}t=t.return}}function jL(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Lr(),e.pingedLanes|=e.suspendedLanes&n,Gn===e&&(nr&n)===n&&(On===4||On===3&&(nr&130023424)===nr&&500>nn()-Ey?tl(e,0):wy|=n),Hr(e,t)}function sS(e,t){t===0&&(e.mode&1?(t=xh,xh<<=1,!(xh&130023424)&&(xh=4194304)):t=1);var n=Lr();e=vo(e,t),e!==null&&(Pf(e,t,n),Hr(e,n))}function zL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sS(e,n)}function BL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ot(314))}r!==null&&r.delete(t),sS(e,n)}var oS;oS=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gr.current)Vr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vr=!1,bL(e,t,n);Vr=!!(e.flags&131072)}else Vr=!1,ke&&t.flags&1048576&&cE(t,wd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yh(e,t),e=t.pendingProps;var i=uu(t,pr.current);ou(t,n),i=gy(null,t,r,e,i,n);var s=my();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qr(r)?(s=!0,_d(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cy(t),i.updater=cp,t.stateNode=i,i._reactInternals=t,Hm(t,r,e,n),t=Xm(null,t,r,!0,s,n)):(t.tag=0,ke&&s&&ry(t),Nr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;t:{switch(Yh(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=VL(r),e=ss(r,e),i){case 0:t=Wm(null,t,r,e,n);break t;case 1:t=tx(null,t,r,e,n);break t;case 11:t=J0(null,t,r,e,n);break t;case 14:t=$0(null,t,r,ss(r.type,e),n);break t}throw Error(ot(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ss(r,i),Wm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ss(r,i),tx(e,t,r,i,n);case 3:t:{if(GE(t),e===null)throw Error(ot(387));r=t.pendingProps,s=t.memoizedState,i=s.element,mE(e,t),Cd(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=du(Error(ot(423)),t),t=ex(e,t,r,n,i);break t}else if(r!==i){i=du(Error(ot(424)),t),t=ex(e,t,r,n,i);break t}else for(ii=na(t.stateNode.containerInfo.firstChild),si=t,ke=!0,as=null,n=pE(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(cu(),r===i){t=yo(e,t,n);break t}Nr(e,t,r,n)}t=t.child}return t;case 5:return vE(t),e===null&&Vm(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,Fm(r,i)?a=null:s!==null&&Fm(r,s)&&(t.flags|=32),VE(e,t),Nr(e,t,a,n),t.child;case 6:return e===null&&Vm(t),null;case 13:return qE(e,t,n);case 4:return fy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fu(t,null,r,n):Nr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ss(r,i),J0(e,t,r,i,n);case 7:return Nr(e,t,t.pendingProps,n),t.child;case 8:return Nr(e,t,t.pendingProps.children,n),t.child;case 12:return Nr(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Ne(Ed,r._currentValue),r._currentValue=a,s!==null)if(ms(s.value,a)){if(s.children===i.children&&!Gr.current){t=yo(e,t,n);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){a=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=co(-1,n&-n),c.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?c.next=c:(c.next=g.next,g.next=c),f.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Gm(s.return,n,t),l.lanes|=n;break}c=c.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(ot(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Gm(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Nr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ou(t,n),i=ji(i),r=r(i),t.flags|=1,Nr(e,t,r,n),t.child;case 14:return r=t.type,i=ss(r,t.pendingProps),i=ss(r.type,i),$0(e,t,r,i,n);case 15:return BE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ss(r,i),Yh(e,t),t.tag=1,qr(r)?(e=!0,_d(t)):e=!1,ou(t,n),FE(t,r,i),Hm(t,r,i,n),Xm(null,t,r,!0,e,n);case 19:return HE(e,t,n);case 22:return UE(e,t,n)}throw Error(ot(156,t.tag))};function aS(e,t){return A1(e,t)}function UL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(e,t,n,r){return new UL(e,t,n,r)}function Py(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VL(e){if(typeof e=="function")return Py(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hv)return 11;if(e===Zv)return 14}return 2}function oa(e,t){var n=e.alternate;return n===null?(n=Ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Jh(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")Py(e)&&(a=1);else if(typeof e=="string")a=5;else t:switch(e){case ql:return el(n.children,i,s,t);case qv:a=8,i|=8;break;case gm:return e=Ai(12,n,t,i|2),e.elementType=gm,e.lanes=s,e;case mm:return e=Ai(13,n,t,i),e.elementType=mm,e.lanes=s,e;case vm:return e=Ai(19,n,t,i),e.elementType=vm,e.lanes=s,e;case v1:return dp(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case g1:a=10;break t;case m1:a=9;break t;case Hv:a=11;break t;case Zv:a=14;break t;case Bo:a=16,r=null;break t}throw Error(ot(130,e==null?e:typeof e,""))}return t=Ai(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function el(e,t,n,r){return e=Ai(7,e,r,t),e.lanes=n,e}function dp(e,t,n,r){return e=Ai(22,e,r,t),e.elementType=v1,e.lanes=n,e.stateNode={isHidden:!1},e}function Wg(e,t,n){return e=Ai(6,e,null,t),e.lanes=n,e}function Xg(e,t,n){return t=Ai(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GL(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lg(0),this.expirationTimes=Lg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function by(e,t,n,r,i,s,a,l,c){return e=new GL(e,t,n,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ai(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cy(s),e}function qL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Gl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lS(e){if(!e)return ha;e=e._reactInternals;t:{if(Sl(e)!==e||e.tag!==1)throw Error(ot(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break t;case 1:if(qr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break t}}t=t.return}while(t!==null);throw Error(ot(171))}if(e.tag===1){var n=e.type;if(qr(n))return lE(e,n,t)}return t}function uS(e,t,n,r,i,s,a,l,c){return e=by(n,r,!0,e,i,s,a,l,c),e.context=lS(null),n=e.current,r=Lr(),i=sa(n),s=co(r,i),s.callback=t??null,ra(n,s,i),e.current.lanes=i,Pf(e,i,r),Hr(e,r),e}function pp(e,t,n,r){var i=t.current,s=Lr(),a=sa(i);return n=lS(n),t.context===null?t.context=n:t.pendingContext=n,t=co(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ra(i,t,a),e!==null&&(ds(e,i,a,s),Zh(e,i,a)),a}function Rd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ly(e,t){fx(e,t),(e=e.alternate)&&fx(e,t)}function HL(){return null}var cS=typeof reportError=="function"?reportError:function(e){console.error(e)};function Iy(e){this._internalRoot=e}gp.prototype.render=Iy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ot(409));pp(e,t,null,null)};gp.prototype.unmount=Iy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;al(function(){pp(null,e,null,null)}),t[mo]=null}};function gp(e){this._internalRoot=e}gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=U1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Go.length&&t!==0&&t<Go[n].priority;n++);Go.splice(n,0,e),n===0&&G1(e)}};function Ty(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function mp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hx(){}function ZL(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var f=Rd(a);s.call(f)}}var a=uS(t,r,e,0,null,!1,!1,"",hx);return e._reactRootContainer=a,e[mo]=a.current,Qc(e.nodeType===8?e.parentNode:e),al(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var f=Rd(c);l.call(f)}}var c=by(e,0,!1,null,null,!1,!1,"",hx);return e._reactRootContainer=c,e[mo]=c.current,Qc(e.nodeType===8?e.parentNode:e),al(function(){pp(t,c,n,r)}),c}function vp(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var l=i;i=function(){var c=Rd(a);l.call(c)}}pp(t,a,e,i)}else a=ZL(n,t,e,i,r);return Rd(a)}z1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cc(t.pendingLanes);n!==0&&(Yv(t,n|1),Hr(t,nn()),!(ae&6)&&(pu=nn()+500,Na()))}break;case 13:al(function(){var r=vo(e,1);if(r!==null){var i=Lr();ds(r,e,1,i)}}),Ly(e,1)}};Kv=function(e){if(e.tag===13){var t=vo(e,134217728);if(t!==null){var n=Lr();ds(t,e,134217728,n)}Ly(e,134217728)}};B1=function(e){if(e.tag===13){var t=sa(e),n=vo(e,t);if(n!==null){var r=Lr();ds(n,e,t,r)}Ly(e,t)}};U1=function(){return pe};V1=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};bm=function(e,t,n){switch(t){case"input":if(xm(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ap(r);if(!i)throw Error(ot(90));_1(r),xm(r,i)}}}break;case"textarea":w1(e,n);break;case"select":t=n.value,t!=null&&nu(e,!!n.multiple,t,!1)}};L1=Sy;I1=al;var WL={usingClientEntryPoint:!1,Events:[Lf,Xl,ap,P1,b1,Sy]},vc={findFiberByHostInstance:Wa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},XL={bundleType:vc.bundleType,version:vc.version,rendererPackageName:vc.rendererPackageName,rendererConfig:vc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Io.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=R1(e),e===null?null:e.stateNode},findFiberByHostInstance:vc.findFiberByHostInstance||HL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oh.isDisabled&&Oh.supportsFiber)try{rp=Oh.inject(XL),Vs=Oh}catch{}}mi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WL;mi.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ty(t))throw Error(ot(200));return qL(e,t,null,n)};mi.createRoot=function(e,t){if(!Ty(e))throw Error(ot(299));var n=!1,r="",i=cS;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=by(e,1,!1,null,null,n,!1,r,i),e[mo]=t.current,Qc(e.nodeType===8?e.parentNode:e),new Iy(t)};mi.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ot(188)):(e=Object.keys(e).join(","),Error(ot(268,e)));return e=R1(t),e=e===null?null:e.stateNode,e};mi.flushSync=function(e){return al(e)};mi.hydrate=function(e,t,n){if(!mp(t))throw Error(ot(200));return vp(null,e,t,!0,n)};mi.hydrateRoot=function(e,t,n){if(!Ty(e))throw Error(ot(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=cS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=uS(t,null,e,1,n??null,i,!1,s,a),e[mo]=t.current,Qc(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new gp(t)};mi.render=function(e,t,n){if(!mp(t))throw Error(ot(200));return vp(null,e,t,!1,n)};mi.unmountComponentAtNode=function(e){if(!mp(e))throw Error(ot(40));return e._reactRootContainer?(al(function(){vp(null,null,e,!1,function(){e._reactRootContainer=null,e[mo]=null})}),!0):!1};mi.unstable_batchedUpdates=Sy;mi.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!mp(n))throw Error(ot(200));if(e==null||e._reactInternals===void 0)throw Error(ot(38));return vp(e,t,n,!1,r)};mi.version="18.3.1-next-f1338f8080-20240426";function fS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fS)}catch(e){console.error(e)}}fS(),f1.exports=mi;var Oy=f1.exports;const YL=$w(Oy);var dx=Oy;dm.createRoot=dx.createRoot,dm.hydrateRoot=dx.hydrateRoot;const KL="modulepreload",QL=function(e){return"/"+e},px={},Yn=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=QL(c),c in px)return;px[c]=!0;const f=c.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${g}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":KL,f||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),f)return new Promise((v,y)=>{d.addEventListener("load",v),d.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function af(){return af=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},af.apply(this,arguments)}var Qo;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qo||(Qo={}));const gx="popstate";function JL(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:a,hash:l}=r.location;return ov("",{pathname:s,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Md(i)}return tI(t,n,null,e)}function sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ry(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $L(){return Math.random().toString(36).substr(2,8)}function mx(e,t){return{usr:e.state,key:e.key,idx:t}}function ov(e,t,n,r){return n===void 0&&(n=null),af({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Uu(t):t,{state:n,key:t&&t.key||r||$L()})}function Md(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Uu(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function tI(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,l=Qo.Pop,c=null,f=g();f==null&&(f=0,a.replaceState(af({},a.state,{idx:f}),""));function g(){return(a.state||{idx:null}).idx}function d(){l=Qo.Pop;let C=g(),E=C==null?null:C-f;f=C,c&&c({action:l,location:S.location,delta:E})}function v(C,E){l=Qo.Push;let w=ov(S.location,C,E);f=g()+1;let N=mx(w,f),I=S.createHref(w);try{a.pushState(N,"",I)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(I)}s&&c&&c({action:l,location:S.location,delta:1})}function y(C,E){l=Qo.Replace;let w=ov(S.location,C,E);f=g();let N=mx(w,f),I=S.createHref(w);a.replaceState(N,"",I),s&&c&&c({action:l,location:S.location,delta:0})}function x(C){let E=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof C=="string"?C:Md(C);return w=w.replace(/ $/,"%20"),sn(E,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,E)}let S={get action(){return l},get location(){return e(i,a)},listen(C){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(gx,d),c=C,()=>{i.removeEventListener(gx,d),c=null}},createHref(C){return t(i,C)},createURL:x,encodeLocation(C){let E=x(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:v,replace:y,go(C){return a.go(C)}};return S}var vx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vx||(vx={}));function eI(e,t,n){return n===void 0&&(n="/"),nI(e,t,n)}function nI(e,t,n,r){let i=typeof t=="string"?Uu(t):t,s=My(i.pathname||"/",n);if(s==null)return null;let a=hS(e);rI(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let f=gI(s);l=hI(a[c],f)}return l}function hS(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(sn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let f=aa([r,c.relativePath]),g=n.concat(c);s.children&&s.children.length>0&&(sn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),hS(s.children,t,g,f)),!(s.path==null&&!s.index)&&t.push({path:f,score:cI(f,s.index),routesMeta:g})};return e.forEach((s,a)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,a);else for(let c of dS(s.path))i(s,a,c)}),t}function dS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=dS(r.join("/")),l=[];return l.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function rI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fI(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iI=/^:[\w-]+$/,sI=3,oI=2,aI=1,lI=10,uI=-2,yx=e=>e==="*";function cI(e,t){let n=e.split("/"),r=n.length;return n.some(yx)&&(r+=uI),t&&(r+=oI),n.filter(i=>!yx(i)).reduce((i,s)=>i+(iI.test(s)?sI:s===""?aI:lI),r)}function fI(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function hI(e,t,n){let{routesMeta:r}=e,i={},s="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],f=l===r.length-1,g=s==="/"?t:t.slice(s.length)||"/",d=dI({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},g),v=c.route;if(!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:aa([s,d.pathname]),pathnameBase:xI(aa([s,d.pathnameBase])),route:v}),d.pathnameBase!=="/"&&(s=aa([s,d.pathnameBase]))}return a}function dI(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pI(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((f,g,d)=>{let{paramName:v,isOptional:y}=g;if(v==="*"){let S=l[d]||"";a=s.slice(0,s.length-S.length).replace(/(.)\/+$/,"$1")}const x=l[d];return y&&!x?f[v]=void 0:f[v]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:a,pattern:e}}function pI(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ry(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function gI(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ry(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function My(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const mI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vI=e=>mI.test(e);function yI(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Uu(e):e,s;if(n)if(vI(n))s=n;else{if(n.includes("//")){let a=n;n=n.replace(/\/\/+/g,"/"),Ry(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?s=_x(n.substring(1),"/"):s=_x(n,t)}else s=t;return{pathname:s,search:wI(r),hash:EI(i)}}function _x(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Yg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function _I(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ay(e,t){let n=_I(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Dy(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Uu(e):(i=af({},e),sn(!i.pathname||!i.pathname.includes("?"),Yg("?","pathname","search",i)),sn(!i.pathname||!i.pathname.includes("#"),Yg("#","pathname","hash",i)),sn(!i.search||!i.search.includes("#"),Yg("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,l;if(a==null)l=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let v=a.split("/");for(;v[0]==="..";)v.shift(),d-=1;i.pathname=v.join("/")}l=d>=0?t[d]:"/"}let c=yI(i,l),f=a&&a!=="/"&&a.endsWith("/"),g=(s||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||g)&&(c.pathname+="/"),c}const aa=e=>e.join("/").replace(/\/\/+/g,"/"),xI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,EI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function SI(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pS=["post","put","patch","delete"];new Set(pS);const CI=["get",...pS];new Set(CI);/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function lf(){return lf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lf.apply(this,arguments)}const ky=P.createContext(null),NI=P.createContext(null),Pa=P.createContext(null),yp=P.createContext(null),To=P.createContext({outlet:null,matches:[],isDataRoute:!1}),gS=P.createContext(null);function PI(e,t){let{relative:n}=t===void 0?{}:t;Vu()||sn(!1);let{basename:r,navigator:i}=P.useContext(Pa),{hash:s,pathname:a,search:l}=vS(e,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:aa([r,a])),i.createHref({pathname:c,search:l,hash:s})}function Vu(){return P.useContext(yp)!=null}function ba(){return Vu()||sn(!1),P.useContext(yp).location}function mS(e){P.useContext(Pa).static||P.useLayoutEffect(e)}function La(){let{isDataRoute:e}=P.useContext(To);return e?BI():bI()}function bI(){Vu()||sn(!1);let e=P.useContext(ky),{basename:t,future:n,navigator:r}=P.useContext(Pa),{matches:i}=P.useContext(To),{pathname:s}=ba(),a=JSON.stringify(Ay(i,n.v7_relativeSplatPath)),l=P.useRef(!1);return mS(()=>{l.current=!0}),P.useCallback(function(f,g){if(g===void 0&&(g={}),!l.current)return;if(typeof f=="number"){r.go(f);return}let d=Dy(f,JSON.parse(a),s,g.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:aa([t,d.pathname])),(g.replace?r.replace:r.push)(d,g.state,g)},[t,r,a,s,e])}function LI(){let{matches:e}=P.useContext(To),t=e[e.length-1];return t?t.params:{}}function vS(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=P.useContext(Pa),{matches:i}=P.useContext(To),{pathname:s}=ba(),a=JSON.stringify(Ay(i,r.v7_relativeSplatPath));return P.useMemo(()=>Dy(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function II(e,t){return TI(e,t)}function TI(e,t,n,r){Vu()||sn(!1);let{navigator:i}=P.useContext(Pa),{matches:s}=P.useContext(To),a=s[s.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let f=ba(),g;if(t){var d;let C=typeof t=="string"?Uu(t):t;c==="/"||(d=C.pathname)!=null&&d.startsWith(c)||sn(!1),g=C}else g=f;let v=g.pathname||"/",y=v;if(c!=="/"){let C=c.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(C.length).join("/")}let x=eI(e,{pathname:y}),S=DI(x&&x.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:aa([c,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:aa([c,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),s,n,r);return t&&S?P.createElement(yp.Provider,{value:{location:lf({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Qo.Pop}},S):S}function OI(){let e=zI(),t=SI(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:i},n):null,null)}const RI=P.createElement(OI,null);class MI extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?P.createElement(To.Provider,{value:this.props.routeContext},P.createElement(gS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AI(e){let{routeContext:t,match:n,children:r}=e,i=P.useContext(ky);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(To.Provider,{value:t},r)}function DI(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let g=a.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);g>=0||sn(!1),a=a.slice(0,Math.min(a.length,g+1))}let c=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let g=0;g<a.length;g++){let d=a[g];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(f=g),d.route.id){let{loaderData:v,errors:y}=n,x=d.route.loader&&v[d.route.id]===void 0&&(!y||y[d.route.id]===void 0);if(d.route.lazy||x){c=!0,f>=0?a=a.slice(0,f+1):a=[a[0]];break}}}return a.reduceRight((g,d,v)=>{let y,x=!1,S=null,C=null;n&&(y=l&&d.route.id?l[d.route.id]:void 0,S=d.route.errorElement||RI,c&&(f<0&&v===0?(UI("route-fallback"),x=!0,C=null):f===v&&(x=!0,C=d.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,v+1)),w=()=>{let N;return y?N=S:x?N=C:d.route.Component?N=P.createElement(d.route.Component,null):d.route.element?N=d.route.element:N=g,P.createElement(AI,{match:d,routeContext:{outlet:g,matches:E,isDataRoute:n!=null},children:N})};return n&&(d.route.ErrorBoundary||d.route.errorElement||v===0)?P.createElement(MI,{location:n.location,revalidation:n.revalidation,component:S,error:y,children:w(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):w()},null)}var yS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yS||{}),_S=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(_S||{});function kI(e){let t=P.useContext(ky);return t||sn(!1),t}function FI(e){let t=P.useContext(NI);return t||sn(!1),t}function jI(e){let t=P.useContext(To);return t||sn(!1),t}function xS(e){let t=jI(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function zI(){var e;let t=P.useContext(gS),n=FI(),r=xS();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function BI(){let{router:e}=kI(yS.UseNavigateStable),t=xS(_S.UseNavigateStable),n=P.useRef(!1);return mS(()=>{n.current=!0}),P.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lf({fromRouteId:t},s)))},[e,t])}const xx={};function UI(e,t,n){xx[e]||(xx[e]=!0)}function VI(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function uf(e){let{to:t,replace:n,state:r,relative:i}=e;Vu()||sn(!1);let{future:s,static:a}=P.useContext(Pa),{matches:l}=P.useContext(To),{pathname:c}=ba(),f=La(),g=Dy(t,Ay(l,s.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(g);return P.useEffect(()=>f(JSON.parse(d),{replace:n,state:r,relative:i}),[f,d,i,n,r]),null}function me(e){sn(!1)}function GI(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qo.Pop,navigator:s,static:a=!1,future:l}=e;Vu()&&sn(!1);let c=t.replace(/^\/*/,"/"),f=P.useMemo(()=>({basename:c,navigator:s,static:a,future:lf({v7_relativeSplatPath:!1},l)}),[c,l,s,a]);typeof r=="string"&&(r=Uu(r));let{pathname:g="/",search:d="",hash:v="",state:y=null,key:x="default"}=r,S=P.useMemo(()=>{let C=My(g,c);return C==null?null:{location:{pathname:C,search:d,hash:v,state:y,key:x},navigationType:i}},[c,g,d,v,y,x,i]);return S==null?null:P.createElement(Pa.Provider,{value:f},P.createElement(yp.Provider,{children:n,value:S}))}function qI(e){let{children:t,location:n}=e;return II(av(t),n)}new Promise(()=>{});function av(e,t){t===void 0&&(t=[]);let n=[];return P.Children.forEach(e,(r,i)=>{if(!P.isValidElement(r))return;let s=[...t,i];if(r.type===P.Fragment){n.push.apply(n,av(r.props.children,s));return}r.type!==me&&sn(!1),!r.props.index||!r.props.children||sn(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=av(r.props.children,s)),n.push(a)}),n}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function lv(){return lv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lv.apply(this,arguments)}function HI(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ZI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function WI(e,t){return e.button===0&&(!t||t==="_self")&&!ZI(e)}function uv(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function XI(e,t){let n=uv(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const YI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],KI="6";try{window.__reactRouterVersion=KI}catch{}const QI="startTransition",wx=jP[QI];function JI(e){let{basename:t,children:n,future:r,window:i}=e,s=P.useRef();s.current==null&&(s.current=JL({window:i,v5Compat:!0}));let a=s.current,[l,c]=P.useState({action:a.action,location:a.location}),{v7_startTransition:f}=r||{},g=P.useCallback(d=>{f&&wx?wx(()=>c(d)):c(d)},[c,f]);return P.useLayoutEffect(()=>a.listen(g),[a,g]),P.useEffect(()=>VI(r),[r]),P.createElement(GI,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const $I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",t2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tr=P.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:l,target:c,to:f,preventScrollReset:g,viewTransition:d}=t,v=HI(t,YI),{basename:y}=P.useContext(Pa),x,S=!1;if(typeof f=="string"&&t2.test(f)&&(x=f,$I))try{let N=new URL(window.location.href),I=f.startsWith("//")?new URL(N.protocol+f):new URL(f),R=My(I.pathname,y);I.origin===N.origin&&R!=null?f=R+I.search+I.hash:S=!0}catch{}let C=PI(f,{relative:i}),E=e2(f,{replace:a,state:l,target:c,preventScrollReset:g,relative:i,viewTransition:d});function w(N){r&&r(N),N.defaultPrevented||E(N)}return P.createElement("a",lv({},v,{href:x||C,onClick:S||s?r:w,ref:n,target:c}))});var Ex;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ex||(Ex={}));var Sx;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Sx||(Sx={}));function e2(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:l}=t===void 0?{}:t,c=La(),f=ba(),g=vS(e,{relative:a});return P.useCallback(d=>{if(WI(d,n)){d.preventDefault();let v=r!==void 0?r:Md(f)===Md(g);c(e,{replace:v,state:i,preventScrollReset:s,relative:a,viewTransition:l})}},[f,c,g,r,i,n,e,s,a,l])}function wS(e){let t=P.useRef(uv(e)),n=P.useRef(!1),r=ba(),i=P.useMemo(()=>XI(r.search,n.current?null:t.current),[r.search]),s=La(),a=P.useCallback((l,c)=>{const f=uv(typeof l=="function"?l(i):l);n.current=!0,s("?"+f,c)},[s,i]);return[i,a]}function cv(e,t){return cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},cv(e,t)}function _p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cv(e,t)}var xp=function(){function e(){this.listeners=[]}var t=e.prototype;return t.subscribe=function(r){var i=this,s=r||function(){};return this.listeners.push(s),this.onSubscribe(),function(){i.listeners=i.listeners.filter(function(a){return a!==s}),i.onUnsubscribe()}},t.hasListeners=function(){return this.listeners.length>0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}();function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(null,arguments)}var ES=typeof window>"u";function Cr(){}function n2(e,t){return typeof e=="function"?e(t):e}function r2(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ad(e){return Array.isArray(e)?e:[e]}function i2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Kg(e,t,n){return wp(e)?typeof t=="function"?de({},n,{queryKey:e,queryFn:t}):de({},t,{queryKey:e}):e}function Vo(e,t,n){return wp(e)?[de({},t,{queryKey:e}),n]:[e||{},t]}function s2(e,t){if(e===!0&&t===!0||e==null&&t==null)return"all";if(e===!1&&t===!1)return"none";var n=e??!t;return n?"active":"inactive"}function Cx(e,t){var n=e.active,r=e.exact,i=e.fetching,s=e.inactive,a=e.predicate,l=e.queryKey,c=e.stale;if(wp(l)){if(r){if(t.queryHash!==Fy(l,t.options))return!1}else if(!Dd(t.queryKey,l))return!1}var f=s2(n,s);if(f==="none")return!1;if(f!=="all"){var g=t.isActive();if(f==="active"&&!g||f==="inactive"&&g)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||typeof i=="boolean"&&t.isFetching()!==i||a&&!a(t))}function Nx(e,t){var n=e.exact,r=e.fetching,i=e.predicate,s=e.mutationKey;if(wp(s)){if(!t.options.mutationKey)return!1;if(n){if(Ka(t.options.mutationKey)!==Ka(s))return!1}else if(!Dd(t.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Fy(e,t){var n=(t==null?void 0:t.queryKeyHashFn)||Ka;return n(e)}function Ka(e){var t=Ad(e);return o2(t)}function o2(e){return JSON.stringify(e,function(t,n){return fv(n)?Object.keys(n).sort().reduce(function(r,i){return r[i]=n[i],r},{}):n})}function Dd(e,t){return SS(Ad(e),Ad(t))}function SS(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(function(n){return!SS(e[n],t[n])}):!1}function CS(e,t){if(e===t)return e;var n=Array.isArray(e)&&Array.isArray(t);if(n||fv(e)&&fv(t)){for(var r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},l=0,c=0;c<s;c++){var f=n?c:i[c];a[f]=CS(e[f],t[f]),a[f]===e[f]&&l++}return r===s&&l===r?e:a}return t}function fv(e){if(!Px(e))return!1;var t=e.constructor;if(typeof t>"u")return!0;var n=t.prototype;return!(!Px(n)||!n.hasOwnProperty("isPrototypeOf"))}function Px(e){return Object.prototype.toString.call(e)==="[object Object]"}function wp(e){return typeof e=="string"||Array.isArray(e)}function a2(e){return new Promise(function(t){setTimeout(t,e)})}function bx(e){Promise.resolve().then(e).catch(function(t){return setTimeout(function(){throw t})})}function NS(){if(typeof AbortController=="function")return new AbortController}var l2=function(e){_p(t,e);function t(){var r;return r=e.call(this)||this,r.setup=function(i){var s;if(!ES&&((s=window)!=null&&s.addEventListener)){var a=function(){return i()};return window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",a,!1),function(){window.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}}},r}var n=t.prototype;return n.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},n.onUnsubscribe=function(){if(!this.hasListeners()){var i;(i=this.cleanup)==null||i.call(this),this.cleanup=void 0}},n.setEventListener=function(i){var s,a=this;this.setup=i,(s=this.cleanup)==null||s.call(this),this.cleanup=i(function(l){typeof l=="boolean"?a.setFocused(l):a.onFocus()})},n.setFocused=function(i){this.focused=i,i&&this.onFocus()},n.onFocus=function(){this.listeners.forEach(function(i){i()})},n.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},t}(xp),$h=new l2,u2=function(e){_p(t,e);function t(){var r;return r=e.call(this)||this,r.setup=function(i){var s;if(!ES&&((s=window)!=null&&s.addEventListener)){var a=function(){return i()};return window.addEventListener("online",a,!1),window.addEventListener("offline",a,!1),function(){window.removeEventListener("online",a),window.removeEventListener("offline",a)}}},r}var n=t.prototype;return n.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},n.onUnsubscribe=function(){if(!this.hasListeners()){var i;(i=this.cleanup)==null||i.call(this),this.cleanup=void 0}},n.setEventListener=function(i){var s,a=this;this.setup=i,(s=this.cleanup)==null||s.call(this),this.cleanup=i(function(l){typeof l=="boolean"?a.setOnline(l):a.onOnline()})},n.setOnline=function(i){this.online=i,i&&this.onOnline()},n.onOnline=function(){this.listeners.forEach(function(i){i()})},n.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},t}(xp),td=new u2;function c2(e){return Math.min(1e3*Math.pow(2,e),3e4)}function kd(e){return typeof(e==null?void 0:e.cancel)=="function"}var PS=function(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent};function Qg(e){return e instanceof PS}var bS=function(t){var n=this,r=!1,i,s,a,l;this.abort=t.abort,this.cancel=function(v){return i==null?void 0:i(v)},this.cancelRetry=function(){r=!0},this.continueRetry=function(){r=!1},this.continue=function(){return s==null?void 0:s()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(v,y){a=v,l=y});var c=function(y){n.isResolved||(n.isResolved=!0,t.onSuccess==null||t.onSuccess(y),s==null||s(),a(y))},f=function(y){n.isResolved||(n.isResolved=!0,t.onError==null||t.onError(y),s==null||s(),l(y))},g=function(){return new Promise(function(y){s=y,n.isPaused=!0,t.onPause==null||t.onPause()}).then(function(){s=void 0,n.isPaused=!1,t.onContinue==null||t.onContinue()})},d=function v(){if(!n.isResolved){var y;try{y=t.fn()}catch(x){y=Promise.reject(x)}i=function(S){if(!n.isResolved&&(f(new PS(S)),n.abort==null||n.abort(),kd(y)))try{y.cancel()}catch{}},n.isTransportCancelable=kd(y),Promise.resolve(y).then(c).catch(function(x){var S,C;if(!n.isResolved){var E=(S=t.retry)!=null?S:3,w=(C=t.retryDelay)!=null?C:c2,N=typeof w=="function"?w(n.failureCount,x):w,I=E===!0||typeof E=="number"&&n.failureCount<E||typeof E=="function"&&E(n.failureCount,x);if(r||!I){f(x);return}n.failureCount++,t.onFail==null||t.onFail(n.failureCount,x),a2(N).then(function(){if(!$h.isFocused()||!td.isOnline())return g()}).then(function(){r?f(x):v()})}})}};d()},f2=function(){function e(){this.queue=[],this.transactions=0,this.notifyFn=function(n){n()},this.batchNotifyFn=function(n){n()}}var t=e.prototype;return t.batch=function(r){var i;this.transactions++;try{i=r()}finally{this.transactions--,this.transactions||this.flush()}return i},t.schedule=function(r){var i=this;this.transactions?this.queue.push(r):bx(function(){i.notifyFn(r)})},t.batchCalls=function(r){var i=this;return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];i.schedule(function(){r.apply(void 0,a)})}},t.flush=function(){var r=this,i=this.queue;this.queue=[],i.length&&bx(function(){r.batchNotifyFn(function(){i.forEach(function(s){r.notifyFn(s)})})})},t.setNotifyFunction=function(r){this.notifyFn=r},t.setBatchNotifyFunction=function(r){this.batchNotifyFn=r},e}(),$n=new f2,LS=console;function IS(){return LS}function h2(e){LS=e}var d2=function(){function e(n){this.abortSignalConsumed=!1,this.hadObservers=!1,this.defaultOptions=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.cache=n.cache,this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.initialState=n.state||this.getDefaultState(this.options),this.state=this.initialState,this.meta=n.meta,this.scheduleGc()}var t=e.prototype;return t.setOptions=function(r){var i;this.options=de({},this.defaultOptions,r),this.meta=r==null?void 0:r.meta,this.cacheTime=Math.max(this.cacheTime||0,(i=this.options.cacheTime)!=null?i:5*60*1e3)},t.setDefaultOptions=function(r){this.defaultOptions=r},t.scheduleGc=function(){var r=this;this.clearGcTimeout(),r2(this.cacheTime)&&(this.gcTimeout=setTimeout(function(){r.optionalRemove()},this.cacheTime))},t.clearGcTimeout=function(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)},t.optionalRemove=function(){this.observers.length||(this.state.isFetching?this.hadObservers&&this.scheduleGc():this.cache.remove(this))},t.setData=function(r,i){var s,a,l=this.state.data,c=n2(r,l);return(s=(a=this.options).isDataEqual)!=null&&s.call(a,l,c)?c=l:this.options.structuralSharing!==!1&&(c=CS(l,c)),this.dispatch({data:c,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt}),c},t.setState=function(r,i){this.dispatch({type:"setState",state:r,setStateOptions:i})},t.cancel=function(r){var i,s=this.promise;return(i=this.retryer)==null||i.cancel(r),s?s.then(Cr).catch(Cr):Promise.resolve()},t.destroy=function(){this.clearGcTimeout(),this.cancel({silent:!0})},t.reset=function(){this.destroy(),this.setState(this.initialState)},t.isActive=function(){return this.observers.some(function(r){return r.options.enabled!==!1})},t.isFetching=function(){return this.state.isFetching},t.isStale=function(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(function(r){return r.getCurrentResult().isStale})},t.isStaleByTime=function(r){return r===void 0&&(r=0),this.state.isInvalidated||!this.state.dataUpdatedAt||!i2(this.state.dataUpdatedAt,r)},t.onFocus=function(){var r,i=this.observers.find(function(s){return s.shouldFetchOnWindowFocus()});i&&i.refetch(),(r=this.retryer)==null||r.continue()},t.onOnline=function(){var r,i=this.observers.find(function(s){return s.shouldFetchOnReconnect()});i&&i.refetch(),(r=this.retryer)==null||r.continue()},t.addObserver=function(r){this.observers.indexOf(r)===-1&&(this.observers.push(r),this.hadObservers=!0,this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:r}))},t.removeObserver=function(r){this.observers.indexOf(r)!==-1&&(this.observers=this.observers.filter(function(i){return i!==r}),this.observers.length||(this.retryer&&(this.retryer.isTransportCancelable||this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.cacheTime?this.scheduleGc():this.cache.remove(this)),this.cache.notify({type:"observerRemoved",query:this,observer:r}))},t.getObserversCount=function(){return this.observers.length},t.invalidate=function(){this.state.isInvalidated||this.dispatch({type:"invalidate"})},t.fetch=function(r,i){var s=this,a,l,c;if(this.state.isFetching){if(this.state.dataUpdatedAt&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(this.promise){var f;return(f=this.retryer)==null||f.continueRetry(),this.promise}}if(r&&this.setOptions(r),!this.options.queryFn){var g=this.observers.find(function(w){return w.options.queryFn});g&&this.setOptions(g.options)}var d=Ad(this.queryKey),v=NS(),y={queryKey:d,pageParam:void 0,meta:this.meta};Object.defineProperty(y,"signal",{enumerable:!0,get:function(){if(v)return s.abortSignalConsumed=!0,v.signal}});var x=function(){return s.options.queryFn?(s.abortSignalConsumed=!1,s.options.queryFn(y)):Promise.reject("Missing queryFn")},S={fetchOptions:i,options:this.options,queryKey:d,state:this.state,fetchFn:x,meta:this.meta};if((a=this.options.behavior)!=null&&a.onFetch){var C;(C=this.options.behavior)==null||C.onFetch(S)}if(this.revertState=this.state,!this.state.isFetching||this.state.fetchMeta!==((l=S.fetchOptions)==null?void 0:l.meta)){var E;this.dispatch({type:"fetch",meta:(E=S.fetchOptions)==null?void 0:E.meta})}return this.retryer=new bS({fn:S.fetchFn,abort:v==null||(c=v.abort)==null?void 0:c.bind(v),onSuccess:function(N){s.setData(N),s.cache.config.onSuccess==null||s.cache.config.onSuccess(N,s),s.cacheTime===0&&s.optionalRemove()},onError:function(N){Qg(N)&&N.silent||s.dispatch({type:"error",error:N}),Qg(N)||(s.cache.config.onError==null||s.cache.config.onError(N,s),IS().error(N)),s.cacheTime===0&&s.optionalRemove()},onFail:function(){s.dispatch({type:"failed"})},onPause:function(){s.dispatch({type:"pause"})},onContinue:function(){s.dispatch({type:"continue"})},retry:S.options.retry,retryDelay:S.options.retryDelay}),this.promise=this.retryer.promise,this.promise},t.dispatch=function(r){var i=this;this.state=this.reducer(this.state,r),$n.batch(function(){i.observers.forEach(function(s){s.onQueryUpdate(r)}),i.cache.notify({query:i,type:"queryUpdated",action:r})})},t.getDefaultState=function(r){var i=typeof r.initialData=="function"?r.initialData():r.initialData,s=typeof r.initialData<"u",a=s?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0,l=typeof i<"u";return{data:i,dataUpdateCount:0,dataUpdatedAt:l?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isFetching:!1,isInvalidated:!1,isPaused:!1,status:l?"success":"idle"}},t.reducer=function(r,i){var s,a;switch(i.type){case"failed":return de({},r,{fetchFailureCount:r.fetchFailureCount+1});case"pause":return de({},r,{isPaused:!0});case"continue":return de({},r,{isPaused:!1});case"fetch":return de({},r,{fetchFailureCount:0,fetchMeta:(s=i.meta)!=null?s:null,isFetching:!0,isPaused:!1},!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return de({},r,{data:i.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(a=i.dataUpdatedAt)!=null?a:Date.now(),error:null,fetchFailureCount:0,isFetching:!1,isInvalidated:!1,isPaused:!1,status:"success"});case"error":var l=i.error;return Qg(l)&&l.revert&&this.revertState?de({},this.revertState):de({},r,{error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return de({},r,{isInvalidated:!0});case"setState":return de({},r,i.state);default:return r}},e}(),p2=function(e){_p(t,e);function t(r){var i;return i=e.call(this)||this,i.config=r||{},i.queries=[],i.queriesMap={},i}var n=t.prototype;return n.build=function(i,s,a){var l,c=s.queryKey,f=(l=s.queryHash)!=null?l:Fy(c,s),g=this.get(f);return g||(g=new d2({cache:this,queryKey:c,queryHash:f,options:i.defaultQueryOptions(s),state:a,defaultOptions:i.getQueryDefaults(c),meta:s.meta}),this.add(g)),g},n.add=function(i){this.queriesMap[i.queryHash]||(this.queriesMap[i.queryHash]=i,this.queries.push(i),this.notify({type:"queryAdded",query:i}))},n.remove=function(i){var s=this.queriesMap[i.queryHash];s&&(i.destroy(),this.queries=this.queries.filter(function(a){return a!==i}),s===i&&delete this.queriesMap[i.queryHash],this.notify({type:"queryRemoved",query:i}))},n.clear=function(){var i=this;$n.batch(function(){i.queries.forEach(function(s){i.remove(s)})})},n.get=function(i){return this.queriesMap[i]},n.getAll=function(){return this.queries},n.find=function(i,s){var a=Vo(i,s),l=a[0];return typeof l.exact>"u"&&(l.exact=!0),this.queries.find(function(c){return Cx(l,c)})},n.findAll=function(i,s){var a=Vo(i,s),l=a[0];return Object.keys(l).length>0?this.queries.filter(function(c){return Cx(l,c)}):this.queries},n.notify=function(i){var s=this;$n.batch(function(){s.listeners.forEach(function(a){a(i)})})},n.onFocus=function(){var i=this;$n.batch(function(){i.queries.forEach(function(s){s.onFocus()})})},n.onOnline=function(){var i=this;$n.batch(function(){i.queries.forEach(function(s){s.onOnline()})})},t}(xp),g2=function(){function e(n){this.options=de({},n.defaultOptions,n.options),this.mutationId=n.mutationId,this.mutationCache=n.mutationCache,this.observers=[],this.state=n.state||m2(),this.meta=n.meta}var t=e.prototype;return t.setState=function(r){this.dispatch({type:"setState",state:r})},t.addObserver=function(r){this.observers.indexOf(r)===-1&&this.observers.push(r)},t.removeObserver=function(r){this.observers=this.observers.filter(function(i){return i!==r})},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(Cr).catch(Cr)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var r=this,i,s=this.state.status==="loading",a=Promise.resolve();return s||(this.dispatch({type:"loading",variables:this.options.variables}),a=a.then(function(){r.mutationCache.config.onMutate==null||r.mutationCache.config.onMutate(r.state.variables,r)}).then(function(){return r.options.onMutate==null?void 0:r.options.onMutate(r.state.variables)}).then(function(l){l!==r.state.context&&r.dispatch({type:"loading",context:l,variables:r.state.variables})})),a.then(function(){return r.executeMutation()}).then(function(l){i=l,r.mutationCache.config.onSuccess==null||r.mutationCache.config.onSuccess(i,r.state.variables,r.state.context,r)}).then(function(){return r.options.onSuccess==null?void 0:r.options.onSuccess(i,r.state.variables,r.state.context)}).then(function(){return r.options.onSettled==null?void 0:r.options.onSettled(i,null,r.state.variables,r.state.context)}).then(function(){return r.dispatch({type:"success",data:i}),i}).catch(function(l){return r.mutationCache.config.onError==null||r.mutationCache.config.onError(l,r.state.variables,r.state.context,r),IS().error(l),Promise.resolve().then(function(){return r.options.onError==null?void 0:r.options.onError(l,r.state.variables,r.state.context)}).then(function(){return r.options.onSettled==null?void 0:r.options.onSettled(void 0,l,r.state.variables,r.state.context)}).then(function(){throw r.dispatch({type:"error",error:l}),l})})},t.executeMutation=function(){var r=this,i;return this.retryer=new bS({fn:function(){return r.options.mutationFn?r.options.mutationFn(r.state.variables):Promise.reject("No mutationFn found")},onFail:function(){r.dispatch({type:"failed"})},onPause:function(){r.dispatch({type:"pause"})},onContinue:function(){r.dispatch({type:"continue"})},retry:(i=this.options.retry)!=null?i:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(r){var i=this;this.state=v2(this.state,r),$n.batch(function(){i.observers.forEach(function(s){s.onMutationUpdate(r)}),i.mutationCache.notify(i)})},e}();function m2(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function v2(e,t){switch(t.type){case"failed":return de({},e,{failureCount:e.failureCount+1});case"pause":return de({},e,{isPaused:!0});case"continue":return de({},e,{isPaused:!1});case"loading":return de({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return de({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return de({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return de({},e,t.state);default:return e}}var y2=function(e){_p(t,e);function t(r){var i;return i=e.call(this)||this,i.config=r||{},i.mutations=[],i.mutationId=0,i}var n=t.prototype;return n.build=function(i,s,a){var l=new g2({mutationCache:this,mutationId:++this.mutationId,options:i.defaultMutationOptions(s),state:a,defaultOptions:s.mutationKey?i.getMutationDefaults(s.mutationKey):void 0,meta:s.meta});return this.add(l),l},n.add=function(i){this.mutations.push(i),this.notify(i)},n.remove=function(i){this.mutations=this.mutations.filter(function(s){return s!==i}),i.cancel(),this.notify(i)},n.clear=function(){var i=this;$n.batch(function(){i.mutations.forEach(function(s){i.remove(s)})})},n.getAll=function(){return this.mutations},n.find=function(i){return typeof i.exact>"u"&&(i.exact=!0),this.mutations.find(function(s){return Nx(i,s)})},n.findAll=function(i){return this.mutations.filter(function(s){return Nx(i,s)})},n.notify=function(i){var s=this;$n.batch(function(){s.listeners.forEach(function(a){a(i)})})},n.onFocus=function(){this.resumePausedMutations()},n.onOnline=function(){this.resumePausedMutations()},n.resumePausedMutations=function(){var i=this.mutations.filter(function(s){return s.state.isPaused});return $n.batch(function(){return i.reduce(function(s,a){return s.then(function(){return a.continue().catch(Cr)})},Promise.resolve())})},t}(xp);function _2(){return{onFetch:function(t){t.fetchFn=function(){var n,r,i,s,a,l,c=(n=t.fetchOptions)==null||(r=n.meta)==null?void 0:r.refetchPage,f=(i=t.fetchOptions)==null||(s=i.meta)==null?void 0:s.fetchMore,g=f==null?void 0:f.pageParam,d=(f==null?void 0:f.direction)==="forward",v=(f==null?void 0:f.direction)==="backward",y=((a=t.state.data)==null?void 0:a.pages)||[],x=((l=t.state.data)==null?void 0:l.pageParams)||[],S=NS(),C=S==null?void 0:S.signal,E=x,w=!1,N=t.options.queryFn||function(){return Promise.reject("Missing queryFn")},I=function(D,ut,it,yt){return E=yt?[ut].concat(E):[].concat(E,[ut]),yt?[it].concat(D):[].concat(D,[it])},R=function(D,ut,it,yt){if(w)return Promise.reject("Cancelled");if(typeof it>"u"&&!ut&&D.length)return Promise.resolve(D);var z={queryKey:t.queryKey,signal:C,pageParam:it,meta:t.meta},at=N(z),tt=Promise.resolve(at).then(function(Lt){return I(D,it,Lt,yt)});if(kd(at)){var vt=tt;vt.cancel=at.cancel}return tt},A;if(!y.length)A=R([]);else if(d){var B=typeof g<"u",q=B?g:Lx(t.options,y);A=R(y,B,q)}else if(v){var Q=typeof g<"u",Y=Q?g:x2(t.options,y);A=R(y,Q,Y,!0)}else(function(){E=[];var $=typeof t.options.getNextPageParam>"u",D=c&&y[0]?c(y[0],0,y):!0;A=D?R([],$,x[0]):Promise.resolve(I([],x[0],y[0]));for(var ut=function(z){A=A.then(function(at){var tt=c&&y[z]?c(y[z],z,y):!0;if(tt){var vt=$?x[z]:Lx(t.options,at);return R(at,$,vt)}return Promise.resolve(I(at,x[z],y[z]))})},it=1;it<y.length;it++)ut(it)})();var J=A.then(function($){return{pages:$,pageParams:E}}),W=J;return W.cancel=function(){w=!0,S==null||S.abort(),kd(A)&&A.cancel()},J}}}}function Lx(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function x2(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}var w2=function(){function e(n){n===void 0&&(n={}),this.queryCache=n.queryCache||new p2,this.mutationCache=n.mutationCache||new y2,this.defaultOptions=n.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var t=e.prototype;return t.mount=function(){var r=this;this.unsubscribeFocus=$h.subscribe(function(){$h.isFocused()&&td.isOnline()&&(r.mutationCache.onFocus(),r.queryCache.onFocus())}),this.unsubscribeOnline=td.subscribe(function(){$h.isFocused()&&td.isOnline()&&(r.mutationCache.onOnline(),r.queryCache.onOnline())})},t.unmount=function(){var r,i;(r=this.unsubscribeFocus)==null||r.call(this),(i=this.unsubscribeOnline)==null||i.call(this)},t.isFetching=function(r,i){var s=Vo(r,i),a=s[0];return a.fetching=!0,this.queryCache.findAll(a).length},t.isMutating=function(r){return this.mutationCache.findAll(de({},r,{fetching:!0})).length},t.getQueryData=function(r,i){var s;return(s=this.queryCache.find(r,i))==null?void 0:s.state.data},t.getQueriesData=function(r){return this.getQueryCache().findAll(r).map(function(i){var s=i.queryKey,a=i.state,l=a.data;return[s,l]})},t.setQueryData=function(r,i,s){var a=Kg(r),l=this.defaultQueryOptions(a);return this.queryCache.build(this,l).setData(i,s)},t.setQueriesData=function(r,i,s){var a=this;return $n.batch(function(){return a.getQueryCache().findAll(r).map(function(l){var c=l.queryKey;return[c,a.setQueryData(c,i,s)]})})},t.getQueryState=function(r,i){var s;return(s=this.queryCache.find(r,i))==null?void 0:s.state},t.removeQueries=function(r,i){var s=Vo(r,i),a=s[0],l=this.queryCache;$n.batch(function(){l.findAll(a).forEach(function(c){l.remove(c)})})},t.resetQueries=function(r,i,s){var a=this,l=Vo(r,i,s),c=l[0],f=l[1],g=this.queryCache,d=de({},c,{active:!0});return $n.batch(function(){return g.findAll(c).forEach(function(v){v.reset()}),a.refetchQueries(d,f)})},t.cancelQueries=function(r,i,s){var a=this,l=Vo(r,i,s),c=l[0],f=l[1],g=f===void 0?{}:f;typeof g.revert>"u"&&(g.revert=!0);var d=$n.batch(function(){return a.queryCache.findAll(c).map(function(v){return v.cancel(g)})});return Promise.all(d).then(Cr).catch(Cr)},t.invalidateQueries=function(r,i,s){var a,l,c,f=this,g=Vo(r,i,s),d=g[0],v=g[1],y=de({},d,{active:(a=(l=d.refetchActive)!=null?l:d.active)!=null?a:!0,inactive:(c=d.refetchInactive)!=null?c:!1});return $n.batch(function(){return f.queryCache.findAll(d).forEach(function(x){x.invalidate()}),f.refetchQueries(y,v)})},t.refetchQueries=function(r,i,s){var a=this,l=Vo(r,i,s),c=l[0],f=l[1],g=$n.batch(function(){return a.queryCache.findAll(c).map(function(v){return v.fetch(void 0,de({},f,{meta:{refetchPage:c==null?void 0:c.refetchPage}}))})}),d=Promise.all(g).then(Cr);return f!=null&&f.throwOnError||(d=d.catch(Cr)),d},t.fetchQuery=function(r,i,s){var a=Kg(r,i,s),l=this.defaultQueryOptions(a);typeof l.retry>"u"&&(l.retry=!1);var c=this.queryCache.build(this,l);return c.isStaleByTime(l.staleTime)?c.fetch(l):Promise.resolve(c.state.data)},t.prefetchQuery=function(r,i,s){return this.fetchQuery(r,i,s).then(Cr).catch(Cr)},t.fetchInfiniteQuery=function(r,i,s){var a=Kg(r,i,s);return a.behavior=_2(),this.fetchQuery(a)},t.prefetchInfiniteQuery=function(r,i,s){return this.fetchInfiniteQuery(r,i,s).then(Cr).catch(Cr)},t.cancelMutations=function(){var r=this,i=$n.batch(function(){return r.mutationCache.getAll().map(function(s){return s.cancel()})});return Promise.all(i).then(Cr).catch(Cr)},t.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},t.executeMutation=function(r){return this.mutationCache.build(this,r).execute()},t.getQueryCache=function(){return this.queryCache},t.getMutationCache=function(){return this.mutationCache},t.getDefaultOptions=function(){return this.defaultOptions},t.setDefaultOptions=function(r){this.defaultOptions=r},t.setQueryDefaults=function(r,i){var s=this.queryDefaults.find(function(a){return Ka(r)===Ka(a.queryKey)});s?s.defaultOptions=i:this.queryDefaults.push({queryKey:r,defaultOptions:i})},t.getQueryDefaults=function(r){var i;return r?(i=this.queryDefaults.find(function(s){return Dd(r,s.queryKey)}))==null?void 0:i.defaultOptions:void 0},t.setMutationDefaults=function(r,i){var s=this.mutationDefaults.find(function(a){return Ka(r)===Ka(a.mutationKey)});s?s.defaultOptions=i:this.mutationDefaults.push({mutationKey:r,defaultOptions:i})},t.getMutationDefaults=function(r){var i;return r?(i=this.mutationDefaults.find(function(s){return Dd(r,s.mutationKey)}))==null?void 0:i.defaultOptions:void 0},t.defaultQueryOptions=function(r){if(r!=null&&r._defaulted)return r;var i=de({},this.defaultOptions.queries,this.getQueryDefaults(r==null?void 0:r.queryKey),r,{_defaulted:!0});return!i.queryHash&&i.queryKey&&(i.queryHash=Fy(i.queryKey,i)),i},t.defaultQueryObserverOptions=function(r){return this.defaultQueryOptions(r)},t.defaultMutationOptions=function(r){return r!=null&&r._defaulted?r:de({},this.defaultOptions.mutations,this.getMutationDefaults(r==null?void 0:r.mutationKey),r,{_defaulted:!0})},t.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},e}(),E2=YL.unstable_batchedUpdates;$n.setBatchNotifyFunction(E2);var S2=console;h2(S2);var Ix=ye.createContext(void 0),C2=ye.createContext(!1);function N2(e){return e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Ix),window.ReactQueryClientContext):Ix}var P2=function(t){var n=t.client,r=t.contextSharing,i=r===void 0?!1:r,s=t.children;ye.useEffect(function(){return n.mount(),function(){n.unmount()}},[n]);var a=N2(i);return ye.createElement(C2.Provider,{value:i},ye.createElement(a.Provider,{value:n},s))};let b2={data:""},L2=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||b2},I2=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,T2=/\/\*[^]*?\*\/| +/g,Tx=/\n+/g,Ho=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?Ho(a,s):s+"{"+Ho(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=Ho(a,t?t.replace(/([^,])+/g,l=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ho.p?Ho.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},io={},TS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+TS(e[n]);return t}return e},O2=(e,t,n,r,i)=>{let s=TS(e),a=io[s]||(io[s]=(c=>{let f=0,g=11;for(;f<c.length;)g=101*g+c.charCodeAt(f++)>>>0;return"go"+g})(s));if(!io[a]){let c=s!==e?e:(f=>{let g,d,v=[{}];for(;g=I2.exec(f.replace(T2,""));)g[4]?v.shift():g[3]?(d=g[3].replace(Tx," ").trim(),v.unshift(v[0][d]=v[0][d]||{})):v[0][g[1]]=g[2].replace(Tx," ").trim();return v[0]})(e);io[a]=Ho(i?{["@keyframes "+a]:c}:c,n?"":"."+a)}let l=n&&io.g?io.g:null;return n&&(io.g=io[a]),((c,f,g,d)=>{d?f.data=f.data.replace(d,c):f.data.indexOf(c)===-1&&(f.data=g?c+f.data:f.data+c)})(io[a],t,r,l),a},R2=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];if(a&&a.call){let l=a(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;a=c?"."+c:l&&typeof l=="object"?l.props?"":Ho(l,""):l===!1?"":l}return r+i+(a??"")},"");function Ep(e){let t=this||{},n=e.call?e(t.p):e;return O2(n.unshift?n.raw?R2(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,L2(t.target),t.g,t.o,t.k)}let OS,hv,dv;Ep.bind({g:1});let _o=Ep.bind({k:1});function M2(e,t,n,r){Ho.p=t,OS=e,hv=n,dv=r}function Ia(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let l=Object.assign({},s),c=l.className||i.className;n.p=Object.assign({theme:hv&&hv()},l),n.o=/ *go\d+/.test(c),l.className=Ep.apply(n,r)+(c?" "+c:"");let f=e;return e[0]&&(f=l.as||e,delete l.as),dv&&f[0]&&dv(l),OS(f,l)}return i}}var A2=e=>typeof e=="function",Fd=(e,t)=>A2(e)?e(t):e,D2=(()=>{let e=0;return()=>(++e).toString()})(),RS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),k2=20,jy="default",MS=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:r}=t;return MS(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(a=>a.id===i||i===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},ed=[],AS={toasts:[],pausedAt:void 0,settings:{toastLimit:k2}},Bs={},DS=(e,t=jy)=>{Bs[t]=MS(Bs[t]||AS,e),ed.forEach(([n,r])=>{n===t&&r(Bs[t])})},kS=e=>Object.keys(Bs).forEach(t=>DS(e,t)),F2=e=>Object.keys(Bs).find(t=>Bs[t].toasts.some(n=>n.id===e)),Sp=(e=jy)=>t=>{DS(t,e)},j2={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},z2=(e={},t=jy)=>{let[n,r]=P.useState(Bs[t]||AS),i=P.useRef(Bs[t]);P.useEffect(()=>(i.current!==Bs[t]&&r(Bs[t]),ed.push([t,r]),()=>{let a=ed.findIndex(([l])=>l===t);a>-1&&ed.splice(a,1)}),[t]);let s=n.toasts.map(a=>{var l,c,f;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((l=e[a.type])==null?void 0:l.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||j2[a.type],style:{...e.style,...(f=e[a.type])==null?void 0:f.style,...a.style}}});return{...n,toasts:s}},B2=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||D2()}),Tf=e=>(t,n)=>{let r=B2(t,e,n);return Sp(r.toasterId||F2(r.id))({type:2,toast:r}),r.id},Tn=(e,t)=>Tf("blank")(e,t);Tn.error=Tf("error");Tn.success=Tf("success");Tn.loading=Tf("loading");Tn.custom=Tf("custom");Tn.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Sp(t)(n):kS(n)};Tn.dismissAll=e=>Tn.dismiss(void 0,e);Tn.remove=(e,t)=>{let n={type:4,toastId:e};t?Sp(t)(n):kS(n)};Tn.removeAll=e=>Tn.remove(void 0,e);Tn.promise=(e,t,n)=>{let r=Tn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?Fd(t.success,i):void 0;return s?Tn.success(s,{id:r,...n,...n==null?void 0:n.success}):Tn.dismiss(r),i}).catch(i=>{let s=t.error?Fd(t.error,i):void 0;s?Tn.error(s,{id:r,...n,...n==null?void 0:n.error}):Tn.dismiss(r)}),e};var U2=1e3,V2=(e,t="default")=>{let{toasts:n,pausedAt:r}=z2(e,t),i=P.useRef(new Map).current,s=P.useCallback((d,v=U2)=>{if(i.has(d))return;let y=setTimeout(()=>{i.delete(d),a({type:4,toastId:d})},v);i.set(d,y)},[]);P.useEffect(()=>{if(r)return;let d=Date.now(),v=n.map(y=>{if(y.duration===1/0)return;let x=(y.duration||0)+y.pauseDuration-(d-y.createdAt);if(x<0){y.visible&&Tn.dismiss(y.id);return}return setTimeout(()=>Tn.dismiss(y.id,t),x)});return()=>{v.forEach(y=>y&&clearTimeout(y))}},[n,r,t]);let a=P.useCallback(Sp(t),[t]),l=P.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=P.useCallback((d,v)=>{a({type:1,toast:{id:d,height:v}})},[a]),f=P.useCallback(()=>{r&&a({type:6,time:Date.now()})},[r,a]),g=P.useCallback((d,v)=>{let{reverseOrder:y=!1,gutter:x=8,defaultPosition:S}=v||{},C=n.filter(N=>(N.position||S)===(d.position||S)&&N.height),E=C.findIndex(N=>N.id===d.id),w=C.filter((N,I)=>I<E&&N.visible).length;return C.filter(N=>N.visible).slice(...y?[w+1]:[0,w]).reduce((N,I)=>N+(I.height||0)+x,0)},[n]);return P.useEffect(()=>{n.forEach(d=>{if(d.dismissed)s(d.id,d.removeDelay);else{let v=i.get(d.id);v&&(clearTimeout(v),i.delete(d.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:c,startPause:l,endPause:f,calculateOffset:g}}},G2=_o`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,q2=_o`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,H2=_o`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,Z2=Ia("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${G2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${q2} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${e=>e.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${H2} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,W2=_o`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,X2=Ia("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${e=>e.secondary||"#e0e0e0"};
border-right-color: ${e=>e.primary||"#616161"};
animation: ${W2} 1s linear infinite;
`,Y2=_o`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,K2=_o`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,Q2=Ia("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${e=>e.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${Y2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${K2} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${e=>e.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,J2=Ia("div")`
position: absolute;
`,$2=Ia("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,tT=_o`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,eT=Ia("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${tT} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,nT=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?P.createElement(eT,null,t):t:n==="blank"?null:P.createElement($2,null,P.createElement(X2,{...r}),n!=="loading"&&P.createElement(J2,null,n==="error"?P.createElement(Z2,{...r}):P.createElement(Q2,{...r})))},rT=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,iT=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,sT="0%{opacity:0;} 100%{opacity:1;}",oT="0%{opacity:1;} 100%{opacity:0;}",aT=Ia("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,lT=Ia("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,uT=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=RS()?[sT,oT]:[rT(n),iT(n)];return{animation:t?`${_o(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${_o(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},cT=P.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?uT(e.position||t||"top-center",e.visible):{opacity:0},s=P.createElement(nT,{toast:e}),a=P.createElement(lT,{...e.ariaProps},Fd(e.message,e));return P.createElement(aT,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):P.createElement(P.Fragment,null,s,a))});M2(P.createElement);var fT=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=P.useCallback(a=>{if(a){let l=()=>{let c=a.getBoundingClientRect().height;r(e,c)};l(),new MutationObserver(l).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return P.createElement("div",{ref:s,className:t,style:n},i)},hT=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:RS()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},dT=Ep`
z-index: 9999;
> * {
pointer-events: auto;
}
`,Rh=16,pT=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:l})=>{let{toasts:c,handlers:f}=V2(n,s);return P.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Rh,left:Rh,right:Rh,bottom:Rh,pointerEvents:"none",...a},className:l,onMouseEnter:f.startPause,onMouseLeave:f.endPause},c.map(g=>{let d=g.position||t,v=f.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),y=hT(d,v);return P.createElement(fT,{id:g.id,key:g.id,onHeightUpdate:f.updateHeight,className:g.visible?dT:"",style:y},g.type==="custom"?Fd(g.message,g):i?i(g):P.createElement(cT,{toast:g,position:d}))}))},re=Tn;function FS(e,t){return function(){return e.apply(t,arguments)}}const{toString:gT}=Object.prototype,{getPrototypeOf:zy}=Object,{iterator:Cp,toStringTag:jS}=Symbol,Np=(e=>t=>{const n=gT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ps=e=>(e=e.toLowerCase(),t=>Np(t)===e),Pp=e=>t=>typeof t===e,{isArray:Gu}=Array,gu=Pp("undefined");function Of(e){return e!==null&&!gu(e)&&e.constructor!==null&&!gu(e.constructor)&&Zr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zS=Ps("ArrayBuffer");function mT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zS(e.buffer),t}const vT=Pp("string"),Zr=Pp("function"),BS=Pp("number"),Rf=e=>e!==null&&typeof e=="object",yT=e=>e===!0||e===!1,nd=e=>{if(Np(e)!=="object")return!1;const t=zy(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(jS in e)&&!(Cp in e)},_T=e=>{if(!Rf(e)||Of(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},xT=Ps("Date"),wT=Ps("File"),ET=e=>!!(e&&typeof e.uri<"u"),ST=e=>e&&typeof e.getParts<"u",CT=Ps("Blob"),NT=Ps("FileList"),PT=e=>Rf(e)&&Zr(e.pipe);function bT(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ox=bT(),Rx=typeof Ox.FormData<"u"?Ox.FormData:void 0,LT=e=>{let t;return e&&(Rx&&e instanceof Rx||Zr(e.append)&&((t=Np(e))==="formdata"||t==="object"&&Zr(e.toString)&&e.toString()==="[object FormData]"))},IT=Ps("URLSearchParams"),[TT,OT,RT,MT]=["ReadableStream","Request","Response","Headers"].map(Ps),AT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Mf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Gu(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Of(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let l;for(r=0;r<a;r++)l=s[r],t.call(null,e[l],l,e)}}function US(e,t){if(Of(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Qa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,VS=e=>!gu(e)&&e!==Qa;function pv(){const{caseless:e,skipUndefined:t}=VS(this)&&this||{},n={},r=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=e&&US(n,s)||s;nd(n[a])&&nd(i)?n[a]=pv(n[a],i):nd(i)?n[a]=pv({},i):Gu(i)?n[a]=i.slice():(!t||!gu(i))&&(n[a]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Mf(arguments[i],r);return n}const DT=(e,t,n,{allOwnKeys:r}={})=>(Mf(t,(i,s)=>{n&&Zr(i)?Object.defineProperty(e,s,{value:FS(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),kT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),FT=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},jT=(e,t,n,r)=>{let i,s,a;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&zy(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zT=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},BT=e=>{if(!e)return null;if(Gu(e))return e;let t=e.length;if(!BS(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},UT=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zy(Uint8Array)),VT=(e,t)=>{const r=(e&&e[Cp]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},GT=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},qT=Ps("HTMLFormElement"),HT=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Mx=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ZT=Ps("RegExp"),GS=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mf(n,(i,s)=>{let a;(a=t(i,s,e))!==!1&&(r[s]=a||i)}),Object.defineProperties(e,r)},WT=e=>{GS(e,(t,n)=>{if(Zr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Zr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},XT=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Gu(e)?r(e):r(String(e).split(t)),n},YT=()=>{},KT=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function QT(e){return!!(e&&Zr(e.append)&&e[jS]==="FormData"&&e[Cp])}const JT=e=>{const t=new Array(10),n=(r,i)=>{if(Rf(r)){if(t.indexOf(r)>=0)return;if(Of(r))return r;if(!("toJSON"in r)){t[i]=r;const s=Gu(r)?[]:{};return Mf(r,(a,l)=>{const c=n(a,i+1);!gu(c)&&(s[l]=c)}),t[i]=void 0,s}}return r};return n(e,0)},$T=Ps("AsyncFunction"),tO=e=>e&&(Rf(e)||Zr(e))&&Zr(e.then)&&Zr(e.catch),qS=((e,t)=>e?setImmediate:t?((n,r)=>(Qa.addEventListener("message",({source:i,data:s})=>{i===Qa&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Qa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Zr(Qa.postMessage)),eO=typeof queueMicrotask<"u"?queueMicrotask.bind(Qa):typeof process<"u"&&process.nextTick||qS,nO=e=>e!=null&&Zr(e[Cp]),H={isArray:Gu,isArrayBuffer:zS,isBuffer:Of,isFormData:LT,isArrayBufferView:mT,isString:vT,isNumber:BS,isBoolean:yT,isObject:Rf,isPlainObject:nd,isEmptyObject:_T,isReadableStream:TT,isRequest:OT,isResponse:RT,isHeaders:MT,isUndefined:gu,isDate:xT,isFile:wT,isReactNativeBlob:ET,isReactNative:ST,isBlob:CT,isRegExp:ZT,isFunction:Zr,isStream:PT,isURLSearchParams:IT,isTypedArray:UT,isFileList:NT,forEach:Mf,merge:pv,extend:DT,trim:AT,stripBOM:kT,inherits:FT,toFlatObject:jT,kindOf:Np,kindOfTest:Ps,endsWith:zT,toArray:BT,forEachEntry:VT,matchAll:GT,isHTMLForm:qT,hasOwnProperty:Mx,hasOwnProp:Mx,reduceDescriptors:GS,freezeMethods:WT,toObjectSet:XT,toCamelCase:HT,noop:YT,toFiniteNumber:KT,findKey:US,global:Qa,isContextDefined:VS,isSpecCompliantForm:QT,toJSONObject:JT,isAsyncFn:$T,isThenable:tO,setImmediate:qS,asap:eO,isIterable:nO};let Ft=class HS extends Error{static from(t,n,r,i,s,a){const l=new HS(t.message,n||t.code,r,i,s);return l.cause=t,l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,n,r,i,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}};Ft.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ft.ERR_BAD_OPTION="ERR_BAD_OPTION";Ft.ECONNABORTED="ECONNABORTED";Ft.ETIMEDOUT="ETIMEDOUT";Ft.ERR_NETWORK="ERR_NETWORK";Ft.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ft.ERR_DEPRECATED="ERR_DEPRECATED";Ft.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ft.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ft.ERR_CANCELED="ERR_CANCELED";Ft.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ft.ERR_INVALID_URL="ERR_INVALID_URL";const rO=null;function gv(e){return H.isPlainObject(e)||H.isArray(e)}function ZS(e){return H.endsWith(e,"[]")?e.slice(0,-2):e}function Jg(e,t,n){return e?e.concat(t).map(function(i,s){return i=ZS(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function iO(e){return H.isArray(e)&&!e.some(gv)}const sO=H.toFlatObject(H,{},null,function(t){return/^is[A-Z]/.test(t)});function bp(e,t,n){if(!H.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!H.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||g,s=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&H.isSpecCompliantForm(t);if(!H.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(H.isDate(x))return x.toISOString();if(H.isBoolean(x))return x.toString();if(!c&&H.isBlob(x))throw new Ft("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(x)||H.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function g(x,S,C){let E=x;if(H.isReactNative(t)&&H.isReactNativeBlob(x))return t.append(Jg(C,S,s),f(x)),!1;if(x&&!C&&typeof x=="object"){if(H.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(H.isArray(x)&&iO(x)||(H.isFileList(x)||H.endsWith(S,"[]"))&&(E=H.toArray(x)))return S=ZS(S),E.forEach(function(N,I){!(H.isUndefined(N)||N===null)&&t.append(a===!0?Jg([S],I,s):a===null?S:S+"[]",f(N))}),!1}return gv(x)?!0:(t.append(Jg(C,S,s),f(x)),!1)}const d=[],v=Object.assign(sO,{defaultVisitor:g,convertValue:f,isVisitable:gv});function y(x,S){if(!H.isUndefined(x)){if(d.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));d.push(x),H.forEach(x,function(E,w){(!(H.isUndefined(E)||E===null)&&i.call(t,E,H.isString(w)?w.trim():w,S,v))===!0&&y(E,S?S.concat(w):[w])}),d.pop()}}if(!H.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ax(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function By(e,t){this._pairs=[],e&&bp(e,this,t)}const WS=By.prototype;WS.append=function(t,n){this._pairs.push([t,n])};WS.toString=function(t){const n=t?function(r){return t.call(this,r,Ax)}:Ax;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oO(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function XS(e,t,n){if(!t)return e;const r=n&&n.encode||oO,i=H.isFunction(n)?{serialize:n}:n,s=i&&i.serialize;let a;if(s?a=s(t,i):a=H.isURLSearchParams(t)?t.toString():new By(t,i).toString(r),a){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Dx{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){H.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Uy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},aO=typeof URLSearchParams<"u"?URLSearchParams:By,lO=typeof FormData<"u"?FormData:null,uO=typeof Blob<"u"?Blob:null,cO={isBrowser:!0,classes:{URLSearchParams:aO,FormData:lO,Blob:uO},protocols:["http","https","file","blob","url","data"]},Vy=typeof window<"u"&&typeof document<"u",mv=typeof navigator=="object"&&navigator||void 0,fO=Vy&&(!mv||["ReactNative","NativeScript","NS"].indexOf(mv.product)<0),hO=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dO=Vy&&window.location.href||"http://localhost",pO=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Vy,hasStandardBrowserEnv:fO,hasStandardBrowserWebWorkerEnv:hO,navigator:mv,origin:dO},Symbol.toStringTag,{value:"Module"})),hr={...pO,...cO};function gO(e,t){return bp(e,new hr.classes.URLSearchParams,{visitor:function(n,r,i,s){return hr.isNode&&H.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function mO(e){return H.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vO(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function YS(e){function t(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=s>=n.length;return a=!a&&H.isArray(i)?i.length:a,c?(H.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!l):((!i[a]||!H.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],s)&&H.isArray(i[a])&&(i[a]=vO(i[a])),!l)}if(H.isFormData(e)&&H.isFunction(e.entries)){const n={};return H.forEachEntry(e,(r,i)=>{t(mO(r),i,n,0)}),n}return null}function yO(e,t,n){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Af={transitional:Uy,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=H.isObject(t);if(s&&H.isHTMLForm(t)&&(t=new FormData(t)),H.isFormData(t))return i?JSON.stringify(YS(t)):t;if(H.isArrayBuffer(t)||H.isBuffer(t)||H.isStream(t)||H.isFile(t)||H.isBlob(t)||H.isReadableStream(t))return t;if(H.isArrayBufferView(t))return t.buffer;if(H.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return gO(t,this.formSerializer).toString();if((l=H.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return bp(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),yO(t)):t}],transformResponse:[function(t){const n=this.transitional||Af.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(H.isResponse(t)||H.isReadableStream(t))return t;if(t&&H.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?Ft.from(l,Ft.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:hr.classes.FormData,Blob:hr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],e=>{Af.headers[e]={}});const _O=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xO=e=>{const t={};let n,r,i;return e&&e.split(`
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&_O[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},kx=Symbol("internals"),wO=e=>!/[\r\n]/.test(e);function KS(e,t){if(!(e===!1||e==null)){if(H.isArray(e)){e.forEach(n=>KS(n,t));return}if(!wO(String(e)))throw new Error(`Invalid character in header content ["${t}"]`)}}function yc(e){return e&&String(e).trim().toLowerCase()}function EO(e){let t=e.length;for(;t>0;){const n=e.charCodeAt(t-1);if(n!==10&&n!==13)break;t-=1}return t===e.length?e:e.slice(0,t)}function rd(e){return e===!1||e==null?e:H.isArray(e)?e.map(rd):EO(String(e))}function SO(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const CO=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $g(e,t,n,r,i){if(H.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!H.isString(t)){if(H.isString(r))return t.indexOf(r)!==-1;if(H.isRegExp(r))return r.test(t)}}function NO(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function PO(e,t){const n=H.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,a){return this[r].call(this,t,i,s,a)},configurable:!0})})}let Wr=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(l,c,f){const g=yc(c);if(!g)throw new Error("header name must be a non-empty string");const d=H.findKey(i,g);(!d||i[d]===void 0||f===!0||f===void 0&&i[d]!==!1)&&(KS(l,c),i[d||c]=rd(l))}const a=(l,c)=>H.forEach(l,(f,g)=>s(f,g,c));if(H.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(H.isString(t)&&(t=t.trim())&&!CO(t))a(xO(t),n);else if(H.isObject(t)&&H.isIterable(t)){let l={},c,f;for(const g of t){if(!H.isArray(g))throw TypeError("Object iterator must return a key-value pair");l[f=g[0]]=(c=l[f])?H.isArray(c)?[...c,g[1]]:[c,g[1]]:g[1]}a(l,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=yc(t),t){const r=H.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return SO(i);if(H.isFunction(n))return n.call(this,i,r);if(H.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yc(t),t){const r=H.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$g(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(a){if(a=yc(a),a){const l=H.findKey(r,a);l&&(!n||$g(r,r[l],l,n))&&(delete r[l],i=!0)}}return H.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||$g(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return H.forEach(this,(i,s)=>{const a=H.findKey(r,s);if(a){n[a]=rd(i),delete n[s];return}const l=t?NO(s):String(s).trim();l!==s&&delete n[s],n[l]=rd(i),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return H.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&H.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[kx]=this[kx]={accessors:{}}).accessors,i=this.prototype;function s(a){const l=yc(a);r[l]||(PO(i,a),r[l]=!0)}return H.isArray(t)?t.forEach(s):s(t),this}};Wr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(Wr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});H.freezeMethods(Wr);function tm(e,t){const n=this||Af,r=t||n,i=Wr.from(r.headers);let s=r.data;return H.forEach(e,function(l){s=l.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function QS(e){return!!(e&&e.__CANCEL__)}let Df=class extends Ft{constructor(t,n,r){super(t??"canceled",Ft.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function JS(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bO(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function LO(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),g=r[s];a||(a=f),n[i]=c,r[i]=f;let d=s,v=0;for(;d!==i;)v+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),f-a<t)return;const y=g&&f-g;return y?Math.round(v*1e3/y):void 0}}function IO(e,t){let n=0,r=1e3/t,i,s;const a=(f,g=Date.now())=>{n=g,i=null,s&&(clearTimeout(s),s=null),e(...f)};return[(...f)=>{const g=Date.now(),d=g-n;d>=r?a(f,g):(i=f,s||(s=setTimeout(()=>{s=null,a(i)},r-d)))},()=>i&&a(i)]}const jd=(e,t,n=3)=>{let r=0;const i=LO(50,250);return IO(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,c=a-r,f=i(c),g=a<=l;r=a;const d={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:f||void 0,estimated:f&&l&&g?(l-a)/f:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},Fx=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jx=e=>(...t)=>H.asap(()=>e(...t)),TO=hr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,hr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(hr.origin),hr.navigator&&/(msie|trident)/i.test(hr.navigator.userAgent)):()=>!0,OO=hr.hasStandardBrowserEnv?{write(e,t,n,r,i,s,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];H.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),H.isString(r)&&l.push(`path=${r}`),H.isString(i)&&l.push(`domain=${i}`),s===!0&&l.push("secure"),H.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function RO(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function MO(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $S(e,t,n){let r=!RO(t);return e&&(r||n==!1)?MO(e,t):t}const zx=e=>e instanceof Wr?{...e}:e;function ll(e,t){t=t||{};const n={};function r(f,g,d,v){return H.isPlainObject(f)&&H.isPlainObject(g)?H.merge.call({caseless:v},f,g):H.isPlainObject(g)?H.merge({},g):H.isArray(g)?g.slice():g}function i(f,g,d,v){if(H.isUndefined(g)){if(!H.isUndefined(f))return r(void 0,f,d,v)}else return r(f,g,d,v)}function s(f,g){if(!H.isUndefined(g))return r(void 0,g)}function a(f,g){if(H.isUndefined(g)){if(!H.isUndefined(f))return r(void 0,f)}else return r(void 0,g)}function l(f,g,d){if(d in t)return r(f,g);if(d in e)return r(void 0,f)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(f,g,d)=>i(zx(f),zx(g),d,!0)};return H.forEach(Object.keys({...e,...t}),function(g){if(g==="__proto__"||g==="constructor"||g==="prototype")return;const d=H.hasOwnProp(c,g)?c[g]:i,v=d(e[g],t[g],g);H.isUndefined(v)&&d!==l||(n[g]=v)}),n}const tC=e=>{const t=ll({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=Wr.from(a),t.url=XS($S(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),H.isFormData(n)){if(hr.hasStandardBrowserEnv||hr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(H.isFunction(n.getHeaders)){const c=n.getHeaders(),f=["content-type","content-length"];Object.entries(c).forEach(([g,d])=>{f.includes(g.toLowerCase())&&a.set(g,d)})}}if(hr.hasStandardBrowserEnv&&(r&&H.isFunction(r)&&(r=r(t)),r||r!==!1&&TO(t.url))){const c=i&&s&&OO.read(s);c&&a.set(i,c)}return t},AO=typeof XMLHttpRequest<"u",DO=AO&&function(e){return new Promise(function(n,r){const i=tC(e);let s=i.data;const a=Wr.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:f}=i,g,d,v,y,x;function S(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(g),i.signal&&i.signal.removeEventListener("abort",g)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function E(){if(!C)return;const N=Wr.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),R={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:N,config:e,request:C};JS(function(B){n(B),S()},function(B){r(B),S()},R),C=null}"onloadend"in C?C.onloadend=E:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(E)},C.onabort=function(){C&&(r(new Ft("Request aborted",Ft.ECONNABORTED,e,C)),C=null)},C.onerror=function(I){const R=I&&I.message?I.message:"Network Error",A=new Ft(R,Ft.ERR_NETWORK,e,C);A.event=I||null,r(A),C=null},C.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const R=i.transitional||Uy;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new Ft(I,R.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,e,C)),C=null},s===void 0&&a.setContentType(null),"setRequestHeader"in C&&H.forEach(a.toJSON(),function(I,R){C.setRequestHeader(R,I)}),H.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),l&&l!=="json"&&(C.responseType=i.responseType),f&&([v,x]=jd(f,!0),C.addEventListener("progress",v)),c&&C.upload&&([d,y]=jd(c),C.upload.addEventListener("progress",d),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(g=N=>{C&&(r(!N||N.type?new Df(null,e,C):N),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(g),i.signal&&(i.signal.aborted?g():i.signal.addEventListener("abort",g)));const w=bO(i.url);if(w&&hr.protocols.indexOf(w)===-1){r(new Ft("Unsupported protocol "+w+":",Ft.ERR_BAD_REQUEST,e));return}C.send(s||null)})},kO=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(f){if(!i){i=!0,l();const g=f instanceof Error?f:this.reason;r.abort(g instanceof Ft?g:new Df(g instanceof Error?g.message:g))}};let a=t&&setTimeout(()=>{a=null,s(new Ft(`timeout of ${t}ms exceeded`,Ft.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),e=null)};e.forEach(f=>f.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>H.asap(l),c}},FO=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},jO=async function*(e,t){for await(const n of zO(e))yield*FO(n,t)},zO=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Bx=(e,t,n,r)=>{const i=jO(e,t);let s=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:g}=await i.next();if(f){l(),c.close();return}let d=g.byteLength;if(n){let v=s+=d;n(v)}c.enqueue(new Uint8Array(g))}catch(f){throw l(f),f}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},Ux=64*1024,{isFunction:Mh}=H,BO=(({Request:e,Response:t})=>({Request:e,Response:t}))(H.global),{ReadableStream:Vx,TextEncoder:Gx}=H.global,qx=(e,...t)=>{try{return!!e(...t)}catch{return!1}},UO=e=>{e=H.merge.call({skipUndefined:!0},BO,e);const{fetch:t,Request:n,Response:r}=e,i=t?Mh(t):typeof fetch=="function",s=Mh(n),a=Mh(r);if(!i)return!1;const l=i&&Mh(Vx),c=i&&(typeof Gx=="function"?(x=>S=>x.encode(S))(new Gx):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=s&&l&&qx(()=>{let x=!1;const S=new Vx,C=new n(hr.origin,{body:S,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return S.cancel(),x&&!C}),g=a&&l&&qx(()=>H.isReadableStream(new r("").body)),d={stream:g&&(x=>x.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!d[x]&&(d[x]=(S,C)=>{let E=S&&S[x];if(E)return E.call(S);throw new Ft(`Response type '${x}' is not supported`,Ft.ERR_NOT_SUPPORT,C)})});const v=async x=>{if(x==null)return 0;if(H.isBlob(x))return x.size;if(H.isSpecCompliantForm(x))return(await new n(hr.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(H.isArrayBufferView(x)||H.isArrayBuffer(x))return x.byteLength;if(H.isURLSearchParams(x)&&(x=x+""),H.isString(x))return(await c(x)).byteLength},y=async(x,S)=>{const C=H.toFiniteNumber(x.getContentLength());return C??v(S)};return async x=>{let{url:S,method:C,data:E,signal:w,cancelToken:N,timeout:I,onDownloadProgress:R,onUploadProgress:A,responseType:B,headers:q,withCredentials:Q="same-origin",fetchOptions:Y}=tC(x),J=t||fetch;B=B?(B+"").toLowerCase():"text";let W=kO([w,N&&N.toAbortSignal()],I),$=null;const D=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let ut;try{if(A&&f&&C!=="get"&&C!=="head"&&(ut=await y(q,E))!==0){let vt=new n(S,{method:"POST",body:E,duplex:"half"}),Lt;if(H.isFormData(E)&&(Lt=vt.headers.get("content-type"))&&q.setContentType(Lt),vt.body){const[ct,ht]=Fx(ut,jd(jx(A)));E=Bx(vt.body,Ux,ct,ht)}}H.isString(Q)||(Q=Q?"include":"omit");const it=s&&"credentials"in n.prototype,yt={...Y,signal:W,method:C.toUpperCase(),headers:q.normalize().toJSON(),body:E,duplex:"half",credentials:it?Q:void 0};$=s&&new n(S,yt);let z=await(s?J($,Y):J(S,yt));const at=g&&(B==="stream"||B==="response");if(g&&(R||at&&D)){const vt={};["status","statusText","headers"].forEach(_t=>{vt[_t]=z[_t]});const Lt=H.toFiniteNumber(z.headers.get("content-length")),[ct,ht]=R&&Fx(Lt,jd(jx(R),!0))||[];z=new r(Bx(z.body,Ux,ct,()=>{ht&&ht(),D&&D()}),vt)}B=B||"text";let tt=await d[H.findKey(d,B)||"text"](z,x);return!at&&D&&D(),await new Promise((vt,Lt)=>{JS(vt,Lt,{data:tt,headers:Wr.from(z.headers),status:z.status,statusText:z.statusText,config:x,request:$})})}catch(it){throw D&&D(),it&&it.name==="TypeError"&&/Load failed|fetch/i.test(it.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,x,$,it&&it.response),{cause:it.cause||it}):Ft.from(it,it&&it.code,x,$,it&&it.response)}}},VO=new Map,eC=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let a=s.length,l=a,c,f,g=VO;for(;l--;)c=s[l],f=g.get(c),f===void 0&&g.set(c,f=l?new Map:UO(t)),g=f;return f};eC();const Gy={http:rO,xhr:DO,fetch:{get:eC}};H.forEach(Gy,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hx=e=>`- ${e}`,GO=e=>H.isFunction(e)||e===null||e===!1;function qO(e,t){e=H.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let a=0;a<n;a++){r=e[a];let l;if(i=r,!GO(r)&&(i=Gy[(l=String(r)).toLowerCase()],i===void 0))throw new Ft(`Unknown adapter '${l}'`);if(i&&(H.isFunction(i)||(i=i.get(t))))break;s[l||"#"+a]=i}if(!i){const a=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
`+a.map(Hx).join(`
`):" "+Hx(a[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const nC={getAdapter:qO,adapters:Gy};function em(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Df(null,e)}function Zx(e){return em(e),e.headers=Wr.from(e.headers),e.data=tm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nC.getAdapter(e.adapter||Af.adapter,e)(e).then(function(r){return em(e),r.data=tm.call(e,e.transformResponse,r),r.headers=Wr.from(r.headers),r},function(r){return QS(r)||(em(e),r&&r.response&&(r.response.data=tm.call(e,e.transformResponse,r.response),r.response.headers=Wr.from(r.response.headers))),Promise.reject(r)})}const rC="1.15.0",Lp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Lp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Wx={};Lp.transitional=function(t,n,r){function i(s,a){return"[Axios v"+rC+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,l)=>{if(t===!1)throw new Ft(i(a," has been removed"+(n?" in "+n:"")),Ft.ERR_DEPRECATED);return n&&!Wx[a]&&(Wx[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,l):!0}};Lp.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function HO(e,t,n){if(typeof e!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],a=t[s];if(a){const l=e[s],c=l===void 0||a(l,s,e);if(c!==!0)throw new Ft("option "+s+" must be "+c,Ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ft("Unknown option "+s,Ft.ERR_BAD_OPTION)}}const id={assertOptions:HO,validators:Lp},Pi=id.validators;let nl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Dx,response:new Dx}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=(()=>{if(!i.stack)return"";const a=i.stack.indexOf(`
`);return a===-1?"":i.stack.slice(a+1)})();try{if(!r.stack)r.stack=s;else if(s){const a=s.indexOf(`
`),l=a===-1?-1:s.indexOf(`
`,a+1),c=l===-1?"":s.slice(l+1);String(r.stack).endsWith(c)||(r.stack+=`
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ll(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&id.assertOptions(r,{silentJSONParsing:Pi.transitional(Pi.boolean),forcedJSONParsing:Pi.transitional(Pi.boolean),clarifyTimeoutError:Pi.transitional(Pi.boolean),legacyInterceptorReqResOrdering:Pi.transitional(Pi.boolean)},!1),i!=null&&(H.isFunction(i)?n.paramsSerializer={serialize:i}:id.assertOptions(i,{encode:Pi.function,serialize:Pi.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),id.assertOptions(n,{baseUrl:Pi.spelling("baseURL"),withXsrfToken:Pi.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&H.merge(s.common,s[n.method]);s&&H.forEach(["delete","get","head","post","put","patch","common"],x=>{delete s[x]}),n.headers=Wr.concat(a,s);const l=[];let c=!0;this.interceptors.request.forEach(function(S){if(typeof S.runWhen=="function"&&S.runWhen(n)===!1)return;c=c&&S.synchronous;const C=n.transitional||Uy;C&&C.legacyInterceptorReqResOrdering?l.unshift(S.fulfilled,S.rejected):l.push(S.fulfilled,S.rejected)});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let g,d=0,v;if(!c){const x=[Zx.bind(this),void 0];for(x.unshift(...l),x.push(...f),v=x.length,g=Promise.resolve(n);d<v;)g=g.then(x[d++],x[d++]);return g}v=l.length;let y=n;for(;d<v;){const x=l[d++],S=l[d++];try{y=x(y)}catch(C){S.call(this,C);break}}try{g=Zx.call(this,y)}catch(x){return Promise.reject(x)}for(d=0,v=f.length;d<v;)g=g.then(f[d++],f[d++]);return g}getUri(t){t=ll(this.defaults,t);const n=$S(t.baseURL,t.url,t.allowAbsoluteUrls);return XS(n,t.params,t.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(t){nl.prototype[t]=function(n,r){return this.request(ll(r||{},{method:t,url:n,data:(r||{}).data}))}});H.forEach(["post","put","patch"],function(t){function n(r){return function(s,a,l){return this.request(ll(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}nl.prototype[t]=n(),nl.prototype[t+"Form"]=n(!0)});let ZO=class iC{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,l){r.reason||(r.reason=new Df(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new iC(function(i){t=i}),cancel:t}}};function WO(e){return function(n){return e.apply(null,n)}}function XO(e){return H.isObject(e)&&e.isAxiosError===!0}const vv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vv).forEach(([e,t])=>{vv[t]=e});function sC(e){const t=new nl(e),n=FS(nl.prototype.request,t);return H.extend(n,nl.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return sC(ll(e,i))},n}const on=sC(Af);on.Axios=nl;on.CanceledError=Df;on.CancelToken=ZO;on.isCancel=QS;on.VERSION=rC;on.toFormData=bp;on.AxiosError=Ft;on.Cancel=on.CanceledError;on.all=function(t){return Promise.all(t)};on.spread=WO;on.isAxiosError=XO;on.mergeConfig=ll;on.AxiosHeaders=Wr;on.formToJSON=e=>YS(H.isHTMLForm(e)?new FormData(e):e);on.getAdapter=nC.getAdapter;on.HttpStatusCode=vv;on.default=on;const{Axios:$D,AxiosError:tk,CanceledError:ek,isCancel:nk,CancelToken:rk,VERSION:ik,all:sk,Cancel:ok,isAxiosError:ak,spread:lk,toFormData:uk,AxiosHeaders:ck,HttpStatusCode:fk,formToJSON:hk,getAdapter:dk,mergeConfig:pk}=on,Xx="http://localhost:5001/api",oC={apiBaseUrl:Xx,apiOrigin:Xx.replace(/\/api\/?$/,"")},YO=oC.apiBaseUrl,K=on.create({baseURL:YO,timeout:1e4,headers:{"Content-Type":"application/json","Cache-Control":"no-cache",Pragma:"no-cache",Expires:"0"}});K.interceptors.request.use(e=>{const t=localStorage.getItem("authToken");if(t&&t!=="undefined"&&t!=="null"&&(e.headers.Authorization=`Bearer ${t}`),(e.method||"get").toLowerCase()==="get"){e.headers["Cache-Control"]="no-cache",e.headers.Pragma="no-cache",e.headers.Expires="0";const n=Object.fromEntries(Object.entries(e.params||{}).filter(([,i])=>i!=null&&i!==""&&i!=="undefined"&&i!=="null")),r=new URLSearchParams(n);r.has("_ts")||r.set("_ts",Date.now().toString()),e.params=Object.fromEntries(r.entries())}return e},e=>Promise.reject(e));let nm=!1;K.interceptors.response.use(e=>e,e=>{var t,n,r,i,s;if(((t=e.response)==null?void 0:t.status)===401||((n=e.response)==null?void 0:n.status)===403){const a=((r=e.config)==null?void 0:r.url)||"",l=a.includes("/auth/registration-status"),c=["/login","/register"].includes(window.location.pathname);if(!l&&(console.log("Clearing invalid token due to auth error:",(i=e.response)==null?void 0:i.status,"on",a),localStorage.removeItem("authToken"),!c&&!nm)){nm=!0;try{window.location.href="/login"}finally{setTimeout(()=>{nm=!1},1500)}}}else((s=e.response)==null?void 0:s.status)>=500?re.error("Server error. Please try again later."):e.code==="ECONNABORTED"?re.error("Request timeout. Please check your connection."):e.response||re.error("Network error. Please check your connection.");return Promise.reject(e)});const Zo={login:e=>K.post("/auth/login",e),register:e=>K.post("/auth/register",e),getCurrentUser:()=>K.get("/auth/me"),changePassword:e=>K.post("/auth/change-password",e),forgotPassword:e=>K.post("/auth/forgot-password",{email:e}),getInvitation:e=>K.get(`/auth/invitations/${e}`),validateResetToken:e=>K.get(`/auth/reset-password/${e}`),resetPassword:e=>K.post("/auth/reset-password",e)},gk={getProfile:()=>K.get("/users/profile"),updateProfile:e=>K.put("/users/profile",e),deleteAccount:e=>K.delete("/users/account",{data:e}),getStats:()=>K.get("/users/stats")},Za={getAll:()=>K.get("/properties"),getById:e=>K.get(`/properties/${e}`),create:e=>K.post("/properties",e),update:(e,t)=>K.put(`/properties/${e}`,t),delete:e=>K.delete(`/properties/${e}`),createSection:(e,t)=>K.post(`/properties/${e}/sections`,t),updateSection:(e,t,n)=>K.put(`/properties/${e}/sections/${t}`,n),deleteSection:(e,t)=>K.delete(`/properties/${e}/sections/${t}`)},mk={getAll:e=>K.get("/equipment",{params:e}),getById:e=>K.get(`/equipment/${e}`),create:e=>K.post("/equipment",e),update:(e,t)=>K.put(`/equipment/${e}`,t),delete:e=>K.delete(`/equipment/${e}`),getCategories:()=>K.get("/equipment/categories"),getTypes:e=>K.get("/equipment/types",{params:e}),getSpreaders:()=>K.get("/equipment/spreaders"),getCalculations:(e,t)=>K.get(`/equipment/${e}/calculations`,{params:t})},vk={getAll:()=>K.get("/nozzles"),getById:e=>K.get(`/nozzles/${e}`),create:e=>K.post("/nozzles",e),update:(e,t)=>K.put(`/nozzles/${e}`,t),delete:e=>K.delete(`/nozzles/${e}`),getNozzleTypes:()=>K.get("/nozzles/types"),getUserNozzles:()=>K.get("/nozzles/user"),calculateFlowRate:(e,t)=>K.get(`/nozzles/${e}/flow-rate`,{params:{pressure:t}}),getPumpAssignments:e=>K.get(`/nozzles/sprayer/${e}/pump-assignments`),assignPump:(e,t)=>K.post(`/nozzles/sprayer/${e}/pump-assignments`,{pumpId:t}),unassignPump:e=>K.delete(`/nozzles/pump-assignments/${e}`),getNozzleConfigurations:e=>K.get(`/nozzles/sprayer/${e}/nozzle-configurations`),addNozzleConfiguration:(e,t)=>K.post(`/nozzles/sprayer/${e}/nozzle-configurations`,t),removeNozzleConfiguration:e=>K.delete(`/nozzles/nozzle-configurations/${e}`),getTypes:e=>K.get("/nozzles/types",{params:e}),getAssignments:e=>K.get(`/nozzles/equipment/${e}/assignments`),assignToEquipment:(e,t)=>K.post(`/nozzles/equipment/${e}/assignments`,t),removeAssignment:e=>K.delete(`/nozzles/assignments/${e}`)},yk={getAll:e=>K.get("/products",{params:e}),getById:e=>K.get(`/products/${e}`),search:e=>K.get("/products/search",{params:e}),getCategories:()=>K.get("/products/categories"),getUserProducts:()=>K.get("/products/user"),createUserProduct:e=>K.post("/products/user",e),getUserProduct:e=>K.get(`/products/user/${e}`),updateUserProduct:(e,t)=>K.put(`/products/user/${e}`,t),deleteUserProduct:e=>K.delete(`/products/user/${e}`),archiveUserProduct:e=>K.put(`/products/user/${e}/archive`),unarchiveUserProduct:e=>K.put(`/products/user/${e}/unarchive`)},jc={getPlans:e=>K.get("/applications/plans",{params:e}),getPlan:e=>K.get(`/applications/plans/${e}`),createPlan:e=>K.post("/applications/plans",e),updatePlan:(e,t)=>K.put(`/applications/plans/${e}`,t),deletePlan:e=>K.delete(`/applications/plans/${e}`),updatePlanStatus:(e,t)=>K.put(`/applications/plans/${e}/status`,{status:t}),getLogs:e=>K.get("/applications/logs",{params:e}),getLog:e=>K.get(`/applications/logs/${e}`),createLog:e=>K.post("/applications/logs",e),getStats:e=>K.get("/applications/stats",{params:e})},_k={getByProduct:e=>K.get(`/product-spreader-settings/product/${e}`),getByUserProduct:e=>K.get(`/product-spreader-settings/user-product/${e}`),create:e=>K.post("/product-spreader-settings",e),update:(e,t)=>K.put(`/product-spreader-settings/${e}`,t),delete:e=>K.delete(`/product-spreader-settings/${e}`)},KO={getCurrent:e=>K.get(`/weather/${e}`),getForecast:e=>K.get(`/weather/${e}/forecast`),getHistory:(e,t)=>K.get(`/weather/${e}/history`,{params:t}),checkSuitability:(e,t)=>K.get(`/weather/conditions/suitable/${e}`,{params:t})},xk={getPlans:e=>K.get("/watering/plans",{params:e}),updatePlan:(e,t)=>K.put(`/watering/plans/${e}`,t),createPlan:e=>K.post("/watering/plans",e),deletePlan:e=>K.delete(`/watering/plans/${e}`),duplicatePlan:(e,t)=>K.post(`/watering/plans/${e}/duplicate`,t),getPlanPoints:e=>K.get(`/watering/plans/${e}/points`),addPlanPoint:(e,t)=>K.post(`/watering/plans/${e}/points`,t),updatePoint:(e,t)=>K.put(`/watering/points/${e}`,t),deletePoint:e=>K.delete(`/watering/points/${e}`),createLog:e=>K.post("/watering/runs",e),getLogs:e=>K.get("/watering/logs",{params:e}),getRun:e=>K.get(`/watering/runs/${e}`)},wk={getOperations:e=>K.get("/reports/operations",{params:e})},Ek={getDashboard:()=>K.get("/admin/dashboard"),getUsers:e=>K.get("/admin/users",{params:e}),inviteUser:e=>K.post("/admin/users/invite",e),updateUser:(e,t)=>K.put(`/admin/users/${e}`,t),updateUserRole:(e,t)=>K.put(`/admin/users/${e}/role`,{role:t}),deleteUser:e=>K.delete(`/admin/users/${e}`),getProducts:e=>K.get("/admin/products",{params:e}),getAllUserProducts:e=>K.get("/admin/products/user",{params:e}),createProduct:e=>K.post("/admin/products",e),updateProduct:(e,t)=>K.put(`/admin/products/${e}`,t),deleteProduct:e=>K.delete(`/admin/products/${e}`),promoteUserProduct:e=>K.post(`/admin/products/user/${e}/promote`),getProperties:e=>K.get("/admin/properties",{params:e}),getProperty:e=>K.get(`/admin/properties/${e}`),updateSectionAdmin:(e,t,n)=>K.put(`/admin/properties/${e}/sections/${t}`,n),getProductRates:e=>K.get(`/admin/products/${e}/rates`),getUserProductSpreaderSettings:e=>K.get(`/admin/products/user/${e}/spreader-settings`),addUserProductSpreaderSetting:(e,t)=>K.post(`/admin/products/user/${e}/spreader-settings`,t),deleteUserProductSpreaderSetting:e=>K.delete(`/admin/products/user/spreader-settings/${e}`),getAllUserEquipment:e=>K.get("/admin/equipment/user",{params:e}),promoteUserEquipment:e=>K.post(`/admin/equipment/user/${e}/promote`),getSystemHealth:()=>K.get("/admin/system/health"),sendTestEmail:e=>K.post("/admin/system/test-email",e),getSettings:()=>K.get("/admin/settings"),updateSettings:e=>K.put("/admin/settings",e)},aC={getPlans:()=>K.get("/mowing/plans"),getPlan:e=>K.get(`/mowing/plans/${e}`),createPlan:e=>K.post("/mowing/plans",e),updatePlanStatus:(e,t)=>K.put(`/mowing/plans/${e}/status`,{status:t}),createLog:e=>K.post("/mowing/sessions",e),getLogs:e=>K.get("/mowing/logs",{params:e}),getSession:e=>K.get(`/mowing/sessions/${e}`)},QO=()=>{const e=localStorage.getItem("authToken");return!e||e==="undefined"||e==="null"?(localStorage.removeItem("authToken"),null):e},JO={user:null,token:QO(),loading:!0,error:null},mn={SET_LOADING:"SET_LOADING",LOGIN_SUCCESS:"LOGIN_SUCCESS",LOGOUT:"LOGOUT",SET_ERROR:"SET_ERROR",CLEAR_ERROR:"CLEAR_ERROR",UPDATE_USER:"UPDATE_USER"},$O=(e,t)=>{switch(t.type){case mn.SET_LOADING:return{...e,loading:t.payload,error:null};case mn.LOGIN_SUCCESS:return localStorage.setItem("authToken",t.payload.token),{...e,user:t.payload.user,token:t.payload.token,loading:!1,error:null};case mn.LOGOUT:return localStorage.removeItem("authToken"),{...e,user:null,token:null,loading:!1,error:null};case mn.SET_ERROR:return{...e,error:t.payload,loading:!1};case mn.CLEAR_ERROR:return{...e,error:null};case mn.UPDATE_USER:return{...e,user:{...e.user,...t.payload}};default:return e}},lC=P.createContext(),tR=()=>{const e=P.useContext(lC);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},eR=({children:e})=>{var d;const[t,n]=P.useReducer($O,JO);P.useEffect(()=>{(async()=>{const y=localStorage.getItem("authToken");if(!y||y==="undefined"||y==="null"){localStorage.removeItem("authToken"),n({type:mn.SET_LOADING,payload:!1});return}try{const x=await Zo.getCurrentUser();n({type:mn.LOGIN_SUCCESS,payload:{user:x.data.data.user,token:y}})}catch(x){console.error("Auth check failed:",x),localStorage.removeItem("authToken"),n({type:mn.LOGOUT})}})()},[]);const r=async v=>{var y,x;try{n({type:mn.SET_LOADING,payload:!0}),n({type:mn.CLEAR_ERROR}),console.log("Attempting login...",v.email);const S=await Zo.login(v);return console.log("Login response:",S.data),n({type:mn.LOGIN_SUCCESS,payload:S.data.data}),re.success("Welcome back!"),{success:!0}}catch(S){console.error("Login error:",S);const C=((x=(y=S.response)==null?void 0:y.data)==null?void 0:x.message)||S.message||"Login failed. Please try again.";return n({type:mn.SET_ERROR,payload:C}),re.error(C),{success:!1,error:C}}},i=async v=>{var y,x;try{n({type:mn.SET_LOADING,payload:!0}),n({type:mn.CLEAR_ERROR});const{confirmPassword:S,agreeTerms:C,...E}=v;console.log("Attempting registration...",E.email);const w=await Zo.register(E);return console.log("Registration response:",w.data),n({type:mn.LOGIN_SUCCESS,payload:w.data.data}),re.success("Account created successfully!"),{success:!0}}catch(S){console.error("Registration error:",S);const C=((x=(y=S.response)==null?void 0:y.data)==null?void 0:x.message)||S.message||"Registration failed. Please try again.";return n({type:mn.SET_ERROR,payload:C}),re.error(C),{success:!1,error:C}}},s=()=>{n({type:mn.LOGOUT}),re.success("Logged out successfully")},a=v=>{n({type:mn.UPDATE_USER,payload:v})},l=async v=>{var y,x;try{return await Zo.changePassword(v),re.success("Password changed successfully"),{success:!0}}catch(S){const C=((x=(y=S.response)==null?void 0:y.data)==null?void 0:x.message)||"Failed to change password";return re.error(C),{success:!1,error:C}}},c=async v=>{var y,x;try{return await Zo.forgotPassword(v),re.success("Password reset instructions sent to your email"),{success:!0}}catch(S){const C=((x=(y=S.response)==null?void 0:y.data)==null?void 0:x.message)||"Failed to send reset email";return re.error(C),{success:!1,error:C}}},f=()=>{n({type:mn.CLEAR_ERROR})},g={user:t.user,token:t.token,loading:t.loading,error:t.error,isAuthenticated:!!t.user,isAdmin:((d=t.user)==null?void 0:d.role)==="admin",login:r,register:i,logout:s,updateUser:a,changePassword:l,forgotPassword:c,clearError:f};return p.jsx(lC.Provider,{value:g,children:e})},qu=tR;function nR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const rR=P.forwardRef(nR);function iR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"}))}const Yx=P.forwardRef(iR);function sR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const oR=P.forwardRef(sR);function aR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5"}))}const yv=P.forwardRef(aR);function lR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"}))}const uR=P.forwardRef(lR);function cR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"}))}const fR=P.forwardRef(cR);function hR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const Kx=P.forwardRef(hR);function dR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const pR=P.forwardRef(dR);function gR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const uC=P.forwardRef(gR);function mR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15a4.5 4.5 0 0 0 4.5 4.5H18a3.75 3.75 0 0 0 1.332-7.257 3 3 0 0 0-3.758-3.848 5.25 5.25 0 0 0-10.233 2.33A4.502 4.502 0 0 0 2.25 15Z"}))}const Qx=P.forwardRef(mR);function vR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const yR=P.forwardRef(vR);function _R({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const cC=P.forwardRef(_R);function xR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const zd=P.forwardRef(xR);function wR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"}))}const qy=P.forwardRef(wR);function ER({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"}))}const zc=P.forwardRef(ER);function SR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"}))}const Jx=P.forwardRef(SR);function CR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const NR=P.forwardRef(CR);function PR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const bR=P.forwardRef(PR);function LR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"}))}const IR=P.forwardRef(LR);function TR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"}))}const OR=P.forwardRef(TR);function RR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const MR=P.forwardRef(RR);function AR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const rm=P.forwardRef(AR);function DR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"}))}const mu=P.forwardRef(DR);function kR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const Hy=P.forwardRef(kR);function FR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M10.5 3.798v5.02a3 3 0 0 1-.879 2.121l-2.377 2.377a9.845 9.845 0 0 1 5.091 1.013 8.315 8.315 0 0 0 5.713.636l.285-.071-3.954-3.955a3 3 0 0 1-.879-2.121v-5.02a23.614 23.614 0 0 0-3 0Zm4.5.138a.75.75 0 0 0 .093-1.495A24.837 24.837 0 0 0 12 2.25a25.048 25.048 0 0 0-3.093.191A.75.75 0 0 0 9 3.936v4.882a1.5 1.5 0 0 1-.44 1.06l-6.293 6.294c-1.62 1.621-.903 4.475 1.471 4.88 2.686.46 5.447.698 8.262.698 2.816 0 5.576-.239 8.262-.697 2.373-.406 3.092-3.26 1.47-4.881L15.44 9.879A1.5 1.5 0 0 1 15 8.818V3.936Z",clipRule:"evenodd"}))}const jR=P.forwardRef(FR);function zR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{d:"M12.75 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM7.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.25 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM9.75 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM10.5 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM12.75 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM14.25 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"}),P.createElement("path",{fillRule:"evenodd",d:"M6.75 2.25A.75.75 0 0 1 7.5 3v1.5h9V3A.75.75 0 0 1 18 3v1.5h.75a3 3 0 0 1 3 3v11.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V7.5a3 3 0 0 1 3-3H6V3a.75.75 0 0 1 .75-.75Zm13.5 9a1.5 1.5 0 0 0-1.5-1.5H5.25a1.5 1.5 0 0 0-1.5 1.5v7.5a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5v-7.5Z",clipRule:"evenodd"}))}const BR=P.forwardRef(zR);function UR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{d:"M18.375 2.25c-1.035 0-1.875.84-1.875 1.875v15.75c0 1.035.84 1.875 1.875 1.875h.75c1.035 0 1.875-.84 1.875-1.875V4.125c0-1.036-.84-1.875-1.875-1.875h-.75ZM9.75 8.625c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v11.25c0 1.035-.84 1.875-1.875 1.875h-.75a1.875 1.875 0 0 1-1.875-1.875V8.625ZM3 13.125c0-1.036.84-1.875 1.875-1.875h.75c1.036 0 1.875.84 1.875 1.875v6.75c0 1.035-.84 1.875-1.875 1.875h-.75A1.875 1.875 0 0 1 3 19.875v-6.75Z"}))}const VR=P.forwardRef(UR);function GR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",clipRule:"evenodd"}))}const qR=P.forwardRef(GR);function HR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M4.5 9.75a6 6 0 0 1 11.573-2.226 3.75 3.75 0 0 1 4.133 4.303A4.5 4.5 0 0 1 18 20.25H6.75a5.25 5.25 0 0 1-2.23-10.004 6.072 6.072 0 0 1-.02-.496Z",clipRule:"evenodd"}))}const $x=P.forwardRef(HR);function ZR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{d:"M11.47 3.841a.75.75 0 0 1 1.06 0l8.69 8.69a.75.75 0 1 0 1.06-1.061l-8.689-8.69a2.25 2.25 0 0 0-3.182 0l-8.69 8.69a.75.75 0 1 0 1.061 1.06l8.69-8.689Z"}),P.createElement("path",{d:"m12 5.432 8.159 8.159c.03.03.06.058.091.086v6.198c0 1.035-.84 1.875-1.875 1.875H15a.75.75 0 0 1-.75-.75v-4.5a.75.75 0 0 0-.75-.75h-3a.75.75 0 0 0-.75.75V21a.75.75 0 0 1-.75.75H5.625a1.875 1.875 0 0 1-1.875-1.875v-6.198a2.29 2.29 0 0 0 .091-.086L12 5.432Z"}))}const WR=P.forwardRef(ZR);function XR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M8.161 2.58a1.875 1.875 0 0 1 1.678 0l4.993 2.498c.106.052.23.052.336 0l3.869-1.935A1.875 1.875 0 0 1 21.75 4.82v12.485c0 .71-.401 1.36-1.037 1.677l-4.875 2.437a1.875 1.875 0 0 1-1.676 0l-4.994-2.497a.375.375 0 0 0-.336 0l-3.868 1.935A1.875 1.875 0 0 1 2.25 19.18V6.695c0-.71.401-1.36 1.036-1.677l4.875-2.437ZM9 6a.75.75 0 0 1 .75.75V15a.75.75 0 0 1-1.5 0V6.75A.75.75 0 0 1 9 6Zm6.75 3a.75.75 0 0 0-1.5 0v8.25a.75.75 0 0 0 1.5 0V9Z",clipRule:"evenodd"}))}const YR=P.forwardRef(XR);function KR({title:e,titleId:t,...n},r){return P.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?P.createElement("title",{id:t},e):null,P.createElement("path",{fillRule:"evenodd",d:"M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z",clipRule:"evenodd"}),P.createElement("path",{d:"m10.076 8.64-2.201-2.2V4.874a.75.75 0 0 0-.364-.643l-3.75-2.25a.75.75 0 0 0-.916.113l-.75.75a.75.75 0 0 0-.113.916l2.25 3.75a.75.75 0 0 0 .643.364h1.564l2.062 2.062 1.575-1.297Z"}),P.createElement("path",{fillRule:"evenodd",d:"m12.556 17.329 4.183 4.182a3.375 3.375 0 0 0 4.773-4.773l-3.306-3.305a6.803 6.803 0 0 1-1.53.043c-.394-.034-.682-.006-.867.042a.589.589 0 0 0-.167.063l-3.086 3.748Zm3.414-1.36a.75.75 0 0 1 1.06 0l1.875 1.876a.75.75 0 1 1-1.06 1.06L15.97 17.03a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const QR=P.forwardRef(KR),JR=e=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:e.className,"aria-hidden":"true",children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 20h18"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 20v-5m0 0 2 2m-2-2-2 2M9 20v-6m0 0 2 2m-2-2-2 2M13 20v-5m0 0 2 2m-2-2-2 2M17 20v-6m0 0 2 2m-2-2-2 2"})]}),$R=e=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:e.className,"aria-hidden":"true",children:[p.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"0.5"}),p.jsx("path",{d:"M6 14v6h2v-4l2 2v2h2v-4l2 2v2h2v-4l2 2v2h2v-1.5l-2.5-2.5L22 16v-1.5l-2.5-2.5L22 12V10l-3 3-3-3v3l-2.5-2.5L13 12v3l-2.5-2.5L9 14v4H7v-3l-2 2v1H4v-1.5l2-2.5-2-1.5V14z"})]});function fC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tw(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fC(e))&&(r&&(r+=" "),r+=t);return r}const Hs=({size:e="md",color:t="primary",className:n="",message:r=null})=>{const i={sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},s={primary:"border-primary-600",white:"border-white",gray:"border-gray-600",grass:"border-grass-600"};return p.jsxs("div",{className:tw("flex flex-col items-center justify-center",n),children:[p.jsx("div",{className:tw("animate-spin rounded-full border-2 border-gray-200",i[e],s[t],"border-t-transparent"),role:"status","aria-label":"Loading"}),r&&p.jsx("p",{className:"mt-2 text-sm text-gray-600 text-center",children:r})]})},Pn=({children:e})=>{var d,v,y,x,S;const[t,n]=P.useState(!1),{user:r,logout:i,isAdmin:s}=qu(),a=ba(),l=La(),c=[{name:"Dashboard",href:"/dashboard",icon:qy,iconSolid:WR},{name:"Properties",href:"/properties",icon:Jx,iconSolid:YR},{name:"Equipment",href:"/equipment",icon:mu,iconSolid:QR},{name:"Products",href:"/products",icon:yv,iconSolid:jR},{name:"Applications",href:"/applications",icon:fR,iconSolid:BR},{name:"Watering",href:"/watering",icon:Qx,iconSolid:$x},{name:"Mowing",href:"/mowing",icon:JR,iconSolid:$R},{name:"History",href:"/history",icon:uC,iconSolid:qR},{name:"Reports",href:"/reports",icon:pR,iconSolid:VR},{name:"Weather",href:"/weather",icon:Qx,iconSolid:$x}],f=[{name:"Admin Dashboard",href:"/admin",icon:yR},{name:"Manage Users",href:"/admin/users",icon:rm},{name:"Manage Products",href:"/admin/products",icon:yv},{name:"Manage Equipment",href:"/admin/equipment",icon:mu},{name:"Manage Properties",href:"/admin/properties",icon:Jx}],g=()=>{i(),l("/login")};return r?p.jsxs("div",{className:"min-h-screen bg-gray-50",children:[p.jsx("div",{className:`lg:hidden ${t?"relative z-40":""}`,children:t&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75",onClick:()=>n(!1)}),p.jsxs("div",{className:"fixed inset-y-0 left-0 flex w-64 flex-col bg-white shadow-xl",children:[p.jsxs("div",{className:"relative flex h-20 items-center px-6 border-b border-gray-200",children:[p.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:p.jsx("img",{src:"/brand/logo.png",alt:"TurfTracking",className:"h-16 w-16 object-contain"})}),p.jsx("button",{type:"button",className:"text-gray-400 hover:text-gray-600",onClick:()=>n(!1),children:p.jsx(Hy,{className:"h-6 w-6"})})]}),p.jsxs("nav",{className:"flex-1 space-y-1 px-4 py-6",children:[c.map(C=>{const E=a.pathname===C.href||C.href!=="/dashboard"&&a.pathname.startsWith(C.href),w=E?C.iconSolid:C.icon;return p.jsxs(tr,{to:C.href,className:E?"nav-link-active":"nav-link-inactive",onClick:()=>n(!1),children:[p.jsx(w,{className:"h-5 w-5 mr-3"}),C.name]},C.name)}),s&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"border-t border-gray-200 my-4"}),p.jsx("div",{className:"px-3 py-2",children:p.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Administration"})}),f.map(C=>{const E=a.pathname===C.href;return p.jsxs(tr,{to:C.href,className:E?"nav-link-active":"nav-link-inactive",onClick:()=>n(!1),children:[p.jsx(C.icon,{className:"h-5 w-5 mr-3"}),C.name]},C.name)})]})]}),p.jsxs("div",{className:"border-t border-gray-200 p-4",children:[p.jsxs("div",{className:"flex items-center mb-4",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"h-8 w-8 rounded-full bg-primary-600 flex items-center justify-center",children:p.jsxs("span",{className:"text-sm font-medium text-white",children:[(d=r.firstName)==null?void 0:d[0],(v=r.lastName)==null?void 0:v[0]]})})}),p.jsxs("div",{className:"ml-3",children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[r.firstName," ",r.lastName]}),p.jsx("p",{className:"text-xs text-gray-500",children:r.email})]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs(tr,{to:"/profile",className:"nav-link-inactive",onClick:()=>n(!1),children:[p.jsx(rm,{className:"h-5 w-5 mr-3"}),"Profile"]}),p.jsxs("button",{onClick:g,className:"nav-link-inactive w-full text-left",children:[p.jsx(Yx,{className:"h-5 w-5 mr-3"}),"Sign out"]})]})]})]})]})}),p.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:p.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-white border-r border-gray-200",children:[p.jsx("div",{className:"flex h-24 items-center justify-center px-6 border-b border-gray-200",children:p.jsx("img",{src:"/brand/logo.png",alt:"TurfTracking",className:"h-20 w-20 object-contain"})}),p.jsxs("nav",{className:"flex-1 space-y-1 px-4 py-6",children:[c.map(C=>{const E=a.pathname===C.href||C.href!=="/dashboard"&&a.pathname.startsWith(C.href),w=E?C.iconSolid:C.icon;return p.jsxs(tr,{to:C.href,className:E?"nav-link-active":"nav-link-inactive",children:[p.jsx(w,{className:"h-5 w-5 mr-3"}),C.name]},C.name)}),s&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"border-t border-gray-200 my-4"}),p.jsx("div",{className:"px-3 py-2",children:p.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Administration"})}),f.map(C=>{const E=a.pathname===C.href;return p.jsxs(tr,{to:C.href,className:E?"nav-link-active":"nav-link-inactive",children:[p.jsx(C.icon,{className:"h-5 w-5 mr-3"}),C.name]},C.name)})]})]}),p.jsxs("div",{className:"border-t border-gray-200 p-4",children:[p.jsxs("div",{className:"flex items-center mb-4",children:[p.jsx("div",{className:"flex-shrink-0",children:p.jsx("div",{className:"h-8 w-8 rounded-full bg-primary-600 flex items-center justify-center",children:p.jsxs("span",{className:"text-sm font-medium text-white",children:[(y=r.firstName)==null?void 0:y[0],(x=r.lastName)==null?void 0:x[0]]})})}),p.jsxs("div",{className:"ml-3",children:[p.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[r.firstName," ",r.lastName]}),p.jsx("p",{className:"text-xs text-gray-500",children:r.email})]})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs(tr,{to:"/profile",className:"nav-link-inactive",children:[p.jsx(rm,{className:"h-5 w-5 mr-3"}),"Profile"]}),p.jsxs("button",{onClick:g,className:"nav-link-inactive w-full text-left",children:[p.jsx(Yx,{className:"h-5 w-5 mr-3"}),"Sign out"]})]})]})]})}),p.jsxs("div",{className:"lg:pl-64",children:[p.jsx("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 lg:hidden",children:p.jsxs("div",{className:"relative flex h-16 items-center justify-between px-4",children:[p.jsx("button",{type:"button",className:"text-gray-500 hover:text-gray-600",onClick:()=>n(!0),children:p.jsx(oR,{className:"h-6 w-6"})}),p.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:p.jsx("img",{src:"/brand/logo.png",alt:"TurfTracking",className:"h-12 w-12 object-contain"})}),p.jsxs("div",{className:"flex items-center space-x-4",children:[p.jsx("button",{className:"text-gray-400 hover:text-gray-500",children:p.jsx(uR,{className:"h-6 w-6"})}),p.jsx("div",{className:"h-6 w-6 rounded-full bg-primary-600 flex items-center justify-center",children:p.jsx("span",{className:"text-xs font-medium text-white",children:(S=r.firstName)==null?void 0:S[0]})})]})]})}),p.jsx("main",{className:"min-h-screen",children:e})]})]}):p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsx(Hs,{size:"lg",message:"Loading..."})})},Ah=({children:e})=>p.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary-50 to-grass-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[p.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"mx-auto h-16 w-16 bg-primary-600 rounded-full flex items-center justify-center mb-6",children:p.jsx("svg",{className:"h-10 w-10 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})})}),p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("img",{src:"/brand/logo.png",alt:"TurfTracking",className:"h-8 w-8"}),p.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"TurfTracking"})]}),p.jsx("p",{className:"text-lg text-gray-600",children:"Professional Lawn Care Management"})]})}),p.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:p.jsx("div",{className:"bg-white py-8 px-4 shadow-xl rounded-lg sm:px-10 border border-gray-200",children:e})}),p.jsx("div",{className:"mt-8 text-center",children:p.jsx("p",{className:"text-sm text-gray-500",children:"Track your lawn care with confidence"})})]});var kf=e=>e.type==="checkbox",Ja=e=>e instanceof Date,Br=e=>e==null;const hC=e=>typeof e=="object";var rn=e=>!Br(e)&&!Array.isArray(e)&&hC(e)&&!Ja(e),tM=e=>rn(e)&&e.target?kf(e.target)?e.target.checked:e.target.value:e,eM=(e,t)=>t.split(".").some((n,r,i)=>!isNaN(Number(n))&&e.has(i.slice(0,r).join("."))),nM=e=>{const t=e.constructor&&e.constructor.prototype;return rn(t)&&t.hasOwnProperty("isPrototypeOf")},Zy=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ln(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Zy&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(rn(e)&&nM(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=Ln(e[i]));return r}var Ip=e=>/^\w*$/.test(e),Ue=e=>e===void 0,Wy=e=>Array.isArray(e)?e.filter(Boolean):[],Xy=e=>Wy(e.replace(/["|']|\]/g,"").split(/\.|\[/)),bt=(e,t,n)=>{if(!t||!rn(e))return n;const r=(Ip(t)?[t]:Xy(t)).reduce((i,s)=>Br(i)?i:i[s],e);return Ue(r)||r===e?Ue(e[t])?n:e[t]:r},Fs=e=>typeof e=="boolean",us=e=>typeof e=="function",Ie=(e,t,n)=>{let r=-1;const i=Ip(t)?[t]:Xy(t),s=i.length,a=s-1;for(;++r<s;){const l=i[r];let c=n;if(r!==a){const f=e[l];c=rn(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Bl={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},cs={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},is={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},im="form",dC="root",rM=ye.createContext(null);rM.displayName="HookFormControlContext";var iM=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const a=s;return t._proxyFormState[a]!==cs.all&&(t._proxyFormState[a]=!r||cs.all),e[a]}});return i};const sM=typeof window<"u"?ye.useLayoutEffect:ye.useEffect;var br=e=>typeof e=="string",oM=(e,t,n,r,i)=>br(e)?(r&&t.watch.add(e),bt(n,e,i)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),bt(n,s))):(r&&(t.watchAll=!0),n),_v=e=>Br(e)||!hC(e);function Wo(e,t,n=new WeakSet){if(_v(e)||_v(t))return Object.is(e,t);if(Ja(e)&&Ja(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const s of r){const a=e[s];if(!i.includes(s))return!1;if(s!=="ref"){const l=t[s];if(Ja(a)&&Ja(l)||(rn(a)||Array.isArray(a))&&(rn(l)||Array.isArray(l))?!Wo(a,l,n):!Object.is(a,l))return!1}}return!0}const aM=ye.createContext(null);aM.displayName="HookFormContext";var lM=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Bc=e=>Array.isArray(e)?e:[e],ew=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}};function pC(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],s=t[r];if(i&&rn(i)&&s){const a=pC(i,s);rn(a)&&(n[r]=a)}else e[r]&&(n[r]=s)}return n}var Sr=e=>rn(e)&&!Object.keys(e).length,Yy=e=>e.type==="file",Bd=e=>{if(!Zy)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},gC=e=>e.type==="select-multiple",Ky=e=>e.type==="radio",uM=e=>Ky(e)||kf(e),sm=e=>Bd(e)&&e.isConnected;function cM(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ue(e)?r++:e[t[r++]];return e}function fM(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ue(e[t]))return!1;return!0}function gn(e,t){const n=Array.isArray(t)?t:Ip(t)?[t]:Xy(t),r=n.length===1?e:cM(e,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(rn(r)&&Sr(r)||Array.isArray(r)&&fM(r))&&gn(e,n.slice(0,-1)),e}var hM=e=>{for(const t in e)if(us(e[t]))return!0;return!1};function mC(e){return Array.isArray(e)||rn(e)&&!hM(e)}function xv(e,t={}){for(const n in e){const r=e[n];mC(r)?(t[n]=Array.isArray(r)?[]:{},xv(r,t[n])):Ue(r)||(t[n]=!0)}return t}function Pc(e,t,n){n||(n=xv(t));for(const r in e){const i=e[r];if(mC(i))Ue(t)||_v(n[r])?n[r]=xv(i,Array.isArray(i)?[]:{}):Pc(i,Br(t)?{}:t[r],n[r]);else{const s=t[r];n[r]=!Wo(i,s)}}return n}const nw={value:!1,isValid:!1},rw={value:!0,isValid:!0};var vC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ue(e[0].attributes.value)?Ue(e[0].value)||e[0].value===""?rw:{value:e[0].value,isValid:!0}:rw:nw}return nw},yC=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ue(e)?e:t?e===""?NaN:e&&+e:n&&br(e)?new Date(e):r?r(e):e;const iw={isValid:!1,value:null};var _C=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,iw):iw;function sw(e){const t=e.ref;return Yy(t)?t.files:Ky(t)?_C(e.refs).value:gC(t)?[...t.selectedOptions].map(({value:n})=>n):kf(t)?vC(e.refs).value:yC(Ue(t.value)?e.ref.value:t.value,e)}var dM=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,pM=(e,t,n,r)=>{const i={};for(const s of e){const a=bt(t,s);a&&Ie(i,s,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ud=e=>e instanceof RegExp,_c=e=>Ue(e)?e:Ud(e)?e.source:rn(e)?Ud(e.value)?e.value.source:e.value:e,ow=e=>({isOnSubmit:!e||e===cs.onSubmit,isOnBlur:e===cs.onBlur,isOnChange:e===cs.onChange,isOnAll:e===cs.all,isOnTouch:e===cs.onTouched});const aw="AsyncFunction";var gM=e=>!!e&&!!e.validate&&!!(us(e.validate)&&e.validate.constructor.name===aw||rn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aw)),mM=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),lw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Uc=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const s=bt(e,i);if(s){const{_f:a,...l}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(Uc(l,t))break}else if(rn(l)&&Uc(l,t))break}}};function uw(e,t,n){const r=bt(e,n);if(r||Ip(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),a=bt(t,s),l=bt(e,s);if(a&&!Array.isArray(a)&&n!==s)return{name:n};if(l&&l.type)return{name:s,error:l};if(l&&l.root&&l.root.type)return{name:`${s}.root`,error:l.root};i.pop()}return{name:n}}var vM=(e,t,n,r)=>{n(e);const{name:i,...s}=e;return Sr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!r||cs.all))},yM=(e,t,n)=>!e||!t||e===t||Bc(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),_M=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,xM=(e,t)=>!Wy(bt(e,t)).length&&gn(e,t),wM=(e,t,n)=>{const r=Bc(bt(e,n));return Ie(r,dC,t[n]),Ie(e,n,r),e};function cw(e,t,n="validate"){if(br(e)||Array.isArray(e)&&e.every(br)||Fs(e)&&!e)return{type:n,message:br(e)?e:"",ref:t}}var Ul=e=>rn(e)&&!Ud(e)?e:{value:e,message:""},fw=async(e,t,n,r,i,s)=>{const{ref:a,refs:l,required:c,maxLength:f,minLength:g,min:d,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:E}=e._f,w=bt(n,S);if(!E||t.has(S))return{};const N=l?l[0]:a,I=W=>{i&&N.reportValidity&&(N.setCustomValidity(Fs(W)?"":W||""),N.reportValidity())},R={},A=Ky(a),B=kf(a),q=A||B,Q=(C||Yy(a))&&Ue(a.value)&&Ue(w)||Bd(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,Y=lM.bind(null,S,r,R),J=(W,$,D,ut=is.maxLength,it=is.minLength)=>{const yt=W?$:D;R[S]={type:W?ut:it,message:yt,ref:a,...Y(W?ut:it,yt)}};if(s?!Array.isArray(w)||!w.length:c&&(!q&&(Q||Br(w))||Fs(w)&&!w||B&&!vC(l).isValid||A&&!_C(l).isValid)){const{value:W,message:$}=br(c)?{value:!!c,message:c}:Ul(c);if(W&&(R[S]={type:is.required,message:$,ref:N,...Y(is.required,$)},!r))return I($),R}if(!Q&&(!Br(d)||!Br(v))){let W,$;const D=Ul(v),ut=Ul(d);if(!Br(w)&&!isNaN(w)){const it=a.valueAsNumber||w&&+w;Br(D.value)||(W=it>D.value),Br(ut.value)||($=it<ut.value)}else{const it=a.valueAsDate||new Date(w),yt=tt=>new Date(new Date().toDateString()+" "+tt),z=a.type=="time",at=a.type=="week";br(D.value)&&w&&(W=z?yt(w)>yt(D.value):at?w>D.value:it>new Date(D.value)),br(ut.value)&&w&&($=z?yt(w)<yt(ut.value):at?w<ut.value:it<new Date(ut.value))}if((W||$)&&(J(!!W,D.message,ut.message,is.max,is.min),!r))return I(R[S].message),R}if((f||g)&&!Q&&(br(w)||s&&Array.isArray(w))){const W=Ul(f),$=Ul(g),D=!Br(W.value)&&w.length>+W.value,ut=!Br($.value)&&w.length<+$.value;if((D||ut)&&(J(D,W.message,$.message),!r))return I(R[S].message),R}if(y&&!Q&&br(w)){const{value:W,message:$}=Ul(y);if(Ud(W)&&!w.match(W)&&(R[S]={type:is.pattern,message:$,ref:a,...Y(is.pattern,$)},!r))return I($),R}if(x){if(us(x)){const W=await x(w,n),$=cw(W,N);if($&&(R[S]={...$,...Y(is.validate,$.message)},!r))return I($.message),R}else if(rn(x)){let W={};for(const $ in x){if(!Sr(W)&&!r)break;const D=cw(await x[$](w,n),N,$);D&&(W={...D,...Y($,D.message)},I(D.message),r&&(R[S]=W))}if(!Sr(W)&&(R[S]={ref:N,...W},!r))return R}}return I(!0),R};const EM={mode:cs.onSubmit,reValidateMode:cs.onChange,shouldFocusError:!0};function SM(e={}){let t={...EM,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:us(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=rn(t.defaultValues)||rn(t.values)?Ln(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Ln(i),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,f=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...g};let v={...d};const y={array:ew(),state:ew()},x=t.criteriaMode===cs.all,S=T=>F=>{clearTimeout(f),f=setTimeout(T,F)},C=async T=>{if(!a.keepIsValid&&!t.disabled&&(d.isValid||v.isValid||T)){let F;t.resolver?(F=Sr((await Q()).errors),E()):F=await W({fields:r,onlyCheckValid:!0,eventType:Bl.VALID}),F!==n.isValid&&y.state.next({isValid:F})}},E=(T,F)=>{!t.disabled&&(d.isValidating||d.validatingFields||v.isValidating||v.validatingFields)&&((T||Array.from(l.mount)).forEach(G=>{G&&(F?Ie(n.validatingFields,G,F):gn(n.validatingFields,G))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Sr(n.validatingFields)}))},w=T=>{const F=Pc(i,s),G=dM(T);Ie(n.dirtyFields,G,bt(F,G))},N=(T,F=[],G,gt,pt=!0,ft=!0)=>{if(gt&&G&&!t.disabled){if(a.action=!0,ft&&Array.isArray(bt(r,T))){const Et=G(bt(r,T),gt.argA,gt.argB);pt&&Ie(r,T,Et)}if(ft&&Array.isArray(bt(n.errors,T))){const Et=G(bt(n.errors,T),gt.argA,gt.argB);pt&&Ie(n.errors,T,Et),xM(n.errors,T)}if((d.touchedFields||v.touchedFields)&&ft&&Array.isArray(bt(n.touchedFields,T))){const Et=G(bt(n.touchedFields,T),gt.argA,gt.argB);pt&&Ie(n.touchedFields,T,Et)}(d.dirtyFields||v.dirtyFields)&&w(T),y.state.next({name:T,isDirty:D(T,F),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ie(s,T,F)},I=(T,F)=>{Ie(n.errors,T,F),y.state.next({errors:n.errors})},R=T=>{n.errors=T,y.state.next({errors:n.errors,isValid:!1})},A=(T,F,G,gt)=>{const pt=bt(r,T);if(pt){const ft=bt(s,T,Ue(G)?bt(i,T):G);Ue(ft)||gt&&gt.defaultChecked||F?Ie(s,T,F?ft:sw(pt._f)):yt(T,ft),a.mount&&!a.action&&C()}},B=(T,F,G,gt,pt)=>{let ft=!1,Et=!1;const Bt={name:T};if(!t.disabled){if(!G||gt){(d.isDirty||v.isDirty)&&(Et=n.isDirty,n.isDirty=Bt.isDirty=D(),ft=Et!==Bt.isDirty);const ne=Wo(bt(i,T),F);Et=!!bt(n.dirtyFields,T),ne?gn(n.dirtyFields,T):Ie(n.dirtyFields,T,!0),Bt.dirtyFields=n.dirtyFields,ft=ft||(d.dirtyFields||v.dirtyFields)&&Et!==!ne}if(G){const ne=bt(n.touchedFields,T);ne||(Ie(n.touchedFields,T,G),Bt.touchedFields=n.touchedFields,ft=ft||(d.touchedFields||v.touchedFields)&&ne!==G)}ft&&pt&&y.state.next(Bt)}return ft?Bt:{}},q=(T,F,G,gt)=>{const pt=bt(n.errors,T),ft=(d.isValid||v.isValid)&&Fs(F)&&n.isValid!==F;if(t.delayError&&G?(c=S(()=>I(T,G)),c(t.delayError)):(clearTimeout(f),c=null,G?Ie(n.errors,T,G):gn(n.errors,T)),(G?!Wo(pt,G):pt)||!Sr(gt)||ft){const Et={...gt,...ft&&Fs(F)?{isValid:F}:{},errors:n.errors,name:T};n={...n,...Et},y.state.next(Et)}},Q=async T=>(E(T,!0),await t.resolver(s,t.context,pM(T||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),Y=async T=>{const{errors:F}=await Q(T);if(E(T),T)for(const G of T){const gt=bt(F,G);gt?Ie(n.errors,G,gt):gn(n.errors,G)}else n.errors=F;return F},J=async({name:T,eventType:F})=>{if(e.validate){const G=await e.validate({formValues:s,formState:n,name:T,eventType:F});if(rn(G))for(const gt in G)G[gt]&&wt(`${im}.${gt}`,{message:br(G.message)?G.message:"",type:is.validate});else br(G)||!G?wt(im,{message:G||"",type:is.validate}):_t(im);return G}return!0},W=async({fields:T,onlyCheckValid:F,name:G,eventType:gt,context:pt={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(pt.runRootValidation=!0,!await J({name:G,eventType:gt})&&(pt.valid=!1,F)))return pt.valid;for(const ft in T){const Et=T[ft];if(Et){const{_f:Bt,...ne}=Et;if(Bt){const $e=l.array.has(Bt.name),_r=Et._f&&gM(Et._f);_r&&d.validatingFields&&E([Bt.name],!0);const tn=await fw(Et,l.disabled,s,x,t.shouldUseNativeValidation&&!F,$e);if(_r&&d.validatingFields&&E([Bt.name]),tn[Bt.name]&&(pt.valid=!1,F)||(!F&&(bt(tn,Bt.name)?$e?wM(n.errors,tn,Bt.name):Ie(n.errors,Bt.name,tn[Bt.name]):gn(n.errors,Bt.name)),e.shouldUseNativeValidation&&tn[Bt.name]))break}!Sr(ne)&&await W({context:pt,onlyCheckValid:F,fields:ne,name:ft,eventType:gt})}}return pt.valid},$=()=>{for(const T of l.unMount){const F=bt(r,T);F&&(F._f.refs?F._f.refs.every(G=>!sm(G)):!sm(F._f.ref))&&Ee(T)}l.unMount=new Set},D=(T,F)=>!t.disabled&&(T&&F&&Ie(s,T,F),!Wo(ct(),i)),ut=(T,F,G)=>oM(T,l,{...a.mount?s:Ue(F)?i:br(T)?{[T]:F}:F},G,F),it=T=>Wy(bt(a.mount?s:i,T,t.shouldUnregister?bt(i,T,[]):[])),yt=(T,F,G={})=>{const gt=bt(r,T);let pt=F;if(gt){const ft=gt._f;ft&&(!ft.disabled&&Ie(s,T,yC(F,ft)),pt=Bd(ft.ref)&&Br(F)?"":F,gC(ft.ref)?[...ft.ref.options].forEach(Et=>Et.selected=pt.includes(Et.value)):ft.refs?kf(ft.ref)?ft.refs.forEach(Et=>{(!Et.defaultChecked||!Et.disabled)&&(Array.isArray(pt)?Et.checked=!!pt.find(Bt=>Bt===Et.value):Et.checked=pt===Et.value||!!pt)}):ft.refs.forEach(Et=>Et.checked=Et.value===pt):Yy(ft.ref)?ft.ref.value="":(ft.ref.value=pt,ft.ref.type||y.state.next({name:T,values:Ln(s)})))}(G.shouldDirty||G.shouldTouch)&&B(T,pt,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&Lt(T)},z=(T,F,G)=>{for(const gt in F){if(!F.hasOwnProperty(gt))return;const pt=F[gt],ft=T+"."+gt,Et=bt(r,ft);(l.array.has(T)||rn(pt)||Et&&!Et._f)&&!Ja(pt)?z(ft,pt,G):yt(ft,pt,G)}},at=(T,F,G={})=>{const gt=bt(r,T),pt=l.array.has(T),ft=Ln(F);Ie(s,T,ft),pt?(y.array.next({name:T,values:Ln(s)}),(d.isDirty||d.dirtyFields||v.isDirty||v.dirtyFields)&&G.shouldDirty&&(w(T),y.state.next({name:T,dirtyFields:n.dirtyFields,isDirty:D(T,ft)}))):gt&&!gt._f&&!Br(ft)?z(T,ft,G):yt(T,ft,G),lw(T,l)?y.state.next({...n,name:T,values:Ln(s)}):y.state.next({name:a.mount?T:void 0,values:Ln(s)})},tt=async T=>{a.mount=!0;const F=T.target;let G=F.name,gt=!0;const pt=bt(r,G),ft=ne=>{gt=Number.isNaN(ne)||Ja(ne)&&isNaN(ne.getTime())||Wo(ne,bt(s,G,ne))},Et=ow(t.mode),Bt=ow(t.reValidateMode);if(pt){let ne,$e;const _r=F.type?sw(pt._f):tM(T),tn=T.type===Bl.BLUR||T.type===Bl.FOCUS_OUT,wi=!mM(pt._f)&&!e.validate&&!t.resolver&&!bt(n.errors,G)&&!pt._f.deps||_M(tn,bt(n.touchedFields,G),n.isSubmitted,Bt,Et),Aa=lw(G,l,tn);Ie(s,G,_r),tn?(!F||!F.readOnly)&&(pt._f.onBlur&&pt._f.onBlur(T),c&&c(0)):pt._f.onChange&&pt._f.onChange(T);const $i=B(G,_r,tn),Ku=!Sr($i)||Aa;if(!tn&&y.state.next({name:G,type:T.type,values:Ln(s)}),wi)return(d.isValid||v.isValid)&&(t.mode==="onBlur"?tn&&C():tn||C()),Ku&&y.state.next({name:G,...Aa?{}:$i});if(!t.resolver&&e.validate&&await J({name:G,eventType:T.type}),!tn&&Aa&&y.state.next({...n}),t.resolver){const{errors:Oo}=await Q([G]);if(E([G]),ft(_r),gt){const Da=uw(n.errors,r,G),Ls=uw(Oo,r,Da.name||G);ne=Ls.error,G=Ls.name,$e=Sr(Oo)}}else E([G],!0),ne=(await fw(pt,l.disabled,s,x,t.shouldUseNativeValidation))[G],E([G]),ft(_r),gt&&(ne?$e=!1:(d.isValid||v.isValid)&&($e=await W({fields:r,onlyCheckValid:!0,name:G,eventType:T.type})));gt&&(pt._f.deps&&(!Array.isArray(pt._f.deps)||pt._f.deps.length>0)&&Lt(pt._f.deps),q(G,$e,ne,$i))}},vt=(T,F)=>{if(bt(n.errors,F)&&T.focus)return T.focus(),1},Lt=async(T,F={})=>{let G,gt;const pt=Bc(T);if(t.resolver){const ft=await Y(Ue(T)?T:pt);G=Sr(ft),gt=T?!pt.some(Et=>bt(ft,Et)):G}else T?(gt=(await Promise.all(pt.map(async ft=>{const Et=bt(r,ft);return await W({fields:Et&&Et._f?{[ft]:Et}:Et,eventType:Bl.TRIGGER})}))).every(Boolean),!(!gt&&!n.isValid)&&C()):gt=G=await W({fields:r,name:T,eventType:Bl.TRIGGER});return y.state.next({...!br(T)||(d.isValid||v.isValid)&&G!==n.isValid?{}:{name:T},...t.resolver||!T?{isValid:G}:{},errors:n.errors}),F.shouldFocus&&!gt&&Uc(r,vt,T?pt:l.mount),gt},ct=(T,F)=>{let G={...a.mount?s:i};return F&&(G=pC(F.dirtyFields?n.dirtyFields:n.touchedFields,G)),Ue(T)?G:br(T)?bt(G,T):T.map(gt=>bt(G,gt))},ht=(T,F)=>({invalid:!!bt((F||n).errors,T),isDirty:!!bt((F||n).dirtyFields,T),error:bt((F||n).errors,T),isValidating:!!bt(n.validatingFields,T),isTouched:!!bt((F||n).touchedFields,T)}),_t=T=>{const F=T?Bc(T):void 0;F==null||F.forEach(G=>gn(n.errors,G)),F?F.forEach(G=>{y.state.next({name:G,errors:n.errors})}):y.state.next({errors:{}})},wt=(T,F,G)=>{const gt=(bt(r,T,{_f:{}})._f||{}).ref,pt=bt(n.errors,T)||{},{ref:ft,message:Et,type:Bt,...ne}=pt;Ie(n.errors,T,{...ne,...F,ref:gt}),y.state.next({name:T,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&gt&&gt.focus&&gt.focus()},Gt=(T,F)=>us(T)?y.state.subscribe({next:G=>"values"in G&&T(ut(void 0,F),G)}):ut(T,F,!0),jt=T=>y.state.subscribe({next:F=>{yM(T.name,F.name,T.exact)&&vM(F,T.formState||d,Il,T.reRenderRoot)&&T.callback({values:{...s},...n,...F,defaultValues:i})}}).unsubscribe,we=T=>(a.mount=!0,v={...v,...T.formState},jt({...T,formState:{...g,...T.formState}})),Ee=(T,F={})=>{for(const G of T?Bc(T):l.mount)l.mount.delete(G),l.array.delete(G),F.keepValue||(gn(r,G),gn(s,G)),!F.keepError&&gn(n.errors,G),!F.keepDirty&&gn(n.dirtyFields,G),!F.keepTouched&&gn(n.touchedFields,G),!F.keepIsValidating&&gn(n.validatingFields,G),!t.shouldUnregister&&!F.keepDefaultValue&&gn(i,G);y.state.next({values:Ln(s)}),y.state.next({...n,...F.keepDirty?{isDirty:D()}:{}}),!F.keepIsValid&&C()},Je=({disabled:T,name:F})=>{if(Fs(T)&&a.mount||T||l.disabled.has(F)){const pt=l.disabled.has(F)!==!!T;T?l.disabled.add(F):l.disabled.delete(F),pt&&a.mount&&!a.action&&C()}},De=(T,F={})=>{let G=bt(r,T);const gt=Fs(F.disabled)||Fs(t.disabled),pt=!l.registerName.has(T)&&G&&!G._f.mount;return Ie(r,T,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:T}},name:T,mount:!0,...F}}),l.mount.add(T),G&&!pt?Je({disabled:Fs(F.disabled)?F.disabled:t.disabled,name:T}):A(T,!0,F.value),{...gt?{disabled:F.disabled||t.disabled}:{},...t.progressive?{required:!!F.required,min:_c(F.min),max:_c(F.max),minLength:_c(F.minLength),maxLength:_c(F.maxLength),pattern:_c(F.pattern)}:{},name:T,onChange:tt,onBlur:tt,ref:ft=>{if(ft){l.registerName.add(T),De(T,F),l.registerName.delete(T),G=bt(r,T);const Et=Ue(ft.value)&&ft.querySelectorAll&&ft.querySelectorAll("input,select,textarea")[0]||ft,Bt=uM(Et),ne=G._f.refs||[];if(Bt?ne.find($e=>$e===Et):Et===G._f.ref)return;Ie(r,T,{_f:{...G._f,...Bt?{refs:[...ne.filter(sm),Et,...Array.isArray(bt(i,T))?[{}]:[]],ref:{type:Et.type,name:T}}:{ref:Et}}}),A(T,!1,void 0,Et)}else G=bt(r,T,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||F.shouldUnregister)&&!(eM(l.array,T)&&a.action)&&l.unMount.add(T)}}},jr=()=>t.shouldFocusError&&Uc(r,vt,l.mount),Nn=T=>{Fs(T)&&(y.state.next({disabled:T}),Uc(r,(F,G)=>{const gt=bt(r,G);gt&&(F.disabled=gt._f.disabled||T,Array.isArray(gt._f.refs)&&gt._f.refs.forEach(pt=>{pt.disabled=gt._f.disabled||T}))},0,!1))},Ke=(T,F)=>async G=>{let gt;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let pt=Ln(s);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:ft,values:Et}=await Q();E(),n.errors=ft,pt=Ln(Et)}else await W({fields:r,eventType:Bl.SUBMIT});if(l.disabled.size)for(const ft of l.disabled)gn(pt,ft);if(gn(n.errors,dC),Sr(n.errors)){y.state.next({errors:{}});try{await T(pt,G)}catch(ft){gt=ft}}else F&&await F({...n.errors},G),jr(),setTimeout(jr);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Sr(n.errors)&&!gt,submitCount:n.submitCount+1,errors:n.errors}),gt)throw gt},Ji=(T,F={})=>{bt(r,T)&&(Ue(F.defaultValue)?at(T,Ln(bt(i,T))):(at(T,F.defaultValue),Ie(i,T,Ln(F.defaultValue))),F.keepTouched||gn(n.touchedFields,T),F.keepDirty||(gn(n.dirtyFields,T),n.isDirty=F.defaultValue?D(T,Ln(bt(i,T))):D()),F.keepError||(gn(n.errors,T),d.isValid&&C()),y.state.next({...n}))},ar=(T,F={})=>{const G=T?Ln(T):i,gt=Ln(G),pt=Sr(T),ft=pt?i:gt;if(F.keepDefaultValues||(i=G),!F.keepValues){if(F.keepDirtyValues){const Et=new Set([...l.mount,...Object.keys(Pc(i,s))]);for(const Bt of Array.from(Et)){const ne=bt(n.dirtyFields,Bt),$e=bt(s,Bt),_r=bt(ft,Bt);ne&&!Ue($e)?Ie(ft,Bt,$e):!ne&&!Ue(_r)&&at(Bt,_r)}}else{if(Zy&&Ue(T))for(const Et of l.mount){const Bt=bt(r,Et);if(Bt&&Bt._f){const ne=Array.isArray(Bt._f.refs)?Bt._f.refs[0]:Bt._f.ref;if(Bd(ne)){const $e=ne.closest("form");if($e){$e.reset();break}}}}if(F.keepFieldsRef)for(const Et of l.mount)at(Et,bt(ft,Et));else r={}}s=t.shouldUnregister?F.keepDefaultValues?Ln(i):{}:Ln(ft),y.array.next({values:{...ft}}),y.state.next({values:{...ft}})}l={mount:F.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!F.keepIsValid||!!F.keepDirtyValues||!t.shouldUnregister&&!Sr(ft),a.watch=!!t.shouldUnregister,a.keepIsValid=!!F.keepIsValid,a.action=!1,F.keepErrors||(n.errors={}),y.state.next({submitCount:F.keepSubmitCount?n.submitCount:0,isDirty:pt?!1:F.keepDirty?n.isDirty:!!(F.keepDefaultValues&&!Wo(T,i)),isSubmitted:F.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:pt?{}:F.keepDirtyValues?F.keepDefaultValues&&s?Pc(i,s):n.dirtyFields:F.keepDefaultValues&&T?Pc(i,T):F.keepDirty?n.dirtyFields:{},touchedFields:F.keepTouched?n.touchedFields:{},errors:F.keepErrors?n.errors:{},isSubmitSuccessful:F.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},cn=(T,F)=>ar(us(T)?T(s):T,{...t.resetOptions,...F}),xi=(T,F={})=>{const G=bt(r,T),gt=G&&G._f;if(gt){const pt=gt.refs?gt.refs[0]:gt.ref;pt.focus&&setTimeout(()=>{pt.focus(),F.shouldSelect&&us(pt.select)&&pt.select()})}},Il=T=>{n={...n,...T}},Ma={control:{register:De,unregister:Ee,getFieldState:ht,handleSubmit:Ke,setError:wt,_subscribe:jt,_runSchema:Q,_updateIsValidating:E,_focusError:jr,_getWatch:ut,_getDirty:D,_setValid:C,_setFieldArray:N,_setDisabledField:Je,_setErrors:R,_getFieldArray:it,_reset:ar,_resetDefaultValues:()=>us(t.defaultValues)&&t.defaultValues().then(T=>{cn(T,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Nn,_subjects:y,_proxyFormState:d,get _fields(){return r},get _formValues(){return s},get _state(){return a},set _state(T){a=T},get _defaultValues(){return i},get _names(){return l},set _names(T){l=T},get _formState(){return n},get _options(){return t},set _options(T){t={...t,...T}}},subscribe:we,trigger:Lt,register:De,handleSubmit:Ke,watch:Gt,setValue:at,getValues:ct,reset:cn,resetField:Ji,clearErrors:_t,unregister:Ee,setError:wt,setFocus:xi,getFieldState:ht};return{...Ma,formControl:Ma}}function Tp(e={}){const t=ye.useRef(void 0),n=ye.useRef(void 0),[r,i]=ye.useState({isDirty:!1,isValidating:!1,isLoading:us(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:us(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!us(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...l}=SM(e);t.current={...l,formState:r}}const s=t.current.control;return s._options=e,sM(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),s._formState.isReady=!0,a},[s]),ye.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ye.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),ye.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),ye.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),ye.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==r.isDirty&&s._subjects.state.next({isDirty:a})}},[s,r.isDirty]),ye.useEffect(()=>{var a;e.values&&!Wo(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((a=s._options.resetOptions)===null||a===void 0)&&a.keepIsValid||s._setValid(),n.current=e.values,i(l=>({...l}))):s._resetDefaultValues()},[s,e.values]),ye.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=ye.useMemo(()=>iM(r,s),[s,r]),t.current}const CM=()=>{var E,w;const[e,t]=P.useState(!1),[n,r]=P.useState(!0),[i,s]=P.useState(!0),{login:a,loading:l}=qu(),c=La(),g=((w=(E=ba().state)==null?void 0:E.from)==null?void 0:w.pathname)||"/dashboard",{register:d,handleSubmit:v,formState:{errors:y},setError:x}=Tp();P.useEffect(()=>{(async()=>{try{const I=await K.get("/auth/registration-status");r(I.data.data.enabled)}catch(I){console.error("Failed to fetch registration setting:",I),r(!0)}finally{s(!1)}})()},[]);const S=async N=>{console.log("Login form submitted:",N.email);const I=await a(N);console.log("Login result:",I),I.success?(console.log("Login successful, navigating to:",g),c(g,{replace:!0})):(console.log("Login failed, showing error:",I.error),x("root",{type:"manual",message:I.error}))},C=()=>{window.location.href=`${oC.apiOrigin}/api/auth/authentik`};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Sign in to your account"}),!i&&n&&p.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Or"," ",p.jsx(tr,{to:"/register",className:"font-medium text-primary-600 hover:text-primary-500",children:"create a new account"})]})]}),p.jsxs("form",{className:"space-y-6",onSubmit:v(S),children:[y.root&&p.jsx("div",{className:"rounded-md bg-red-50 p-4",children:p.jsx("div",{className:"flex",children:p.jsx("div",{className:"ml-3",children:p.jsx("h3",{className:"text-sm font-medium text-red-800",children:y.root.message})})})}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"email",className:"label",children:"Email address"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"email",type:"email",autoComplete:"email",className:y.email?"input-error":"input",...d("email",{required:"Email is required",pattern:{value:/^\S+@\S+$/i,message:"Invalid email address"}})}),y.email&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:y.email.message})]})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"password",className:"label",children:"Password"}),p.jsxs("div",{className:"mt-1 relative",children:[p.jsx("input",{id:"password",type:e?"text":"password",autoComplete:"current-password",className:y.password?"input-error pr-10":"input pr-10",...d("password",{required:"Password is required"})}),p.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:()=>t(!e),children:e?p.jsx(cC,{className:"h-5 w-5 text-gray-400"}):p.jsx(zd,{className:"h-5 w-5 text-gray-400"})}),y.password&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:y.password.message})]})]}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("input",{id:"remember-me",name:"remember-me",type:"checkbox",className:"h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded"}),p.jsx("label",{htmlFor:"remember-me",className:"ml-2 block text-sm text-gray-900",children:"Remember me"})]}),p.jsx("div",{className:"text-sm",children:p.jsx(tr,{to:"/forgot-password",className:"font-medium text-primary-600 hover:text-primary-500",children:"Forgot your password?"})})]}),p.jsx("div",{children:p.jsx("button",{type:"submit",disabled:l,className:"btn-primary w-full justify-center",children:l?p.jsx(Hs,{size:"sm",color:"white"}):"Sign in"})}),p.jsxs("div",{className:"mt-6",children:[p.jsxs("div",{className:"relative",children:[p.jsx("div",{className:"absolute inset-0 flex items-center",children:p.jsx("div",{className:"w-full border-t border-gray-300"})}),p.jsx("div",{className:"relative flex justify-center text-sm",children:p.jsx("span",{className:"px-2 bg-white text-gray-500",children:"Or continue with"})})]}),p.jsx("div",{className:"mt-6",children:p.jsxs("button",{type:"button",onClick:C,className:"w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-lg shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors duration-200",children:[p.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:[p.jsx("path",{d:"M12 2L2 7v10c0 5.55 3.84 9.74 9 11 5.16-1.26 9-5.45 9-11V7l-10-5z"}),p.jsx("path",{d:"M10 17l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z",fill:"white"})]}),p.jsx("span",{className:"ml-2",children:"Sign in with Authentik"})]})})]})]})]})},NM=()=>{const[e,t]=P.useState(!1),[n,r]=P.useState(!1),{register:i,loading:s}=qu(),a=La(),[l]=wS(),c=l.get("invite"),{register:f,handleSubmit:g,formState:{errors:d},watch:v,setError:y,setValue:x}=Tp(),S=v("password");P.useEffect(()=>{(async()=>{var w,N,I,R;if(c)try{r(!0);const B=(N=(w=(await Zo.getInvitation(c)).data)==null?void 0:w.data)==null?void 0:N.invitation;if(!B)return;x("firstName",B.firstName||""),x("lastName",B.lastName||""),x("email",B.email||"")}catch(A){y("root",{type:"manual",message:((R=(I=A.response)==null?void 0:I.data)==null?void 0:R.message)||"Invitation is invalid or expired"})}finally{r(!1)}})()},[c,y,x]);const C=async E=>{console.log("Register form submitted:",E.email);const w=await i({...E,inviteToken:c});console.log("Register result:",w),w.success?(console.log("Registration successful, navigating to dashboard"),a("/dashboard")):(console.log("Registration failed, showing error:",w.error),y("root",{type:"manual",message:w.error}))};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:c?"Accept your invitation":"Create your account"}),p.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:[c?"Finish account setup to access TurfTracking.":"Already have an account? ",!c&&p.jsx(tr,{to:"/login",className:"font-medium text-primary-600 hover:text-primary-500",children:"Sign in here"})]})]}),n&&p.jsx("div",{className:"rounded-md bg-blue-50 p-4 text-sm text-blue-800",children:"Validating invitation..."}),p.jsxs("form",{className:"space-y-6",onSubmit:g(C),children:[d.root&&p.jsx("div",{className:"rounded-md bg-red-50 p-4",children:p.jsx("div",{className:"flex",children:p.jsx("div",{className:"ml-3",children:p.jsx("h3",{className:"text-sm font-medium text-red-800",children:d.root.message})})})}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{children:[p.jsx("label",{htmlFor:"firstName",className:"label",children:"First name"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"firstName",type:"text",autoComplete:"given-name",className:d.firstName?"input-error":"input",...f("firstName",{required:"First name is required",minLength:{value:2,message:"First name must be at least 2 characters"}})}),d.firstName&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.firstName.message})]})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"lastName",className:"label",children:"Last name"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"lastName",type:"text",autoComplete:"family-name",className:d.lastName?"input-error":"input",...f("lastName",{required:"Last name is required",minLength:{value:2,message:"Last name must be at least 2 characters"}})}),d.lastName&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.lastName.message})]})]})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"email",className:"label",children:"Email address"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"email",type:"email",autoComplete:"email",className:d.email?"input-error":"input",readOnly:!!c,...f("email",{required:"Email is required",pattern:{value:/^\S+@\S+$/i,message:"Invalid email address"}})}),d.email&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.email.message})]})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"password",className:"label",children:"Password"}),p.jsxs("div",{className:"mt-1 relative",children:[p.jsx("input",{id:"password",type:e?"text":"password",autoComplete:"new-password",className:d.password?"input-error pr-10":"input pr-10",...f("password",{required:"Password is required",minLength:{value:8,message:"Password must be at least 8 characters"},pattern:{value:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#+])[A-Za-z\d@$!%*?&#+]/,message:"Password must contain uppercase, lowercase, number, and special character"}})}),p.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:()=>t(!e),children:e?p.jsx(cC,{className:"h-5 w-5 text-gray-400"}):p.jsx(zd,{className:"h-5 w-5 text-gray-400"})}),d.password&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.password.message})]})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"confirmPassword",className:"label",children:"Confirm password"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"confirmPassword",type:"password",autoComplete:"new-password",className:d.confirmPassword?"input-error":"input",...f("confirmPassword",{required:"Please confirm your password",validate:E=>E===S||"Passwords do not match"})}),d.confirmPassword&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.confirmPassword.message})]})]}),p.jsxs("div",{className:"flex items-center",children:[p.jsx("input",{id:"agree-terms",type:"checkbox",className:"h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded",...f("agreeTerms",{required:"You must agree to the terms and conditions"})}),p.jsxs("label",{htmlFor:"agree-terms",className:"ml-2 block text-sm text-gray-900",children:["I agree to the"," ",p.jsx(tr,{to:"/terms",className:"text-primary-600 hover:text-primary-500",target:"_blank",children:"Terms and Conditions"})," ","and"," ",p.jsx(tr,{to:"/privacy",className:"text-primary-600 hover:text-primary-500",target:"_blank",children:"Privacy Policy"})]})]}),d.agreeTerms&&p.jsx("p",{className:"text-sm text-red-600",children:d.agreeTerms.message}),p.jsx("div",{children:p.jsx("button",{type:"submit",disabled:s,className:"btn-primary w-full justify-center",children:s?p.jsx(Hs,{size:"sm",color:"white"}):"Create account"})})]})]})},PM=()=>{const{forgotPassword:e,loading:t}=qu(),{register:n,handleSubmit:r,formState:{errors:i},setError:s,reset:a}=Tp(),l=async c=>{const f=await e(c.email);f.success?a():s("root",{type:"manual",message:f.error})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Forgot your password?"}),p.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Enter your email address and we'll send you a link to reset your password."})]}),p.jsxs("form",{className:"space-y-6",onSubmit:r(l),children:[i.root&&p.jsx("div",{className:"rounded-md bg-red-50 p-4",children:p.jsx("div",{className:"flex",children:p.jsx("div",{className:"ml-3",children:p.jsx("h3",{className:"text-sm font-medium text-red-800",children:i.root.message})})})}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"email",className:"label",children:"Email address"}),p.jsxs("div",{className:"mt-1",children:[p.jsx("input",{id:"email",type:"email",autoComplete:"email",className:i.email?"input-error":"input",...n("email",{required:"Email is required",pattern:{value:/^\S+@\S+$/i,message:"Invalid email address"}})}),i.email&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:i.email.message})]})]}),p.jsx("div",{children:p.jsx("button",{type:"submit",disabled:t,className:"btn-primary w-full justify-center",children:t?p.jsx(Hs,{size:"sm",color:"white"}):"Send reset link"})}),p.jsx("div",{className:"text-center",children:p.jsx(tr,{to:"/login",className:"font-medium text-primary-600 hover:text-primary-500",children:"Back to sign in"})})]})]})},bM=()=>{const[e]=wS(),t=La(),n=e.get("token"),[r,i]=P.useState(!0),[s,a]=P.useState(!1),[l,c]=P.useState(!1),{register:f,handleSubmit:g,watch:d,setError:v,formState:{errors:y}}=Tp(),x=d("newPassword");P.useEffect(()=>{(async()=>{var E,w;if(!n){v("root",{type:"manual",message:"Password reset link is missing a token."}),i(!1);return}try{await Zo.validateResetToken(n),a(!0)}catch(N){v("root",{type:"manual",message:((w=(E=N.response)==null?void 0:E.data)==null?void 0:w.message)||"Password reset link is invalid or expired."})}finally{i(!1)}})()},[n,v]);const S=async C=>{var E,w;try{c(!0),await Zo.resetPassword({token:n,newPassword:C.newPassword}),t("/login",{replace:!0})}catch(N){v("root",{type:"manual",message:((w=(E=N.response)==null?void 0:E.data)==null?void 0:w.message)||"Failed to reset password"})}finally{c(!1)}};return r?p.jsxs("div",{className:"space-y-6",children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Reset your password"}),p.jsx("div",{className:"flex justify-center py-8",children:p.jsx(Hs,{size:"lg"})})]}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Reset your password"}),p.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Choose a new password for your TurfTracking account."})]}),y.root&&p.jsx("div",{className:"rounded-md bg-red-50 p-4 text-sm font-medium text-red-800",children:y.root.message}),s&&p.jsxs("form",{className:"space-y-6",onSubmit:g(S),children:[p.jsxs("div",{children:[p.jsx("label",{htmlFor:"newPassword",className:"label",children:"New password"}),p.jsx("input",{id:"newPassword",type:"password",className:y.newPassword?"input-error":"input",...f("newPassword",{required:"Password is required",minLength:{value:8,message:"Password must be at least 8 characters"},pattern:{value:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#+])[A-Za-z\d@$!%*?&#+]/,message:"Password must contain uppercase, lowercase, number, and special character"}})}),y.newPassword&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:y.newPassword.message})]}),p.jsxs("div",{children:[p.jsx("label",{htmlFor:"confirmPassword",className:"label",children:"Confirm password"}),p.jsx("input",{id:"confirmPassword",type:"password",className:y.confirmPassword?"input-error":"input",...f("confirmPassword",{required:"Please confirm your password",validate:C=>C===x||"Passwords do not match"})}),y.confirmPassword&&p.jsx("p",{className:"mt-2 text-sm text-red-600",children:y.confirmPassword.message})]}),p.jsx("button",{type:"submit",disabled:l,className:"btn-primary w-full justify-center",children:l?p.jsx(Hs,{size:"sm",color:"white"}):"Reset password"})]}),p.jsx("div",{className:"text-center",children:p.jsx(tr,{to:"/login",className:"font-medium text-primary-600 hover:text-primary-500",children:"Back to sign in"})})]})};function xC(e,t){const n=P.useRef(t);P.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const LM=1;function IM(e){return Object.freeze({__version:LM,map:e})}function Qy(e,t){return Object.freeze({...e,...t})}const wC=P.createContext(null),EC=wC.Provider;function Op(){const e=P.useContext(wC);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function SC(e){function t(n,r){const{instance:i,context:s}=e(n).current;return P.useImperativeHandle(r,()=>i),n.children==null?null:ye.createElement(EC,{value:s},n.children)}return P.forwardRef(t)}function TM(e){function t(n,r){const[i,s]=P.useState(!1),{instance:a}=e(n,s).current;P.useImperativeHandle(r,()=>a),P.useEffect(function(){i&&a.update()},[a,i,n.children]);const l=a._contentNode;return l?Oy.createPortal(n.children,l):null}return P.forwardRef(t)}function OM(e){function t(n,r){const{instance:i}=e(n).current;return P.useImperativeHandle(r,()=>i),null}return P.forwardRef(t)}function Jy(e,t){const n=P.useRef();P.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function Rp(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function RM(e,t){return function(r,i){const s=Op(),a=e(Rp(r,s),s);return xC(s.map,r.attribution),Jy(a.current,r.eventHandlers),t(a.current,s,r,i),a}}var wv={exports:{}};/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/(function(e,t){(function(n,r){r(t)})(EP,function(n){var r="1.9.4";function i(o){var u,h,m,_;for(h=1,m=arguments.length;h<m;h++){_=arguments[h];for(u in _)o[u]=_[u]}return o}var s=Object.create||function(){function o(){}return function(u){return o.prototype=u,new o}}();function a(o,u){var h=Array.prototype.slice;if(o.bind)return o.bind.apply(o,h.call(arguments,1));var m=h.call(arguments,2);return function(){return o.apply(u,m.length?m.concat(h.call(arguments)):arguments)}}var l=0;function c(o){return"_leaflet_id"in o||(o._leaflet_id=++l),o._leaflet_id}function f(o,u,h){var m,_,b,O;return O=function(){m=!1,_&&(b.apply(h,_),_=!1)},b=function(){m?_=arguments:(o.apply(h,arguments),setTimeout(O,u),m=!0)},b}function g(o,u,h){var m=u[1],_=u[0],b=m-_;return o===m&&h?o:((o-_)%b+b)%b+_}function d(){return!1}function v(o,u){if(u===!1)return o;var h=Math.pow(10,u===void 0?6:u);return Math.round(o*h)/h}function y(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function x(o){return y(o).split(/\s+/)}function S(o,u){Object.prototype.hasOwnProperty.call(o,"options")||(o.options=o.options?s(o.options):{});for(var h in u)o.options[h]=u[h];return o.options}function C(o,u,h){var m=[];for(var _ in o)m.push(encodeURIComponent(h?_.toUpperCase():_)+"="+encodeURIComponent(o[_]));return(!u||u.indexOf("?")===-1?"?":"&")+m.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function w(o,u){return o.replace(E,function(h,m){var _=u[m];if(_===void 0)throw new Error("No value provided for variable "+h);return typeof _=="function"&&(_=_(u)),_})}var N=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function I(o,u){for(var h=0;h<o.length;h++)if(o[h]===u)return h;return-1}var R="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function A(o){return window["webkit"+o]||window["moz"+o]||window["ms"+o]}var B=0;function q(o){var u=+new Date,h=Math.max(0,16-(u-B));return B=u+h,window.setTimeout(o,h)}var Q=window.requestAnimationFrame||A("RequestAnimationFrame")||q,Y=window.cancelAnimationFrame||A("CancelAnimationFrame")||A("CancelRequestAnimationFrame")||function(o){window.clearTimeout(o)};function J(o,u,h){if(h&&Q===q)o.call(u);else return Q.call(window,a(o,u))}function W(o){o&&Y.call(window,o)}var $={__proto__:null,extend:i,create:s,bind:a,get lastId(){return l},stamp:c,throttle:f,wrapNum:g,falseFn:d,formatNum:v,trim:y,splitWords:x,setOptions:S,getParamString:C,template:w,isArray:N,indexOf:I,emptyImageUrl:R,requestFn:Q,cancelFn:Y,requestAnimFrame:J,cancelAnimFrame:W};function D(){}D.extend=function(o){var u=function(){S(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},h=u.__super__=this.prototype,m=s(h);m.constructor=u,u.prototype=m;for(var _ in this)Object.prototype.hasOwnProperty.call(this,_)&&_!=="prototype"&&_!=="__super__"&&(u[_]=this[_]);return o.statics&&i(u,o.statics),o.includes&&(ut(o.includes),i.apply(null,[m].concat(o.includes))),i(m,o),delete m.statics,delete m.includes,m.options&&(m.options=h.options?s(h.options):{},i(m.options,o.options)),m._initHooks=[],m.callInitHooks=function(){if(!this._initHooksCalled){h.callInitHooks&&h.callInitHooks.call(this),this._initHooksCalled=!0;for(var b=0,O=m._initHooks.length;b<O;b++)m._initHooks[b].call(this)}},u},D.include=function(o){var u=this.prototype.options;return i(this.prototype,o),o.options&&(this.prototype.options=u,this.mergeOptions(o.options)),this},D.mergeOptions=function(o){return i(this.prototype.options,o),this},D.addInitHook=function(o){var u=Array.prototype.slice.call(arguments,1),h=typeof o=="function"?o:function(){this[o].apply(this,u)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(h),this};function ut(o){if(!(typeof L>"u"||!L||!L.Mixin)){o=N(o)?o:[o];for(var u=0;u<o.length;u++)o[u]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var it={on:function(o,u,h){if(typeof o=="object")for(var m in o)this._on(m,o[m],u);else{o=x(o);for(var _=0,b=o.length;_<b;_++)this._on(o[_],u,h)}return this},off:function(o,u,h){if(!arguments.length)delete this._events;else if(typeof o=="object")for(var m in o)this._off(m,o[m],u);else{o=x(o);for(var _=arguments.length===1,b=0,O=o.length;b<O;b++)_?this._off(o[b]):this._off(o[b],u,h)}return this},_on:function(o,u,h,m){if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}if(this._listens(o,u,h)===!1){h===this&&(h=void 0);var _={fn:u,ctx:h};m&&(_.once=!0),this._events=this._events||{},this._events[o]=this._events[o]||[],this._events[o].push(_)}},_off:function(o,u,h){var m,_,b;if(this._events&&(m=this._events[o],!!m)){if(arguments.length===1){if(this._firingCount)for(_=0,b=m.length;_<b;_++)m[_].fn=d;delete this._events[o];return}if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}var O=this._listens(o,u,h);if(O!==!1){var j=m[O];this._firingCount&&(j.fn=d,this._events[o]=m=m.slice()),m.splice(O,1)}}},fire:function(o,u,h){if(!this.listens(o,h))return this;var m=i({},u,{type:o,target:this,sourceTarget:u&&u.sourceTarget||this});if(this._events){var _=this._events[o];if(_){this._firingCount=this._firingCount+1||1;for(var b=0,O=_.length;b<O;b++){var j=_[b],Z=j.fn;j.once&&this.off(o,Z,j.ctx),Z.call(j.ctx||this,m)}this._firingCount--}}return h&&this._propagateEvent(m),this},listens:function(o,u,h,m){typeof o!="string"&&console.warn('"string" type argument expected');var _=u;typeof u!="function"&&(m=!!u,_=void 0,h=void 0);var b=this._events&&this._events[o];if(b&&b.length&&this._listens(o,_,h)!==!1)return!0;if(m){for(var O in this._eventParents)if(this._eventParents[O].listens(o,u,h,m))return!0}return!1},_listens:function(o,u,h){if(!this._events)return!1;var m=this._events[o]||[];if(!u)return!!m.length;h===this&&(h=void 0);for(var _=0,b=m.length;_<b;_++)if(m[_].fn===u&&m[_].ctx===h)return _;return!1},once:function(o,u,h){if(typeof o=="object")for(var m in o)this._on(m,o[m],u,!0);else{o=x(o);for(var _=0,b=o.length;_<b;_++)this._on(o[_],u,h,!0)}return this},addEventParent:function(o){return this._eventParents=this._eventParents||{},this._eventParents[c(o)]=o,this},removeEventParent:function(o){return this._eventParents&&delete this._eventParents[c(o)],this},_propagateEvent:function(o){for(var u in this._eventParents)this._eventParents[u].fire(o.type,i({layer:o.target,propagatedFrom:o.target},o),!0)}};it.addEventListener=it.on,it.removeEventListener=it.clearAllEventListeners=it.off,it.addOneTimeEventListener=it.once,it.fireEvent=it.fire,it.hasEventListeners=it.listens;var yt=D.extend(it);function z(o,u,h){this.x=h?Math.round(o):o,this.y=h?Math.round(u):u}var at=Math.trunc||function(o){return o>0?Math.floor(o):Math.ceil(o)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(o){return this.clone()._add(tt(o))},_add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.clone()._subtract(tt(o))},_subtract:function(o){return this.x-=o.x,this.y-=o.y,this},divideBy:function(o){return this.clone()._divideBy(o)},_divideBy:function(o){return this.x/=o,this.y/=o,this},multiplyBy:function(o){return this.clone()._multiplyBy(o)},_multiplyBy:function(o){return this.x*=o,this.y*=o,this},scaleBy:function(o){return new z(this.x*o.x,this.y*o.y)},unscaleBy:function(o){return new z(this.x/o.x,this.y/o.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=at(this.x),this.y=at(this.y),this},distanceTo:function(o){o=tt(o);var u=o.x-this.x,h=o.y-this.y;return Math.sqrt(u*u+h*h)},equals:function(o){return o=tt(o),o.x===this.x&&o.y===this.y},contains:function(o){return o=tt(o),Math.abs(o.x)<=Math.abs(this.x)&&Math.abs(o.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function tt(o,u,h){return o instanceof z?o:N(o)?new z(o[0],o[1]):o==null?o:typeof o=="object"&&"x"in o&&"y"in o?new z(o.x,o.y):new z(o,u,h)}function vt(o,u){if(o)for(var h=u?[o,u]:o,m=0,_=h.length;m<_;m++)this.extend(h[m])}vt.prototype={extend:function(o){var u,h;if(!o)return this;if(o instanceof z||typeof o[0]=="number"||"x"in o)u=h=tt(o);else if(o=Lt(o),u=o.min,h=o.max,!u||!h)return this;return!this.min&&!this.max?(this.min=u.clone(),this.max=h.clone()):(this.min.x=Math.min(u.x,this.min.x),this.max.x=Math.max(h.x,this.max.x),this.min.y=Math.min(u.y,this.min.y),this.max.y=Math.max(h.y,this.max.y)),this},getCenter:function(o){return tt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,o)},getBottomLeft:function(){return tt(this.min.x,this.max.y)},getTopRight:function(){return tt(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(o){var u,h;return typeof o[0]=="number"||o instanceof z?o=tt(o):o=Lt(o),o instanceof vt?(u=o.min,h=o.max):u=h=o,u.x>=this.min.x&&h.x<=this.max.x&&u.y>=this.min.y&&h.y<=this.max.y},intersects:function(o){o=Lt(o);var u=this.min,h=this.max,m=o.min,_=o.max,b=_.x>=u.x&&m.x<=h.x,O=_.y>=u.y&&m.y<=h.y;return b&&O},overlaps:function(o){o=Lt(o);var u=this.min,h=this.max,m=o.min,_=o.max,b=_.x>u.x&&m.x<h.x,O=_.y>u.y&&m.y<h.y;return b&&O},isValid:function(){return!!(this.min&&this.max)},pad:function(o){var u=this.min,h=this.max,m=Math.abs(u.x-h.x)*o,_=Math.abs(u.y-h.y)*o;return Lt(tt(u.x-m,u.y-_),tt(h.x+m,h.y+_))},equals:function(o){return o?(o=Lt(o),this.min.equals(o.getTopLeft())&&this.max.equals(o.getBottomRight())):!1}};function Lt(o,u){return!o||o instanceof vt?o:new vt(o,u)}function ct(o,u){if(o)for(var h=u?[o,u]:o,m=0,_=h.length;m<_;m++)this.extend(h[m])}ct.prototype={extend:function(o){var u=this._southWest,h=this._northEast,m,_;if(o instanceof _t)m=o,_=o;else if(o instanceof ct){if(m=o._southWest,_=o._northEast,!m||!_)return this}else return o?this.extend(wt(o)||ht(o)):this;return!u&&!h?(this._southWest=new _t(m.lat,m.lng),this._northEast=new _t(_.lat,_.lng)):(u.lat=Math.min(m.lat,u.lat),u.lng=Math.min(m.lng,u.lng),h.lat=Math.max(_.lat,h.lat),h.lng=Math.max(_.lng,h.lng)),this},pad:function(o){var u=this._southWest,h=this._northEast,m=Math.abs(u.lat-h.lat)*o,_=Math.abs(u.lng-h.lng)*o;return new ct(new _t(u.lat-m,u.lng-_),new _t(h.lat+m,h.lng+_))},getCenter:function(){return new _t((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new _t(this.getNorth(),this.getWest())},getSouthEast:function(){return new _t(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(o){typeof o[0]=="number"||o instanceof _t||"lat"in o?o=wt(o):o=ht(o);var u=this._southWest,h=this._northEast,m,_;return o instanceof ct?(m=o.getSouthWest(),_=o.getNorthEast()):m=_=o,m.lat>=u.lat&&_.lat<=h.lat&&m.lng>=u.lng&&_.lng<=h.lng},intersects:function(o){o=ht(o);var u=this._southWest,h=this._northEast,m=o.getSouthWest(),_=o.getNorthEast(),b=_.lat>=u.lat&&m.lat<=h.lat,O=_.lng>=u.lng&&m.lng<=h.lng;return b&&O},overlaps:function(o){o=ht(o);var u=this._southWest,h=this._northEast,m=o.getSouthWest(),_=o.getNorthEast(),b=_.lat>u.lat&&m.lat<h.lat,O=_.lng>u.lng&&m.lng<h.lng;return b&&O},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(o,u){return o?(o=ht(o),this._southWest.equals(o.getSouthWest(),u)&&this._northEast.equals(o.getNorthEast(),u)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ht(o,u){return o instanceof ct?o:new ct(o,u)}function _t(o,u,h){if(isNaN(o)||isNaN(u))throw new Error("Invalid LatLng object: ("+o+", "+u+")");this.lat=+o,this.lng=+u,h!==void 0&&(this.alt=+h)}_t.prototype={equals:function(o,u){if(!o)return!1;o=wt(o);var h=Math.max(Math.abs(this.lat-o.lat),Math.abs(this.lng-o.lng));return h<=(u===void 0?1e-9:u)},toString:function(o){return"LatLng("+v(this.lat,o)+", "+v(this.lng,o)+")"},distanceTo:function(o){return jt.distance(this,wt(o))},wrap:function(){return jt.wrapLatLng(this)},toBounds:function(o){var u=180*o/40075017,h=u/Math.cos(Math.PI/180*this.lat);return ht([this.lat-u,this.lng-h],[this.lat+u,this.lng+h])},clone:function(){return new _t(this.lat,this.lng,this.alt)}};function wt(o,u,h){return o instanceof _t?o:N(o)&&typeof o[0]!="object"?o.length===3?new _t(o[0],o[1],o[2]):o.length===2?new _t(o[0],o[1]):null:o==null?o:typeof o=="object"&&"lat"in o?new _t(o.lat,"lng"in o?o.lng:o.lon,o.alt):u===void 0?null:new _t(o,u,h)}var Gt={latLngToPoint:function(o,u){var h=this.projection.project(o),m=this.scale(u);return this.transformation._transform(h,m)},pointToLatLng:function(o,u){var h=this.scale(u),m=this.transformation.untransform(o,h);return this.projection.unproject(m)},project:function(o){return this.projection.project(o)},unproject:function(o){return this.projection.unproject(o)},scale:function(o){return 256*Math.pow(2,o)},zoom:function(o){return Math.log(o/256)/Math.LN2},getProjectedBounds:function(o){if(this.infinite)return null;var u=this.projection.bounds,h=this.scale(o),m=this.transformation.transform(u.min,h),_=this.transformation.transform(u.max,h);return new vt(m,_)},infinite:!1,wrapLatLng:function(o){var u=this.wrapLng?g(o.lng,this.wrapLng,!0):o.lng,h=this.wrapLat?g(o.lat,this.wrapLat,!0):o.lat,m=o.alt;return new _t(h,u,m)},wrapLatLngBounds:function(o){var u=o.getCenter(),h=this.wrapLatLng(u),m=u.lat-h.lat,_=u.lng-h.lng;if(m===0&&_===0)return o;var b=o.getSouthWest(),O=o.getNorthEast(),j=new _t(b.lat-m,b.lng-_),Z=new _t(O.lat-m,O.lng-_);return new ct(j,Z)}},jt=i({},Gt,{wrapLng:[-180,180],R:6371e3,distance:function(o,u){var h=Math.PI/180,m=o.lat*h,_=u.lat*h,b=Math.sin((u.lat-o.lat)*h/2),O=Math.sin((u.lng-o.lng)*h/2),j=b*b+Math.cos(m)*Math.cos(_)*O*O,Z=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return this.R*Z}}),we=6378137,Ee={R:we,MAX_LATITUDE:85.0511287798,project:function(o){var u=Math.PI/180,h=this.MAX_LATITUDE,m=Math.max(Math.min(h,o.lat),-h),_=Math.sin(m*u);return new z(this.R*o.lng*u,this.R*Math.log((1+_)/(1-_))/2)},unproject:function(o){var u=180/Math.PI;return new _t((2*Math.atan(Math.exp(o.y/this.R))-Math.PI/2)*u,o.x*u/this.R)},bounds:function(){var o=we*Math.PI;return new vt([-o,-o],[o,o])}()};function Je(o,u,h,m){if(N(o)){this._a=o[0],this._b=o[1],this._c=o[2],this._d=o[3];return}this._a=o,this._b=u,this._c=h,this._d=m}Je.prototype={transform:function(o,u){return this._transform(o.clone(),u)},_transform:function(o,u){return u=u||1,o.x=u*(this._a*o.x+this._b),o.y=u*(this._c*o.y+this._d),o},untransform:function(o,u){return u=u||1,new z((o.x/u-this._b)/this._a,(o.y/u-this._d)/this._c)}};function De(o,u,h,m){return new Je(o,u,h,m)}var jr=i({},jt,{code:"EPSG:3857",projection:Ee,transformation:function(){var o=.5/(Math.PI*Ee.R);return De(o,.5,-o,.5)}()}),Nn=i({},jr,{code:"EPSG:900913"});function Ke(o){return document.createElementNS("http://www.w3.org/2000/svg",o)}function Ji(o,u){var h="",m,_,b,O,j,Z;for(m=0,b=o.length;m<b;m++){for(j=o[m],_=0,O=j.length;_<O;_++)Z=j[_],h+=(_?"L":"M")+Z.x+" "+Z.y;h+=u?It.svg?"z":"x":""}return h||"M0 0"}var ar=document.documentElement.style,cn="ActiveXObject"in window,xi=cn&&!document.addEventListener,Il="msLaunchUri"in navigator&&!("documentMode"in document),Ra=Ei("webkit"),Ma=Ei("android"),T=Ei("android 2")||Ei("android 3"),F=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),G=Ma&&Ei("Google")&&F<537&&!("AudioNode"in window),gt=!!window.opera,pt=!Il&&Ei("chrome"),ft=Ei("gecko")&&!Ra&&!gt&&!cn,Et=!pt&&Ei("safari"),Bt=Ei("phantom"),ne="OTransition"in ar,$e=navigator.platform.indexOf("Win")===0,_r=cn&&"transition"in ar,tn="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!T,wi="MozPerspective"in ar,Aa=!window.L_DISABLE_3D&&(_r||tn||wi)&&!ne&&!Bt,$i=typeof orientation<"u"||Ei("mobile"),Ku=$i&&Ra,Oo=$i&&tn,Da=!window.PointerEvent&&window.MSPointerEvent,Ls=!!(window.PointerEvent||Da),Wf="ontouchstart"in window||!!window.TouchEvent,Xf=!window.L_NO_TOUCH&&(Wf||Ls),Wp=$i&&gt,Xp=$i&&ft,Ro=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Yf=function(){var o=!1;try{var u=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("testPassiveEventSupport",d,u),window.removeEventListener("testPassiveEventSupport",d,u)}catch{}return o}(),Yp=function(){return!!document.createElement("canvas").getContext}(),Tl=!!(document.createElementNS&&Ke("svg").createSVGRect),Kf=!!Tl&&function(){var o=document.createElement("div");return o.innerHTML="<svg/>",(o.firstChild&&o.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Kp=!Tl&&function(){try{var o=document.createElement("div");o.innerHTML='<v:shape adj="1"/>';var u=o.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),Qp=navigator.platform.indexOf("Mac")===0,Jp=navigator.platform.indexOf("Linux")===0;function Ei(o){return navigator.userAgent.toLowerCase().indexOf(o)>=0}var It={ie:cn,ielt9:xi,edge:Il,webkit:Ra,android:Ma,android23:T,androidStock:G,opera:gt,chrome:pt,gecko:ft,safari:Et,phantom:Bt,opera12:ne,win:$e,ie3d:_r,webkit3d:tn,gecko3d:wi,any3d:Aa,mobile:$i,mobileWebkit:Ku,mobileWebkit3d:Oo,msPointer:Da,pointer:Ls,touch:Xf,touchNative:Wf,mobileOpera:Wp,mobileGecko:Xp,retina:Ro,passiveEvents:Yf,canvas:Yp,svg:Tl,vml:Kp,inlineSvg:Kf,mac:Qp,linux:Jp},Qu=It.msPointer?"MSPointerDown":"pointerdown",ka=It.msPointer?"MSPointerMove":"pointermove",Ju=It.msPointer?"MSPointerUp":"pointerup",U=It.msPointer?"MSPointerCancel":"pointercancel",X={touchstart:Qu,touchmove:ka,touchend:Ju,touchcancel:U},mt={touchstart:fn,touchmove:kn,touchend:kn,touchcancel:kn},st={},nt=!1;function St(o,u,h){return u==="touchstart"&&he(),mt[u]?(h=mt[u].bind(this,h),o.addEventListener(X[u],h,!1),h):(console.warn("wrong event specified:",u),d)}function Xt(o,u,h){if(!X[u]){console.warn("wrong event specified:",u);return}o.removeEventListener(X[u],h,!1)}function Yt(o){st[o.pointerId]=o}function Mt(o){st[o.pointerId]&&(st[o.pointerId]=o)}function zt(o){delete st[o.pointerId]}function he(){nt||(document.addEventListener(Qu,Yt,!0),document.addEventListener(ka,Mt,!0),document.addEventListener(Ju,zt,!0),document.addEventListener(U,zt,!0),nt=!0)}function kn(o,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var h in st)u.touches.push(st[h]);u.changedTouches=[u],o(u)}}function fn(o,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&Kn(u),kn(o,u)}function ts(o){var u={},h,m;for(m in o)h=o[m],u[m]=h&&h.bind?h.bind(o):h;return o=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var Mo=200;function Ao(o,u){o.addEventListener("dblclick",u);var h=0,m;function _(b){if(b.detail!==1){m=b.detail;return}if(!(b.pointerType==="mouse"||b.sourceCapabilities&&!b.sourceCapabilities.firesTouchEvents)){var O=w_(b);if(!(O.some(function(Z){return Z instanceof HTMLLabelElement&&Z.attributes.for})&&!O.some(function(Z){return Z instanceof HTMLInputElement||Z instanceof HTMLSelectElement}))){var j=Date.now();j-h<=Mo?(m++,m===2&&u(ts(b))):m=1,h=j}}}return o.addEventListener("click",_),{dblclick:u,simDblclick:_}}function hn(o,u){o.removeEventListener("dblclick",u.dblclick),o.removeEventListener("click",u.simDblclick)}var ni=th(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Fa=th(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Qf=Fa==="webkitTransition"||Fa==="OTransition"?Fa+"End":"transitionend";function y_(o){return typeof o=="string"?document.getElementById(o):o}function $u(o,u){var h=o.style[u]||o.currentStyle&&o.currentStyle[u];if((!h||h==="auto")&&document.defaultView){var m=document.defaultView.getComputedStyle(o,null);h=m?m[u]:null}return h==="auto"?null:h}function le(o,u,h){var m=document.createElement(o);return m.className=u||"",h&&h.appendChild(m),m}function Be(o){var u=o.parentNode;u&&u.removeChild(o)}function Jf(o){for(;o.firstChild;)o.removeChild(o.firstChild)}function Ol(o){var u=o.parentNode;u&&u.lastChild!==o&&u.appendChild(o)}function Rl(o){var u=o.parentNode;u&&u.firstChild!==o&&u.insertBefore(o,u.firstChild)}function $p(o,u){if(o.classList!==void 0)return o.classList.contains(u);var h=$f(o);return h.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(h)}function Zt(o,u){if(o.classList!==void 0)for(var h=x(u),m=0,_=h.length;m<_;m++)o.classList.add(h[m]);else if(!$p(o,u)){var b=$f(o);tg(o,(b?b+" ":"")+u)}}function en(o,u){o.classList!==void 0?o.classList.remove(u):tg(o,y((" "+$f(o)+" ").replace(" "+u+" "," ")))}function tg(o,u){o.className.baseVal===void 0?o.className=u:o.className.baseVal=u}function $f(o){return o.correspondingElement&&(o=o.correspondingElement),o.className.baseVal===void 0?o.className:o.className.baseVal}function Si(o,u){"opacity"in o.style?o.style.opacity=u:"filter"in o.style&&PN(o,u)}function PN(o,u){var h=!1,m="DXImageTransform.Microsoft.Alpha";try{h=o.filters.item(m)}catch{if(u===1)return}u=Math.round(u*100),h?(h.Enabled=u!==100,h.Opacity=u):o.style.filter+=" progid:"+m+"(opacity="+u+")"}function th(o){for(var u=document.documentElement.style,h=0;h<o.length;h++)if(o[h]in u)return o[h];return!1}function ja(o,u,h){var m=u||new z(0,0);o.style[ni]=(It.ie3d?"translate("+m.x+"px,"+m.y+"px)":"translate3d("+m.x+"px,"+m.y+"px,0)")+(h?" scale("+h+")":"")}function dn(o,u){o._leaflet_pos=u,It.any3d?ja(o,u):(o.style.left=u.x+"px",o.style.top=u.y+"px")}function za(o){return o._leaflet_pos||new z(0,0)}var tc,ec,eg;if("onselectstart"in document)tc=function(){qt(window,"selectstart",Kn)},ec=function(){Se(window,"selectstart",Kn)};else{var nc=th(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);tc=function(){if(nc){var o=document.documentElement.style;eg=o[nc],o[nc]="none"}},ec=function(){nc&&(document.documentElement.style[nc]=eg,eg=void 0)}}function ng(){qt(window,"dragstart",Kn)}function rg(){Se(window,"dragstart",Kn)}var eh,ig;function sg(o){for(;o.tabIndex===-1;)o=o.parentNode;o.style&&(nh(),eh=o,ig=o.style.outlineStyle,o.style.outlineStyle="none",qt(window,"keydown",nh))}function nh(){eh&&(eh.style.outlineStyle=ig,eh=void 0,ig=void 0,Se(window,"keydown",nh))}function __(o){do o=o.parentNode;while((!o.offsetWidth||!o.offsetHeight)&&o!==document.body);return o}function og(o){var u=o.getBoundingClientRect();return{x:u.width/o.offsetWidth||1,y:u.height/o.offsetHeight||1,boundingClientRect:u}}var bN={__proto__:null,TRANSFORM:ni,TRANSITION:Fa,TRANSITION_END:Qf,get:y_,getStyle:$u,create:le,remove:Be,empty:Jf,toFront:Ol,toBack:Rl,hasClass:$p,addClass:Zt,removeClass:en,setClass:tg,getClass:$f,setOpacity:Si,testProp:th,setTransform:ja,setPosition:dn,getPosition:za,get disableTextSelection(){return tc},get enableTextSelection(){return ec},disableImageDrag:ng,enableImageDrag:rg,preventOutline:sg,restoreOutline:nh,getSizedParentNode:__,getScale:og};function qt(o,u,h,m){if(u&&typeof u=="object")for(var _ in u)lg(o,_,u[_],h);else{u=x(u);for(var b=0,O=u.length;b<O;b++)lg(o,u[b],h,m)}return this}var Is="_leaflet_events";function Se(o,u,h,m){if(arguments.length===1)x_(o),delete o[Is];else if(u&&typeof u=="object")for(var _ in u)ug(o,_,u[_],h);else if(u=x(u),arguments.length===2)x_(o,function(j){return I(u,j)!==-1});else for(var b=0,O=u.length;b<O;b++)ug(o,u[b],h,m);return this}function x_(o,u){for(var h in o[Is]){var m=h.split(/\d/)[0];(!u||u(m))&&ug(o,m,null,null,h)}}var ag={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function lg(o,u,h,m){var _=u+c(h)+(m?"_"+c(m):"");if(o[Is]&&o[Is][_])return this;var b=function(j){return h.call(m||o,j||window.event)},O=b;!It.touchNative&&It.pointer&&u.indexOf("touch")===0?b=St(o,u,b):It.touch&&u==="dblclick"?b=Ao(o,b):"addEventListener"in o?u==="touchstart"||u==="touchmove"||u==="wheel"||u==="mousewheel"?o.addEventListener(ag[u]||u,b,It.passiveEvents?{passive:!1}:!1):u==="mouseenter"||u==="mouseleave"?(b=function(j){j=j||window.event,fg(o,j)&&O(j)},o.addEventListener(ag[u],b,!1)):o.addEventListener(u,O,!1):o.attachEvent("on"+u,b),o[Is]=o[Is]||{},o[Is][_]=b}function ug(o,u,h,m,_){_=_||u+c(h)+(m?"_"+c(m):"");var b=o[Is]&&o[Is][_];if(!b)return this;!It.touchNative&&It.pointer&&u.indexOf("touch")===0?Xt(o,u,b):It.touch&&u==="dblclick"?hn(o,b):"removeEventListener"in o?o.removeEventListener(ag[u]||u,b,!1):o.detachEvent("on"+u,b),o[Is][_]=null}function Ba(o){return o.stopPropagation?o.stopPropagation():o.originalEvent?o.originalEvent._stopped=!0:o.cancelBubble=!0,this}function cg(o){return lg(o,"wheel",Ba),this}function rc(o){return qt(o,"mousedown touchstart dblclick contextmenu",Ba),o._leaflet_disable_click=!0,this}function Kn(o){return o.preventDefault?o.preventDefault():o.returnValue=!1,this}function Ua(o){return Kn(o),Ba(o),this}function w_(o){if(o.composedPath)return o.composedPath();for(var u=[],h=o.target;h;)u.push(h),h=h.parentNode;return u}function E_(o,u){if(!u)return new z(o.clientX,o.clientY);var h=og(u),m=h.boundingClientRect;return new z((o.clientX-m.left)/h.x-u.clientLeft,(o.clientY-m.top)/h.y-u.clientTop)}var LN=It.linux&&It.chrome?window.devicePixelRatio:It.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function S_(o){return It.edge?o.wheelDeltaY/2:o.deltaY&&o.deltaMode===0?-o.deltaY/LN:o.deltaY&&o.deltaMode===1?-o.deltaY*20:o.deltaY&&o.deltaMode===2?-o.deltaY*60:o.deltaX||o.deltaZ?0:o.wheelDelta?(o.wheelDeltaY||o.wheelDelta)/2:o.detail&&Math.abs(o.detail)<32765?-o.detail*20:o.detail?o.detail/-32765*60:0}function fg(o,u){var h=u.relatedTarget;if(!h)return!0;try{for(;h&&h!==o;)h=h.parentNode}catch{return!1}return h!==o}var IN={__proto__:null,on:qt,off:Se,stopPropagation:Ba,disableScrollPropagation:cg,disableClickPropagation:rc,preventDefault:Kn,stop:Ua,getPropagationPath:w_,getMousePosition:E_,getWheelDelta:S_,isExternalTarget:fg,addListener:qt,removeListener:Se},C_=yt.extend({run:function(o,u,h,m){this.stop(),this._el=o,this._inProgress=!0,this._duration=h||.25,this._easeOutPower=1/Math.max(m||.5,.2),this._startPos=za(o),this._offset=u.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=J(this._animate,this),this._step()},_step:function(o){var u=+new Date-this._startTime,h=this._duration*1e3;u<h?this._runFrame(this._easeOut(u/h),o):(this._runFrame(1),this._complete())},_runFrame:function(o,u){var h=this._startPos.add(this._offset.multiplyBy(o));u&&h._round(),dn(this._el,h),this.fire("step")},_complete:function(){W(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(o){return 1-Math.pow(1-o,this._easeOutPower)}}),se=yt.extend({options:{crs:jr,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(o,u){u=S(this,u),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(o),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),u.maxBounds&&this.setMaxBounds(u.maxBounds),u.zoom!==void 0&&(this._zoom=this._limitZoom(u.zoom)),u.center&&u.zoom!==void 0&&this.setView(wt(u.center),u.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Fa&&It.any3d&&!It.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),qt(this._proxy,Qf,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(o,u,h){if(u=u===void 0?this._zoom:this._limitZoom(u),o=this._limitCenter(wt(o),u,this.options.maxBounds),h=h||{},this._stop(),this._loaded&&!h.reset&&h!==!0){h.animate!==void 0&&(h.zoom=i({animate:h.animate},h.zoom),h.pan=i({animate:h.animate,duration:h.duration},h.pan));var m=this._zoom!==u?this._tryAnimatedZoom&&this._tryAnimatedZoom(o,u,h.zoom):this._tryAnimatedPan(o,h.pan);if(m)return clearTimeout(this._sizeTimer),this}return this._resetView(o,u,h.pan&&h.pan.noMoveStart),this},setZoom:function(o,u){return this._loaded?this.setView(this.getCenter(),o,{zoom:u}):(this._zoom=o,this)},zoomIn:function(o,u){return o=o||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+o,u)},zoomOut:function(o,u){return o=o||(It.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-o,u)},setZoomAround:function(o,u,h){var m=this.getZoomScale(u),_=this.getSize().divideBy(2),b=o instanceof z?o:this.latLngToContainerPoint(o),O=b.subtract(_).multiplyBy(1-1/m),j=this.containerPointToLatLng(_.add(O));return this.setView(j,u,{zoom:h})},_getBoundsCenterZoom:function(o,u){u=u||{},o=o.getBounds?o.getBounds():ht(o);var h=tt(u.paddingTopLeft||u.padding||[0,0]),m=tt(u.paddingBottomRight||u.padding||[0,0]),_=this.getBoundsZoom(o,!1,h.add(m));if(_=typeof u.maxZoom=="number"?Math.min(u.maxZoom,_):_,_===1/0)return{center:o.getCenter(),zoom:_};var b=m.subtract(h).divideBy(2),O=this.project(o.getSouthWest(),_),j=this.project(o.getNorthEast(),_),Z=this.unproject(O.add(j).divideBy(2).add(b),_);return{center:Z,zoom:_}},fitBounds:function(o,u){if(o=ht(o),!o.isValid())throw new Error("Bounds are not valid.");var h=this._getBoundsCenterZoom(o,u);return this.setView(h.center,h.zoom,u)},fitWorld:function(o){return this.fitBounds([[-90,-180],[90,180]],o)},panTo:function(o,u){return this.setView(o,this._zoom,{pan:u})},panBy:function(o,u){if(o=tt(o).round(),u=u||{},!o.x&&!o.y)return this.fire("moveend");if(u.animate!==!0&&!this.getSize().contains(o))return this._resetView(this.unproject(this.project(this.getCenter()).add(o)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new C_,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),u.noMoveStart||this.fire("movestart"),u.animate!==!1){Zt(this._mapPane,"leaflet-pan-anim");var h=this._getMapPanePos().subtract(o).round();this._panAnim.run(this._mapPane,h,u.duration||.25,u.easeLinearity)}else this._rawPanBy(o),this.fire("move").fire("moveend");return this},flyTo:function(o,u,h){if(h=h||{},h.animate===!1||!It.any3d)return this.setView(o,u,h);this._stop();var m=this.project(this.getCenter()),_=this.project(o),b=this.getSize(),O=this._zoom;o=wt(o),u=u===void 0?O:u;var j=Math.max(b.x,b.y),Z=j*this.getZoomScale(O,u),et=_.distanceTo(m)||1,xt=1.42,Dt=xt*xt;function Kt(pn){var ph=pn?-1:1,vP=pn?Z:j,yP=Z*Z-j*j+ph*Dt*Dt*et*et,_P=2*vP*Dt*et,Eg=yP/_P,i0=Math.sqrt(Eg*Eg+1)-Eg,xP=i0<1e-9?-18:Math.log(i0);return xP}function xr(pn){return(Math.exp(pn)-Math.exp(-pn))/2}function Fn(pn){return(Math.exp(pn)+Math.exp(-pn))/2}function Ni(pn){return xr(pn)/Fn(pn)}var zr=Kt(0);function jl(pn){return j*(Fn(zr)/Fn(zr+xt*pn))}function dP(pn){return j*(Fn(zr)*Ni(zr+xt*pn)-xr(zr))/Dt}function pP(pn){return 1-Math.pow(1-pn,1.5)}var gP=Date.now(),n0=(Kt(1)-zr)/xt,mP=h.duration?1e3*h.duration:1e3*n0*.8;function r0(){var pn=(Date.now()-gP)/mP,ph=pP(pn)*n0;pn<=1?(this._flyToFrame=J(r0,this),this._move(this.unproject(m.add(_.subtract(m).multiplyBy(dP(ph)/et)),O),this.getScaleZoom(j/jl(ph),O),{flyTo:!0})):this._move(o,u)._moveEnd(!0)}return this._moveStart(!0,h.noMoveStart),r0.call(this),this},flyToBounds:function(o,u){var h=this._getBoundsCenterZoom(o,u);return this.flyTo(h.center,h.zoom,u)},setMaxBounds:function(o){return o=ht(o),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),o.isValid()?(this.options.maxBounds=o,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(o){var u=this.options.minZoom;return this.options.minZoom=o,this._loaded&&u!==o&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(o):this},setMaxZoom:function(o){var u=this.options.maxZoom;return this.options.maxZoom=o,this._loaded&&u!==o&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(o):this},panInsideBounds:function(o,u){this._enforcingBounds=!0;var h=this.getCenter(),m=this._limitCenter(h,this._zoom,ht(o));return h.equals(m)||this.panTo(m,u),this._enforcingBounds=!1,this},panInside:function(o,u){u=u||{};var h=tt(u.paddingTopLeft||u.padding||[0,0]),m=tt(u.paddingBottomRight||u.padding||[0,0]),_=this.project(this.getCenter()),b=this.project(o),O=this.getPixelBounds(),j=Lt([O.min.add(h),O.max.subtract(m)]),Z=j.getSize();if(!j.contains(b)){this._enforcingBounds=!0;var et=b.subtract(j.getCenter()),xt=j.extend(b).getSize().subtract(Z);_.x+=et.x<0?-xt.x:xt.x,_.y+=et.y<0?-xt.y:xt.y,this.panTo(this.unproject(_),u),this._enforcingBounds=!1}return this},invalidateSize:function(o){if(!this._loaded)return this;o=i({animate:!1,pan:!0},o===!0?{animate:!0}:o);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var h=this.getSize(),m=u.divideBy(2).round(),_=h.divideBy(2).round(),b=m.subtract(_);return!b.x&&!b.y?this:(o.animate&&o.pan?this.panBy(b):(o.pan&&this._rawPanBy(b),this.fire("move"),o.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:h}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(o){if(o=this._locateOptions=i({timeout:1e4,watch:!1},o),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=a(this._handleGeolocationResponse,this),h=a(this._handleGeolocationError,this);return o.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,h,o):navigator.geolocation.getCurrentPosition(u,h,o),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(o){if(this._container._leaflet_id){var u=o.code,h=o.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+h+"."})}},_handleGeolocationResponse:function(o){if(this._container._leaflet_id){var u=o.coords.latitude,h=o.coords.longitude,m=new _t(u,h),_=m.toBounds(o.coords.accuracy*2),b=this._locateOptions;if(b.setView){var O=this.getBoundsZoom(_);this.setView(m,b.maxZoom?Math.min(O,b.maxZoom):O)}var j={latlng:m,bounds:_,timestamp:o.timestamp};for(var Z in o.coords)typeof o.coords[Z]=="number"&&(j[Z]=o.coords[Z]);this.fire("locationfound",j)}},addHandler:function(o,u){if(!u)return this;var h=this[o]=new u(this);return this._handlers.push(h),this.options[o]&&h.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(),Be(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(W(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var o;for(o in this._layers)this._layers[o].remove();for(o in this._panes)Be(this._panes[o]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(o,u){var h="leaflet-pane"+(o?" leaflet-"+o.replace("Pane","")+"-pane":""),m=le("div",h,u||this._mapPane);return o&&(this._panes[o]=m),m},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var o=this.getPixelBounds(),u=this.unproject(o.getBottomLeft()),h=this.unproject(o.getTopRight());return new ct(u,h)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(o,u,h){o=ht(o),h=tt(h||[0,0]);var m=this.getZoom()||0,_=this.getMinZoom(),b=this.getMaxZoom(),O=o.getNorthWest(),j=o.getSouthEast(),Z=this.getSize().subtract(h),et=Lt(this.project(j,m),this.project(O,m)).getSize(),xt=It.any3d?this.options.zoomSnap:1,Dt=Z.x/et.x,Kt=Z.y/et.y,xr=u?Math.max(Dt,Kt):Math.min(Dt,Kt);return m=this.getScaleZoom(xr,m),xt&&(m=Math.round(m/(xt/100))*(xt/100),m=u?Math.ceil(m/xt)*xt:Math.floor(m/xt)*xt),Math.max(_,Math.min(b,m))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(o,u){var h=this._getTopLeftPoint(o,u);return new vt(h,h.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(o){return this.options.crs.getProjectedBounds(o===void 0?this.getZoom():o)},getPane:function(o){return typeof o=="string"?this._panes[o]:o},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(o,u){var h=this.options.crs;return u=u===void 0?this._zoom:u,h.scale(o)/h.scale(u)},getScaleZoom:function(o,u){var h=this.options.crs;u=u===void 0?this._zoom:u;var m=h.zoom(o*h.scale(u));return isNaN(m)?1/0:m},project:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(wt(o),u)},unproject:function(o,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(tt(o),u)},layerPointToLatLng:function(o){var u=tt(o).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(o){var u=this.project(wt(o))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(o){return this.options.crs.wrapLatLng(wt(o))},wrapLatLngBounds:function(o){return this.options.crs.wrapLatLngBounds(ht(o))},distance:function(o,u){return this.options.crs.distance(wt(o),wt(u))},containerPointToLayerPoint:function(o){return tt(o).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(o){return tt(o).add(this._getMapPanePos())},containerPointToLatLng:function(o){var u=this.containerPointToLayerPoint(tt(o));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(o){return this.layerPointToContainerPoint(this.latLngToLayerPoint(wt(o)))},mouseEventToContainerPoint:function(o){return E_(o,this._container)},mouseEventToLayerPoint:function(o){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(o))},mouseEventToLatLng:function(o){return this.layerPointToLatLng(this.mouseEventToLayerPoint(o))},_initContainer:function(o){var u=this._container=y_(o);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qt(u,"scroll",this._onScroll,this),this._containerId=c(u)},_initLayout:function(){var o=this._container;this._fadeAnimated=this.options.fadeAnimation&&It.any3d,Zt(o,"leaflet-container"+(It.touch?" leaflet-touch":"")+(It.retina?" leaflet-retina":"")+(It.ielt9?" leaflet-oldie":"")+(It.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=$u(o,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(o.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var o=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),dn(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Zt(o.markerPane,"leaflet-zoom-hide"),Zt(o.shadowPane,"leaflet-zoom-hide"))},_resetView:function(o,u,h){dn(this._mapPane,new z(0,0));var m=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var _=this._zoom!==u;this._moveStart(_,h)._move(o,u)._moveEnd(_),this.fire("viewreset"),m&&this.fire("load")},_moveStart:function(o,u){return o&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(o,u,h,m){u===void 0&&(u=this._zoom);var _=this._zoom!==u;return this._zoom=u,this._lastCenter=o,this._pixelOrigin=this._getNewPixelOrigin(o),m?h&&h.pinch&&this.fire("zoom",h):((_||h&&h.pinch)&&this.fire("zoom",h),this.fire("move",h)),this},_moveEnd:function(o){return o&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return W(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(o){dn(this._mapPane,this._getMapPanePos().subtract(o))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(o){this._targets={},this._targets[c(this._container)]=this;var u=o?Se:qt;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),It.any3d&&this.options.transform3DLimit&&(o?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){W(this._resizeRequest),this._resizeRequest=J(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var o=this._getMapPanePos();Math.max(Math.abs(o.x),Math.abs(o.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(o,u){for(var h=[],m,_=u==="mouseout"||u==="mouseover",b=o.target||o.srcElement,O=!1;b;){if(m=this._targets[c(b)],m&&(u==="click"||u==="preclick")&&this._draggableMoved(m)){O=!0;break}if(m&&m.listens(u,!0)&&(_&&!fg(b,o)||(h.push(m),_))||b===this._container)break;b=b.parentNode}return!h.length&&!O&&!_&&this.listens(u,!0)&&(h=[this]),h},_isClickDisabled:function(o){for(;o&&o!==this._container;){if(o._leaflet_disable_click)return!0;o=o.parentNode}},_handleDOMEvent:function(o){var u=o.target||o.srcElement;if(!(!this._loaded||u._leaflet_disable_events||o.type==="click"&&this._isClickDisabled(u))){var h=o.type;h==="mousedown"&&sg(u),this._fireDOMEvent(o,h)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(o,u,h){if(o.type==="click"){var m=i({},o);m.type="preclick",this._fireDOMEvent(m,m.type,h)}var _=this._findEventTargets(o,u);if(h){for(var b=[],O=0;O<h.length;O++)h[O].listens(u,!0)&&b.push(h[O]);_=b.concat(_)}if(_.length){u==="contextmenu"&&Kn(o);var j=_[0],Z={originalEvent:o};if(o.type!=="keypress"&&o.type!=="keydown"&&o.type!=="keyup"){var et=j.getLatLng&&(!j._radius||j._radius<=10);Z.containerPoint=et?this.latLngToContainerPoint(j.getLatLng()):this.mouseEventToContainerPoint(o),Z.layerPoint=this.containerPointToLayerPoint(Z.containerPoint),Z.latlng=et?j.getLatLng():this.layerPointToLatLng(Z.layerPoint)}for(O=0;O<_.length;O++)if(_[O].fire(u,Z,!0),Z.originalEvent._stopped||_[O].options.bubblingMouseEvents===!1&&I(this._mouseEvents,u)!==-1)return}},_draggableMoved:function(o){return o=o.dragging&&o.dragging.enabled()?o:this,o.dragging&&o.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var o=0,u=this._handlers.length;o<u;o++)this._handlers[o].disable()},whenReady:function(o,u){return this._loaded?o.call(u||this,{target:this}):this.on("load",o,u),this},_getMapPanePos:function(){return za(this._mapPane)||new z(0,0)},_moved:function(){var o=this._getMapPanePos();return o&&!o.equals([0,0])},_getTopLeftPoint:function(o,u){var h=o&&u!==void 0?this._getNewPixelOrigin(o,u):this.getPixelOrigin();return h.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(o,u){var h=this.getSize()._divideBy(2);return this.project(o,u)._subtract(h)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(o,u,h){var m=this._getNewPixelOrigin(h,u);return this.project(o,u)._subtract(m)},_latLngBoundsToNewLayerBounds:function(o,u,h){var m=this._getNewPixelOrigin(h,u);return Lt([this.project(o.getSouthWest(),u)._subtract(m),this.project(o.getNorthWest(),u)._subtract(m),this.project(o.getSouthEast(),u)._subtract(m),this.project(o.getNorthEast(),u)._subtract(m)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(o){return this.latLngToLayerPoint(o).subtract(this._getCenterLayerPoint())},_limitCenter:function(o,u,h){if(!h)return o;var m=this.project(o,u),_=this.getSize().divideBy(2),b=new vt(m.subtract(_),m.add(_)),O=this._getBoundsOffset(b,h,u);return Math.abs(O.x)<=1&&Math.abs(O.y)<=1?o:this.unproject(m.add(O),u)},_limitOffset:function(o,u){if(!u)return o;var h=this.getPixelBounds(),m=new vt(h.min.add(o),h.max.add(o));return o.add(this._getBoundsOffset(m,u))},_getBoundsOffset:function(o,u,h){var m=Lt(this.project(u.getNorthEast(),h),this.project(u.getSouthWest(),h)),_=m.min.subtract(o.min),b=m.max.subtract(o.max),O=this._rebound(_.x,-b.x),j=this._rebound(_.y,-b.y);return new z(O,j)},_rebound:function(o,u){return o+u>0?Math.round(o-u)/2:Math.max(0,Math.ceil(o))-Math.max(0,Math.floor(u))},_limitZoom:function(o){var u=this.getMinZoom(),h=this.getMaxZoom(),m=It.any3d?this.options.zoomSnap:1;return m&&(o=Math.round(o/m)*m),Math.max(u,Math.min(h,o))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){en(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(o,u){var h=this._getCenterOffset(o)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(h)?!1:(this.panBy(h,u),!0)},_createAnimProxy:function(){var o=this._proxy=le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(o),this.on("zoomanim",function(u){var h=ni,m=this._proxy.style[h];ja(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),m===this._proxy.style[h]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Be(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var o=this.getCenter(),u=this.getZoom();ja(this._proxy,this.project(o,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(o){this._animatingZoom&&o.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(o,u,h){if(this._animatingZoom)return!0;if(h=h||{},!this._zoomAnimated||h.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var m=this.getZoomScale(u),_=this._getCenterOffset(o)._divideBy(1-1/m);return h.animate!==!0&&!this.getSize().contains(_)?!1:(J(function(){this._moveStart(!0,h.noMoveStart||!1)._animateZoom(o,u,!0)},this),!0)},_animateZoom:function(o,u,h,m){this._mapPane&&(h&&(this._animatingZoom=!0,this._animateToCenter=o,this._animateToZoom=u,Zt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:o,zoom:u,noUpdate:m}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&en(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 TN(o,u){return new se(o,u)}var es=D.extend({options:{position:"topright"},initialize:function(o){S(this,o)},getPosition:function(){return this.options.position},setPosition:function(o){var u=this._map;return u&&u.removeControl(this),this.options.position=o,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(o){this.remove(),this._map=o;var u=this._container=this.onAdd(o),h=this.getPosition(),m=o._controlCorners[h];return Zt(u,"leaflet-control"),h.indexOf("bottom")!==-1?m.insertBefore(u,m.firstChild):m.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Be(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(o){this._map&&o&&o.screenX>0&&o.screenY>0&&this._map.getContainer().focus()}}),ic=function(o){return new es(o)};se.include({addControl:function(o){return o.addTo(this),this},removeControl:function(o){return o.remove(),this},_initControlPos:function(){var o=this._controlCorners={},u="leaflet-",h=this._controlContainer=le("div",u+"control-container",this._container);function m(_,b){var O=u+_+" "+u+b;o[_+b]=le("div",O,h)}m("top","left"),m("top","right"),m("bottom","left"),m("bottom","right")},_clearControlPos:function(){for(var o in this._controlCorners)Be(this._controlCorners[o]);Be(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var N_=es.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(o,u,h,m){return h<m?-1:m<h?1:0}},initialize:function(o,u,h){S(this,h),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var m in o)this._addLayer(o[m],m);for(m in u)this._addLayer(u[m],m,!0)},onAdd:function(o){this._initLayout(),this._update(),this._map=o,o.on("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(o){return es.prototype.addTo.call(this,o),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(o,u){return this._addLayer(o,u),this._map?this._update():this},addOverlay:function(o,u){return this._addLayer(o,u,!0),this._map?this._update():this},removeLayer:function(o){o.off("add remove",this._onLayerChange,this);var u=this._getLayer(c(o));return u&&this._layers.splice(this._layers.indexOf(u),1),this._map?this._update():this},expand:function(){Zt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var o=this._map.getSize().y-(this._container.offsetTop+50);return o<this._section.clientHeight?(Zt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=o+"px"):en(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return en(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var o="leaflet-control-layers",u=this._container=le("div",o),h=this.options.collapsed;u.setAttribute("aria-haspopup",!0),rc(u),cg(u);var m=this._section=le("section",o+"-list");h&&(this._map.on("click",this.collapse,this),qt(u,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var _=this._layersLink=le("a",o+"-toggle",u);_.href="#",_.title="Layers",_.setAttribute("role","button"),qt(_,{keydown:function(b){b.keyCode===13&&this._expandSafely()},click:function(b){Kn(b),this._expandSafely()}},this),h||this.expand(),this._baseLayersList=le("div",o+"-base",m),this._separator=le("div",o+"-separator",m),this._overlaysList=le("div",o+"-overlays",m),u.appendChild(m)},_getLayer:function(o){for(var u=0;u<this._layers.length;u++)if(this._layers[u]&&c(this._layers[u].layer)===o)return this._layers[u]},_addLayer:function(o,u,h){this._map&&o.on("add remove",this._onLayerChange,this),this._layers.push({layer:o,name:u,overlay:h}),this.options.sortLayers&&this._layers.sort(a(function(m,_){return this.options.sortFunction(m.layer,_.layer,m.name,_.name)},this)),this.options.autoZIndex&&o.setZIndex&&(this._lastZIndex++,o.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Jf(this._baseLayersList),Jf(this._overlaysList),this._layerControlInputs=[];var o,u,h,m,_=0;for(h=0;h<this._layers.length;h++)m=this._layers[h],this._addItem(m),u=u||m.overlay,o=o||!m.overlay,_+=m.overlay?0:1;return this.options.hideSingleBase&&(o=o&&_>1,this._baseLayersList.style.display=o?"":"none"),this._separator.style.display=u&&o?"":"none",this},_onLayerChange:function(o){this._handlingClick||this._update();var u=this._getLayer(c(o.target)),h=u.overlay?o.type==="add"?"overlayadd":"overlayremove":o.type==="add"?"baselayerchange":null;h&&this._map.fire(h,u)},_createRadioElement:function(o,u){var h='<input type="radio" class="leaflet-control-layers-selector" name="'+o+'"'+(u?' checked="checked"':"")+"/>",m=document.createElement("div");return m.innerHTML=h,m.firstChild},_addItem:function(o){var u=document.createElement("label"),h=this._map.hasLayer(o.layer),m;o.overlay?(m=document.createElement("input"),m.type="checkbox",m.className="leaflet-control-layers-selector",m.defaultChecked=h):m=this._createRadioElement("leaflet-base-layers_"+c(this),h),this._layerControlInputs.push(m),m.layerId=c(o.layer),qt(m,"click",this._onInputClick,this);var _=document.createElement("span");_.innerHTML=" "+o.name;var b=document.createElement("span");u.appendChild(b),b.appendChild(m),b.appendChild(_);var O=o.overlay?this._overlaysList:this._baseLayersList;return O.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var o=this._layerControlInputs,u,h,m=[],_=[];this._handlingClick=!0;for(var b=o.length-1;b>=0;b--)u=o[b],h=this._getLayer(u.layerId).layer,u.checked?m.push(h):u.checked||_.push(h);for(b=0;b<_.length;b++)this._map.hasLayer(_[b])&&this._map.removeLayer(_[b]);for(b=0;b<m.length;b++)this._map.hasLayer(m[b])||this._map.addLayer(m[b]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var o=this._layerControlInputs,u,h,m=this._map.getZoom(),_=o.length-1;_>=0;_--)u=o[_],h=this._getLayer(u.layerId).layer,u.disabled=h.options.minZoom!==void 0&&m<h.options.minZoom||h.options.maxZoom!==void 0&&m>h.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var o=this._section;this._preventClick=!0,qt(o,"click",Kn),this.expand();var u=this;setTimeout(function(){Se(o,"click",Kn),u._preventClick=!1})}}),ON=function(o,u,h){return new N_(o,u,h)},hg=es.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(o){var u="leaflet-control-zoom",h=le("div",u+" leaflet-bar"),m=this.options;return this._zoomInButton=this._createButton(m.zoomInText,m.zoomInTitle,u+"-in",h,this._zoomIn),this._zoomOutButton=this._createButton(m.zoomOutText,m.zoomOutTitle,u+"-out",h,this._zoomOut),this._updateDisabled(),o.on("zoomend zoomlevelschange",this._updateDisabled,this),h},onRemove:function(o){o.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(o){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(o.shiftKey?3:1))},_zoomOut:function(o){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(o.shiftKey?3:1))},_createButton:function(o,u,h,m,_){var b=le("a",h,m);return b.innerHTML=o,b.href="#",b.title=u,b.setAttribute("role","button"),b.setAttribute("aria-label",u),rc(b),qt(b,"click",Ua),qt(b,"click",_,this),qt(b,"click",this._refocusOnMap,this),b},_updateDisabled:function(){var o=this._map,u="leaflet-disabled";en(this._zoomInButton,u),en(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||o._zoom===o.getMinZoom())&&(Zt(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||o._zoom===o.getMaxZoom())&&(Zt(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});se.mergeOptions({zoomControl:!0}),se.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new hg,this.addControl(this.zoomControl))});var RN=function(o){return new hg(o)},P_=es.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(o){var u="leaflet-control-scale",h=le("div",u),m=this.options;return this._addScales(m,u+"-line",h),o.on(m.updateWhenIdle?"moveend":"move",this._update,this),o.whenReady(this._update,this),h},onRemove:function(o){o.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(o,u,h){o.metric&&(this._mScale=le("div",u,h)),o.imperial&&(this._iScale=le("div",u,h))},_update:function(){var o=this._map,u=o.getSize().y/2,h=o.distance(o.containerPointToLatLng([0,u]),o.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(h)},_updateScales:function(o){this.options.metric&&o&&this._updateMetric(o),this.options.imperial&&o&&this._updateImperial(o)},_updateMetric:function(o){var u=this._getRoundNum(o),h=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,h,u/o)},_updateImperial:function(o){var u=o*3.2808399,h,m,_;u>5280?(h=u/5280,m=this._getRoundNum(h),this._updateScale(this._iScale,m+" mi",m/h)):(_=this._getRoundNum(u),this._updateScale(this._iScale,_+" ft",_/u))},_updateScale:function(o,u,h){o.style.width=Math.round(this.options.maxWidth*h)+"px",o.innerHTML=u},_getRoundNum:function(o){var u=Math.pow(10,(Math.floor(o)+"").length-1),h=o/u;return h=h>=10?10:h>=5?5:h>=3?3:h>=2?2:1,u*h}}),MN=function(o){return new P_(o)},AN='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',dg=es.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(It.inlineSvg?AN+" ":"")+"Leaflet</a>"},initialize:function(o){S(this,o),this._attributions={}},onAdd:function(o){o.attributionControl=this,this._container=le("div","leaflet-control-attribution"),rc(this._container);for(var u in o._layers)o._layers[u].getAttribution&&this.addAttribution(o._layers[u].getAttribution());return this._update(),o.on("layeradd",this._addAttribution,this),this._container},onRemove:function(o){o.off("layeradd",this._addAttribution,this)},_addAttribution:function(o){o.layer.getAttribution&&(this.addAttribution(o.layer.getAttribution()),o.layer.once("remove",function(){this.removeAttribution(o.layer.getAttribution())},this))},setPrefix:function(o){return this.options.prefix=o,this._update(),this},addAttribution:function(o){return o?(this._attributions[o]||(this._attributions[o]=0),this._attributions[o]++,this._update(),this):this},removeAttribution:function(o){return o?(this._attributions[o]&&(this._attributions[o]--,this._update()),this):this},_update:function(){if(this._map){var o=[];for(var u in this._attributions)this._attributions[u]&&o.push(u);var h=[];this.options.prefix&&h.push(this.options.prefix),o.length&&h.push(o.join(", ")),this._container.innerHTML=h.join(' <span aria-hidden="true">|</span> ')}}});se.mergeOptions({attributionControl:!0}),se.addInitHook(function(){this.options.attributionControl&&new dg().addTo(this)});var DN=function(o){return new dg(o)};es.Layers=N_,es.Zoom=hg,es.Scale=P_,es.Attribution=dg,ic.layers=ON,ic.zoom=RN,ic.scale=MN,ic.attribution=DN;var Ts=D.extend({initialize:function(o){this._map=o},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ts.addTo=function(o,u){return o.addHandler(u,this),this};var kN={Events:it},b_=It.touch?"touchstart mousedown":"mousedown",Do=yt.extend({options:{clickTolerance:3},initialize:function(o,u,h,m){S(this,m),this._element=o,this._dragStartTarget=u||o,this._preventOutline=h},enable:function(){this._enabled||(qt(this._dragStartTarget,b_,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Do._dragging===this&&this.finishDrag(!0),Se(this._dragStartTarget,b_,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(o){if(this._enabled&&(this._moved=!1,!$p(this._element,"leaflet-zoom-anim"))){if(o.touches&&o.touches.length!==1){Do._dragging===this&&this.finishDrag();return}if(!(Do._dragging||o.shiftKey||o.which!==1&&o.button!==1&&!o.touches)&&(Do._dragging=this,this._preventOutline&&sg(this._element),ng(),tc(),!this._moving)){this.fire("down");var u=o.touches?o.touches[0]:o,h=__(this._element);this._startPoint=new z(u.clientX,u.clientY),this._startPos=za(this._element),this._parentScale=og(h);var m=o.type==="mousedown";qt(document,m?"mousemove":"touchmove",this._onMove,this),qt(document,m?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(o){if(this._enabled){if(o.touches&&o.touches.length>1){this._moved=!0;return}var u=o.touches&&o.touches.length===1?o.touches[0]:o,h=new z(u.clientX,u.clientY)._subtract(this._startPoint);!h.x&&!h.y||Math.abs(h.x)+Math.abs(h.y)<this.options.clickTolerance||(h.x/=this._parentScale.x,h.y/=this._parentScale.y,Kn(o),this._moved||(this.fire("dragstart"),this._moved=!0,Zt(document.body,"leaflet-dragging"),this._lastTarget=o.target||o.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Zt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(h),this._moving=!0,this._lastEvent=o,this._updatePosition())}},_updatePosition:function(){var o={originalEvent:this._lastEvent};this.fire("predrag",o),dn(this._element,this._newPos),this.fire("drag",o)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(o){en(document.body,"leaflet-dragging"),this._lastTarget&&(en(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Se(document,"mousemove touchmove",this._onMove,this),Se(document,"mouseup touchend touchcancel",this._onUp,this),rg(),ec();var u=this._moved&&this._moving;this._moving=!1,Do._dragging=!1,u&&this.fire("dragend",{noInertia:o,distance:this._newPos.distanceTo(this._startPos)})}});function L_(o,u,h){var m,_=[1,4,2,8],b,O,j,Z,et,xt,Dt,Kt;for(b=0,xt=o.length;b<xt;b++)o[b]._code=Va(o[b],u);for(j=0;j<4;j++){for(Dt=_[j],m=[],b=0,xt=o.length,O=xt-1;b<xt;O=b++)Z=o[b],et=o[O],Z._code&Dt?et._code&Dt||(Kt=rh(et,Z,Dt,u,h),Kt._code=Va(Kt,u),m.push(Kt)):(et._code&Dt&&(Kt=rh(et,Z,Dt,u,h),Kt._code=Va(Kt,u),m.push(Kt)),m.push(Z));o=m}return o}function I_(o,u){var h,m,_,b,O,j,Z,et,xt;if(!o||o.length===0)throw new Error("latlngs not passed");Ci(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var Dt=wt([0,0]),Kt=ht(o),xr=Kt.getNorthWest().distanceTo(Kt.getSouthWest())*Kt.getNorthEast().distanceTo(Kt.getNorthWest());xr<1700&&(Dt=pg(o));var Fn=o.length,Ni=[];for(h=0;h<Fn;h++){var zr=wt(o[h]);Ni.push(u.project(wt([zr.lat-Dt.lat,zr.lng-Dt.lng])))}for(j=Z=et=0,h=0,m=Fn-1;h<Fn;m=h++)_=Ni[h],b=Ni[m],O=_.y*b.x-b.y*_.x,Z+=(_.x+b.x)*O,et+=(_.y+b.y)*O,j+=O*3;j===0?xt=Ni[0]:xt=[Z/j,et/j];var jl=u.unproject(tt(xt));return wt([jl.lat+Dt.lat,jl.lng+Dt.lng])}function pg(o){for(var u=0,h=0,m=0,_=0;_<o.length;_++){var b=wt(o[_]);u+=b.lat,h+=b.lng,m++}return wt([u/m,h/m])}var FN={__proto__:null,clipPolygon:L_,polygonCenter:I_,centroid:pg};function T_(o,u){if(!u||!o.length)return o.slice();var h=u*u;return o=BN(o,h),o=zN(o,h),o}function O_(o,u,h){return Math.sqrt(sc(o,u,h,!0))}function jN(o,u,h){return sc(o,u,h)}function zN(o,u){var h=o.length,m=typeof Uint8Array<"u"?Uint8Array:Array,_=new m(h);_[0]=_[h-1]=1,gg(o,_,u,0,h-1);var b,O=[];for(b=0;b<h;b++)_[b]&&O.push(o[b]);return O}function gg(o,u,h,m,_){var b=0,O,j,Z;for(j=m+1;j<=_-1;j++)Z=sc(o[j],o[m],o[_],!0),Z>b&&(O=j,b=Z);b>h&&(u[O]=1,gg(o,u,h,m,O),gg(o,u,h,O,_))}function BN(o,u){for(var h=[o[0]],m=1,_=0,b=o.length;m<b;m++)UN(o[m],o[_])>u&&(h.push(o[m]),_=m);return _<b-1&&h.push(o[b-1]),h}var R_;function M_(o,u,h,m,_){var b=m?R_:Va(o,h),O=Va(u,h),j,Z,et;for(R_=O;;){if(!(b|O))return[o,u];if(b&O)return!1;j=b||O,Z=rh(o,u,j,h,_),et=Va(Z,h),j===b?(o=Z,b=et):(u=Z,O=et)}}function rh(o,u,h,m,_){var b=u.x-o.x,O=u.y-o.y,j=m.min,Z=m.max,et,xt;return h&8?(et=o.x+b*(Z.y-o.y)/O,xt=Z.y):h&4?(et=o.x+b*(j.y-o.y)/O,xt=j.y):h&2?(et=Z.x,xt=o.y+O*(Z.x-o.x)/b):h&1&&(et=j.x,xt=o.y+O*(j.x-o.x)/b),new z(et,xt,_)}function Va(o,u){var h=0;return o.x<u.min.x?h|=1:o.x>u.max.x&&(h|=2),o.y<u.min.y?h|=4:o.y>u.max.y&&(h|=8),h}function UN(o,u){var h=u.x-o.x,m=u.y-o.y;return h*h+m*m}function sc(o,u,h,m){var _=u.x,b=u.y,O=h.x-_,j=h.y-b,Z=O*O+j*j,et;return Z>0&&(et=((o.x-_)*O+(o.y-b)*j)/Z,et>1?(_=h.x,b=h.y):et>0&&(_+=O*et,b+=j*et)),O=o.x-_,j=o.y-b,m?O*O+j*j:new z(_,b)}function Ci(o){return!N(o[0])||typeof o[0][0]!="object"&&typeof o[0][0]<"u"}function A_(o){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ci(o)}function D_(o,u){var h,m,_,b,O,j,Z,et;if(!o||o.length===0)throw new Error("latlngs not passed");Ci(o)||(console.warn("latlngs are not flat! Only the first ring will be used"),o=o[0]);var xt=wt([0,0]),Dt=ht(o),Kt=Dt.getNorthWest().distanceTo(Dt.getSouthWest())*Dt.getNorthEast().distanceTo(Dt.getNorthWest());Kt<1700&&(xt=pg(o));var xr=o.length,Fn=[];for(h=0;h<xr;h++){var Ni=wt(o[h]);Fn.push(u.project(wt([Ni.lat-xt.lat,Ni.lng-xt.lng])))}for(h=0,m=0;h<xr-1;h++)m+=Fn[h].distanceTo(Fn[h+1])/2;if(m===0)et=Fn[0];else for(h=0,b=0;h<xr-1;h++)if(O=Fn[h],j=Fn[h+1],_=O.distanceTo(j),b+=_,b>m){Z=(b-m)/_,et=[j.x-Z*(j.x-O.x),j.y-Z*(j.y-O.y)];break}var zr=u.unproject(tt(et));return wt([zr.lat+xt.lat,zr.lng+xt.lng])}var VN={__proto__:null,simplify:T_,pointToSegmentDistance:O_,closestPointOnSegment:jN,clipSegment:M_,_getEdgeIntersection:rh,_getBitCode:Va,_sqClosestPointOnSegment:sc,isFlat:Ci,_flat:A_,polylineCenter:D_},mg={project:function(o){return new z(o.lng,o.lat)},unproject:function(o){return new _t(o.y,o.x)},bounds:new vt([-180,-90],[180,90])},vg={R:6378137,R_MINOR:6356752314245179e-9,bounds:new vt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(o){var u=Math.PI/180,h=this.R,m=o.lat*u,_=this.R_MINOR/h,b=Math.sqrt(1-_*_),O=b*Math.sin(m),j=Math.tan(Math.PI/4-m/2)/Math.pow((1-O)/(1+O),b/2);return m=-h*Math.log(Math.max(j,1e-10)),new z(o.lng*u*h,m)},unproject:function(o){for(var u=180/Math.PI,h=this.R,m=this.R_MINOR/h,_=Math.sqrt(1-m*m),b=Math.exp(-o.y/h),O=Math.PI/2-2*Math.atan(b),j=0,Z=.1,et;j<15&&Math.abs(Z)>1e-7;j++)et=_*Math.sin(O),et=Math.pow((1-et)/(1+et),_/2),Z=Math.PI/2-2*Math.atan(b*et)-O,O+=Z;return new _t(O*u,o.x*u/h)}},GN={__proto__:null,LonLat:mg,Mercator:vg,SphericalMercator:Ee},qN=i({},jt,{code:"EPSG:3395",projection:vg,transformation:function(){var o=.5/(Math.PI*vg.R);return De(o,.5,-o,.5)}()}),k_=i({},jt,{code:"EPSG:4326",projection:mg,transformation:De(1/180,1,-1/180,.5)}),HN=i({},Gt,{projection:mg,transformation:De(1,0,-1,0),scale:function(o){return Math.pow(2,o)},zoom:function(o){return Math.log(o)/Math.LN2},distance:function(o,u){var h=u.lng-o.lng,m=u.lat-o.lat;return Math.sqrt(h*h+m*m)},infinite:!0});Gt.Earth=jt,Gt.EPSG3395=qN,Gt.EPSG3857=jr,Gt.EPSG900913=Nn,Gt.EPSG4326=k_,Gt.Simple=HN;var ns=yt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(o){return o.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(o){return o&&o.removeLayer(this),this},getPane:function(o){return this._map.getPane(o?this.options[o]||o:this.options.pane)},addInteractiveTarget:function(o){return this._map._targets[c(o)]=this,this},removeInteractiveTarget:function(o){return delete this._map._targets[c(o)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(o){var u=o.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var h=this.getEvents();u.on(h,this),this.once("remove",function(){u.off(h,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});se.include({addLayer:function(o){if(!o._layerAdd)throw new Error("The provided object is not a Layer.");var u=c(o);return this._layers[u]?this:(this._layers[u]=o,o._mapToAdd=this,o.beforeAdd&&o.beforeAdd(this),this.whenReady(o._layerAdd,o),this)},removeLayer:function(o){var u=c(o);return this._layers[u]?(this._loaded&&o.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:o}),o.fire("remove")),o._map=o._mapToAdd=null,this):this},hasLayer:function(o){return c(o)in this._layers},eachLayer:function(o,u){for(var h in this._layers)o.call(u,this._layers[h]);return this},_addLayers:function(o){o=o?N(o)?o:[o]:[];for(var u=0,h=o.length;u<h;u++)this.addLayer(o[u])},_addZoomLimit:function(o){(!isNaN(o.options.maxZoom)||!isNaN(o.options.minZoom))&&(this._zoomBoundLayers[c(o)]=o,this._updateZoomLevels())},_removeZoomLimit:function(o){var u=c(o);this._zoomBoundLayers[u]&&(delete this._zoomBoundLayers[u],this._updateZoomLevels())},_updateZoomLevels:function(){var o=1/0,u=-1/0,h=this._getZoomSpan();for(var m in this._zoomBoundLayers){var _=this._zoomBoundLayers[m].options;o=_.minZoom===void 0?o:Math.min(o,_.minZoom),u=_.maxZoom===void 0?u:Math.max(u,_.maxZoom)}this._layersMaxZoom=u===-1/0?void 0:u,this._layersMinZoom=o===1/0?void 0:o,h!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ml=ns.extend({initialize:function(o,u){S(this,u),this._layers={};var h,m;if(o)for(h=0,m=o.length;h<m;h++)this.addLayer(o[h])},addLayer:function(o){var u=this.getLayerId(o);return this._layers[u]=o,this._map&&this._map.addLayer(o),this},removeLayer:function(o){var u=o in this._layers?o:this.getLayerId(o);return this._map&&this._layers[u]&&this._map.removeLayer(this._layers[u]),delete this._layers[u],this},hasLayer:function(o){var u=typeof o=="number"?o:this.getLayerId(o);return u in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(o){var u=Array.prototype.slice.call(arguments,1),h,m;for(h in this._layers)m=this._layers[h],m[o]&&m[o].apply(m,u);return this},onAdd:function(o){this.eachLayer(o.addLayer,o)},onRemove:function(o){this.eachLayer(o.removeLayer,o)},eachLayer:function(o,u){for(var h in this._layers)o.call(u,this._layers[h]);return this},getLayer:function(o){return this._layers[o]},getLayers:function(){var o=[];return this.eachLayer(o.push,o),o},setZIndex:function(o){return this.invoke("setZIndex",o)},getLayerId:function(o){return c(o)}}),ZN=function(o,u){return new Ml(o,u)},to=Ml.extend({addLayer:function(o){return this.hasLayer(o)?this:(o.addEventParent(this),Ml.prototype.addLayer.call(this,o),this.fire("layeradd",{layer:o}))},removeLayer:function(o){return this.hasLayer(o)?(o in this._layers&&(o=this._layers[o]),o.removeEventParent(this),Ml.prototype.removeLayer.call(this,o),this.fire("layerremove",{layer:o})):this},setStyle:function(o){return this.invoke("setStyle",o)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var o=new ct;for(var u in this._layers){var h=this._layers[u];o.extend(h.getBounds?h.getBounds():h.getLatLng())}return o}}),WN=function(o,u){return new to(o,u)},Al=D.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(o){S(this,o)},createIcon:function(o){return this._createIcon("icon",o)},createShadow:function(o){return this._createIcon("shadow",o)},_createIcon:function(o,u){var h=this._getIconUrl(o);if(!h){if(o==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var m=this._createImg(h,u&&u.tagName==="IMG"?u:null);return this._setIconStyles(m,o),(this.options.crossOrigin||this.options.crossOrigin==="")&&(m.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),m},_setIconStyles:function(o,u){var h=this.options,m=h[u+"Size"];typeof m=="number"&&(m=[m,m]);var _=tt(m),b=tt(u==="shadow"&&h.shadowAnchor||h.iconAnchor||_&&_.divideBy(2,!0));o.className="leaflet-marker-"+u+" "+(h.className||""),b&&(o.style.marginLeft=-b.x+"px",o.style.marginTop=-b.y+"px"),_&&(o.style.width=_.x+"px",o.style.height=_.y+"px")},_createImg:function(o,u){return u=u||document.createElement("img"),u.src=o,u},_getIconUrl:function(o){return It.retina&&this.options[o+"RetinaUrl"]||this.options[o+"Url"]}});function XN(o){return new Al(o)}var oc=Al.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(o){return typeof oc.imagePath!="string"&&(oc.imagePath=this._detectIconPath()),(this.options.imagePath||oc.imagePath)+Al.prototype._getIconUrl.call(this,o)},_stripUrl:function(o){var u=function(h,m,_){var b=m.exec(h);return b&&b[_]};return o=u(o,/^url\((['"])?(.+)\1\)$/,2),o&&u(o,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var o=le("div","leaflet-default-icon-path",document.body),u=$u(o,"background-image")||$u(o,"backgroundImage");if(document.body.removeChild(o),u=this._stripUrl(u),u)return u;var h=document.querySelector('link[href$="leaflet.css"]');return h?h.href.substring(0,h.href.length-11-1):""}}),F_=Ts.extend({initialize:function(o){this._marker=o},addHooks:function(){var o=this._marker._icon;this._draggable||(this._draggable=new Do(o,o,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Zt(o,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&en(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(o){var u=this._marker,h=u._map,m=this._marker.options.autoPanSpeed,_=this._marker.options.autoPanPadding,b=za(u._icon),O=h.getPixelBounds(),j=h.getPixelOrigin(),Z=Lt(O.min._subtract(j).add(_),O.max._subtract(j).subtract(_));if(!Z.contains(b)){var et=tt((Math.max(Z.max.x,b.x)-Z.max.x)/(O.max.x-Z.max.x)-(Math.min(Z.min.x,b.x)-Z.min.x)/(O.min.x-Z.min.x),(Math.max(Z.max.y,b.y)-Z.max.y)/(O.max.y-Z.max.y)-(Math.min(Z.min.y,b.y)-Z.min.y)/(O.min.y-Z.min.y)).multiplyBy(m);h.panBy(et,{animate:!1}),this._draggable._newPos._add(et),this._draggable._startPos._add(et),dn(u._icon,this._draggable._newPos),this._onDrag(o),this._panRequest=J(this._adjustPan.bind(this,o))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(o){this._marker.options.autoPan&&(W(this._panRequest),this._panRequest=J(this._adjustPan.bind(this,o)))},_onDrag:function(o){var u=this._marker,h=u._shadow,m=za(u._icon),_=u._map.layerPointToLatLng(m);h&&dn(h,m),u._latlng=_,o.latlng=_,o.oldLatLng=this._oldLatLng,u.fire("move",o).fire("drag",o)},_onDragEnd:function(o){W(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",o)}}),ih=ns.extend({options:{icon:new oc,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(o,u){S(this,u),this._latlng=wt(o)},onAdd:function(o){this._zoomAnimated=this._zoomAnimated&&o.options.markerZoomAnimation,this._zoomAnimated&&o.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(o){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&o.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(o){var u=this._latlng;return this._latlng=wt(o),this.update(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},setZIndexOffset:function(o){return this.options.zIndexOffset=o,this.update()},getIcon:function(){return this.options.icon},setIcon:function(o){return this.options.icon=o,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var o=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(o)}return this},_initIcon:function(){var o=this.options,u="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),h=o.icon.createIcon(this._icon),m=!1;h!==this._icon&&(this._icon&&this._removeIcon(),m=!0,o.title&&(h.title=o.title),h.tagName==="IMG"&&(h.alt=o.alt||"")),Zt(h,u),o.keyboard&&(h.tabIndex="0",h.setAttribute("role","button")),this._icon=h,o.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&qt(h,"focus",this._panOnFocus,this);var _=o.icon.createShadow(this._shadow),b=!1;_!==this._shadow&&(this._removeShadow(),b=!0),_&&(Zt(_,u),_.alt=""),this._shadow=_,o.opacity<1&&this._updateOpacity(),m&&this.getPane().appendChild(this._icon),this._initInteraction(),_&&b&&this.getPane(o.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Se(this._icon,"focus",this._panOnFocus,this),Be(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Be(this._shadow),this._shadow=null},_setPos:function(o){this._icon&&dn(this._icon,o),this._shadow&&dn(this._shadow,o),this._zIndex=o.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(o){this._icon&&(this._icon.style.zIndex=this._zIndex+o)},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center).round();this._setPos(u)},_initInteraction:function(){if(this.options.interactive&&(Zt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),F_)){var o=this.options.draggable;this.dragging&&(o=this.dragging.enabled(),this.dragging.disable()),this.dragging=new F_(this),o&&this.dragging.enable()}},setOpacity:function(o){return this.options.opacity=o,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var o=this.options.opacity;this._icon&&Si(this._icon,o),this._shadow&&Si(this._shadow,o)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var o=this._map;if(o){var u=this.options.icon.options,h=u.iconSize?tt(u.iconSize):tt(0,0),m=u.iconAnchor?tt(u.iconAnchor):tt(0,0);o.panInside(this._latlng,{paddingTopLeft:m,paddingBottomRight:h.subtract(m)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function YN(o,u){return new ih(o,u)}var ko=ns.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(o){this._renderer=o.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(o){return S(this,o),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&o&&Object.prototype.hasOwnProperty.call(o,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),sh=ko.extend({options:{fill:!0,radius:10},initialize:function(o,u){S(this,u),this._latlng=wt(o),this._radius=this.options.radius},setLatLng:function(o){var u=this._latlng;return this._latlng=wt(o),this.redraw(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(o){return this.options.radius=this._radius=o,this.redraw()},getRadius:function(){return this._radius},setStyle:function(o){var u=o&&o.radius||this._radius;return ko.prototype.setStyle.call(this,o),this.setRadius(u),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var o=this._radius,u=this._radiusY||o,h=this._clickTolerance(),m=[o+h,u+h];this._pxBounds=new vt(this._point.subtract(m),this._point.add(m))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(o){return o.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function KN(o,u){return new sh(o,u)}var yg=sh.extend({initialize:function(o,u,h){if(typeof u=="number"&&(u=i({},h,{radius:u})),S(this,u),this._latlng=wt(o),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(o){return this._mRadius=o,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var o=[this._radius,this._radiusY||this._radius];return new ct(this._map.layerPointToLatLng(this._point.subtract(o)),this._map.layerPointToLatLng(this._point.add(o)))},setStyle:ko.prototype.setStyle,_project:function(){var o=this._latlng.lng,u=this._latlng.lat,h=this._map,m=h.options.crs;if(m.distance===jt.distance){var _=Math.PI/180,b=this._mRadius/jt.R/_,O=h.project([u+b,o]),j=h.project([u-b,o]),Z=O.add(j).divideBy(2),et=h.unproject(Z).lat,xt=Math.acos((Math.cos(b*_)-Math.sin(u*_)*Math.sin(et*_))/(Math.cos(u*_)*Math.cos(et*_)))/_;(isNaN(xt)||xt===0)&&(xt=b/Math.cos(Math.PI/180*u)),this._point=Z.subtract(h.getPixelOrigin()),this._radius=isNaN(xt)?0:Z.x-h.project([et,o-xt]).x,this._radiusY=Z.y-O.y}else{var Dt=m.unproject(m.project(this._latlng).subtract([this._mRadius,0]));this._point=h.latLngToLayerPoint(this._latlng),this._radius=this._point.x-h.latLngToLayerPoint(Dt).x}this._updateBounds()}});function QN(o,u,h){return new yg(o,u,h)}var eo=ko.extend({options:{smoothFactor:1,noClip:!1},initialize:function(o,u){S(this,u),this._setLatLngs(o)},getLatLngs:function(){return this._latlngs},setLatLngs:function(o){return this._setLatLngs(o),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(o){for(var u=1/0,h=null,m=sc,_,b,O=0,j=this._parts.length;O<j;O++)for(var Z=this._parts[O],et=1,xt=Z.length;et<xt;et++){_=Z[et-1],b=Z[et];var Dt=m(o,_,b,!0);Dt<u&&(u=Dt,h=m(o,_,b))}return h&&(h.distance=Math.sqrt(u)),h},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return D_(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(o,u){return u=u||this._defaultShape(),o=wt(o),u.push(o),this._bounds.extend(o),this.redraw()},_setLatLngs:function(o){this._bounds=new ct,this._latlngs=this._convertLatLngs(o)},_defaultShape:function(){return Ci(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(o){for(var u=[],h=Ci(o),m=0,_=o.length;m<_;m++)h?(u[m]=wt(o[m]),this._bounds.extend(u[m])):u[m]=this._convertLatLngs(o[m]);return u},_project:function(){var o=new vt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,o),this._bounds.isValid()&&o.isValid()&&(this._rawPxBounds=o,this._updateBounds())},_updateBounds:function(){var o=this._clickTolerance(),u=new z(o,o);this._rawPxBounds&&(this._pxBounds=new vt([this._rawPxBounds.min.subtract(u),this._rawPxBounds.max.add(u)]))},_projectLatlngs:function(o,u,h){var m=o[0]instanceof _t,_=o.length,b,O;if(m){for(O=[],b=0;b<_;b++)O[b]=this._map.latLngToLayerPoint(o[b]),h.extend(O[b]);u.push(O)}else for(b=0;b<_;b++)this._projectLatlngs(o[b],u,h)},_clipPoints:function(){var o=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}var u=this._parts,h,m,_,b,O,j,Z;for(h=0,_=0,b=this._rings.length;h<b;h++)for(Z=this._rings[h],m=0,O=Z.length;m<O-1;m++)j=M_(Z[m],Z[m+1],o,m,!0),j&&(u[_]=u[_]||[],u[_].push(j[0]),(j[1]!==Z[m+1]||m===O-2)&&(u[_].push(j[1]),_++))}},_simplifyPoints:function(){for(var o=this._parts,u=this.options.smoothFactor,h=0,m=o.length;h<m;h++)o[h]=T_(o[h],u)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(o,u){var h,m,_,b,O,j,Z=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(h=0,b=this._parts.length;h<b;h++)for(j=this._parts[h],m=0,O=j.length,_=O-1;m<O;_=m++)if(!(!u&&m===0)&&O_(o,j[_],j[m])<=Z)return!0;return!1}});function JN(o,u){return new eo(o,u)}eo._flat=A_;var Dl=eo.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return I_(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(o){var u=eo.prototype._convertLatLngs.call(this,o),h=u.length;return h>=2&&u[0]instanceof _t&&u[0].equals(u[h-1])&&u.pop(),u},_setLatLngs:function(o){eo.prototype._setLatLngs.call(this,o),Ci(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ci(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var o=this._renderer._bounds,u=this.options.weight,h=new z(u,u);if(o=new vt(o.min.subtract(h),o.max.add(h)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(o))){if(this.options.noClip){this._parts=this._rings;return}for(var m=0,_=this._rings.length,b;m<_;m++)b=L_(this._rings[m],o,!0),b.length&&this._parts.push(b)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(o){var u=!1,h,m,_,b,O,j,Z,et;if(!this._pxBounds||!this._pxBounds.contains(o))return!1;for(b=0,Z=this._parts.length;b<Z;b++)for(h=this._parts[b],O=0,et=h.length,j=et-1;O<et;j=O++)m=h[O],_=h[j],m.y>o.y!=_.y>o.y&&o.x<(_.x-m.x)*(o.y-m.y)/(_.y-m.y)+m.x&&(u=!u);return u||eo.prototype._containsPoint.call(this,o,!0)}});function $N(o,u){return new Dl(o,u)}var no=to.extend({initialize:function(o,u){S(this,u),this._layers={},o&&this.addData(o)},addData:function(o){var u=N(o)?o:o.features,h,m,_;if(u){for(h=0,m=u.length;h<m;h++)_=u[h],(_.geometries||_.geometry||_.features||_.coordinates)&&this.addData(_);return this}var b=this.options;if(b.filter&&!b.filter(o))return this;var O=oh(o,b);return O?(O.feature=uh(o),O.defaultOptions=O.options,this.resetStyle(O),b.onEachFeature&&b.onEachFeature(o,O),this.addLayer(O)):this},resetStyle:function(o){return o===void 0?this.eachLayer(this.resetStyle,this):(o.options=i({},o.defaultOptions),this._setLayerStyle(o,this.options.style),this)},setStyle:function(o){return this.eachLayer(function(u){this._setLayerStyle(u,o)},this)},_setLayerStyle:function(o,u){o.setStyle&&(typeof u=="function"&&(u=u(o.feature)),o.setStyle(u))}});function oh(o,u){var h=o.type==="Feature"?o.geometry:o,m=h?h.coordinates:null,_=[],b=u&&u.pointToLayer,O=u&&u.coordsToLatLng||_g,j,Z,et,xt;if(!m&&!h)return null;switch(h.type){case"Point":return j=O(m),j_(b,o,j,u);case"MultiPoint":for(et=0,xt=m.length;et<xt;et++)j=O(m[et]),_.push(j_(b,o,j,u));return new to(_);case"LineString":case"MultiLineString":return Z=ah(m,h.type==="LineString"?0:1,O),new eo(Z,u);case"Polygon":case"MultiPolygon":return Z=ah(m,h.type==="Polygon"?1:2,O),new Dl(Z,u);case"GeometryCollection":for(et=0,xt=h.geometries.length;et<xt;et++){var Dt=oh({geometry:h.geometries[et],type:"Feature",properties:o.properties},u);Dt&&_.push(Dt)}return new to(_);case"FeatureCollection":for(et=0,xt=h.features.length;et<xt;et++){var Kt=oh(h.features[et],u);Kt&&_.push(Kt)}return new to(_);default:throw new Error("Invalid GeoJSON object.")}}function j_(o,u,h,m){return o?o(u,h):new ih(h,m&&m.markersInheritOptions&&m)}function _g(o){return new _t(o[1],o[0],o[2])}function ah(o,u,h){for(var m=[],_=0,b=o.length,O;_<b;_++)O=u?ah(o[_],u-1,h):(h||_g)(o[_]),m.push(O);return m}function xg(o,u){return o=wt(o),o.alt!==void 0?[v(o.lng,u),v(o.lat,u),v(o.alt,u)]:[v(o.lng,u),v(o.lat,u)]}function lh(o,u,h,m){for(var _=[],b=0,O=o.length;b<O;b++)_.push(u?lh(o[b],Ci(o[b])?0:u-1,h,m):xg(o[b],m));return!u&&h&&_.length>0&&_.push(_[0].slice()),_}function kl(o,u){return o.feature?i({},o.feature,{geometry:u}):uh(u)}function uh(o){return o.type==="Feature"||o.type==="FeatureCollection"?o:{type:"Feature",properties:{},geometry:o}}var wg={toGeoJSON:function(o){return kl(this,{type:"Point",coordinates:xg(this.getLatLng(),o)})}};ih.include(wg),yg.include(wg),sh.include(wg),eo.include({toGeoJSON:function(o){var u=!Ci(this._latlngs),h=lh(this._latlngs,u?1:0,!1,o);return kl(this,{type:(u?"Multi":"")+"LineString",coordinates:h})}}),Dl.include({toGeoJSON:function(o){var u=!Ci(this._latlngs),h=u&&!Ci(this._latlngs[0]),m=lh(this._latlngs,h?2:u?1:0,!0,o);return u||(m=[m]),kl(this,{type:(h?"Multi":"")+"Polygon",coordinates:m})}}),Ml.include({toMultiPoint:function(o){var u=[];return this.eachLayer(function(h){u.push(h.toGeoJSON(o).geometry.coordinates)}),kl(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(o){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(o);var h=u==="GeometryCollection",m=[];return this.eachLayer(function(_){if(_.toGeoJSON){var b=_.toGeoJSON(o);if(h)m.push(b.geometry);else{var O=uh(b);O.type==="FeatureCollection"?m.push.apply(m,O.features):m.push(O)}}}),h?kl(this,{geometries:m,type:"GeometryCollection"}):{type:"FeatureCollection",features:m}}});function z_(o,u){return new no(o,u)}var tP=z_,ch=ns.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(o,u,h){this._url=o,this._bounds=ht(u),S(this,h)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Zt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Be(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(o){return this.options.opacity=o,this._image&&this._updateOpacity(),this},setStyle:function(o){return o.opacity&&this.setOpacity(o.opacity),this},bringToFront:function(){return this._map&&Ol(this._image),this},bringToBack:function(){return this._map&&Rl(this._image),this},setUrl:function(o){return this._url=o,this._image&&(this._image.src=o),this},setBounds:function(o){return this._bounds=ht(o),this._map&&this._reset(),this},getEvents:function(){var o={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var o=this._url.tagName==="IMG",u=this._image=o?this._url:le("img");if(Zt(u,"leaflet-image-layer"),this._zoomAnimated&&Zt(u,"leaflet-zoom-animated"),this.options.className&&Zt(u,this.options.className),u.onselectstart=d,u.onmousemove=d,u.onload=a(this.fire,this,"load"),u.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),o){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(o){var u=this._map.getZoomScale(o.zoom),h=this._map._latLngBoundsToNewLayerBounds(this._bounds,o.zoom,o.center).min;ja(this._image,h,u)},_reset:function(){var o=this._image,u=new vt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),h=u.getSize();dn(o,u.min),o.style.width=h.x+"px",o.style.height=h.y+"px"},_updateOpacity:function(){Si(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var o=this.options.errorOverlayUrl;o&&this._url!==o&&(this._url=o,this._image.src=o)},getCenter:function(){return this._bounds.getCenter()}}),eP=function(o,u,h){return new ch(o,u,h)},B_=ch.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var o=this._url.tagName==="VIDEO",u=this._image=o?this._url:le("video");if(Zt(u,"leaflet-image-layer"),this._zoomAnimated&&Zt(u,"leaflet-zoom-animated"),this.options.className&&Zt(u,this.options.className),u.onselectstart=d,u.onmousemove=d,u.onloadeddata=a(this.fire,this,"load"),o){for(var h=u.getElementsByTagName("source"),m=[],_=0;_<h.length;_++)m.push(h[_].src);this._url=h.length>0?m:[u.src];return}N(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var b=0;b<this._url.length;b++){var O=le("source");O.src=this._url[b],u.appendChild(O)}}});function nP(o,u,h){return new B_(o,u,h)}var U_=ch.extend({_initImage:function(){var o=this._image=this._url;Zt(o,"leaflet-image-layer"),this._zoomAnimated&&Zt(o,"leaflet-zoom-animated"),this.options.className&&Zt(o,this.options.className),o.onselectstart=d,o.onmousemove=d}});function rP(o,u,h){return new U_(o,u,h)}var Os=ns.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(o,u){o&&(o instanceof _t||N(o))?(this._latlng=wt(o),S(this,u)):(S(this,o),this._source=u),this.options.content&&(this._content=this.options.content)},openOn:function(o){return o=arguments.length?o:this._source._map,o.hasLayer(this)||o.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(o){return this._map?this.close():(arguments.length?this._source=o:o=this._source,this._prepareOpen(),this.openOn(o._map)),this},onAdd:function(o){this._zoomAnimated=o._zoomAnimated,this._container||this._initLayout(),o._fadeAnimated&&Si(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),o._fadeAnimated&&Si(this._container,1),this.bringToFront(),this.options.interactive&&(Zt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(o){o._fadeAnimated?(Si(this._container,0),this._removeTimeout=setTimeout(a(Be,void 0,this._container),200)):Be(this._container),this.options.interactive&&(en(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(o){return this._latlng=wt(o),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(o){return this._content=o,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var o={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Ol(this._container),this},bringToBack:function(){return this._map&&Rl(this._container),this},_prepareOpen:function(o){var u=this._source;if(!u._map)return!1;if(u instanceof to){u=null;var h=this._source._layers;for(var m in h)if(h[m]._map){u=h[m];break}if(!u)return!1;this._source=u}if(!o)if(u.getCenter)o=u.getCenter();else if(u.getLatLng)o=u.getLatLng();else if(u.getBounds)o=u.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(o),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var o=this._contentNode,u=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof u=="string")o.innerHTML=u;else{for(;o.hasChildNodes();)o.removeChild(o.firstChild);o.appendChild(u)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var o=this._map.latLngToLayerPoint(this._latlng),u=tt(this.options.offset),h=this._getAnchor();this._zoomAnimated?dn(this._container,o.add(h)):u=u.add(o).add(h);var m=this._containerBottom=-u.y,_=this._containerLeft=-Math.round(this._containerWidth/2)+u.x;this._container.style.bottom=m+"px",this._container.style.left=_+"px"}},_getAnchor:function(){return[0,0]}});se.include({_initOverlay:function(o,u,h,m){var _=u;return _ instanceof o||(_=new o(m).setContent(u)),h&&_.setLatLng(h),_}}),ns.include({_initOverlay:function(o,u,h,m){var _=h;return _ instanceof o?(S(_,m),_._source=this):(_=u&&!m?u:new o(m,this),_.setContent(h)),_}});var fh=Os.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(o){return o=arguments.length?o:this._source._map,!o.hasLayer(this)&&o._popup&&o._popup.options.autoClose&&o.removeLayer(o._popup),o._popup=this,Os.prototype.openOn.call(this,o)},onAdd:function(o){Os.prototype.onAdd.call(this,o),o.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ko||this._source.on("preclick",Ba))},onRemove:function(o){Os.prototype.onRemove.call(this,o),o.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ko||this._source.off("preclick",Ba))},getEvents:function(){var o=Os.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(o.preclick=this.close),this.options.keepInView&&(o.moveend=this._adjustPan),o},_initLayout:function(){var o="leaflet-popup",u=this._container=le("div",o+" "+(this.options.className||"")+" leaflet-zoom-animated"),h=this._wrapper=le("div",o+"-content-wrapper",u);if(this._contentNode=le("div",o+"-content",h),rc(u),cg(this._contentNode),qt(u,"contextmenu",Ba),this._tipContainer=le("div",o+"-tip-container",u),this._tip=le("div",o+"-tip",this._tipContainer),this.options.closeButton){var m=this._closeButton=le("a",o+"-close-button",u);m.setAttribute("role","button"),m.setAttribute("aria-label","Close popup"),m.href="#close",m.innerHTML='<span aria-hidden="true">&#215;</span>',qt(m,"click",function(_){Kn(_),this.close()},this)}},_updateLayout:function(){var o=this._contentNode,u=o.style;u.width="",u.whiteSpace="nowrap";var h=o.offsetWidth;h=Math.min(h,this.options.maxWidth),h=Math.max(h,this.options.minWidth),u.width=h+1+"px",u.whiteSpace="",u.height="";var m=o.offsetHeight,_=this.options.maxHeight,b="leaflet-popup-scrolled";_&&m>_?(u.height=_+"px",Zt(o,b)):en(o,b),this._containerWidth=this._container.offsetWidth},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center),h=this._getAnchor();dn(this._container,u.add(h))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var o=this._map,u=parseInt($u(this._container,"marginBottom"),10)||0,h=this._container.offsetHeight+u,m=this._containerWidth,_=new z(this._containerLeft,-h-this._containerBottom);_._add(za(this._container));var b=o.layerPointToContainerPoint(_),O=tt(this.options.autoPanPadding),j=tt(this.options.autoPanPaddingTopLeft||O),Z=tt(this.options.autoPanPaddingBottomRight||O),et=o.getSize(),xt=0,Dt=0;b.x+m+Z.x>et.x&&(xt=b.x+m-et.x+Z.x),b.x-xt-j.x<0&&(xt=b.x-j.x),b.y+h+Z.y>et.y&&(Dt=b.y+h-et.y+Z.y),b.y-Dt-j.y<0&&(Dt=b.y-j.y),(xt||Dt)&&(this.options.keepInView&&(this._autopanning=!0),o.fire("autopanstart").panBy([xt,Dt]))}},_getAnchor:function(){return tt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),iP=function(o,u){return new fh(o,u)};se.mergeOptions({closePopupOnClick:!0}),se.include({openPopup:function(o,u,h){return this._initOverlay(fh,o,u,h).openOn(this),this},closePopup:function(o){return o=arguments.length?o:this._popup,o&&o.close(),this}}),ns.include({bindPopup:function(o,u){return this._popup=this._initOverlay(fh,this._popup,o,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(o){return this._popup&&(this instanceof to||(this._popup._source=this),this._popup._prepareOpen(o||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(o){return this._popup&&this._popup.setContent(o),this},getPopup:function(){return this._popup},_openPopup:function(o){if(!(!this._popup||!this._map)){Ua(o);var u=o.layer||o.target;if(this._popup._source===u&&!(u instanceof ko)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(o.latlng);return}this._popup._source=u,this.openPopup(o.latlng)}},_movePopup:function(o){this._popup.setLatLng(o.latlng)},_onKeyPress:function(o){o.originalEvent.keyCode===13&&this._openPopup(o)}});var hh=Os.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(o){Os.prototype.onAdd.call(this,o),this.setOpacity(this.options.opacity),o.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(o){Os.prototype.onRemove.call(this,o),o.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var o=Os.prototype.getEvents.call(this);return this.options.permanent||(o.preclick=this.close),o},_initLayout:function(){var o="leaflet-tooltip",u=o+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=le("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(o){var u,h,m=this._map,_=this._container,b=m.latLngToContainerPoint(m.getCenter()),O=m.layerPointToContainerPoint(o),j=this.options.direction,Z=_.offsetWidth,et=_.offsetHeight,xt=tt(this.options.offset),Dt=this._getAnchor();j==="top"?(u=Z/2,h=et):j==="bottom"?(u=Z/2,h=0):j==="center"?(u=Z/2,h=et/2):j==="right"?(u=0,h=et/2):j==="left"?(u=Z,h=et/2):O.x<b.x?(j="right",u=0,h=et/2):(j="left",u=Z+(xt.x+Dt.x)*2,h=et/2),o=o.subtract(tt(u,h,!0)).add(xt).add(Dt),en(_,"leaflet-tooltip-right"),en(_,"leaflet-tooltip-left"),en(_,"leaflet-tooltip-top"),en(_,"leaflet-tooltip-bottom"),Zt(_,"leaflet-tooltip-"+j),dn(_,o)},_updatePosition:function(){var o=this._map.latLngToLayerPoint(this._latlng);this._setPosition(o)},setOpacity:function(o){this.options.opacity=o,this._container&&Si(this._container,o)},_animateZoom:function(o){var u=this._map._latLngToNewLayerPoint(this._latlng,o.zoom,o.center);this._setPosition(u)},_getAnchor:function(){return tt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),sP=function(o,u){return new hh(o,u)};se.include({openTooltip:function(o,u,h){return this._initOverlay(hh,o,u,h).openOn(this),this},closeTooltip:function(o){return o.close(),this}}),ns.include({bindTooltip:function(o,u){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(hh,this._tooltip,o,u),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(o){if(!(!o&&this._tooltipHandlersAdded)){var u=o?"off":"on",h={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?h.add=this._openTooltip:(h.mouseover=this._openTooltip,h.mouseout=this.closeTooltip,h.click=this._openTooltip,this._map?this._addFocusListeners():h.add=this._addFocusListeners),this._tooltip.options.sticky&&(h.mousemove=this._moveTooltip),this[u](h),this._tooltipHandlersAdded=!o}},openTooltip:function(o){return this._tooltip&&(this instanceof to||(this._tooltip._source=this),this._tooltip._prepareOpen(o)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(o){return this._tooltip&&this._tooltip.setContent(o),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(o){var u=typeof o.getElement=="function"&&o.getElement();u&&(qt(u,"focus",function(){this._tooltip._source=o,this.openTooltip()},this),qt(u,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(o){var u=typeof o.getElement=="function"&&o.getElement();u&&u.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(o){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var u=this;this._map.once("moveend",function(){u._openOnceFlag=!1,u._openTooltip(o)});return}this._tooltip._source=o.layer||o.target,this.openTooltip(this._tooltip.options.sticky?o.latlng:void 0)}},_moveTooltip:function(o){var u=o.latlng,h,m;this._tooltip.options.sticky&&o.originalEvent&&(h=this._map.mouseEventToContainerPoint(o.originalEvent),m=this._map.containerPointToLayerPoint(h),u=this._map.layerPointToLatLng(m)),this._tooltip.setLatLng(u)}});var V_=Al.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(o){var u=o&&o.tagName==="DIV"?o:document.createElement("div"),h=this.options;if(h.html instanceof Element?(Jf(u),u.appendChild(h.html)):u.innerHTML=h.html!==!1?h.html:"",h.bgPos){var m=tt(h.bgPos);u.style.backgroundPosition=-m.x+"px "+-m.y+"px"}return this._setIconStyles(u,"icon"),u},createShadow:function(){return null}});function oP(o){return new V_(o)}Al.Default=oc;var ac=ns.extend({options:{tileSize:256,opacity:1,updateWhenIdle:It.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(o){S(this,o)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(o){o._addZoomLimit(this)},onRemove:function(o){this._removeAllTiles(),Be(this._container),o._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Ol(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Rl(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(o){return this.options.opacity=o,this._updateOpacity(),this},setZIndex:function(o){return this.options.zIndex=o,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var o=this._clampZoom(this._map.getZoom());o!==this._tileZoom&&(this._tileZoom=o,this._updateLevels()),this._update()}return this},getEvents:function(){var o={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=f(this._onMoveEnd,this.options.updateInterval,this)),o.move=this._onMove),this._zoomAnimated&&(o.zoomanim=this._animateZoom),o},createTile:function(){return document.createElement("div")},getTileSize:function(){var o=this.options.tileSize;return o instanceof z?o:new z(o,o)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(o){for(var u=this.getPane().children,h=-o(-1/0,1/0),m=0,_=u.length,b;m<_;m++)b=u[m].style.zIndex,u[m]!==this._container&&b&&(h=o(h,+b));isFinite(h)&&(this.options.zIndex=h+o(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!It.ielt9){Si(this._container,this.options.opacity);var o=+new Date,u=!1,h=!1;for(var m in this._tiles){var _=this._tiles[m];if(!(!_.current||!_.loaded)){var b=Math.min(1,(o-_.loaded)/200);Si(_.el,b),b<1?u=!0:(_.active?h=!0:this._onOpaqueTile(_),_.active=!0)}}h&&!this._noPrune&&this._pruneTiles(),u&&(W(this._fadeFrame),this._fadeFrame=J(this._updateOpacity,this))}},_onOpaqueTile:d,_initContainer:function(){this._container||(this._container=le("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var o=this._tileZoom,u=this.options.maxZoom;if(o!==void 0){for(var h in this._levels)h=Number(h),this._levels[h].el.children.length||h===o?(this._levels[h].el.style.zIndex=u-Math.abs(o-h),this._onUpdateLevel(h)):(Be(this._levels[h].el),this._removeTilesAtZoom(h),this._onRemoveLevel(h),delete this._levels[h]);var m=this._levels[o],_=this._map;return m||(m=this._levels[o]={},m.el=le("div","leaflet-tile-container leaflet-zoom-animated",this._container),m.el.style.zIndex=u,m.origin=_.project(_.unproject(_.getPixelOrigin()),o).round(),m.zoom=o,this._setZoomTransform(m,_.getCenter(),_.getZoom()),d(m.el.offsetWidth),this._onCreateLevel(m)),this._level=m,m}},_onUpdateLevel:d,_onRemoveLevel:d,_onCreateLevel:d,_pruneTiles:function(){if(this._map){var o,u,h=this._map.getZoom();if(h>this.options.maxZoom||h<this.options.minZoom){this._removeAllTiles();return}for(o in this._tiles)u=this._tiles[o],u.retain=u.current;for(o in this._tiles)if(u=this._tiles[o],u.current&&!u.active){var m=u.coords;this._retainParent(m.x,m.y,m.z,m.z-5)||this._retainChildren(m.x,m.y,m.z,m.z+2)}for(o in this._tiles)this._tiles[o].retain||this._removeTile(o)}},_removeTilesAtZoom:function(o){for(var u in this._tiles)this._tiles[u].coords.z===o&&this._removeTile(u)},_removeAllTiles:function(){for(var o in this._tiles)this._removeTile(o)},_invalidateAll:function(){for(var o in this._levels)Be(this._levels[o].el),this._onRemoveLevel(Number(o)),delete this._levels[o];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(o,u,h,m){var _=Math.floor(o/2),b=Math.floor(u/2),O=h-1,j=new z(+_,+b);j.z=+O;var Z=this._tileCoordsToKey(j),et=this._tiles[Z];return et&&et.active?(et.retain=!0,!0):(et&&et.loaded&&(et.retain=!0),O>m?this._retainParent(_,b,O,m):!1)},_retainChildren:function(o,u,h,m){for(var _=2*o;_<2*o+2;_++)for(var b=2*u;b<2*u+2;b++){var O=new z(_,b);O.z=h+1;var j=this._tileCoordsToKey(O),Z=this._tiles[j];if(Z&&Z.active){Z.retain=!0;continue}else Z&&Z.loaded&&(Z.retain=!0);h+1<m&&this._retainChildren(_,b,h+1,m)}},_resetView:function(o){var u=o&&(o.pinch||o.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),u,u)},_animateZoom:function(o){this._setView(o.center,o.zoom,!0,o.noUpdate)},_clampZoom:function(o){var u=this.options;return u.minNativeZoom!==void 0&&o<u.minNativeZoom?u.minNativeZoom:u.maxNativeZoom!==void 0&&u.maxNativeZoom<o?u.maxNativeZoom:o},_setView:function(o,u,h,m){var _=Math.round(u);this.options.maxZoom!==void 0&&_>this.options.maxZoom||this.options.minZoom!==void 0&&_<this.options.minZoom?_=void 0:_=this._clampZoom(_);var b=this.options.updateWhenZooming&&_!==this._tileZoom;(!m||b)&&(this._tileZoom=_,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),_!==void 0&&this._update(o),h||this._pruneTiles(),this._noPrune=!!h),this._setZoomTransforms(o,u)},_setZoomTransforms:function(o,u){for(var h in this._levels)this._setZoomTransform(this._levels[h],o,u)},_setZoomTransform:function(o,u,h){var m=this._map.getZoomScale(h,o.zoom),_=o.origin.multiplyBy(m).subtract(this._map._getNewPixelOrigin(u,h)).round();It.any3d?ja(o.el,_,m):dn(o.el,_)},_resetGrid:function(){var o=this._map,u=o.options.crs,h=this._tileSize=this.getTileSize(),m=this._tileZoom,_=this._map.getPixelWorldBounds(this._tileZoom);_&&(this._globalTileRange=this._pxBoundsToTileRange(_)),this._wrapX=u.wrapLng&&!this.options.noWrap&&[Math.floor(o.project([0,u.wrapLng[0]],m).x/h.x),Math.ceil(o.project([0,u.wrapLng[1]],m).x/h.y)],this._wrapY=u.wrapLat&&!this.options.noWrap&&[Math.floor(o.project([u.wrapLat[0],0],m).y/h.x),Math.ceil(o.project([u.wrapLat[1],0],m).y/h.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(o){var u=this._map,h=u._animatingZoom?Math.max(u._animateToZoom,u.getZoom()):u.getZoom(),m=u.getZoomScale(h,this._tileZoom),_=u.project(o,this._tileZoom).floor(),b=u.getSize().divideBy(m*2);return new vt(_.subtract(b),_.add(b))},_update:function(o){var u=this._map;if(u){var h=this._clampZoom(u.getZoom());if(o===void 0&&(o=u.getCenter()),this._tileZoom!==void 0){var m=this._getTiledPixelBounds(o),_=this._pxBoundsToTileRange(m),b=_.getCenter(),O=[],j=this.options.keepBuffer,Z=new vt(_.getBottomLeft().subtract([j,-j]),_.getTopRight().add([j,-j]));if(!(isFinite(_.min.x)&&isFinite(_.min.y)&&isFinite(_.max.x)&&isFinite(_.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var et in this._tiles){var xt=this._tiles[et].coords;(xt.z!==this._tileZoom||!Z.contains(new z(xt.x,xt.y)))&&(this._tiles[et].current=!1)}if(Math.abs(h-this._tileZoom)>1){this._setView(o,h);return}for(var Dt=_.min.y;Dt<=_.max.y;Dt++)for(var Kt=_.min.x;Kt<=_.max.x;Kt++){var xr=new z(Kt,Dt);if(xr.z=this._tileZoom,!!this._isValidTile(xr)){var Fn=this._tiles[this._tileCoordsToKey(xr)];Fn?Fn.current=!0:O.push(xr)}}if(O.sort(function(zr,jl){return zr.distanceTo(b)-jl.distanceTo(b)}),O.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ni=document.createDocumentFragment();for(Kt=0;Kt<O.length;Kt++)this._addTile(O[Kt],Ni);this._level.el.appendChild(Ni)}}}},_isValidTile:function(o){var u=this._map.options.crs;if(!u.infinite){var h=this._globalTileRange;if(!u.wrapLng&&(o.x<h.min.x||o.x>h.max.x)||!u.wrapLat&&(o.y<h.min.y||o.y>h.max.y))return!1}if(!this.options.bounds)return!0;var m=this._tileCoordsToBounds(o);return ht(this.options.bounds).overlaps(m)},_keyToBounds:function(o){return this._tileCoordsToBounds(this._keyToTileCoords(o))},_tileCoordsToNwSe:function(o){var u=this._map,h=this.getTileSize(),m=o.scaleBy(h),_=m.add(h),b=u.unproject(m,o.z),O=u.unproject(_,o.z);return[b,O]},_tileCoordsToBounds:function(o){var u=this._tileCoordsToNwSe(o),h=new ct(u[0],u[1]);return this.options.noWrap||(h=this._map.wrapLatLngBounds(h)),h},_tileCoordsToKey:function(o){return o.x+":"+o.y+":"+o.z},_keyToTileCoords:function(o){var u=o.split(":"),h=new z(+u[0],+u[1]);return h.z=+u[2],h},_removeTile:function(o){var u=this._tiles[o];u&&(Be(u.el),delete this._tiles[o],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(o)}))},_initTile:function(o){Zt(o,"leaflet-tile");var u=this.getTileSize();o.style.width=u.x+"px",o.style.height=u.y+"px",o.onselectstart=d,o.onmousemove=d,It.ielt9&&this.options.opacity<1&&Si(o,this.options.opacity)},_addTile:function(o,u){var h=this._getTilePos(o),m=this._tileCoordsToKey(o),_=this.createTile(this._wrapCoords(o),a(this._tileReady,this,o));this._initTile(_),this.createTile.length<2&&J(a(this._tileReady,this,o,null,_)),dn(_,h),this._tiles[m]={el:_,coords:o,current:!0},u.appendChild(_),this.fire("tileloadstart",{tile:_,coords:o})},_tileReady:function(o,u,h){u&&this.fire("tileerror",{error:u,tile:h,coords:o});var m=this._tileCoordsToKey(o);h=this._tiles[m],h&&(h.loaded=+new Date,this._map._fadeAnimated?(Si(h.el,0),W(this._fadeFrame),this._fadeFrame=J(this._updateOpacity,this)):(h.active=!0,this._pruneTiles()),u||(Zt(h.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:h.el,coords:o})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),It.ielt9||!this._map._fadeAnimated?J(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(o){return o.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(o){var u=new z(this._wrapX?g(o.x,this._wrapX):o.x,this._wrapY?g(o.y,this._wrapY):o.y);return u.z=o.z,u},_pxBoundsToTileRange:function(o){var u=this.getTileSize();return new vt(o.min.unscaleBy(u).floor(),o.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var o in this._tiles)if(!this._tiles[o].loaded)return!1;return!0}});function aP(o){return new ac(o)}var Fl=ac.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(o,u){this._url=o,u=S(this,u),u.detectRetina&&It.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(o,u){return this._url===o&&u===void 0&&(u=!0),this._url=o,u||this.redraw(),this},createTile:function(o,u){var h=document.createElement("img");return qt(h,"load",a(this._tileOnLoad,this,u,h)),qt(h,"error",a(this._tileOnError,this,u,h)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(h.referrerPolicy=this.options.referrerPolicy),h.alt="",h.src=this.getTileUrl(o),h},getTileUrl:function(o){var u={r:It.retina?"@2x":"",s:this._getSubdomain(o),x:o.x,y:o.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var h=this._globalTileRange.max.y-o.y;this.options.tms&&(u.y=h),u["-y"]=h}return w(this._url,i(u,this.options))},_tileOnLoad:function(o,u){It.ielt9?setTimeout(a(o,this,null,u),0):o(null,u)},_tileOnError:function(o,u,h){var m=this.options.errorTileUrl;m&&u.getAttribute("src")!==m&&(u.src=m),o(h,u)},_onTileRemove:function(o){o.tile.onload=null},_getZoomForUrl:function(){var o=this._tileZoom,u=this.options.maxZoom,h=this.options.zoomReverse,m=this.options.zoomOffset;return h&&(o=u-o),o+m},_getSubdomain:function(o){var u=Math.abs(o.x+o.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var o,u;for(o in this._tiles)if(this._tiles[o].coords.z!==this._tileZoom&&(u=this._tiles[o].el,u.onload=d,u.onerror=d,!u.complete)){u.src=R;var h=this._tiles[o].coords;Be(u),delete this._tiles[o],this.fire("tileabort",{tile:u,coords:h})}},_removeTile:function(o){var u=this._tiles[o];if(u)return u.el.setAttribute("src",R),ac.prototype._removeTile.call(this,o)},_tileReady:function(o,u,h){if(!(!this._map||h&&h.getAttribute("src")===R))return ac.prototype._tileReady.call(this,o,u,h)}});function G_(o,u){return new Fl(o,u)}var q_=Fl.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(o,u){this._url=o;var h=i({},this.defaultWmsParams);for(var m in u)m in this.options||(h[m]=u[m]);u=S(this,u);var _=u.detectRetina&&It.retina?2:1,b=this.getTileSize();h.width=b.x*_,h.height=b.y*_,this.wmsParams=h},onAdd:function(o){this._crs=this.options.crs||o.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,Fl.prototype.onAdd.call(this,o)},getTileUrl:function(o){var u=this._tileCoordsToNwSe(o),h=this._crs,m=Lt(h.project(u[0]),h.project(u[1])),_=m.min,b=m.max,O=(this._wmsVersion>=1.3&&this._crs===k_?[_.y,_.x,b.y,b.x]:[_.x,_.y,b.x,b.y]).join(","),j=Fl.prototype.getTileUrl.call(this,o);return j+C(this.wmsParams,j,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+O},setParams:function(o,u){return i(this.wmsParams,o),u||this.redraw(),this}});function lP(o,u){return new q_(o,u)}Fl.WMS=q_,G_.wms=lP;var ro=ns.extend({options:{padding:.1},initialize:function(o){S(this,o),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Zt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var o={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(o.zoomanim=this._onAnimZoom),o},_onAnimZoom:function(o){this._updateTransform(o.center,o.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(o,u){var h=this._map.getZoomScale(u,this._zoom),m=this._map.getSize().multiplyBy(.5+this.options.padding),_=this._map.project(this._center,u),b=m.multiplyBy(-h).add(_).subtract(this._map._getNewPixelOrigin(o,u));It.any3d?ja(this._container,b,h):dn(this._container,b)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var o in this._layers)this._layers[o]._reset()},_onZoomEnd:function(){for(var o in this._layers)this._layers[o]._project()},_updatePaths:function(){for(var o in this._layers)this._layers[o]._update()},_update:function(){var o=this.options.padding,u=this._map.getSize(),h=this._map.containerPointToLayerPoint(u.multiplyBy(-o)).round();this._bounds=new vt(h,h.add(u.multiplyBy(1+o*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),H_=ro.extend({options:{tolerance:0},getEvents:function(){var o=ro.prototype.getEvents.call(this);return o.viewprereset=this._onViewPreReset,o},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ro.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var o=this._container=document.createElement("canvas");qt(o,"mousemove",this._onMouseMove,this),qt(o,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qt(o,"mouseout",this._handleMouseOut,this),o._leaflet_disable_events=!0,this._ctx=o.getContext("2d")},_destroyContainer:function(){W(this._redrawRequest),delete this._ctx,Be(this._container),Se(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var o;this._redrawBounds=null;for(var u in this._layers)o=this._layers[u],o._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ro.prototype._update.call(this);var o=this._bounds,u=this._container,h=o.getSize(),m=It.retina?2:1;dn(u,o.min),u.width=m*h.x,u.height=m*h.y,u.style.width=h.x+"px",u.style.height=h.y+"px",It.retina&&this._ctx.scale(2,2),this._ctx.translate(-o.min.x,-o.min.y),this.fire("update")}},_reset:function(){ro.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(o){this._updateDashArray(o),this._layers[c(o)]=o;var u=o._order={layer:o,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(o){this._requestRedraw(o)},_removePath:function(o){var u=o._order,h=u.next,m=u.prev;h?h.prev=m:this._drawLast=m,m?m.next=h:this._drawFirst=h,delete o._order,delete this._layers[c(o)],this._requestRedraw(o)},_updatePath:function(o){this._extendRedrawBounds(o),o._project(),o._update(),this._requestRedraw(o)},_updateStyle:function(o){this._updateDashArray(o),this._requestRedraw(o)},_updateDashArray:function(o){if(typeof o.options.dashArray=="string"){var u=o.options.dashArray.split(/[, ]+/),h=[],m,_;for(_=0;_<u.length;_++){if(m=Number(u[_]),isNaN(m))return;h.push(m)}o.options._dashArray=h}else o.options._dashArray=o.options.dashArray},_requestRedraw:function(o){this._map&&(this._extendRedrawBounds(o),this._redrawRequest=this._redrawRequest||J(this._redraw,this))},_extendRedrawBounds:function(o){if(o._pxBounds){var u=(o.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new vt,this._redrawBounds.extend(o._pxBounds.min.subtract([u,u])),this._redrawBounds.extend(o._pxBounds.max.add([u,u]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var o=this._redrawBounds;if(o){var u=o.getSize();this._ctx.clearRect(o.min.x,o.min.y,u.x,u.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var o,u=this._redrawBounds;if(this._ctx.save(),u){var h=u.getSize();this._ctx.beginPath(),this._ctx.rect(u.min.x,u.min.y,h.x,h.y),this._ctx.clip()}this._drawing=!0;for(var m=this._drawFirst;m;m=m.next)o=m.layer,(!u||o._pxBounds&&o._pxBounds.intersects(u))&&o._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(o,u){if(this._drawing){var h,m,_,b,O=o._parts,j=O.length,Z=this._ctx;if(j){for(Z.beginPath(),h=0;h<j;h++){for(m=0,_=O[h].length;m<_;m++)b=O[h][m],Z[m?"lineTo":"moveTo"](b.x,b.y);u&&Z.closePath()}this._fillStroke(Z,o)}}},_updateCircle:function(o){if(!(!this._drawing||o._empty())){var u=o._point,h=this._ctx,m=Math.max(Math.round(o._radius),1),_=(Math.max(Math.round(o._radiusY),1)||m)/m;_!==1&&(h.save(),h.scale(1,_)),h.beginPath(),h.arc(u.x,u.y/_,m,0,Math.PI*2,!1),_!==1&&h.restore(),this._fillStroke(h,o)}},_fillStroke:function(o,u){var h=u.options;h.fill&&(o.globalAlpha=h.fillOpacity,o.fillStyle=h.fillColor||h.color,o.fill(h.fillRule||"evenodd")),h.stroke&&h.weight!==0&&(o.setLineDash&&o.setLineDash(u.options&&u.options._dashArray||[]),o.globalAlpha=h.opacity,o.lineWidth=h.weight,o.strokeStyle=h.color,o.lineCap=h.lineCap,o.lineJoin=h.lineJoin,o.stroke())},_onClick:function(o){for(var u=this._map.mouseEventToLayerPoint(o),h,m,_=this._drawFirst;_;_=_.next)h=_.layer,h.options.interactive&&h._containsPoint(u)&&(!(o.type==="click"||o.type==="preclick")||!this._map._draggableMoved(h))&&(m=h);this._fireEvent(m?[m]:!1,o)},_onMouseMove:function(o){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var u=this._map.mouseEventToLayerPoint(o);this._handleMouseHover(o,u)}},_handleMouseOut:function(o){var u=this._hoveredLayer;u&&(en(this._container,"leaflet-interactive"),this._fireEvent([u],o,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(o,u){if(!this._mouseHoverThrottled){for(var h,m,_=this._drawFirst;_;_=_.next)h=_.layer,h.options.interactive&&h._containsPoint(u)&&(m=h);m!==this._hoveredLayer&&(this._handleMouseOut(o),m&&(Zt(this._container,"leaflet-interactive"),this._fireEvent([m],o,"mouseover"),this._hoveredLayer=m)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,o),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(o,u,h){this._map._fireDOMEvent(u,h||u.type,o)},_bringToFront:function(o){var u=o._order;if(u){var h=u.next,m=u.prev;if(h)h.prev=m;else return;m?m.next=h:h&&(this._drawFirst=h),u.prev=this._drawLast,this._drawLast.next=u,u.next=null,this._drawLast=u,this._requestRedraw(o)}},_bringToBack:function(o){var u=o._order;if(u){var h=u.next,m=u.prev;if(m)m.next=h;else return;h?h.prev=m:m&&(this._drawLast=m),u.prev=null,u.next=this._drawFirst,this._drawFirst.prev=u,this._drawFirst=u,this._requestRedraw(o)}}});function Z_(o){return It.canvas?new H_(o):null}var lc=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(o){return document.createElement("<lvml:"+o+' class="lvml">')}}catch{}return function(o){return document.createElement("<"+o+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),uP={_initContainer:function(){this._container=le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ro.prototype._update.call(this),this.fire("update"))},_initPath:function(o){var u=o._container=lc("shape");Zt(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",o._path=lc("path"),u.appendChild(o._path),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){var u=o._container;this._container.appendChild(u),o.options.interactive&&o.addInteractiveTarget(u)},_removePath:function(o){var u=o._container;Be(u),o.removeInteractiveTarget(u),delete this._layers[c(o)]},_updateStyle:function(o){var u=o._stroke,h=o._fill,m=o.options,_=o._container;_.stroked=!!m.stroke,_.filled=!!m.fill,m.stroke?(u||(u=o._stroke=lc("stroke")),_.appendChild(u),u.weight=m.weight+"px",u.color=m.color,u.opacity=m.opacity,m.dashArray?u.dashStyle=N(m.dashArray)?m.dashArray.join(" "):m.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=m.lineCap.replace("butt","flat"),u.joinstyle=m.lineJoin):u&&(_.removeChild(u),o._stroke=null),m.fill?(h||(h=o._fill=lc("fill")),_.appendChild(h),h.color=m.fillColor||m.color,h.opacity=m.fillOpacity):h&&(_.removeChild(h),o._fill=null)},_updateCircle:function(o){var u=o._point.round(),h=Math.round(o._radius),m=Math.round(o._radiusY||h);this._setPath(o,o._empty()?"M0 0":"AL "+u.x+","+u.y+" "+h+","+m+" 0,"+65535*360)},_setPath:function(o,u){o._path.v=u},_bringToFront:function(o){Ol(o._container)},_bringToBack:function(o){Rl(o._container)}},dh=It.vml?lc:Ke,uc=ro.extend({_initContainer:function(){this._container=dh("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dh("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Be(this._container),Se(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ro.prototype._update.call(this);var o=this._bounds,u=o.getSize(),h=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,h.setAttribute("width",u.x),h.setAttribute("height",u.y)),dn(h,o.min),h.setAttribute("viewBox",[o.min.x,o.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(o){var u=o._path=dh("path");o.options.className&&Zt(u,o.options.className),o.options.interactive&&Zt(u,"leaflet-interactive"),this._updateStyle(o),this._layers[c(o)]=o},_addPath:function(o){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(o._path),o.addInteractiveTarget(o._path)},_removePath:function(o){Be(o._path),o.removeInteractiveTarget(o._path),delete this._layers[c(o)]},_updatePath:function(o){o._project(),o._update()},_updateStyle:function(o){var u=o._path,h=o.options;u&&(h.stroke?(u.setAttribute("stroke",h.color),u.setAttribute("stroke-opacity",h.opacity),u.setAttribute("stroke-width",h.weight),u.setAttribute("stroke-linecap",h.lineCap),u.setAttribute("stroke-linejoin",h.lineJoin),h.dashArray?u.setAttribute("stroke-dasharray",h.dashArray):u.removeAttribute("stroke-dasharray"),h.dashOffset?u.setAttribute("stroke-dashoffset",h.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),h.fill?(u.setAttribute("fill",h.fillColor||h.color),u.setAttribute("fill-opacity",h.fillOpacity),u.setAttribute("fill-rule",h.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(o,u){this._setPath(o,Ji(o._parts,u))},_updateCircle:function(o){var u=o._point,h=Math.max(Math.round(o._radius),1),m=Math.max(Math.round(o._radiusY),1)||h,_="a"+h+","+m+" 0 1,0 ",b=o._empty()?"M0 0":"M"+(u.x-h)+","+u.y+_+h*2+",0 "+_+-h*2+",0 ";this._setPath(o,b)},_setPath:function(o,u){o._path.setAttribute("d",u)},_bringToFront:function(o){Ol(o._path)},_bringToBack:function(o){Rl(o._path)}});It.vml&&uc.include(uP);function W_(o){return It.svg||It.vml?new uc(o):null}se.include({getRenderer:function(o){var u=o.options.renderer||this._getPaneRenderer(o.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(o){if(o==="overlayPane"||o===void 0)return!1;var u=this._paneRenderers[o];return u===void 0&&(u=this._createRenderer({pane:o}),this._paneRenderers[o]=u),u},_createRenderer:function(o){return this.options.preferCanvas&&Z_(o)||W_(o)}});var X_=Dl.extend({initialize:function(o,u){Dl.prototype.initialize.call(this,this._boundsToLatLngs(o),u)},setBounds:function(o){return this.setLatLngs(this._boundsToLatLngs(o))},_boundsToLatLngs:function(o){return o=ht(o),[o.getSouthWest(),o.getNorthWest(),o.getNorthEast(),o.getSouthEast()]}});function cP(o,u){return new X_(o,u)}uc.create=dh,uc.pointsToPath=Ji,no.geometryToLayer=oh,no.coordsToLatLng=_g,no.coordsToLatLngs=ah,no.latLngToCoords=xg,no.latLngsToCoords=lh,no.getFeature=kl,no.asFeature=uh,se.mergeOptions({boxZoom:!0});var Y_=Ts.extend({initialize:function(o){this._map=o,this._container=o._container,this._pane=o._panes.overlayPane,this._resetStateTimeout=0,o.on("unload",this._destroy,this)},addHooks:function(){qt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Be(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(o){if(!o.shiftKey||o.which!==1&&o.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),tc(),ng(),this._startPoint=this._map.mouseEventToContainerPoint(o),qt(document,{contextmenu:Ua,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(o){this._moved||(this._moved=!0,this._box=le("div","leaflet-zoom-box",this._container),Zt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(o);var u=new vt(this._point,this._startPoint),h=u.getSize();dn(this._box,u.min),this._box.style.width=h.x+"px",this._box.style.height=h.y+"px"},_finish:function(){this._moved&&(Be(this._box),en(this._container,"leaflet-crosshair")),ec(),rg(),Se(document,{contextmenu:Ua,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(o){if(!(o.which!==1&&o.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var u=new ct(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(o){o.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});se.addInitHook("addHandler","boxZoom",Y_),se.mergeOptions({doubleClickZoom:!0});var K_=Ts.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(o){var u=this._map,h=u.getZoom(),m=u.options.zoomDelta,_=o.originalEvent.shiftKey?h-m:h+m;u.options.doubleClickZoom==="center"?u.setZoom(_):u.setZoomAround(o.containerPoint,_)}});se.addInitHook("addHandler","doubleClickZoom",K_),se.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Q_=Ts.extend({addHooks:function(){if(!this._draggable){var o=this._map;this._draggable=new Do(o._mapPane,o._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),o.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),o.on("zoomend",this._onZoomEnd,this),o.whenReady(this._onZoomEnd,this))}Zt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){en(this._map._container,"leaflet-grab"),en(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var o=this._map;if(o._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=ht(this._map.options.maxBounds);this._offsetLimit=Lt(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;o.fire("movestart").fire("dragstart"),o.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(o){if(this._map.options.inertia){var u=this._lastTime=+new Date,h=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(h),this._times.push(u),this._prunePositions(u)}this._map.fire("move",o).fire("drag",o)},_prunePositions:function(o){for(;this._positions.length>1&&o-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var o=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(o).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(o,u){return o-(o-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var o=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;o.x<u.min.x&&(o.x=this._viscousLimit(o.x,u.min.x)),o.y<u.min.y&&(o.y=this._viscousLimit(o.y,u.min.y)),o.x>u.max.x&&(o.x=this._viscousLimit(o.x,u.max.x)),o.y>u.max.y&&(o.y=this._viscousLimit(o.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(o)}},_onPreDragWrap:function(){var o=this._worldWidth,u=Math.round(o/2),h=this._initialWorldOffset,m=this._draggable._newPos.x,_=(m-u+h)%o+u-h,b=(m+u+h)%o-u-h,O=Math.abs(_+h)<Math.abs(b+h)?_:b;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=O},_onDragEnd:function(o){var u=this._map,h=u.options,m=!h.inertia||o.noInertia||this._times.length<2;if(u.fire("dragend",o),m)u.fire("moveend");else{this._prunePositions(+new Date);var _=this._lastPos.subtract(this._positions[0]),b=(this._lastTime-this._times[0])/1e3,O=h.easeLinearity,j=_.multiplyBy(O/b),Z=j.distanceTo([0,0]),et=Math.min(h.inertiaMaxSpeed,Z),xt=j.multiplyBy(et/Z),Dt=et/(h.inertiaDeceleration*O),Kt=xt.multiplyBy(-Dt/2).round();!Kt.x&&!Kt.y?u.fire("moveend"):(Kt=u._limitOffset(Kt,u.options.maxBounds),J(function(){u.panBy(Kt,{duration:Dt,easeLinearity:O,noMoveStart:!0,animate:!0})}))}}});se.addInitHook("addHandler","dragging",Q_),se.mergeOptions({keyboard:!0,keyboardPanDelta:80});var J_=Ts.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(o){this._map=o,this._setPanDelta(o.options.keyboardPanDelta),this._setZoomDelta(o.options.zoomDelta)},addHooks:function(){var o=this._map._container;o.tabIndex<=0&&(o.tabIndex="0"),qt(o,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Se(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var o=document.body,u=document.documentElement,h=o.scrollTop||u.scrollTop,m=o.scrollLeft||u.scrollLeft;this._map._container.focus(),window.scrollTo(m,h)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(o){var u=this._panKeys={},h=this.keyCodes,m,_;for(m=0,_=h.left.length;m<_;m++)u[h.left[m]]=[-1*o,0];for(m=0,_=h.right.length;m<_;m++)u[h.right[m]]=[o,0];for(m=0,_=h.down.length;m<_;m++)u[h.down[m]]=[0,o];for(m=0,_=h.up.length;m<_;m++)u[h.up[m]]=[0,-1*o]},_setZoomDelta:function(o){var u=this._zoomKeys={},h=this.keyCodes,m,_;for(m=0,_=h.zoomIn.length;m<_;m++)u[h.zoomIn[m]]=o;for(m=0,_=h.zoomOut.length;m<_;m++)u[h.zoomOut[m]]=-o},_addHooks:function(){qt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Se(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(o){if(!(o.altKey||o.ctrlKey||o.metaKey)){var u=o.keyCode,h=this._map,m;if(u in this._panKeys){if(!h._panAnim||!h._panAnim._inProgress)if(m=this._panKeys[u],o.shiftKey&&(m=tt(m).multiplyBy(3)),h.options.maxBounds&&(m=h._limitOffset(tt(m),h.options.maxBounds)),h.options.worldCopyJump){var _=h.wrapLatLng(h.unproject(h.project(h.getCenter()).add(m)));h.panTo(_)}else h.panBy(m)}else if(u in this._zoomKeys)h.setZoom(h.getZoom()+(o.shiftKey?3:1)*this._zoomKeys[u]);else if(u===27&&h._popup&&h._popup.options.closeOnEscapeKey)h.closePopup();else return;Ua(o)}}});se.addInitHook("addHandler","keyboard",J_),se.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var $_=Ts.extend({addHooks:function(){qt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Se(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(o){var u=S_(o),h=this._map.options.wheelDebounceTime;this._delta+=u,this._lastMousePos=this._map.mouseEventToContainerPoint(o),this._startTime||(this._startTime=+new Date);var m=Math.max(h-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),m),Ua(o)},_performZoom:function(){var o=this._map,u=o.getZoom(),h=this._map.options.zoomSnap||0;o._stop();var m=this._delta/(this._map.options.wheelPxPerZoomLevel*4),_=4*Math.log(2/(1+Math.exp(-Math.abs(m))))/Math.LN2,b=h?Math.ceil(_/h)*h:_,O=o._limitZoom(u+(this._delta>0?b:-b))-u;this._delta=0,this._startTime=null,O&&(o.options.scrollWheelZoom==="center"?o.setZoom(u+O):o.setZoomAround(this._lastMousePos,u+O))}});se.addInitHook("addHandler","scrollWheelZoom",$_);var fP=600;se.mergeOptions({tapHold:It.touchNative&&It.safari&&It.mobile,tapTolerance:15});var t0=Ts.extend({addHooks:function(){qt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Se(this._map._container,"touchstart",this._onDown,this)},_onDown:function(o){if(clearTimeout(this._holdTimeout),o.touches.length===1){var u=o.touches[0];this._startPos=this._newPos=new z(u.clientX,u.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(qt(document,"touchend",Kn),qt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),fP),qt(document,"touchend touchcancel contextmenu",this._cancel,this),qt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function o(){Se(document,"touchend",Kn),Se(document,"touchend touchcancel",o)},_cancel:function(){clearTimeout(this._holdTimeout),Se(document,"touchend touchcancel contextmenu",this._cancel,this),Se(document,"touchmove",this._onMove,this)},_onMove:function(o){var u=o.touches[0];this._newPos=new z(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(o,u){var h=new MouseEvent(o,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});h._simulated=!0,u.target.dispatchEvent(h)}});se.addInitHook("addHandler","tapHold",t0),se.mergeOptions({touchZoom:It.touch,bounceAtZoomLimits:!0});var e0=Ts.extend({addHooks:function(){Zt(this._map._container,"leaflet-touch-zoom"),qt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){en(this._map._container,"leaflet-touch-zoom"),Se(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(o){var u=this._map;if(!(!o.touches||o.touches.length!==2||u._animatingZoom||this._zooming)){var h=u.mouseEventToContainerPoint(o.touches[0]),m=u.mouseEventToContainerPoint(o.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(h.add(m)._divideBy(2))),this._startDist=h.distanceTo(m),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),qt(document,"touchmove",this._onTouchMove,this),qt(document,"touchend touchcancel",this._onTouchEnd,this),Kn(o)}},_onTouchMove:function(o){if(!(!o.touches||o.touches.length!==2||!this._zooming)){var u=this._map,h=u.mouseEventToContainerPoint(o.touches[0]),m=u.mouseEventToContainerPoint(o.touches[1]),_=h.distanceTo(m)/this._startDist;if(this._zoom=u.getScaleZoom(_,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoom<u.getMinZoom()&&_<1||this._zoom>u.getMaxZoom()&&_>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,_===1)return}else{var b=h._add(m)._divideBy(2)._subtract(this._centerPoint);if(_===1&&b.x===0&&b.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(b),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),W(this._animRequest);var O=a(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=J(O,this,!0),Kn(o)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,W(this._animRequest),Se(document,"touchmove",this._onTouchMove,this),Se(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))}});se.addInitHook("addHandler","touchZoom",e0),se.BoxZoom=Y_,se.DoubleClickZoom=K_,se.Drag=Q_,se.Keyboard=J_,se.ScrollWheelZoom=$_,se.TapHold=t0,se.TouchZoom=e0,n.Bounds=vt,n.Browser=It,n.CRS=Gt,n.Canvas=H_,n.Circle=yg,n.CircleMarker=sh,n.Class=D,n.Control=es,n.DivIcon=V_,n.DivOverlay=Os,n.DomEvent=IN,n.DomUtil=bN,n.Draggable=Do,n.Evented=yt,n.FeatureGroup=to,n.GeoJSON=no,n.GridLayer=ac,n.Handler=Ts,n.Icon=Al,n.ImageOverlay=ch,n.LatLng=_t,n.LatLngBounds=ct,n.Layer=ns,n.LayerGroup=Ml,n.LineUtil=VN,n.Map=se,n.Marker=ih,n.Mixin=kN,n.Path=ko,n.Point=z,n.PolyUtil=FN,n.Polygon=Dl,n.Polyline=eo,n.Popup=fh,n.PosAnimation=C_,n.Projection=GN,n.Rectangle=X_,n.Renderer=ro,n.SVG=uc,n.SVGOverlay=U_,n.TileLayer=Fl,n.Tooltip=hh,n.Transformation=Je,n.Util=$,n.VideoOverlay=B_,n.bind=a,n.bounds=Lt,n.canvas=Z_,n.circle=QN,n.circleMarker=KN,n.control=ic,n.divIcon=oP,n.extend=i,n.featureGroup=WN,n.geoJSON=z_,n.geoJson=tP,n.gridLayer=aP,n.icon=XN,n.imageOverlay=eP,n.latLng=wt,n.latLngBounds=ht,n.layerGroup=ZN,n.map=TN,n.marker=YN,n.point=tt,n.polygon=$N,n.polyline=JN,n.popup=iP,n.rectangle=cP,n.setOptions=S,n.stamp=c,n.svg=W_,n.svgOverlay=rP,n.tileLayer=G_,n.tooltip=sP,n.transformation=De,n.version=r,n.videoOverlay=nP;var hP=window.L;n.noConflict=function(){return window.L=hP,this},window.L=n})})(wv,wv.exports);var Fr=wv.exports;function Ff(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function Mp(e,t){return t==null?function(r,i){const s=P.useRef();return s.current||(s.current=e(r,i)),s}:function(r,i){const s=P.useRef();s.current||(s.current=e(r,i));const a=P.useRef(r),{instance:l}=s.current;return P.useEffect(function(){a.current!==r&&(t(l,r,a.current),a.current=r)},[l,r,i]),s}}function CC(e,t){P.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var s;(s=t.layerContainer)==null||s.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function NC(e){return function(n){const r=Op(),i=e(Rp(n,r),r);return xC(r.map,n.attribution),Jy(i.current,n.eventHandlers),CC(i.current,r),i}}function MM(e,t){const n=P.useRef();P.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function AM(e){return function(n){const r=Op(),i=e(Rp(n,r),r);return Jy(i.current,n.eventHandlers),CC(i.current,r),MM(i.current,n),i}}function DM(e,t){const n=Mp(e,t),r=NC(n);return SC(r)}function kM(e,t){const n=Mp(e),r=RM(n,t);return TM(r)}function PC(e,t){const n=Mp(e,t),r=AM(n);return SC(r)}function FM(e,t){const n=Mp(e,t),r=NC(n);return OM(r)}function jM(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function $y(){return Op().map}function bC(e){const t=$y();return P.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}function Ev(){return Ev=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ev.apply(this,arguments)}function zM({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:s,placeholder:a,style:l,whenReady:c,zoom:f,...g},d){const[v]=P.useState({className:i,id:s,style:l}),[y,x]=P.useState(null);P.useImperativeHandle(d,()=>(y==null?void 0:y.map)??null,[y]);const S=P.useCallback(E=>{if(E!==null&&y===null){const w=new Fr.Map(E,g);n!=null&&f!=null?w.setView(n,f):e!=null&&w.fitBounds(e,t),c!=null&&w.whenReady(c),x(IM(w))}},[]);P.useEffect(()=>()=>{y==null||y.map.remove()},[y]);const C=y?ye.createElement(EC,{value:y},r):a??null;return ye.createElement("div",Ev({},v,{ref:S}),C)}const LC=P.forwardRef(zM),$a=DM(function({position:t,...n},r){const i=new Fr.Marker(t,n);return Ff(i,Qy(r,{overlayContainer:i}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),Vd=PC(function({positions:t,...n},r){const i=new Fr.Polygon(t,n);return Ff(i,Qy(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),sd=PC(function({positions:t,...n},r){const i=new Fr.Polyline(t,n);return Ff(i,Qy(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Sv=kM(function(t,n){const r=new Fr.Popup(t,n.overlayContainer);return Ff(r,n)},function(t,n,{position:r},i){P.useEffect(function(){const{instance:a}=t;function l(f){f.popup===a&&(a.update(),i(!0))}function c(f){f.popup===a&&i(!1)}return n.map.on({popupopen:l,popupclose:c}),n.overlayContainer==null?(r!=null&&a.setLatLng(r),a.openOn(n.map)):n.overlayContainer.bindPopup(a),function(){var g;n.map.off({popupopen:l,popupclose:c}),(g=n.overlayContainer)==null||g.unbindPopup(),n.map.removeLayer(a)}},[t,n,i,r])}),IC=FM(function({url:t,...n},r){const i=new Fr.TileLayer(t,Rp(n,r));return Ff(i,r)},function(t,n,r){jM(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)});var Er=63710088e-1,TC={centimeters:Er*100,centimetres:Er*100,degrees:Er/111325,feet:Er*3.28084,inches:Er*39.37,kilometers:Er/1e3,kilometres:Er/1e3,meters:Er,metres:Er,miles:Er/1609.344,millimeters:Er*1e3,millimetres:Er*1e3,nauticalmiles:Er/1852,radians:1,yards:Er*1.0936};function jf(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function BM(e,t,n){if(n===void 0&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hw(e[0])||!hw(e[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:e};return jf(r,t,n)}function Ap(e,t,n){n===void 0&&(n={});for(var r=0,i=e;r<i.length;r++){var s=i[r];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:e};return jf(l,t,n)}function UM(e,t,n){if(n===void 0&&(n={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:e};return jf(r,t,n)}function Cv(e,t){t===void 0&&(t={});var n={type:"FeatureCollection"};return t.id&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.features=e,n}function OC(e,t,n){n===void 0&&(n={});var r={type:"MultiPolygon",coordinates:e};return jf(r,t,n)}function VM(e,t){var n=TC[t];return e*n}function GM(e,t){t===void 0&&(t="kilometers");var n=TC[t];if(!n)throw new Error(t+" units is invalid");return e/n}function hw(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function RC(e,t,n){if(e!==null)for(var r,i,s,a,l,c,f,g=0,d=0,v,y=e.type,x=y==="FeatureCollection",S=y==="Feature",C=x?e.features.length:1,E=0;E<C;E++){f=x?e.features[E].geometry:S?e.geometry:e,v=f?f.type==="GeometryCollection":!1,l=v?f.geometries.length:1;for(var w=0;w<l;w++){var N=0,I=0;if(a=v?f.geometries[w]:f,a!==null){c=a.coordinates;var R=a.type;switch(g=0,R){case null:break;case"Point":if(t(c,d,E,N,I)===!1)return!1;d++,N++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(t(c[r],d,E,N,I)===!1)return!1;d++,R==="MultiPoint"&&N++}R==="LineString"&&N++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(i=0;i<c[r].length-g;i++){if(t(c[r][i],d,E,N,I)===!1)return!1;d++}R==="MultiLineString"&&N++,R==="Polygon"&&I++}R==="Polygon"&&N++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(I=0,i=0;i<c[r].length;i++){for(s=0;s<c[r][i].length-g;s++){if(t(c[r][i][s],d,E,N,I)===!1)return!1;d++}I++}N++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(RC(a.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function dw(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var n=0;n<e.features.length&&t(e.features[n],n)!==!1;n++);}function t_(e,t){var n,r,i,s,a,l,c,f,g,d,v=0,y=e.type==="FeatureCollection",x=e.type==="Feature",S=y?e.features.length:1;for(n=0;n<S;n++){for(l=y?e.features[n].geometry:x?e.geometry:e,f=y?e.features[n].properties:x?e.properties:{},g=y?e.features[n].bbox:x?e.bbox:void 0,d=y?e.features[n].id:x?e.id:void 0,c=l?l.type==="GeometryCollection":!1,a=c?l.geometries.length:1,i=0;i<a;i++){if(s=c?l.geometries[i]:l,s===null){if(t(null,v,f,g,d)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,v,f,g,d)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(t(s.geometries[r],v,f,g,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function qM(e,t,n){var r=n;return t_(e,function(i,s,a,l,c){r=t(r,i,s,a,l,c)}),r}function Nv(e){var t=[1/0,1/0,-1/0,-1/0];return RC(e,function(n){t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}Nv.default=Nv;function Gd(e){return e.type==="Feature"?e.geometry:e}const fo=11102230246251565e-32,cr=134217729,HM=(3+8*fo)*fo;function om(e,t,n,r,i){let s,a,l,c,f=t[0],g=r[0],d=0,v=0;g>f==g>-f?(s=f,f=t[++d]):(s=g,g=r[++v]);let y=0;if(d<e&&v<n)for(g>f==g>-f?(a=f+s,l=s-(a-f),f=t[++d]):(a=g+s,l=s-(a-g),g=r[++v]),s=a,l!==0&&(i[y++]=l);d<e&&v<n;)g>f==g>-f?(a=s+f,c=a-s,l=s-(a-c)+(f-c),f=t[++d]):(a=s+g,c=a-s,l=s-(a-c)+(g-c),g=r[++v]),s=a,l!==0&&(i[y++]=l);for(;d<e;)a=s+f,c=a-s,l=s-(a-c)+(f-c),f=t[++d],s=a,l!==0&&(i[y++]=l);for(;v<n;)a=s+g,c=a-s,l=s-(a-c)+(g-c),g=r[++v],s=a,l!==0&&(i[y++]=l);return(s!==0||y===0)&&(i[y++]=s),y}function ZM(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function zf(e){return new Float64Array(e)}const WM=(3+16*fo)*fo,XM=(2+12*fo)*fo,YM=(9+64*fo)*fo*fo,Vl=zf(4),pw=zf(8),gw=zf(12),mw=zf(16),wr=zf(4);function KM(e,t,n,r,i,s,a){let l,c,f,g,d,v,y,x,S,C,E,w,N,I,R,A,B,q;const Q=e-i,Y=n-i,J=t-s,W=r-s;I=Q*W,v=cr*Q,y=v-(v-Q),x=Q-y,v=cr*W,S=v-(v-W),C=W-S,R=x*C-(I-y*S-x*S-y*C),A=J*Y,v=cr*J,y=v-(v-J),x=J-y,v=cr*Y,S=v-(v-Y),C=Y-S,B=x*C-(A-y*S-x*S-y*C),E=R-B,d=R-E,Vl[0]=R-(E+d)+(d-B),w=I+E,d=w-I,N=I-(w-d)+(E-d),E=N-A,d=N-E,Vl[1]=N-(E+d)+(d-A),q=w+E,d=q-w,Vl[2]=w-(q-d)+(E-d),Vl[3]=q;let $=ZM(4,Vl),D=XM*a;if($>=D||-$>=D||(d=e-Q,l=e-(Q+d)+(d-i),d=n-Y,f=n-(Y+d)+(d-i),d=t-J,c=t-(J+d)+(d-s),d=r-W,g=r-(W+d)+(d-s),l===0&&c===0&&f===0&&g===0)||(D=YM*a+HM*Math.abs($),$+=Q*g+W*l-(J*f+Y*c),$>=D||-$>=D))return $;I=l*W,v=cr*l,y=v-(v-l),x=l-y,v=cr*W,S=v-(v-W),C=W-S,R=x*C-(I-y*S-x*S-y*C),A=c*Y,v=cr*c,y=v-(v-c),x=c-y,v=cr*Y,S=v-(v-Y),C=Y-S,B=x*C-(A-y*S-x*S-y*C),E=R-B,d=R-E,wr[0]=R-(E+d)+(d-B),w=I+E,d=w-I,N=I-(w-d)+(E-d),E=N-A,d=N-E,wr[1]=N-(E+d)+(d-A),q=w+E,d=q-w,wr[2]=w-(q-d)+(E-d),wr[3]=q;const ut=om(4,Vl,4,wr,pw);I=Q*g,v=cr*Q,y=v-(v-Q),x=Q-y,v=cr*g,S=v-(v-g),C=g-S,R=x*C-(I-y*S-x*S-y*C),A=J*f,v=cr*J,y=v-(v-J),x=J-y,v=cr*f,S=v-(v-f),C=f-S,B=x*C-(A-y*S-x*S-y*C),E=R-B,d=R-E,wr[0]=R-(E+d)+(d-B),w=I+E,d=w-I,N=I-(w-d)+(E-d),E=N-A,d=N-E,wr[1]=N-(E+d)+(d-A),q=w+E,d=q-w,wr[2]=w-(q-d)+(E-d),wr[3]=q;const it=om(ut,pw,4,wr,gw);I=l*g,v=cr*l,y=v-(v-l),x=l-y,v=cr*g,S=v-(v-g),C=g-S,R=x*C-(I-y*S-x*S-y*C),A=c*f,v=cr*c,y=v-(v-c),x=c-y,v=cr*f,S=v-(v-f),C=f-S,B=x*C-(A-y*S-x*S-y*C),E=R-B,d=R-E,wr[0]=R-(E+d)+(d-B),w=I+E,d=w-I,N=I-(w-d)+(E-d),E=N-A,d=N-E,wr[1]=N-(E+d)+(d-A),q=w+E,d=q-w,wr[2]=w-(q-d)+(E-d),wr[3]=q;const yt=om(it,gw,4,wr,mw);return mw[yt-1]}function QM(e,t,n,r,i,s){const a=(t-s)*(n-i),l=(e-i)*(r-s),c=a-l,f=Math.abs(a+l);return Math.abs(c)>=WM*f?c:-KM(e,t,n,r,i,s,f)}function JM(e,t){t===void 0&&(t={});var n=Nv(e),r=(n[0]+n[2])/2,i=(n[1]+n[3])/2;return BM([r,i],t.properties,t)}var vw=6378137;function MC(e){return qM(e,function(t,n){return t+$M(n)},0)}function $M(e){var t=0,n;switch(e.type){case"Polygon":return yw(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)t+=yw(e.coordinates[n]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function yw(e){var t=0;if(e&&e.length>0){t+=Math.abs(_w(e[0]));for(var n=1;n<e.length;n++)t-=Math.abs(_w(e[n]))}return t}function _w(e){var t,n,r,i,s,a,l,c=0,f=e.length;if(f>2){for(l=0;l<f;l++)l===f-2?(i=f-2,s=f-1,a=0):l===f-1?(i=f-1,s=0,a=1):(i=l,s=l+1,a=l+2),t=e[i],n=e[s],r=e[a],c+=(am(r[0])-am(t[0]))*Math.sin(am(n[1]));c=c*vw*vw/2}return c}function am(e){return e*Math.PI/180}class da{constructor(t,n){this.next=null,this.key=t,this.data=n,this.left=null,this.right=null}}function tA(e,t){return e>t?1:e<t?-1:0}function Xo(e,t,n){const r=new da(null,null);let i=r,s=r;for(;;){const a=n(e,t.key);if(a<0){if(t.left===null)break;if(n(e,t.left.key)<0){const l=t.left;if(t.left=l.right,l.right=t,t=l,t.left===null)break}s.left=t,s=t,t=t.left}else if(a>0){if(t.right===null)break;if(n(e,t.right.key)>0){const l=t.right;if(t.right=l.left,l.left=t,t=l,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,s.left=t.right,t.left=r.right,t.right=r.left,t}function lm(e,t,n,r){const i=new da(e,t);if(n===null)return i.left=i.right=null,i;n=Xo(e,n,r);const s=r(e,n.key);return s<0?(i.left=n.left,i.right=n,n.left=null):s>=0&&(i.right=n.right,i.left=n,n.right=null),i}function xw(e,t,n){let r=null,i=null;if(t){t=Xo(e,t,n);const s=n(t.key,e);s===0?(r=t.left,i=t.right):s<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function eA(e,t,n){return t===null?e:(e===null||(t=Xo(e.key,t,n),t.left=e),t)}function Pv(e,t,n,r,i){if(e){r(`${t}${n?"└── ":"├── "}${i(e)}
`);const s=t+(n?" ":"│ ");e.left&&Pv(e.left,s,!1,r,i),e.right&&Pv(e.right,s,!0,r,i)}}class e_{constructor(t=tA){this._root=null,this._size=0,this._comparator=t}insert(t,n){return this._size++,this._root=lm(t,n,this._root,this._comparator)}add(t,n){const r=new da(t,n);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);const i=this._comparator,s=Xo(t,this._root,i),a=i(t,s.key);return a===0?this._root=s:(a<0?(r.left=s.left,r.right=s,s.left=null):a>0&&(r.right=s.right,r.left=s,s.right=null),this._size++,this._root=r),this._root}remove(t){this._root=this._remove(t,this._root,this._comparator)}_remove(t,n,r){let i;return n===null?null:(n=Xo(t,n,r),r(t,n.key)===0?(n.left===null?i=n.right:(i=Xo(t,n.left,r),i.right=n.right),this._size--,i):n)}pop(){let t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Xo(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null}findStatic(t){let n=this._root;const r=this._comparator;for(;n;){const i=r(t,n.key);if(i===0)return n;i<0?n=n.left:n=n.right}return null}find(t){return this._root&&(this._root=Xo(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root}contains(t){let n=this._root;const r=this._comparator;for(;n;){const i=r(t,n.key);if(i===0)return!0;i<0?n=n.left:n=n.right}return!1}forEach(t,n){let r=this._root;const i=[];let s=!1;for(;!s;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(n,r),r=r.right):s=!0;return this}range(t,n,r,i){const s=[],a=this._comparator;let l=this._root,c;for(;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=a(l.key,n),c>0)break;if(a(l.key,t)>=0&&r.call(i,l))return this;l=l.right}return this}keys(){const t=[];return this.forEach(({key:n})=>{t.push(n)}),t}values(){const t=[];return this.forEach(({data:n})=>{t.push(n)}),t}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(t=this._root){if(t)for(;t.left;)t=t.left;return t}maxNode(t=this._root){if(t)for(;t.right;)t=t.right;return t}at(t){let n=this._root,r=!1,i=0;const s=[];for(;!r;)if(n)s.push(n),n=n.left;else if(s.length>0){if(n=s.pop(),i===t)return n;i++,n=n.right}else r=!0;return null}next(t){let n=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}const i=this._comparator;for(;n;){const s=i(t.key,n.key);if(s===0)break;s<0?(r=n,n=n.left):n=n.right}return r}prev(t){let n=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}const i=this._comparator;for(;n;){const s=i(t.key,n.key);if(s===0)break;s<0?n=n.left:(r=n,n=n.right)}return r}clear(){return this._root=null,this._size=0,this}toList(){return rA(this._root)}load(t,n=[],r=!1){let i=t.length;const s=this._comparator;if(r&&Iv(t,n,0,i-1,s),this._root===null)this._root=bv(t,n,0,i),this._size=i;else{const a=iA(this.toList(),nA(t,n),s);i=this._size+i,this._root=Lv({head:a},0,i)}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(t=n=>String(n.key)){const n=[];return Pv(this._root,"",!0,r=>n.push(r),t),n.join("")}update(t,n,r){const i=this._comparator;let{left:s,right:a}=xw(t,this._root,i);i(t,n)<0?a=lm(n,r,a,i):s=lm(n,r,s,i),this._root=eA(s,a,i)}split(t){return xw(t,this._root,this._comparator)}*[Symbol.iterator](){let t=this._root;const n=[];let r=!1;for(;!r;)t!==null?(n.push(t),t=t.left):n.length!==0?(t=n.pop(),yield t,t=t.right):r=!0}}function bv(e,t,n,r){const i=r-n;if(i>0){const s=n+Math.floor(i/2),a=e[s],l=t[s],c=new da(a,l);return c.left=bv(e,t,n,s),c.right=bv(e,t,s+1,r),c}return null}function nA(e,t){const n=new da(null,null);let r=n;for(let i=0;i<e.length;i++)r=r.next=new da(e[i],t[i]);return r.next=null,n.next}function rA(e){let t=e;const n=[];let r=!1;const i=new da(null,null);let s=i;for(;!r;)t?(n.push(t),t=t.left):n.length>0?(t=s=s.next=n.pop(),t=t.right):r=!0;return s.next=null,i.next}function Lv(e,t,n){const r=n-t;if(r>0){const i=t+Math.floor(r/2),s=Lv(e,t,i),a=e.head;return a.left=s,e.head=e.head.next,a.right=Lv(e,i+1,n),a}return null}function iA(e,t,n){const r=new da(null,null);let i=r,s=e,a=t;for(;s!==null&&a!==null;)n(s.key,a.key)<0?(i.next=s,s=s.next):(i.next=a,a=a.next),i=i.next;return s!==null?i.next=s:a!==null&&(i.next=a),r.next}function Iv(e,t,n,r,i){if(n>=r)return;const s=e[n+r>>1];let a=n-1,l=r+1;for(;;){do a++;while(i(e[a],s)<0);do l--;while(i(e[l],s)>0);if(a>=l)break;let c=e[a];e[a]=e[l],e[l]=c,c=t[a],t[a]=t[l],t[l]=c}Iv(e,t,n,l,i),Iv(e,t,l+1,r,i)}var AC={};const xc=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,Tv=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;const n=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x,i=e.ll.y<t.ll.y?t.ll.y:e.ll.y,s=e.ur.y<t.ur.y?e.ur.y:t.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:s}}};let Jo=Number.EPSILON;Jo===void 0&&(Jo=Math.pow(2,-52));const sA=Jo*Jo,ww=(e,t)=>{if(-Jo<e&&e<Jo&&-Jo<t&&t<Jo)return 0;const n=e-t;return n*n<sA*e*t?0:e<t?-1:1};class oA{constructor(){this.reset()}reset(){this.xRounder=new Ew,this.yRounder=new Ew}round(t,n){return{x:this.xRounder.round(t),y:this.yRounder.round(n)}}}class Ew{constructor(){this.tree=new e_,this.round(0)}round(t){const n=this.tree.add(t),r=this.tree.prev(n);if(r!==null&&ww(n.key,r.key)===0)return this.tree.remove(t),r.key;const i=this.tree.next(n);return i!==null&&ww(n.key,i.key)===0?(this.tree.remove(t),i.key):t}}const cf=new oA,od=(e,t)=>e.x*t.y-e.y*t.x,DC=(e,t)=>e.x*t.x+e.y*t.y,Sw=(e,t,n)=>{const r=QM(e.x,e.y,t.x,t.y,n.x,n.y);return r>0?-1:r<0?1:0},qd=e=>Math.sqrt(DC(e,e)),aA=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return od(i,r)/qd(i)/qd(r)},lA=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return DC(i,r)/qd(i)/qd(r)},Cw=(e,t,n)=>t.y===0?null:{x:e.x+t.x/t.y*(n-e.y),y:n},Nw=(e,t,n)=>t.x===0?null:{x:n,y:e.y+t.y/t.x*(n-e.x)},uA=(e,t,n,r)=>{if(t.x===0)return Nw(n,r,e.x);if(r.x===0)return Nw(e,t,n.x);if(t.y===0)return Cw(n,r,e.y);if(r.y===0)return Cw(e,t,n.y);const i=od(t,r);if(i==0)return null;const s={x:n.x-e.x,y:n.y-e.y},a=od(s,t)/i,l=od(s,r)/i,c=e.x+l*t.x,f=n.x+a*r.x,g=e.y+l*t.y,d=n.y+a*r.y,v=(c+f)/2,y=(g+d)/2;return{x:v,y}};class Ti{static compare(t,n){const r=Ti.comparePoints(t.point,n.point);return r!==0?r:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:la.compare(t.segment,n.segment))}static comparePoints(t,n){return t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0}constructor(t,n){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=n}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const n=t.point.events;for(let r=0,i=n.length;r<i;r++){const s=n[r];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let n=0;n<t;n++){const r=this.point.events[n];if(r.segment.consumedBy===void 0)for(let i=n+1;i<t;i++){const s=this.point.events[i];s.consumedBy===void 0&&r.otherSE.point.events===s.otherSE.point.events&&r.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const t=[];for(let n=0,r=this.point.events.length;n<r;n++){const i=this.point.events[n];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const n=new Map,r=i=>{const s=i.otherSE;n.set(i,{sine:aA(this.point,t.point,s.point),cosine:lA(this.point,t.point,s.point)})};return(i,s)=>{n.has(i)||r(i),n.has(s)||r(s);const{sine:a,cosine:l}=n.get(i),{sine:c,cosine:f}=n.get(s);return a>=0&&c>=0?l<f?1:l>f?-1:0:a<0&&c<0?l<f?-1:l>f?1:0:c<a?-1:c>a?1:0}}}let cA=0;class la{static compare(t,n){const r=t.leftSE.point.x,i=n.leftSE.point.x,s=t.rightSE.point.x,a=n.rightSE.point.x;if(a<r)return 1;if(s<i)return-1;const l=t.leftSE.point.y,c=n.leftSE.point.y,f=t.rightSE.point.y,g=n.rightSE.point.y;if(r<i){if(c<l&&c<f)return 1;if(c>l&&c>f)return-1;const d=t.comparePoint(n.leftSE.point);if(d<0)return 1;if(d>0)return-1;const v=n.comparePoint(t.rightSE.point);return v!==0?v:-1}if(r>i){if(l<c&&l<g)return-1;if(l>c&&l>g)return 1;const d=n.comparePoint(t.leftSE.point);if(d!==0)return d;const v=t.comparePoint(n.rightSE.point);return v<0?1:v>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<a){const d=n.comparePoint(t.rightSE.point);if(d!==0)return d}if(s>a){const d=t.comparePoint(n.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(s!==a){const d=f-l,v=s-r,y=g-c,x=a-i;if(d>v&&y<x)return 1;if(d<v&&y>x)return-1}return s>a?1:s<a||f<g?-1:f>g?1:t.id<n.id?-1:t.id>n.id?1:0}constructor(t,n,r,i){this.id=++cA,this.leftSE=t,t.segment=this,t.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=t,this.rings=r,this.windings=i}static fromRing(t,n,r){let i,s,a;const l=Ti.comparePoints(t,n);if(l<0)i=t,s=n,a=1;else if(l>0)i=n,s=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new Ti(i,!0),f=new Ti(s,!1);return new la(c,f,[r],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<n?t:n},ur:{x:this.rightSE.point.x,y:t>n?t:n}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const n=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(n.x===r.x)return t.x===n.x?0:t.x<n.x?1:-1;const s=(t.y-n.y)/i.y,a=n.x+s*i.x;if(t.x===a)return 0;const l=(t.x-n.x)/i.x,c=n.y+l*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const n=this.bbox(),r=t.bbox(),i=Tv(n,r);if(i===null)return null;const s=this.leftSE.point,a=this.rightSE.point,l=t.leftSE.point,c=t.rightSE.point,f=xc(n,l)&&this.comparePoint(l)===0,g=xc(r,s)&&t.comparePoint(s)===0,d=xc(n,c)&&this.comparePoint(c)===0,v=xc(r,a)&&t.comparePoint(a)===0;if(g&&f)return v&&!d?a:!v&&d?c:null;if(g)return d&&s.x===c.x&&s.y===c.y?null:s;if(f)return v&&a.x===l.x&&a.y===l.y?null:l;if(v&&d)return null;if(v)return a;if(d)return c;const y=uA(s,this.vector(),l,t.vector());return y===null||!xc(i,y)?null:cf.round(y.x,y.y)}split(t){const n=[],r=t.events!==void 0,i=new Ti(t,!0),s=new Ti(t,!1),a=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(i);const l=new la(i,a,this.rings.slice(),this.windings.slice());return Ti.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),Ti.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),s.checkForConsuming()),n}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let n=0,r=this.windings.length;n<r;n++)this.windings[n]*=-1}consume(t){let n=this,r=t;for(;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;const i=la.compare(n,r);if(i!==0){if(i>0){const s=n;n=r,r=s}if(n.prev===r){const s=n;n=r,r=s}for(let s=0,a=r.rings.length;s<a;s++){const l=r.rings[s],c=r.windings[s],f=n.rings.indexOf(l);f===-1?(n.rings.push(l),n.windings.push(c)):n.windings[f]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const n=this._afterState.rings,r=this._afterState.windings,i=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const f=this.rings[l],g=this.windings[l],d=n.indexOf(f);d===-1?(n.push(f),r.push(g)):r[d]+=g}const s=[],a=[];for(let l=0,c=n.length;l<c;l++){if(r[l]===0)continue;const f=n[l],g=f.poly;if(a.indexOf(g)===-1)if(f.isExterior)s.push(g);else{a.indexOf(g)===-1&&a.push(g);const d=s.indexOf(f.poly);d!==-1&&s.splice(d,1)}}for(let l=0,c=s.length;l<c;l++){const f=s[l].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(fs.type){case"union":{const r=t.length===0,i=n.length===0;this._isInResult=r!==i;break}case"intersection":{let r,i;t.length<n.length?(r=t.length,i=n.length):(r=n.length,i=t.length),this._isInResult=i===fs.numMultiPolys&&r<i;break}case"xor":{const r=Math.abs(t.length-n.length);this._isInResult=r%2===1;break}case"difference":{const r=i=>i.length===1&&i[0].isSubject;this._isInResult=r(t)!==r(n);break}default:throw new Error(`Unrecognized operation type found ${fs.type}`)}return this._isInResult}}class Pw{constructor(t,n,r){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=cf.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let s=i;for(let a=1,l=t.length;a<l;a++){if(typeof t[a][0]!="number"||typeof t[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=cf.round(t[a][0],t[a][1]);c.x===s.x&&c.y===s.y||(this.segments.push(la.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(i.x!==s.x||i.y!==s.y)&&this.segments.push(la.fromRing(s,i,this))}getSweepEvents(){const t=[];for(let n=0,r=this.segments.length;n<r;n++){const i=this.segments[n];t.push(i.leftSE),t.push(i.rightSE)}return t}}class fA{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pw(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,i=t.length;r<i;r++){const s=new Pw(t[r],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let n=0,r=this.interiorRings.length;n<r;n++){const i=this.interiorRings[n].getSweepEvents();for(let s=0,a=i.length;s<a;s++)t.push(i[s])}return t}}class bw{constructor(t,n){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let r=0,i=t.length;r<i;r++){const s=new fA(t[r],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n}getSweepEvents(){const t=[];for(let n=0,r=this.polys.length;n<r;n++){const i=this.polys[n].getSweepEvents();for(let s=0,a=i.length;s<a;s++)t.push(i[s])}return t}}class Hd{static factory(t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];if(!s.isInResult()||s.ringOut)continue;let a=null,l=s.leftSE,c=s.rightSE;const f=[l],g=l.point,d=[];for(;a=l,l=c,f.push(l),l.point!==g;)for(;;){const v=l.getAvailableLinkedEvents();if(v.length===0){const S=f[0].point,C=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${S.x}, ${S.y}]. Last matching segment found ends at [${C.x}, ${C.y}].`)}if(v.length===1){c=v[0].otherSE;break}let y=null;for(let S=0,C=d.length;S<C;S++)if(d[S].point===l.point){y=S;break}if(y!==null){const S=d.splice(y)[0],C=f.splice(S.index);C.unshift(C[0].otherSE),n.push(new Hd(C.reverse()));continue}d.push({index:f.length,point:l.point});const x=l.getLeftmostComparator(a);c=v.sort(x)[0].otherSE;break}n.push(new Hd(f))}return n}constructor(t){this.events=t;for(let n=0,r=t.length;n<r;n++)t[n].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const n=[t];for(let f=1,g=this.events.length-1;f<g;f++){const d=this.events[f].point,v=this.events[f+1].point;Sw(d,t,v)!==0&&(n.push(d),t=d)}if(n.length===1)return null;const r=n[0],i=n[1];Sw(r,t,i)===0&&n.shift(),n.push(n[0]);const s=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:n.length-1,l=this.isExteriorRing()?n.length:-1,c=[];for(let f=a;f!=l;f+=s)c.push([n[f].x,n[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,s=this.events.length;i<s;i++){const a=this.events[i];Ti.compare(t,a)>0&&(t=a)}let n=t.segment.prevInResult(),r=n?n.prevInResult():null;for(;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}class Lw{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let n=0,r=this.interiorRings.length;n<r;n++){const i=this.interiorRings[n].getGeom();i!==null&&t.push(i)}return t}}class hA{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let n=0,r=this.polys.length;n<r;n++){const i=this.polys[n].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];if(!s.poly)if(s.isExteriorRing())n.push(new Lw(s));else{const a=s.enclosingRing();a.poly||n.push(new Lw(a)),a.poly.addInterior(s)}}return n}}class dA{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:la.compare;this.queue=t,this.tree=new e_(n),this.segments=[]}process(t){const n=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(n),r;const i=t.isLeft?this.tree.add(n):this.tree.find(n);if(!i)throw new Error(`Unable to find segment #${n.id} [${n.leftSE.point.x}, ${n.leftSE.point.y}] -> [${n.rightSE.point.x}, ${n.rightSE.point.y}] in SweepLine tree.`);let s=i,a=i,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)a=this.tree.next(a),a===null?c=null:a.key.consumedBy===void 0&&(c=a.key);if(t.isLeft){let f=null;if(l){const d=l.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(f=d),!l.isAnEndpoint(d))){const v=this._splitSafely(l,d);for(let y=0,x=v.length;y<x;y++)r.push(v[y])}}let g=null;if(c){const d=c.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(g=d),!c.isAnEndpoint(d))){const v=this._splitSafely(c,d);for(let y=0,x=v.length;y<x;y++)r.push(v[y])}}if(f!==null||g!==null){let d=null;f===null?d=g:g===null?d=f:d=Ti.comparePoints(f,g)<=0?f:g,this.queue.remove(n.rightSE),r.push(n.rightSE);const v=n.split(d);for(let y=0,x=v.length;y<x;y++)r.push(v[y])}r.length>0?(this.tree.remove(n),r.push(t)):(this.segments.push(n),n.prev=l)}else{if(l&&c){const f=l.getIntersection(c);if(f!==null){if(!l.isAnEndpoint(f)){const g=this._splitSafely(l,f);for(let d=0,v=g.length;d<v;d++)r.push(g[d])}if(!c.isAnEndpoint(f)){const g=this._splitSafely(c,f);for(let d=0,v=g.length;d<v;d++)r.push(g[d])}}}this.tree.remove(n)}return r}_splitSafely(t,n){this.tree.remove(t);const r=t.rightSE;this.queue.remove(r);const i=t.split(n);return i.push(r),t.consumedBy===void 0&&this.tree.add(t),i}}const Iw=typeof process<"u"&&AC.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,pA=typeof process<"u"&&AC.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class gA{run(t,n,r){fs.type=t,cf.reset();const i=[new bw(n,!0)];for(let d=0,v=r.length;d<v;d++)i.push(new bw(r[d],!1));if(fs.numMultiPolys=i.length,fs.type==="difference"){const d=i[0];let v=1;for(;v<i.length;)Tv(i[v].bbox,d.bbox)!==null?v++:i.splice(v,1)}if(fs.type==="intersection")for(let d=0,v=i.length;d<v;d++){const y=i[d];for(let x=d+1,S=i.length;x<S;x++)if(Tv(y.bbox,i[x].bbox)===null)return[]}const s=new e_(Ti.compare);for(let d=0,v=i.length;d<v;d++){const y=i[d].getSweepEvents();for(let x=0,S=y.length;x<S;x++)if(s.insert(y[x]),s.size>Iw)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new dA(s);let l=s.size,c=s.pop();for(;c;){const d=c.key;if(s.size===l){const y=d.segment;throw new Error(`Unable to pop() ${d.isLeft?"left":"right"} SweepEvent [${d.point.x}, ${d.point.y}] from segment #${y.id} [${y.leftSE.point.x}, ${y.leftSE.point.y}] -> [${y.rightSE.point.x}, ${y.rightSE.point.y}] from queue.`)}if(s.size>Iw)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>pA)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const v=a.process(d);for(let y=0,x=v.length;y<x;y++){const S=v[y];S.consumedBy===void 0&&s.insert(S)}l=s.size,c=s.pop()}cf.reset();const f=Hd.factory(a.segments);return new hA(f).getGeom()}}const fs=new gA,mA=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return fs.run("union",e,n)},vA=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return fs.run("intersection",e,n)},yA=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return fs.run("xor",e,n)},_A=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return fs.run("difference",e,n)};var kC={union:mA,intersection:vA,xor:yA,difference:_A};"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var n=Object(this),r=Math.max(Math.min(n.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(s=s<0?Math.max(r+arguments[2],0):Math.min(s,r);i<s;)n[i]=t,++i;return n},writable:!0});Number.isFinite=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)};Number.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};Number.parseFloat=Number.parseFloat||parseFloat;Number.isNaN=Number.isNaN||function(e){return e!==e};Math.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};var ul=function(){};ul.prototype.interfaces_=function(){return[]};ul.prototype.getClass=function(){return ul};ul.prototype.equalsWithTolerance=function(t,n,r){return Math.abs(t-n)<=r};var ve=function(e){function t(n){e.call(this,n),this.name="IllegalArgumentException",this.message=n,this.stack=new e().stack}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Rt=function(){},FC={MAX_VALUE:{configurable:!0}};Rt.isNaN=function(t){return Number.isNaN(t)};Rt.doubleToLongBits=function(t){return t};Rt.longBitsToDouble=function(t){return t};Rt.isInfinite=function(t){return!Number.isFinite(t)};FC.MAX_VALUE.get=function(){return Number.MAX_VALUE};Object.defineProperties(Rt,FC);var ti=function(){},Dp=function(){},vu=function(){};function ei(){}var M=function e(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=e.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=e.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Cl={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};M.prototype.setOrdinate=function(t,n){switch(t){case M.X:this.x=n;break;case M.Y:this.y=n;break;case M.Z:this.z=n;break;default:throw new ve("Invalid ordinate index: "+t)}};M.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return!(!ul.equalsWithTolerance(this.x,n.x,r)||!ul.equalsWithTolerance(this.y,n.y,r))}};M.prototype.getOrdinate=function(t){switch(t){case M.X:return this.x;case M.Y:return this.y;case M.Z:return this.z}throw new ve("Invalid ordinate index: "+t)};M.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Rt.isNaN(this.z))&&Rt.isNaN(t.z)};M.prototype.equals=function(t){return t instanceof M?this.equals2D(t):!1};M.prototype.equalInZ=function(t,n){return ul.equalsWithTolerance(this.z,t.z,n)};M.prototype.compareTo=function(t){var n=t;return this.x<n.x?-1:this.x>n.x?1:this.y<n.y?-1:this.y>n.y?1:0};M.prototype.clone=function(){};M.prototype.copy=function(){return new M(this)};M.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};M.prototype.distance3D=function(t){var n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return Math.sqrt(n*n+r*r+i*i)};M.prototype.distance=function(t){var n=this.x-t.x,r=this.y-t.y;return Math.sqrt(n*n+r*r)};M.prototype.hashCode=function(){var t=17;return t=37*t+M.hashCode(this.x),t=37*t+M.hashCode(this.y),t};M.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};M.prototype.interfaces_=function(){return[ti,Dp,ei]};M.prototype.getClass=function(){return M};M.hashCode=function(){if(arguments.length===1){var t=arguments[0],n=Rt.doubleToLongBits(t);return Math.trunc((n^n)>>>32)}};Cl.DimensionalComparator.get=function(){return uo};Cl.serialVersionUID.get=function(){return 6683108902428367e3};Cl.NULL_ORDINATE.get=function(){return Rt.NaN};Cl.X.get=function(){return 0};Cl.Y.get=function(){return 1};Cl.Z.get=function(){return 2};Object.defineProperties(M,Cl);var uo=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var n=arguments[0];if(n!==2&&n!==3)throw new ve("only 2 or 3 dimensions may be specified");this._dimensionsToTest=n}}};uo.prototype.compare=function(t,n){var r=t,i=n,s=uo.compare(r.x,i.x);if(s!==0)return s;var a=uo.compare(r.y,i.y);if(a!==0)return a;if(this._dimensionsToTest<=2)return 0;var l=uo.compare(r.z,i.z);return l};uo.prototype.interfaces_=function(){return[vu]};uo.prototype.getClass=function(){return uo};uo.compare=function(t,n){return t<n?-1:t>n?1:Rt.isNaN(t)?Rt.isNaN(n)?0:-1:Rt.isNaN(n)?1:0};var yu=function(){};yu.prototype.create=function(){};yu.prototype.interfaces_=function(){return[]};yu.prototype.getClass=function(){return yu};var k=function(){},Bf={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};k.prototype.interfaces_=function(){return[]};k.prototype.getClass=function(){return k};k.toLocationSymbol=function(t){switch(t){case k.EXTERIOR:return"e";case k.BOUNDARY:return"b";case k.INTERIOR:return"i";case k.NONE:return"-"}throw new ve("Unknown location value: "+t)};Bf.INTERIOR.get=function(){return 0};Bf.BOUNDARY.get=function(){return 1};Bf.EXTERIOR.get=function(){return 2};Bf.NONE.get=function(){return-1};Object.defineProperties(k,Bf);var Ot=function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1},Tr=function(){},jC={LOG_10:{configurable:!0}};Tr.prototype.interfaces_=function(){return[]};Tr.prototype.getClass=function(){return Tr};Tr.log10=function(t){var n=Math.log(t);return Rt.isInfinite(n)||Rt.isNaN(n)?n:n/Tr.LOG_10};Tr.min=function(t,n,r,i){var s=t;return n<s&&(s=n),r<s&&(s=r),i<s&&(s=i),s};Tr.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1],r=arguments[2];return t<n?n:t>r?r:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],a=arguments[2];return i<s?s:i>a?a:i}};Tr.wrap=function(t,n){return t<0?n- -t%n:t%n};Tr.max=function(){if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2],i=t;return n>i&&(i=n),r>i&&(i=r),i}else if(arguments.length===4){var s=arguments[0],a=arguments[1],l=arguments[2],c=arguments[3],f=s;return a>f&&(f=a),l>f&&(f=l),c>f&&(f=c),f}};Tr.average=function(t,n){return(t+n)/2};jC.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(Tr,jC);var Ki=function(t){this.str=t};Ki.prototype.append=function(t){this.str+=t};Ki.prototype.setCharAt=function(t,n){this.str=this.str.substr(0,t)+n+this.str.substr(t+1)};Ki.prototype.toString=function(t){return this.str};var Bi=function(t){this.value=t};Bi.prototype.intValue=function(){return this.value};Bi.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0};Bi.isNaN=function(t){return Number.isNaN(t)};var ff=function(){};ff.isWhitespace=function(t){return t<=32&&t>=0||t===127};ff.toUpperCase=function(t){return t.toUpperCase()};var V=function e(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];e.call(this,e.parse(r))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},yi={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};V.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo};V.prototype.extractSignificantDigits=function(t,n){var r=this.abs(),i=V.magnitude(r._hi),s=V.TEN.pow(i);r=r.divide(s),r.gt(V.TEN)?(r=r.divide(V.TEN),i+=1):r.lt(V.ONE)&&(r=r.multiply(V.TEN),i-=1);for(var a=i+1,l=new Ki,c=V.MAX_PRINT_DIGITS-1,f=0;f<=c;f++){t&&f===a&&l.append(".");var g=Math.trunc(r._hi);if(g<0)break;var d=!1,v=0;g>9?(d=!0,v="9"):v="0"+g,l.append(v),r=r.subtract(V.valueOf(g)).multiply(V.TEN),d&&r.selfAdd(V.TEN);var y=!0,x=V.magnitude(r._hi);if(x<0&&Math.abs(x)>=c-f&&(y=!1),!y)break}return n[0]=i,l.toString()};V.prototype.sqr=function(){return this.multiply(this)};V.prototype.doubleValue=function(){return this._hi+this._lo};V.prototype.subtract=function(){if(arguments[0]instanceof V){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var n=arguments[0];return this.add(-n)}};V.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};V.prototype.isZero=function(){return this._hi===0&&this._lo===0};V.prototype.selfSubtract=function(){if(arguments[0]instanceof V){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}};V.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};V.prototype.min=function(t){return this.le(t)?this:t};V.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof V){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var n=arguments[0];return this.selfDivide(n,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=null,a=null,l=null,c=null,f=null,g=null,d=null,v=null;return f=this._hi/r,g=V.SPLIT*f,s=g-f,v=V.SPLIT*r,s=g-s,a=f-s,l=v-r,d=f*r,l=v-l,c=r-l,v=s*l-d+s*c+a*l+a*c,g=(this._hi-d-v+this._lo-f*i)/r,v=f+g,this._hi=v,this._lo=f-v+g,this}};V.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};V.prototype.divide=function(){if(arguments[0]instanceof V){var t=arguments[0],n=null,r=null,i=null,s=null,a=null,l=null,c=null,f=null;a=this._hi/t._hi,l=V.SPLIT*a,n=l-a,f=V.SPLIT*t._hi,n=l-n,r=a-n,i=f-t._hi,c=a*t._hi,i=f-i,s=t._hi-i,f=n*i-c+n*s+r*i+r*s,l=(this._hi-c-f+this._lo-a*t._lo)/t._hi,f=a+l;var g=f,d=a-f+l;return new V(g,d)}else if(typeof arguments[0]=="number"){var v=arguments[0];return Rt.isNaN(v)?V.createNaN():V.copy(this).selfDivide(v,0)}};V.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};V.prototype.pow=function(t){if(t===0)return V.valueOf(1);var n=new V(this),r=V.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(n),i/=2,i>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal():r};V.prototype.ceil=function(){if(this.isNaN())return V.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new V(t,n)};V.prototype.compareTo=function(t){var n=t;return this._hi<n._hi?-1:this._hi>n._hi?1:this._lo<n._lo?-1:this._lo>n._lo?1:0};V.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};V.prototype.setValue=function(){if(arguments[0]instanceof V){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var n=arguments[0];return this.init(n),this}};V.prototype.max=function(t){return this.ge(t)?this:t};V.prototype.sqrt=function(){if(this.isZero())return V.valueOf(0);if(this.isNegative())return V.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=V.valueOf(n),i=this.subtract(r.sqr()),s=i._hi*(t*.5);return r.add(s)};V.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof V){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var n=arguments[0],r=null,i=null,s=null,a=null,l=null,c=null;return s=this._hi+n,l=s-this._hi,a=s-l,a=n-l+(this._hi-a),c=a+this._lo,r=s+c,i=c+(s-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var f=arguments[0],g=arguments[1],d=null,v=null,y=null,x=null,S=null,C=null,E=null,w=null;S=this._hi+f,y=this._lo+g,E=S-this._hi,w=y-this._lo,C=S-E,x=y-w,C=f-E+(this._hi-C),x=g-w+(this._lo-x),E=C+y,d=S+E,v=E+(S-d),E=x+v;var N=d+E,I=E+(d-N);return this._hi=N,this._lo=I,this}};V.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof V){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var n=arguments[0];return this.selfMultiply(n,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=null,a=null,l=null,c=null,f=null,g=null;f=V.SPLIT*this._hi,s=f-this._hi,g=V.SPLIT*r,s=f-s,a=this._hi-s,l=g-r,f=this._hi*r,l=g-l,c=r-l,g=s*l-f+s*c+a*l+a*c+(this._hi*i+this._lo*r);var d=f+g;s=f-d;var v=g+s;return this._hi=d,this._lo=v,this}};V.prototype.selfSqr=function(){return this.selfMultiply(this)};V.prototype.floor=function(){if(this.isNaN())return V.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new V(t,n)};V.prototype.negate=function(){return this.isNaN()?this:new V(-this._hi,-this._lo)};V.prototype.clone=function(){};V.prototype.multiply=function(){if(arguments[0]instanceof V){var t=arguments[0];return t.isNaN()?V.createNaN():V.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var n=arguments[0];return Rt.isNaN(n)?V.createNaN():V.copy(this).selfMultiply(n,0)}};V.prototype.isNaN=function(){return Rt.isNaN(this._hi)};V.prototype.intValue=function(){return Math.trunc(this._hi)};V.prototype.toString=function(){var t=V.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};V.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,s=r;if(r.charAt(0)===".")s="0"+r;else if(i<0)s="0."+V.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var a=i-r.length,l=V.stringOfChar("0",a);s=r+l+".0"}return this.isNegative()?"-"+s:s};V.prototype.reciprocal=function(){var t=null,n=null,r=null,i=null,s=null,a=null,l=null,c=null;s=1/this._hi,a=V.SPLIT*s,t=a-s,c=V.SPLIT*this._hi,t=a-t,n=s-t,r=c-this._hi,l=s*this._hi,r=c-r,i=this._hi-r,c=t*r-l+t*i+n*r+n*i,a=(1-l-c-s*this._lo)/this._hi;var f=s+a,g=s-f+a;return new V(f,g)};V.prototype.toSciNotation=function(){if(this.isZero())return V.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!1,n),i=V.SCI_NOT_EXPONENT_CHAR+n[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var s="";r.length>1&&(s=r.substring(1));var a=r.charAt(0)+"."+s;return this.isNegative()?"-"+a+i:a+i};V.prototype.abs=function(){return this.isNaN()?V.NaN:this.isNegative()?this.negate():new V(this)};V.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};V.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo};V.prototype.add=function(){if(arguments[0]instanceof V){var t=arguments[0];return V.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var n=arguments[0];return V.copy(this).selfAdd(n)}};V.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof V){var n=arguments[0];this._hi=n._hi,this._lo=n._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}};V.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo};V.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};V.prototype.trunc=function(){return this.isNaN()?V.NaN:this.isPositive()?this.floor():this.ceil()};V.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};V.prototype.interfaces_=function(){return[ei,ti,Dp]};V.prototype.getClass=function(){return V};V.sqr=function(t){return V.valueOf(t).selfMultiply(t)};V.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return V.parse(t)}else if(typeof arguments[0]=="number"){var n=arguments[0];return new V(n)}};V.sqrt=function(t){return V.valueOf(t).sqrt()};V.parse=function(t){for(var n=0,r=t.length;ff.isWhitespace(t.charAt(n));)n++;var i=!1;if(n<r){var s=t.charAt(n);(s==="-"||s==="+")&&(n++,s==="-"&&(i=!0))}for(var a=new V,l=0,c=0,f=0;!(n>=r);){var g=t.charAt(n);if(n++,ff.isDigit(g)){var d=g-"0";a.selfMultiply(V.TEN),a.selfAdd(d),l++;continue}if(g==="."){c=l;continue}if(g==="e"||g==="E"){var v=t.substring(n);try{f=Bi.parseInt(v)}catch(E){throw E instanceof Error?new Error("Invalid exponent "+v+" in string "+t):E}finally{}break}throw new Error("Unexpected character '"+g+"' at position "+n+" in string "+t)}var y=a,x=l-c-f;if(x===0)y=a;else if(x>0){var S=V.TEN.pow(x);y=a.divide(S)}else if(x<0){var C=V.TEN.pow(-x);y=a.multiply(C)}return i?y.negate():y};V.createNaN=function(){return new V(Rt.NaN,Rt.NaN)};V.copy=function(t){return new V(t)};V.magnitude=function(t){var n=Math.abs(t),r=Math.log(n)/Math.log(10),i=Math.trunc(Math.floor(r)),s=Math.pow(10,i);return s*10<=n&&(i+=1),i};V.stringOfChar=function(t,n){for(var r=new Ki,i=0;i<n;i++)r.append(t);return r.toString()};yi.PI.get=function(){return new V(3.141592653589793,12246467991473532e-32)};yi.TWO_PI.get=function(){return new V(6.283185307179586,24492935982947064e-32)};yi.PI_2.get=function(){return new V(1.5707963267948966,6123233995736766e-32)};yi.E.get=function(){return new V(2.718281828459045,14456468917292502e-32)};yi.NaN.get=function(){return new V(Rt.NaN,Rt.NaN)};yi.EPS.get=function(){return 123259516440783e-46};yi.SPLIT.get=function(){return 134217729};yi.MAX_PRINT_DIGITS.get=function(){return 32};yi.TEN.get=function(){return V.valueOf(10)};yi.ONE.get=function(){return V.valueOf(1)};yi.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"};yi.SCI_NOT_ZERO.get=function(){return"0.0E0"};Object.defineProperties(V,yi);var er=function(){},zC={DP_SAFE_EPSILON:{configurable:!0}};er.prototype.interfaces_=function(){return[]};er.prototype.getClass=function(){return er};er.orientationIndex=function(t,n,r){var i=er.orientationIndexFilter(t,n,r);if(i<=1)return i;var s=V.valueOf(n.x).selfAdd(-t.x),a=V.valueOf(n.y).selfAdd(-t.y),l=V.valueOf(r.x).selfAdd(-n.x),c=V.valueOf(r.y).selfAdd(-n.y);return s.selfMultiply(c).selfSubtract(a.selfMultiply(l)).signum()};er.signOfDet2x2=function(t,n,r,i){var s=t.multiply(i).selfSubtract(n.multiply(r));return s.signum()};er.intersection=function(t,n,r,i){var s=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(n.x).selfSubtract(t.x)),a=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(n.y).selfSubtract(t.y)),l=s.subtract(a),c=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(t.y).selfSubtract(r.y)),f=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(t.x).selfSubtract(r.x)),g=c.subtract(f),d=g.selfDivide(l).doubleValue(),v=V.valueOf(t.x).selfAdd(V.valueOf(n.x).selfSubtract(t.x).selfMultiply(d)).doubleValue(),y=V.valueOf(n.x).selfSubtract(t.x).selfMultiply(V.valueOf(t.y).selfSubtract(r.y)),x=V.valueOf(n.y).selfSubtract(t.y).selfMultiply(V.valueOf(t.x).selfSubtract(r.x)),S=y.subtract(x),C=S.selfDivide(l).doubleValue(),E=V.valueOf(r.y).selfAdd(V.valueOf(i.y).selfSubtract(r.y).selfMultiply(C)).doubleValue();return new M(v,E)};er.orientationIndexFilter=function(t,n,r){var i=null,s=(t.x-r.x)*(n.y-r.y),a=(t.y-r.y)*(n.x-r.x),l=s-a;if(s>0){if(a<=0)return er.signum(l);i=s+a}else if(s<0){if(a>=0)return er.signum(l);i=-s-a}else return er.signum(l);var c=er.DP_SAFE_EPSILON*i;return l>=c||-l>=c?er.signum(l):2};er.signum=function(t){return t>0?1:t<0?-1:0};zC.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(er,zC);var Wt=function(){},Uf={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Uf.X.get=function(){return 0};Uf.Y.get=function(){return 1};Uf.Z.get=function(){return 2};Uf.M.get=function(){return 3};Wt.prototype.setOrdinate=function(t,n,r){};Wt.prototype.size=function(){};Wt.prototype.getOrdinate=function(t,n){};Wt.prototype.getCoordinate=function(){};Wt.prototype.getCoordinateCopy=function(t){};Wt.prototype.getDimension=function(){};Wt.prototype.getX=function(t){};Wt.prototype.clone=function(){};Wt.prototype.expandEnvelope=function(t){};Wt.prototype.copy=function(){};Wt.prototype.getY=function(t){};Wt.prototype.toCoordinateArray=function(){};Wt.prototype.interfaces_=function(){return[Dp]};Wt.prototype.getClass=function(){return Wt};Object.defineProperties(Wt,Uf);var BC=function(){},Hu=function(e){function t(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(BC),wn=function(){};wn.arraycopy=function(t,n,r,i,s){for(var a=0,l=n;l<n+s;l++)r[i+a]=t[l],a++};wn.getProperty=function(t){return{"line.separator":`
`}[t]};var oi=function e(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var a=arguments[0],l=arguments[1];this.x=a.y-l.y,this.y=l.x-a.x,this.w=a.x*l.y-l.x*a.y}}else if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];this.x=c,this.y=f,this.w=g}else if(arguments.length===4){var d=arguments[0],v=arguments[1],y=arguments[2],x=arguments[3],S=d.y-v.y,C=v.x-d.x,E=d.x*v.y-v.x*d.y,w=y.y-x.y,N=x.x-y.x,I=y.x*x.y-x.x*y.y;this.x=C*I-N*E,this.y=w*E-S*I,this.w=S*N-w*C}};oi.prototype.getY=function(){var t=this.y/this.w;if(Rt.isNaN(t)||Rt.isInfinite(t))throw new Hu;return t};oi.prototype.getX=function(){var t=this.x/this.w;if(Rt.isNaN(t)||Rt.isInfinite(t))throw new Hu;return t};oi.prototype.getCoordinate=function(){var t=new M;return t.x=this.getX(),t.y=this.getY(),t};oi.prototype.interfaces_=function(){return[]};oi.prototype.getClass=function(){return oi};oi.intersection=function(t,n,r,i){var s=t.y-n.y,a=n.x-t.x,l=t.x*n.y-n.x*t.y,c=r.y-i.y,f=i.x-r.x,g=r.x*i.y-i.x*r.y,d=a*g-f*l,v=c*l-s*g,y=s*f-c*a,x=d/y,S=v/y;if(Rt.isNaN(x)||Rt.isInfinite(x)||Rt.isNaN(S)||Rt.isInfinite(S))throw new Hu;return new M(x,S)};var Nt=function e(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],a=arguments[1],l=arguments[2],c=arguments[3];this.init(s,a,l,c)}},UC={serialVersionUID:{configurable:!0}};Nt.prototype.getArea=function(){return this.getWidth()*this.getHeight()};Nt.prototype.equals=function(t){if(!(t instanceof Nt))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()};Nt.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Nt;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,s=this._maxy<t._maxy?this._maxy:t._maxy;return new Nt(n,i,r,s)};Nt.prototype.isNull=function(){return this._maxx<this._minx};Nt.prototype.getMaxX=function(){return this._maxx};Nt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof Nt){var n=arguments[0];return this.isNull()||n.isNull()?!1:n.getMinX()>=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}};Nt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Nt){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof M){var n=arguments[0];return this.intersects(n.x,n.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}};Nt.prototype.getMinY=function(){return this._miny};Nt.prototype.getMinX=function(){return this._minx};Nt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Nt){var n=arguments[0];if(n.isNull())return null;this.isNull()?(this._minx=n.getMinX(),this._maxx=n.getMaxX(),this._miny=n.getMinY(),this._maxy=n.getMaxY()):(n._minx<this._minx&&(this._minx=n._minx),n._maxx>this._maxx&&(this._maxx=n._maxx),n._miny<this._miny&&(this._miny=n._miny),n._maxy>this._maxy&&(this._maxy=n._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}};Nt.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),n=this.getHeight();return t<n?t:n};Nt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx};Nt.prototype.compareTo=function(t){var n=t;return this.isNull()?n.isNull()?0:-1:n.isNull()?1:this._minx<n._minx?-1:this._minx>n._minx?1:this._miny<n._miny?-1:this._miny>n._miny?1:this._maxx<n._maxx?-1:this._maxx>n._maxx?1:this._maxy<n._maxy?-1:this._maxy>n._maxy?1:0};Nt.prototype.translate=function(t,n){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+n,this.getMaxY()+n)};Nt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Nt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Nt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Nt.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),n=this.getHeight();return t>n?t:n};Nt.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=n,this._maxx+=n,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};Nt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Nt){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof M){var n=arguments[0];return this.covers(n)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}};Nt.prototype.centre=function(){return this.isNull()?null:new M((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Nt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Nt){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],a=arguments[1],l=arguments[2],c=arguments[3];s<a?(this._minx=s,this._maxx=a):(this._minx=a,this._maxx=s),l<c?(this._miny=l,this._maxy=c):(this._miny=c,this._maxy=l)}};Nt.prototype.getMaxY=function(){return this._maxy};Nt.prototype.distance=function(t){if(this.intersects(t))return 0;var n=0;this._maxx<t._minx?n=t._minx-this._maxx:this._minx>t._maxx&&(n=this._minx-t._maxx);var r=0;return this._maxy<t._miny?r=t._miny-this._maxy:this._miny>t._maxy&&(r=this._miny-t._maxy),n===0?r:r===0?n:Math.sqrt(n*n+r*r)};Nt.prototype.hashCode=function(){var t=17;return t=37*t+M.hashCode(this._minx),t=37*t+M.hashCode(this._maxx),t=37*t+M.hashCode(this._miny),t=37*t+M.hashCode(this._maxy),t};Nt.prototype.interfaces_=function(){return[ti,ei]};Nt.prototype.getClass=function(){return Nt};Nt.intersects=function(){if(arguments.length===3){var t=arguments[0],n=arguments[1],r=arguments[2];return r.x>=(t.x<n.x?t.x:n.x)&&r.x<=(t.x>n.x?t.x:n.x)&&r.y>=(t.y<n.y?t.y:n.y)&&r.y<=(t.y>n.y?t.y:n.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3],c=Math.min(a.x,l.x),f=Math.max(a.x,l.x),g=Math.min(i.x,s.x),d=Math.max(i.x,s.x);return!(g>f||d<c||(c=Math.min(a.y,l.y),f=Math.max(a.y,l.y),g=Math.min(i.y,s.y),d=Math.max(i.y,s.y),g>f)||d<c)}};UC.serialVersionUID.get=function(){return 5873921885273102e3};Object.defineProperties(Nt,UC);var bi={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},kp=function(t){this.geometryFactory=t||new Ut};kp.prototype.read=function(t){var n,r,i;t=t.replace(/[\n\r]/g," ");var s=bi.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(s=bi.emptyTypeStr.exec(t),s[2]=void 0),s&&(r=s[1].toLowerCase(),i=s[2],eu[r]&&(n=eu[r].apply(this,[i]))),n===void 0)throw new Error("Could not parse WKT "+t);return n};kp.prototype.write=function(t){return this.extractGeometry(t)};kp.prototype.extractGeometry=function(t){var n=t.getGeometryType().toLowerCase();if(!Ds[n])return null;var r=n.toUpperCase(),i;return t.isEmpty()?i=r+" EMPTY":i=r+"("+Ds[n].apply(this,[t])+")",i};var Ds={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ds.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var n=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ds.point.apply(n,[t._geometries[i]])+")");return r.join(",")},linestring:function(t){for(var n=this,r=[],i=0,s=t._points._coordinates.length;i<s;++i)r.push(Ds.coordinate.apply(n,[t._points._coordinates[i]]));return r.join(",")},linearring:function(t){for(var n=this,r=[],i=0,s=t._points._coordinates.length;i<s;++i)r.push(Ds.coordinate.apply(n,[t._points._coordinates[i]]));return r.join(",")},multilinestring:function(t){for(var n=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ds.linestring.apply(n,[t._geometries[i]])+")");return r.join(",")},polygon:function(t){var n=this,r=[];r.push("("+Ds.linestring.apply(this,[t._shell])+")");for(var i=0,s=t._holes.length;i<s;++i)r.push("("+Ds.linestring.apply(n,[t._holes[i]])+")");return r.join(",")},multipolygon:function(t){for(var n=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push("("+Ds.polygon.apply(n,[t._geometries[i]])+")");return r.join(",")},geometrycollection:function(t){for(var n=this,r=[],i=0,s=t._geometries.length;i<s;++i)r.push(n.extractGeometry(t._geometries[i]));return r.join(",")}},eu={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var n=t.trim().split(bi.spaces);return this.geometryFactory.createPoint(new M(Number.parseFloat(n[0]),Number.parseFloat(n[1])))},multipoint:function(t){var n=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=t.trim().split(","),s=[],a=0,l=i.length;a<l;++a)r=i[a].replace(bi.trimParens,"$1"),s.push(eu.point.apply(n,[r]));return this.geometryFactory.createMultiPoint(s)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var n=t.trim().split(","),r=[],i,s=0,a=n.length;s<a;++s)i=n[s].trim().split(bi.spaces),r.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var n=t.trim().split(","),r=[],i,s=0,a=n.length;s<a;++s)i=n[s].trim().split(bi.spaces),r.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){var n=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=t.trim().split(bi.parenComma),s=[],a=0,l=i.length;a<l;++a)r=i[a].replace(bi.trimParens,"$1"),s.push(eu.linestring.apply(n,[r]));return this.geometryFactory.createMultiLineString(s)},polygon:function(t){var n=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var r,i,s,a=t.trim().split(bi.parenComma),l,c=[],f=0,g=a.length;f<g;++f)r=a[f].replace(bi.trimParens,"$1"),i=eu.linestring.apply(n,[r]),s=n.geometryFactory.createLinearRing(i._points),f===0?l=s:c.push(s);return this.geometryFactory.createPolygon(l,c)},multipolygon:function(t){var n=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=t.trim().split(bi.doubleParenComma),s=[],a=0,l=i.length;a<l;++a)r=i[a].replace(bi.trimParens,"$1"),s.push(eu.polygon.apply(n,[r]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(t){var n=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=t.trim().split("|"),i=[],s=0,a=r.length;s<a;++s)i.push(n.read(r[s]));return this.geometryFactory.createGeometryCollection(i)}},ui=function(t){this.parser=new kp(t)};ui.prototype.write=function(t){return this.parser.write(t)};ui.toLineString=function(t,n){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+n.x+" "+n.y+" )"};var Zs=function(e){function t(n){e.call(this,n),this.name="RuntimeException",this.message=n,this.stack=new e().stack}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Zd=function(e){function t(){if(e.call(this),arguments.length===0)e.call(this);else if(arguments.length===1){var n=arguments[0];e.call(this,n)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Zs),kt=function(){};kt.prototype.interfaces_=function(){return[]};kt.prototype.getClass=function(){return kt};kt.shouldNeverReachHere=function(){if(arguments.length===0)kt.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Zd("Should never reach here"+(t!==null?": "+t:""))}};kt.isTrue=function(){var t,n;if(arguments.length===1)t=arguments[0],kt.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],n=arguments[1],!t))throw n===null?new Zd:new Zd(n)};kt.equals=function(){var t,n,r;if(arguments.length===2)t=arguments[0],n=arguments[1],kt.equals(t,n,null);else if(arguments.length===3&&(t=arguments[0],n=arguments[1],r=arguments[2],!n.equals(t)))throw new Zd("Expected "+t+" but encountered "+n+(r!==null?": "+r:""))};var _e=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new M,this._intPt[1]=new M,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Nl={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};_e.prototype.getIndexAlongSegment=function(t,n){return this.computeIntLineIndex(),this._intLineIndex[t][n]};_e.prototype.getTopologySummary=function(){var t=new Ki;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()};_e.prototype.computeIntersection=function(t,n,r,i){this._inputLines[0][0]=t,this._inputLines[0][1]=n,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,n,r,i)};_e.prototype.getIntersectionNum=function(){return this._result};_e.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],n=this.getEdgeDistance(t,0),r=this.getEdgeDistance(t,1);n>r?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};_e.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};_e.prototype.setPrecisionModel=function(t){this._precisionModel=t};_e.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var n=arguments[0],r=0;r<this._result;r++)if(!(t._intPt[r].equals2D(t._inputLines[n][0])||t._intPt[r].equals2D(t._inputLines[n][1])))return!0;return!1}};_e.prototype.getIntersection=function(t){return this._intPt[t]};_e.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};_e.prototype.hasIntersection=function(){return this._result!==_e.NO_INTERSECTION};_e.prototype.getEdgeDistance=function(t,n){var r=_e.computeEdgeDistance(this._intPt[n],this._inputLines[t][0],this._inputLines[t][1]);return r};_e.prototype.isCollinear=function(){return this._result===_e.COLLINEAR_INTERSECTION};_e.prototype.toString=function(){return ui.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+ui.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()};_e.prototype.getEndpoint=function(t,n){return this._inputLines[t][n]};_e.prototype.isIntersection=function(t){for(var n=this,r=0;r<this._result;r++)if(n._intPt[r].equals2D(t))return!0;return!1};_e.prototype.getIntersectionAlongSegment=function(t,n){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][n]]};_e.prototype.interfaces_=function(){return[]};_e.prototype.getClass=function(){return _e};_e.computeEdgeDistance=function(t,n,r){var i=Math.abs(r.x-n.x),s=Math.abs(r.y-n.y),a=-1;if(t.equals(n))a=0;else if(t.equals(r))i>s?a=i:a=s;else{var l=Math.abs(t.x-n.x),c=Math.abs(t.y-n.y);i>s?a=l:a=c,a===0&&!t.equals(n)&&(a=Math.max(l,c))}return kt.isTrue(!(a===0&&!t.equals(n)),"Bad distance calculation"),a};_e.nonRobustComputeEdgeDistance=function(t,n,r){var i=t.x-n.x,s=t.y-n.y,a=Math.sqrt(i*i+s*s);return kt.isTrue(!(a===0&&!t.equals(n)),"Invalid distance calculation"),a};Nl.DONT_INTERSECT.get=function(){return 0};Nl.DO_INTERSECT.get=function(){return 1};Nl.COLLINEAR.get=function(){return 2};Nl.NO_INTERSECTION.get=function(){return 0};Nl.POINT_INTERSECTION.get=function(){return 1};Nl.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(_e,Nl);var Ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(r){var i=new Nt(this._inputLines[0][0],this._inputLines[0][1]),s=new Nt(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&s.contains(r)},t.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,Nt.intersects(i,s,r)&&dt.orientationIndex(i,s,r)===0&&dt.orientationIndex(s,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(s))&&(this._isProper=!1),this._result=e.POINT_INTERSECTION,null;this._result=e.NO_INTERSECTION}else return e.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(r,i,s,a,l){l.x=this.smallestInAbsValue(r.x,i.x,s.x,a.x),l.y=this.smallestInAbsValue(r.y,i.y,s.y,a.y),r.x-=l.x,r.y-=l.y,i.x-=l.x,i.y-=l.y,s.x-=l.x,s.y-=l.y,a.x-=l.x,a.y-=l.y},t.prototype.safeHCoordinateIntersection=function(r,i,s,a){var l=null;try{l=oi.intersection(r,i,s,a)}catch(c){if(c instanceof Hu)l=t.nearestEndpoint(r,i,s,a);else throw c}finally{}return l},t.prototype.intersection=function(r,i,s,a){var l=this.intersectionWithNormalization(r,i,s,a);return this.isInSegmentEnvelopes(l)||(l=new M(t.nearestEndpoint(r,i,s,a))),this._precisionModel!==null&&this._precisionModel.makePrecise(l),l},t.prototype.smallestInAbsValue=function(r,i,s,a){var l=r,c=Math.abs(l);return Math.abs(i)<c&&(l=i,c=Math.abs(i)),Math.abs(s)<c&&(l=s,c=Math.abs(s)),Math.abs(a)<c&&(l=a),l},t.prototype.checkDD=function(r,i,s,a,l){var c=er.intersection(r,i,s,a),f=this.isInSegmentEnvelopes(c);wn.out.println("DD in env = "+f+" --------------------- "+c),l.distance(c)>1e-4&&wn.out.println("Distance = "+l.distance(c))},t.prototype.intersectionWithNormalization=function(r,i,s,a){var l=new M(r),c=new M(i),f=new M(s),g=new M(a),d=new M;this.normalizeToEnvCentre(l,c,f,g,d);var v=this.safeHCoordinateIntersection(l,c,f,g);return v.x+=d.x,v.y+=d.y,v},t.prototype.computeCollinearIntersection=function(r,i,s,a){var l=Nt.intersects(r,i,s),c=Nt.intersects(r,i,a),f=Nt.intersects(s,a,r),g=Nt.intersects(s,a,i);return l&&c?(this._intPt[0]=s,this._intPt[1]=a,e.COLLINEAR_INTERSECTION):f&&g?(this._intPt[0]=r,this._intPt[1]=i,e.COLLINEAR_INTERSECTION):l&&f?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!c&&!g?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):l&&g?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!c&&!f?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&f?(this._intPt[0]=a,this._intPt[1]=r,a.equals(r)&&!l&&!g?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):c&&g?(this._intPt[0]=a,this._intPt[1]=i,a.equals(i)&&!l&&!f?e.POINT_INTERSECTION:e.COLLINEAR_INTERSECTION):e.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(r,i,s,a,l){var c=r.x<i.x?r.x:i.x,f=r.y<i.y?r.y:i.y,g=r.x>i.x?r.x:i.x,d=r.y>i.y?r.y:i.y,v=s.x<a.x?s.x:a.x,y=s.y<a.y?s.y:a.y,x=s.x>a.x?s.x:a.x,S=s.y>a.y?s.y:a.y,C=c>v?c:v,E=g<x?g:x,w=f>y?f:y,N=d<S?d:S,I=(C+E)/2,R=(w+N)/2;l.x=I,l.y=R,r.x-=l.x,r.y-=l.y,i.x-=l.x,i.y-=l.y,s.x-=l.x,s.y-=l.y,a.x-=l.x,a.y-=l.y},t.prototype.computeIntersect=function(r,i,s,a){if(this._isProper=!1,!Nt.intersects(r,i,s,a))return e.NO_INTERSECTION;var l=dt.orientationIndex(r,i,s),c=dt.orientationIndex(r,i,a);if(l>0&&c>0||l<0&&c<0)return e.NO_INTERSECTION;var f=dt.orientationIndex(s,a,r),g=dt.orientationIndex(s,a,i);if(f>0&&g>0||f<0&&g<0)return e.NO_INTERSECTION;var d=l===0&&c===0&&f===0&&g===0;return d?this.computeCollinearIntersection(r,i,s,a):(l===0||c===0||f===0||g===0?(this._isProper=!1,r.equals2D(s)||r.equals2D(a)?this._intPt[0]=r:i.equals2D(s)||i.equals2D(a)?this._intPt[0]=i:l===0?this._intPt[0]=new M(s):c===0?this._intPt[0]=new M(a):f===0?this._intPt[0]=new M(r):g===0&&(this._intPt[0]=new M(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,s,a)),e.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(r,i,s,a){var l=r,c=dt.distancePointLine(r,s,a),f=dt.distancePointLine(i,s,a);return f<c&&(c=f,l=i),f=dt.distancePointLine(s,r,i),f<c&&(c=f,l=s),f=dt.distancePointLine(a,r,i),f<c&&(c=f,l=a),l},t}(_e),cl=function(){};cl.prototype.interfaces_=function(){return[]};cl.prototype.getClass=function(){return cl};cl.orientationIndex=function(t,n,r){var i=n.x-t.x,s=n.y-t.y,a=r.x-n.x,l=r.y-n.y;return cl.signOfDet2x2(i,s,a,l)};cl.signOfDet2x2=function(t,n,r,i){var s=null,a=null,l=null;if(s=1,t===0||i===0)return n===0||r===0?0:n>0?r>0?-s:s:r>0?s:-s;if(n===0||r===0)return i>0?t>0?s:-s:t>0?-s:s;if(n>0?i>0?n<=i||(s=-s,a=t,t=r,r=a,a=n,n=i,i=a):n<=-i?(s=-s,r=-r,i=-i):(a=t,t=-r,r=a,a=n,n=-i,i=a):i>0?-n<=i?(s=-s,t=-t,n=-n):(a=-t,t=r,r=a,a=-n,n=i,i=a):n>=i?(t=-t,n=-n,r=-r,i=-i):(s=-s,a=-t,t=-r,r=a,a=-n,n=-i,i=a),t>0)if(r>0){if(!(t<=r))return s}else return s;else{if(r>0)return-s;if(t>=r)s=-s,t=-t,r=-r;else return-s}for(;;){if(l=Math.floor(r/t),r=r-l*t,i=i-l*n,i<0)return-s;if(i>n)return s;if(t>r+r){if(n<i+i)return s}else{if(n>i+i)return-s;r=t-r,i=n-i,s=-s}if(i===0)return r===0?0:-s;if(r===0||(l=Math.floor(t/r),t=t-l*r,n=n-l*i,n<0))return s;if(n>i)return-s;if(r>t+t){if(i<n+n)return-s}else{if(i>n+n)return s;t=r-t,n=i-n,s=-s}if(n===0)return t===0?0:s;if(t===0)return-s}};var ki=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ki.prototype.countSegment=function(t,n){if(t.x<this._p.x&&n.x<this._p.x)return null;if(this._p.x===n.x&&this._p.y===n.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&n.y===this._p.y){var r=t.x,i=n.x;return r>i&&(r=n.x,i=t.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&n.y<=this._p.y||n.y>this._p.y&&t.y<=this._p.y){var s=t.x-this._p.x,a=t.y-this._p.y,l=n.x-this._p.x,c=n.y-this._p.y,f=cl.signOfDet2x2(s,a,l,c);if(f===0)return this._isPointOnSegment=!0,null;c<a&&(f=-f),f>0&&this._crossingCount++}};ki.prototype.isPointInPolygon=function(){return this.getLocation()!==k.EXTERIOR};ki.prototype.getLocation=function(){return this._isPointOnSegment?k.BOUNDARY:this._crossingCount%2===1?k.INTERIOR:k.EXTERIOR};ki.prototype.isOnSegment=function(){return this._isPointOnSegment};ki.prototype.interfaces_=function(){return[]};ki.prototype.getClass=function(){return ki};ki.locatePointInRing=function(){if(arguments[0]instanceof M&&Ot(arguments[1],Wt)){for(var t=arguments[0],n=arguments[1],r=new ki(t),i=new M,s=new M,a=1;a<n.size();a++)if(n.getCoordinate(a,i),n.getCoordinate(a-1,s),r.countSegment(i,s),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof M&&arguments[1]instanceof Array){for(var l=arguments[0],c=arguments[1],f=new ki(l),g=1;g<c.length;g++){var d=c[g],v=c[g-1];if(f.countSegment(d,v),f.isOnSegment())return f.getLocation()}return f.getLocation()}};var dt=function(){},Pl={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};dt.prototype.interfaces_=function(){return[]};dt.prototype.getClass=function(){return dt};dt.orientationIndex=function(t,n,r){return er.orientationIndex(t,n,r)};dt.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var n=0,r=t[0].x,i=1;i<t.length-1;i++){var s=t[i].x-r,a=t[i+1].y,l=t[i-1].y;n+=s*(l-a)}return n/2}else if(Ot(arguments[0],Wt)){var c=arguments[0],f=c.size();if(f<3)return 0;var g=new M,d=new M,v=new M;c.getCoordinate(0,d),c.getCoordinate(1,v);var y=d.x;v.x-=y;for(var x=0,S=1;S<f-1;S++)g.y=d.y,d.x=v.x,d.y=v.y,c.getCoordinate(S+1,v),v.x-=y,x+=d.x*(g.y-v.y);return x/2}};dt.distanceLineLine=function(t,n,r,i){if(t.equals(n))return dt.distancePointLine(t,r,i);if(r.equals(i))return dt.distancePointLine(i,t,n);var s=!1;if(!Nt.intersects(t,n,r,i))s=!0;else{var a=(n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(a===0)s=!0;else{var l=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),c=(t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y),f=c/a,g=l/a;(g<0||g>1||f<0||f>1)&&(s=!0)}}return s?Tr.min(dt.distancePointLine(t,r,i),dt.distancePointLine(n,r,i),dt.distancePointLine(r,t,n),dt.distancePointLine(i,t,n)):0};dt.isPointInRing=function(t,n){return dt.locatePointInRing(t,n)!==k.EXTERIOR};dt.computeLength=function(t){var n=t.size();if(n<=1)return 0;var r=0,i=new M;t.getCoordinate(0,i);for(var s=i.x,a=i.y,l=1;l<n;l++){t.getCoordinate(l,i);var c=i.x,f=i.y,g=c-s,d=f-a;r+=Math.sqrt(g*g+d*d),s=c,a=f}return r};dt.isCCW=function(t){var n=t.length-1;if(n<3)throw new ve("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,s=1;s<=n;s++){var a=t[s];a.y>r.y&&(r=a,i=s)}var l=i;do l=l-1,l<0&&(l=n);while(t[l].equals2D(r)&&l!==i);var c=i;do c=(c+1)%n;while(t[c].equals2D(r)&&c!==i);var f=t[l],g=t[c];if(f.equals2D(r)||g.equals2D(r)||f.equals2D(g))return!1;var d=dt.computeOrientation(f,r,g),v=!1;return d===0?v=f.x>g.x:v=d>0,v};dt.locatePointInRing=function(t,n){return ki.locatePointInRing(t,n)};dt.distancePointLinePerpendicular=function(t,n,r){var i=(r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y),s=((n.y-t.y)*(r.x-n.x)-(n.x-t.x)*(r.y-n.y))/i;return Math.abs(s)*Math.sqrt(i)};dt.computeOrientation=function(t,n,r){return dt.orientationIndex(t,n,r)};dt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1];if(n.length===0)throw new ve("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i<n.length-1;i++){var s=dt.distancePointLine(t,n[i],n[i+1]);s<r&&(r=s)}return r}else if(arguments.length===3){var a=arguments[0],l=arguments[1],c=arguments[2];if(l.x===c.x&&l.y===c.y)return a.distance(l);var f=(c.x-l.x)*(c.x-l.x)+(c.y-l.y)*(c.y-l.y),g=((a.x-l.x)*(c.x-l.x)+(a.y-l.y)*(c.y-l.y))/f;if(g<=0)return a.distance(l);if(g>=1)return a.distance(c);var d=((l.y-a.y)*(c.x-l.x)-(l.x-a.x)*(c.y-l.y))/f;return Math.abs(d)*Math.sqrt(f)}};dt.isOnLine=function(t,n){for(var r=new Ta,i=1;i<n.length;i++){var s=n[i-1],a=n[i];if(r.computeIntersection(t,s,a),r.hasIntersection())return!0}return!1};Pl.CLOCKWISE.get=function(){return-1};Pl.RIGHT.get=function(){return dt.CLOCKWISE};Pl.COUNTERCLOCKWISE.get=function(){return 1};Pl.LEFT.get=function(){return dt.COUNTERCLOCKWISE};Pl.COLLINEAR.get=function(){return 0};Pl.STRAIGHT.get=function(){return dt.COLLINEAR};Object.defineProperties(dt,Pl);var Ws=function(){};Ws.prototype.filter=function(t){};Ws.prototype.interfaces_=function(){return[]};Ws.prototype.getClass=function(){return Ws};var Tt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},bs={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Tt.prototype.isGeometryCollection=function(){return this.getSortIndex()===Tt.SORTINDEX_GEOMETRYCOLLECTION};Tt.prototype.getFactory=function(){return this._factory};Tt.prototype.getGeometryN=function(t){return this};Tt.prototype.getArea=function(){return 0};Tt.prototype.isRectangle=function(){return!1};Tt.prototype.equals=function(){if(arguments[0]instanceof Tt){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var n=arguments[0];if(!(n instanceof Tt))return!1;var r=n;return this.equalsExact(r)}};Tt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)};Tt.prototype.geometryChanged=function(){this.apply(Tt.geometryChangedFilter)};Tt.prototype.geometryChangedAction=function(){this._envelope=null};Tt.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())};Tt.prototype.getLength=function(){return 0};Tt.prototype.getNumGeometries=function(){return 1};Tt.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],n=t;return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}};Tt.prototype.getUserData=function(){return this._userData};Tt.prototype.getSRID=function(){return this._SRID};Tt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};Tt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===Tt.SORTINDEX_GEOMETRYCOLLECTION)throw new ve("This method does not support GeometryCollection arguments")};Tt.prototype.equal=function(t,n,r){return r===0?t.equals(n):t.distance(n)<=r};Tt.prototype.norm=function(){var t=this.copy();return t.normalize(),t};Tt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()};Tt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Nt(this._envelope)};Tt.prototype.setSRID=function(t){this._SRID=t};Tt.prototype.setUserData=function(t){this._userData=t};Tt.prototype.compare=function(t,n){for(var r=t.iterator(),i=n.iterator();r.hasNext()&&i.hasNext();){var s=r.next(),a=i.next(),l=s.compareTo(a);if(l!==0)return l}return r.hasNext()?1:i.hasNext()?-1:0};Tt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()};Tt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Tt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Tt.SORTINDEX_MULTIPOINT||this.getSortIndex()===Tt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Tt.SORTINDEX_MULTIPOLYGON};Tt.prototype.interfaces_=function(){return[Dp,ti,ei]};Tt.prototype.getClass=function(){return Tt};Tt.hasNonEmptyElements=function(t){for(var n=0;n<t.length;n++)if(!t[n].isEmpty())return!0;return!1};Tt.hasNullElements=function(t){for(var n=0;n<t.length;n++)if(t[n]===null)return!0;return!1};bs.serialVersionUID.get=function(){return 8763622679187377e3};bs.SORTINDEX_POINT.get=function(){return 0};bs.SORTINDEX_MULTIPOINT.get=function(){return 1};bs.SORTINDEX_LINESTRING.get=function(){return 2};bs.SORTINDEX_LINEARRING.get=function(){return 3};bs.SORTINDEX_MULTILINESTRING.get=function(){return 4};bs.SORTINDEX_POLYGON.get=function(){return 5};bs.SORTINDEX_MULTIPOLYGON.get=function(){return 6};bs.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7};bs.geometryChangedFilter.get=function(){return n_};Object.defineProperties(Tt,bs);var n_=function(){};n_.interfaces_=function(){return[Ws]};n_.filter=function(t){t.geometryChangedAction()};var vs=function(){};vs.prototype.filter=function(t){};vs.prototype.interfaces_=function(){return[]};vs.prototype.getClass=function(){return vs};var Qr=function(){},Js={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Qr.prototype.isInBoundary=function(t){};Qr.prototype.interfaces_=function(){return[]};Qr.prototype.getClass=function(){return Qr};Js.Mod2BoundaryNodeRule.get=function(){return _u};Js.EndPointBoundaryNodeRule.get=function(){return xu};Js.MultiValentEndPointBoundaryNodeRule.get=function(){return wu};Js.MonoValentEndPointBoundaryNodeRule.get=function(){return Eu};Js.MOD2_BOUNDARY_RULE.get=function(){return new _u};Js.ENDPOINT_BOUNDARY_RULE.get=function(){return new xu};Js.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new wu};Js.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Eu};Js.OGC_SFS_BOUNDARY_RULE.get=function(){return Qr.MOD2_BOUNDARY_RULE};Object.defineProperties(Qr,Js);var _u=function(){};_u.prototype.isInBoundary=function(t){return t%2===1};_u.prototype.interfaces_=function(){return[Qr]};_u.prototype.getClass=function(){return _u};var xu=function(){};xu.prototype.isInBoundary=function(t){return t>0};xu.prototype.interfaces_=function(){return[Qr]};xu.prototype.getClass=function(){return xu};var wu=function(){};wu.prototype.isInBoundary=function(t){return t>1};wu.prototype.interfaces_=function(){return[Qr]};wu.prototype.getClass=function(){return wu};var Eu=function(){};Eu.prototype.isInBoundary=function(t){return t===1};Eu.prototype.interfaces_=function(){return[Qr]};Eu.prototype.getClass=function(){return Eu};var Ge=function(){};Ge.prototype.add=function(){};Ge.prototype.addAll=function(){};Ge.prototype.isEmpty=function(){};Ge.prototype.iterator=function(){};Ge.prototype.size=function(){};Ge.prototype.toArray=function(){};Ge.prototype.remove=function(){};function r_(e){this.message=e||""}r_.prototype=new Error;r_.prototype.name="IndexOutOfBoundsException";var Zu=function(){};Zu.prototype.hasNext=function(){};Zu.prototype.next=function(){};Zu.prototype.remove=function(){};var ai=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(Ge);function Wu(e){this.message=e||""}Wu.prototype=new Error;Wu.prototype.name="NoSuchElementException";var lt=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof Ge&&this.addAll(arguments[0])}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[e,Ge]},t.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.set=function(r,i){var s=this.array_[r];return this.array_[r]=i,s},t.prototype.iterator=function(){return new xA(this)},t.prototype.get=function(r){if(r<0||r>=this.size())throw new r_;return this.array_[r]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var r=this,i=[],s=0,a=this.array_.length;s<a;s++)i.push(r.array_[s]);return i},t.prototype.remove=function(r){for(var i=this,s=!1,a=0,l=this.array_.length;a<l;a++)if(i.array_[a]===r){i.array_.splice(a,1),s=!0;break}return s},t}(ai),xA=function(e){function t(n){e.call(this),this.arrayList_=n,this.position_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Wu;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Zu),Vf=function(e){function t(){if(e.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],a=arguments[1],l=!1,c=s.iterator();c.hasNext();)i.add(c.next(),a),l=!0;return l}else return e.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,s=e.prototype.clone.call(this),a=0;a<this.size();a++)s.add(a,i.get(a).copy());return s},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];e.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var a=arguments[0],l=arguments[1];return this.add(a,l,!0),!0}else if(arguments[0]instanceof M&&typeof arguments[1]=="boolean"){var c=arguments[0],f=arguments[1];if(!f&&this.size()>=1){var g=this.get(this.size()-1);if(g.equals2D(c))return null}e.prototype.add.call(this,c)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1];return this.add(d,v),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var y=arguments[0],x=arguments[1],S=arguments[2];if(S)for(var C=0;C<y.length;C++)i.add(y[C],x);else for(var E=y.length-1;E>=0;E--)i.add(y[E],x);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof M){var w=arguments[0],N=arguments[1],I=arguments[2];if(!I){var R=this.size();if(R>0){if(w>0){var A=this.get(w-1);if(A.equals2D(N))return null}if(w<R){var B=this.get(w);if(B.equals2D(N))return null}}}e.prototype.add.call(this,w,N)}}else if(arguments.length===4){var q=arguments[0],Q=arguments[1],Y=arguments[2],J=arguments[3],W=1;Y>J&&(W=-1);for(var $=Y;$!==J;$+=W)i.add(q[$],Q);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new M(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,n),t}(lt),Vt=function(){},Fp={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Fp.ForwardComparator.get=function(){return hf};Fp.BidirectionalComparator.get=function(){return Su};Fp.coordArrayType.get=function(){return new Array(0).fill(null)};Vt.prototype.interfaces_=function(){return[]};Vt.prototype.getClass=function(){return Vt};Vt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};Vt.ptNotInList=function(t,n){for(var r=0;r<t.length;r++){var i=t[r];if(Vt.indexOf(i,n)<0)return i}return null};Vt.scroll=function(t,n){var r=Vt.indexOf(n,t);if(r<0)return null;var i=new Array(t.length).fill(null);wn.arraycopy(t,r,i,0,t.length-r),wn.arraycopy(t,0,i,t.length-r,r),wn.arraycopy(i,0,t,0,t.length)};Vt.equals=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1];if(t===n)return!0;if(t===null||n===null||t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(n[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var l=0;l<i.length;l++)if(a.compare(i[l],s[l])!==0)return!1;return!0}};Vt.intersection=function(t,n){for(var r=new Vf,i=0;i<t.length;i++)n.intersects(t[i])&&r.add(t[i],!0);return r.toCoordinateArray()};Vt.hasRepeatedPoints=function(t){for(var n=1;n<t.length;n++)if(t[n-1].equals(t[n]))return!0;return!1};Vt.removeRepeatedPoints=function(t){if(!Vt.hasRepeatedPoints(t))return t;var n=new Vf(t,!1);return n.toCoordinateArray()};Vt.reverse=function(t){for(var n=t.length-1,r=Math.trunc(n/2),i=0;i<=r;i++){var s=t[i];t[i]=t[n-i],t[n-i]=s}};Vt.removeNull=function(t){for(var n=0,r=0;r<t.length;r++)t[r]!==null&&n++;var i=new Array(n).fill(null);if(n===0)return i;for(var s=0,a=0;a<t.length;a++)t[a]!==null&&(i[s++]=t[a]);return i};Vt.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],n=new Array(t.length).fill(null),r=0;r<t.length;r++)n[r]=new M(t[r]);return n}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3],c=arguments[4],f=0;f<c;f++)a[l+f]=new M(i[s+f])};Vt.isEqualReversed=function(t,n){for(var r=0;r<t.length;r++){var i=t[r],s=n[t.length-r-1];if(i.compareTo(s)!==0)return!1}return!0};Vt.envelope=function(t){for(var n=new Nt,r=0;r<t.length;r++)n.expandToInclude(t[r]);return n};Vt.toCoordinateArray=function(t){return t.toArray(Vt.coordArrayType)};Vt.atLeastNCoordinatesOrNothing=function(t,n){return n.length>=t?n:[]};Vt.indexOf=function(t,n){for(var r=0;r<n.length;r++)if(t.equals(n[r]))return r;return-1};Vt.increasingDirection=function(t){for(var n=0;n<Math.trunc(t.length/2);n++){var r=t.length-1-n,i=t[n].compareTo(t[r]);if(i!==0)return i}return 1};Vt.compare=function(t,n){for(var r=0;r<t.length&&r<n.length;){var i=t[r].compareTo(n[r]);if(i!==0)return i;r++}return r<n.length?-1:r<t.length?1:0};Vt.minCoordinate=function(t){for(var n=null,r=0;r<t.length;r++)(n===null||n.compareTo(t[r])>0)&&(n=t[r]);return n};Vt.extract=function(t,n,r){n=Tr.clamp(n,0,t.length),r=Tr.clamp(r,-1,t.length);var i=r-n+1;r<0&&(i=0),n>=t.length&&(i=0),r<n&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var a=0,l=n;l<=r;l++)s[a++]=t[l];return s};Object.defineProperties(Vt,Fp);var hf=function(){};hf.prototype.compare=function(t,n){var r=t,i=n;return Vt.compare(r,i)};hf.prototype.interfaces_=function(){return[vu]};hf.prototype.getClass=function(){return hf};var Su=function(){};Su.prototype.compare=function(t,n){var r=t,i=n;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var s=Vt.compare(r,i),a=Vt.isEqualReversed(r,i);return a?0:s};Su.prototype.OLDcompare=function(t,n){var r=t,i=n;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var s=Vt.increasingDirection(r),a=Vt.increasingDirection(i),l=s>0?0:r.length-1,c=a>0?0:r.length-1,f=0;f<r.length;f++){var g=r[l].compareTo(i[c]);if(g!==0)return g;l+=s,c+=a}return 0};Su.prototype.interfaces_=function(){return[vu]};Su.prototype.getClass=function(){return Su};var bl=function(){};bl.prototype.get=function(){};bl.prototype.put=function(){};bl.prototype.size=function(){};bl.prototype.values=function(){};bl.prototype.entrySet=function(){};var wA=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(bl);function Gf(e){this.message=e||""}Gf.prototype=new Error;Gf.prototype.name="OperationNotSupported";function jp(){}jp.prototype=new Ge;jp.prototype.contains=function(){};var i_=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof Ge&&this.addAll(arguments[0])}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.contains=function(r){for(var i=this,s=0,a=this.array_.length;s<a;s++){var l=i.array_[s];if(l===r)return!0}return!1},t.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},t.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},t.prototype.remove=function(r){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var r=this,i=[],s=0,a=this.array_.length;s<a;s++)i.push(r.array_[s]);return i},t.prototype.iterator=function(){return new EA(this)},t}(jp),EA=function(e){function t(n){e.call(this),this.hashSet_=n,this.position_=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Wu;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new Gf},t}(Zu),js=0,jo=1;function Tw(e){return e===null?js:e.color}function ce(e){return e===null?null:e.parent}function Ms(e,t){e!==null&&(e.color=t)}function um(e){return e===null?null:e.left}function Ow(e){return e===null?null:e.right}function Mn(){this.root_=null,this.size_=0}Mn.prototype=new wA;Mn.prototype.get=function(e){for(var t=this.root_;t!==null;){var n=e.compareTo(t.key);if(n<0)t=t.left;else if(n>0)t=t.right;else return t.value}return null};Mn.prototype.put=function(e,t){if(this.root_===null)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:js,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,i;do if(r=n,i=e.compareTo(n.key),i<0)n=n.left;else if(i>0)n=n.right;else{var s=n.value;return n.value=t,s}while(n!==null);var a={key:e,left:null,right:null,value:t,parent:r,color:js,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null};Mn.prototype.fixAfterInsertion=function(e){var t=this;for(e.color=jo;e!=null&&e!==this.root_&&e.parent.color===jo;)if(ce(e)===um(ce(ce(e)))){var n=Ow(ce(ce(e)));Tw(n)===jo?(Ms(ce(e),js),Ms(n,js),Ms(ce(ce(e)),jo),e=ce(ce(e))):(e===Ow(ce(e))&&(e=ce(e),t.rotateLeft(e)),Ms(ce(e),js),Ms(ce(ce(e)),jo),t.rotateRight(ce(ce(e))))}else{var r=um(ce(ce(e)));Tw(r)===jo?(Ms(ce(e),js),Ms(r,js),Ms(ce(ce(e)),jo),e=ce(ce(e))):(e===um(ce(e))&&(e=ce(e),t.rotateRight(e)),Ms(ce(e),js),Ms(ce(ce(e)),jo),t.rotateLeft(ce(ce(e))))}this.root_.color=js};Mn.prototype.values=function(){var e=new lt,t=this.getFirstEntry();if(t!==null)for(e.add(t.value);(t=Mn.successor(t))!==null;)e.add(t.value);return e};Mn.prototype.entrySet=function(){var e=new i_,t=this.getFirstEntry();if(t!==null)for(e.add(t);(t=Mn.successor(t))!==null;)e.add(t);return e};Mn.prototype.rotateLeft=function(e){if(e!=null){var t=e.right;e.right=t.left,t.left!=null&&(t.left.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}};Mn.prototype.rotateRight=function(e){if(e!=null){var t=e.left;e.left=t.right,t.right!=null&&(t.right.parent=e),t.parent=e.parent,e.parent===null?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}};Mn.prototype.getFirstEntry=function(){var e=this.root_;if(e!=null)for(;e.left!=null;)e=e.left;return e};Mn.successor=function(e){if(e===null)return null;if(e.right!==null){for(var t=e.right;t.left!==null;)t=t.left;return t}else{for(var n=e.parent,r=e;n!==null&&r===n.right;)r=n,n=n.parent;return n}};Mn.prototype.size=function(){return this.size_};var df=function(){};df.prototype.interfaces_=function(){return[]};df.prototype.getClass=function(){return df};function VC(){}VC.prototype=new jp;function Ui(){this.array_=[],arguments[0]instanceof Ge&&this.addAll(arguments[0])}Ui.prototype=new VC;Ui.prototype.contains=function(e){for(var t=this,n=0,r=this.array_.length;n<r;n++){var i=t.array_[n];if(i.compareTo(e)===0)return!0}return!1};Ui.prototype.add=function(e){var t=this;if(this.contains(e))return!1;for(var n=0,r=this.array_.length;n<r;n++){var i=t.array_[n];if(i.compareTo(e)===1)return t.array_.splice(n,0,e),!0}return this.array_.push(e),!0};Ui.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next());return!0};Ui.prototype.remove=function(e){throw new Gf};Ui.prototype.size=function(){return this.array_.length};Ui.prototype.isEmpty=function(){return this.array_.length===0};Ui.prototype.toArray=function(){for(var e=this,t=[],n=0,r=this.array_.length;n<r;n++)t.push(e.array_[n]);return t};Ui.prototype.iterator=function(){return new zp(this)};var zp=function(e){this.treeSet_=e,this.position_=0};zp.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Wu;return this.treeSet_.array_[this.position_++]};zp.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};zp.prototype.remove=function(){throw new Gf};var ua=function(){};ua.sort=function(){var t=arguments[0],n,r,i,s;if(arguments.length===1)s=function(l,c){return l.compareTo(c)},t.sort(s);else if(arguments.length===2)i=arguments[1],s=function(l,c){return i.compare(l,c)},t.sort(s);else if(arguments.length===3){r=t.slice(arguments[1],arguments[2]),r.sort();var a=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length));for(t.splice(0,t.length),n=0;n<a.length;n++)t.push(a[n])}else if(arguments.length===4)for(r=t.slice(arguments[1],arguments[2]),i=arguments[3],s=function(l,c){return i.compare(l,c)},r.sort(s),a=t.slice(0,arguments[1]).concat(r,t.slice(arguments[2],t.length)),t.splice(0,t.length),n=0;n<a.length;n++)t.push(a[n])};ua.asList=function(t){for(var n=new lt,r=0,i=t.length;r<i;r++)n.add(t[r]);return n};var Qt=function(){},_i={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};_i.P.get=function(){return 0};_i.L.get=function(){return 1};_i.A.get=function(){return 2};_i.FALSE.get=function(){return-1};_i.TRUE.get=function(){return-2};_i.DONTCARE.get=function(){return-3};_i.SYM_FALSE.get=function(){return"F"};_i.SYM_TRUE.get=function(){return"T"};_i.SYM_DONTCARE.get=function(){return"*"};_i.SYM_P.get=function(){return"0"};_i.SYM_L.get=function(){return"1"};_i.SYM_A.get=function(){return"2"};Qt.prototype.interfaces_=function(){return[]};Qt.prototype.getClass=function(){return Qt};Qt.toDimensionSymbol=function(t){switch(t){case Qt.FALSE:return Qt.SYM_FALSE;case Qt.TRUE:return Qt.SYM_TRUE;case Qt.DONTCARE:return Qt.SYM_DONTCARE;case Qt.P:return Qt.SYM_P;case Qt.L:return Qt.SYM_L;case Qt.A:return Qt.SYM_A}throw new ve("Unknown dimension value: "+t)};Qt.toDimensionValue=function(t){switch(ff.toUpperCase(t)){case Qt.SYM_FALSE:return Qt.FALSE;case Qt.SYM_TRUE:return Qt.TRUE;case Qt.SYM_DONTCARE:return Qt.DONTCARE;case Qt.SYM_P:return Qt.P;case Qt.SYM_L:return Qt.L;case Qt.SYM_A:return Qt.A}throw new ve("Unknown dimension symbol: "+t)};Object.defineProperties(Qt,_i);var Vi=function(){};Vi.prototype.filter=function(t){};Vi.prototype.interfaces_=function(){return[]};Vi.prototype.getClass=function(){return Vi};var ci=function(){};ci.prototype.filter=function(t,n){};ci.prototype.isDone=function(){};ci.prototype.isGeometryChanged=function(){};ci.prototype.interfaces_=function(){return[]};ci.prototype.getClass=function(){return ci};var Hn=function(e){function t(r,i){if(e.call(this,i),this._geometries=r||[],e.hasNullElements(this._geometries))throw new ve("geometries must not contain null elements")}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new Nt,a=0;a<this._geometries.length;a++)s.expandToInclude(i._geometries[a].getEnvelopeInternal());return s},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return e.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),a=-1,l=0;l<this._geometries.length;l++)for(var c=i._geometries[l].getCoordinates(),f=0;f<c.length;f++)a++,s[a]=c[f];return s},t.prototype.getArea=function(){for(var i=this,s=0,a=0;a<this._geometries.length;a++)s+=i._geometries[a].getArea();return s},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],a=arguments[1];if(!this.isEquivalentClass(s))return!1;var l=s;if(this._geometries.length!==l._geometries.length)return!1;for(var c=0;c<this._geometries.length;c++)if(!i._geometries[c].equalsExact(l._geometries[c],a))return!1;return!0}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();ua.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,s=Qt.FALSE,a=0;a<this._geometries.length;a++)s=Math.max(s,i._geometries[a].getBoundaryDimension());return s},t.prototype.getDimension=function(){for(var i=this,s=Qt.FALSE,a=0;a<this._geometries.length;a++)s=Math.max(s,i._geometries[a].getDimension());return s},t.prototype.getLength=function(){for(var i=this,s=0,a=0;a<this._geometries.length;a++)s+=i._geometries[a].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=0,a=0;a<this._geometries.length;a++)s+=i._geometries[a].getNumPoints();return s},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,a=new Array(s).fill(null),l=0;l<this._geometries.length;l++)a[l]=i._geometries[l].reverse();return this.getFactory().createGeometryCollection(a)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],a=new Ui(ua.asList(this._geometries)),l=new Ui(ua.asList(s._geometries));return this.compare(a,l)}else if(arguments.length===2){for(var c=arguments[0],f=arguments[1],g=c,d=this.getNumGeometries(),v=g.getNumGeometries(),y=0;y<d&&y<v;){var x=i.getGeometryN(y),S=g.getGeometryN(y),C=x.compareToSameClass(S,f);if(C!==0)return C;y++}return y<d?1:y<v?-1:0}},t.prototype.apply=function(){var i=this;if(Ot(arguments[0],vs))for(var s=arguments[0],a=0;a<this._geometries.length;a++)i._geometries[a].apply(s);else if(Ot(arguments[0],ci)){var l=arguments[0];if(this._geometries.length===0)return null;for(var c=0;c<this._geometries.length&&(i._geometries[c].apply(l),!l.isDone());c++);l.isGeometryChanged()&&this.geometryChanged()}else if(Ot(arguments[0],Vi)){var f=arguments[0];f.filter(this);for(var g=0;g<this._geometries.length;g++)i._geometries[g].apply(f)}else if(Ot(arguments[0],Ws)){var d=arguments[0];d.filter(this);for(var v=0;v<this._geometries.length;v++)i._geometries[v].apply(d)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),kt.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,s=e.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var a=0;a<this._geometries.length;a++)s._geometries[a]=i._geometries[a].clone();return s},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),a=0;a<s.length;a++)s[a]=i._geometries[a].copy();return new t(s,this._factory)},t.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,n),t}(Tt),pa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return Tt.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?e.prototype.equalsExact.call(this,i,s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Qt.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,a=new Array(s).fill(null),l=0;l<this._geometries.length;l++)a[s-1-l]=i._geometries[l].reverse();return this.getFactory().createMultiLineString(a)},t.prototype.getBoundary=function(){return new Xr(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),a=0;a<s.length;a++)s[a]=i._geometries[a].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[df]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,n),t}(Hn),Xr=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],n=Qr.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=n}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Xr.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var n=this.computeBoundaryCoordinates(t);return n.length===1?this._geomFact.createPoint(n[0]):this._geomFact.createMultiPointFromCoords(n)};Xr.prototype.getBoundary=function(){return this._geom instanceof Pe?this.boundaryLineString(this._geom):this._geom instanceof pa?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()};Xr.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var n=this._bnRule.isInBoundary(2);return n?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])};Xr.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()};Xr.prototype.computeBoundaryCoordinates=function(t){var n=this,r=new lt;this._endpointMap=new Mn;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);s.getNumPoints()!==0&&(n.addEndpoint(s.getCoordinateN(0)),n.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var a=this._endpointMap.entrySet().iterator();a.hasNext();){var l=a.next(),c=l.getValue(),f=c.count;n._bnRule.isInBoundary(f)&&r.add(l.getKey())}return Vt.toCoordinateArray(r)};Xr.prototype.addEndpoint=function(t){var n=this._endpointMap.get(t);n===null&&(n=new Wd,this._endpointMap.put(t,n)),n.count++};Xr.prototype.interfaces_=function(){return[]};Xr.prototype.getClass=function(){return Xr};Xr.getBoundary=function(){if(arguments.length===1){var t=arguments[0],n=new Xr(t);return n.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new Xr(r,i);return s.getBoundary()}};var Wd=function(){this.count=null};Wd.prototype.interfaces_=function(){return[]};Wd.prototype.getClass=function(){return Wd};function SA(){}function CA(){}var NA=function(){};function PA(){}function bA(){}function LA(){}var Yr=function(){},s_={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Yr.prototype.interfaces_=function(){return[]};Yr.prototype.getClass=function(){return Yr};Yr.chars=function(t,n){for(var r=new Array(n).fill(null),i=0;i<n;i++)r[i]=t;return String(r)};Yr.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],n=new PA,r=new SA;return t.printStackTrace(r),n.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],a="";new CA(Yr.getStackTrace(i));for(var l=new LA,c=0;c<s;c++)try{a+=l.readLine()+Yr.NEWLINE}catch(f){if(f instanceof bA)kt.shouldNeverReachHere();else throw f}finally{}return a}};Yr.split=function(t,n){for(var r=n.length,i=new lt,s=""+t,a=s.indexOf(n);a>=0;){var l=s.substring(0,a);i.add(l),s=s.substring(a+r),a=s.indexOf(n)}s.length>0&&i.add(s);for(var c=new Array(i.size()).fill(null),f=0;f<c.length;f++)c[f]=i.get(f);return c};Yr.toString=function(){if(arguments.length===1){var t=arguments[0];return Yr.SIMPLE_ORDINATE_FORMAT.format(t)}};Yr.spaces=function(t){return Yr.chars(" ",t)};s_.NEWLINE.get=function(){return wn.getProperty("line.separator")};s_.SIMPLE_ORDINATE_FORMAT.get=function(){return new NA};Object.defineProperties(Yr,s_);var Me=function(){};Me.prototype.interfaces_=function(){return[]};Me.prototype.getClass=function(){return Me};Me.copyCoord=function(t,n,r,i){for(var s=Math.min(t.getDimension(),r.getDimension()),a=0;a<s;a++)r.setOrdinate(i,a,t.getOrdinate(n,a))};Me.isRing=function(t){var n=t.size();return n===0?!0:n<=3?!1:t.getOrdinate(0,Wt.X)===t.getOrdinate(n-1,Wt.X)&&t.getOrdinate(0,Wt.Y)===t.getOrdinate(n-1,Wt.Y)};Me.isEqual=function(t,n){var r=t.size(),i=n.size();if(r!==i)return!1;for(var s=Math.min(t.getDimension(),n.getDimension()),a=0;a<r;a++)for(var l=0;l<s;l++){var c=t.getOrdinate(a,l),f=n.getOrdinate(a,l);if(t.getOrdinate(a,l)!==n.getOrdinate(a,l)&&!(Rt.isNaN(c)&&Rt.isNaN(f)))return!1}return!0};Me.extend=function(t,n,r){var i=t.create(r,n.getDimension()),s=n.size();if(Me.copy(n,0,i,0,s),s>0)for(var a=s;a<r;a++)Me.copy(n,s-1,i,a,1);return i};Me.reverse=function(t){for(var n=t.size()-1,r=Math.trunc(n/2),i=0;i<=r;i++)Me.swap(t,i,n-i)};Me.swap=function(t,n,r){if(n===r)return null;for(var i=0;i<t.getDimension();i++){var s=t.getOrdinate(n,i);t.setOrdinate(n,i,t.getOrdinate(r,i)),t.setOrdinate(r,i,s)}};Me.copy=function(t,n,r,i,s){for(var a=0;a<s;a++)Me.copyCoord(t,n+a,r,i+a)};Me.toString=function(){if(arguments.length===1){var t=arguments[0],n=t.size();if(n===0)return"()";var r=t.getDimension(),i=new Ki;i.append("(");for(var s=0;s<n;s++){s>0&&i.append(" ");for(var a=0;a<r;a++)a>0&&i.append(","),i.append(Yr.toString(t.getOrdinate(s,a)))}return i.append(")"),i.toString()}};Me.ensureValidRing=function(t,n){var r=n.size();if(r===0)return n;if(r<=3)return Me.createClosedRing(t,n,4);var i=n.getOrdinate(0,Wt.X)===n.getOrdinate(r-1,Wt.X)&&n.getOrdinate(0,Wt.Y)===n.getOrdinate(r-1,Wt.Y);return i?n:Me.createClosedRing(t,n,r+1)};Me.createClosedRing=function(t,n,r){var i=t.create(r,n.getDimension()),s=n.size();Me.copy(n,0,i,0,s);for(var a=s;a<r;a++)Me.copy(n,0,i,a,1);return i};var Pe=function(e){function t(r,i){e.call(this,i),this._points=null,this.init(r)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Nt:this._points.expandEnvelope(new Nt)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return e.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],a=arguments[1];if(!this.isEquivalentClass(s))return!1;var l=s;if(this._points.size()!==l._points.size())return!1;for(var c=0;c<this._points.size();c++)if(!i.equal(i._points.getCoordinate(c),l._points.getCoordinate(c),a))return!1;return!0}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var a=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(a)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(a))>0&&Me.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Qt.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return dt.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Me.reverse(i);var s=this.getFactory().createLineString(i);return s},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],a=s,l=0,c=0;l<this._points.size()&&c<a._points.size();){var f=i._points.getCoordinate(l).compareTo(a._points.getCoordinate(c));if(f!==0)return f;l++,c++}return l<this._points.size()?1:c<a._points.size()?-1:0}else if(arguments.length===2){var g=arguments[0],d=arguments[1],v=g;return d.compare(this._points,v._points)}},t.prototype.apply=function(){var i=this;if(Ot(arguments[0],vs))for(var s=arguments[0],a=0;a<this._points.size();a++)s.filter(i._points.getCoordinate(a));else if(Ot(arguments[0],ci)){var l=arguments[0];if(this._points.size()===0)return null;for(var c=0;c<this._points.size()&&(l.filter(i._points,c),!l.isDone());c++);l.isGeometryChanged()&&this.geometryChanged()}else if(Ot(arguments[0],Vi)){var f=arguments[0];f.filter(this)}else if(Ot(arguments[0],Ws)){var g=arguments[0];g.filter(this)}},t.prototype.getBoundary=function(){return new Xr(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=e.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new ve("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var s=this,a=0;a<this._points.size();a++)if(s._points.getCoordinate(a).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[df]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,n),t}(Tt),pf=function(){};pf.prototype.interfaces_=function(){return[]};pf.prototype.getClass=function(){return pf};var gr=function(e){function t(r,i){e.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Nt;var i=new Nt;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return e.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Qt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var a=arguments[0],l=arguments[1],c=a;return l.compare(this._coordinates,c._coordinates)}},t.prototype.apply=function(){if(Ot(arguments[0],vs)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(Ot(arguments[0],ci)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(Ot(arguments[0],Vi)){var a=arguments[0];a.filter(this)}else if(Ot(arguments[0],Ws)){var l=arguments[0];l.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=e.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),kt.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[pf]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,n),t}(Tt),xo=function(){};xo.prototype.interfaces_=function(){return[]};xo.prototype.getClass=function(){return xo};var Ye=function(e){function t(r,i,s){if(e.call(this,s),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),e.hasNullElements(i))throw new ve("holes must not contain null elements");if(r.isEmpty()&&e.hasNonEmptyElements(i))throw new ve("shell is empty but holes are not");this._shell=r,this._holes=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return e.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),a=-1,l=this._shell.getCoordinates(),c=0;c<l.length;c++)a++,s[a]=l[c];for(var f=0;f<this._holes.length;f++)for(var g=i._holes[f].getCoordinates(),d=0;d<g.length;d++)a++,s[a]=g[d];return s},t.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(dt.signedArea(this._shell.getCoordinateSequence()));for(var a=0;a<this._holes.length;a++)s-=Math.abs(dt.signedArea(i._holes[a].getCoordinateSequence()));return s},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),a=0;a<5;a++){var l=i.getX(a);if(!(l===s.getMinX()||l===s.getMaxX()))return!1;var c=i.getY(a);if(!(c===s.getMinY()||c===s.getMaxY()))return!1}for(var f=i.getX(0),g=i.getY(0),d=1;d<=4;d++){var v=i.getX(d),y=i.getY(d),x=v!==f,S=y!==g;if(x===S)return!1;f=v,g=y}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],a=arguments[1];if(!this.isEquivalentClass(s))return!1;var l=s,c=this._shell,f=l._shell;if(!c.equalsExact(f,a)||this._holes.length!==l._holes.length)return!1;for(var g=0;g<this._holes.length;g++)if(!i._holes[g].equalsExact(l._holes[g],a))return!1;return!0}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);ua.sort(this._holes)}else if(arguments.length===2){var a=arguments[0],l=arguments[1];if(a.isEmpty())return null;var c=new Array(a.getCoordinates().length-1).fill(null);wn.arraycopy(a.getCoordinates(),0,c,0,c.length);var f=Vt.minCoordinate(a.getCoordinates());Vt.scroll(c,f),wn.arraycopy(c,0,a.getCoordinates(),0,c.length),a.getCoordinates()[c.length]=c[0],dt.isCCW(a.getCoordinates())===l&&Vt.reverse(a.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var a=0;a<this._holes.length;a++)s+=i._holes[a].getLength();return s},t.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),a=0;a<this._holes.length;a++)s+=i._holes[a].getNumPoints();return s},t.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)s._holes[a]=i._holes[a].copy().reverse();return s},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],a=this._shell,l=s._shell;return a.compareToSameClass(l)}else if(arguments.length===2){var c=arguments[0],f=arguments[1],g=c,d=this._shell,v=g._shell,y=d.compareToSameClass(v,f);if(y!==0)return y;for(var x=this.getNumInteriorRing(),S=g.getNumInteriorRing(),C=0;C<x&&C<S;){var E=i.getInteriorRingN(C),w=g.getInteriorRingN(C),N=E.compareToSameClass(w,f);if(N!==0)return N;C++}return C<x?1:C<S?-1:0}},t.prototype.apply=function(i){var s=this;if(Ot(i,vs)){this._shell.apply(i);for(var a=0;a<this._holes.length;a++)s._holes[a].apply(i)}else if(Ot(i,ci)){if(this._shell.apply(i),!i.isDone())for(var l=0;l<this._holes.length&&(s._holes[l].apply(i),!i.isDone());l++);i.isGeometryChanged()&&this.geometryChanged()}else if(Ot(i,Vi))i.filter(this);else if(Ot(i,Ws)){i.filter(this),this._shell.apply(i);for(var c=0;c<this._holes.length;c++)s._holes[c].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var a=0;a<this._holes.length;a++)s[a+1]=i._holes[a];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},t.prototype.clone=function(){var i=this,s=e.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var a=0;a<this._holes.length;a++)s._holes[a]=i._holes[a].clone();return s},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,s=this._shell.copy(),a=new Array(this._holes.length).fill(null),l=0;l<a.length;l++)a[l]=i._holes[l].copy();return new t(s,a,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[xo]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,n),t}(Tt),Cu=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return Tt.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?e.prototype.equalsExact.call(this,i,s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return e.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Qt.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),a=0;a<s.length;a++)s[a]=i._geometries[a].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[pf]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,n),t}(Hn),ys=function(e){function t(r,i){r instanceof M&&i instanceof Ut&&(r=i.getCoordinateSequenceFactory().create(r)),e.call(this,r,i),this.validateConstruction()}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return Tt.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Qt.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:e.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Me.reverse(i);var s=this.getFactory().createLinearRing(i);return s},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!e.prototype.isClosed.call(this))throw new ve("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ve("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,n),t}(Pe),ps=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return Tt.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?e.prototype.equalsExact.call(this,i,s):!1}else return e.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,s=this._geometries.length,a=new Array(s).fill(null),l=0;l<this._geometries.length;l++)a[l]=i._geometries[l].reverse();return this.getFactory().createMultiPolygon(a)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new lt,a=0;a<this._geometries.length;a++)for(var l=i._geometries[a],c=l.getBoundary(),f=0;f<c.getNumGeometries();f++)s.add(c.getGeometryN(f));var g=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(g))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),a=0;a<s.length;a++)s[a]=i._geometries[a].copy();return new t(s,this._factory)},t.prototype.interfaces_=function(){return[xo]},t.prototype.getClass=function(){return t},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,n),t}(Hn),Jr=function(t){this._factory=t||null,this._isUserDataCopied=!1},Bp={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Jr.prototype.setCopyUserData=function(t){this._isUserDataCopied=t};Jr.prototype.edit=function(t,n){if(t===null)return null;var r=this.editInternal(t,n);return this._isUserDataCopied&&r.setUserData(t.getUserData()),r};Jr.prototype.editInternal=function(t,n){return this._factory===null&&(this._factory=t.getFactory()),t instanceof Hn?this.editGeometryCollection(t,n):t instanceof Ye?this.editPolygon(t,n):t instanceof gr?n.edit(t,this._factory):t instanceof Pe?n.edit(t,this._factory):(kt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)};Jr.prototype.editGeometryCollection=function(t,n){for(var r=this,i=n.edit(t,this._factory),s=new lt,a=0;a<i.getNumGeometries();a++){var l=r.edit(i.getGeometryN(a),n);l===null||l.isEmpty()||s.add(l)}return i.getClass()===Cu?this._factory.createMultiPoint(s.toArray([])):i.getClass()===pa?this._factory.createMultiLineString(s.toArray([])):i.getClass()===ps?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))};Jr.prototype.editPolygon=function(t,n){var r=this,i=n.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),n);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var a=new lt,l=0;l<i.getNumInteriorRing();l++){var c=r.edit(i.getInteriorRingN(l),n);c===null||c.isEmpty()||a.add(c)}return this._factory.createPolygon(s,a.toArray([]))};Jr.prototype.interfaces_=function(){return[]};Jr.prototype.getClass=function(){return Jr};Jr.GeometryEditorOperation=function(){};Bp.NoOpGeometryOperation.get=function(){return gf};Bp.CoordinateOperation.get=function(){return mf};Bp.CoordinateSequenceOperation.get=function(){return vf};Object.defineProperties(Jr,Bp);var gf=function(){};gf.prototype.edit=function(t,n){return t};gf.prototype.interfaces_=function(){return[Jr.GeometryEditorOperation]};gf.prototype.getClass=function(){return gf};var mf=function(){};mf.prototype.edit=function(t,n){var r=this.editCoordinates(t.getCoordinates(),t);return r===null?t:t instanceof ys?n.createLinearRing(r):t instanceof Pe?n.createLineString(r):t instanceof gr?r.length>0?n.createPoint(r[0]):n.createPoint():t};mf.prototype.interfaces_=function(){return[Jr.GeometryEditorOperation]};mf.prototype.getClass=function(){return mf};var vf=function(){};vf.prototype.edit=function(t,n){return t instanceof ys?n.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Pe?n.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof gr?n.createPoint(this.edit(t.getCoordinateSequence(),t)):t};vf.prototype.interfaces_=function(){return[Jr.GeometryEditorOperation]};vf.prototype.getClass=function(){return vf};var Oe=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var r=0;r<n;r++)t._coordinates[r]=new M}else if(Ot(arguments[0],Wt)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)t._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var a=arguments[0],l=arguments[1];this._coordinates=a,this._dimension=l,a===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],f=arguments[1];this._coordinates=new Array(c).fill(null),this._dimension=f;for(var g=0;g<c;g++)t._coordinates[g]=new M}}},GC={serialVersionUID:{configurable:!0}};Oe.prototype.setOrdinate=function(t,n,r){switch(n){case Wt.X:this._coordinates[t].x=r;break;case Wt.Y:this._coordinates[t].y=r;break;case Wt.Z:this._coordinates[t].z=r;break;default:throw new ve("invalid ordinateIndex")}};Oe.prototype.size=function(){return this._coordinates.length};Oe.prototype.getOrdinate=function(t,n){switch(n){case Wt.X:return this._coordinates[t].x;case Wt.Y:return this._coordinates[t].y;case Wt.Z:return this._coordinates[t].z}return Rt.NaN};Oe.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var n=arguments[0],r=arguments[1];r.x=this._coordinates[n].x,r.y=this._coordinates[n].y,r.z=this._coordinates[n].z}};Oe.prototype.getCoordinateCopy=function(t){return new M(this._coordinates[t])};Oe.prototype.getDimension=function(){return this._dimension};Oe.prototype.getX=function(t){return this._coordinates[t].x};Oe.prototype.clone=function(){for(var t=this,n=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)n[r]=t._coordinates[r].clone();return new Oe(n,this._dimension)};Oe.prototype.expandEnvelope=function(t){for(var n=this,r=0;r<this._coordinates.length;r++)t.expandToInclude(n._coordinates[r]);return t};Oe.prototype.copy=function(){for(var t=this,n=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)n[r]=t._coordinates[r].copy();return new Oe(n,this._dimension)};Oe.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var n=new Ki(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)n.append(", "),n.append(t._coordinates[r]);return n.append(")"),n.toString()}else return"()"};Oe.prototype.getY=function(t){return this._coordinates[t].y};Oe.prototype.toCoordinateArray=function(){return this._coordinates};Oe.prototype.interfaces_=function(){return[Wt,ei]};Oe.prototype.getClass=function(){return Oe};GC.serialVersionUID.get=function(){return-0xcb44a778db18e00};Object.defineProperties(Oe,GC);var _s=function(){},o_={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};_s.prototype.readResolve=function(){return _s.instance()};_s.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new Oe(t)}else if(Ot(arguments[0],Wt)){var n=arguments[0];return new Oe(n)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new Oe(r):new Oe(r,i)}};_s.prototype.interfaces_=function(){return[yu,ei]};_s.prototype.getClass=function(){return _s};_s.instance=function(){return _s.instanceObject};o_.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};o_.instanceObject.get=function(){return new _s};Object.defineProperties(_s,o_);var qC=function(e){function t(){e.call(this),this.map_=new Map}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r){return this.map_.get(r)||null},t.prototype.put=function(r,i){return this.map_.set(r,i),i},t.prototype.values=function(){for(var r=new lt,i=this.map_.values(),s=i.next();!s.done;)r.add(s.value),s=i.next();return r},t.prototype.entrySet=function(){var r=new i_;return this.map_.entries().forEach(function(i){return r.add(i)}),r},t.prototype.size=function(){return this.map_.size()},t}(bl),$t=function e(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=e.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Gi){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},a_={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};$t.prototype.equals=function(t){if(!(t instanceof $t))return!1;var n=t;return this._modelType===n._modelType&&this._scale===n._scale};$t.prototype.compareTo=function(t){var n=t,r=this.getMaximumSignificantDigits(),i=n.getMaximumSignificantDigits();return new Bi(r).compareTo(new Bi(i))};$t.prototype.getScale=function(){return this._scale};$t.prototype.isFloating=function(){return this._modelType===$t.FLOATING||this._modelType===$t.FLOATING_SINGLE};$t.prototype.getType=function(){return this._modelType};$t.prototype.toString=function(){var t="UNKNOWN";return this._modelType===$t.FLOATING?t="Floating":this._modelType===$t.FLOATING_SINGLE?t="Floating-Single":this._modelType===$t.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};$t.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(Rt.isNaN(t))return t;if(this._modelType===$t.FLOATING_SINGLE){var n=t;return n}return this._modelType===$t.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof M){var r=arguments[0];if(this._modelType===$t.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}};$t.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===$t.FLOATING?t=16:this._modelType===$t.FLOATING_SINGLE?t=6:this._modelType===$t.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};$t.prototype.setScale=function(t){this._scale=Math.abs(t)};$t.prototype.interfaces_=function(){return[ei,ti]};$t.prototype.getClass=function(){return $t};$t.mostPrecise=function(t,n){return t.compareTo(n)>=0?t:n};a_.serialVersionUID.get=function(){return 7777263578777804e3};a_.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties($t,a_);var Gi=function e(t){this._name=t||null,e.nameToTypeMap.put(t,this)},l_={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Gi.prototype.readResolve=function(){return Gi.nameToTypeMap.get(this._name)};Gi.prototype.toString=function(){return this._name};Gi.prototype.interfaces_=function(){return[ei]};Gi.prototype.getClass=function(){return Gi};l_.serialVersionUID.get=function(){return-552860263173159e4};l_.nameToTypeMap.get=function(){return new qC};Object.defineProperties(Gi,l_);$t.Type=Gi;$t.FIXED=new Gi("FIXED");$t.FLOATING=new Gi("FLOATING");$t.FLOATING_SINGLE=new Gi("FLOATING SINGLE");var Ut=function e(){this._precisionModel=new $t,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?Ot(arguments[0],yu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof $t&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},HC={serialVersionUID:{configurable:!0}};Ut.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new M(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new M(t.getMinX(),t.getMinY()),new M(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new M(t.getMinX(),t.getMinY()),new M(t.getMinX(),t.getMaxY()),new M(t.getMaxX(),t.getMaxY()),new M(t.getMaxX(),t.getMinY()),new M(t.getMinX(),t.getMinY())]),null)};Ut.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Pe(this.getCoordinateSequenceFactory().create(t),this);if(Ot(t,Wt))return new Pe(t,this)}else return new Pe(this.getCoordinateSequenceFactory().create([]),this)};Ut.prototype.createMultiLineString=function(){if(arguments.length===0)return new pa(null,this);if(arguments.length===1){var t=arguments[0];return new pa(t,this)}};Ut.prototype.buildGeometry=function(t){for(var n=null,r=!1,i=!1,s=t.iterator();s.hasNext();){var a=s.next(),l=a.getClass();n===null&&(n=l),l!==n&&(r=!0),a.isGeometryCollectionOrDerived()&&(i=!0)}if(n===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(Ut.toGeometryArray(t));var c=t.iterator().next(),f=t.size()>1;if(f){if(c instanceof Ye)return this.createMultiPolygon(Ut.toPolygonArray(t));if(c instanceof Pe)return this.createMultiLineString(Ut.toLineStringArray(t));if(c instanceof gr)return this.createMultiPoint(Ut.toPointArray(t));kt.shouldNeverReachHere("Unhandled class: "+c.getClass().getName())}return c};Ut.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};Ut.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(Ot(arguments[0],Wt)){var n=arguments[0];return new gr(n,this)}}};Ut.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};Ut.prototype.createPolygon=function(){if(arguments.length===0)return new Ye(null,null,this);if(arguments.length===1){if(Ot(arguments[0],Wt)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}else if(arguments[0]instanceof ys){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new Ye(i,s,this)}};Ut.prototype.getSRID=function(){return this._SRID};Ut.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Hn(null,this);if(arguments.length===1){var t=arguments[0];return new Hn(t,this)}};Ut.prototype.createGeometry=function(t){var n=new Jr(this);return n.edit(t,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})};Ut.prototype.getPrecisionModel=function(){return this._precisionModel};Ut.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(Ot(arguments[0],Wt)){var n=arguments[0];return new ys(n,this)}}};Ut.prototype.createMultiPolygon=function(){if(arguments.length===0)return new ps(null,this);if(arguments.length===1){var t=arguments[0];return new ps(t,this)}};Ut.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Cu(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new Cu(n,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(Ot(arguments[0],Wt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),a=0;a<i.size();a++){var l=t.getCoordinateSequenceFactory().create(1,i.getDimension());Me.copy(i,a,l,0,1),s[a]=t.createPoint(l)}return this.createMultiPoint(s)}}};Ut.prototype.interfaces_=function(){return[ei]};Ut.prototype.getClass=function(){return Ut};Ut.toMultiPolygonArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toGeometryArray=function(t){if(t===null)return null;var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.getDefaultCoordinateSequenceFactory=function(){return _s.instance()};Ut.toMultiLineStringArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toLineStringArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toMultiPointArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toLinearRingArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toPointArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.toPolygonArray=function(t){var n=new Array(t.size()).fill(null);return t.toArray(n)};Ut.createPointFromInternalCoord=function(t,n){return n.getPrecisionModel().makePrecise(t),n.getFactory().createPoint(t)};HC.serialVersionUID.get=function(){return-6820524753094096e3};Object.defineProperties(Ut,HC);var IA=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Up=function(t){this.geometryFactory=t||new Ut};Up.prototype.read=function(t){var n;typeof t=="string"?n=JSON.parse(t):n=t;var r=n.type;if(!Ii[r])throw new Error("Unknown GeoJSON type: "+n.type);return IA.indexOf(r)!==-1?Ii[r].apply(this,[n.coordinates]):r==="GeometryCollection"?Ii[r].apply(this,[n.geometries]):Ii[r].apply(this,[n])};Up.prototype.write=function(t){var n=t.getGeometryType();if(!ks[n])throw new Error("Geometry is not supported");return ks[n].apply(this,[t])};var Ii={Feature:function(e){var t={};for(var n in e)t[n]=e[n];if(e.geometry){var r=e.geometry.type;if(!Ii[r])throw new Error("Unknown GeoJSON type: "+e.type);t.geometry=this.read(e.geometry)}return e.bbox&&(t.bbox=Ii.bbox.apply(this,[e.bbox])),t},FeatureCollection:function(e){var t=this,n={};if(e.features){n.features=[];for(var r=0;r<e.features.length;++r)n.features.push(t.read(e.features[r]))}return e.bbox&&(n.bbox=this.parse.bbox.apply(this,[e.bbox])),n},coordinates:function(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];t.push(new M(r[0],r[1]))}return t},bbox:function(e){return this.geometryFactory.createLinearRing([new M(e[0],e[1]),new M(e[2],e[1]),new M(e[2],e[3]),new M(e[0],e[3]),new M(e[0],e[1])])},Point:function(e){var t=new M(e[0],e[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(e){for(var t=this,n=[],r=0;r<e.length;++r)n.push(Ii.Point.apply(t,[e[r]]));return this.geometryFactory.createMultiPoint(n)},LineString:function(e){var t=Ii.coordinates.apply(this,[e]);return this.geometryFactory.createLineString(t)},MultiLineString:function(e){for(var t=this,n=[],r=0;r<e.length;++r)n.push(Ii.LineString.apply(t,[e[r]]));return this.geometryFactory.createMultiLineString(n)},Polygon:function(e){for(var t=this,n=Ii.coordinates.apply(this,[e[0]]),r=this.geometryFactory.createLinearRing(n),i=[],s=1;s<e.length;++s){var a=e[s],l=Ii.coordinates.apply(t,[a]),c=t.geometryFactory.createLinearRing(l);i.push(c)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(e){for(var t=this,n=[],r=0;r<e.length;++r){var i=e[r];n.push(Ii.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(n)},GeometryCollection:function(e){for(var t=this,n=[],r=0;r<e.length;++r){var i=e[r];n.push(t.read(i))}return this.geometryFactory.createGeometryCollection(n)}},ks={coordinate:function(e){return[e.x,e.y]},Point:function(e){var t=ks.coordinate.apply(this,[e.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(e){for(var t=this,n=[],r=0;r<e._geometries.length;++r){var i=e._geometries[r],s=ks.Point.apply(t,[i]);n.push(s.coordinates)}return{type:"MultiPoint",coordinates:n}},LineString:function(e){for(var t=this,n=[],r=e.getCoordinates(),i=0;i<r.length;++i){var s=r[i];n.push(ks.coordinate.apply(t,[s]))}return{type:"LineString",coordinates:n}},MultiLineString:function(e){for(var t=this,n=[],r=0;r<e._geometries.length;++r){var i=e._geometries[r],s=ks.LineString.apply(t,[i]);n.push(s.coordinates)}return{type:"MultiLineString",coordinates:n}},Polygon:function(e){var t=this,n=[],r=ks.LineString.apply(this,[e._shell]);n.push(r.coordinates);for(var i=0;i<e._holes.length;++i){var s=e._holes[i],a=ks.LineString.apply(t,[s]);n.push(a.coordinates)}return{type:"Polygon",coordinates:n}},MultiPolygon:function(e){for(var t=this,n=[],r=0;r<e._geometries.length;++r){var i=e._geometries[r],s=ks.Polygon.apply(t,[i]);n.push(s.coordinates)}return{type:"MultiPolygon",coordinates:n}},GeometryCollection:function(e){for(var t=this,n=[],r=0;r<e._geometries.length;++r){var i=e._geometries[r],s=i.getGeometryType();n.push(ks[s].apply(t,[i]))}return{type:"GeometryCollection",geometries:n}}},u_=function(t){this.geometryFactory=t||new Ut,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Up(this.geometryFactory)};u_.prototype.read=function(t){var n=this.parser.read(t);return this.precisionModel.getType()===$t.FIXED&&this.reducePrecision(n),n};u_.prototype.reducePrecision=function(t){var n=this,r,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(r=0,i=t.points.length;r<i;r++)n.precisionModel.makePrecise(t.points[r]);else if(t.geometries)for(r=0,i=t.geometries.length;r<i;r++)n.reducePrecision(t.geometries[r])};var ZC=function(){this.parser=new Up(this.geometryFactory)};ZC.prototype.write=function(t){return this.parser.write(t)};var rt=function(){},Vp={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};rt.prototype.interfaces_=function(){return[]};rt.prototype.getClass=function(){return rt};rt.opposite=function(t){return t===rt.LEFT?rt.RIGHT:t===rt.RIGHT?rt.LEFT:t};Vp.ON.get=function(){return 0};Vp.LEFT.get=function(){return 1};Vp.RIGHT.get=function(){return 2};Object.defineProperties(rt,Vp);function Gp(e){this.message=e||""}Gp.prototype=new Error;Gp.prototype.name="EmptyStackException";function Qi(){this.array_=[]}Qi.prototype=new ai;Qi.prototype.add=function(e){return this.array_.push(e),!0};Qi.prototype.get=function(e){if(e<0||e>=this.size())throw new Error;return this.array_[e]};Qi.prototype.push=function(e){return this.array_.push(e),e};Qi.prototype.pop=function(e){if(this.array_.length===0)throw new Gp;return this.array_.pop()};Qi.prototype.peek=function(){if(this.array_.length===0)throw new Gp;return this.array_[this.array_.length-1]};Qi.prototype.empty=function(){return this.array_.length===0};Qi.prototype.isEmpty=function(){return this.empty()};Qi.prototype.search=function(e){return this.array_.indexOf(e)};Qi.prototype.size=function(){return this.array_.length};Qi.prototype.toArray=function(){for(var e=this,t=[],n=0,r=this.array_.length;n<r;n++)t.push(e.array_[n]);return t};var qi=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};qi.prototype.getCoordinate=function(){return this._minCoord};qi.prototype.getRightmostSide=function(t,n){var r=this.getRightmostSideOfSegment(t,n);return r<0&&(r=this.getRightmostSideOfSegment(t,n-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),r};qi.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();kt.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var n=t[this._minIndex-1],r=t[this._minIndex+1],i=dt.computeOrientation(this._minCoord,r,n),s=!1;(n.y<this._minCoord.y&&r.y<this._minCoord.y&&i===dt.COUNTERCLOCKWISE||n.y>this._minCoord.y&&r.y>this._minCoord.y&&i===dt.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)};qi.prototype.getRightmostSideOfSegment=function(t,n){var r=t.getEdge(),i=r.getCoordinates();if(n<0||n+1>=i.length||i[n].y===i[n+1].y)return-1;var s=rt.LEFT;return i[n].y<i[n+1].y&&(s=rt.RIGHT),s};qi.prototype.getEdge=function(){return this._orientedDe};qi.prototype.checkForRightmostCoordinate=function(t){for(var n=this,r=t.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(n._minCoord===null||r[i].x>n._minCoord.x)&&(n._minDe=t,n._minIndex=i,n._minCoord=r[i])};qi.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),n=t.getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};qi.prototype.findEdge=function(t){for(var n=this,r=t.iterator();r.hasNext();){var i=r.next();i.isForward()&&n.checkForRightmostCoordinate(i)}kt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===rt.LEFT&&(this._orientedDe=this._minDe.getSym())};qi.prototype.interfaces_=function(){return[]};qi.prototype.getClass=function(){return qi};var Xs=function(e){function t(n,r){e.call(this,t.msgWithCoord(n,r)),this.pt=r?new M(r):null,this.name="TopologyException"}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},t}(Zs),qp=function(){this.array_=[]};qp.prototype.addLast=function(t){this.array_.push(t)};qp.prototype.removeFirst=function(){return this.array_.shift()};qp.prototype.isEmpty=function(){return this.array_.length===0};var Zn=function(){this._finder=null,this._dirEdgeList=new lt,this._nodes=new lt,this._rightMostCoord=null,this._env=null,this._finder=new qi};Zn.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var n=t.next();n.setVisited(!1)}};Zn.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};Zn.prototype.computeNodeDepth=function(t){for(var n=this,r=null,i=t.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){r=s;break}}if(r===null)throw new Xs("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(r);for(var a=t.getEdges().iterator();a.hasNext();){var l=a.next();l.setVisited(!0),n.copySymDepths(l)}};Zn.prototype.computeDepth=function(t){this.clearVisitedEdges();var n=this._finder.getEdge();n.setEdgeDepths(rt.RIGHT,t),this.copySymDepths(n),this.computeDepths(n)};Zn.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};Zn.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var n=t.next();n.getDepth(rt.RIGHT)>=1&&n.getDepth(rt.LEFT)<=0&&!n.isInteriorAreaEdge()&&n.setInResult(!0)}};Zn.prototype.computeDepths=function(t){var n=this,r=new i_,i=new qp,s=t.getNode();for(i.addLast(s),r.add(s),t.setVisited(!0);!i.isEmpty();){var a=i.removeFirst();r.add(a),n.computeNodeDepth(a);for(var l=a.getEdges().iterator();l.hasNext();){var c=l.next(),f=c.getSym();if(!f.isVisited()){var g=f.getNode();r.contains(g)||(i.addLast(g),r.add(g))}}}};Zn.prototype.compareTo=function(t){var n=t;return this._rightMostCoord.x<n._rightMostCoord.x?-1:this._rightMostCoord.x>n._rightMostCoord.x?1:0};Zn.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Nt,n=this._dirEdgeList.iterator();n.hasNext();)for(var r=n.next(),i=r.getEdge().getCoordinates(),s=0;s<i.length-1;s++)t.expandToInclude(i[s]);this._env=t}return this._env};Zn.prototype.addReachable=function(t){var n=this,r=new Qi;for(r.add(t);!r.empty();){var i=r.pop();n.add(i,r)}};Zn.prototype.copySymDepths=function(t){var n=t.getSym();n.setDepth(rt.LEFT,t.getDepth(rt.RIGHT)),n.setDepth(rt.RIGHT,t.getDepth(rt.LEFT))};Zn.prototype.add=function(t,n){var r=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var s=i.next();r._dirEdgeList.add(s);var a=s.getSym(),l=a.getNode();l.isVisited()||n.push(l)}};Zn.prototype.getNodes=function(){return this._nodes};Zn.prototype.getDirectedEdges=function(){return this._dirEdgeList};Zn.prototype.interfaces_=function(){return[ti]};Zn.prototype.getClass=function(){return Zn};var fe=function e(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];this.init(n.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[rt.ON]=r}else if(arguments[0]instanceof e){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)t.location[s]=i.location[s]}}else if(arguments.length===3){var a=arguments[0],l=arguments[1],c=arguments[2];this.init(3),this.location[rt.ON]=a,this.location[rt.LEFT]=l,this.location[rt.RIGHT]=c}};fe.prototype.setAllLocations=function(t){for(var n=this,r=0;r<this.location.length;r++)n.location[r]=t};fe.prototype.isNull=function(){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]!==k.NONE)return!1;return!0};fe.prototype.setAllLocationsIfNull=function(t){for(var n=this,r=0;r<this.location.length;r++)n.location[r]===k.NONE&&(n.location[r]=t)};fe.prototype.isLine=function(){return this.location.length===1};fe.prototype.merge=function(t){var n=this;if(t.location.length>this.location.length){var r=new Array(3).fill(null);r[rt.ON]=this.location[rt.ON],r[rt.LEFT]=k.NONE,r[rt.RIGHT]=k.NONE,this.location=r}for(var i=0;i<this.location.length;i++)n.location[i]===k.NONE&&i<t.location.length&&(n.location[i]=t.location[i])};fe.prototype.getLocations=function(){return this.location};fe.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[rt.LEFT];this.location[rt.LEFT]=this.location[rt.RIGHT],this.location[rt.RIGHT]=t};fe.prototype.toString=function(){var t=new Ki;return this.location.length>1&&t.append(k.toLocationSymbol(this.location[rt.LEFT])),t.append(k.toLocationSymbol(this.location[rt.ON])),this.location.length>1&&t.append(k.toLocationSymbol(this.location[rt.RIGHT])),t.toString()};fe.prototype.setLocations=function(t,n,r){this.location[rt.ON]=t,this.location[rt.LEFT]=n,this.location[rt.RIGHT]=r};fe.prototype.get=function(t){return t<this.location.length?this.location[t]:k.NONE};fe.prototype.isArea=function(){return this.location.length>1};fe.prototype.isAnyNull=function(){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]===k.NONE)return!0;return!1};fe.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(rt.ON,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.location[n]=r}};fe.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(k.NONE)};fe.prototype.isEqualOnSide=function(t,n){return this.location[n]===t.location[n]};fe.prototype.allPositionsEqual=function(t){for(var n=this,r=0;r<this.location.length;r++)if(n.location[r]!==t)return!1;return!0};fe.prototype.interfaces_=function(){return[]};fe.prototype.getClass=function(){return fe};var ie=function e(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new fe(t),this.elt[1]=new fe(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.elt[0]=new fe(n.elt[0]),this.elt[1]=new fe(n.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new fe(k.NONE),this.elt[1]=new fe(k.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],l=arguments[2];this.elt[0]=new fe(s,a,l),this.elt[1]=new fe(s,a,l)}else if(arguments.length===4){var c=arguments[0],f=arguments[1],g=arguments[2],d=arguments[3];this.elt[0]=new fe(k.NONE,k.NONE,k.NONE),this.elt[1]=new fe(k.NONE,k.NONE,k.NONE),this.elt[c].setLocations(f,g,d)}};ie.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t};ie.prototype.setAllLocations=function(t,n){this.elt[t].setAllLocations(n)};ie.prototype.isNull=function(t){return this.elt[t].isNull()};ie.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.elt[n].setAllLocationsIfNull(r)}};ie.prototype.isLine=function(t){return this.elt[t].isLine()};ie.prototype.merge=function(t){for(var n=this,r=0;r<2;r++)n.elt[r]===null&&t.elt[r]!==null?n.elt[r]=new fe(t.elt[r]):n.elt[r].merge(t.elt[r])};ie.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()};ie.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(rt.ON)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.elt[n].get(r)}};ie.prototype.toString=function(){var t=new Ki;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()};ie.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}};ie.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()};ie.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setLocation(rt.ON,n)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this.elt[r].setLocation(i,s)}};ie.prototype.isEqualOnSide=function(t,n){return this.elt[0].isEqualOnSide(t.elt[0],n)&&this.elt[1].isEqualOnSide(t.elt[1],n)};ie.prototype.allPositionsEqual=function(t,n){return this.elt[t].allPositionsEqual(n)};ie.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new fe(this.elt[t].location[0]))};ie.prototype.interfaces_=function(){return[]};ie.prototype.getClass=function(){return ie};ie.toLineLabel=function(t){for(var n=new ie(k.NONE),r=0;r<2;r++)n.setLocation(r,t.getLocation(r));return n};var ze=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new lt,this._pts=new lt,this._label=new ie(k.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new lt,this._geometryFactory=null;var t=arguments[0],n=arguments[1];this._geometryFactory=n,this.computePoints(t),this.computeRing()};ze.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)n[r]=t._pts.get(r);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=dt.isCCW(this._ring.getCoordinates())};ze.prototype.isIsolated=function(){return this._label.getGeometryCount()===1};ze.prototype.computePoints=function(t){var n=this;this._startDe=t;var r=t,i=!0;do{if(r===null)throw new Xs("Found null DirectedEdge");if(r.getEdgeRing()===n)throw new Xs("Directed Edge visited twice during ring-building at "+r.getCoordinate());n._edges.add(r);var s=r.getLabel();kt.isTrue(s.isArea()),n.mergeLabel(s),n.addPoints(r.getEdge(),r.isForward(),i),i=!1,n.setEdgeRing(r,n),r=n.getNext(r)}while(r!==this._startDe)};ze.prototype.getLinearRing=function(){return this._ring};ze.prototype.getCoordinate=function(t){return this._pts.get(t)};ze.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var n=this._startDe;do{var r=n.getNode(),i=r.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),n=t.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2};ze.prototype.addPoints=function(t,n,r){var i=this,s=t.getCoordinates();if(n){var a=1;r&&(a=0);for(var l=a;l<s.length;l++)i._pts.add(s[l])}else{var c=s.length-2;r&&(c=s.length-1);for(var f=c;f>=0;f--)i._pts.add(s[f])}};ze.prototype.isHole=function(){return this._isHole};ze.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};ze.prototype.containsPoint=function(t){var n=this.getLinearRing(),r=n.getEnvelopeInternal();if(!r.contains(t)||!dt.isPointInRing(t,n.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(t))return!1}return!0};ze.prototype.addHole=function(t){this._holes.add(t)};ze.prototype.isShell=function(){return this._shell===null};ze.prototype.getLabel=function(){return this._label};ze.prototype.getEdges=function(){return this._edges};ze.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};ze.prototype.getShell=function(){return this._shell};ze.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=n.getLocation(r,rt.RIGHT);if(i===k.NONE)return null;if(this._label.getLocation(r)===k.NONE)return this._label.setLocation(r,i),null}};ze.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};ze.prototype.toPolygon=function(t){for(var n=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=n._holes.get(i).getLinearRing();var s=t.createPolygon(this.getLinearRing(),r);return s};ze.prototype.interfaces_=function(){return[]};ze.prototype.getClass=function(){return ze};var TA=function(e){function t(){var n=arguments[0],r=arguments[1];e.call(this,n,r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},t.prototype.getNext=function(r){return r.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ze),OA=function(e){function t(){var n=arguments[0],r=arguments[1];e.call(this,n,r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var r=this,i=new lt,s=this._startDe;do{if(s.getMinEdgeRing()===null){var a=new TA(s,r._geometryFactory);i.add(a)}s=s.getNext()}while(s!==this._startDe);return i},t.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(r){return r.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ze),Or=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._label=t}}};Or.prototype.setVisited=function(t){this._isVisited=t};Or.prototype.setInResult=function(t){this._isInResult=t};Or.prototype.isCovered=function(){return this._isCovered};Or.prototype.isCoveredSet=function(){return this._isCoveredSet};Or.prototype.setLabel=function(t){this._label=t};Or.prototype.getLabel=function(){return this._label};Or.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0};Or.prototype.updateIM=function(t){kt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)};Or.prototype.isInResult=function(){return this._isInResult};Or.prototype.isVisited=function(){return this._isVisited};Or.prototype.interfaces_=function(){return[]};Or.prototype.getClass=function(){return Or};var Hp=function(e){function t(){e.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new ie(0,k.NONE)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(r){},t.prototype.computeMergedLocation=function(r,i){var s=k.NONE;if(s=this._label.getLocation(i),!r.isNull(i)){var a=r.getLocation(i);s!==k.BOUNDARY&&(s=a)}return s},t.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new ie(r,i):this._label.setLocation(r,i)}else return e.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof ie)for(var s=arguments[0],a=0;a<2;a++){var l=r.computeMergedLocation(s,a),c=r._label.getLocation(a);c===k.NONE&&r._label.setLocation(a,l)}},t.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},t.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=k.NONE;this._label!==null&&(i=this._label.getLocation(r));var s=null;switch(i){case k.BOUNDARY:s=k.INTERIOR;break;case k.INTERIOR:s=k.BOUNDARY;break;default:s=k.BOUNDARY;break}this._label.setLocation(r,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Or),Hi=function(){this.nodeMap=new Mn,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Hi.prototype.find=function(t){return this.nodeMap.get(t)};Hi.prototype.addNode=function(){if(arguments[0]instanceof M){var t=arguments[0],n=this.nodeMap.get(t);return n===null&&(n=this.nodeFact.createNode(t),this.nodeMap.put(t,n)),n}else if(arguments[0]instanceof Hp){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}};Hi.prototype.print=function(t){for(var n=this.iterator();n.hasNext();){var r=n.next();r.print(t)}};Hi.prototype.iterator=function(){return this.nodeMap.values().iterator()};Hi.prototype.values=function(){return this.nodeMap.values()};Hi.prototype.getBoundaryNodes=function(t){for(var n=new lt,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(t)===k.BOUNDARY&&n.add(i)}return n};Hi.prototype.add=function(t){var n=t.getCoordinate(),r=this.addNode(n);r.add(t)};Hi.prototype.interfaces_=function(){return[]};Hi.prototype.getClass=function(){return Hi};var oe=function(){},qf={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};oe.prototype.interfaces_=function(){return[]};oe.prototype.getClass=function(){return oe};oe.isNorthern=function(t){return t===oe.NE||t===oe.NW};oe.isOpposite=function(t,n){if(t===n)return!1;var r=(t-n+4)%4;return r===2};oe.commonHalfPlane=function(t,n){if(t===n)return t;var r=(t-n+4)%4;if(r===2)return-1;var i=t<n?t:n,s=t>n?t:n;return i===0&&s===3?3:i};oe.isInHalfPlane=function(t,n){return n===oe.SE?t===oe.SE||t===oe.SW:t===n||t===n+1};oe.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];if(t===0&&n===0)throw new ve("Cannot compute the quadrant for point ( "+t+", "+n+" )");return t>=0?n>=0?oe.NE:oe.SE:n>=0?oe.NW:oe.SW}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new ve("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?oe.NE:oe.SE:i.y>=r.y?oe.NW:oe.SW}};qf.NE.get=function(){return 0};qf.NW.get=function(){return 1};qf.SW.get=function(){return 2};qf.SE.get=function(){return 3};Object.defineProperties(oe,qf);var An=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2],s=null;this._edge=n,this.init(r,i),this._label=s}else if(arguments.length===4){var a=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this._edge=a,this.init(l,c),this._label=f}};An.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:dt.computeOrientation(t._p0,t._p1,this._p1)};An.prototype.getDy=function(){return this._dy};An.prototype.getCoordinate=function(){return this._p0};An.prototype.setNode=function(t){this._node=t};An.prototype.print=function(t){var n=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),s=r.substring(i+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label)};An.prototype.compareTo=function(t){var n=t;return this.compareDirection(n)};An.prototype.getDirectedCoordinate=function(){return this._p1};An.prototype.getDx=function(){return this._dx};An.prototype.getLabel=function(){return this._label};An.prototype.getEdge=function(){return this._edge};An.prototype.getQuadrant=function(){return this._quadrant};An.prototype.getNode=function(){return this._node};An.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label};An.prototype.computeLabel=function(t){};An.prototype.init=function(t,n){this._p0=t,this._p1=n,this._dx=n.x-t.x,this._dy=n.y-t.y,this._quadrant=oe.quadrant(this._dx,this._dy),kt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")};An.prototype.interfaces_=function(){return[ti]};An.prototype.getClass=function(){return An};var Ov=function(e){function t(){var n=arguments[0],r=arguments[1];if(e.call(this,n),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(n.getCoordinate(0),n.getCoordinate(1));else{var i=n.getNumPoints()-1;this.init(n.getCoordinate(i),n.getCoordinate(i-1))}this.computeDirectedLabel()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(r){return this._depth[r]},t.prototype.setVisited=function(r){this._isVisited=r},t.prototype.computeDirectedLabel=function(){this._label=new ie(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new Xs("assigned depths do not match",this.getCoordinate());this._depth[r]=i},t.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,s=0;s<2;s++)r._label.isArea(s)&&r._label.getLocation(s,rt.LEFT)===k.INTERIOR&&r._label.getLocation(s,rt.RIGHT)===k.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(r){this._nextMin=r},t.prototype.print=function(r){e.prototype.print.call(this,r),r.print(" "+this._depth[rt.LEFT]+"/"+this._depth[rt.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},t.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},t.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,k.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,k.EXTERIOR);return r&&i&&s},t.prototype.setEdgeRing=function(r){this._edgeRing=r},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},t.prototype.setInResult=function(r){this._isInResult=r},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},t.prototype.setSym=function(r){this._sym=r},t.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},t.prototype.setEdgeDepths=function(r,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var a=1;r===rt.LEFT&&(a=-1);var l=rt.opposite(r),c=s*a,f=i+c;this.setDepth(r,i),this.setDepth(l,f)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(r){this._next=r},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(r,i){return r===k.EXTERIOR&&i===k.INTERIOR?1:r===k.INTERIOR&&i===k.EXTERIOR?-1:0},t}(An),Nu=function(){};Nu.prototype.createNode=function(t){return new Hp(t,null)};Nu.prototype.interfaces_=function(){return[]};Nu.prototype.getClass=function(){return Nu};var xe=function(){if(this._edges=new lt,this._nodes=null,this._edgeEndList=new lt,arguments.length===0)this._nodes=new Hi(new Nu);else if(arguments.length===1){var t=arguments[0];this._nodes=new Hi(t)}};xe.prototype.printEdges=function(t){var n=this;t.println("Edges:");for(var r=0;r<this._edges.size();r++){t.println("edge "+r+":");var i=n._edges.get(r);i.print(t),i.eiList.print(t)}};xe.prototype.find=function(t){return this._nodes.find(t)};xe.prototype.addNode=function(){if(arguments[0]instanceof Hp){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof M){var n=arguments[0];return this._nodes.addNode(n)}};xe.prototype.getNodeIterator=function(){return this._nodes.iterator()};xe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var n=t.next();n.getEdges().linkResultDirectedEdges()}};xe.prototype.debugPrintln=function(t){wn.out.println(t)};xe.prototype.isBoundaryNode=function(t,n){var r=this._nodes.find(n);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(t)===k.BOUNDARY};xe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var n=t.next();n.getEdges().linkAllDirectedEdges()}};xe.prototype.matchInSameDirection=function(t,n,r,i){return t.equals(r)?dt.computeOrientation(t,n,i)===dt.COLLINEAR&&oe.quadrant(t,n)===oe.quadrant(r,i):!1};xe.prototype.getEdgeEnds=function(){return this._edgeEndList};xe.prototype.debugPrint=function(t){wn.out.print(t)};xe.prototype.getEdgeIterator=function(){return this._edges.iterator()};xe.prototype.findEdgeInSameDirection=function(t,n){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),a=s.getCoordinates();if(r.matchInSameDirection(t,n,a[0],a[1])||r.matchInSameDirection(t,n,a[a.length-1],a[a.length-2]))return s}return null};xe.prototype.insertEdge=function(t){this._edges.add(t)};xe.prototype.findEdgeEnd=function(t){for(var n=this.getEdgeEnds().iterator();n.hasNext();){var r=n.next();if(r.getEdge()===t)return r}return null};xe.prototype.addEdges=function(t){for(var n=this,r=t.iterator();r.hasNext();){var i=r.next();n._edges.add(i);var s=new Ov(i,!0),a=new Ov(i,!1);s.setSym(a),a.setSym(s),n.add(s),n.add(a)}};xe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)};xe.prototype.getNodes=function(){return this._nodes.values()};xe.prototype.findEdge=function(t,n){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),a=s.getCoordinates();if(t.equals(a[0])&&n.equals(a[1]))return s}return null};xe.prototype.interfaces_=function(){return[]};xe.prototype.getClass=function(){return xe};xe.linkResultDirectedEdges=function(t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.getEdges().linkResultDirectedEdges()}};var mr=function(){this._geometryFactory=null,this._shellList=new lt;var t=arguments[0];this._geometryFactory=t};mr.prototype.sortShellsAndHoles=function(t,n,r){for(var i=t.iterator();i.hasNext();){var s=i.next();s.isHole()?r.add(s):n.add(s)}};mr.prototype.computePolygons=function(t){for(var n=this,r=new lt,i=t.iterator();i.hasNext();){var s=i.next(),a=s.toPolygon(n._geometryFactory);r.add(a)}return r};mr.prototype.placeFreeHoles=function(t,n){for(var r=this,i=n.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var a=r.findEdgeRingContaining(s,t);if(a===null)throw new Xs("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(a)}}};mr.prototype.buildMinimalEdgeRings=function(t,n,r){for(var i=this,s=new lt,a=t.iterator();a.hasNext();){var l=a.next();if(l.getMaxNodeDegree()>2){l.linkDirectedEdgesForMinimalEdgeRings();var c=l.buildMinimalRings(),f=i.findShell(c);f!==null?(i.placePolygonHoles(f,c),n.add(f)):r.addAll(c)}else s.add(l)}return s};mr.prototype.containsPoint=function(t){for(var n=this._shellList.iterator();n.hasNext();){var r=n.next();if(r.containsPoint(t))return!0}return!1};mr.prototype.buildMaximalEdgeRings=function(t){for(var n=this,r=new lt,i=t.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var a=new OA(s,n._geometryFactory);r.add(a),a.setInResult()}}return r};mr.prototype.placePolygonHoles=function(t,n){for(var r=n.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(t)}};mr.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};mr.prototype.findEdgeRingContaining=function(t,n){for(var r=t.getLinearRing(),i=r.getEnvelopeInternal(),s=r.getCoordinateN(0),a=null,l=null,c=n.iterator();c.hasNext();){var f=c.next(),g=f.getLinearRing(),d=g.getEnvelopeInternal();a!==null&&(l=a.getLinearRing().getEnvelopeInternal());var v=!1;d.contains(i)&&dt.isPointInRing(s,g.getCoordinates())&&(v=!0),v&&(a===null||l.contains(d))&&(a=f)}return a};mr.prototype.findShell=function(t){for(var n=0,r=null,i=t.iterator();i.hasNext();){var s=i.next();s.isHole()||(r=s,n++)}return kt.isTrue(n<=1,"found two shells in MinimalEdgeRing list"),r};mr.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var n=arguments[0],r=arguments[1];xe.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(n),s=new lt,a=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(a,this._shellList,s),this.placeFreeHoles(this._shellList,s)}};mr.prototype.interfaces_=function(){return[]};mr.prototype.getClass=function(){return mr};var Pu=function(){};Pu.prototype.getBounds=function(){};Pu.prototype.interfaces_=function(){return[]};Pu.prototype.getClass=function(){return Pu};var fi=function(){this._bounds=null,this._item=null;var t=arguments[0],n=arguments[1];this._bounds=t,this._item=n};fi.prototype.getItem=function(){return this._item};fi.prototype.getBounds=function(){return this._bounds};fi.prototype.interfaces_=function(){return[Pu,ei]};fi.prototype.getClass=function(){return fi};var Ys=function(){this._size=null,this._items=null,this._size=0,this._items=new lt,this._items.add(null)};Ys.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t};Ys.prototype.size=function(){return this._size};Ys.prototype.reorder=function(t){for(var n=this,r=null,i=this._items.get(t);t*2<=this._size&&(r=t*2,r!==n._size&&n._items.get(r+1).compareTo(n._items.get(r))<0&&r++,n._items.get(r).compareTo(i)<0);t=r)n._items.set(t,n._items.get(r));this._items.set(t,i)};Ys.prototype.clear=function(){this._size=0,this._items.clear()};Ys.prototype.isEmpty=function(){return this._size===0};Ys.prototype.add=function(t){var n=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)n._items.set(r,n._items.get(Math.trunc(r/2)));this._items.set(r,t)};Ys.prototype.interfaces_=function(){return[]};Ys.prototype.getClass=function(){return Ys};var wo=function(){};wo.prototype.visitItem=function(t){};wo.prototype.interfaces_=function(){return[]};wo.prototype.getClass=function(){return wo};var fl=function(){};fl.prototype.insert=function(t,n){};fl.prototype.remove=function(t,n){};fl.prototype.query=function(){};fl.prototype.interfaces_=function(){return[]};fl.prototype.getClass=function(){return fl};var Ze=function(){if(this._childBoundables=new lt,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},WC={serialVersionUID:{configurable:!0}};Ze.prototype.getLevel=function(){return this._level};Ze.prototype.size=function(){return this._childBoundables.size()};Ze.prototype.getChildBoundables=function(){return this._childBoundables};Ze.prototype.addChildBoundable=function(t){kt.isTrue(this._bounds===null),this._childBoundables.add(t)};Ze.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Ze.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Ze.prototype.interfaces_=function(){return[Pu,ei]};Ze.prototype.getClass=function(){return Ze};WC.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Ze,WC);var hi=function(){};hi.reverseOrder=function(){return{compare:function(n,r){return r.compareTo(n)}}};hi.min=function(t){return hi.sort(t),t.get(0)};hi.sort=function(t,n){var r=t.toArray();n?ua.sort(r,n):ua.sort(r);for(var i=t.iterator(),s=0,a=r.length;s<a;s++)i.next(),i.set(r[s])};hi.singletonList=function(t){var n=new lt;return n.add(t),n};var Fe=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],n=arguments[1],r=arguments[2];this._boundable1=t,this._boundable2=n,this._itemDistance=r,this._distance=this.distance()};Fe.prototype.expandToQueue=function(t,n){var r=Fe.isComposite(this._boundable1),i=Fe.isComposite(this._boundable2);if(r&&i)return Fe.area(this._boundable1)>Fe.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,n),null):(this.expand(this._boundable2,this._boundable1,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,t,n),null;if(i)return this.expand(this._boundable2,this._boundable1,t,n),null;throw new ve("neither boundable is composite")};Fe.prototype.isLeaves=function(){return!(Fe.isComposite(this._boundable1)||Fe.isComposite(this._boundable2))};Fe.prototype.compareTo=function(t){var n=t;return this._distance<n._distance?-1:this._distance>n._distance?1:0};Fe.prototype.expand=function(t,n,r,i){for(var s=this,a=t.getChildBoundables(),l=a.iterator();l.hasNext();){var c=l.next(),f=new Fe(c,n,s._itemDistance);f.getDistance()<i&&r.add(f)}};Fe.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2};Fe.prototype.getDistance=function(){return this._distance};Fe.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())};Fe.prototype.interfaces_=function(){return[ti]};Fe.prototype.getClass=function(){return Fe};Fe.area=function(t){return t.getBounds().getArea()};Fe.isComposite=function(t){return t instanceof Ze};var an=function e(){if(this._root=null,this._built=!1,this._itemBoundables=new lt,this._nodeCapacity=null,arguments.length===0){var t=e.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var n=arguments[0];kt.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},Zp={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};an.prototype.getNodeCapacity=function(){return this._nodeCapacity};an.prototype.lastNode=function(t){return t.get(t.size()-1)};an.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=arguments[0],r=0,i=n.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Ze?r+=t.size(s):s instanceof fi&&(r+=1)}return r}};an.prototype.removeItem=function(t,n){for(var r=null,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof fi&&s.getItem()===n&&(r=s)}return r!==null?(t.getChildBoundables().remove(r),!0):!1};an.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new lt:n}else if(arguments.length===1){for(var r=arguments[0],i=new lt,s=r.getChildBoundables().iterator();s.hasNext();){var a=s.next();if(a instanceof Ze){var l=t.itemsTree(a);l!==null&&i.add(l)}else a instanceof fi?i.add(a.getItem()):kt.shouldNeverReachHere()}return i.size()<=0?null:i}};an.prototype.insert=function(t,n){kt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new fi(t,n))};an.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var n=arguments[0],r=new lt;return this.boundablesAtLevel(n,this._root,r),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2];if(kt.isTrue(i>-2),s.getLevel()===i)return a.add(s),null;for(var l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();c instanceof Ze?t.boundablesAtLevel(i,c,a):(kt.isTrue(c instanceof fi),i===-1&&a.add(c))}return null}};an.prototype.query=function(){var t=this;if(arguments.length===1){var n=arguments[0];this.build();var r=new lt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r),r}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(Ot(arguments[2],wo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var a=arguments[0],l=arguments[1],c=arguments[2],f=l.getChildBoundables(),g=0;g<f.size();g++){var d=f.get(g);t.getIntersectsOp().intersects(d.getBounds(),a)&&(d instanceof Ze?t.query(a,d,c):d instanceof fi?c.visitItem(d.getItem()):kt.shouldNeverReachHere())}else if(Ot(arguments[2],ai)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var v=arguments[0],y=arguments[1],x=arguments[2],S=y.getChildBoundables(),C=0;C<S.size();C++){var E=S.get(C);t.getIntersectsOp().intersects(E.getBounds(),v)&&(E instanceof Ze?t.query(v,E,x):E instanceof fi?x.add(E.getItem()):kt.shouldNeverReachHere())}}};an.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0};an.prototype.getRoot=function(){return this.build(),this._root};an.prototype.remove=function(){var t=this;if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),n)?this.remove(n,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2],l=this.removeItem(s,a);if(l)return!0;for(var c=null,f=s.getChildBoundables().iterator();f.hasNext();){var g=f.next();if(t.getIntersectsOp().intersects(g.getBounds(),i)&&g instanceof Ze&&(l=t.remove(i,g,a),l)){c=g;break}}return c!==null&&c.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(c),l}};an.prototype.createHigherLevels=function(t,n){kt.isTrue(!t.isEmpty());var r=this.createParentBoundables(t,n+1);return r.size()===1?r.get(0):this.createHigherLevels(r,n+1)};an.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=arguments[0],r=0,i=n.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Ze){var a=t.depth(s);a>r&&(r=a)}}return r+1}};an.prototype.createParentBoundables=function(t,n){var r=this;kt.isTrue(!t.isEmpty());var i=new lt;i.add(this.createNode(n));var s=new lt(t);hi.sort(s,this.getComparator());for(var a=s.iterator();a.hasNext();){var l=a.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(n)),r.lastNode(i).addChildBoundable(l)}return i};an.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};an.prototype.interfaces_=function(){return[ei]};an.prototype.getClass=function(){return an};an.compareDoubles=function(t,n){return t>n?1:t<n?-1:0};Zp.IntersectsOp.get=function(){return RA};Zp.serialVersionUID.get=function(){return-3886435814360241e3};Zp.DEFAULT_NODE_CAPACITY.get=function(){return 10};Object.defineProperties(an,Zp);var RA=function(){},bu=function(){};bu.prototype.distance=function(t,n){};bu.prototype.interfaces_=function(){return[]};bu.prototype.getClass=function(){return bu};var XC=function(e){function t(r){r=r||t.DEFAULT_NODE_CAPACITY,e.call(this,r)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var a=this;kt.isTrue(i.length>0);for(var l=new lt,c=0;c<i.length;c++)l.addAll(a.createParentBoundablesFromVerticalSlice(i[c],s));return l},t.prototype.createNode=function(i){return new Rw(i)},t.prototype.size=function(){return arguments.length===0?e.prototype.size.call(this):e.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;e.prototype.insert.call(this,i,s)}else return e.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,s){for(var a=Math.trunc(Math.ceil(i.size()/s)),l=new Array(s).fill(null),c=i.iterator(),f=0;f<s;f++){l[f]=new lt;for(var g=0;c.hasNext()&&g<a;){var d=c.next();l[f].add(d),g++}}return l},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return e.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];e.prototype.query.call(this,s,a)}else if(arguments.length===3){if(Ot(arguments[2],wo)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var l=arguments[0],c=arguments[1],f=arguments[2];e.prototype.query.call(this,l,c,f)}else if(Ot(arguments[2],ai)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var g=arguments[0],d=arguments[1],v=arguments[2];e.prototype.query.call(this,g,d,v)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return e.prototype.createParentBoundables.call(this,i,s)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return e.prototype.remove.call(this,i,s)}else return e.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?e.prototype.depth.call(this):e.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,s){kt.isTrue(!i.isEmpty());var a=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),l=new lt(i);hi.sort(l,t.xComparator);var c=this.verticalSlices(l,Math.trunc(Math.ceil(Math.sqrt(a))));return this.createParentBoundablesFromVerticalSlices(c,s)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(Ot(arguments[0],bu)){var i=arguments[0],s=new Fe(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof Fe){var a=arguments[0];return this.nearestNeighbour(a,Rt.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&Ot(arguments[1],bu)){var l=arguments[0],c=arguments[1],f=new Fe(this.getRoot(),l.getRoot(),c);return this.nearestNeighbour(f)}else if(arguments[0]instanceof Fe&&typeof arguments[1]=="number"){var g=arguments[0],d=arguments[1],v=d,y=null,x=new Ys;for(x.add(g);!x.isEmpty()&&v>0;){var S=x.poll(),C=S.getDistance();if(C>=v)break;S.isLeaves()?(v=C,y=S):S.expandToQueue(x,v)}return[y.getBoundable(0).getItem(),y.getBoundable(1).getItem()]}}else if(arguments.length===3){var E=arguments[0],w=arguments[1],N=arguments[2],I=new fi(E,w),R=new Fe(this.getRoot(),I,N);return this.nearestNeighbour(R)[0]}},t.prototype.interfaces_=function(){return[fl,ei]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,s){return(i+s)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},n.STRtreeNode.get=function(){return Rw},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[vu]},compare:function(r,i){return e.compareDoubles(t.centreX(r.getBounds()),t.centreX(i.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[vu]},compare:function(r,i){return e.compareDoubles(t.centreY(r.getBounds()),t.centreY(i.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[e.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,n),t}(an),Rw=function(e){function t(){var n=arguments[0];e.call(this,n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();r===null?r=new Nt(s.getBounds()):r.expandToInclude(s.getBounds())}return r},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ze),Jn=function(){};Jn.prototype.interfaces_=function(){return[]};Jn.prototype.getClass=function(){return Jn};Jn.relativeSign=function(t,n){return t<n?-1:t>n?1:0};Jn.compare=function(t,n,r){if(n.equals2D(r))return 0;var i=Jn.relativeSign(n.x,r.x),s=Jn.relativeSign(n.y,r.y);switch(t){case 0:return Jn.compareValue(i,s);case 1:return Jn.compareValue(s,i);case 2:return Jn.compareValue(s,-i);case 3:return Jn.compareValue(-i,s);case 4:return Jn.compareValue(-i,-s);case 5:return Jn.compareValue(-s,-i);case 6:return Jn.compareValue(-s,i);case 7:return Jn.compareValue(i,-s)}return kt.shouldNeverReachHere("invalid octant value"),0};Jn.compareValue=function(t,n){return t<0?-1:t>0?1:n<0?-1:n>0?1:0};var Eo=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this._segString=t,this.coord=new M(n),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!n.equals2D(t.getCoordinate(r))};Eo.prototype.getCoordinate=function(){return this.coord};Eo.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};Eo.prototype.compareTo=function(t){var n=t;return this.segmentIndex<n.segmentIndex?-1:this.segmentIndex>n.segmentIndex?1:this.coord.equals2D(n.coord)?0:Jn.compare(this._segmentOctant,this.coord,n.coord)};Eo.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};Eo.prototype.isInterior=function(){return this._isInterior};Eo.prototype.interfaces_=function(){return[ti]};Eo.prototype.getClass=function(){return Eo};var Wn=function(){this._nodeMap=new Mn,this._edge=null;var t=arguments[0];this._edge=t};Wn.prototype.getSplitCoordinates=function(){var t=this,n=new Vf;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next();t.addEdgeCoordinates(i,s,n),i=s}return n.toCoordinateArray()};Wn.prototype.addCollapsedNodes=function(){var t=this,n=new lt;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var r=n.iterator();r.hasNext();){var i=r.next().intValue();t.add(t._edge.getCoordinate(i),i)}};Wn.prototype.print=function(t){t.println("Intersections:");for(var n=this.iterator();n.hasNext();){var r=n.next();r.print(t)}};Wn.prototype.findCollapsesFromExistingVertices=function(t){for(var n=this,r=0;r<this._edge.size()-2;r++){var i=n._edge.getCoordinate(r),s=n._edge.getCoordinate(r+2);i.equals2D(s)&&t.add(new Bi(r+1))}};Wn.prototype.addEdgeCoordinates=function(t,n,r){var i=this,s=this._edge.getCoordinate(n.segmentIndex),a=n.isInterior()||!n.coord.equals2D(s);r.add(new M(t.coord),!1);for(var l=t.segmentIndex+1;l<=n.segmentIndex;l++)r.add(i._edge.getCoordinate(l));a&&r.add(new M(n.coord))};Wn.prototype.iterator=function(){return this._nodeMap.values().iterator()};Wn.prototype.addSplitEdges=function(t){var n=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),a=n.createSplitEdge(i,s);t.add(a),i=s}};Wn.prototype.findCollapseIndex=function(t,n,r){if(!t.coord.equals2D(n.coord))return!1;var i=n.segmentIndex-t.segmentIndex;return n.isInterior()||i--,i===1?(r[0]=t.segmentIndex+1,!0):!1};Wn.prototype.findCollapsesFromInsertedNodes=function(t){for(var n=this,r=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var a=i.next(),l=n.findCollapseIndex(s,a,r);l&&t.add(new Bi(r[0])),s=a}};Wn.prototype.getEdge=function(){return this._edge};Wn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)};Wn.prototype.createSplitEdge=function(t,n){var r=this,i=n.segmentIndex-t.segmentIndex+2,s=this._edge.getCoordinate(n.segmentIndex),a=n.isInterior()||!n.coord.equals2D(s);a||i--;var l=new Array(i).fill(null),c=0;l[c++]=new M(t.coord);for(var f=t.segmentIndex+1;f<=n.segmentIndex;f++)l[c++]=r._edge.getCoordinate(f);return a&&(l[c]=new M(n.coord)),new Ae(l,this._edge.getData())};Wn.prototype.add=function(t,n){var r=new Eo(this._edge,t,n,this._edge.getSegmentOctant(n)),i=this._nodeMap.get(r);return i!==null?(kt.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)};Wn.prototype.checkSplitEdgesCorrectness=function(t){var n=this._edge.getCoordinates(),r=t.get(0),i=r.getCoordinate(0);if(!i.equals2D(n[0]))throw new Zs("bad split edge start point at "+i);var s=t.get(t.size()-1),a=s.getCoordinates(),l=a[a.length-1];if(!l.equals2D(n[n.length-1]))throw new Zs("bad split edge end point at "+l)};Wn.prototype.interfaces_=function(){return[]};Wn.prototype.getClass=function(){return Wn};var hl=function(){};hl.prototype.interfaces_=function(){return[]};hl.prototype.getClass=function(){return hl};hl.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];if(t===0&&n===0)throw new ve("Cannot compute the octant for point ( "+t+", "+n+" )");var r=Math.abs(t),i=Math.abs(n);return t>=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var s=arguments[0],a=arguments[1],l=a.x-s.x,c=a.y-s.y;if(l===0&&c===0)throw new ve("Cannot compute the octant for two identical points "+s);return hl.octant(l,c)}};var xs=function(){};xs.prototype.getCoordinates=function(){};xs.prototype.size=function(){};xs.prototype.getCoordinate=function(t){};xs.prototype.isClosed=function(){};xs.prototype.setData=function(t){};xs.prototype.getData=function(){};xs.prototype.interfaces_=function(){return[]};xs.prototype.getClass=function(){return xs};var yf=function(){};yf.prototype.addIntersection=function(t,n){};yf.prototype.interfaces_=function(){return[xs]};yf.prototype.getClass=function(){return yf};var Ae=function(){this._nodeList=new Wn(this),this._pts=null,this._data=null;var t=arguments[0],n=arguments[1];this._pts=t,this._data=n};Ae.prototype.getCoordinates=function(){return this._pts};Ae.prototype.size=function(){return this._pts.length};Ae.prototype.getCoordinate=function(t){return this._pts[t]};Ae.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Ae.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};Ae.prototype.setData=function(t){this._data=t};Ae.prototype.safeOctant=function(t,n){return t.equals2D(n)?0:hl.octant(t,n)};Ae.prototype.getData=function(){return this._data};Ae.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1];this.addIntersectionNode(t,n)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[3],a=new M(r.getIntersection(s));this.addIntersection(a,i)}};Ae.prototype.toString=function(){return ui.toLineString(new Oe(this._pts))};Ae.prototype.getNodeList=function(){return this._nodeList};Ae.prototype.addIntersectionNode=function(t,n){var r=n,i=r+1;if(i<this._pts.length){var s=this._pts[i];t.equals2D(s)&&(r=i)}var a=this._nodeList.add(t,r);return a};Ae.prototype.addIntersections=function(t,n,r){for(var i=this,s=0;s<t.getIntersectionNum();s++)i.addIntersection(t,n,r,s)};Ae.prototype.interfaces_=function(){return[yf]};Ae.prototype.getClass=function(){return Ae};Ae.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],n=new lt;return Ae.getNodedSubstrings(t,n),n}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],s=r.iterator();s.hasNext();){var a=s.next();a.getNodeList().addSplitEdges(i)}};var Pt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new M,this.p1=new M;else if(arguments.length===1){var t=arguments[0];this.p0=new M(t.p0),this.p1=new M(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[2],s=arguments[3];this.p0=new M(n,r),this.p1=new M(i,s)}},YC={serialVersionUID:{configurable:!0}};Pt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)};Pt.prototype.orientationIndex=function(){if(arguments[0]instanceof Pt){var t=arguments[0],n=dt.orientationIndex(this.p0,this.p1,t.p0),r=dt.orientationIndex(this.p0,this.p1,t.p1);return n>=0&&r>=0||n<=0&&r<=0?Math.max(n,r):0}else if(arguments[0]instanceof M){var i=arguments[0];return dt.orientationIndex(this.p0,this.p1,i)}};Pt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};Pt.prototype.isVertical=function(){return this.p0.x===this.p1.x};Pt.prototype.equals=function(t){if(!(t instanceof Pt))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)};Pt.prototype.intersection=function(t){var n=new Ta;return n.computeIntersection(this.p0,this.p1,t.p0,t.p1),n.hasIntersection()?n.getIntersection(0):null};Pt.prototype.project=function(){if(arguments[0]instanceof M){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new M(t);var n=this.projectionFactor(t),r=new M;return r.x=this.p0.x+n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof Pt){var i=arguments[0],s=this.projectionFactor(i.p0),a=this.projectionFactor(i.p1);if(s>=1&&a>=1||s<=0&&a<=0)return null;var l=this.project(i.p0);s<0&&(l=this.p0),s>1&&(l=this.p1);var c=this.project(i.p1);return a<0&&(c=this.p0),a>1&&(c=this.p1),new Pt(l,c)}};Pt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};Pt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};Pt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};Pt.prototype.distancePerpendicular=function(t){return dt.distancePointLinePerpendicular(t,this.p0,this.p1)};Pt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};Pt.prototype.midPoint=function(){return Pt.midPoint(this.p0,this.p1)};Pt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var n=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=n*n+r*r;if(i<=0)return Rt.NaN;var s=((t.x-this.p0.x)*n+(t.y-this.p0.y)*r)/i;return s};Pt.prototype.closestPoints=function(t){var n=this.intersection(t);if(n!==null)return[n,n];var r=new Array(2).fill(null),i=Rt.MAX_VALUE,s=null,a=this.closestPoint(t.p0);i=a.distance(t.p0),r[0]=a,r[1]=t.p0;var l=this.closestPoint(t.p1);s=l.distance(t.p1),s<i&&(i=s,r[0]=l,r[1]=t.p1);var c=t.closestPoint(this.p0);s=c.distance(this.p0),s<i&&(i=s,r[0]=this.p0,r[1]=c);var f=t.closestPoint(this.p1);return s=f.distance(this.p1),s<i&&(i=s,r[0]=this.p1,r[1]=f),r};Pt.prototype.closestPoint=function(t){var n=this.projectionFactor(t);if(n>0&&n<1)return this.project(t);var r=this.p0.distance(t),i=this.p1.distance(t);return r<i?this.p0:this.p1};Pt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)};Pt.prototype.getLength=function(){return this.p0.distance(this.p1)};Pt.prototype.compareTo=function(t){var n=t,r=this.p0.compareTo(n.p0);return r!==0?r:this.p1.compareTo(n.p1)};Pt.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t};Pt.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)};Pt.prototype.lineIntersection=function(t){try{var n=oi.intersection(this.p0,this.p1,t.p0,t.p1);return n}catch(r){if(!(r instanceof Hu))throw r}finally{}return null};Pt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)};Pt.prototype.pointAlongOffset=function(t,n){var r=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,l=Math.sqrt(s*s+a*a),c=0,f=0;if(n!==0){if(l<=0)throw new Error("Cannot compute offset from zero-length line segment");c=n*s/l,f=n*a/l}var g=r-f,d=i+c,v=new M(g,d);return v};Pt.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.p0.x=n.x,this.p0.y=n.y,this.p1.x=r.x,this.p1.y=r.y}};Pt.prototype.segmentFraction=function(t){var n=this.projectionFactor(t);return n<0?n=0:(n>1||Rt.isNaN(n))&&(n=1),n};Pt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};Pt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};Pt.prototype.distance=function(){if(arguments[0]instanceof Pt){var t=arguments[0];return dt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof M){var n=arguments[0];return dt.distancePointLine(n,this.p0,this.p1)}};Pt.prototype.pointAlong=function(t){var n=new M;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n};Pt.prototype.hashCode=function(){var t=Rt.doubleToLongBits(this.p0.x);t^=Rt.doubleToLongBits(this.p0.y)*31;var n=Math.trunc(t)^Math.trunc(t>>32),r=Rt.doubleToLongBits(this.p1.x);r^=Rt.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return n^i};Pt.prototype.interfaces_=function(){return[ti,ei]};Pt.prototype.getClass=function(){return Pt};Pt.midPoint=function(t,n){return new M((t.x+n.x)/2,(t.y+n.y)/2)};YC.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(Pt,YC);var _f=function(){this.tempEnv1=new Nt,this.tempEnv2=new Nt,this._overlapSeg1=new Pt,this._overlapSeg2=new Pt};_f.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];t.getLineSegment(n,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}};_f.prototype.interfaces_=function(){return[]};_f.prototype.getClass=function(){return _f};var vr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this._pts=t,this._start=n,this._end=r,this._context=i};vr.prototype.getLineSegment=function(t,n){n.p0=this._pts[t],n.p1=this._pts[t+1]};vr.prototype.computeSelect=function(t,n,r,i){var s=this._pts[n],a=this._pts[r];if(i.tempEnv1.init(s,a),r-n===1)return i.select(this,n),null;if(!t.intersects(i.tempEnv1))return null;var l=Math.trunc((n+r)/2);n<l&&this.computeSelect(t,n,l,i),l<r&&this.computeSelect(t,l,r,i)};vr.prototype.getCoordinates=function(){for(var t=this,n=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)n[r++]=t._pts[i];return n};vr.prototype.computeOverlaps=function(t,n){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,n)};vr.prototype.setId=function(t){this._id=t};vr.prototype.select=function(t,n){this.computeSelect(t,this._start,this._end,n)};vr.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],n=this._pts[this._end];this._env=new Nt(t,n)}return this._env};vr.prototype.getEndIndex=function(){return this._end};vr.prototype.getStartIndex=function(){return this._start};vr.prototype.getContext=function(){return this._context};vr.prototype.getId=function(){return this._id};vr.prototype.computeOverlapsInternal=function(t,n,r,i,s,a){var l=this._pts[t],c=this._pts[n],f=r._pts[i],g=r._pts[s];if(n-t===1&&s-i===1)return a.overlap(this,t,r,i),null;if(a.tempEnv1.init(l,c),a.tempEnv2.init(f,g),!a.tempEnv1.intersects(a.tempEnv2))return null;var d=Math.trunc((t+n)/2),v=Math.trunc((i+s)/2);t<d&&(i<v&&this.computeOverlapsInternal(t,d,r,i,v,a),v<s&&this.computeOverlapsInternal(t,d,r,v,s,a)),d<n&&(i<v&&this.computeOverlapsInternal(d,n,r,i,v,a),v<s&&this.computeOverlapsInternal(d,n,r,v,s,a))};vr.prototype.interfaces_=function(){return[]};vr.prototype.getClass=function(){return vr};var Fi=function(){};Fi.prototype.interfaces_=function(){return[]};Fi.prototype.getClass=function(){return Fi};Fi.getChainStartIndices=function(t){var n=0,r=new lt;r.add(new Bi(n));do{var i=Fi.findChainEnd(t,n);r.add(new Bi(i)),n=i}while(n<t.length-1);var s=Fi.toIntArray(r);return s};Fi.findChainEnd=function(t,n){for(var r=n;r<t.length-1&&t[r].equals2D(t[r+1]);)r++;if(r>=t.length-1)return t.length-1;for(var i=oe.quadrant(t[r],t[r+1]),s=n+1;s<t.length;){if(!t[s-1].equals2D(t[s])){var a=oe.quadrant(t[s-1],t[s]);if(a!==i)break}s++}return s-1};Fi.getChains=function(){if(arguments.length===1){var t=arguments[0];return Fi.getChains(t,null)}else if(arguments.length===2){for(var n=arguments[0],r=arguments[1],i=new lt,s=Fi.getChainStartIndices(n),a=0;a<s.length-1;a++){var l=new vr(n,s[a],s[a+1],r);i.add(l)}return i}};Fi.toIntArray=function(t){for(var n=new Array(t.size()).fill(null),r=0;r<n.length;r++)n[r]=t.get(r).intValue();return n};var ga=function(){};ga.prototype.computeNodes=function(t){};ga.prototype.getNodedSubstrings=function(){};ga.prototype.interfaces_=function(){return[]};ga.prototype.getClass=function(){return ga};var xf=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};xf.prototype.setSegmentIntersector=function(t){this._segInt=t};xf.prototype.interfaces_=function(){return[ga]};xf.prototype.getClass=function(){return xf};var c_=function(e){function t(r){r?e.call(this,r):e.call(this),this._monoChains=new lt,this._index=new XC,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return Ae.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var s=this,a=Fi.getChains(i.getCoordinates(),i),l=a.iterator();l.hasNext();){var c=l.next();c.setId(s._idCounter++),s._index.insert(c.getEnvelope(),c),s._monoChains.add(c)}},t.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var a=i.iterator();a.hasNext();)s.add(a.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,s=new Mw(this._segInt),a=this._monoChains.iterator();a.hasNext();)for(var l=a.next(),c=i._index.query(l.getEnvelope()),f=c.iterator();f.hasNext();){var g=f.next();if(g.getId()>l.getId()&&(l.computeOverlaps(g,s),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return Mw},Object.defineProperties(t,n),t}(xf),Mw=function(e){function t(){e.call(this),this._si=null;var n=arguments[0];this._si=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[2],a=arguments[3],l=r.getContext(),c=s.getContext();this._si.processIntersections(l,i,c,a)}else return e.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(_f),Jt=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(a),this.setMitreLimit(l)}}},$s={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Jt.prototype.getEndCapStyle=function(){return this._endCapStyle};Jt.prototype.isSingleSided=function(){return this._isSingleSided};Jt.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=Jt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Jt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Jt.JOIN_ROUND&&(this._quadrantSegments=Jt.DEFAULT_QUADRANT_SEGMENTS)};Jt.prototype.getJoinStyle=function(){return this._joinStyle};Jt.prototype.setJoinStyle=function(t){this._joinStyle=t};Jt.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};Jt.prototype.getSimplifyFactor=function(){return this._simplifyFactor};Jt.prototype.getQuadrantSegments=function(){return this._quadrantSegments};Jt.prototype.setEndCapStyle=function(t){this._endCapStyle=t};Jt.prototype.getMitreLimit=function(){return this._mitreLimit};Jt.prototype.setMitreLimit=function(t){this._mitreLimit=t};Jt.prototype.setSingleSided=function(t){this._isSingleSided=t};Jt.prototype.interfaces_=function(){return[]};Jt.prototype.getClass=function(){return Jt};Jt.bufferDistanceError=function(t){var n=Math.PI/2/t;return 1-Math.cos(n/2)};$s.CAP_ROUND.get=function(){return 1};$s.CAP_FLAT.get=function(){return 2};$s.CAP_SQUARE.get=function(){return 3};$s.JOIN_ROUND.get=function(){return 1};$s.JOIN_MITRE.get=function(){return 2};$s.JOIN_BEVEL.get=function(){return 3};$s.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};$s.DEFAULT_MITRE_LIMIT.get=function(){return 5};$s.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(Jt,$s);var be=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=dt.COUNTERCLOCKWISE,this._inputLine=t||null},Hf={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};be.prototype.isDeletable=function(t,n,r,i){var s=this._inputLine[t],a=this._inputLine[n],l=this._inputLine[r];return!this.isConcave(s,a,l)||!this.isShallow(s,a,l,i)?!1:this.isShallowSampled(s,a,t,r,i)};be.prototype.deleteShallowConcavities=function(){for(var t=this,n=1,r=this.findNextNonDeletedIndex(n),i=this.findNextNonDeletedIndex(r),s=!1;i<this._inputLine.length;){var a=!1;t.isDeletable(n,r,i,t._distanceTol)&&(t._isDeleted[r]=be.DELETE,a=!0,s=!0),a?n=i:n=r,r=t.findNextNonDeletedIndex(n),i=t.findNextNonDeletedIndex(r)}return s};be.prototype.isShallowConcavity=function(t,n,r,i){var s=dt.computeOrientation(t,n,r),a=s===this._angleOrientation;if(!a)return!1;var l=dt.distancePointLine(n,t,r);return l<i};be.prototype.isShallowSampled=function(t,n,r,i,s){var a=this,l=Math.trunc((i-r)/be.NUM_PTS_TO_CHECK);l<=0&&(l=1);for(var c=r;c<i;c+=l)if(!a.isShallow(t,n,a._inputLine[c],s))return!1;return!0};be.prototype.isConcave=function(t,n,r){var i=dt.computeOrientation(t,n,r),s=i===this._angleOrientation;return s};be.prototype.simplify=function(t){var n=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=dt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=n.deleteShallowConcavities();while(r);return this.collapseLine()};be.prototype.findNextNonDeletedIndex=function(t){for(var n=t+1;n<this._inputLine.length&&this._isDeleted[n]===be.DELETE;)n++;return n};be.prototype.isShallow=function(t,n,r,i){var s=dt.distancePointLine(n,t,r);return s<i};be.prototype.collapseLine=function(){for(var t=this,n=new Vf,r=0;r<this._inputLine.length;r++)t._isDeleted[r]!==be.DELETE&&n.add(t._inputLine[r]);return n.toCoordinateArray()};be.prototype.interfaces_=function(){return[]};be.prototype.getClass=function(){return be};be.simplify=function(t,n){var r=new be(t);return r.simplify(n)};Hf.INIT.get=function(){return 0};Hf.DELETE.get=function(){return 1};Hf.KEEP.get=function(){return 1};Hf.NUM_PTS_TO_CHECK.get=function(){return 10};Object.defineProperties(be,Hf);var Rr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new lt},KC={COORDINATE_ARRAY_TYPE:{configurable:!0}};Rr.prototype.getCoordinates=function(){var t=this._ptList.toArray(Rr.COORDINATE_ARRAY_TYPE);return t};Rr.prototype.setPrecisionModel=function(t){this._precisionModel=t};Rr.prototype.addPt=function(t){var n=new M(t);if(this._precisionModel.makePrecise(n),this.isRedundant(n))return null;this._ptList.add(n)};Rr.prototype.revere=function(){};Rr.prototype.addPts=function(t,n){var r=this;if(n)for(var i=0;i<t.length;i++)r.addPt(t[i]);else for(var s=t.length-1;s>=0;s--)r.addPt(t[s])};Rr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var n=this._ptList.get(this._ptList.size()-1),r=t.distance(n);return r<this._minimimVertexDistance};Rr.prototype.toString=function(){var t=new Ut,n=t.createLineString(this.getCoordinates());return n.toString()};Rr.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new M(this._ptList.get(0)),n=this._ptList.get(this._ptList.size()-1);if(t.equals(n))return null;this._ptList.add(t)};Rr.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t};Rr.prototype.interfaces_=function(){return[]};Rr.prototype.getClass=function(){return Rr};KC.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)};Object.defineProperties(Rr,KC);var Ht=function(){},Ll={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ht.prototype.interfaces_=function(){return[]};Ht.prototype.getClass=function(){return Ht};Ht.toDegrees=function(t){return t*180/Math.PI};Ht.normalize=function(t){for(;t>Math.PI;)t-=Ht.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ht.PI_TIMES_2;return t};Ht.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=r.x-n.x,s=r.y-n.y;return Math.atan2(s,i)}};Ht.isAcute=function(t,n,r){var i=t.x-n.x,s=t.y-n.y,a=r.x-n.x,l=r.y-n.y,c=i*a+s*l;return c>0};Ht.isObtuse=function(t,n,r){var i=t.x-n.x,s=t.y-n.y,a=r.x-n.x,l=r.y-n.y,c=i*a+s*l;return c<0};Ht.interiorAngle=function(t,n,r){var i=Ht.angle(n,t),s=Ht.angle(n,r);return Math.abs(s-i)};Ht.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ht.PI_TIMES_2;t>=Ht.PI_TIMES_2&&(t=0)}else{for(;t>=Ht.PI_TIMES_2;)t-=Ht.PI_TIMES_2;t<0&&(t=0)}return t};Ht.angleBetween=function(t,n,r){var i=Ht.angle(n,t),s=Ht.angle(n,r);return Ht.diff(i,s)};Ht.diff=function(t,n){var r=null;return t<n?r=n-t:r=t-n,r>Math.PI&&(r=2*Math.PI-r),r};Ht.toRadians=function(t){return t*Math.PI/180};Ht.getTurn=function(t,n){var r=Math.sin(n-t);return r>0?Ht.COUNTERCLOCKWISE:r<0?Ht.CLOCKWISE:Ht.NONE};Ht.angleBetweenOriented=function(t,n,r){var i=Ht.angle(n,t),s=Ht.angle(n,r),a=s-i;return a<=-Math.PI?a+Ht.PI_TIMES_2:a>Math.PI?a-Ht.PI_TIMES_2:a};Ll.PI_TIMES_2.get=function(){return 2*Math.PI};Ll.PI_OVER_2.get=function(){return Math.PI/2};Ll.PI_OVER_4.get=function(){return Math.PI/4};Ll.COUNTERCLOCKWISE.get=function(){return dt.COUNTERCLOCKWISE};Ll.CLOCKWISE.get=function(){return dt.CLOCKWISE};Ll.NONE.get=function(){return dt.COLLINEAR};Object.defineProperties(Ht,Ll);var ge=function e(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Pt,this._seg1=new Pt,this._offset0=new Pt,this._offset1=new Pt,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new Ta,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Jt.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Zf={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ge.prototype.addNextSegment=function(t,n){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=dt.computeOrientation(this._s0,this._s1,this._s2),i=r===dt.CLOCKWISE&&this._side===rt.LEFT||r===dt.COUNTERCLOCKWISE&&this._side===rt.RIGHT;r===0?this.addCollinear(n):i?this.addOutsideTurn(r,n):this.addInsideTurn(r,n)};ge.prototype.addLineEndCap=function(t,n){var r=new Pt(t,n),i=new Pt;this.computeOffsetSegment(r,rt.LEFT,this._distance,i);var s=new Pt;this.computeOffsetSegment(r,rt.RIGHT,this._distance,s);var a=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,a);switch(this._bufParams.getEndCapStyle()){case Jt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(n,c+Math.PI/2,c-Math.PI/2,dt.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Jt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Jt.CAP_SQUARE:var f=new M;f.x=Math.abs(this._distance)*Math.cos(c),f.y=Math.abs(this._distance)*Math.sin(c);var g=new M(i.p1.x+f.x,i.p1.y+f.y),d=new M(s.p1.x+f.x,s.p1.y+f.y);this._segList.addPt(g),this._segList.addPt(d);break}};ge.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};ge.prototype.addMitreJoin=function(t,n,r,i){var s=!0,a=null;try{a=oi.intersection(n.p0,n.p1,r.p0,r.p1);var l=i<=0?1:a.distance(t)/Math.abs(i);l>this._bufParams.getMitreLimit()&&(s=!1)}catch(c){if(c instanceof Hu)a=new M(0,0),s=!1;else throw c}finally{}s?this._segList.addPt(a):this.addLimitedMitreJoin(n,r,i,this._bufParams.getMitreLimit())};ge.prototype.addFilletCorner=function(t,n,r,i,s){var a=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,a),f=r.x-t.x,g=r.y-t.y,d=Math.atan2(g,f);i===dt.CLOCKWISE?c<=d&&(c+=2*Math.PI):c>=d&&(c-=2*Math.PI),this._segList.addPt(n),this.addFilletArc(t,c,d,i,s),this._segList.addPt(r)};ge.prototype.addOutsideTurn=function(t,n){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ge.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Jt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Jt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(n&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))};ge.prototype.createSquare=function(t){this._segList.addPt(new M(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new M(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new M(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new M(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()};ge.prototype.addSegments=function(t,n){this._segList.addPts(t,n)};ge.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)};ge.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)};ge.prototype.initSideSegments=function(t,n,r){this._s1=t,this._s2=n,this._side=r,this._seg1.setCoordinates(t,n),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)};ge.prototype.addLimitedMitreJoin=function(t,n,r,i){var s=this._seg0.p1,a=Ht.angle(s,this._seg0.p0),l=Ht.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),c=l/2,f=Ht.normalize(a+c),g=Ht.normalize(f+Math.PI),d=i*r,v=d*Math.abs(Math.sin(c)),y=r-v,x=s.x+d*Math.cos(g),S=s.y+d*Math.sin(g),C=new M(x,S),E=new Pt(s,C),w=E.pointAlongOffset(1,y),N=E.pointAlongOffset(1,-y);this._side===rt.LEFT?(this._segList.addPt(w),this._segList.addPt(N)):(this._segList.addPt(N),this._segList.addPt(w))};ge.prototype.computeOffsetSegment=function(t,n,r,i){var s=n===rt.LEFT?1:-1,a=t.p1.x-t.p0.x,l=t.p1.y-t.p0.y,c=Math.sqrt(a*a+l*l),f=s*r*a/c,g=s*r*l/c;i.p0.x=t.p0.x-g,i.p0.y=t.p0.y+f,i.p1.x=t.p1.x-g,i.p1.y=t.p1.y+f};ge.prototype.addFilletArc=function(t,n,r,i,s){var a=this,l=i===dt.CLOCKWISE?-1:1,c=Math.abs(n-r),f=Math.trunc(c/this._filletAngleQuantum+.5);if(f<1)return null;for(var g=0,d=c/f,v=g,y=new M;v<c;){var x=n+l*v;y.x=t.x+s*Math.cos(x),y.y=t.y+s*Math.sin(x),a._segList.addPt(y),v+=d}};ge.prototype.addInsideTurn=function(t,n){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ge.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new M((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var i=new M((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};ge.prototype.createCircle=function(t){var n=new M(t.x+this._distance,t.y);this._segList.addPt(n),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};ge.prototype.addBevelJoin=function(t,n){this._segList.addPt(t.p1),this._segList.addPt(n.p0)};ge.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Rr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ge.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};ge.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var n=this._li.getIntersectionNum();n>=2&&(this._bufParams.getJoinStyle()===Jt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Jt.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,dt.CLOCKWISE,this._distance))};ge.prototype.closeRing=function(){this._segList.closeRing()};ge.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};ge.prototype.interfaces_=function(){return[]};ge.prototype.getClass=function(){return ge};Zf.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};Zf.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};Zf.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};Zf.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(ge,Zf);var ir=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],n=arguments[1];this._precisionModel=t,this._bufParams=n};ir.prototype.getOffsetCurve=function(t,n){if(this._distance=n,n===0)return null;var r=n<0,i=Math.abs(n),s=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],s):this.computeOffsetCurve(t,r,s);var a=s.getCoordinates();return r&&Vt.reverse(a),a};ir.prototype.computeSingleSidedBufferCurve=function(t,n,r){var i=this.simplifyTolerance(this._distance);if(n){r.addSegments(t,!0);var s=be.simplify(t,-i),a=s.length-1;r.initSideSegments(s[a],s[a-1],rt.LEFT),r.addFirstSegment();for(var l=a-2;l>=0;l--)r.addNextSegment(s[l],!0)}else{r.addSegments(t,!1);var c=be.simplify(t,i),f=c.length-1;r.initSideSegments(c[0],c[1],rt.LEFT),r.addFirstSegment();for(var g=2;g<=f;g++)r.addNextSegment(c[g],!0)}r.addLastSegment(),r.closeRing()};ir.prototype.computeRingBufferCurve=function(t,n,r){var i=this.simplifyTolerance(this._distance);n===rt.RIGHT&&(i=-i);var s=be.simplify(t,i),a=s.length-1;r.initSideSegments(s[a-1],s[0],n);for(var l=1;l<=a;l++){var c=l!==1;r.addNextSegment(s[l],c)}r.closeRing()};ir.prototype.computeLineBufferCurve=function(t,n){var r=this.simplifyTolerance(this._distance),i=be.simplify(t,r),s=i.length-1;n.initSideSegments(i[0],i[1],rt.LEFT);for(var a=2;a<=s;a++)n.addNextSegment(i[a],!0);n.addLastSegment(),n.addLineEndCap(i[s-1],i[s]);var l=be.simplify(t,-r),c=l.length-1;n.initSideSegments(l[c],l[c-1],rt.LEFT);for(var f=c-2;f>=0;f--)n.addNextSegment(l[f],!0);n.addLastSegment(),n.addLineEndCap(l[1],l[0]),n.closeRing()};ir.prototype.computePointCurve=function(t,n){switch(this._bufParams.getEndCapStyle()){case Jt.CAP_ROUND:n.createCircle(t);break;case Jt.CAP_SQUARE:n.createSquare(t);break}};ir.prototype.getLineCurve=function(t,n){if(this._distance=n,n<0&&!this._bufParams.isSingleSided()||n===0)return null;var r=Math.abs(n),i=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var s=n<0;this.computeSingleSidedBufferCurve(t,s,i)}else this.computeLineBufferCurve(t,i);var a=i.getCoordinates();return a};ir.prototype.getBufferParameters=function(){return this._bufParams};ir.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};ir.prototype.getRingCurve=function(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(r===0)return ir.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,n,i),i.getCoordinates()};ir.prototype.computeOffsetCurve=function(t,n,r){var i=this.simplifyTolerance(this._distance);if(n){var s=be.simplify(t,-i),a=s.length-1;r.initSideSegments(s[a],s[a-1],rt.LEFT),r.addFirstSegment();for(var l=a-2;l>=0;l--)r.addNextSegment(s[l],!0)}else{var c=be.simplify(t,i),f=c.length-1;r.initSideSegments(c[0],c[1],rt.LEFT),r.addFirstSegment();for(var g=2;g<=f;g++)r.addNextSegment(c[g],!0)}r.addLastSegment()};ir.prototype.getSegGen=function(t){return new ge(this._precisionModel,this._bufParams,t)};ir.prototype.interfaces_=function(){return[]};ir.prototype.getClass=function(){return ir};ir.copyCoordinates=function(t){for(var n=new Array(t.length).fill(null),r=0;r<n.length;r++)n[r]=new M(t[r]);return n};var dl=function(){this._subgraphs=null,this._seg=new Pt,this._cga=new dt;var t=arguments[0];this._subgraphs=t},QC={DepthSegment:{configurable:!0}};dl.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var n=arguments[0],r=new lt,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),a=s.getEnvelope();n.y<a.getMinY()||n.y>a.getMaxY()||t.findStabbedSegments(n,s.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(Ot(arguments[2],ai)&&arguments[0]instanceof M&&arguments[1]instanceof Ov)for(var l=arguments[0],c=arguments[1],f=arguments[2],g=c.getEdge().getCoordinates(),d=0;d<g.length-1;d++){t._seg.p0=g[d],t._seg.p1=g[d+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var v=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(v<l.x)&&!t._seg.isHorizontal()&&!(l.y<t._seg.p0.y||l.y>t._seg.p1.y)&&dt.computeOrientation(t._seg.p0,t._seg.p1,l)!==dt.RIGHT){var y=c.getDepth(rt.LEFT);t._seg.p0.equals(g[d])||(y=c.getDepth(rt.RIGHT));var x=new ma(t._seg,y);f.add(x)}}else if(Ot(arguments[2],ai)&&arguments[0]instanceof M&&Ot(arguments[1],ai))for(var S=arguments[0],C=arguments[1],E=arguments[2],w=C.iterator();w.hasNext();){var N=w.next();N.isForward()&&t.findStabbedSegments(S,N,E)}}};dl.prototype.getDepth=function(t){var n=this.findStabbedSegments(t);if(n.size()===0)return 0;var r=hi.min(n);return r._leftDepth};dl.prototype.interfaces_=function(){return[]};dl.prototype.getClass=function(){return dl};QC.DepthSegment.get=function(){return ma};Object.defineProperties(dl,QC);var ma=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],n=arguments[1];this._upwardSeg=new Pt(t),this._leftDepth=n};ma.prototype.compareTo=function(t){var n=t;if(this._upwardSeg.minX()>=n._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=n._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(n._upwardSeg);return r!==0||(r=-1*n._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(n._upwardSeg)};ma.prototype.compareX=function(t,n){var r=t.p0.compareTo(n.p0);return r!==0?r:t.p1.compareTo(n.p1)};ma.prototype.toString=function(){return this._upwardSeg.toString()};ma.prototype.interfaces_=function(){return[ti]};ma.prototype.getClass=function(){return ma};var te=function(t,n,r){this.p0=t||null,this.p1=n||null,this.p2=r||null};te.prototype.area=function(){return te.area(this.p0,this.p1,this.p2)};te.prototype.signedArea=function(){return te.signedArea(this.p0,this.p1,this.p2)};te.prototype.interpolateZ=function(t){if(t===null)throw new ve("Supplied point is null.");return te.interpolateZ(t,this.p0,this.p1,this.p2)};te.prototype.longestSideLength=function(){return te.longestSideLength(this.p0,this.p1,this.p2)};te.prototype.isAcute=function(){return te.isAcute(this.p0,this.p1,this.p2)};te.prototype.circumcentre=function(){return te.circumcentre(this.p0,this.p1,this.p2)};te.prototype.area3D=function(){return te.area3D(this.p0,this.p1,this.p2)};te.prototype.centroid=function(){return te.centroid(this.p0,this.p1,this.p2)};te.prototype.inCentre=function(){return te.inCentre(this.p0,this.p1,this.p2)};te.prototype.interfaces_=function(){return[]};te.prototype.getClass=function(){return te};te.area=function(t,n,r){return Math.abs(((r.x-t.x)*(n.y-t.y)-(n.x-t.x)*(r.y-t.y))/2)};te.signedArea=function(t,n,r){return((r.x-t.x)*(n.y-t.y)-(n.x-t.x)*(r.y-t.y))/2};te.det=function(t,n,r,i){return t*i-n*r};te.interpolateZ=function(t,n,r,i){var s=n.x,a=n.y,l=r.x-s,c=i.x-s,f=r.y-a,g=i.y-a,d=l*g-c*f,v=t.x-s,y=t.y-a,x=(g*v-c*y)/d,S=(-f*v+l*y)/d,C=n.z+x*(r.z-n.z)+S*(i.z-n.z);return C};te.longestSideLength=function(t,n,r){var i=t.distance(n),s=n.distance(r),a=r.distance(t),l=i;return s>l&&(l=s),a>l&&(l=a),l};te.isAcute=function(t,n,r){return!(!Ht.isAcute(t,n,r)||!Ht.isAcute(n,r,t)||!Ht.isAcute(r,t,n))};te.circumcentre=function(t,n,r){var i=r.x,s=r.y,a=t.x-i,l=t.y-s,c=n.x-i,f=n.y-s,g=2*te.det(a,l,c,f),d=te.det(l,a*a+l*l,f,c*c+f*f),v=te.det(a,a*a+l*l,c,c*c+f*f),y=i-d/g,x=s+v/g;return new M(y,x)};te.perpendicularBisector=function(t,n){var r=n.x-t.x,i=n.y-t.y,s=new oi(t.x+r/2,t.y+i/2,1),a=new oi(t.x-i+r/2,t.y+r+i/2,1);return new oi(s,a)};te.angleBisector=function(t,n,r){var i=n.distance(t),s=n.distance(r),a=i/(i+s),l=r.x-t.x,c=r.y-t.y,f=new M(t.x+a*l,t.y+a*c);return f};te.area3D=function(t,n,r){var i=n.x-t.x,s=n.y-t.y,a=n.z-t.z,l=r.x-t.x,c=r.y-t.y,f=r.z-t.z,g=s*f-a*c,d=a*l-i*f,v=i*c-s*l,y=g*g+d*d+v*v,x=Math.sqrt(y)/2;return x};te.centroid=function(t,n,r){var i=(t.x+n.x+r.x)/3,s=(t.y+n.y+r.y)/3;return new M(i,s)};te.inCentre=function(t,n,r){var i=n.distance(r),s=t.distance(r),a=t.distance(n),l=i+s+a,c=(i*t.x+s*n.x+a*r.x)/l,f=(i*t.y+s*n.y+a*r.y)/l;return new M(c,f)};var $r=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new lt;var t=arguments[0],n=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=n,this._curveBuilder=r};$r.prototype.addPoint=function(t){if(this._distance<=0)return null;var n=t.getCoordinates(),r=this._curveBuilder.getLineCurve(n,this._distance);this.addCurve(r,k.EXTERIOR,k.INTERIOR)};$r.prototype.addPolygon=function(t){var n=this,r=this._distance,i=rt.LEFT;this._distance<0&&(r=-this._distance,i=rt.RIGHT);var s=t.getExteriorRing(),a=Vt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&a.length<3)return null;this.addPolygonRing(a,r,i,k.EXTERIOR,k.INTERIOR);for(var l=0;l<t.getNumInteriorRing();l++){var c=t.getInteriorRingN(l),f=Vt.removeRepeatedPoints(c.getCoordinates());n._distance>0&&n.isErodedCompletely(c,-n._distance)||n.addPolygonRing(f,r,rt.opposite(i),k.INTERIOR,k.EXTERIOR)}};$r.prototype.isTriangleErodedCompletely=function(t,n){var r=new te(t[0],t[1],t[2]),i=r.inCentre(),s=dt.distancePointLine(i,r.p0,r.p1);return s<Math.abs(n)};$r.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var n=Vt.removeRepeatedPoints(t.getCoordinates()),r=this._curveBuilder.getLineCurve(n,this._distance);this.addCurve(r,k.EXTERIOR,k.INTERIOR)};$r.prototype.addCurve=function(t,n,r){if(t===null||t.length<2)return null;var i=new Ae(t,new ie(0,k.BOUNDARY,n,r));this._curveList.add(i)};$r.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList};$r.prototype.addPolygonRing=function(t,n,r,i,s){if(n===0&&t.length<ys.MINIMUM_VALID_SIZE)return null;var a=i,l=s;t.length>=ys.MINIMUM_VALID_SIZE&&dt.isCCW(t)&&(a=s,l=i,r=rt.opposite(r));var c=this._curveBuilder.getRingCurve(t,r,n);this.addCurve(c,a,l)};$r.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ye?this.addPolygon(t):t instanceof Pe?this.addLineString(t):t instanceof gr?this.addPoint(t):t instanceof Cu?this.addCollection(t):t instanceof pa?this.addCollection(t):t instanceof ps?this.addCollection(t):t instanceof Hn&&this.addCollection(t)};$r.prototype.isErodedCompletely=function(t,n){var r=t.getCoordinates();if(r.length<4)return n<0;if(r.length===4)return this.isTriangleErodedCompletely(r,n);var i=t.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return n<0&&2*Math.abs(n)>s};$r.prototype.addCollection=function(t){for(var n=this,r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);n.add(i)}};$r.prototype.interfaces_=function(){return[]};$r.prototype.getClass=function(){return $r};var Lu=function(){};Lu.prototype.locate=function(t){};Lu.prototype.interfaces_=function(){return[]};Lu.prototype.getClass=function(){return Lu};var gs=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};gs.prototype.next=function(){if(this._atStart)return this._atStart=!1,gs.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Wu;var t=this._parent.getGeometryN(this._index++);return t instanceof Hn?(this._subcollectionIterator=new gs(t),this._subcollectionIterator.next()):t};gs.prototype.remove=function(){throw new Error(this.getClass().getName())};gs.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};gs.prototype.interfaces_=function(){return[Zu]};gs.prototype.getClass=function(){return gs};gs.isAtomic=function(t){return!(t instanceof Hn)};var Ir=function(){this._geom=null;var t=arguments[0];this._geom=t};Ir.prototype.locate=function(t){return Ir.locate(t,this._geom)};Ir.prototype.interfaces_=function(){return[Lu]};Ir.prototype.getClass=function(){return Ir};Ir.isPointInRing=function(t,n){return n.getEnvelopeInternal().intersects(t)?dt.isPointInRing(t,n.getCoordinates()):!1};Ir.containsPointInPolygon=function(t,n){if(n.isEmpty())return!1;var r=n.getExteriorRing();if(!Ir.isPointInRing(t,r))return!1;for(var i=0;i<n.getNumInteriorRing();i++){var s=n.getInteriorRingN(i);if(Ir.isPointInRing(t,s))return!1}return!0};Ir.containsPoint=function(t,n){if(n instanceof Ye)return Ir.containsPointInPolygon(t,n);if(n instanceof Hn)for(var r=new gs(n);r.hasNext();){var i=r.next();if(i!==n&&Ir.containsPoint(t,i))return!0}return!1};Ir.locate=function(t,n){return n.isEmpty()?k.EXTERIOR:Ir.containsPoint(t,n)?k.INTERIOR:k.EXTERIOR};var Dn=function(){this._edgeMap=new Mn,this._edgeList=null,this._ptInAreaLocation=[k.NONE,k.NONE]};Dn.prototype.getNextCW=function(t){this.getEdges();var n=this._edgeList.indexOf(t),r=n-1;return n===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)};Dn.prototype.propagateSideLabels=function(t){for(var n=k.NONE,r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.isArea(t)&&s.getLocation(t,rt.LEFT)!==k.NONE&&(n=s.getLocation(t,rt.LEFT))}if(n===k.NONE)return null;for(var a=n,l=this.iterator();l.hasNext();){var c=l.next(),f=c.getLabel();if(f.getLocation(t,rt.ON)===k.NONE&&f.setLocation(t,rt.ON,a),f.isArea(t)){var g=f.getLocation(t,rt.LEFT),d=f.getLocation(t,rt.RIGHT);if(d!==k.NONE){if(d!==a)throw new Xs("side location conflict",c.getCoordinate());g===k.NONE&&kt.shouldNeverReachHere("found single null side (at "+c.getCoordinate()+")"),a=g}else kt.isTrue(f.getLocation(t,rt.LEFT)===k.NONE,"found single null side"),f.setLocation(t,rt.RIGHT,a),f.setLocation(t,rt.LEFT,a)}}};Dn.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var n=t.next();return n.getCoordinate()};Dn.prototype.print=function(t){wn.out.println("EdgeEndStar: "+this.getCoordinate());for(var n=this.iterator();n.hasNext();){var r=n.next();r.print(t)}};Dn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)};Dn.prototype.checkAreaLabelsConsistent=function(t){var n=this.getEdges();if(n.size()<=0)return!0;var r=n.size()-1,i=n.get(r).getLabel(),s=i.getLocation(t,rt.LEFT);kt.isTrue(s!==k.NONE,"Found unlabelled area edge");for(var a=s,l=this.iterator();l.hasNext();){var c=l.next(),f=c.getLabel();kt.isTrue(f.isArea(t),"Found non-area edge");var g=f.getLocation(t,rt.LEFT),d=f.getLocation(t,rt.RIGHT);if(g===d||d!==a)return!1;a=g}return!0};Dn.prototype.findIndex=function(t){var n=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=n._edgeList.get(r);if(i===t)return r}return-1};Dn.prototype.iterator=function(){return this.getEdges().iterator()};Dn.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new lt(this._edgeMap.values())),this._edgeList};Dn.prototype.getLocation=function(t,n,r){return this._ptInAreaLocation[t]===k.NONE&&(this._ptInAreaLocation[t]=Ir.locate(n,r[t].getGeometry())),this._ptInAreaLocation[t]};Dn.prototype.toString=function(){var t=new Ki;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
`);for(var n=this.iterator();n.hasNext();){var r=n.next();t.append(r),t.append(`
`)}return t.toString()};Dn.prototype.computeEdgeEndLabels=function(t){for(var n=this.iterator();n.hasNext();){var r=n.next();r.computeLabel(t)}};Dn.prototype.computeLabelling=function(t){var n=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),a=s.getLabel(),l=0;l<2;l++)a.isLine(l)&&a.getLocation(l)===k.BOUNDARY&&(r[l]=!0);for(var c=this.iterator();c.hasNext();)for(var f=c.next(),g=f.getLabel(),d=0;d<2;d++)if(g.isAnyNull(d)){var v=k.NONE;if(r[d])v=k.EXTERIOR;else{var y=f.getCoordinate();v=n.getLocation(d,y,t)}g.setAllLocationsIfNull(d,v)}};Dn.prototype.getDegree=function(){return this._edgeMap.size()};Dn.prototype.insertEdgeEnd=function(t,n){this._edgeMap.put(t,n),this._edgeList=null};Dn.prototype.interfaces_=function(){return[]};Dn.prototype.getClass=function(){return Dn};var MA=function(e){function t(){e.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,s=null,a=this._SCANNING_FOR_INCOMING,l=0;l<this._resultAreaEdgeList.size();l++){var c=r._resultAreaEdgeList.get(l),f=c.getSym();if(c.getLabel().isArea())switch(i===null&&c.isInResult()&&(i=c),a){case r._SCANNING_FOR_INCOMING:if(!f.isInResult())continue;s=f,a=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!c.isInResult())continue;s.setNext(c),a=r._SCANNING_FOR_INCOMING;break}}if(a===this._LINKING_TO_OUTGOING){if(i===null)throw new Xs("no outgoing dirEdge found",this.getCoordinate());kt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var s=r.get(0);if(i===1)return s;var a=r.get(i-1),l=s.getQuadrant(),c=a.getQuadrant();return oe.isNorthern(l)&&oe.isNorthern(c)?s:!oe.isNorthern(l)&&!oe.isNorthern(c)?a:s.getDy()!==0?s:a.getDy()!==0?a:(kt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){wn.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();r.print("out "),s.print(r),r.println(),r.print("in "),s.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new lt;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&r._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var s=i.next(),a=s.getLabel();a.setAllLocationsIfNull(0,r.getLocation(0)),a.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,s=null,a=this._edgeList.size()-1;a>=0;a--){var l=r._edgeList.get(a),c=l.getSym();s===null&&(s=c),i!==null&&c.setNext(i),i=l}s.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),a=i.getDepth(rt.LEFT),l=i.getDepth(rt.RIGHT),c=this.computeDepths(s+1,this._edgeList.size(),a),f=this.computeDepths(0,s,c);if(f!==l)throw new Xs("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var g=arguments[0],d=arguments[1],v=arguments[2],y=v,x=g;x<d;x++){var S=r._edgeList.get(x);S.setEdgeDepths(rt.RIGHT,y),y=S.getDepth(rt.LEFT)}return y}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,s=null,a=null,l=this._SCANNING_FOR_INCOMING,c=this._resultAreaEdgeList.size()-1;c>=0;c--){var f=i._resultAreaEdgeList.get(c),g=f.getSym();switch(s===null&&f.getEdgeRing()===r&&(s=f),l){case i._SCANNING_FOR_INCOMING:if(g.getEdgeRing()!==r)continue;a=g,l=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(f.getEdgeRing()!==r)continue;a.setNextMin(f),l=i._SCANNING_FOR_INCOMING;break}}l===this._LINKING_TO_OUTGOING&&(kt.isTrue(s!==null,"found null for first outgoing dirEdge"),kt.isTrue(s.getEdgeRing()===r,"unable to link last incoming dirEdge"),a.setNextMin(s))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&r++}return r}else if(arguments.length===1){for(var a=arguments[0],l=0,c=this.iterator();c.hasNext();){var f=c.next();f.getEdgeRing()===a&&l++}return l}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=k.NONE,i=this.iterator();i.hasNext();){var s=i.next(),a=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){r=k.INTERIOR;break}if(a.isInResult()){r=k.EXTERIOR;break}}}if(r===k.NONE)return null;for(var l=r,c=this.iterator();c.hasNext();){var f=c.next(),g=f.getSym();f.isLineEdge()?f.getEdge().setCovered(l===k.INTERIOR):(f.isInResult()&&(l=k.EXTERIOR),g.isInResult()&&(l=k.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;e.prototype.computeLabelling.call(this,r),this._label=new ie(k.NONE);for(var s=this.iterator();s.hasNext();)for(var a=s.next(),l=a.getEdge(),c=l.getLabel(),f=0;f<2;f++){var g=c.getLocation(f);(g===k.INTERIOR||g===k.BOUNDARY)&&i._label.setLocation(f,k.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Dn),JC=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new Hp(r,new MA)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Nu),So=function e(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)};So.prototype.compareTo=function(t){var n=t,r=So.compareOriented(this._pts,this._orientation,n._pts,n._orientation);return r};So.prototype.interfaces_=function(){return[ti]};So.prototype.getClass=function(){return So};So.orientation=function(t){return Vt.increasingDirection(t)===1};So.compareOriented=function(t,n,r,i){for(var s=n?1:-1,a=i?1:-1,l=n?t.length:-1,c=i?r.length:-1,f=n?0:t.length-1,g=i?0:r.length-1;;){var d=t[f].compareTo(r[g]);if(d!==0)return d;f+=s,g+=a;var v=f===l,y=g===c;if(v&&!y)return-1;if(!v&&y)return 1;if(v&&y)return 0}};var di=function(){this._edges=new lt,this._ocaMap=new Mn};di.prototype.print=function(t){var n=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=n._edges.get(r);r>0&&t.print(","),t.print("(");for(var s=i.getCoordinates(),a=0;a<s.length;a++)a>0&&t.print(","),t.print(s[a].x+" "+s[a].y);t.println(")")}t.print(") ")};di.prototype.addAll=function(t){for(var n=this,r=t.iterator();r.hasNext();)n.add(r.next())};di.prototype.findEdgeIndex=function(t){for(var n=this,r=0;r<this._edges.size();r++)if(n._edges.get(r).equals(t))return r;return-1};di.prototype.iterator=function(){return this._edges.iterator()};di.prototype.getEdges=function(){return this._edges};di.prototype.get=function(t){return this._edges.get(t)};di.prototype.findEqualEdge=function(t){var n=new So(t.getCoordinates()),r=this._ocaMap.get(n);return r};di.prototype.add=function(t){this._edges.add(t);var n=new So(t.getCoordinates());this._ocaMap.put(n,t)};di.prototype.interfaces_=function(){return[]};di.prototype.getClass=function(){return di};var va=function(){};va.prototype.processIntersections=function(t,n,r,i){};va.prototype.isDone=function(){};va.prototype.interfaces_=function(){return[]};va.prototype.getClass=function(){return va};var Mr=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Mr.prototype.isTrivialIntersection=function(t,n,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Mr.isAdjacentSegments(n,i))return!0;if(t.isClosed()){var s=t.size()-1;if(n===0&&i===s||i===0&&n===s)return!0}}return!1};Mr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Mr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Mr.prototype.getLineIntersector=function(){return this._li};Mr.prototype.hasProperIntersection=function(){return this._hasProper};Mr.prototype.processIntersections=function(t,n,r,i){if(t===r&&n===i)return null;this.numTests++;var s=t.getCoordinates()[n],a=t.getCoordinates()[n+1],l=r.getCoordinates()[i],c=r.getCoordinates()[i+1];this._li.computeIntersection(s,a,l,c),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,n,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,n,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))};Mr.prototype.hasIntersection=function(){return this._hasIntersection};Mr.prototype.isDone=function(){return!1};Mr.prototype.hasInteriorIntersection=function(){return this._hasInterior};Mr.prototype.interfaces_=function(){return[va]};Mr.prototype.getClass=function(){return Mr};Mr.isAdjacentSegments=function(t,n){return Math.abs(t-n)===1};var Zi=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],n=arguments[1],r=arguments[2];this.coord=new M(t),this.segmentIndex=n,this.dist=r};Zi.prototype.getSegmentIndex=function(){return this.segmentIndex};Zi.prototype.getCoordinate=function(){return this.coord};Zi.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)};Zi.prototype.compareTo=function(t){var n=t;return this.compare(n.segmentIndex,n.dist)};Zi.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t};Zi.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist};Zi.prototype.getDistance=function(){return this.dist};Zi.prototype.compare=function(t,n){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<n?-1:this.dist>n?1:0};Zi.prototype.interfaces_=function(){return[ti]};Zi.prototype.getClass=function(){return Zi};var ws=function(){this._nodeMap=new Mn,this.edge=null;var t=arguments[0];this.edge=t};ws.prototype.print=function(t){t.println("Intersections:");for(var n=this.iterator();n.hasNext();){var r=n.next();r.print(t)}};ws.prototype.iterator=function(){return this._nodeMap.values().iterator()};ws.prototype.addSplitEdges=function(t){var n=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),a=n.createSplitEdge(i,s);t.add(a),i=s}};ws.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)};ws.prototype.createSplitEdge=function(t,n){var r=this,i=n.segmentIndex-t.segmentIndex+2,s=this.edge.pts[n.segmentIndex],a=n.dist>0||!n.coord.equals2D(s);a||i--;var l=new Array(i).fill(null),c=0;l[c++]=new M(t.coord);for(var f=t.segmentIndex+1;f<=n.segmentIndex;f++)l[c++]=r.edge.pts[f];return a&&(l[c]=n.coord),new Xd(l,new ie(this.edge._label))};ws.prototype.add=function(t,n,r){var i=new Zi(t,n,r),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)};ws.prototype.isIntersection=function(t){for(var n=this.iterator();n.hasNext();){var r=n.next();if(r.coord.equals(t))return!0}return!1};ws.prototype.interfaces_=function(){return[]};ws.prototype.getClass=function(){return ws};var ya=function(){};ya.prototype.getChainStartIndices=function(t){var n=this,r=0,i=new lt;i.add(new Bi(r));do{var s=n.findChainEnd(t,r);i.add(new Bi(s)),r=s}while(r<t.length-1);var a=ya.toIntArray(i);return a};ya.prototype.findChainEnd=function(t,n){for(var r=oe.quadrant(t[n],t[n+1]),i=n+1;i<t.length;){var s=oe.quadrant(t[i-1],t[i]);if(s!==r)break;i++}return i-1};ya.prototype.interfaces_=function(){return[]};ya.prototype.getClass=function(){return ya};ya.toIntArray=function(t){for(var n=new Array(t.size()).fill(null),r=0;r<n.length;r++)n[r]=t.get(r).intValue();return n};var Ks=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Nt,this.env2=new Nt;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var n=new ya;this.startIndex=n.getChainStartIndices(this.pts)};Ks.prototype.getCoordinates=function(){return this.pts};Ks.prototype.getMaxX=function(t){var n=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return n>r?n:r};Ks.prototype.getMinX=function(t){var n=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return n<r?n:r};Ks.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],n,n.startIndex[r],n.startIndex[r+1],i)}else if(arguments.length===6){var s=arguments[0],a=arguments[1],l=arguments[2],c=arguments[3],f=arguments[4],g=arguments[5],d=this.pts[s],v=this.pts[a],y=l.pts[c],x=l.pts[f];if(a-s===1&&f-c===1)return g.addIntersections(this.e,s,l.e,c),null;if(this.env1.init(d,v),this.env2.init(y,x),!this.env1.intersects(this.env2))return null;var S=Math.trunc((s+a)/2),C=Math.trunc((c+f)/2);s<S&&(c<C&&this.computeIntersectsForChain(s,S,l,c,C,g),C<f&&this.computeIntersectsForChain(s,S,l,C,f,g)),S<a&&(c<C&&this.computeIntersectsForChain(S,a,l,c,C,g),C<f&&this.computeIntersectsForChain(S,a,l,C,f,g))}};Ks.prototype.getStartIndexes=function(){return this.startIndex};Ks.prototype.computeIntersects=function(t,n){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<t.startIndex.length-1;s++)r.computeIntersectsForChain(i,t,s,n)};Ks.prototype.interfaces_=function(){return[]};Ks.prototype.getClass=function(){return Ks};var xn=function e(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var n=0;n<2;n++)for(var r=0;r<3;r++)t._depth[n][r]=e.NULL_VALUE},$C={NULL_VALUE:{configurable:!0}};xn.prototype.getDepth=function(t,n){return this._depth[t][n]};xn.prototype.setDepth=function(t,n,r){this._depth[t][n]=r};xn.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var n=0;n<2;n++)for(var r=0;r<3;r++)if(t._depth[n][r]!==xn.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===xn.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return this._depth[s][a]===xn.NULL_VALUE}};xn.prototype.normalize=function(){for(var t=this,n=0;n<2;n++)if(!t.isNull(n)){var r=t._depth[n][1];t._depth[n][2]<r&&(r=t._depth[n][2]),r<0&&(r=0);for(var i=1;i<3;i++){var s=0;t._depth[n][i]>r&&(s=1),t._depth[n][i]=s}}};xn.prototype.getDelta=function(t){return this._depth[t][rt.RIGHT]-this._depth[t][rt.LEFT]};xn.prototype.getLocation=function(t,n){return this._depth[t][n]<=0?k.EXTERIOR:k.INTERIOR};xn.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};xn.prototype.add=function(){var t=this;if(arguments.length===1)for(var n=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var s=n.getLocation(r,i);(s===k.EXTERIOR||s===k.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=xn.depthAtLocation(s):t._depth[r][i]+=xn.depthAtLocation(s))}else if(arguments.length===3){var a=arguments[0],l=arguments[1],c=arguments[2];c===k.INTERIOR&&this._depth[a][l]++}};xn.prototype.interfaces_=function(){return[]};xn.prototype.getClass=function(){return xn};xn.depthAtLocation=function(t){return t===k.EXTERIOR?0:t===k.INTERIOR?1:xn.NULL_VALUE};$C.NULL_VALUE.get=function(){return-1};Object.defineProperties(xn,$C);var Xd=function(e){function t(){if(e.call(this),this.pts=null,this._env=null,this.eiList=new ws(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new xn,this._depthDelta=0,arguments.length===1){var n=arguments[0];t.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,ie.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var s=r;if(this.pts.length!==s.pts.length)return!1;for(var a=!0,l=!0,c=this.pts.length,f=0;f<this.pts.length;f++)if(i.pts[f].equals2D(s.pts[f])||(a=!1),i.pts[f].equals2D(s.pts[--c])||(l=!1),!a&&!l)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.print(","),r.print(i.pts[s].x+" "+i.pts[s].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)r.print(i.pts[s]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ks(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new Nt;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,s,a){var l=new M(r.getIntersection(a)),c=i,f=r.getEdgeDistance(s,a),g=c+1;if(g<this.pts.length){var d=this.pts[g];l.equals2D(d)&&(c=g,f=0)}this.eiList.add(l,c,f)},t.prototype.toString=function(){var r=this,i=new Ki;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(r.pts[s].x+" "+r.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(r.pts[s]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,s){for(var a=this,l=0;l<r.getIntersectionNum();l++)a.addIntersection(r,i,s,l)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,rt.ON),r.getLocation(1,rt.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,rt.LEFT),r.getLocation(1,rt.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,rt.RIGHT),r.getLocation(1,rt.RIGHT),2))}else return e.prototype.updateIM.apply(this,arguments)},t}(Or),qn=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new di,this._bufParams=t||null};qn.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t};qn.prototype.insertUniqueEdge=function(t){var n=this._edgeList.findEqualEdge(t);if(n!==null){var r=n.getLabel(),i=t.getLabel();n.isPointwiseEqual(t)||(i=new ie(t.getLabel()),i.flip()),r.merge(i);var s=qn.depthDelta(i),a=n.getDepthDelta(),l=a+s;n.setDepthDelta(l)}else this._edgeList.add(t),t.setDepthDelta(qn.depthDelta(t.getLabel()))};qn.prototype.buildSubgraphs=function(t,n){for(var r=new lt,i=t.iterator();i.hasNext();){var s=i.next(),a=s.getRightmostCoordinate(),l=new dl(r),c=l.getDepth(a);s.computeDepth(c),s.findResultEdges(),r.add(s),n.add(s.getDirectedEdges(),s.getNodes())}};qn.prototype.createSubgraphs=function(t){for(var n=new lt,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var s=new Zn;s.create(i),n.add(s)}}return hi.sort(n,hi.reverseOrder()),n};qn.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t};qn.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var n=new c_,r=new Ta;return r.setPrecisionModel(t),n.setSegmentIntersector(new Mr(r)),n};qn.prototype.buffer=function(t,n){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ir(r,this._bufParams),s=new $r(t,n,i),a=s.getCurves();if(a.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(a,r),this._graph=new xe(new JC),this._graph.addEdges(this._edgeList.getEdges());var l=this.createSubgraphs(this._graph),c=new mr(this._geomFact);this.buildSubgraphs(l,c);var f=c.getPolygons();if(f.size()<=0)return this.createEmptyResultGeometry();var g=this._geomFact.buildGeometry(f);return g};qn.prototype.computeNodedEdges=function(t,n){var r=this,i=this.getNoder(n);i.computeNodes(t);for(var s=i.getNodedSubstrings(),a=s.iterator();a.hasNext();){var l=a.next(),c=l.getCoordinates();if(!(c.length===2&&c[0].equals2D(c[1]))){var f=l.getData(),g=new Xd(l.getCoordinates(),new ie(f));r.insertUniqueEdge(g)}}};qn.prototype.setNoder=function(t){this._workingNoder=t};qn.prototype.interfaces_=function(){return[]};qn.prototype.getClass=function(){return qn};qn.depthDelta=function(t){var n=t.getLocation(0,rt.LEFT),r=t.getLocation(0,rt.RIGHT);return n===k.INTERIOR&&r===k.EXTERIOR?1:n===k.EXTERIOR&&r===k.INTERIOR?-1:0};qn.convertSegStrings=function(t){for(var n=new Ut,r=new lt;t.hasNext();){var i=t.next(),s=n.createLineString(i.getCoordinates());r.add(s)}return n.buildGeometry(r)};var Co=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],n=arguments[1];this._noder=t,this._scaleFactor=n,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[2],a=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=s,this._offsetY=a,this._isScaled=!this.isIntegerPrecision()}};Co.prototype.rescale=function(){var t=this;if(Ot(arguments[0],Ge))for(var n=arguments[0],r=n.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=0;a<s.length;a++)s[a].x=s[a].x/t._scaleFactor+t._offsetX,s[a].y=s[a].y/t._scaleFactor+t._offsetY;s.length===2&&s[0].equals2D(s[1])&&wn.out.println(s)}};Co.prototype.scale=function(){var t=this;if(Ot(arguments[0],Ge)){for(var n=arguments[0],r=new lt,i=n.iterator();i.hasNext();){var s=i.next();r.add(new Ae(t.scale(s.getCoordinates()),s.getData()))}return r}else if(arguments[0]instanceof Array){for(var a=arguments[0],l=new Array(a.length).fill(null),c=0;c<a.length;c++)l[c]=new M(Math.round((a[c].x-t._offsetX)*t._scaleFactor),Math.round((a[c].y-t._offsetY)*t._scaleFactor),a[c].z);var f=Vt.removeRepeatedPoints(l);return f}};Co.prototype.isIntegerPrecision=function(){return this._scaleFactor===1};Co.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t};Co.prototype.computeNodes=function(t){var n=t;this._isScaled&&(n=this.scale(t)),this._noder.computeNodes(n)};Co.prototype.interfaces_=function(){return[ga]};Co.prototype.getClass=function(){return Co};var Wi=function(){this._li=new Ta,this._segStrings=null;var t=arguments[0];this._segStrings=t},tN={fact:{configurable:!0}};Wi.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var n=this._segStrings.iterator();n.hasNext();){var r=n.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var s=arguments[0],a=arguments[1],l=a.iterator();l.hasNext();)for(var c=l.next(),f=c.getCoordinates(),g=1;g<f.length-1;g++)if(f[g].equals(s))throw new Zs("found endpt/interior pt intersection at index "+g+" :pt "+s)}};Wi.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var n=this._segStrings.iterator();n.hasNext();)for(var r=n.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();t.checkInteriorIntersections(r,s)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],c=a.getCoordinates(),f=l.getCoordinates(),g=0;g<c.length-1;g++)for(var d=0;d<f.length-1;d++)t.checkInteriorIntersections(a,g,l,d);else if(arguments.length===4){var v=arguments[0],y=arguments[1],x=arguments[2],S=arguments[3];if(v===x&&y===S)return null;var C=v.getCoordinates()[y],E=v.getCoordinates()[y+1],w=x.getCoordinates()[S],N=x.getCoordinates()[S+1];if(this._li.computeIntersection(C,E,w,N),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,C,E)||this.hasInteriorIntersection(this._li,w,N)))throw new Zs("found non-noded intersection at "+C+"-"+E+" and "+w+"-"+N)}};Wi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()};Wi.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var n=this._segStrings.iterator();n.hasNext();){var r=n.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),a=0;a<s.length-2;a++)t.checkCollapse(s[a],s[a+1],s[a+2])};Wi.prototype.hasInteriorIntersection=function(t,n,r){for(var i=0;i<t.getIntersectionNum();i++){var s=t.getIntersection(i);if(!(s.equals(n)||s.equals(r)))return!0}return!1};Wi.prototype.checkCollapse=function(t,n,r){if(t.equals(r))throw new Zs("found non-noded collapse at "+Wi.fact.createLineString([t,n,r]))};Wi.prototype.interfaces_=function(){return[]};Wi.prototype.getClass=function(){return Wi};tN.fact.get=function(){return new Ut};Object.defineProperties(Wi,tN);var sr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],n=arguments[1],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=n,this._li=r,n<=0)throw new ve("Scale factor must be non-zero");n!==1&&(this._pt=new M(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new M,this._p1Scaled=new M),this.initCorners(this._pt)},eN={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,n){var r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),s=Math.min(t.y,n.y),a=Math.max(t.y,n.y),l=this._maxx<r||this._minx>i||this._maxy<s||this._miny>a;if(l)return!1;var c=this.intersectsToleranceSquare(t,n);return kt.isTrue(!(l&&c),"Found bad envelope test"),c};sr.prototype.initCorners=function(t){var n=.5;this._minx=t.x-n,this._maxx=t.x+n,this._miny=t.y-n,this._maxy=t.y+n,this._corner[0]=new M(this._maxx,this._maxy),this._corner[1]=new M(this._minx,this._maxy),this._corner[2]=new M(this._minx,this._miny),this._corner[3]=new M(this._maxx,this._miny)};sr.prototype.intersects=function(t,n){return this._scaleFactor===1?this.intersectsScaled(t,n):(this.copyScaled(t,this._p0Scaled),this.copyScaled(n,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};sr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};sr.prototype.getCoordinate=function(){return this._originalPt};sr.prototype.copyScaled=function(t,n){n.x=this.scale(t.x),n.y=this.scale(t.y)};sr.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Nt(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};sr.prototype.intersectsPixelClosure=function(t,n){return this._li.computeIntersection(t,n,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,n,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,n,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,n,this._corner[3],this._corner[0]),this._li.hasIntersection()))};sr.prototype.intersectsToleranceSquare=function(t,n){var r=!1,i=!1;return this._li.computeIntersection(t,n,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,n,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,n,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,n,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||t.equals(this._pt)||n.equals(this._pt))};sr.prototype.addSnappedNode=function(t,n){var r=t.getCoordinate(n),i=t.getCoordinate(n+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),n),!0):!1};sr.prototype.interfaces_=function(){return[]};sr.prototype.getClass=function(){return sr};eN.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(sr,eN);var wf=function(){this.tempEnv1=new Nt,this.selectedSegment=new Pt};wf.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],n=arguments[1];t.getLineSegment(n,this.selectedSegment),this.select(this.selectedSegment)}}};wf.prototype.interfaces_=function(){return[]};wf.prototype.getClass=function(){return wf};var Iu=function(){this._index=null;var t=arguments[0];this._index=t},nN={HotPixelSnapAction:{configurable:!0}};Iu.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2],s=n.getSafeEnvelope(),a=new rN(n,r,i);return this._index.query(s,{interfaces_:function(){return[wo]},visitItem:function(l){var c=l;c.select(s,a)}}),a.isNodeAdded()}};Iu.prototype.interfaces_=function(){return[]};Iu.prototype.getClass=function(){return Iu};nN.HotPixelSnapAction.get=function(){return rN};Object.defineProperties(Iu,nN);var rN=function(e){function t(){e.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],s=r.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return e.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wf),pl=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new lt};pl.prototype.processIntersections=function(t,n,r,i){var s=this;if(t===r&&n===i)return null;var a=t.getCoordinates()[n],l=t.getCoordinates()[n+1],c=r.getCoordinates()[i],f=r.getCoordinates()[i+1];if(this._li.computeIntersection(a,l,c,f),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var g=0;g<this._li.getIntersectionNum();g++)s._interiorIntersections.add(s._li.getIntersection(g));t.addIntersections(this._li,n,0),r.addIntersections(this._li,i,1)}};pl.prototype.isDone=function(){return!1};pl.prototype.getInteriorIntersections=function(){return this._interiorIntersections};pl.prototype.interfaces_=function(){return[va]};pl.prototype.getClass=function(){return pl};var Es=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Ta,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Es.prototype.checkCorrectness=function(t){var n=Ae.getNodedSubstrings(t),r=new Wi(n);try{r.checkValid()}catch(i){if(i instanceof BC)i.printStackTrace();else throw i}finally{}};Es.prototype.getNodedSubstrings=function(){return Ae.getNodedSubstrings(this._nodedSegStrings)};Es.prototype.snapRound=function(t,n){var r=this.findInteriorIntersections(t,n);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)};Es.prototype.findInteriorIntersections=function(t,n){var r=new pl(n);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()};Es.prototype.computeVertexSnaps=function(){var t=this;if(Ot(arguments[0],Ge))for(var n=arguments[0],r=n.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof Ae)for(var s=arguments[0],a=s.getCoordinates(),l=0;l<a.length;l++){var c=new sr(a[l],t._scaleFactor,t._li),f=t._pointSnapper.snap(c,s,l);f&&s.addIntersection(a[l],l)}};Es.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new c_,this._pointSnapper=new Iu(this._noder.getIndex()),this.snapRound(t,this._li)};Es.prototype.computeIntersectionSnaps=function(t){for(var n=this,r=t.iterator();r.hasNext();){var i=r.next(),s=new sr(i,n._scaleFactor,n._li);n._pointSnapper.snap(s)}};Es.prototype.interfaces_=function(){return[ga]};Es.prototype.getClass=function(){return Es};var _n=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Jt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._argGeom=n,this._bufParams=r}},Xu={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};_n.prototype.bufferFixedPrecision=function(t){var n=new Co(new Es(new $t(1)),t.getScale()),r=new qn(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(n),this._resultGeometry=r.buffer(this._argGeom,this._distance)};_n.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var n=_n.MAX_PRECISION_DIGITS;n>=0;n--){try{t.bufferReducedPrecision(n)}catch(a){if(a instanceof Xs)t._saveException=a;else throw a}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=_n.precisionScaleFactor(this._argGeom,this._distance,r),s=new $t(i);this.bufferFixedPrecision(s)}};_n.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===$t.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};_n.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};_n.prototype.bufferOriginalPrecision=function(){try{var t=new qn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(n){if(n instanceof Zs)this._saveException=n;else throw n}finally{}};_n.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};_n.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};_n.prototype.interfaces_=function(){return[]};_n.prototype.getClass=function(){return _n};_n.bufferOp=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1],r=new _n(t),i=r.getResultGeometry(n);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Tt&&typeof arguments[1]=="number"){var s=arguments[0],a=arguments[1],l=arguments[2],c=new _n(s);c.setQuadrantSegments(l);var f=c.getResultGeometry(a);return f}else if(arguments[2]instanceof Jt&&arguments[0]instanceof Tt&&typeof arguments[1]=="number"){var g=arguments[0],d=arguments[1],v=arguments[2],y=new _n(g,v),x=y.getResultGeometry(d);return x}}else if(arguments.length===4){var S=arguments[0],C=arguments[1],E=arguments[2],w=arguments[3],N=new _n(S);N.setQuadrantSegments(E),N.setEndCapStyle(w);var I=N.getResultGeometry(C);return I}};_n.precisionScaleFactor=function(t,n,r){var i=t.getEnvelopeInternal(),s=Tr.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),a=n>0?n:0,l=s+2*a,c=Math.trunc(Math.log(l)/Math.log(10)+1),f=r-c,g=Math.pow(10,f);return g};Xu.CAP_ROUND.get=function(){return Jt.CAP_ROUND};Xu.CAP_BUTT.get=function(){return Jt.CAP_FLAT};Xu.CAP_FLAT.get=function(){return Jt.CAP_FLAT};Xu.CAP_SQUARE.get=function(){return Jt.CAP_SQUARE};Xu.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(_n,Xu);var Bn=function(){this._pt=[new M,new M],this._distance=Rt.NaN,this._isNull=!0};Bn.prototype.getCoordinates=function(){return this._pt};Bn.prototype.getCoordinate=function(t){return this._pt[t]};Bn.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var n=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(n,r),null;var i=n.distance(r);i<this._distance&&this.initialize(n,r,i)}};Bn.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(n),this._distance=t.distance(n),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}};Bn.prototype.getDistance=function(){return this._distance};Bn.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var n=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(n,r),null;var i=n.distance(r);i>this._distance&&this.initialize(n,r,i)}};Bn.prototype.interfaces_=function(){return[]};Bn.prototype.getClass=function(){return Bn};var ls=function(){};ls.prototype.interfaces_=function(){return[]};ls.prototype.getClass=function(){return ls};ls.computeDistance=function(){if(arguments[2]instanceof Bn&&arguments[0]instanceof Pe&&arguments[1]instanceof M)for(var t=arguments[0],n=arguments[1],r=arguments[2],i=t.getCoordinates(),s=new Pt,a=0;a<i.length-1;a++){s.setCoordinates(i[a],i[a+1]);var l=s.closestPoint(n);r.setMinimum(l,n)}else if(arguments[2]instanceof Bn&&arguments[0]instanceof Ye&&arguments[1]instanceof M){var c=arguments[0],f=arguments[1],g=arguments[2];ls.computeDistance(c.getExteriorRing(),f,g);for(var d=0;d<c.getNumInteriorRing();d++)ls.computeDistance(c.getInteriorRingN(d),f,g)}else if(arguments[2]instanceof Bn&&arguments[0]instanceof Tt&&arguments[1]instanceof M){var v=arguments[0],y=arguments[1],x=arguments[2];if(v instanceof Pe)ls.computeDistance(v,y,x);else if(v instanceof Ye)ls.computeDistance(v,y,x);else if(v instanceof Hn)for(var S=v,C=0;C<S.getNumGeometries();C++){var E=S.getGeometryN(C);ls.computeDistance(E,y,x)}else x.setMinimum(v.getCoordinate(),y)}else if(arguments[2]instanceof Bn&&arguments[0]instanceof Pt&&arguments[1]instanceof M){var w=arguments[0],N=arguments[1],I=arguments[2],R=w.closestPoint(N);I.setMinimum(R,N)}};var _a=function(t){this._maxPtDist=new Bn,this._inputGeom=t||null},f_={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_a.prototype.computeMaxMidpointDistance=function(t){var n=new No(this._inputGeom);t.apply(n),this._maxPtDist.setMaximum(n.getMaxPointDistance())};_a.prototype.computeMaxVertexDistance=function(t){var n=new gl(this._inputGeom);t.apply(n),this._maxPtDist.setMaximum(n.getMaxPointDistance())};_a.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()};_a.prototype.getDistancePoints=function(){return this._maxPtDist};_a.prototype.interfaces_=function(){return[]};_a.prototype.getClass=function(){return _a};f_.MaxPointDistanceFilter.get=function(){return gl};f_.MaxMidpointDistanceFilter.get=function(){return No};Object.defineProperties(_a,f_);var gl=function(t){this._maxPtDist=new Bn,this._minPtDist=new Bn,this._geom=t||null};gl.prototype.filter=function(t){this._minPtDist.initialize(),ls.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};gl.prototype.getMaxPointDistance=function(){return this._maxPtDist};gl.prototype.interfaces_=function(){return[vs]};gl.prototype.getClass=function(){return gl};var No=function(t){this._maxPtDist=new Bn,this._minPtDist=new Bn,this._geom=t||null};No.prototype.filter=function(t,n){if(n===0)return null;var r=t.getCoordinate(n-1),i=t.getCoordinate(n),s=new M((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),ls.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};No.prototype.isDone=function(){return!1};No.prototype.isGeometryChanged=function(){return!1};No.prototype.getMaxPointDistance=function(){return this._maxPtDist};No.prototype.interfaces_=function(){return[ci]};No.prototype.getClass=function(){return No};var qs=function(t){this._comps=t||null};qs.prototype.filter=function(t){t instanceof Ye&&this._comps.add(t)};qs.prototype.interfaces_=function(){return[Vi]};qs.prototype.getClass=function(){return qs};qs.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return qs.getPolygons(t,new lt)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return n instanceof Ye?r.add(n):n instanceof Hn&&n.apply(new qs(r)),r}};var vn=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._lines=n,this._isForcedToLineString=r}};vn.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ys){var n=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(n),null}t instanceof Pe&&this._lines.add(t)};vn.prototype.setForceToLineString=function(t){this._isForcedToLineString=t};vn.prototype.interfaces_=function(){return[Ws]};vn.prototype.getClass=function(){return vn};vn.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(vn.getLines(t))}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return n.getFactory().buildGeometry(vn.getLines(n,r))}};vn.getLines=function(){if(arguments.length===1){var t=arguments[0];return vn.getLines(t,!1)}else if(arguments.length===2){if(Ot(arguments[0],Ge)&&Ot(arguments[1],Ge)){for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var s=i.next();vn.getLines(s,r)}return r}else if(arguments[0]instanceof Tt&&typeof arguments[1]=="boolean"){var a=arguments[0],l=arguments[1],c=new lt;return a.apply(new vn(c,l)),c}else if(arguments[0]instanceof Tt&&Ot(arguments[1],Ge)){var f=arguments[0],g=arguments[1];return f instanceof Pe?g.add(f):f.apply(new vn(g)),g}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&Ot(arguments[0],Ge)&&Ot(arguments[1],Ge)){for(var d=arguments[0],v=arguments[1],y=arguments[2],x=d.iterator();x.hasNext();){var S=x.next();vn.getLines(S,v,y)}return v}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Tt&&Ot(arguments[1],Ge)){var C=arguments[0],E=arguments[1],w=arguments[2];return C.apply(new vn(E,w)),E}}};var pi=function(){if(this._boundaryRule=Qr.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new ve("Rule must be non-null");this._boundaryRule=t}}};pi.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof M&&arguments[1]instanceof Ye){var n=arguments[0],r=arguments[1];if(r.isEmpty())return k.EXTERIOR;var i=r.getExteriorRing(),s=this.locateInPolygonRing(n,i);if(s===k.EXTERIOR)return k.EXTERIOR;if(s===k.BOUNDARY)return k.BOUNDARY;for(var a=0;a<r.getNumInteriorRing();a++){var l=r.getInteriorRingN(a),c=t.locateInPolygonRing(n,l);if(c===k.INTERIOR)return k.EXTERIOR;if(c===k.BOUNDARY)return k.BOUNDARY}return k.INTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof Pe){var f=arguments[0],g=arguments[1];if(!g.getEnvelopeInternal().intersects(f))return k.EXTERIOR;var d=g.getCoordinates();return!g.isClosed()&&(f.equals(d[0])||f.equals(d[d.length-1]))?k.BOUNDARY:dt.isOnLine(f,d)?k.INTERIOR:k.EXTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof gr){var v=arguments[0],y=arguments[1],x=y.getCoordinate();return x.equals2D(v)?k.INTERIOR:k.EXTERIOR}};pi.prototype.locateInPolygonRing=function(t,n){return n.getEnvelopeInternal().intersects(t)?dt.locatePointInRing(t,n.getCoordinates()):k.EXTERIOR};pi.prototype.intersects=function(t,n){return this.locate(t,n)!==k.EXTERIOR};pi.prototype.updateLocationInfo=function(t){t===k.INTERIOR&&(this._isIn=!0),t===k.BOUNDARY&&this._numBoundaries++};pi.prototype.computeLocation=function(t,n){var r=this;if(n instanceof gr&&this.updateLocationInfo(this.locateInternal(t,n)),n instanceof Pe)this.updateLocationInfo(this.locateInternal(t,n));else if(n instanceof Ye)this.updateLocationInfo(this.locateInternal(t,n));else if(n instanceof pa)for(var i=n,s=0;s<i.getNumGeometries();s++){var a=i.getGeometryN(s);r.updateLocationInfo(r.locateInternal(t,a))}else if(n instanceof ps)for(var l=n,c=0;c<l.getNumGeometries();c++){var f=l.getGeometryN(c);r.updateLocationInfo(r.locateInternal(t,f))}else if(n instanceof Hn)for(var g=new gs(n);g.hasNext();){var d=g.next();d!==n&&r.computeLocation(t,d)}};pi.prototype.locate=function(t,n){return n.isEmpty()?k.EXTERIOR:n instanceof Pe?this.locateInternal(t,n):n instanceof Ye?this.locateInternal(t,n):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,n),this._boundaryRule.isInBoundary(this._numBoundaries)?k.BOUNDARY:this._numBoundaries>0||this._isIn?k.INTERIOR:k.EXTERIOR)};pi.prototype.interfaces_=function(){return[]};pi.prototype.getClass=function(){return pi};var Un=function e(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],n=arguments[1];e.call(this,t,e.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._component=r,this._segIndex=i,this._pt=s}},iN={INSIDE_AREA:{configurable:!0}};Un.prototype.isInsideArea=function(){return this._segIndex===Un.INSIDE_AREA};Un.prototype.getCoordinate=function(){return this._pt};Un.prototype.getGeometryComponent=function(){return this._component};Un.prototype.getSegmentIndex=function(){return this._segIndex};Un.prototype.interfaces_=function(){return[]};Un.prototype.getClass=function(){return Un};iN.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Un,iN);var ho=function(t){this._pts=t||null};ho.prototype.filter=function(t){t instanceof gr&&this._pts.add(t)};ho.prototype.interfaces_=function(){return[Vi]};ho.prototype.getClass=function(){return ho};ho.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof gr?hi.singletonList(t):ho.getPoints(t,new lt)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return n instanceof gr?r.add(n):n instanceof Hn&&n.apply(new ho(r)),r}};var ml=function(){this._locations=null;var t=arguments[0];this._locations=t};ml.prototype.filter=function(t){(t instanceof gr||t instanceof Pe||t instanceof Ye)&&this._locations.add(new Un(t,0,t.getCoordinate()))};ml.prototype.interfaces_=function(){return[Vi]};ml.prototype.getClass=function(){return ml};ml.getLocations=function(t){var n=new lt;return t.apply(new ml(n)),n};var En=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new pi,this._minDistanceLocation=null,this._minDistance=Rt.MAX_VALUE,arguments.length===2){var t=arguments[0],n=arguments[1];this._geom=[t,n],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=s}};En.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var n=new Array(2).fill(null);if(this.computeContainmentDistance(0,n),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,n)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=1-r,a=qs.getPolygons(this._geom[r]);if(a.size()>0){var l=ml.getLocations(this._geom[s]);if(this.computeContainmentDistance(l,a,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&Ot(arguments[0],ai)&&Ot(arguments[1],ai)){for(var c=arguments[0],f=arguments[1],g=arguments[2],d=0;d<c.size();d++)for(var v=c.get(d),y=0;y<f.size();y++)if(t.computeContainmentDistance(v,f.get(y),g),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Un&&arguments[1]instanceof Ye){var x=arguments[0],S=arguments[1],C=arguments[2],E=x.getCoordinate();if(k.EXTERIOR!==this._ptLocator.locate(E,S))return this._minDistance=0,C[0]=x,C[1]=new Un(S,E),null}}};En.prototype.computeMinDistanceLinesPoints=function(t,n,r){for(var i=this,s=0;s<t.size();s++)for(var a=t.get(s),l=0;l<n.size();l++){var c=n.get(l);if(i.computeMinDistance(a,c,r),i._minDistance<=i._terminateDistance)return null}};En.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),n=vn.getLines(this._geom[0]),r=vn.getLines(this._geom[1]),i=ho.getPoints(this._geom[0]),s=ho.getPoints(this._geom[1]);if(this.computeMinDistanceLines(n,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,s,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,s,t),this.updateMinDistance(t,!1)};En.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation};En.prototype.updateMinDistance=function(t,n){if(t[0]===null)return null;n?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])};En.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t};En.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Pe&&arguments[1]instanceof gr){var n=arguments[0],r=arguments[1],i=arguments[2];if(n.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var s=n.getCoordinates(),a=r.getCoordinate(),l=0;l<s.length-1;l++){var c=dt.distancePointLine(a,s[l],s[l+1]);if(c<t._minDistance){t._minDistance=c;var f=new Pt(s[l],s[l+1]),g=f.closestPoint(a);i[0]=new Un(n,l,g),i[1]=new Un(r,0,a)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Pe&&arguments[1]instanceof Pe){var d=arguments[0],v=arguments[1],y=arguments[2];if(d.getEnvelopeInternal().distance(v.getEnvelopeInternal())>this._minDistance)return null;for(var x=d.getCoordinates(),S=v.getCoordinates(),C=0;C<x.length-1;C++)for(var E=0;E<S.length-1;E++){var w=dt.distanceLineLine(x[C],x[C+1],S[E],S[E+1]);if(w<t._minDistance){t._minDistance=w;var N=new Pt(x[C],x[C+1]),I=new Pt(S[E],S[E+1]),R=N.closestPoints(I);y[0]=new Un(d,C,R[0]),y[1]=new Un(v,E,R[1])}if(t._minDistance<=t._terminateDistance)return null}}}};En.prototype.computeMinDistancePoints=function(t,n,r){for(var i=this,s=0;s<t.size();s++)for(var a=t.get(s),l=0;l<n.size();l++){var c=n.get(l),f=a.getCoordinate().distance(c.getCoordinate());if(f<i._minDistance&&(i._minDistance=f,r[0]=new Un(a,0,a.getCoordinate()),r[1]=new Un(c,0,c.getCoordinate())),i._minDistance<=i._terminateDistance)return null}};En.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ve("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)};En.prototype.computeMinDistanceLines=function(t,n,r){for(var i=this,s=0;s<t.size();s++)for(var a=t.get(s),l=0;l<n.size();l++){var c=n.get(l);if(i.computeMinDistance(a,c,r),i._minDistance<=i._terminateDistance)return null}};En.prototype.interfaces_=function(){return[]};En.prototype.getClass=function(){return En};En.distance=function(t,n){var r=new En(t,n);return r.distance()};En.isWithinDistance=function(t,n,r){var i=new En(t,n,r);return i.distance()<=r};En.nearestPoints=function(t,n){var r=new En(t,n);return r.nearestPoints()};var Rn=function(){this._pt=[new M,new M],this._distance=Rt.NaN,this._isNull=!0};Rn.prototype.getCoordinates=function(){return this._pt};Rn.prototype.getCoordinate=function(t){return this._pt[t]};Rn.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var n=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(n,r),null;var i=n.distance(r);i<this._distance&&this.initialize(n,r,i)}};Rn.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(n),this._distance=t.distance(n),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}};Rn.prototype.toString=function(){return ui.toLineString(this._pt[0],this._pt[1])};Rn.prototype.getDistance=function(){return this._distance};Rn.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var n=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(n,r),null;var i=n.distance(r);i>this._distance&&this.initialize(n,r,i)}};Rn.prototype.interfaces_=function(){return[]};Rn.prototype.getClass=function(){return Rn};var Mi=function(){};Mi.prototype.interfaces_=function(){return[]};Mi.prototype.getClass=function(){return Mi};Mi.computeDistance=function(){if(arguments[2]instanceof Rn&&arguments[0]instanceof Pe&&arguments[1]instanceof M)for(var t=arguments[0],n=arguments[1],r=arguments[2],i=new Pt,s=t.getCoordinates(),a=0;a<s.length-1;a++){i.setCoordinates(s[a],s[a+1]);var l=i.closestPoint(n);r.setMinimum(l,n)}else if(arguments[2]instanceof Rn&&arguments[0]instanceof Ye&&arguments[1]instanceof M){var c=arguments[0],f=arguments[1],g=arguments[2];Mi.computeDistance(c.getExteriorRing(),f,g);for(var d=0;d<c.getNumInteriorRing();d++)Mi.computeDistance(c.getInteriorRingN(d),f,g)}else if(arguments[2]instanceof Rn&&arguments[0]instanceof Tt&&arguments[1]instanceof M){var v=arguments[0],y=arguments[1],x=arguments[2];if(v instanceof Pe)Mi.computeDistance(v,y,x);else if(v instanceof Ye)Mi.computeDistance(v,y,x);else if(v instanceof Hn)for(var S=v,C=0;C<S.getNumGeometries();C++){var E=S.getGeometryN(C);Mi.computeDistance(E,y,x)}else x.setMinimum(v.getCoordinate(),y)}else if(arguments[2]instanceof Rn&&arguments[0]instanceof Pt&&arguments[1]instanceof M){var w=arguments[0],N=arguments[1],I=arguments[2],R=w.closestPoint(N);I.setMinimum(R,N)}};var Kr=function(){this._g0=null,this._g1=null,this._ptDist=new Rn,this._densifyFrac=0;var t=arguments[0],n=arguments[1];this._g0=t,this._g1=n},h_={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Kr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()};Kr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ve("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};Kr.prototype.compute=function(t,n){this.computeOrientedDistance(t,n,this._ptDist),this.computeOrientedDistance(n,t,this._ptDist)};Kr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Kr.prototype.computeOrientedDistance=function(t,n,r){var i=new vl(n);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new Po(n,this._densifyFrac);t.apply(s),r.setMaximum(s.getMaxPointDistance())}};Kr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Kr.prototype.interfaces_=function(){return[]};Kr.prototype.getClass=function(){return Kr};Kr.distance=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1],r=new Kr(t,n);return r.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2],l=new Kr(i,s);return l.setDensifyFraction(a),l.distance()}};h_.MaxPointDistanceFilter.get=function(){return vl};h_.MaxDensifiedByFractionDistanceFilter.get=function(){return Po};Object.defineProperties(Kr,h_);var vl=function(){this._maxPtDist=new Rn,this._minPtDist=new Rn,this._euclideanDist=new Mi,this._geom=null;var t=arguments[0];this._geom=t};vl.prototype.filter=function(t){this._minPtDist.initialize(),Mi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};vl.prototype.getMaxPointDistance=function(){return this._maxPtDist};vl.prototype.interfaces_=function(){return[vs]};vl.prototype.getClass=function(){return vl};var Po=function(){this._maxPtDist=new Rn,this._minPtDist=new Rn,this._geom=null,this._numSubSegs=0;var t=arguments[0],n=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/n))};Po.prototype.filter=function(t,n){var r=this;if(n===0)return null;for(var i=t.getCoordinate(n-1),s=t.getCoordinate(n),a=(s.x-i.x)/this._numSubSegs,l=(s.y-i.y)/this._numSubSegs,c=0;c<this._numSubSegs;c++){var f=i.x+c*a,g=i.y+c*l,d=new M(f,g);r._minPtDist.initialize(),Mi.computeDistance(r._geom,d,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}};Po.prototype.isDone=function(){return!1};Po.prototype.isGeometryChanged=function(){return!1};Po.prototype.getMaxPointDistance=function(){return this._maxPtDist};Po.prototype.interfaces_=function(){return[ci]};Po.prototype.getClass=function(){return Po};var dr=function(t,n,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=n||null,this._result=r||null},d_={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};dr.prototype.checkMaximumDistance=function(t,n,r){var i=new Kr(n,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ui.toLineString(s[0],s[1])+")"}};dr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),n=dr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-n,this._maxValidDistance=t+n,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),dr.VERBOSE&&wn.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};dr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ye||this._input instanceof ps||this._input instanceof Hn))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)};dr.prototype.getErrorIndicator=function(){return this._errorIndicator};dr.prototype.checkMinimumDistance=function(t,n,r){var i=new En(t,n,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ui.toLineString(s[0],s[1])+" )"}};dr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)};dr.prototype.getErrorLocation=function(){return this._errorLocation};dr.prototype.getPolygonLines=function(t){for(var n=new lt,r=new vn(n),i=qs.getPolygons(t),s=i.iterator();s.hasNext();){var a=s.next();a.apply(r)}return t.getFactory().buildGeometry(n)};dr.prototype.getErrorMessage=function(){return this._errMsg};dr.prototype.interfaces_=function(){return[]};dr.prototype.getClass=function(){return dr};d_.VERBOSE.get=function(){return!1};d_.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012};Object.defineProperties(dr,d_);var Sn=function(t,n,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=n||null,this._result=r||null},p_={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Sn.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid};Sn.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Sn.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var n=new Nt(this._input.getEnvelopeInternal());n.expandBy(this._distance);var r=new Nt(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(n)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")};Sn.prototype.checkDistance=function(){var t=new dr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")};Sn.prototype.checkArea=function(){var t=this._input.getArea(),n=this._result.getArea();this._distance>0&&t>n&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<n&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")};Sn.prototype.checkPolygonal=function(){this._result instanceof Ye||this._result instanceof ps||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")};Sn.prototype.getErrorIndicator=function(){return this._errorIndicator};Sn.prototype.getErrorLocation=function(){return this._errorLocation};Sn.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};Sn.prototype.report=function(t){if(!Sn.VERBOSE)return null;wn.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};Sn.prototype.getErrorMessage=function(){return this._errorMsg};Sn.prototype.interfaces_=function(){return[]};Sn.prototype.getClass=function(){return Sn};Sn.isValidMsg=function(t,n,r){var i=new Sn(t,n,r);return i.isValid()?null:i.getErrorMessage()};Sn.isValid=function(t,n,r){var i=new Sn(t,n,r);return!!i.isValid()};p_.VERBOSE.get=function(){return!1};p_.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(Sn,p_);var Xi=function(){this._pts=null,this._data=null;var t=arguments[0],n=arguments[1];this._pts=t,this._data=n};Xi.prototype.getCoordinates=function(){return this._pts};Xi.prototype.size=function(){return this._pts.length};Xi.prototype.getCoordinate=function(t){return this._pts[t]};Xi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Xi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hl.octant(this.getCoordinate(t),this.getCoordinate(t+1))};Xi.prototype.setData=function(t){this._data=t};Xi.prototype.getData=function(){return this._data};Xi.prototype.toString=function(){return ui.toLineString(new Oe(this._pts))};Xi.prototype.interfaces_=function(){return[xs]};Xi.prototype.getClass=function(){return Xi};var ln=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new lt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};ln.prototype.getInteriorIntersection=function(){return this._interiorIntersection};ln.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};ln.prototype.getIntersectionSegments=function(){return this._intSegments};ln.prototype.count=function(){return this._intersectionCount};ln.prototype.getIntersections=function(){return this._intersections};ln.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};ln.prototype.setKeepIntersections=function(t){this._keepIntersections=t};ln.prototype.processIntersections=function(t,n,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&n===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(t,n)||this.isEndSegment(r,i);if(!s)return null}var a=t.getCoordinates()[n],l=t.getCoordinates()[n+1],c=r.getCoordinates()[i],f=r.getCoordinates()[i+1];this._li.computeIntersection(a,l,c,f),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=a,this._intSegments[1]=l,this._intSegments[2]=c,this._intSegments[3]=f,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};ln.prototype.isEndSegment=function(t,n){return n===0||n>=t.size()-2};ln.prototype.hasIntersection=function(){return this._interiorIntersection!==null};ln.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};ln.prototype.interfaces_=function(){return[va]};ln.prototype.getClass=function(){return ln};ln.createAllIntersectionsFinder=function(t){var n=new ln(t);return n.setFindAllIntersections(!0),n};ln.createAnyIntersectionFinder=function(t){return new ln(t)};ln.createIntersectionCounter=function(t){var n=new ln(t);return n.setFindAllIntersections(!0),n.setKeepIntersections(!1),n};var gi=function(){this._li=new Ta,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};gi.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};gi.prototype.getIntersections=function(){return this._segInt.getIntersections()};gi.prototype.isValid=function(){return this.execute(),this._isValid};gi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};gi.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ln(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new c_;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};gi.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Xs(this.getErrorMessage(),this._segInt.getInteriorIntersection())};gi.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ui.toLineString(t[0],t[1])+" and "+ui.toLineString(t[2],t[3])};gi.prototype.interfaces_=function(){return[]};gi.prototype.getClass=function(){return gi};gi.computeIntersections=function(t){var n=new gi(t);return n.setFindAllIntersections(!0),n.isValid(),n.getIntersections()};var xa=function e(){this._nv=null;var t=arguments[0];this._nv=new gi(e.toSegmentStrings(t))};xa.prototype.checkValid=function(){this._nv.checkValid()};xa.prototype.interfaces_=function(){return[]};xa.prototype.getClass=function(){return xa};xa.toSegmentStrings=function(t){for(var n=new lt,r=t.iterator();r.hasNext();){var i=r.next();n.add(new Xi(i.getCoordinates(),i))}return n};xa.checkValid=function(t){var n=new xa(t);n.checkValid()};var yl=function(t){this._mapOp=t};yl.prototype.map=function(t){for(var n=this,r=new lt,i=0;i<t.getNumGeometries();i++){var s=n._mapOp.map(t.getGeometryN(i));s.isEmpty()||r.add(s)}return t.getFactory().createGeometryCollection(Ut.toGeometryArray(r))};yl.prototype.interfaces_=function(){return[]};yl.prototype.getClass=function(){return yl};yl.map=function(t,n){var r=new yl(n);return r.map(t)};var Yi=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new lt,this._resultLineList=new lt;var t=arguments[0],n=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=n,this._ptLocator=r};Yi.prototype.collectLines=function(t){for(var n=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();n.collectLineEdge(i,t,n._lineEdgesList),n.collectBoundaryTouchEdge(i,t,n._lineEdgesList)}};Yi.prototype.labelIsolatedLine=function(t,n){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(n));t.getLabel().setLocation(n,r)};Yi.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList};Yi.prototype.collectLineEdge=function(t,n,r){var i=t.getLabel(),s=t.getEdge();t.isLineEdge()&&!t.isVisited()&&At.isResultOfOp(i,n)&&!s.isCovered()&&(r.add(s),t.setVisitedEdge(!0))};Yi.prototype.findCoveredLineEdges=function(){for(var t=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var r=n.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),a=s.getEdge();if(s.isLineEdge()&&!a.isCoveredSet()){var l=t._op.isCoveredByA(s.getCoordinate());a.setCovered(l)}}};Yi.prototype.labelIsolatedLines=function(t){for(var n=this,r=t.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?n.labelIsolatedLine(i,0):n.labelIsolatedLine(i,1))}};Yi.prototype.buildLines=function(t){for(var n=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),s=n._geometryFactory.createLineString(i.getCoordinates());n._resultLineList.add(s),i.setInResult(!0)}};Yi.prototype.collectBoundaryTouchEdge=function(t,n,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;kt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),At.isResultOfOp(i,n)&&n===At.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))};Yi.prototype.interfaces_=function(){return[]};Yi.prototype.getClass=function(){return Yi};var _l=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new lt;var t=arguments[0],n=arguments[1];this._op=t,this._geometryFactory=n};_l.prototype.filterCoveredNodeToPoint=function(t){var n=t.getCoordinate();if(!this._op.isCoveredByLA(n)){var r=this._geometryFactory.createPoint(n);this._resultPointList.add(r)}};_l.prototype.extractNonCoveredResultNodes=function(t){for(var n=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===At.INTERSECTION)){var s=i.getLabel();At.isResultOfOp(s,t)&&n.filterCoveredNodeToPoint(i)}}};_l.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList};_l.prototype.interfaces_=function(){return[]};_l.prototype.getClass=function(){return _l};var or=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};or.prototype.transformPoint=function(t,n){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))};or.prototype.transformPolygon=function(t,n){var r=this,i=!0,s=this.transformLinearRing(t.getExteriorRing(),t);(s===null||!(s instanceof ys)||s.isEmpty())&&(i=!1);for(var a=new lt,l=0;l<t.getNumInteriorRing();l++){var c=r.transformLinearRing(t.getInteriorRingN(l),t);c===null||c.isEmpty()||(c instanceof ys||(i=!1),a.add(c))}if(i)return this._factory.createPolygon(s,a.toArray([]));var f=new lt;return s!==null&&f.add(s),f.addAll(a),this._factory.buildGeometry(f)};or.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)};or.prototype.getInputGeometry=function(){return this._inputGeom};or.prototype.transformMultiLineString=function(t,n){for(var r=this,i=new lt,s=0;s<t.getNumGeometries();s++){var a=r.transformLineString(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)};or.prototype.transformCoordinates=function(t,n){return this.copy(t)};or.prototype.transformLineString=function(t,n){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))};or.prototype.transformMultiPoint=function(t,n){for(var r=this,i=new lt,s=0;s<t.getNumGeometries();s++){var a=r.transformPoint(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)};or.prototype.transformMultiPolygon=function(t,n){for(var r=this,i=new lt,s=0;s<t.getNumGeometries();s++){var a=r.transformPolygon(t.getGeometryN(s),t);a!==null&&(a.isEmpty()||i.add(a))}return this._factory.buildGeometry(i)};or.prototype.copy=function(t){return t.copy()};or.prototype.transformGeometryCollection=function(t,n){for(var r=this,i=new lt,s=0;s<t.getNumGeometries();s++){var a=r.transform(t.getGeometryN(s));a!==null&&(r._pruneEmptyGeometry&&a.isEmpty()||i.add(a))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Ut.toGeometryArray(i)):this._factory.buildGeometry(i)};or.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof gr)return this.transformPoint(t,null);if(t instanceof Cu)return this.transformMultiPoint(t,null);if(t instanceof ys)return this.transformLinearRing(t,null);if(t instanceof Pe)return this.transformLineString(t,null);if(t instanceof pa)return this.transformMultiLineString(t,null);if(t instanceof Ye)return this.transformPolygon(t,null);if(t instanceof ps)return this.transformMultiPolygon(t,null);if(t instanceof Hn)return this.transformGeometryCollection(t,null);throw new ve("Unknown Geometry subtype: "+t.getClass().getName())};or.prototype.transformLinearRing=function(t,n){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)};or.prototype.interfaces_=function(){return[]};or.prototype.getClass=function(){return or};var Ss=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Pt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Pe&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];e.call(this,t.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=e.isClosed(r),this._snapTolerance=i}};Ss.prototype.snapVertices=function(t,n){for(var r=this,i=this._isClosed?t.size()-1:t.size(),s=0;s<i;s++){var a=t.get(s),l=r.findSnapForVertex(a,n);l!==null&&(t.set(s,new M(l)),s===0&&r._isClosed&&t.set(t.size()-1,new M(l)))}};Ss.prototype.findSnapForVertex=function(t,n){for(var r=this,i=0;i<n.length;i++){if(t.equals2D(n[i]))return null;if(t.distance(n[i])<r._snapTolerance)return n[i]}return null};Ss.prototype.snapTo=function(t){var n=new Vf(this._srcPts);this.snapVertices(n,t),this.snapSegments(n,t);var r=n.toCoordinateArray();return r};Ss.prototype.snapSegments=function(t,n){var r=this;if(n.length===0)return null;var i=n.length;n[0].equals2D(n[n.length-1])&&(i=n.length-1);for(var s=0;s<i;s++){var a=n[s],l=r.findSegmentIndexToSnap(a,t);l>=0&&t.add(l+1,new M(a),!1)}};Ss.prototype.findSegmentIndexToSnap=function(t,n){for(var r=this,i=Rt.MAX_VALUE,s=-1,a=0;a<n.size()-1;a++){if(r._seg.p0=n.get(a),r._seg.p1=n.get(a+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var l=r._seg.distance(t);l<r._snapTolerance&&l<i&&(i=l,s=a)}return s};Ss.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t};Ss.prototype.interfaces_=function(){return[]};Ss.prototype.getClass=function(){return Ss};Ss.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Re=function(t){this._srcGeom=t||null},sN={SNAP_PRECISION_FACTOR:{configurable:!0}};Re.prototype.snapTo=function(t,n){var r=this.extractTargetCoordinates(t),i=new oN(n,r);return i.transform(this._srcGeom)};Re.prototype.snapToSelf=function(t,n){var r=this.extractTargetCoordinates(this._srcGeom),i=new oN(t,r,!0),s=i.transform(this._srcGeom),a=s;return n&&Ot(a,xo)&&(a=s.buffer(0)),a};Re.prototype.computeSnapTolerance=function(t){var n=this.computeMinimumSegmentLength(t),r=n/10;return r};Re.prototype.extractTargetCoordinates=function(t){for(var n=new Ui,r=t.getCoordinates(),i=0;i<r.length;i++)n.add(r[i]);return n.toArray(new Array(0).fill(null))};Re.prototype.computeMinimumSegmentLength=function(t){for(var n=Rt.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<n&&(n=i)}return n};Re.prototype.interfaces_=function(){return[]};Re.prototype.getClass=function(){return Re};Re.snap=function(t,n,r){var i=new Array(2).fill(null),s=new Re(t);i[0]=s.snapTo(n,r);var a=new Re(n);return i[1]=a.snapTo(i[0],r),i};Re.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],n=Re.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===$t.FIXED){var i=1/r.getScale()*2/1.415;i>n&&(n=i)}return n}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return Math.min(Re.computeOverlaySnapTolerance(s),Re.computeOverlaySnapTolerance(a))}};Re.computeSizeBasedSnapTolerance=function(t){var n=t.getEnvelopeInternal(),r=Math.min(n.getHeight(),n.getWidth()),i=r*Re.SNAP_PRECISION_FACTOR;return i};Re.snapToSelf=function(t,n,r){var i=new Re(t);return i.snapToSelf(n,r)};sN.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(Re,sN);var oN=function(e){function t(n,r,i){e.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var s=new Ss(r,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var s=r.toCoordinateArray(),a=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(or),zn=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};zn.prototype.getCommon=function(){return Rt.longBitsToDouble(this._commonBits)};zn.prototype.add=function(t){var n=Rt.doubleToLongBits(t);if(this._isFirst)return this._commonBits=n,this._commonSignExp=zn.signExpBits(this._commonBits),this._isFirst=!1,null;var r=zn.signExpBits(n);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=zn.numCommonMostSigMantissaBits(this._commonBits,n),this._commonBits=zn.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};zn.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],n=Rt.longBitsToDouble(t),r=Rt.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,s=i.substring(i.length-64),a=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+n+" ]";return a}};zn.prototype.interfaces_=function(){return[]};zn.prototype.getClass=function(){return zn};zn.getBit=function(t,n){var r=1<<n;return t&r?1:0};zn.signExpBits=function(t){return t>>52};zn.zeroLowerBits=function(t,n){var r=(1<<n)-1,i=~r,s=t&i;return s};zn.numCommonMostSigMantissaBits=function(t,n){for(var r=0,i=52;i>=0;i--){if(zn.getBit(t,i)!==zn.getBit(n,i))return r;r++}return 52};var bo=function(){this._commonCoord=null,this._ccFilter=new xl},g_={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};bo.prototype.addCommonBits=function(t){var n=new Lo(this._commonCoord);t.apply(n),t.geometryChanged()};bo.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var n=new M(this._commonCoord);n.x=-n.x,n.y=-n.y;var r=new Lo(n);return t.apply(r),t.geometryChanged(),t};bo.prototype.getCommonCoordinate=function(){return this._commonCoord};bo.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};bo.prototype.interfaces_=function(){return[]};bo.prototype.getClass=function(){return bo};g_.CommonCoordinateFilter.get=function(){return xl};g_.Translater.get=function(){return Lo};Object.defineProperties(bo,g_);var xl=function(){this._commonBitsX=new zn,this._commonBitsY=new zn};xl.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};xl.prototype.getCommonCoordinate=function(){return new M(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};xl.prototype.interfaces_=function(){return[vs]};xl.prototype.getClass=function(){return xl};var Lo=function(){this.trans=null;var t=arguments[0];this.trans=t};Lo.prototype.filter=function(t,n){var r=t.getOrdinate(n,0)+this.trans.x,i=t.getOrdinate(n,1)+this.trans.y;t.setOrdinate(n,0,r),t.setOrdinate(n,1,i)};Lo.prototype.isDone=function(){return!1};Lo.prototype.isGeometryChanged=function(){return!0};Lo.prototype.interfaces_=function(){return[ci]};Lo.prototype.getClass=function(){return Lo};var un=function(t,n){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=n,this.computeSnapTolerance()};un.prototype.selfSnap=function(t){var n=new Re(t),r=n.snapTo(t,this._snapTolerance);return r};un.prototype.removeCommonBits=function(t){this._cbr=new bo,this._cbr.add(t[0]),this._cbr.add(t[1]);var n=new Array(2).fill(null);return n[0]=this._cbr.removeCommonBits(t[0].copy()),n[1]=this._cbr.removeCommonBits(t[1].copy()),n};un.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};un.prototype.getResultGeometry=function(t){var n=this.snap(this._geom),r=At.overlayOp(n[0],n[1],t);return this.prepareResult(r)};un.prototype.checkValid=function(t){t.isValid()||wn.out.println("Snapped geometry is invalid")};un.prototype.computeSnapTolerance=function(){this._snapTolerance=Re.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};un.prototype.snap=function(t){var n=this.removeCommonBits(t),r=Re.snap(n[0],n[1],this._snapTolerance);return r};un.prototype.interfaces_=function(){return[]};un.prototype.getClass=function(){return un};un.overlayOp=function(t,n,r){var i=new un(t,n);return i.getResultGeometry(r)};un.union=function(t,n){return un.overlayOp(t,n,At.UNION)};un.intersection=function(t,n){return un.overlayOp(t,n,At.INTERSECTION)};un.symDifference=function(t,n){return un.overlayOp(t,n,At.SYMDIFFERENCE)};un.difference=function(t,n){return un.overlayOp(t,n,At.DIFFERENCE)};var Xn=function(t,n){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=n};Xn.prototype.getResultGeometry=function(t){var n=null,r=!1,i=null;try{n=At.overlayOp(this._geom[0],this._geom[1],t);var s=!0;s&&(r=!0)}catch(a){if(a instanceof Zs)i=a;else throw a}finally{}if(!r)try{n=un.overlayOp(this._geom[0],this._geom[1],t)}catch(a){throw a instanceof Zs?i:a}finally{}return n};Xn.prototype.interfaces_=function(){return[]};Xn.prototype.getClass=function(){return Xn};Xn.overlayOp=function(t,n,r){var i=new Xn(t,n);return i.getResultGeometry(r)};Xn.union=function(t,n){return Xn.overlayOp(t,n,At.UNION)};Xn.intersection=function(t,n){return Xn.overlayOp(t,n,At.INTERSECTION)};Xn.symDifference=function(t,n){return Xn.overlayOp(t,n,At.SYMDIFFERENCE)};Xn.difference=function(t,n){return Xn.overlayOp(t,n,At.DIFFERENCE)};var Ef=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],n=arguments[1];this.mce=t,this.chainIndex=n};Ef.prototype.computeIntersections=function(t,n){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,n)};Ef.prototype.interfaces_=function(){return[]};Ef.prototype.getClass=function(){return Ef};var yr=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],n=arguments[1];this._eventType=e.DELETE,this._xValue=t,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._eventType=e.INSERT,this._label=r,this._xValue=i,this._obj=s}},m_={INSERT:{configurable:!0},DELETE:{configurable:!0}};yr.prototype.isDelete=function(){return this._eventType===yr.DELETE};yr.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};yr.prototype.getObject=function(){return this._obj};yr.prototype.compareTo=function(t){var n=t;return this._xValue<n._xValue?-1:this._xValue>n._xValue?1:this._eventType<n._eventType?-1:this._eventType>n._eventType?1:0};yr.prototype.getInsertEvent=function(){return this._insertEvent};yr.prototype.isInsert=function(){return this._eventType===yr.INSERT};yr.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};yr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};yr.prototype.interfaces_=function(){return[ti]};yr.prototype.getClass=function(){return yr};m_.INSERT.get=function(){return 1};m_.DELETE.get=function(){return 2};Object.defineProperties(yr,m_);var Yd=function(){};Yd.prototype.interfaces_=function(){return[]};Yd.prototype.getClass=function(){return Yd};var Cn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._li=t,this._includeProper=n,this._recordIsolated=r};Cn.prototype.isTrivialIntersection=function(t,n,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Cn.isAdjacentSegments(n,i))return!0;if(t.isClosed()){var s=t.getNumPoints()-1;if(n===0&&i===s||i===0&&n===s)return!0}}return!1};Cn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Cn.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};Cn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Cn.prototype.isBoundaryPointInternal=function(t,n){for(var r=n.iterator();r.hasNext();){var i=r.next(),s=i.getCoordinate();if(t.isIntersection(s))return!0}return!1};Cn.prototype.hasProperIntersection=function(){return this._hasProper};Cn.prototype.hasIntersection=function(){return this._hasIntersection};Cn.prototype.isDone=function(){return this._isDone};Cn.prototype.isBoundaryPoint=function(t,n){return n===null?!1:!!(this.isBoundaryPointInternal(t,n[0])||this.isBoundaryPointInternal(t,n[1]))};Cn.prototype.setBoundaryNodes=function(t,n){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=n};Cn.prototype.addIntersections=function(t,n,r,i){if(t===r&&n===i)return null;this.numTests++;var s=t.getCoordinates()[n],a=t.getCoordinates()[n+1],l=r.getCoordinates()[i],c=r.getCoordinates()[i+1];this._li.computeIntersection(s,a,l,c),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,n,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,n,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};Cn.prototype.interfaces_=function(){return[]};Cn.prototype.getClass=function(){return Cn};Cn.isAdjacentSegments=function(t,n){return Math.abs(t-n)===1};var AA=function(e){function t(){e.call(this),this.events=new lt,this.nOverlaps=null}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;hi.sort(this.events);for(var i=0;i<this.events.size();i++){var s=r.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var a=r.events.get(s);if(a.isInsert()&&r.processOverlaps(s,a.getDeleteEventIndex(),a,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Cn&&Ot(arguments[0],ai)&&Ot(arguments[1],ai)){var l=arguments[0],c=arguments[1],f=arguments[2];this.addEdges(l,l),this.addEdges(c,c),this.computeIntersections(f)}else if(typeof arguments[2]=="boolean"&&Ot(arguments[0],ai)&&arguments[1]instanceof Cn){var g=arguments[0],d=arguments[1],v=arguments[2];v?this.addEdges(g,null):this.addEdges(g),this.computeIntersections(d)}}},t.prototype.addEdge=function(r,i){for(var s=this,a=r.getMonotoneChainEdge(),l=a.getStartIndexes(),c=0;c<l.length-1;c++){var f=new Ef(a,c),g=new yr(i,a.getMinX(c),f);s.events.add(g),s.events.add(new yr(a.getMaxX(c),g))}},t.prototype.processOverlaps=function(r,i,s,a){for(var l=this,c=s.getObject(),f=r;f<i;f++){var g=l.events.get(f);if(g.isInsert()){var d=g.getObject();s.isSameLabel(g)||(c.computeIntersections(d,a),l.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var a=s.next();r.addEdge(a,a)}else if(arguments.length===2)for(var l=arguments[0],c=arguments[1],f=l.iterator();f.hasNext();){var g=f.next();r.addEdge(g,c)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Yd),Cs=function(){this._min=Rt.POSITIVE_INFINITY,this._max=Rt.NEGATIVE_INFINITY},aN={NodeComparator:{configurable:!0}};Cs.prototype.getMin=function(){return this._min};Cs.prototype.intersects=function(t,n){return!(this._min>n||this._max<t)};Cs.prototype.getMax=function(){return this._max};Cs.prototype.toString=function(){return ui.toLineString(new M(this._min,0),new M(this._max,0))};Cs.prototype.interfaces_=function(){return[]};Cs.prototype.getClass=function(){return Cs};aN.NodeComparator.get=function(){return Sf};Object.defineProperties(Cs,aN);var Sf=function(){};Sf.prototype.compare=function(t,n){var r=t,i=n,s=(r._min+r._max)/2,a=(i._min+i._max)/2;return s<a?-1:s>a?1:0};Sf.prototype.interfaces_=function(){return[vu]};Sf.prototype.getClass=function(){return Sf};var DA=function(e){function t(){e.call(this),this._item=null;var n=arguments[0],r=arguments[1],i=arguments[2];this._min=n,this._max=r,this._item=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;s.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cs),kA=function(e){function t(){e.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,s),this._node2!==null&&this._node2.query(r,i,s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cs),Ns=function(){this._leaves=new lt,this._root=null,this._level=0};Ns.prototype.buildTree=function(){var t=this;hi.sort(this._leaves,new Cs.NodeComparator);for(var n=this._leaves,r=null,i=new lt;;){if(t.buildLevel(n,i),i.size()===1)return i.get(0);r=n,n=i,i=r}};Ns.prototype.insert=function(t,n,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new DA(t,n,r))};Ns.prototype.query=function(t,n,r){this.init(),this._root.query(t,n,r)};Ns.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};Ns.prototype.printNode=function(t){wn.out.println(ui.toLineString(new M(t._min,this._level),new M(t._max,this._level)))};Ns.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};Ns.prototype.buildLevel=function(t,n){this._level++,n.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),s=r+1<t.size()?t.get(r):null;if(s===null)n.add(i);else{var a=new kA(t.get(r),t.get(r+1));n.add(a)}}};Ns.prototype.interfaces_=function(){return[]};Ns.prototype.getClass=function(){return Ns};var Tu=function(){this._items=new lt};Tu.prototype.visitItem=function(t){this._items.add(t)};Tu.prototype.getItems=function(){return this._items};Tu.prototype.interfaces_=function(){return[wo]};Tu.prototype.getClass=function(){return Tu};var Ou=function(){this._index=null;var t=arguments[0];if(!Ot(t,xo))throw new ve("Argument must be Polygonal");this._index=new wa(t)},v_={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Ou.prototype.locate=function(t){var n=new ki(t),r=new Ru(n);return this._index.query(t.y,t.y,r),n.getLocation()};Ou.prototype.interfaces_=function(){return[Lu]};Ou.prototype.getClass=function(){return Ou};v_.SegmentVisitor.get=function(){return Ru};v_.IntervalIndexedGeometry.get=function(){return wa};Object.defineProperties(Ou,v_);var Ru=function(){this._counter=null;var t=arguments[0];this._counter=t};Ru.prototype.visitItem=function(t){var n=t;this._counter.countSegment(n.getCoordinate(0),n.getCoordinate(1))};Ru.prototype.interfaces_=function(){return[wo]};Ru.prototype.getClass=function(){return Ru};var wa=function(){this._index=new Ns;var t=arguments[0];this.init(t)};wa.prototype.init=function(t){for(var n=this,r=vn.getLines(t),i=r.iterator();i.hasNext();){var s=i.next(),a=s.getCoordinates();n.addLine(a)}};wa.prototype.addLine=function(t){for(var n=this,r=1;r<t.length;r++){var i=new Pt(t[r-1],t[r]),s=Math.min(i.p0.y,i.p1.y),a=Math.max(i.p0.y,i.p1.y);n._index.insert(s,a,i)}};wa.prototype.query=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1],r=new Tu;return this._index.query(t,n,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2];this._index.query(i,s,a)}};wa.prototype.interfaces_=function(){return[]};wa.prototype.getClass=function(){return wa};var wc=function(e){function t(){if(e.call(this),this._parentGeom=null,this._lineEdgeMap=new qC,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new pi,arguments.length===2){var n=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;this._argIndex=n,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],l=arguments[2];this._argIndex=s,this._parentGeom=a,this._boundaryNodeRule=l,a!==null&&this.add(a)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var s=this._nodes.addNode(i),a=s.getLabel(),l=1,c=k.NONE;c=a.getLocation(r,rt.ON),c===k.BOUNDARY&&l++;var f=t.determineBoundary(this._boundaryNodeRule,l);a.setLocation(r,f)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],l=arguments[2],c=new Cn(s,!0,!1);c.setIsDoneIfProperInt(l);var f=this.createEdgeSetIntersector(),g=this._parentGeom instanceof ys||this._parentGeom instanceof Ye||this._parentGeom instanceof ps,d=a||!g;return f.computeIntersections(this._edges,c,d),this.addSelfIntersectionNodes(this._argIndex),c}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,s){var a=new Cn(i,s,!0);a.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var l=this.createEdgeSetIntersector();return l.computeIntersections(this._edges,r._edges,a),a},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof gr){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,k.INTERIOR)}else if(arguments[0]instanceof M){var s=arguments[0];this.insertPoint(this._argIndex,s,k.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),k.EXTERIOR,k.INTERIOR);for(var s=0;s<r.getNumInteriorRing();s++){var a=r.getInteriorRingN(s);i.addPolygonRing(a,k.INTERIOR,k.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],k.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],k.BOUNDARY)},t.prototype.addLineString=function(r){var i=Vt.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Xd(i,new ie(this._argIndex,k.INTERIOR));this._lineEdgeMap.put(r,s),this.insertEdge(s),kt.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),s=0,a=r.iterator();a.hasNext();){var l=a.next();i[s++]=l.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,s){if(this.isBoundaryNode(r,i))return null;s===k.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,s)},t.prototype.addPolygonRing=function(r,i,s){if(r.isEmpty())return null;var a=Vt.removeRepeatedPoints(r.getCoordinates());if(a.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=a[0],null;var l=i,c=s;dt.isCCW(a)&&(l=s,c=i);var f=new Xd(a,new ie(this._argIndex,k.BOUNDARY,l,c));this._lineEdgeMap.put(r,f),this.insertEdge(f),this.insertPoint(this._argIndex,a[0],k.BOUNDARY)},t.prototype.insertPoint=function(r,i,s){var a=this._nodes.addNode(i),l=a.getLabel();l===null?a._label=new ie(r,s):l.setLocation(r,s)},t.prototype.createEdgeSetIntersector=function(){return new AA},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var a=s.next(),l=a.getLabel().getLocation(r),c=a.eiList.iterator();c.hasNext();){var f=c.next();i.addSelfIntersectionNode(r,f.coord,l)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof ps&&(this._useBoundaryDeterminationRule=!1),r instanceof Ye)this.addPolygon(r);else if(r instanceof Pe)this.addLineString(r);else if(r instanceof gr)this.addPoint(r);else if(r instanceof Cu)this.addCollection(r);else if(r instanceof pa)this.addCollection(r);else if(r instanceof ps)this.addCollection(r);else if(r instanceof Hn)this.addCollection(r);else throw new Error(r.getClass().getName())}else return e.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,s=0;s<r.getNumGeometries();s++){var a=r.getGeometryN(s);i.add(a)}},t.prototype.locate=function(r){return Ot(this._parentGeom,xo)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Ou(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return e.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?k.BOUNDARY:k.INTERIOR},t}(xe),Mu=function(){if(this._li=new Ta,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new wc(0,t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=Qr.OGC_SFS_BOUNDARY_RULE;n.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(n.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wc(0,n,i),this._arg[1]=new wc(1,r,i)}else if(arguments.length===3){var s=arguments[0],a=arguments[1],l=arguments[2];s.getPrecisionModel().compareTo(a.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wc(0,s,l),this._arg[1]=new wc(1,a,l)}};Mu.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};Mu.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};Mu.prototype.interfaces_=function(){return[]};Mu.prototype.getClass=function(){return Mu};var ca=function(){};ca.prototype.interfaces_=function(){return[]};ca.prototype.getClass=function(){return ca};ca.map=function(){if(arguments[0]instanceof Tt&&Ot(arguments[1],ca.MapOp)){for(var t=arguments[0],n=arguments[1],r=new lt,i=0;i<t.getNumGeometries();i++){var s=n.map(t.getGeometryN(i));s!==null&&r.add(s)}return t.getFactory().buildGeometry(r)}else if(Ot(arguments[0],Ge)&&Ot(arguments[1],ca.MapOp)){for(var a=arguments[0],l=arguments[1],c=new lt,f=a.iterator();f.hasNext();){var g=f.next(),d=l.map(g);d!==null&&c.add(d)}return c}};ca.MapOp=function(){};var At=function(e){function t(){var n=arguments[0],r=arguments[1];e.call(this,n,r),this._ptLocator=new pi,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new di,this._resultPolyList=new lt,this._resultLineList=new lt,this._resultPointList=new lt,this._graph=new xe(new JC),this._geomFact=n.getFactory()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var s=i.getLabel(),a=r.getLabel();i.isPointwiseEqual(r)||(a=new ie(r.getLabel()),a.flip());var l=i.getDepth();l.isNull()&&l.add(s),l.add(a),s.merge(a)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,s,a){var l=new lt;return l.addAll(r),l.addAll(i),l.addAll(s),l.isEmpty()?t.createEmptyResult(a,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(l)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var s=this,a=i.iterator();a.hasNext();){var l=a.next(),c=s._ptLocator.locate(r,l);if(c!==k.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new lt,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),r.add(s.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,s=r.iterator();s.hasNext();){var a=s.next();i.insertUniqueEdge(a)}},t.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new lt;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),xa.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var s=new mr(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var a=new Yi(this,this._geomFact,this._ptLocator);this._resultLineList=a.build(r);var l=new _l(this,this._geomFact,this._ptLocator);this._resultPointList=l.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var s=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,s)},t.prototype.copyPoints=function(r){for(var i=this,s=this._arg[r].getNodeIterator();s.hasNext();){var a=s.next(),l=i._graph.addNode(a.getCoordinate());l.setLabel(r,a.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),a=s.getLabel();a.isArea()&&!s.isInteriorAreaEdge()&&t.isResultOfOp(a.getLocation(0,rt.RIGHT),a.getLocation(1,rt.RIGHT),r)&&s.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),s=i.getLabel(),a=i.getDepth();if(!a.isNull()){a.normalize();for(var l=0;l<2;l++)!s.isNull(l)&&s.isArea()&&!a.isNull(l)&&(a.getDelta(l)===0?s.toLine(l):(kt.isTrue(!a.isNull(l,rt.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(l,rt.LEFT,a.getLocation(l,rt.LEFT)),kt.isTrue(!a.isNull(l,rt.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(l,rt.RIGHT,a.getLocation(l,rt.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),a=s.getLabel();s.isIsolated()&&(a.isNull(0)?r.labelIncompleteNode(s,0):r.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(a)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mu);At.overlayOp=function(e,t,n){var r=new At(e,t),i=r.getResultGeometry(n);return i};At.intersection=function(e,t){if(e.isEmpty()||t.isEmpty())return At.createEmptyResult(At.INTERSECTION,e,t,e.getFactory());if(e.isGeometryCollection()){var n=t;return yl.map(e,{interfaces_:function(){return[ca.MapOp]},map:function(r){return r.intersection(n)}})}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Xn.overlayOp(e,t,At.INTERSECTION)};At.symDifference=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return At.createEmptyResult(At.SYMDIFFERENCE,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Xn.overlayOp(e,t,At.SYMDIFFERENCE)};At.resultDimension=function(e,t,n){var r=t.getDimension(),i=n.getDimension(),s=-1;switch(e){case At.INTERSECTION:s=Math.min(r,i);break;case At.UNION:s=Math.max(r,i);break;case At.DIFFERENCE:s=r;break;case At.SYMDIFFERENCE:s=Math.max(r,i);break}return s};At.createEmptyResult=function(e,t,n,r){var i=null;switch(At.resultDimension(e,t,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i};At.difference=function(e,t){return e.isEmpty()?At.createEmptyResult(At.DIFFERENCE,e,t,e.getFactory()):t.isEmpty()?e.copy():(e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Xn.overlayOp(e,t,At.DIFFERENCE))};At.isResultOfOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=e.getLocation(0),r=e.getLocation(1);return At.isResultOfOp(n,r,t)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2];switch(i===k.BOUNDARY&&(i=k.INTERIOR),s===k.BOUNDARY&&(s=k.INTERIOR),a){case At.INTERSECTION:return i===k.INTERIOR&&s===k.INTERIOR;case At.UNION:return i===k.INTERIOR||s===k.INTERIOR;case At.DIFFERENCE:return i===k.INTERIOR&&s!==k.INTERIOR;case At.SYMDIFFERENCE:return i===k.INTERIOR&&s!==k.INTERIOR||i!==k.INTERIOR&&s===k.INTERIOR}return!1}};At.INTERSECTION=1;At.UNION=2;At.DIFFERENCE=3;At.SYMDIFFERENCE=4;var po=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new pi,this._seg=new Pt;var t=arguments[0],n=arguments[1];this._g=t,this._boundaryDistanceTolerance=n,this._linework=this.extractLinework(t)};po.prototype.isWithinToleranceOfBoundary=function(t){for(var n=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=n._linework.getGeometryN(r),s=i.getCoordinateSequence(),a=0;a<s.size()-1;a++){s.getCoordinate(a,n._seg.p0),s.getCoordinate(a+1,n._seg.p1);var l=n._seg.distance(t);if(l<=n._boundaryDistanceTolerance)return!0}return!1};po.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?k.BOUNDARY:this._ptLocator.locate(t,this._g)};po.prototype.extractLinework=function(t){var n=new Au;t.apply(n);var r=n.getLinework(),i=Ut.toLineStringArray(r);return t.getFactory().createMultiLineString(i)};po.prototype.interfaces_=function(){return[]};po.prototype.getClass=function(){return po};var Au=function(){this._linework=null,this._linework=new lt};Au.prototype.getLinework=function(){return this._linework};Au.prototype.filter=function(t){var n=this;if(t instanceof Ye){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)n._linework.add(r.getInteriorRingN(i))}};Au.prototype.interfaces_=function(){return[Vi]};Au.prototype.getClass=function(){return Au};var Ea=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Ea.prototype.extractPoints=function(t,n,r){for(var i=this,s=t.getCoordinates(),a=0;a<s.length-1;a++)i.computeOffsetPoints(s[a],s[a+1],n,r)};Ea.prototype.setSidesToGenerate=function(t,n){this._doLeft=t,this._doRight=n};Ea.prototype.getPoints=function(t){for(var n=this,r=new lt,i=vn.getLines(this._g),s=i.iterator();s.hasNext();){var a=s.next();n.extractPoints(a,t,r)}return r};Ea.prototype.computeOffsetPoints=function(t,n,r,i){var s=n.x-t.x,a=n.y-t.y,l=Math.sqrt(s*s+a*a),c=r*s/l,f=r*a/l,g=(n.x+t.x)/2,d=(n.y+t.y)/2;if(this._doLeft){var v=new M(g-f,d+c);i.add(v)}if(this._doRight){var y=new M(g+f,d-c);i.add(y)}};Ea.prototype.interfaces_=function(){return[]};Ea.prototype.getClass=function(){return Ea};var Ar=function e(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=e.TOLERANCE,this._testCoords=new lt;var t=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=e.computeBoundaryDistanceTolerance(t,n),this._geom=[t,n,r],this._locFinder=[new po(this._geom[0],this._boundaryDistanceTolerance),new po(this._geom[1],this._boundaryDistanceTolerance),new po(this._geom[2],this._boundaryDistanceTolerance)]},lN={TOLERANCE:{configurable:!0}};Ar.prototype.reportResult=function(t,n,r){wn.out.println("Overlay result invalid - A:"+k.toLocationSymbol(n[0])+" B:"+k.toLocationSymbol(n[1])+" expected:"+(r?"i":"e")+" actual:"+k.toLocationSymbol(n[2]))};Ar.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var n=this.checkValid(t);return n};Ar.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var n=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(n,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],a=arguments[1];return this._location[0]=this._locFinder[0].getLocation(a),this._location[1]=this._locFinder[1].getLocation(a),this._location[2]=this._locFinder[2].getLocation(a),Ar.hasLocation(this._location,k.BOUNDARY)?!0:this.isValidResult(s,this._location)}};Ar.prototype.addTestPts=function(t){var n=new Ea(t);this._testCoords.addAll(n.getPoints(5*this._boundaryDistanceTolerance))};Ar.prototype.isValidResult=function(t,n){var r=At.isResultOfOp(n[0],n[1],t),i=n[2]===k.INTERIOR,s=!(r^i);return s||this.reportResult(t,n,r),s};Ar.prototype.getInvalidLocation=function(){return this._invalidLocation};Ar.prototype.interfaces_=function(){return[]};Ar.prototype.getClass=function(){return Ar};Ar.hasLocation=function(t,n){for(var r=0;r<3;r++)if(t[r]===n)return!0;return!1};Ar.computeBoundaryDistanceTolerance=function(t,n){return Math.min(Re.computeSizeBasedSnapTolerance(t),Re.computeSizeBasedSnapTolerance(n))};Ar.isValid=function(t,n,r,i){var s=new Ar(t,n,i);return s.isValid(r)};lN.TOLERANCE.get=function(){return 1e-6};Object.defineProperties(Ar,lN);var Pr=function e(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=e.extractFactory(t),this._inputGeoms=t};Pr.prototype.extractElements=function(t,n){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var s=t.getGeometryN(i);r._skipEmpty&&s.isEmpty()||n.add(s)}};Pr.prototype.combine=function(){for(var t=this,n=new lt,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,n)}return n.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(n)};Pr.prototype.interfaces_=function(){return[]};Pr.prototype.getClass=function(){return Pr};Pr.combine=function(){if(arguments.length===1){var t=arguments[0],n=new Pr(t);return n.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new Pr(Pr.createList(r,i));return s.combine()}else if(arguments.length===3){var a=arguments[0],l=arguments[1],c=arguments[2],f=new Pr(Pr.createList(a,l,c));return f.combine()}};Pr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()};Pr.createList=function(){if(arguments.length===2){var t=arguments[0],n=arguments[1],r=new lt;return r.add(t),r.add(n),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],a=arguments[2],l=new lt;return l.add(i),l.add(s),l.add(a),l}};var je=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new lt)},uN={STRTREE_NODE_CAPACITY:{configurable:!0}};je.prototype.reduceToGeometries=function(t){for(var n=this,r=new lt,i=t.iterator();i.hasNext();){var s=i.next(),a=null;Ot(s,ai)?a=n.unionTree(s):s instanceof Tt&&(a=s),r.add(a)}return r};je.prototype.extractByEnvelope=function(t,n,r){for(var i=new lt,s=0;s<n.getNumGeometries();s++){var a=n.getGeometryN(s);a.getEnvelopeInternal().intersects(t)?i.add(a):r.add(a)}return this._geomFactory.buildGeometry(i)};je.prototype.unionOptimized=function(t,n){var r=t.getEnvelopeInternal(),i=n.getEnvelopeInternal();if(!r.intersects(i)){var s=Pr.combine(t,n);return s}if(t.getNumGeometries()<=1&&n.getNumGeometries()<=1)return this.unionActual(t,n);var a=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,n,a)};je.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new XC(je.STRTREE_NODE_CAPACITY),n=this._inputPolys.iterator();n.hasNext();){var r=n.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),s=this.unionTree(i);return s};je.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var s=je.getGeometry(n,r);return this.unionSafe(s,null)}else{if(i-r===2)return this.unionSafe(je.getGeometry(n,r),je.getGeometry(n,r+1));var a=Math.trunc((i+r)/2),l=this.binaryUnion(n,r,a),c=this.binaryUnion(n,a,i);return this.unionSafe(l,c)}}};je.prototype.repeatedUnion=function(t){for(var n=null,r=t.iterator();r.hasNext();){var i=r.next();n===null?n=i.copy():n=n.union(i)}return n};je.prototype.unionSafe=function(t,n){return t===null&&n===null?null:t===null?n.copy():n===null?t.copy():this.unionOptimized(t,n)};je.prototype.unionActual=function(t,n){return je.restrictToPolygons(t.union(n))};je.prototype.unionTree=function(t){var n=this.reduceToGeometries(t),r=this.binaryUnion(n);return r};je.prototype.unionUsingEnvelopeIntersection=function(t,n,r){var i=new lt,s=this.extractByEnvelope(r,t,i),a=this.extractByEnvelope(r,n,i),l=this.unionActual(s,a);i.add(l);var c=Pr.combine(i);return c};je.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],n=t.get(0).getFactory(),r=n.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],a=arguments[1],l=s.getFactory(),c=l.createGeometryCollection([s,a]),f=c.buffer(0);return f}};je.prototype.interfaces_=function(){return[]};je.prototype.getClass=function(){return je};je.restrictToPolygons=function(t){if(Ot(t,xo))return t;var n=qs.getPolygons(t);return n.size()===1?n.get(0):t.getFactory().createMultiPolygon(Ut.toPolygonArray(n))};je.getGeometry=function(t,n){return n>=t.size()?null:t.get(n)};je.union=function(t){var n=new je(t);return n.union()};uN.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(je,uN);var Kd=function(){};Kd.prototype.interfaces_=function(){return[]};Kd.prototype.getClass=function(){return Kd};Kd.union=function(t,n){if(t.isEmpty()||n.isEmpty()){if(t.isEmpty()&&n.isEmpty())return At.createEmptyResult(At.UNION,t,n,t.getFactory());if(t.isEmpty())return n.copy();if(n.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(n),Xn.overlayOp(t,n,At.UNION)};function Oa(){return new Qd}function Qd(){this.reset()}Qd.prototype={constructor:Qd,reset:function(){this.s=this.t=0},add:function(e){Aw(Dh,e,this.t),Aw(this,Dh.s,this.s),this.s?this.t+=Dh.t:this.s=Dh.t},valueOf:function(){return this.s}};var Dh=new Qd;function Aw(e,t,n){var r=e.s=t+n,i=r-t,s=r-i;e.t=t-s+(n-i)}var Ce=1e-6,ue=Math.PI,Us=ue/2,Dw=ue/4,Qs=ue*2,zo=180/ue,Li=ue/180,Vn=Math.abs,FA=Math.atan,Du=Math.atan2,qe=Math.cos,He=Math.sin,Yu=Math.sqrt;function cN(e){return e>1?0:e<-1?ue:Math.acos(e)}function wl(e){return e>1?Us:e<-1?-Us:Math.asin(e)}function bc(){}function Jd(e,t){e&&Fw.hasOwnProperty(e.type)&&Fw[e.type](e,t)}var kw={Feature:function(e,t){Jd(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Jd(n[r].geometry,t)}},Fw={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Rv(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Rv(n[r],t,0)},Polygon:function(e,t){jw(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)jw(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Jd(n[r],t)}};function Rv(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function jw(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Rv(e[n],t,1);t.polygonEnd()}function jA(e,t){e&&kw.hasOwnProperty(e.type)?kw[e.type](e,t):Jd(e,t)}Oa();Oa();function Mv(e){return[Du(e[1],e[0]),wl(e[2])]}function ku(e){var t=e[0],n=e[1],r=qe(n);return[r*qe(t),r*He(t),He(n)]}function kh(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function $d(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function cm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Fh(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Av(e){var t=Yu(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}Oa();function fN(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Dv(e,t){return[e>ue?e-Qs:e<-ue?e+Qs:e,t]}Dv.invert=Dv;function zA(e,t,n){return(e%=Qs)?t||n?fN(Bw(e),Uw(t,n)):Bw(e):t||n?Uw(t,n):Dv}function zw(e){return function(t,n){return t+=e,[t>ue?t-Qs:t<-ue?t+Qs:t,n]}}function Bw(e){var t=zw(e);return t.invert=zw(-e),t}function Uw(e,t){var n=qe(e),r=He(e),i=qe(t),s=He(t);function a(l,c){var f=qe(c),g=qe(l)*f,d=He(l)*f,v=He(c),y=v*n+g*r;return[Du(d*i-y*s,g*n-v*r),wl(y*i+d*s)]}return a.invert=function(l,c){var f=qe(c),g=qe(l)*f,d=He(l)*f,v=He(c),y=v*i-d*s;return[Du(d*i+v*s,g*n+y*r),wl(y*n-g*r)]},a}function BA(e,t,n,r,i,s){if(n){var a=qe(t),l=He(t),c=r*n;i==null?(i=t+r*Qs,s=t-c/2):(i=Vw(a,i),s=Vw(a,s),(r>0?i<s:i>s)&&(i+=r*Qs));for(var f,g=i;r>0?g>s:g<s;g-=c)f=Mv([a,-l*qe(g),-l*He(g)]),e.point(f[0],f[1])}}function Vw(e,t){t=ku(t),t[0]-=e,Av(t);var n=cN(-t[1]);return((-t[2]<0?-n:n)+Qs-Ce)%Qs}function hN(){var e=[],t;return{point:function(n,r){t.push([n,r])},lineStart:function(){e.push(t=[])},lineEnd:bc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function UA(e,t,n,r,i,s){var a=e[0],l=e[1],c=t[0],f=t[1],g=0,d=1,v=c-a,y=f-l,x;if(x=n-a,!(!v&&x>0)){if(x/=v,v<0){if(x<g)return;x<d&&(d=x)}else if(v>0){if(x>d)return;x>g&&(g=x)}if(x=i-a,!(!v&&x<0)){if(x/=v,v<0){if(x>d)return;x>g&&(g=x)}else if(v>0){if(x<g)return;x<d&&(d=x)}if(x=r-l,!(!y&&x>0)){if(x/=y,y<0){if(x<g)return;x<d&&(d=x)}else if(y>0){if(x>d)return;x>g&&(g=x)}if(x=s-l,!(!y&&x<0)){if(x/=y,y<0){if(x>d)return;x>g&&(g=x)}else if(y>0){if(x<g)return;x<d&&(d=x)}return g>0&&(e[0]=a+g*v,e[1]=l+g*y),d<1&&(t[0]=a+d*v,t[1]=l+d*y),!0}}}}}function ad(e,t){return Vn(e[0]-t[0])<Ce&&Vn(e[1]-t[1])<Ce}function jh(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function dN(e,t,n,r,i){var s=[],a=[],l,c;if(e.forEach(function(x){if(!((S=x.length-1)<=0)){var S,C=x[0],E=x[S],w;if(ad(C,E)){for(i.lineStart(),l=0;l<S;++l)i.point((C=x[l])[0],C[1]);i.lineEnd();return}s.push(w=new jh(C,x,null,!0)),a.push(w.o=new jh(C,null,w,!1)),s.push(w=new jh(E,x,null,!1)),a.push(w.o=new jh(E,null,w,!0))}}),!!s.length){for(a.sort(t),Gw(s),Gw(a),l=0,c=a.length;l<c;++l)a[l].e=n=!n;for(var f=s[0],g,d;;){for(var v=f,y=!0;v.v;)if((v=v.n)===f)return;g=v.z,i.lineStart();do{if(v.v=v.o.v=!0,v.e){if(y)for(l=0,c=g.length;l<c;++l)i.point((d=g[l])[0],d[1]);else r(v.x,v.n.x,1,i);v=v.n}else{if(y)for(g=v.p.z,l=g.length-1;l>=0;--l)i.point((d=g[l])[0],d[1]);else r(v.x,v.p.x,-1,i);v=v.p}v=v.o,g=v.z,y=!y}while(!v.v);i.lineEnd()}}}function Gw(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function pN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function VA(e){return e.length===1&&(e=GA(e)),{left:function(t,n,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;e(t[s],n)<0?r=s+1:i=s}return r},right:function(t,n,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var s=r+i>>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}function GA(e){return function(t,n){return pN(e(t),n)}}VA(pN);function gN(e){for(var t=e.length,n,r=-1,i=0,s,a;++r<t;)i+=e[r].length;for(s=new Array(i);--t>=0;)for(a=e[t],n=a.length;--n>=0;)s[--i]=a[n];return s}var Lc=1e9,zh=-Lc;function qA(e,t,n,r){function i(f,g){return e<=f&&f<=n&&t<=g&&g<=r}function s(f,g,d,v){var y=0,x=0;if(f==null||(y=a(f,d))!==(x=a(g,d))||c(f,g)<0^d>0)do v.point(y===0||y===3?e:n,y>1?r:t);while((y=(y+d+4)%4)!==x);else v.point(g[0],g[1])}function a(f,g){return Vn(f[0]-e)<Ce?g>0?0:3:Vn(f[0]-n)<Ce?g>0?2:1:Vn(f[1]-t)<Ce?g>0?1:0:g>0?3:2}function l(f,g){return c(f.x,g.x)}function c(f,g){var d=a(f,1),v=a(g,1);return d!==v?d-v:d===0?g[1]-f[1]:d===1?f[0]-g[0]:d===2?f[1]-g[1]:g[0]-f[0]}return function(f){var g=f,d=hN(),v,y,x,S,C,E,w,N,I,R,A,B={point:q,lineStart:W,lineEnd:$,polygonStart:Y,polygonEnd:J};function q(ut,it){i(ut,it)&&g.point(ut,it)}function Q(){for(var ut=0,it=0,yt=y.length;it<yt;++it)for(var z=y[it],at=1,tt=z.length,vt=z[0],Lt,ct,ht=vt[0],_t=vt[1];at<tt;++at)Lt=ht,ct=_t,vt=z[at],ht=vt[0],_t=vt[1],ct<=r?_t>r&&(ht-Lt)*(r-ct)>(_t-ct)*(e-Lt)&&++ut:_t<=r&&(ht-Lt)*(r-ct)<(_t-ct)*(e-Lt)&&--ut;return ut}function Y(){g=d,v=[],y=[],A=!0}function J(){var ut=Q(),it=A&&ut,yt=(v=gN(v)).length;(it||yt)&&(f.polygonStart(),it&&(f.lineStart(),s(null,null,1,f),f.lineEnd()),yt&&dN(v,l,ut,s,f),f.polygonEnd()),g=f,v=y=x=null}function W(){B.point=D,y&&y.push(x=[]),R=!0,I=!1,w=N=NaN}function $(){v&&(D(S,C),E&&I&&d.rejoin(),v.push(d.result())),B.point=q,I&&g.lineEnd()}function D(ut,it){var yt=i(ut,it);if(y&&x.push([ut,it]),R)S=ut,C=it,E=yt,R=!1,yt&&(g.lineStart(),g.point(ut,it));else if(yt&&I)g.point(ut,it);else{var z=[w=Math.max(zh,Math.min(Lc,w)),N=Math.max(zh,Math.min(Lc,N))],at=[ut=Math.max(zh,Math.min(Lc,ut)),it=Math.max(zh,Math.min(Lc,it))];UA(z,at,e,t,n,r)?(I||(g.lineStart(),g.point(z[0],z[1])),g.point(at[0],at[1]),yt||g.lineEnd(),A=!1):yt&&(g.lineStart(),g.point(ut,it),A=!1)}w=ut,N=it,I=yt}return B}}var fm=Oa();function HA(e,t){var n=t[0],r=t[1],i=[He(n),-qe(n),0],s=0,a=0;fm.reset();for(var l=0,c=e.length;l<c;++l)if(g=(f=e[l]).length)for(var f,g,d=f[g-1],v=d[0],y=d[1]/2+Dw,x=He(y),S=qe(y),C=0;C<g;++C,v=w,x=I,S=R,d=E){var E=f[C],w=E[0],N=E[1]/2+Dw,I=He(N),R=qe(N),A=w-v,B=A>=0?1:-1,q=B*A,Q=q>ue,Y=x*I;if(fm.add(Du(Y*B*He(q),S*R+Y*qe(q))),s+=Q?A+B*Qs:A,Q^v>=n^w>=n){var J=$d(ku(d),ku(E));Av(J);var W=$d(i,J);Av(W);var $=(Q^A>=0?-1:1)*wl(W[2]);(r>$||r===$&&(J[0]||J[1]))&&(a+=Q^A>=0?1:-1)}}return(s<-Ce||s<Ce&&fm<-Ce)^a&1}Oa();function qw(e){return e}Oa();Oa();var Fu=1/0,tp=Fu,Cf=-Fu,ep=Cf,Hw={point:ZA,lineStart:bc,lineEnd:bc,polygonStart:bc,polygonEnd:bc,result:function(){var e=[[Fu,tp],[Cf,ep]];return Cf=ep=-(tp=Fu=1/0),e}};function ZA(e,t){e<Fu&&(Fu=e),e>Cf&&(Cf=e),t<tp&&(tp=t),t>ep&&(ep=t)}Oa();function mN(e,t,n,r){return function(i,s){var a=t(s),l=i.invert(r[0],r[1]),c=hN(),f=t(c),g=!1,d,v,y,x={point:S,lineStart:E,lineEnd:w,polygonStart:function(){x.point=N,x.lineStart=I,x.lineEnd=R,v=[],d=[]},polygonEnd:function(){x.point=S,x.lineStart=E,x.lineEnd=w,v=gN(v);var A=HA(d,l);v.length?(g||(s.polygonStart(),g=!0),dN(v,XA,A,n,s)):A&&(g||(s.polygonStart(),g=!0),s.lineStart(),n(null,null,1,s),s.lineEnd()),g&&(s.polygonEnd(),g=!1),v=d=null},sphere:function(){s.polygonStart(),s.lineStart(),n(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function S(A,B){var q=i(A,B);e(A=q[0],B=q[1])&&s.point(A,B)}function C(A,B){var q=i(A,B);a.point(q[0],q[1])}function E(){x.point=C,a.lineStart()}function w(){x.point=S,a.lineEnd()}function N(A,B){y.push([A,B]);var q=i(A,B);f.point(q[0],q[1])}function I(){f.lineStart(),y=[]}function R(){N(y[0][0],y[0][1]),f.lineEnd();var A=f.clean(),B=c.result(),q,Q=B.length,Y,J,W;if(y.pop(),d.push(y),y=null,!!Q){if(A&1){if(J=B[0],(Y=J.length-1)>0){for(g||(s.polygonStart(),g=!0),s.lineStart(),q=0;q<Y;++q)s.point((W=J[q])[0],W[1]);s.lineEnd()}return}Q>1&&A&2&&B.push(B.pop().concat(B.shift())),v.push(B.filter(WA))}}return x}}function WA(e){return e.length>1}function XA(e,t){return((e=e.x)[0]<0?e[1]-Us-Ce:Us-e[1])-((t=t.x)[0]<0?t[1]-Us-Ce:Us-t[1])}const Zw=mN(function(){return!0},YA,QA,[-ue,-Us]);function YA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var l=s>0?ue:-ue,c=Vn(s-t);Vn(c-ue)<Ce?(e.point(t,n=(n+a)/2>0?Us:-Us),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(s,n),i=0):r!==l&&c>=ue&&(Vn(t-r)<Ce&&(t-=r*Ce),Vn(s-l)<Ce&&(s-=l*Ce),n=KA(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(l,n),i=0),e.point(t=s,n=a),r=l},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function KA(e,t,n,r){var i,s,a=He(e-n);return Vn(a)>Ce?FA((He(t)*(s=qe(r))*He(n)-He(r)*(i=qe(t))*He(e))/(i*s*a)):(t+r)/2}function QA(e,t,n,r){var i;if(e==null)i=n*Us,r.point(-ue,i),r.point(0,i),r.point(ue,i),r.point(ue,0),r.point(ue,-i),r.point(0,-i),r.point(-ue,-i),r.point(-ue,0),r.point(-ue,i);else if(Vn(e[0]-t[0])>Ce){var s=e[0]<t[0]?ue:-ue;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function JA(e,t){var n=qe(e),r=n>0,i=Vn(n)>Ce;function s(g,d,v,y){BA(y,e,t,v,g,d)}function a(g,d){return qe(g)*qe(d)>n}function l(g){var d,v,y,x,S;return{lineStart:function(){x=y=!1,S=1},point:function(C,E){var w=[C,E],N,I=a(C,E),R=r?I?0:f(C,E):I?f(C+(C<0?ue:-ue),E):0;if(!d&&(x=y=I)&&g.lineStart(),I!==y&&(N=c(d,w),(!N||ad(d,N)||ad(w,N))&&(w[0]+=Ce,w[1]+=Ce,I=a(w[0],w[1]))),I!==y)S=0,I?(g.lineStart(),N=c(w,d),g.point(N[0],N[1])):(N=c(d,w),g.point(N[0],N[1]),g.lineEnd()),d=N;else if(i&&d&&r^I){var A;!(R&v)&&(A=c(w,d,!0))&&(S=0,r?(g.lineStart(),g.point(A[0][0],A[0][1]),g.point(A[1][0],A[1][1]),g.lineEnd()):(g.point(A[1][0],A[1][1]),g.lineEnd(),g.lineStart(),g.point(A[0][0],A[0][1])))}I&&(!d||!ad(d,w))&&g.point(w[0],w[1]),d=w,y=I,v=R},lineEnd:function(){y&&g.lineEnd(),d=null},clean:function(){return S|(x&&y)<<1}}}function c(g,d,v){var y=ku(g),x=ku(d),S=[1,0,0],C=$d(y,x),E=kh(C,C),w=C[0],N=E-w*w;if(!N)return!v&&g;var I=n*E/N,R=-n*w/N,A=$d(S,C),B=Fh(S,I),q=Fh(C,R);cm(B,q);var Q=A,Y=kh(B,Q),J=kh(Q,Q),W=Y*Y-J*(kh(B,B)-1);if(!(W<0)){var $=Yu(W),D=Fh(Q,(-Y-$)/J);if(cm(D,B),D=Mv(D),!v)return D;var ut=g[0],it=d[0],yt=g[1],z=d[1],at;it<ut&&(at=ut,ut=it,it=at);var tt=it-ut,vt=Vn(tt-ue)<Ce,Lt=vt||tt<Ce;if(!vt&&z<yt&&(at=yt,yt=z,z=at),Lt?vt?yt+z>0^D[1]<(Vn(D[0]-ut)<Ce?yt:z):yt<=D[1]&&D[1]<=z:tt>ue^(ut<=D[0]&&D[0]<=it)){var ct=Fh(Q,(-Y+$)/J);return cm(ct,B),[D,Mv(ct)]}}}function f(g,d){var v=r?e:ue-e,y=0;return g<-v?y|=1:g>v&&(y|=2),d<-v?y|=4:d>v&&(y|=8),y}return mN(a,l,s,r?[0,-e]:[-ue,e-ue])}function vN(e){return function(t){var n=new kv;for(var r in e)n[r]=e[r];return n.stream=t,n}}function kv(){}kv.prototype={constructor:kv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function yN(e,t,n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),s!=null&&e.clipExtent(null),jA(n,e.stream(Hw));var a=Hw.result(),l=Math.min(r/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),c=+t[0][0]+(r-l*(a[1][0]+a[0][0]))/2,f=+t[0][1]+(i-l*(a[1][1]+a[0][1]))/2;return s!=null&&e.clipExtent(s),e.scale(l*150).translate([c,f])}function $A(e,t,n){return yN(e,[[0,0],t],n)}var Ww=16,tD=qe(30*Li);function Xw(e,t){return+t?nD(e,t):eD(e)}function eD(e){return vN({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function nD(e,t){function n(r,i,s,a,l,c,f,g,d,v,y,x,S,C){var E=f-r,w=g-i,N=E*E+w*w;if(N>4*t&&S--){var I=a+v,R=l+y,A=c+x,B=Yu(I*I+R*R+A*A),q=wl(A/=B),Q=Vn(Vn(A)-1)<Ce||Vn(s-d)<Ce?(s+d)/2:Du(R,I),Y=e(Q,q),J=Y[0],W=Y[1],$=J-r,D=W-i,ut=w*$-E*D;(ut*ut/N>t||Vn((E*$+w*D)/N-.5)>.3||a*v+l*y+c*x<tD)&&(n(r,i,s,a,l,c,J,W,Q,I/=B,R/=B,A,S,C),C.point(J,W),n(J,W,Q,I,R,A,f,g,d,v,y,x,S,C))}}return function(r){var i,s,a,l,c,f,g,d,v,y,x,S,C={point:E,lineStart:w,lineEnd:I,polygonStart:function(){r.polygonStart(),C.lineStart=R},polygonEnd:function(){r.polygonEnd(),C.lineStart=w}};function E(q,Q){q=e(q,Q),r.point(q[0],q[1])}function w(){d=NaN,C.point=N,r.lineStart()}function N(q,Q){var Y=ku([q,Q]),J=e(q,Q);n(d,v,g,y,x,S,d=J[0],v=J[1],g=q,y=Y[0],x=Y[1],S=Y[2],Ww,r),r.point(d,v)}function I(){C.point=E,r.lineEnd()}function R(){w(),C.point=A,C.lineEnd=B}function A(q,Q){N(i=q,Q),s=d,a=v,l=y,c=x,f=S,C.point=N}function B(){n(d,v,g,y,x,S,s,a,i,l,c,f,Ww,r),C.lineEnd=I,I()}return C}}var rD=vN({point:function(e,t){this.stream.point(e*Li,t*Li)}});function iD(e){return sD(function(){return e})()}function sD(e){var t,n=150,r=480,i=250,s,a,l=0,c=0,f=0,g=0,d=0,v,y,x=null,S=Zw,C=null,E,w,N,I=qw,R=.5,A=Xw(J,R),B,q;function Q(D){return D=y(D[0]*Li,D[1]*Li),[D[0]*n+s,a-D[1]*n]}function Y(D){return D=y.invert((D[0]-s)/n,(a-D[1])/n),D&&[D[0]*zo,D[1]*zo]}function J(D,ut){return D=t(D,ut),[D[0]*n+s,a-D[1]*n]}Q.stream=function(D){return B&&q===D?B:B=rD(S(v,A(I(q=D))))},Q.clipAngle=function(D){return arguments.length?(S=+D?JA(x=D*Li,6*Li):(x=null,Zw),$()):x*zo},Q.clipExtent=function(D){return arguments.length?(I=D==null?(C=E=w=N=null,qw):qA(C=+D[0][0],E=+D[0][1],w=+D[1][0],N=+D[1][1]),$()):C==null?null:[[C,E],[w,N]]},Q.scale=function(D){return arguments.length?(n=+D,W()):n},Q.translate=function(D){return arguments.length?(r=+D[0],i=+D[1],W()):[r,i]},Q.center=function(D){return arguments.length?(l=D[0]%360*Li,c=D[1]%360*Li,W()):[l*zo,c*zo]},Q.rotate=function(D){return arguments.length?(f=D[0]%360*Li,g=D[1]%360*Li,d=D.length>2?D[2]%360*Li:0,W()):[f*zo,g*zo,d*zo]},Q.precision=function(D){return arguments.length?(A=Xw(J,R=D*D),$()):Yu(R)},Q.fitExtent=function(D,ut){return yN(Q,D,ut)},Q.fitSize=function(D,ut){return $A(Q,D,ut)};function W(){y=fN(v=zA(f,g,d),t);var D=t(l,c);return s=r-D[0]*n,a=i+D[1]*n,$()}function $(){return B=q=null,Q}return function(){return t=e.apply(this,arguments),Q.invert=t.invert&&Y,W()}}function _N(e){return function(t,n){var r=qe(t),i=qe(n),s=e(r*i);return[s*i*He(t),s*He(n)]}}function xN(e){return function(t,n){var r=Yu(t*t+n*n),i=e(r),s=He(i),a=qe(i);return[Du(t*s,r*a),wl(r&&n*s/r)]}}var oD=_N(function(e){return Yu(2/(1+e))});oD.invert=xN(function(e){return 2*wl(e/2)});var wN=_N(function(e){return(e=cN(e))&&e/He(e)});wN.invert=xN(function(e){return e});function aD(){return iD(wN).scale(79.4188).clipAngle(180-.001)}function Yw(e,t){return[e,t]}Yw.invert=Yw;function lD(e,t,n){n=n||{};var r=n.units||"kilometers",i=n.steps||8;if(!e)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(e.type){case"GeometryCollection":return t_(e,function(a){var l=ld(a,t,r,i);l&&s.push(l)}),Cv(s);case"FeatureCollection":return dw(e,function(a){var l=ld(a,t,r,i);l&&dw(l,function(c){c&&s.push(c)})}),Cv(s)}return ld(e,t,r,i)}function ld(e,t,n,r){var i=e.properties||{},s=e.type==="Feature"?e.geometry:e;if(s.type==="GeometryCollection"){var a=[];return t_(e,function(S){var C=ld(S,t,n,r);C&&a.push(C)}),Cv(a)}var l=uD(s),c={type:s.type,coordinates:SN(s.coordinates,l)},f=new u_,g=f.read(c),d=VM(GM(t,n),"meters"),v=_n.bufferOp(g,d,r),y=new ZC;if(v=y.write(v),!EN(v.coordinates)){var x={type:v.type,coordinates:CN(v.coordinates,l)};return jf(x,i)}}function EN(e){return Array.isArray(e[0])?EN(e[0]):isNaN(e[0])}function SN(e,t){return typeof e[0]!="object"?t(e):e.map(function(n){return SN(n,t)})}function CN(e,t){return typeof e[0]!="object"?t.invert(e):e.map(function(n){return CN(n,t)})}function uD(e){var t=JM(e).geometry.coordinates,n=[-t[0],-t[1]];return aD().rotate(n).scale(Er)}function cD(e,t,n){n===void 0&&(n={});var r=Gd(e),i=Gd(t),s=kC.union(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?Ap(s[0],n.properties):OC(s,n.properties)}function fD(e,t,n){n===void 0&&(n={});var r=Gd(e),i=Gd(t),s=kC.intersection(r.coordinates,i.coordinates);return s.length===0?null:s.length===1?Ap(s[0],n.properties):OC(s,n.properties)}const hD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",dD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",pD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete Fr.Icon.Default.prototype._getIconUrl;Fr.Icon.Default.mergeOptions({iconRetinaUrl:hD,iconUrl:dD,shadowUrl:pD});const gD=new Fr.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa(`
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<circle cx="10" cy="10" r="8" fill="#3B82F6" stroke="white" stroke-width="2"/>
<circle cx="10" cy="10" r="4" fill="white"/>
</svg>
`),iconSize:[20,20],iconAnchor:[10,10]}),mD=new Fr.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa(`
<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" viewBox="0 0 6 6">
<circle cx="3" cy="3" r="2" fill="#10B981"/>
</svg>
`),iconSize:[6,6],iconAnchor:[3,3]}),vD=({isDrawing:e,onPointAdd:t,onDrawingComplete:n})=>(bC({click:r=>{e&&t([r.latlng.lat,r.latlng.lng])},keydown:r=>{r.originalEvent.key==="Escape"&&e&&n()}}),null),yD=({center:e,zoom:t})=>{const n=$y(),r=P.useRef({center:null,zoom:null});return ye.useEffect(()=>{const[i,s]=e||[],a=typeof i=="number"&&typeof s=="number",l=typeof t=="number"?t:n.getZoom(),c=!r.current.center||r.current.center[0]!==i||r.current.center[1]!==s||r.current.zoom!==l;a&&c&&(n.setView(e,l,{animate:!0}),r.current={center:e,zoom:l})},[e,t,n]),null},hm=e=>{if(!e||e.length<3)return 0;let t=0;const n=e.length;for(let a=0;a<n;a++){const l=(a+1)%n;t+=e[a][0]*e[l][1],t-=e[l][0]*e[a][1]}t=Math.abs(t)/2;const r=e.reduce((a,l)=>a+l[0],0)/n,i=3.28084,s=111320*Math.cos(r*Math.PI/180);return t*Math.pow(s*i,2)},NN=({center:e=[39.8283,-98.5795],zoom:t=15,property:n,sections:r=[],onSectionCreate:i,onSectionUpdate:s,onSectionDelete:a,onPropertyUpdate:l,onSectionClick:c,selectedSections:f=[],editable:g=!1,className:d="h-96 w-full",mode:v="view",gpsTrack:y=[],currentLocation:x=null,showTrackPoints:S=!0,direction:C=null})=>{console.log("PropertyMap render:",{center:e,zoom:t,sections:r.length,selectedSections:f,mode:v,gpsTrack:y.length,currentLocation:x});const[E,w]=P.useState(!1),[N,I]=P.useState([]),[R,A]=P.useState(null),[B,q]=P.useState(!1),[Q,Y]=P.useState(""),[J,W]=P.useState(""),[$,D]=P.useState(""),ut=P.useRef(null),it=P.useCallback(ct=>{I(ht=>[...ht,ct])},[]),yt=P.useCallback(()=>{N.length>=3?(hm(N),q(!0)):I([]),w(!1)},[N]),z=()=>{w(!0),I([]),A(null)},at=()=>{w(!1),I([]),q(!1),Y(""),W(""),D("")},tt=async()=>{if(!Q.trim()||N.length<3)return;const ct=hm(N),ht={name:Q,area:ct,polygonData:{type:"Polygon",coordinates:[N.map(([_t,wt])=>[wt,_t])]},grassType:J||null,soilType:$||null};try{i&&await i(ht),at()}catch(_t){console.error("Error creating section:",_t)}},vt=ct=>{c?c(ct):A((R==null?void 0:R.id)===ct.id?null:ct)},Lt=async()=>{if(!(!R||!a))try{await a(R.id),A(null)}catch(ct){console.error("Error deleting section:",ct)}};return p.jsxs("div",{className:`relative ${d}`,children:[g&&p.jsxs("div",{className:"absolute top-4 right-4 z-10 flex flex-col space-y-2",children:[p.jsx("div",{className:"bg-white rounded-lg shadow-lg p-2",children:E?p.jsxs("div",{className:"flex flex-col space-y-2",children:[p.jsxs("button",{onClick:yt,className:"btn-success text-sm px-3 py-2",disabled:N.length<3,title:"Finish drawing (or press Escape)",children:["Finish (",N.length," points)"]}),p.jsx("button",{onClick:at,className:"btn-secondary text-sm px-3 py-2",title:"Cancel drawing",children:"Cancel"})]}):p.jsx("button",{onClick:z,className:"btn-primary text-sm px-3 py-2",title:"Draw new lawn section",children:"Draw Section"})}),R&&p.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-3",children:[p.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:R.name}),p.jsxs("p",{className:"text-sm text-gray-600 mb-2",children:[Math.round(R.area).toLocaleString()," sq ft"]}),R.grassType&&p.jsxs("p",{className:"text-xs text-gray-500 mb-1",children:["Grass: ",R.grassType]}),R.soilType&&p.jsxs("p",{className:"text-xs text-gray-500 mb-3",children:["Soil: ",R.soilType]}),p.jsx("button",{onClick:Lt,className:"btn-danger text-xs px-2 py-1 w-full",children:"Delete Section"})]})]}),B&&p.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-black bg-opacity-50",children:p.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[p.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"New Lawn Section"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Section Name *"}),p.jsx("input",{type:"text",value:Q,onChange:ct=>Y(ct.target.value),className:"input",placeholder:"e.g., Front Yard, Back Lawn",autoFocus:!0})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Grass Type"}),p.jsxs("select",{value:J,onChange:ct=>W(ct.target.value),className:"input",children:[p.jsx("option",{value:"",children:"Select grass type"}),p.jsx("option",{value:"bermuda",children:"Bermuda"}),p.jsx("option",{value:"fescue",children:"Fescue"}),p.jsx("option",{value:"kentucky bluegrass",children:"Kentucky Bluegrass"}),p.jsx("option",{value:"zoysia",children:"Zoysia"}),p.jsx("option",{value:"st augustine",children:"St. Augustine"}),p.jsx("option",{value:"centipede",children:"Centipede"}),p.jsx("option",{value:"other",children:"Other"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Soil Type"}),p.jsxs("select",{value:$,onChange:ct=>D(ct.target.value),className:"input",children:[p.jsx("option",{value:"",children:"Select soil type"}),p.jsx("option",{value:"clay",children:"Clay"}),p.jsx("option",{value:"sand",children:"Sand"}),p.jsx("option",{value:"loam",children:"Loam"}),p.jsx("option",{value:"silt",children:"Silt"}),p.jsx("option",{value:"rocky",children:"Rocky"})]})]}),p.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg",children:[p.jsxs("p",{className:"text-sm text-gray-600",children:["Area: ",Math.round(hm(N)).toLocaleString()," sq ft"]}),p.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[N.length," points drawn"]})]})]}),p.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[p.jsx("button",{onClick:at,className:"btn-outline",children:"Cancel"}),p.jsx("button",{onClick:tt,disabled:!Q.trim(),className:"btn-primary",children:"Save Section"})]})]})}),p.jsxs(LC,{center:e,zoom:t,className:"h-full w-full rounded-lg",ref:ut,children:[p.jsx(IC,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),p.jsx(yD,{center:e,zoom:t}),p.jsx(vD,{isDrawing:E,onPointAdd:it,onDrawingComplete:yt}),n&&n.latitude&&n.longitude&&p.jsx($a,{position:[n.latitude,n.longitude],title:n.name}),r.map(ct=>{var we;let ht=ct.polygonData||ct.polygon_data;if(typeof ht=="string")try{ht=JSON.parse(ht)}catch(Ee){return console.error("Failed to parse polygon data:",Ee),null}if(!((we=ht==null?void 0:ht.coordinates)!=null&&we[0]))return null;const _t=ht.coordinates[0],wt=(R==null?void 0:R.id)===ct.id,Gt=f.includes(ct.id),jt=wt||Gt;return p.jsx(Vd,{positions:_t,pathOptions:{fillColor:Gt?"#10b981":"#3b82f6",fillOpacity:jt?.8:.5,color:Gt?"#059669":"#2563eb",weight:jt?4:3,opacity:1},eventHandlers:{click:()=>vt(ct)}},ct.id)}),(v==="execution"||v==="view")&&p.jsxs(p.Fragment,{children:[y.length>1&&p.jsx(sd,{positions:y.map(ct=>[ct.lat,ct.lng]),pathOptions:{color:"#EF4444",weight:4,opacity:.8}}),S&&y.map((ct,ht)=>ht%10===0&&p.jsx($a,{position:[ct.lat,ct.lng],icon:mD},`track-${ht}`)),x&&v==="execution"&&p.jsx($a,{position:[x.lat,x.lng],icon:gD}),C&&r&&r.length>0&&(()=>{let ct=90,ht=-90,_t=180,wt=-180;if(r.forEach(Nn=>{var Ji;let Ke=Nn.polygonData||Nn.polygon_data;if(typeof Ke=="string")try{Ke=JSON.parse(Ke)}catch{return}(Ji=Ke==null?void 0:Ke.coordinates)!=null&&Ji[0]&&Ke.coordinates[0].forEach(([ar,cn])=>{ar<ct&&(ct=ar),ar>ht&&(ht=ar),cn<_t&&(_t=cn),cn>wt&&(wt=cn)})}),!(ct<ht&&_t<wt))return null;const Gt=(ct+ht)/2,jt=(_t+wt)/2;let we=[];switch((C||"").toUpperCase()){case"N_S":we=[[ht,jt],[ct,jt]];break;case"E_W":we=[[Gt,_t],[Gt,wt]];break;case"NE_SW":we=[[ht,wt],[ct,_t]];break;case"NW_SE":we=[[ht,_t],[ct,wt]];break;case"CIRCULAR":{const Nn=(ht-ct)/3,Ke=(wt-_t)/3,Ji=Array.from({length:72}).map((ar,cn)=>{const xi=cn/72*2*Math.PI;return[Gt+Nn*Math.sin(xi),jt+Ke*Math.cos(xi)]});return p.jsxs(p.Fragment,{children:[p.jsx(sd,{positions:Ji,pathOptions:{color:"#A855F7",weight:3,dashArray:"8,6",opacity:.9}}),p.jsx("div",{className:"absolute top-4 left-4 bg-white rounded shadow px-2 py-1 text-xs text-gray-900 border border-purple-200",children:"Direction: Circular"})]})}}if(we.length===0)return null;const Ee=(ht-ct)*.02,Je=(wt-_t)*.02,De=[];C==="N_S"?(De.push(we),De.push([[ht,jt-Je],[ct,jt-Je]]),De.push([[ht,jt+Je],[ct,jt+Je]])):C==="E_W"?(De.push(we),De.push([[Gt-Ee,_t],[Gt-Ee,wt]]),De.push([[Gt+Ee,_t],[Gt+Ee,wt]])):(C==="NE_SW"||C==="NW_SE")&&De.push(we);const jr={N_S:"North to South",E_W:"East to West",NE_SW:"NE to SW",NW_SE:"NW to SE",CIRCULAR:"Circular"};return p.jsxs(p.Fragment,{children:[De.map((Nn,Ke)=>p.jsx(sd,{positions:Nn,pathOptions:{color:"#A855F7",weight:Ke===0?4:2,dashArray:"8,6",opacity:.95}},`dir-${Ke}`)),p.jsxs("div",{className:"absolute top-4 left-4 bg-white rounded shadow px-2 py-1 text-xs text-gray-900 border border-purple-200",children:["Direction: ",jr[(C||"").toUpperCase()]||C]})]})})()]}),N.length>0&&p.jsxs(p.Fragment,{children:[N.map((ct,ht)=>p.jsx($a,{position:ct,icon:new Fr.Icon({iconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iNCIgZmlsbD0iIzNiODJmNiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=",iconSize:[12,12],iconAnchor:[6,6]})},ht)),N.length>=3&&p.jsx(Vd,{positions:N,pathOptions:{fillColor:"#3b82f6",fillOpacity:.3,color:"#3b82f6",weight:2,dashArray:"5, 5"}})]})]}),E&&p.jsxs("div",{className:"absolute bottom-4 left-4 bg-white rounded-lg shadow-lg p-3 max-w-xs",children:[p.jsx("p",{className:"text-sm text-gray-700",children:p.jsx("strong",{children:"Drawing Mode:"})}),p.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["Click to add points. Press ",p.jsx("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded text-xs",children:"Escape"}),' or click "Finish" when done.']}),p.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Need at least 3 points to create a section."})]}),v==="execution"&&y.length>0&&p.jsxs("div",{className:"absolute bottom-4 left-4 bg-white rounded-lg shadow-lg p-3",children:[p.jsx("p",{className:"text-sm font-medium text-gray-700",children:"GPS Tracking Active"}),p.jsxs("p",{className:"text-xs text-gray-600",children:["Track Points: ",y.length]}),x&&p.jsxs("p",{className:"text-xs text-gray-600",children:["Accuracy: ±",Math.round(x.accuracy||0),"m"]})]}),r.length>0&&!E&&v!=="execution"&&p.jsxs("div",{className:"absolute bottom-4 left-4 bg-white rounded-lg shadow-lg p-3",children:[p.jsxs("p",{className:"text-sm font-medium text-gray-700",children:[r.length," Section",r.length!==1?"s":""]}),p.jsxs("p",{className:"text-xs text-gray-600",children:["Total: ",r.reduce((ct,ht)=>ct+(ht.area||0),0).toLocaleString()," sq ft"]})]})]})},_D=({application:e,propertyDetails:t,onClose:n})=>{var I,R,A,B,q,Q;const[r,i]=P.useState(null),[s,a]=P.useState([]),[l,c]=P.useState(null),[f,g]=P.useState(!0),[d,v]=P.useState(null),[y,x]=P.useState(null),S=(Y,J,W,$)=>{const ut=at=>at*Math.PI/180,it=ut(W-Y),yt=ut($-J),z=Math.sin(it/2)**2+Math.cos(ut(Y))*Math.cos(ut(W))*Math.sin(yt/2)**2;return 2*6371e3*Math.atan2(Math.sqrt(z),Math.sqrt(1-z))},C=(Y=[])=>{if(!Array.isArray(Y)||Y.length<2)return 0;let J=0;for(let W=1;W<Y.length;W++){const $=Y[W-1],D=Y[W];J+=S($.lat,$.lng,D.lat,D.lng)}return J*3.28084},E=Y=>{if(!(Y!=null&&Y.gpsTrack))return 0;const J=Y.gpsTrack.totalDistance;return typeof J=="number"&&J>0?J*3.28084:C(Y.gpsTrack.points)},w=(Y,J)=>{var ut,it;if(!((ut=J==null?void 0:J.gpsTrack)!=null&&ut.points)||J.gpsTrack.points.length<2)return 0;let W=4;const $=(l==null?void 0:l.equipment)||{};if(typeof $.spreadWidth=="number"&&$.spreadWidth>0)W=$.spreadWidth;else if(typeof $.sprayWidthFeet=="number"&&$.sprayWidthFeet>0)W=$.sprayWidthFeet;else{const yt=((it=Y.equipmentName)==null?void 0:it.toLowerCase())||"";yt.includes("spreader")?W=12:yt.includes("sprayer")?W=20:yt.includes("mower")&&(W=6)}const D=Y.totalSectionArea||0;if(D<=0)return 0;try{const yt=(s||[]).map(Gt=>{var Ee;let jt=Gt.polygonData;if(typeof jt=="string")try{jt=JSON.parse(jt)}catch{jt=null}if(!((Ee=jt==null?void 0:jt.coordinates)!=null&&Ee[0]))return null;const we=jt.coordinates[0].map(([Je,De])=>[De,Je]);return Ap([we])}).filter(Boolean);if(yt.length===0){const Gt=E(J);if(Gt===0)return 0;const jt=Gt*W;return Math.min(Math.round(jt/D*100),100)}const z=yt.reduce((Gt,jt)=>Gt?cD(Gt,jt):jt,null);if(!z)return 0;const at=J.gpsTrack.points.map(Gt=>[Gt.lng,Gt.lat]),tt=UM(at),vt=W/2*.3048/1e3,Lt=lD(tt,vt,{units:"kilometers"});if(!Lt)return 0;const ct=fD(Lt,z);if(!ct)return 0;const ht=MC(ct),_t=D*.092903,wt=ht/_t*100;return Math.min(Math.round(wt),100)}catch(yt){console.warn("Coverage calc fallback due to error:",yt);const at=E(J)*W;return Math.min(Math.round(at/D*100),100)}};P.useEffect(()=>{(async()=>{var J;if(e!=null&&e.id)try{g(!0);const $=(await jc.getPlan(e.id)).data.data.plan;c($),$.sections&&a($.sections);try{const ut=(await jc.getLogs({planId:e.id})).data.data.logs;ut&&ut.length>0&&i(ut[0])}catch(D){console.log("No application logs found:",D)}try{const D=$.property_id||e.propertyId;if(D){const ut=await KO.getCurrent(D);v(ut.data.data.weather),x(null)}}catch(D){console.warn("Weather fetch failed:",((J=D==null?void 0:D.response)==null?void 0:J.data)||D.message),x("Weather unavailable")}}catch(W){console.error("Failed to fetch application data:",W)}finally{g(!1)}})()},[e==null?void 0:e.id]);const N=ye.useMemo(()=>{if(s.length===0)return null;let Y=0,J=0,W=0;return s.forEach($=>{var ut;let D=$.polygonData;if(typeof D=="string")try{D=JSON.parse(D)}catch{return}(ut=D==null?void 0:D.coordinates)!=null&&ut[0]&&D.coordinates[0].forEach(([it,yt])=>{Y+=it,J+=yt,W++})}),W>0?[Y/W,J/W]:null},[s]);return f?p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsx("div",{className:"bg-white rounded-lg p-6 w-full max-w-4xl mx-4 max-h-[90vh] overflow-y-auto",children:p.jsx("div",{className:"flex items-center justify-center py-8",children:p.jsx("div",{className:"text-gray-500",children:"Loading application details..."})})})}):p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-6xl mx-4 max-h-[90vh] overflow-y-auto",children:[p.jsxs("div",{className:"flex justify-between items-center mb-6",children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Application Details"}),p.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600",children:p.jsx(Hy,{className:"h-6 w-6"})})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[p.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(zc,{className:"h-5 w-5 mr-2"}),"Property & Areas"]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Property:"})," ",e.propertyName]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Areas:"})," ",e.sectionNames]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Total Area:"})," ",(I=e.totalSectionArea)==null?void 0:I.toLocaleString()," sq ft"]})]})]}),p.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(mu,{className:"h-5 w-5 mr-2"}),"Equipment & Status"]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Equipment:"})," ",e.equipmentName]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Status:"}),p.jsx("span",{className:`ml-2 px-2 py-1 text-xs font-medium rounded-full ${e.status==="completed"?"bg-green-100 text-green-800":e.status==="planned"?"bg-blue-100 text-blue-800":e.status==="in_progress"?"bg-yellow-100 text-yellow-800":"bg-gray-100 text-gray-800"}`,children:e.status})]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Planned Date:"})," ",new Date(e.plannedDate).toLocaleDateString()]})]})]})]}),p.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:p.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg col-span-1",children:[p.jsx("h3",{className:"font-semibold text-blue-900 mb-3",children:"Current Weather"}),d?p.jsxs("div",{className:"text-sm text-blue-900",children:[p.jsxs("div",{className:"flex items-center mb-2",children:[p.jsx("img",{alt:"icon",src:`https://openweathermap.org/img/wn/${d.current.icon}@2x.png`}),p.jsxs("div",{className:"ml-2 text-2xl font-bold",children:[d.current.temperature,"°F"]})]}),p.jsx("div",{children:d.current.conditions}),p.jsxs("div",{className:"mt-1",children:["Humidity: ",d.current.humidity,"%"]}),p.jsxs("div",{children:["Wind: ",Math.round(d.current.windSpeed)," mph"]})]}):y?p.jsx("div",{className:"text-sm text-blue-700",children:y}):p.jsx("div",{className:"text-sm text-blue-700",children:"Loading weather…"})]})}),(l==null?void 0:l.products)&&l.products.length>0&&p.jsxs("div",{className:"mb-6",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(yv,{className:"h-5 w-5 mr-2"}),"Products Applied"]}),p.jsxs("div",{className:"bg-gray-50 rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"grid grid-cols-4 gap-4 p-4 border-b text-sm font-medium text-gray-600",children:[p.jsx("div",{children:"Product"}),p.jsx("div",{children:"Rate"}),p.jsx("div",{children:"Amount"}),p.jsx("div",{children:"Water"})]}),l.products.map((Y,J)=>{var W,$;return p.jsxs("div",{className:"grid grid-cols-4 gap-4 p-4 border-b last:border-b-0",children:[p.jsx("div",{className:"font-medium",children:Y.productName}),p.jsxs("div",{children:[Y.rateAmount," ",Y.rateUnit]}),p.jsxs("div",{children:[(W=Y.calculatedProductAmount)==null?void 0:W.toFixed(2)," lbs"]}),p.jsxs("div",{children:[($=Y.calculatedWaterAmount)==null?void 0:$.toFixed(2)," gal"]})]},J)})]})]}),r&&p.jsxs("div",{className:"mb-6",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(uC,{className:"h-5 w-5 mr-2"}),"Tracking Information"]}),p.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4",children:[p.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg",children:[p.jsx("div",{className:"text-sm text-blue-600 font-medium",children:"Average Speed"}),p.jsxs("div",{className:"text-xl font-bold text-blue-900",children:[(((R=r.gpsTrack)==null?void 0:R.averageSpeed)||r.averageSpeed||0).toFixed(1)," mph"]})]}),p.jsxs("div",{className:"bg-green-50 p-3 rounded-lg",children:[p.jsx("div",{className:"text-sm text-green-600 font-medium",children:"GPS Points"}),p.jsx("div",{className:"text-xl font-bold text-green-900",children:((B=(A=r.gpsTrack)==null?void 0:A.points)==null?void 0:B.length)||0})]}),p.jsxs("div",{className:"bg-purple-50 p-3 rounded-lg",children:[p.jsx("div",{className:"text-sm text-purple-600 font-medium",children:"Duration"}),p.jsxs("div",{className:"text-xl font-bold text-purple-900",children:[(q=r.gpsTrack)!=null&&q.duration?Math.round(r.gpsTrack.duration/60):0," min"]})]}),p.jsxs("div",{className:"bg-orange-50 p-3 rounded-lg",children:[p.jsx("div",{className:"text-sm text-orange-600 font-medium",children:"Distance"}),p.jsxs("div",{className:"text-xl font-bold text-orange-900",children:[Math.round(E(r))," ft"]})]}),p.jsxs("div",{className:"bg-emerald-50 p-3 rounded-lg",children:[p.jsx("div",{className:"text-sm text-emerald-600 font-medium",children:"Coverage"}),p.jsxs("div",{className:"text-xl font-bold text-emerald-900",children:[w(e,r),"%"]})]})]})]}),p.jsxs("div",{className:"mb-6",children:[p.jsx("h4",{className:"font-medium mb-2",children:"Application Area & GPS Track"}),p.jsx("div",{className:"h-96 border rounded-lg overflow-hidden",children:p.jsx(NN,{property:t,sections:s,selectedSections:s.map(Y=>Y.id)||[],mode:"view",gpsTrack:((Q=r==null?void 0:r.gpsTrack)==null?void 0:Q.points)||[],currentLocation:null,center:N,zoom:N?16:15,editable:!1})})]}),(e.notes||(r==null?void 0:r.notes))&&p.jsxs("div",{className:"mb-6",children:[p.jsx("h3",{className:"font-semibold text-gray-900 mb-2",children:"Notes"}),p.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:p.jsx("p",{className:"text-gray-700",children:e.notes||(r==null?void 0:r.notes)})})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx("button",{onClick:n,className:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600",children:"Close"})})]})})},xD=({session:e,onClose:t})=>{var d,v,y;const[n,r]=P.useState([]),[i,s]=P.useState(e),[a,l]=P.useState(!0),c=x=>(x||0)*3.28084;P.useEffect(()=>{(async()=>{var S,C,E,w,N,I,R,A,B,q;if(e!=null&&e.id)try{l(!0);const Q=await aC.getSession(e.id),Y=((C=(S=Q.data)==null?void 0:S.data)==null?void 0:C.session)||e,J=((w=(E=Q.data)==null?void 0:E.data)==null?void 0:w.sections)||[];if(s(Y),J.length)r(J);else if(Y.property_id){const W=await Za.getById(Y.property_id);r(((R=(I=(N=W.data)==null?void 0:N.data)==null?void 0:I.property)==null?void 0:R.sections)||[])}}catch{try{if(e.property_id){const Y=await Za.getById(e.property_id);r(((q=(B=(A=Y.data)==null?void 0:A.data)==null?void 0:B.property)==null?void 0:q.sections)||[])}}catch{}}finally{l(!1)}})()},[e==null?void 0:e.id,e==null?void 0:e.property_id]);const f=P.useMemo(()=>((i==null?void 0:i.gps_track)||(i==null?void 0:i.gpsTrack)||{}).points||[],[i]),g=P.useMemo(()=>{if(!n.length)return null;let x=0,S=0,C=0;return n.forEach(E=>{var N;let w=E.polygonData||E.polygon_data;if(typeof w=="string")try{w=JSON.parse(w)}catch{w=null}(N=w==null?void 0:w.coordinates)!=null&&N[0]&&w.coordinates[0].forEach(([I,R])=>{x+=I,S+=R,C++})}),C?[x/C,S/C]:null},[n]);return a?p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsx("div",{className:"bg-white rounded-lg p-6 w-full max-w-4xl mx-4 max-h-[90vh] overflow-y-auto",children:p.jsx("div",{className:"py-8 text-center text-gray-600",children:"Loading mowing session…"})})}):p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:p.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-6xl mx-4 max-h-[90vh] overflow-y-auto",children:[p.jsxs("div",{className:"flex justify-between items-center mb-6",children:[p.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Mowing Session Details"}),p.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600",children:p.jsx(Hy,{className:"h-6 w-6"})})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[p.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(zc,{className:"h-5 w-5 mr-2"}),"Property & Areas"]}),p.jsxs("div",{className:"space-y-1 text-sm",children:[p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Property:"})," ",i.property_name||e.property_name]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Areas:"})," ",i.section_names||e.section_names||n.map(x=>x.name).join(", ")]}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Cut Height:"})," ",Number(i.cut_height_inches||e.cut_height_inches).toFixed(2),'"']}),p.jsxs("p",{children:[p.jsx("span",{className:"font-medium",children:"Direction:"})," ",i.direction||e.direction]})]})]}),p.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[p.jsxs("h3",{className:"font-semibold text-gray-900 mb-3 flex items-center",children:[p.jsx(mu,{className:"h-5 w-5 mr-2"}),"Equipment & Stats"]}),p.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"Mower:"})," ",i.equipment_name||e.equipment_name]}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"Avg Speed:"})," ",((v=(d=i.average_speed_mph||i.averageSpeed||0).toFixed)==null?void 0:v.call(d,1))||Number(i.averageSpeed||0).toFixed(1)," mph"]}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"Duration:"})," ",Math.round((i.duration_seconds||i.durationSeconds||0)/60)," min"]}),p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"Distance:"})," ",Math.round(c(i.total_distance_meters||((y=i.gps_track)==null?void 0:y.totalDistance)||0))," ft"]})]})]})]}),p.jsxs("div",{className:"mb-6",children:[p.jsx("h4",{className:"font-medium mb-2",children:"Mowed Areas & GPS Track"}),p.jsx("div",{className:"h-96 border rounded-lg overflow-hidden",children:p.jsx(NN,{sections:n,selectedSections:n.map(x=>x.id),mode:"view",gpsTrack:f,center:g,zoom:g?16:15,direction:i.direction||e.direction,editable:!1})})]}),i.notes&&p.jsxs("div",{className:"mb-6",children:[p.jsx("h3",{className:"font-semibold text-gray-900 mb-2",children:"Notes"}),p.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:p.jsx("p",{className:"text-gray-700",children:i.notes})})]}),p.jsx("div",{className:"flex justify-end",children:p.jsx("button",{onClick:t,className:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600",children:"Close"})})]})})},wD=["Turf Type Tall Fescue","Kentucky Bluegrass","Perennial Ryegrass","Fine Fescue","Creeping Red Fescue","Chewings Fescue","Hard Fescue","Annual Ryegrass"],Kw=({value:e=[],onChange:t})=>{const[n,r]=P.useState(""),i=s=>{const a=s.trim();a&&(e.includes(a)||t([...e||[],a]),r(""))};return p.jsxs("div",{className:"border rounded p-2",children:[p.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(e||[]).map(s=>p.jsxs("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs flex items-center gap-1",children:[s,p.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>t((e||[]).filter(a=>a!==s)),children:"×"})]},s))}),p.jsx("input",{className:"w-full border-0 focus:outline-none text-sm",placeholder:"Type and press Enter to add",value:n,onChange:s=>r(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),i(n))}})]})},Qw=({onPick:e})=>p.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:wD.map(t=>p.jsx("button",{type:"button",onClick:()=>e(t),className:"px-2 py-1 bg-blue-50 hover:bg-blue-100 text-blue-700 rounded text-xs",children:t},t))});delete Fr.Icon.Default.prototype._getIconUrl;Fr.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const Ga=[{name:"Green",value:"#22c55e"},{name:"Blue",value:"#3b82f6"},{name:"Red",value:"#ef4444"},{name:"Yellow",value:"#eab308"},{name:"Purple",value:"#a855f7"},{name:"Orange",value:"#f97316"}],Vc=e=>{try{const t=Ap([e.map(r=>[r[1],r[0]])]),n=MC(t);return Math.round(n*10.7639)}catch(t){return console.error("Area calculation error:",t),0}},ED=(e,t,n)=>{const[r,i]=e,[s,a]=t,[l,c]=n,f=r-s,g=i-a,d=l-s,v=c-a,y=f*d+g*v,x=d*d+v*v;if(x===0)return Math.sqrt(f*f+g*g);let S=y/x,C,E;S<0?(C=s,E=a):S>1?(C=l,E=c):(C=s+S*d,E=a+S*v);const w=r-C,N=i-E;return Math.sqrt(w*w+N*N)};function SD({isDrawing:e,onPolygonComplete:t,currentColor:n}){const[r,i]=P.useState([]);return bC({click(s){if(!e)return;const a=[s.latlng.lat,s.latlng.lng];console.log("Adding point:",a),i(l=>{const c=[...l,a];return console.log("Current polygon has",c.length,"points"),c})},dblclick(s){console.log("Double click detected, drawing:",e,"points:",r.length),e&&r.length>=3&&(s.originalEvent.preventDefault(),s.originalEvent.stopPropagation(),console.log("Completing polygon with",r.length,"points"),t(r),i([]))}}),r.length>0?p.jsx(Vd,{positions:r,pathOptions:{color:n.value,fillColor:n.value,fillOpacity:.3,weight:2,dashArray:"5, 5"}}):null}function CD({section:e,onUpdate:t,onEdit:n,onDelete:r}){const[i,s]=P.useState(!1),[a,l]=P.useState(e.coordinates);$y();const c=(g,d)=>{const v=[...a];v[g]=[d.lat,d.lng],l(v);const y=Vc([...v,v[0]]);t(e.id,{...e,coordinates:v,area:y})},f=g=>{if(a.length<=3){re.error("Polygon must have at least 3 points");return}const d=a.filter((y,x)=>x!==g);l(d);const v=Vc([...d,d[0]]);t(e.id,{...e,coordinates:d,area:v})};return p.jsxs(p.Fragment,{children:[p.jsx(Vd,{positions:a,pathOptions:{color:e.color.value,fillColor:e.color.value,fillOpacity:i?.3:.4,weight:i?3:2},eventHandlers:{click:g=>{if(!i)s(!0),re("Edit mode enabled: Drag points to move, right-click to remove points, click edges to add points");else{const d=[g.latlng.lat,g.latlng.lng];let v=0,y=1/0;for(let C=0;C<a.length;C++){const E=a[C],w=a[(C+1)%a.length],N=ED(d,E,w);N<y&&(y=N,v=C)}const x=[...a];x.splice(v+1,0,d),l(x);const S=Vc([...x,x[0]]);t(e.id,{...e,coordinates:x,area:S}),re("Point added! Drag it to adjust position")}}},children:p.jsx(Sv,{children:p.jsxs("div",{className:"text-center",children:[p.jsx("strong",{children:e.name}),p.jsx("br",{}),e.area.toLocaleString()," sq ft",p.jsx("br",{}),p.jsxs("div",{className:"flex gap-2 mt-2",children:[p.jsx("button",{onClick:()=>{s(!i),re(i?"Edit mode disabled":"Edit mode enabled")},className:`text-sm ${i?"text-green-600":"text-blue-600"}`,title:i?"Exit edit mode":"Drag corners, click edges to add points, right-click to remove",children:i?"Done":"Edit Points"}),p.jsx("button",{onClick:()=>n(e),className:"text-blue-600 text-sm",children:"Edit Name"}),p.jsx("button",{onClick:()=>r(e.id),className:"text-red-600 text-sm",children:"Delete"})]})]})})}),i&&a.map((g,d)=>p.jsx($a,{position:g,draggable:!0,eventHandlers:{dragend:v=>{c(d,v.target.getLatLng())},contextmenu:v=>{v.originalEvent.preventDefault(),a.length>3&&f(d)}},icon:new Fr.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa(`
<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<circle cx="6" cy="6" r="5" fill="${e.color.value}" stroke="white" stroke-width="2"/>
</svg>
`),iconSize:[12,12],iconAnchor:[6,6]}),children:p.jsx(Sv,{children:p.jsxs("div",{className:"text-center",children:[p.jsxs("p",{className:"text-xs",children:["Point ",d+1]}),p.jsx("button",{onClick:()=>f(d),className:"text-red-600 text-xs",disabled:a.length<=3,children:"Remove Point"})]})})},`${e.id}-${d}`))]})}const ND=()=>{const{id:e}=LI(),t=La(),[n,r]=P.useState(null),[i,s]=P.useState([]),[a,l]=P.useState(!0),[c,f]=P.useState(!1),[g,d]=P.useState(!1),[v,y]=P.useState(!1),[x,S]=P.useState(!1),[C,E]=P.useState(null),[w,N]=P.useState([]),[I,R]=P.useState([]),[A,B]=P.useState(0),[q,Q]=P.useState(null),[Y,J]=P.useState(null),[W,$]=P.useState(!1),[D,ut]=P.useState(null),[it,yt]=P.useState(!1),[z,at]=P.useState(!1),[tt,vt]=P.useState(!1),[Lt,ct]=P.useState(!1),[ht,_t]=P.useState(Ga[0]),[wt,Gt]=P.useState(!1),[jt,we]=P.useState(null),[Ee,Je]=P.useState(""),[De,jr]=P.useState([]),[Nn,Ke]=P.useState(null),[Ji,ar]=P.useState(!1),[cn,xi]=P.useState([]),[Il,Ra]=P.useState([]),[Ma,T]=P.useState([]),[F,G]=P.useState([]),[gt,pt]=P.useState(!1),[ft,Et]=P.useState(null),[Bt,ne]=P.useState(null);P.useEffect(()=>{_r()},[e]);const $e=()=>{if(!navigator.geolocation||D)return;const U=navigator.geolocation.watchPosition(X=>{const{latitude:mt,longitude:st,accuracy:nt}=X.coords;Ls(mt,st,nt)},X=>{console.warn("Warm GPS watch error",X==null?void 0:X.message)},{enableHighAccuracy:!0,maximumAge:1e3,timeout:2e4});ut(U)};P.useEffect(()=>($e(),()=>{try{D&&navigator.geolocation.clearWatch(D)}catch{}ut(null)}),[]),P.useEffect(()=>{if(!navigator.geolocation||it)return;const U=()=>{navigator.geolocation.getCurrentPosition(X=>{Ls(X.coords.latitude,X.coords.longitude,X.coords.accuracy),$e(),yt(!0),document.removeEventListener("click",U),document.removeEventListener("touchstart",U)},()=>{$e(),yt(!0),document.removeEventListener("click",U),document.removeEventListener("touchstart",U)},{enableHighAccuracy:!0,maximumAge:1e3,timeout:8e3})};return document.addEventListener("click",U,{once:!0}),document.addEventListener("touchstart",U,{once:!0}),()=>{document.removeEventListener("click",U),document.removeEventListener("touchstart",U)}},[it]),P.useEffect(()=>{if(!(n!=null&&n.id))return;(async()=>{var X,mt,st,nt,St,Xt,Yt,Mt,zt;try{pt(!0);const[he,kn,fn,ts]=await Promise.all([jc.getPlans({status:"completed",property_id:n.id}),jc.getPlans({status:"archived",property_id:n.id}),jc.getLogs({property_id:n.id}),aC.getLogs({property_id:n.id})]),Mo=((mt=(X=he.data)==null?void 0:X.data)==null?void 0:mt.plans)||[],Ao=((nt=(st=kn.data)==null?void 0:st.data)==null?void 0:nt.plans)||[];Ra([...Mo||[],...Ao||[]]),T(((Xt=(St=fn.data)==null?void 0:St.data)==null?void 0:Xt.logs)||[]),G(((Mt=(Yt=ts.data)==null?void 0:Yt.data)==null?void 0:Mt.logs)||[])}catch(he){console.warn("Failed to load property history",((zt=he==null?void 0:he.response)==null?void 0:zt.data)||he.message),Ra([]),T([]),G([])}finally{pt(!1)}})()},[n==null?void 0:n.id]),P.useEffect(()=>{const U=X=>{c&&X.key==="Enter"&&console.log("Enter pressed during drawing mode"),X.key==="Escape"&&c&&(f(!1),re("Drawing cancelled"))};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[c]);const _r=async()=>{try{l(!0);const U=await Za.getById(e);console.log("Property details:",U);const X=U.data.data.property;if(r(X),X.sections&&X.sections.length>0){const mt=X.sections.map(st=>{var zt;const nt=typeof st.polygonData=="string"?JSON.parse(st.polygonData):st.polygonData,Xt=(Array.isArray((zt=nt==null?void 0:nt.coordinates)==null?void 0:zt[0])?nt.coordinates[0]:[]).map(he=>[Number(he[0]),Number(he[1])]),Yt=nt==null?void 0:nt.color,Mt=Yt&&typeof Yt=="object"&&"value"in Yt?Yt:typeof Yt=="string"?{name:"Custom",value:Yt}:Ga[0];return{id:st.id,name:st.name,coordinates:Xt,color:Mt,area:st.area,grassType:st.grassType||"",grassTypes:st.grassTypes||null}});s(mt)}}catch(U){console.error("Failed to fetch property:",U),re.error("Failed to load property"),t("/properties")}finally{l(!1)}},tn=U=>{if(console.log("handlePolygonComplete called with",U.length,"coordinates"),U.length<3){re.error("Polygon needs at least 3 points");return}const X=Vc([...U,U[0]]);console.log("Calculated area:",X),we({coordinates:U,color:ht,area:X}),Gt(!0),f(!1)},wi=(U,X,mt,st)=>{const nt=zt=>zt*Math.PI/180,Xt=nt(mt-U),Yt=nt(st-X),Mt=Math.sin(Xt/2)**2+Math.cos(nt(U))*Math.cos(nt(mt))*Math.sin(Yt/2)**2;return 2*6371e3*Math.atan2(Math.sqrt(Mt),Math.sqrt(1-Mt))},Aa=12,$i=2.5,Ku=12,Oo=5,Da=(U,X)=>{const mt=he=>he*Math.PI/180,st=he=>he*180/Math.PI,nt=mt(U[0]),St=mt(X[0]),Xt=mt(X[1]-U[1]),Yt=Math.sin(Xt)*Math.cos(St),Mt=Math.cos(nt)*Math.sin(St)-Math.sin(nt)*Math.cos(St)*Math.cos(Xt);return(st(Math.atan2(Yt,Mt))+360)%360},Ls=(U,X,mt)=>{const st=Date.now();R(Mt=>[...Mt,{lat:U,lng:X,accuracy:mt??999,t:st}].slice(-12));const nt=[...I,{lat:U,lng:X,accuracy:mt??999,t:st}].slice(-12),St=nt.filter(Mt=>Mt.accuracy!=null).sort((Mt,zt)=>Mt.accuracy-zt.accuracy).slice(0,Math.min(5,nt.length));if(St.length===0)return[U,X];const Xt=St.reduce((Mt,zt)=>Mt+zt.lat,0)/St.length,Yt=St.reduce((Mt,zt)=>Mt+zt.lng,0)/St.length;return[Xt,Yt]},Wf=()=>{const U=Date.now(),X=I.filter(nt=>U-(nt.t||0)<=3e3),mt=(X.length?X:I).slice(-12);if(mt.length===0)return null;const st=mt.reduce((nt,St)=>St.accuracy<((nt==null?void 0:nt.accuracy)??1/0)?St:nt,null);return st?[st.lat,st.lng,st.accuracy]:null},Xf=(U,X,mt,st)=>{if(mt!=null&&mt>Aa)return re("GPS accuracy too low ("+Math.round(mt)+"m). Waiting for better fix…"),null;if(st.length>0){const[nt,St]=st[st.length-1];if(wi(nt,St,U,X)<$i)if(st.length>=2){const Yt=Da(st[st.length-2],[nt,St]),Mt=Da([nt,St],[U,X]);let zt=Math.abs(Yt-Mt);if(zt>180&&(zt=360-zt),zt<Ku)return null}else return null}if(st.length>=2){const[nt,St]=st[0];if(wi(nt,St,U,X)<=Oo)return[nt,St]}return[U,X]},Wp=()=>{if(!navigator.geolocation){re.error("GPS not available");return}const U=Wf(),X=(mt,st,nt)=>{Q(nt||null),N(St=>{const Xt=Xf(mt,st,nt,St);if(St.length>=2){const[Mt,zt]=St[0],he=wi(Mt,zt,mt,st);at(he<=Oo)}else at(!1);if(!Xt)return St;const Yt=[...St,Xt];if(Yt.length>1){const[Mt,zt]=Yt[Yt.length-2];B(he=>he+wi(Mt,zt,Xt[0],Xt[1]))}return Yt})};if(U){const[mt,st,nt]=U;X(mt,st,nt)}else navigator.geolocation.getCurrentPosition(mt=>{const{latitude:st,longitude:nt,accuracy:St}=mt.coords;Ls(st,nt,St),X(st,nt,St)},mt=>{console.warn("GPS error",mt==null?void 0:mt.message),re.error("GPS error: "+((mt==null?void 0:mt.message)||"unknown"))},{enableHighAccuracy:!0,maximumAge:500,timeout:8e3})},Xp=()=>{N(U=>{if(U.length<=0)return U;const X=U.slice(0,-1);let mt=0;for(let st=1;st<X.length;st++)mt+=wi(X[st-1][0],X[st-1][1],X[st][0],X[st][1]);return B(mt),X})},Ro=()=>{N([]),B(0),Q(null),C&&(navigator.geolocation.clearWatch(C),E(null))},Yf=()=>{if(w.length<3){re.error("Need at least 3 points to create an area");return}tn(w),y(!1),d(!1),Ro()},Yp=async()=>{var U,X,mt,st;if(!Ee.trim()){re.error("Please enter a section name");return}try{let nt=jt.coordinates||[];if(nt.length>=3){const[hn,ni]=nt[0]||[],[Fa,Qf]=nt[nt.length-1]||[];(hn!==Fa||ni!==Qf)&&(nt=[...nt,nt[0]])}if(nt.length<4){re.error("Polygon invalid: need at least 3 unique points");return}const St=Vc(nt);if(!St||St<=0){re.error("Polygon area is zero — adjust points");return}const Xt={name:Ee,area:St,polygonData:{coordinates:[nt],color:jt.color},grassType:De.join(", "),grassTypes:De,soilType:null,captureMethod:g?"gps_points":v?"gps_trace":"tap",captureMeta:{accuracyLast:q,totalDistanceMeters:A,pointsCount:((U=jt.coordinates)==null?void 0:U.length)||0}},Mt=(await Za.createSection(e,Xt)).data.data.section,zt=typeof Mt.polygonData=="string"?JSON.parse(Mt.polygonData):Mt.polygonData,kn=(Array.isArray((X=zt==null?void 0:zt.coordinates)==null?void 0:X[0])?zt.coordinates[0]:[]).map(hn=>[Number(hn[0]),Number(hn[1])]),fn=zt==null?void 0:zt.color,ts=fn&&typeof fn=="object"&&"value"in fn?fn:typeof fn=="string"?{name:"Custom",value:fn}:ht,Mo={id:Mt.id,name:Mt.name,coordinates:kn,color:ts,area:Mt.area,grassType:Mt.grassType||"",grassTypes:Mt.grassTypes||[]};s(hn=>[...hn,Mo]),re.success(`${Ee} section created and saved!`),Je(""),jr([]),we(null),Gt(!1);const Ao=(Ga.findIndex(hn=>hn.value===ht.value)+1)%Ga.length;_t(Ga[Ao])}catch(nt){console.error("Failed to save section:",nt),re.error(((st=(mt=nt==null?void 0:nt.response)==null?void 0:mt.data)==null?void 0:st.message)||(nt==null?void 0:nt.message)||"Failed to save section. Please try again.")}},Tl=async U=>{if(window.confirm("Delete this lawn section?"))try{await Za.deleteSection(e,U),s(X=>X.filter(mt=>mt.id!==U)),re.success("Section deleted")}catch(X){console.error("Failed to delete section:",X),re.error("Failed to delete section. Please try again.")}},Kf=U=>{Ke(U),Je(U.name),_t(U.color),ar(!0);const X=(U.grassType||"").split(",").map(mt=>mt.trim()).filter(Boolean);xi(X)},Kp=async()=>{if(!Ee.trim()){re.error("Please enter a section name");return}try{const U={name:Ee,area:Nn.area,polygonData:{coordinates:[Nn.coordinates],color:ht},grassType:cn.join(", "),grassTypes:cn,soilType:null};await Za.updateSection(e,Nn.id,U);const X={...Nn,name:Ee,color:ht,grassType:cn.join(", "),grassTypes:[...cn]};s(mt=>mt.map(st=>st.id===Nn.id?X:st)),re.success("Section updated and saved!"),Je(""),Ke(null),ar(!1),xi([])}catch(U){console.error("Failed to update section:",U),re.error("Failed to update section. Please try again.")}},Qp=async(U,X)=>{try{const mt={name:X.name,area:X.area,polygonData:{coordinates:[X.coordinates],color:X.color},grassType:X.grassType||"",grassTypes:X.grassTypes||null,soilType:null};await Za.updateSection(e,U,mt),s(st=>st.map(nt=>nt.id===U?X:nt))}catch(mt){console.error("Failed to update section coordinates:",mt),re.error("Failed to save polygon changes. Please try again.")}},Jp=()=>i.reduce((U,X)=>U+X.area,0),Ei=(U,X)=>{var Mt,zt,he,kn,fn,ts;if(!((Mt=X==null?void 0:X.gpsTrack)!=null&&Mt.points)&&!((zt=X==null?void 0:X.gps_track)!=null&&zt.points))return 0;const st=(typeof(((he=X.gpsTrack)==null?void 0:he.totalDistance)||((kn=X.gps_track)==null?void 0:kn.totalDistance))=="number"?((fn=X.gpsTrack)==null?void 0:fn.totalDistance)||((ts=X.gps_track)==null?void 0:ts.totalDistance):0)*3.28084,nt=U.totalSectionArea||U.total_section_area||0;if(st===0||nt===0)return 0;let St=4;const Xt=(U.equipmentName||"").toLowerCase();Xt.includes("spreader")?St=12:Xt.includes("sprayer")?St=20:Xt.includes("mower")&&(St=6);const Yt=st*St;return Math.min(Math.round(Yt/nt*100),100)},It=U=>{var Yt,Mt;const mt=(U.total_distance_meters||((Yt=U.gpsTrack)==null?void 0:Yt.totalDistance)||((Mt=U.gps_track)==null?void 0:Mt.totalDistance)||0||0)*3.28084,st=Number(U.total_area||0),nt=parseFloat(U.cutting_width_inches||0),St=isNaN(nt)?0:nt/12;if(mt===0||st===0||St===0)return 0;const Xt=mt*St;return Math.min(100,Math.round(Xt/st*100))},Qu=(()=>{const U=(Il||[]).map(st=>{const nt=Ma.find(Yt=>Yt.planId===st.id),St=(nt==null?void 0:nt.applicationDate)||st.plannedDate||st.updatedAt||st.createdAt;return{kind:"application",date:St?new Date(St):new Date(0),application:st,log:nt}}),X=(F||[]).map(st=>{const nt=st.session_date||st.created_at;return{kind:"mowing",date:nt?new Date(nt):new Date(0),log:st}}),mt=[...U,...X];return mt.sort((st,nt)=>nt.date-st.date),mt.slice(0,10)})();if(a)return p.jsx("div",{className:"p-6",children:p.jsx("div",{className:"flex justify-center items-center h-64",children:p.jsx(Hs,{size:"lg"})})});if(!n)return p.jsx("div",{className:"p-6",children:p.jsxs("div",{className:"card text-center py-12",children:[p.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Property Not Found"}),p.jsx("button",{onClick:()=>t("/properties"),className:"btn-primary",children:"Back to Properties"})]})});const ka=n&&n.latitude!==void 0&&n.longitude!==void 0&&n.latitude!==null&&n.longitude!==null&&!isNaN(n.latitude)&&!isNaN(n.longitude),Ju=ka?[n.latitude,n.longitude]:[40.7128,-74.006];return p.jsxs("div",{className:"p-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-6",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx("button",{onClick:()=>t("/properties"),className:"p-2 hover:bg-gray-100 rounded-lg",children:p.jsx(rR,{className:"h-5 w-5"})}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:n.name}),p.jsxs("p",{className:"text-gray-600 flex items-center gap-1",children:[p.jsx(zc,{className:"h-4 w-4"}),n.address||"No address specified"]}),!ka&&p.jsx("p",{className:"text-red-600 text-sm",children:"⚠️ Property coordinates not set - using default location"})]})]}),p.jsx("div",{className:"relative",children:p.jsxs("button",{onClick:()=>ct(!0),className:"btn-primary flex items-center gap-2",title:"Add a lawn section",children:[p.jsx(bR,{className:"h-5 w-5"}),"Add Lawn Section"]})})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[p.jsx("div",{className:"lg:col-span-3",children:p.jsxs("div",{className:"card p-0 overflow-hidden",children:[p.jsx("div",{style:{height:"600px",width:"100%"},children:p.jsxs(LC,{center:Ju,zoom:ka?18:13,maxZoom:19,style:{height:"100%",width:"100%"},children:[p.jsx(IC,{attribution:'© <a href="https://www.esri.com/">Esri</a>',url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",maxZoom:19}),ka&&p.jsx($a,{position:Ju,children:p.jsx(Sv,{children:n.name})}),i.map(U=>p.jsx(CD,{section:U,onUpdate:Qp,onEdit:Kf,onDelete:Tl},U.id)),c&&p.jsx(SD,{isDrawing:c,onPolygonComplete:tn,currentColor:ht}),(g||v)&&w.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(sd,{positions:w,pathOptions:{color:"#2563eb",weight:3}}),w.map((U,X)=>p.jsx($a,{position:U,icon:new Fr.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa(`
<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg">
${X===0&&z?'<circle cx="7" cy="7" r="6" fill="#fde68a" stroke="#f59e0b" stroke-width="2"/>':'<circle cx="7" cy="7" r="6" fill="#2563eb" stroke="white" stroke-width="2"/>'}
</svg>
`),iconSize:[14,14],iconAnchor:[7,7]})},`g${X}`))]})]})}),c&&p.jsxs("div",{className:"p-4 bg-blue-50 border-t",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 bg-blue-600 rounded-full animate-pulse"}),p.jsxs("p",{className:"text-sm text-blue-800",children:[p.jsx("strong",{children:"Drawing Mode Active:"})," Click to add points. Double-click to complete polygon."]})]}),p.jsx("p",{className:"text-xs text-blue-600 mt-1",children:"Need at least 3 points to create a section. Press ESC to cancel."}),p.jsx("p",{className:"text-xs text-blue-500 mt-1",children:"💡 After creating: Click any polygon to edit its points by dragging"})]}),g&&p.jsxs("div",{className:"p-4 bg-green-50 border-t",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-green-900",children:[p.jsx("span",{className:"font-semibold",children:"GPS Points Mode"}),p.jsxs("span",{children:["Points: ",w.length]}),p.jsxs("span",{children:["Distance: ",(A*3.28084).toFixed(0)," ft"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${W?"bg-green-600":q&&q<=20?"bg-amber-500":"bg-red-600"}`}),p.jsxs("span",{children:["Fix ",W?"Good":"Improving",q!=null?` ±${Math.round(q)} m`:""]})]})]}),p.jsxs("div",{className:"mt-3 flex gap-2 items-center",children:[p.jsx("button",{className:"btn-primary",onClick:Wp,children:"Mark Point"}),p.jsx("button",{className:"btn-secondary",onClick:Xp,disabled:w.length===0,children:"Undo"}),p.jsx("button",{className:"btn-secondary",onClick:Ro,disabled:w.length===0,children:"Clear"}),p.jsx("button",{className:"btn-primary",onClick:Yf,disabled:w.length<3,children:"Complete Boundary"}),z&&p.jsx("span",{className:"text-xs text-amber-700 bg-amber-100 px-2 py-1 rounded",children:"Snap to start available"})]}),p.jsx("p",{className:"text-xs text-green-700 mt-2",children:"Walk to each corner, tap Mark Point, then Complete. You can refine points afterward."})]}),v&&p.jsxs("div",{className:"p-4 bg-green-50 border-t",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-green-900",children:[p.jsx("span",{className:"font-semibold",children:"Trace Mode"}),p.jsxs("span",{children:["Points: ",w.length]}),p.jsxs("span",{children:["Distance: ",(A*3.28084).toFixed(0)," ft"]}),p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${W?"bg-green-600":q&&q<=25?"bg-amber-500":"bg-red-600"}`}),p.jsxs("span",{children:["Fix ",W?"Good":"Improving",q!=null?` ±${Math.round(q)} m`:""]})]})]}),p.jsxs("div",{className:"mt-3 flex gap-2 items-center",children:[x?p.jsx("button",{className:"btn-secondary",onClick:()=>{C&&(navigator.geolocation.clearWatch(C),E(null)),S(!1)},children:"Pause"}):p.jsx("button",{className:"btn-primary",onClick:()=>{if(!navigator.geolocation){re.error("GPS not available");return}const U=navigator.geolocation.watchPosition(X=>{const{latitude:mt,longitude:st,accuracy:nt}=X.coords;Q(nt||null),N(St=>{const[Xt,Yt]=Ls(mt,st,nt),Mt=Xf(Xt,Yt,nt,St);if(St.length>=2){const[he,kn]=St[0],fn=wi(he,kn,Xt,Yt);at(fn<=Oo)}else at(!1);if(!Mt)return St;const zt=[...St,Mt];if(zt.length>1){const[he,kn]=zt[zt.length-2];B(fn=>fn+wi(he,kn,Mt[0],Mt[1]))}return zt})},X=>{console.warn("GPS watch error",X==null?void 0:X.message)},{enableHighAccuracy:!0,maximumAge:500,timeout:2e4});E(U),S(!0)},children:"Start"}),p.jsx("button",{className:"btn-secondary",onClick:()=>{C&&(navigator.geolocation.clearWatch(C),E(null)),S(!1),Ro()},disabled:w.length===0,children:"Clear"}),p.jsx("button",{className:"btn-secondary",onClick:()=>{window.confirm("Cancel GPS trace? Unsaved points will be lost.")&&(C&&(navigator.geolocation.clearWatch(C),E(null)),S(!1),y(!1),d(!1),f(!1),Ro())},children:"Cancel"}),p.jsx("button",{className:"btn-primary",onClick:Yf,disabled:w.length<3,children:"Complete Boundary"}),z&&p.jsx("span",{className:"text-xs text-amber-700 bg-amber-100 px-2 py-1 rounded",children:"Snap to start available"})]}),p.jsx("p",{className:"text-xs text-green-700 mt-2",children:"Walk the boundary to trace it. Pause as needed, then Complete to create the area."})]})]})}),p.jsxs("div",{className:"space-y-6",children:[c&&p.jsxs("div",{className:"card",children:[p.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[p.jsx(OR,{className:"h-5 w-5"}),"Section Color"]}),p.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ga.map(U=>p.jsx("button",{onClick:()=>_t(U),className:`w-10 h-10 rounded border-2 ${ht.value===U.value?"border-gray-900":"border-gray-300"}`,style:{backgroundColor:U.value},title:U.name},U.value))})]}),p.jsxs("div",{className:"card",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Property Summary"}),p.jsxs("div",{className:"space-y-2 text-sm",children:[p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{className:"text-gray-600",children:"Total Sections:"}),p.jsx("span",{className:"font-medium",children:i.length})]}),p.jsxs("div",{className:"flex justify-between",children:[p.jsx("span",{className:"text-gray-600",children:"Total Area:"}),p.jsxs("span",{className:"font-medium",children:[Jp().toLocaleString()," sq ft"]})]})]})]}),p.jsxs("div",{className:"card",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Lawn Sections"}),i.length===0?p.jsx("p",{className:"text-gray-500 text-sm",children:"No sections yet."}):p.jsx("div",{className:"space-y-2",children:i.map(U=>p.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:U.color.value}}),p.jsxs("div",{children:[p.jsx("p",{className:"font-medium text-sm",children:U.name}),p.jsxs("p",{className:"text-xs text-gray-600",children:[U.area.toLocaleString()," sq ft"]}),U.grassTypes&&U.grassTypes.length>0||U.grassType?p.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:(U.grassTypes&&U.grassTypes.length>0?U.grassTypes:(U.grassType||"").split(",").map(X=>X.trim()).filter(Boolean)).map((X,mt)=>p.jsx("span",{className:"px-1.5 py-0.5 bg-green-100 text-green-800 rounded text-[10px]",children:X},mt))}):null]})]}),p.jsxs("div",{className:"flex gap-1",children:[p.jsx("button",{onClick:()=>Kf(U),className:"text-blue-600 hover:text-blue-800",children:p.jsx(NR,{className:"h-4 w-4"})}),p.jsx("button",{onClick:()=>Tl(U.id),className:"text-red-600 hover:text-red-800",children:p.jsx(MR,{className:"h-4 w-4"})})]})]},U.id))})]})]})]}),Lt&&p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center",style:{zIndex:9999},children:p.jsxs("div",{className:"bg-white rounded-lg p-6 w-96 max-w-[92vw] shadow-2xl",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Create Lawn Section"}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("button",{className:"w-full px-4 py-3 border rounded hover:bg-gray-50 text-left",onClick:()=>{ct(!1),f(!0),d(!1),y(!1)},children:[p.jsx("div",{className:"font-medium",children:"Tap to Draw (manual)"}),p.jsx("div",{className:"text-xs text-gray-600",children:"Tap the map to add corners, doubletap to finish."})]}),p.jsxs("button",{className:"w-full px-4 py-3 border rounded hover:bg-gray-50 text-left",onClick:()=>{ct(!1),y(!1),S(!1),C&&(navigator.geolocation.clearWatch(C),E(null)),Ro(),d(!0)},children:[p.jsx("div",{className:"font-medium",children:"GPS Points (walk and mark)"}),p.jsx("div",{className:"text-xs text-gray-600",children:"Walk to each corner and tap “Mark Point”, then Complete."})]}),p.jsxs("button",{className:"w-full px-4 py-3 border rounded hover:bg-gray-50 text-left",onClick:()=>{ct(!1),d(!1),Ro(),y(!0)},children:[p.jsx("div",{className:"font-medium",children:"Trace Boundary (continuous)"}),p.jsx("div",{className:"text-xs text-gray-600",children:"Start tracing and walk the perimeter. Pause as needed, then Complete."})]})]}),p.jsx("div",{className:"mt-4 flex justify-end",children:p.jsx("button",{className:"btn-secondary",onClick:()=>ct(!1),children:"Cancel"})})]})}),p.jsxs("div",{className:"mt-8",children:[p.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Recent History"}),gt?p.jsx("div",{className:"card p-4",children:p.jsx("div",{className:"text-gray-600",children:"Loading…"})}):Qu.length===0?p.jsx("div",{className:"card p-4 text-gray-600",children:"No history yet for this property."}):p.jsx("div",{className:"grid gap-4",children:Qu.map(U=>{var nt,St,Xt,Yt,Mt,zt,he,kn,fn,ts,Mo,Ao;if(U.kind==="application"){const hn=U.application,ni=U.log;return p.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex justify-between items-start",children:[p.jsxs("div",{className:"flex-1",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[hn.propertyName," - ",hn.sectionNames]}),p.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-indigo-100 text-indigo-800",children:"Application"})]}),p.jsx("span",{className:`px-3 py-1 text-sm font-medium rounded-full ${hn.status==="archived"?"bg-gray-100 text-gray-800":"bg-green-100 text-green-800"}`,children:hn.status==="archived"?"Archived":"Completed"})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(Kx,{className:"h-4 w-4 mr-2"}),new Date(U.date).toLocaleString()]}),p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(zc,{className:"h-4 w-4 mr-2"}),hn.propertyName]}),p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(mu,{className:"h-4 w-4 mr-2"}),hn.equipmentName]})]}),(ni==null?void 0:ni.gpsTrack)&&p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mb-4",children:[p.jsxs("div",{className:"bg-blue-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-blue-600 font-medium",children:"Duration"}),p.jsxs("div",{className:"text-sm font-bold text-blue-900",children:[Math.round((((nt=ni.gpsTrack)==null?void 0:nt.duration)||0)/60)," min"]})]}),p.jsxs("div",{className:"bg-green-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-green-600 font-medium",children:"GPS Points"}),p.jsx("div",{className:"text-sm font-bold text-green-900",children:((Xt=(St=ni.gpsTrack)==null?void 0:St.points)==null?void 0:Xt.length)||0})]}),p.jsxs("div",{className:"bg-purple-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-purple-600 font-medium",children:"Distance"}),p.jsxs("div",{className:"text-sm font-bold text-purple-900",children:[Math.round(((Yt=ni.gpsTrack)==null?void 0:Yt.totalDistance)||0)," ft"]})]}),p.jsxs("div",{className:"bg-orange-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-orange-600 font-medium",children:"Coverage"}),p.jsxs("div",{className:"text-sm font-bold text-orange-900",children:[Ei(hn,ni),"%"]})]})]})]}),p.jsx("button",{onClick:()=>Et(hn),className:"p-2 text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded",title:"View details",children:p.jsx(zd,{className:"h-5 w-5"})})]})},`app-${hn.id}`)}const X=U.log,mt=Math.round((X.duration_seconds||X.durationSeconds||((Mt=X.gpsTrack)==null?void 0:Mt.duration)||((zt=X.gps_track)==null?void 0:zt.duration)||0)/60),st=Math.round((X.total_distance_meters||((he=X.gpsTrack)==null?void 0:he.totalDistance)||((kn=X.gps_track)==null?void 0:kn.totalDistance)||0)*3.28084||0);return p.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:p.jsxs("div",{className:"flex justify-between items-start",children:[p.jsxs("div",{className:"flex-1",children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:[X.property_name," - ",X.section_names]}),p.jsx("span",{className:"px-2 py-0.5 text-xs rounded-full bg-green-100 text-green-800",children:"Mowing"})]}),p.jsx("span",{className:"px-3 py-1 text-sm font-medium rounded-full bg-green-100 text-green-800",children:"Completed"})]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(Kx,{className:"h-4 w-4 mr-2"}),new Date(U.date).toLocaleString()]}),p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(zc,{className:"h-4 w-4 mr-2"}),X.property_name]}),p.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[p.jsx(mu,{className:"h-4 w-4 mr-2"}),X.equipment_name||"Mower"]})]}),p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 mb-4",children:[p.jsxs("div",{className:"bg-blue-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-blue-600 font-medium",children:"Duration"}),p.jsxs("div",{className:"text-sm font-bold text-blue-900",children:[mt," min"]})]}),p.jsxs("div",{className:"bg-green-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-green-600 font-medium",children:"GPS Points"}),p.jsx("div",{className:"text-sm font-bold text-green-900",children:((ts=(fn=X.gpsTrack)==null?void 0:fn.points)==null?void 0:ts.length)||((Ao=(Mo=X.gps_track)==null?void 0:Mo.points)==null?void 0:Ao.length)||0})]}),p.jsxs("div",{className:"bg-purple-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-purple-600 font-medium",children:"Distance"}),p.jsxs("div",{className:"text-sm font-bold text-purple-900",children:[st," ft"]})]}),p.jsxs("div",{className:"bg-orange-50 p-2 rounded text-center",children:[p.jsx("div",{className:"text-xs text-orange-600 font-medium",children:"Coverage"}),p.jsxs("div",{className:"text-sm font-bold text-orange-900",children:[It(X),"%"]})]})]})]}),p.jsx("button",{onClick:()=>ne(X),className:"p-2 text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50 rounded",title:"View mowing session",children:p.jsx(zd,{className:"h-5 w-5"})})]})},`mow-${X.id}`)})})]}),wt&&p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center",style:{zIndex:9999},children:p.jsxs("div",{className:"bg-white rounded-lg p-6 w-96 shadow-2xl",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Name Your Lawn Section"}),p.jsxs("div",{className:"space-y-4",children:[p.jsx("input",{type:"text",className:"input",value:Ee,onChange:U=>Je(U.target.value),placeholder:"e.g., Front Yard, Back Lawn",autoFocus:!0}),p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:jt==null?void 0:jt.color.value}}),p.jsxs("span",{children:[jt==null?void 0:jt.area.toLocaleString()," sq ft"]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Adjust Position (1 ft)"}),p.jsxs("div",{className:"grid grid-cols-3 gap-2 w-40",children:[p.jsx("div",{}),p.jsx("button",{className:"btn-secondary",onClick:()=>{we(U=>{if(!U)return U;U.coordinates[0][0];const mt=1*.3048/111320,st=U.coordinates.map(([nt,St])=>[nt+mt,St]);return{...U,coordinates:st}})},children:"▲"}),p.jsx("div",{}),p.jsx("button",{className:"btn-secondary",onClick:()=>{we(U=>{if(!U)return U;const X=U.coordinates[0][0],mt=111320*Math.cos(X*Math.PI/180),st=1*.3048/mt,nt=U.coordinates.map(([St,Xt])=>[St,Xt-st]);return{...U,coordinates:nt}})},children:"◀"}),p.jsx("div",{}),p.jsx("button",{className:"btn-secondary",onClick:()=>{we(U=>{if(!U)return U;const X=U.coordinates[0][0],mt=111320*Math.cos(X*Math.PI/180),st=1*.3048/mt,nt=U.coordinates.map(([St,Xt])=>[St,Xt+st]);return{...U,coordinates:nt}})},children:"▶"}),p.jsx("div",{}),p.jsx("button",{className:"btn-secondary",onClick:()=>{we(U=>{if(!U)return U;const X=1*.3048/111320,mt=U.coordinates.map(([st,nt])=>[st-X,nt]);return{...U,coordinates:mt}})},children:"▼"}),p.jsx("div",{})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Grass Types"}),p.jsx(Kw,{value:De,onChange:jr}),p.jsx(Qw,{onPick:U=>jr(X=>X.includes(U)?X:[...X,U])})]})]}),p.jsxs("div",{className:"flex gap-3 mt-6",children:[p.jsx("button",{onClick:Yp,className:"btn-primary flex-1",children:"Save"}),p.jsx("button",{onClick:()=>{Gt(!1),we(null),Je(""),jr([])},className:"btn-secondary flex-1",children:"Cancel"})]})]})}),Ji&&p.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center",style:{zIndex:9999},children:p.jsxs("div",{className:"bg-white rounded-lg p-6 w-96 shadow-2xl",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Edit Lawn Section"}),p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Section Name"}),p.jsx("input",{type:"text",className:"input",value:Ee,onChange:U=>Je(U.target.value),placeholder:"e.g., Front Yard, Back Lawn",autoFocus:!0})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Color"}),p.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ga.map(U=>p.jsx("button",{onClick:()=>_t(U),className:`w-10 h-10 rounded border-2 ${ht.value===U.value?"border-gray-900":"border-gray-300"}`,style:{backgroundColor:U.value},title:U.name},U.value))})]}),p.jsxs("div",{children:[p.jsx("label",{className:"label",children:"Grass Types"}),p.jsx(Kw,{value:cn,onChange:xi}),p.jsx(Qw,{onPick:U=>xi(X=>X.includes(U)?X:[...X,U])})]}),p.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[p.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:ht.value}}),p.jsxs("span",{children:[Nn==null?void 0:Nn.area.toLocaleString()," sq ft"]})]})]}),p.jsxs("div",{className:"flex gap-3 mt-6",children:[p.jsx("button",{onClick:Kp,className:"btn-primary flex-1",children:"Save Changes"}),p.jsx("button",{onClick:()=>{ar(!1),Ke(null),Je(""),xi([])},className:"btn-secondary flex-1",children:"Cancel"})]})]})}),ft&&p.jsx(_D,{application:ft,propertyDetails:n,onClose:()=>Et(null)}),Bt&&p.jsx(xD,{session:Bt,onClose:()=>ne(null)})]})},PD=()=>p.jsx("div",{className:"min-h-screen bg-white flex flex-col justify-center items-center px-4 sm:px-6 lg:px-8",children:p.jsxs("div",{className:"max-w-md w-full space-y-8 text-center",children:[p.jsxs("div",{children:[p.jsx("h1",{className:"text-9xl font-bold text-primary-600",children:"404"}),p.jsx("h2",{className:"mt-6 text-3xl font-bold text-gray-900",children:"Page not found"}),p.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Sorry, we couldn't find the page you're looking for."})]}),p.jsxs("div",{className:"mt-8 space-y-4",children:[p.jsxs(tr,{to:"/dashboard",className:"btn-primary w-full justify-center",children:[p.jsx(qy,{className:"h-5 w-5 mr-2"}),"Go back home"]}),p.jsx(tr,{to:"/properties",className:"btn-outline w-full justify-center",children:"View Properties"})]}),p.jsx("div",{className:"mt-8",children:p.jsx("p",{className:"text-xs text-gray-500",children:"If you believe this is an error, please contact support."})})]})}),bD=()=>p.jsx("div",{className:"min-h-screen bg-white flex flex-col justify-center items-center px-4 sm:px-6 lg:px-8",children:p.jsxs("div",{className:"max-w-md w-full space-y-8 text-center",children:[p.jsxs("div",{children:[p.jsx("div",{className:"mx-auto h-24 w-24 bg-red-100 rounded-full flex items-center justify-center mb-6",children:p.jsx(IR,{className:"h-12 w-12 text-red-600"})}),p.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Access Denied"}),p.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"You don't have permission to access this page. Contact your administrator if you believe this is an error."})]}),p.jsxs("div",{className:"mt-8 space-y-4",children:[p.jsxs(tr,{to:"/dashboard",className:"btn-primary w-full justify-center",children:[p.jsx(qy,{className:"h-5 w-5 mr-2"}),"Go back home"]}),p.jsx(tr,{to:"/profile",className:"btn-outline w-full justify-center",children:"View Profile"})]}),p.jsx("div",{className:"mt-8",children:p.jsx("p",{className:"text-xs text-gray-500",children:"Need help? Contact support for assistance."})})]})}),LD=P.lazy(()=>Yn(()=>import("./Dashboard-DJdwRlmp.js"),[])),ID=P.lazy(()=>Yn(()=>import("./Properties-D9FZPvIV.js"),[])),TD=P.lazy(()=>Yn(()=>import("./Equipment-CTLZqt7C.js"),__vite__mapDeps([0,1]))),OD=P.lazy(()=>Yn(()=>import("./Products-BYbbRN4N.js"),__vite__mapDeps([2,1]))),RD=P.lazy(()=>Yn(()=>import("./Applications-Dk6lLrM6.js"),__vite__mapDeps([3,4]))),MD=P.lazy(()=>Yn(()=>import("./ApplicationPlan-SpihCSnJ.js"),[])),AD=P.lazy(()=>Yn(()=>import("./ApplicationLog-DQD7_Rzv.js"),[])),DD=P.lazy(()=>Yn(()=>import("./History-CLp9SoB2.js"),[])),kD=P.lazy(()=>Yn(()=>import("./Reports-Y1w9L7Me.js").then(e=>e.R),[])),FD=P.lazy(()=>Yn(()=>import("./Weather-BKVvxjXo.js"),[])),jD=P.lazy(()=>Yn(()=>import("./Mowing-B8nXiqFU.js"),__vite__mapDeps([5,4]))),zD=P.lazy(()=>Yn(()=>import("./Watering-LopRVs8A.js"),[])),BD=P.lazy(()=>Yn(()=>import("./Profile-1kT_Rbg4.js"),[])),UD=P.lazy(()=>Yn(()=>import("./AdminDashboard-ZjlQm83Z.js"),__vite__mapDeps([6,7]))),VD=P.lazy(()=>Yn(()=>import("./AdminUsers-DBAyiX-x.js"),__vite__mapDeps([8,1,7,9]))),GD=P.lazy(()=>Yn(()=>import("./AdminProducts-Dw06v4jS.js"),__vite__mapDeps([10,1,11,9]))),qD=P.lazy(()=>Yn(()=>import("./AdminEquipment-I7Ze0qiC.js"),__vite__mapDeps([12,1,11,9]))),HD=P.lazy(()=>Yn(()=>import("./AdminProperties-y-IOfczF.js"),[])),ZD=new w2({defaultOptions:{queries:{retry:(e,t)=>{var n,r;return((n=t==null?void 0:t.response)==null?void 0:n.status)===401||((r=t==null?void 0:t.response)==null?void 0:r.status)===403?!1:e<2},staleTime:0,cacheTime:60*1e3,refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchOnMount:"always"}}}),bn=({children:e,adminOnly:t=!1})=>{const{user:n,loading:r}=qu();return r?p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsx(Hs,{size:"lg"})}):n?t&&n.role!=="admin"?p.jsx(uf,{to:"/unauthorized",replace:!0}):e:p.jsx(uf,{to:"/login",replace:!0})},Bh=({children:e})=>{const{user:t,loading:n}=qu();return n?p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsx(Hs,{size:"lg"})}):t?p.jsx(uf,{to:"/dashboard",replace:!0}):e};function WD(){const e=p.jsx("div",{className:"min-h-screen flex items-center justify-center",children:p.jsx(Hs,{size:"lg"})});return p.jsx(P2,{client:ZD,children:p.jsx(eR,{children:p.jsx(JI,{children:p.jsxs("div",{className:"App",children:[p.jsx(P.Suspense,{fallback:e,children:p.jsxs(qI,{children:[p.jsx(me,{path:"/login",element:p.jsx(Bh,{children:p.jsx(Ah,{children:p.jsx(CM,{})})})}),p.jsx(me,{path:"/register",element:p.jsx(Bh,{children:p.jsx(Ah,{children:p.jsx(NM,{})})})}),p.jsx(me,{path:"/forgot-password",element:p.jsx(Bh,{children:p.jsx(Ah,{children:p.jsx(PM,{})})})}),p.jsx(me,{path:"/reset-password",element:p.jsx(Bh,{children:p.jsx(Ah,{children:p.jsx(bM,{})})})}),p.jsx(me,{path:"/dashboard",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(LD,{})})})}),p.jsx(me,{path:"/properties",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(ID,{})})})}),p.jsx(me,{path:"/properties/:id",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(ND,{})})})}),p.jsx(me,{path:"/equipment",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(TD,{})})})}),p.jsx(me,{path:"/products",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(OD,{})})})}),p.jsx(me,{path:"/applications",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(RD,{})})})}),p.jsx(me,{path:"/applications/plan",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(MD,{})})})}),p.jsx(me,{path:"/applications/log",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(AD,{})})})}),p.jsx(me,{path:"/history",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(DD,{})})})}),p.jsx(me,{path:"/reports",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(kD,{})})})}),p.jsx(me,{path:"/weather",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(FD,{})})})}),p.jsx(me,{path:"/mowing",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(jD,{})})})}),p.jsx(me,{path:"/watering",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(zD,{})})})}),p.jsx(me,{path:"/profile",element:p.jsx(bn,{children:p.jsx(Pn,{children:p.jsx(BD,{})})})}),p.jsx(me,{path:"/admin",element:p.jsx(bn,{adminOnly:!0,children:p.jsx(Pn,{children:p.jsx(UD,{})})})}),p.jsx(me,{path:"/admin/users",element:p.jsx(bn,{adminOnly:!0,children:p.jsx(Pn,{children:p.jsx(VD,{})})})}),p.jsx(me,{path:"/admin/products",element:p.jsx(bn,{adminOnly:!0,children:p.jsx(Pn,{children:p.jsx(GD,{})})})}),p.jsx(me,{path:"/admin/equipment",element:p.jsx(bn,{adminOnly:!0,children:p.jsx(Pn,{children:p.jsx(qD,{})})})}),p.jsx(me,{path:"/admin/properties",element:p.jsx(bn,{adminOnly:!0,children:p.jsx(Pn,{children:p.jsx(HD,{})})})}),p.jsx(me,{path:"/unauthorized",element:p.jsx(bD,{})}),p.jsx(me,{path:"/404",element:p.jsx(PD,{})}),p.jsx(me,{path:"/",element:p.jsx(uf,{to:"/dashboard",replace:!0})}),p.jsx(me,{path:"*",element:p.jsx(uf,{to:"/404",replace:!0})})]})}),p.jsx(pT,{position:"top-right",toastOptions:{duration:4e3,style:{background:"#fff",color:"#374151",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",borderRadius:"0.5rem",border:"1px solid #e5e7eb"},success:{iconTheme:{primary:"#10b981",secondary:"#fff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#fff"}}}})]})})})})}const XD=dm.createRoot(document.getElementById("root"));XD.render(p.jsx(ye.StrictMode,{children:p.jsx(WD,{})}));const Jw=document.getElementById("loading-indicator");Jw&&setTimeout(()=>{Jw.style.display="none"},500);export{Qy as $,_k as A,NN as B,Hy as C,ba as D,La as E,Jx as F,_D as G,pR as H,Kx as I,xD as J,wk as K,Hs as L,LC as M,uf as N,oC as O,Sv as P,UM as Q,ye as R,lD as S,IC as T,Ap as U,cD as V,fD as W,MC as X,PC as Y,Ff as Z,Yn as _,fR as a,xk as a0,Vd as a1,sd as a2,$y as a3,Ek as a4,YD as a5,$w as a6,EP as a7,mu as b,yv as c,uC as d,tr as e,bR as f,Qx as g,gk as h,jc as i,p as j,bC as k,$a as l,aC as m,Fr as n,zc as o,Za as p,NR as q,P as r,MR as s,mk as t,qu as u,zd as v,KO as w,vk as x,yk as y,re as z};