@skypath-io/web-sdk 0.4.20 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/bundle.cjs.js +2 -2
- package/dist/bundle.es.js +2 -2
- package/dist/bundle.iife.js +2 -2
- package/dist/types/src/core/auth/consts.d.ts +0 -5
- package/dist/types/src/core/flow/consts.d.ts +12 -0
- package/dist/types/src/core/geo/geo.d.ts +119 -53
- package/dist/types/src/core/utils/utils.d.ts +72 -20
- package/dist/types/src/features/adsb/consts.d.ts +0 -9
- package/dist/types/src/features/adsb/utils.d.ts +0 -1
- package/dist/types/src/features/nowcasting/consts.d.ts +0 -1
- package/dist/types/src/features/observations/consts.d.ts +0 -21
- package/dist/types/src/features/observations/utils.d.ts +0 -1
- package/dist/types/src/features/oneLayer/consts.d.ts +6 -40
- package/package.json +3 -3
package/dist/bundle.iife.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @skypath-io/web-sdk v0.4.
|
|
2
|
+
* @skypath-io/web-sdk v0.4.22
|
|
3
3
|
* SkyPath JavaScript SDK for Web
|
|
4
4
|
* (c) 2025 SkyPath LTD
|
|
5
5
|
*/
|
|
6
|
-
var SkyPathSDK=function(t){"use strict";const e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},n=console,r={};Object.keys(e).forEach((t=>{r[t]=n[t]}));const A="Datadog Browser SDK:",i={debug:r.debug.bind(n,A),log:r.log.bind(n,A),info:r.info.bind(n,A),warn:r.warn.bind(n,A),error:r.error.bind(n,A)},o="https://docs.datadoghq.com",s=`${o}/real_user_monitoring/browser/troubleshooting`,a="More details:";function u(t,e){return(...n)=>{try{return t(...n)}catch(t){i.error(e,t)}}}function c(t){return 0!==t&&100*Math.random()<=t}const l=1e3,f=60*l,h=60*f,p=365*(24*h);function d(){return(new Date).getTime()}function g(){return d()}function y(){return performance.now()}function _(){return{relative:y(),timeStamp:g()}}let m;function v(){return void 0===m&&(m=performance.timing.navigationStart),m}const E=1024,w=1024*E,b=/[^\u0000-\u007F]/;function I(t){return b.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function C(t,e){return Object.keys(t).some((n=>t[n]===e))}function x(t){return 0===Object.keys(t).length}function N(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function S(t,e){const n=N();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let D,L=!1;function T(t){L=t}function M(t){return function(){return O(t,this,arguments)}}function O(t,e,n){try{return t.apply(e,n)}catch(t){!function(t){if(R(t),D)try{D(t)}catch(t){R(t)}}(t)}}function R(...t){L&&i.error("[MONITOR]",...t)}function P(t,e){return S(N(),"setTimeout")(M(t),e)}function k(t){S(N(),"clearTimeout")(t)}function B(t,e){return S(N(),"setInterval")(M(t),e)}function F(t){S(N(),"clearInterval")(t)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function U(...t){return new G((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function Q(t,e,n){let r,A,i=!1;return{throttled:(...n)=>{i?r=n:(t(...n),i=!0,A=P((()=>{r&&t(...r),i=!1,r=void 0}),e))},cancel:()=>{k(A),i=!1,r=void 0}}}function z(){}function V(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,V)}const q=/([\w-]+)\s*=\s*([^;]+)/g;function Y(t,e,n=""){const r=t.charCodeAt(e-1),A=r>=55296&&r<=56319?e+1:e;return t.length<=A?t:`${t.slice(0,A)}${n}`}function j(){return 0===(null!=H?H:H=function(t=window){var e;const n=t.navigator.userAgent;return t.chrome||/HeadlessChrome/.test(n)?0:0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}())}let H,X,$;function W(t,e,n=0,r){const A=new Date;A.setTime(A.getTime()+n);const i=`expires=${A.toUTCString()}`,o=r&&r.crossSite?"none":"strict",s=r&&r.domain?`;domain=${r.domain}`:"",a=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${o}${s}${a}${u}`}function K(t){return function(t,e){for(q.lastIndex=0;;){const n=q.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function Z(t){return X||(X=function(t){const e=new Map;for(q.lastIndex=0;;){const n=q.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),X.get(t)}function J(t,e){W(t,"",0,e)}const tt="_dd_s";function et(t){return Object.values(t)}function nt(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function rt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const At=4*h,it=15*f,ot=p,st={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},at=/^([a-zA-Z]+)=([a-z0-9-]+)$/,ut="&";const ct="1";function lt(t,e){const n={isExpired:ct};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function ft(t){return x(t)}function ht(t){return!ft(t)}function pt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||d()-Number(e.created)<At)&&(void 0===e.expire||d()<Number(e.expire)));var e}function dt(t){t.expire=String(d()+it)}function gt(t){return(e=t,Object.entries(e)).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join(ut);var e}function yt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf(ut)||at.test(t))}(t)&&t.split(ut).forEach((t=>{const n=at.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}const _t="_dd",mt="_dd_r",vt="_dd_l",Et="rum",wt="logs";function bt(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===$){const t=`dd_site_test_${V()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!K(t);)r=`${n.pop()}.${r}`,W(t,e,l,{domain:r});J(t,{domain:r}),$=r}return $}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${V()}`,n="test";W(e,n,f,t);const r=K(e)===n;return J(e,t),r}catch(t){return i.error(t),!1}}(e)?{type:st.COOKIE,cookieOptions:e}:void 0}function It(t,e){const n={isLockEnabled:j(),persistSession:(r=e,t=>{W(tt,gt(t),it,r)}),retrieveSession:Ct,expireSession:n=>function(t,e,n){const r=lt(e,n);W(tt,gt(r),n.trackAnonymousUser?ot:At,t)}(e,n,t)};var r;return function(t){if(!Z(tt)){const e=Z(_t),n=Z(mt),r=Z(vt),A={};e&&(A.id=e),r&&/^[01]$/.test(r)&&(A[wt]=r),n&&/^[012]$/.test(n)&&(A[Et]=n),ht(A)&&(dt(A),t.persistSession(A))}}(n),n}function Ct(){return yt(K(tt))}const xt="_dd_test_";function Nt(){try{const t=V(),e=`${xt}${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:st.LOCAL_STORAGE}:void 0}catch(t){return}}function St(t){return{isLockEnabled:!1,persistSession:Dt,retrieveSession:Lt,expireSession:e=>function(t,e){Dt(lt(t,e))}(e,t)}}function Dt(t){localStorage.setItem(tt,gt(t))}function Lt(){return yt(localStorage.getItem(tt))}const Tt=10,Mt=100,Ot=[];let Rt;function Pt(t,e,n=0){var r;const{isLockEnabled:A,persistSession:i,expireSession:o}=e,s=t=>i({...t,lock:u}),a=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Rt||(Rt=t),t!==Rt)return void Ot.push(t);if(A&&n>=Mt)return void Bt(e);let u,c=a();if(A){if(c.lock)return void kt(t,e,n);if(u=V(),s(c.session),c=a(),c.lock!==u)return void kt(t,e,n)}let l=t.process(c.session);if(A&&(c=a(),c.lock!==u))kt(t,e,n);else{if(l&&(pt(l)?o(l):(dt(l),A?s(l):i(l))),A&&(!l||!pt(l))){if(c=a(),c.lock!==u)return void kt(t,e,n);i(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),Bt(e)}}function kt(t,e,n){P((()=>{Pt(t,e,n+1)}),Tt)}function Bt(t){Rt=void 0;const e=Ot.shift();e&&Pt(e,t)}const Ft=l;function Gt(t){switch(t.sessionPersistence){case st.COOKIE:return bt(t);case st.LOCAL_STORAGE:return Nt();case void 0:{let e=bt(t);return!e&&t.allowFallbackToLocalStorage&&(e=Nt()),e}default:i.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Ut(t,e,n,r){const A=new G,i=new G,o=new G,s=t.type===st.COOKIE?It(e,t.cookieOptions):St(e),{expireSession:a}=s,u=B((function(){Pt({process:t=>pt(t)?lt(t,e):void 0,after:h},s)}),Ft);let c;p();const{throttled:l,cancel:f}=Q((()=>{Pt({process:t=>{if(ft(t))return;const e=h(t);return function(t){if(ft(t))return!1;const{trackingType:e,isTracked:A}=r(t[n]);t[n]=e,delete t.isExpired,A&&!t.id&&(t.id=V(),t.created=String(d()))}(e),e},after:t=>{ht(t)&&!g()&&function(t){c=t,A.notify()}(t),c=t}},s)}),Ft);function h(t){return pt(t)&&(t=lt(t,e)),g()&&(!function(t){return c.id!==t.id||c[n]!==t[n]}(t)?(o.notify({previousState:c,newState:t}),c=t):(c=lt(c,e),i.notify())),t}function p(){Pt({process:t=>{if(ft(t))return lt(t,e)},after:t=>{c=t}},s)}function g(){return void 0!==c[n]}return{expandOrRenewSession:l,expandSession:function(){Pt({process:t=>g()?h(t):void 0},s)},getSession:()=>c,renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o,restartSession:p,expire:()=>{f(),a(c),h(lt(c,e))},stop:()=>{F(u)},updateSessionState:function(t){Pt({process:e=>({...e,...t}),after:h},s)}}}const Qt={GRANTED:"granted",NOT_GRANTED:"not-granted"};function zt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=Vt(Object.prototype),A=Vt(Array.prototype),i=Vt(Object.getPrototypeOf(t)),o=Vt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),A(),i(),o()}}function Vt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):z}function qt(t){return function(t,e){const n=function(){if(void 0===jt)try{const t=new Yt("http://test/path");jt="http://test/path"===t.href}catch(t){jt=!1}return jt?Yt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${zt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const A=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(A)}return A.href=t,A}(t,location.href).href}const Yt=URL;let jt;const Ht="datad0g.com",Xt="dd0g-gov.com",$t="datadoghq.com",Wt="pci.browser-intake-datadoghq.com",Kt=["ddsource","ddtags"];function Zt(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=qt(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const A=function(t,e){const{site:n=$t,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===$t)return Wt;if(r&&n===$t)return`${r}.${$t}`;if(n===Xt)return`http-intake.logs.${n}`;const A=n.split("."),i=A.pop();return`browser-intake-${A.join("-")}.${i}`}(e,t);return t=>`https://${A}${n}?${t}`}(t,e);return{build(A,i){const o=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,A,{retry:i,encoding:o}){const s=["sdk_version:6.0.0",`api:${A}`].concat(r);i&&s.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const a=["ddsource=browser",`ddtags=${encodeURIComponent(s.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${V()}`];o&&a.push(`dd-evp-encoding=${o}`);"rum"===n&&a.push(`batch_time=${g()}`);e&&a.reverse();return a.join("&")}(t,e,n,A,i);return r(o)},urlPrefix:r(""),trackType:e}}const Jt=200;function te(t,e){const n=Jt-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&i.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${a} ${o}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function ee(t){const e=t.site||$t,n=function(t){const{env:e,service:n,version:r,datacenter:A}=t,i=[];return e&&i.push(te("env",e)),n&&i.push(te("service",n)),r&&i.push(te("version",r)),A&&i.push(te("datacenter",A)),i}(t),r=function(t,e){return{logsEndpointBuilder:Zt(t,"logs",e),rumEndpointBuilder:Zt(t,"rum",e),sessionReplayEndpointBuilder:Zt(t,"replay",e)}}(t,n),A=function(t,e){if(!t.replica)return;const n={...t,site:$t,clientToken:t.replica.clientToken},r={logsEndpointBuilder:Zt(n,"logs",e),rumEndpointBuilder:Zt(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:A,site:e,...r}}function ne(t,e){return null==t||"string"==typeof t||(i.error(`${e} must be defined as a string`),!1)}function re(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(i.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function Ae(t){var e,n,r,A,s,c;if(t&&t.clientToken){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(i.error(`Site should be a valid Datadog site. ${a} ${o}/getting_started/site/.`),0))&&re(t.sessionSampleRate,"Session")&&re(t.telemetrySampleRate,"Telemetry")&&re(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&re(t.telemetryUsageSampleRate,"Telemetry Usage")&&ne(t.version,"Version")&&ne(t.env,"Env")&&ne(t.service,"Service")){var f;if(void 0===t.trackingConsent||C(Qt,t.trackingConsent))return{beforeSend:t.beforeSend&&u(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Gt(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(A=t.telemetryUsageSampleRate)&&void 0!==A?A:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(s=t.trackingConsent)&&void 0!==s?s:Qt.GRANTED,trackAnonymousUser:null===(c=t.trackAnonymousUser)||void 0===c||c,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*l,batchMessagesLimit:50,messageBytesLimit:256*E,...ee(t)};i.error('Tracking Consent should be either "granted" or "not-granted"')}}else i.error("Client Token is not configured, we will not send any data.")}var ie;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ie||(ie={}));const oe=new Set;function se(t){Array.isArray(t)&&t.filter((t=>C(ie,t))).forEach((t=>{oe.add(t)}))}function ae(){return oe}const ue="?";function ce(t){const e=[];let n=me(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=he.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),A=pe.exec(e[2]);r&&A&&(e[2]=A[1],e[3]=A[2],e[4]=A[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||ue,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=de.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:ue,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=ge.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||ue,line:+e[3],url:e[2]}}(t)||function(t){const e=ye.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=_e.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||ue,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=ue),e.push(n))})),{message:me(t,"message"),name:me(t,"name"),stack:e}}const le="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",he=new RegExp(`^\\s*at (.*?) ?\\(${le}${fe}?${fe}?\\)?\\s*$`,"i"),pe=new RegExp(`\\((\\S*)${fe}${fe}\\)`);const de=new RegExp(`^\\s*at ?${le}${fe}?${fe}??\\s*$`,"i");const ge=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const ye=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,_e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function me(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function ve(t,e,n,r){const A=[{url:e,column:r,line:n}],{name:i,message:o}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=Ee.exec(t));return{name:e,message:n}}(t);return{name:i,message:o,stack:A}}const Ee=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function we(){const t=new Error;let e;return O((()=>{const n=ce(t);n.stack=n.stack.slice(2),e=be(n)})),e}function be(t){let e=Ie(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",A=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${A}${i}`})),e}function Ie(t){return`${t.name||"Error"}: ${t.message}`}function Ce(t,e,n,{computeHandlingStack:r}={}){let A=t[e];if("function"!=typeof A){if(!(e in t)||!e.startsWith("on"))return{stop:z};A=z}let i=!1;const o=function(){if(i)return A.apply(this,arguments);const t=Array.from(arguments);let e;O(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?we():void 0}]);const o=A.apply(this,t);return e&&O(e,null,[o]),o};return t[e]=o,{stop:()=>{i=!0,t[e]===o&&(t[e]=A)}}}const xe=220*E,Ne="$",Se=3;function De(t,e=xe){const n=Vt(Object.prototype),r=Vt(Array.prototype),A=[],i=new WeakMap,o=Le(t,Ne,void 0,A,i),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;A.length>0&&a<e;){const n=A.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=Le(n.source[o],n.path,o,A,i);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){Me(e,"truncated",t);break}n.target[o]=s}else for(const o in n.source)if(Object.prototype.hasOwnProperty.call(n.source,o)){const s=Le(n.source[o],n.path,o,A,i);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+Se,r=1),a>e){Me(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}Me(e,"discarded",t)}function Le(t,e,n,r,A){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const o=Te(i);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(A.has(s))return`[Reference seen at ${A.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return A.set(s,a),r.push({source:i,target:u,path:a}),u}function Te(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Te(e.currentTarget):null,target:e.target?Te(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function Me(t,e,n){i.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Oe="No stack, consider using an instance of Error";function Re({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:A,source:i,handling:o}){const s=ke(e),a=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${zt(De(r))}`}(t,s,A,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(s,t)?be(t):Oe,c=s?Be(e,i):void 0;return{startClocks:r,source:i,handling:o,handlingStack:n,originalError:e,type:t?t.name:void 0,message:a,stack:u,causes:c,fingerprint:Pe(e)}}function Pe(t){return ke(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function ke(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Be(t,e){let n=t;const r=[];for(;ke(null==n?void 0:n.cause)&&r.length<10;){const t=ce(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&be(t)}),n=n.cause}return r.length?r:void 0}const Fe={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Ge(t){const e=(e,n)=>{const r=Re({stackTrace:e,originalError:n,startClocks:_(),nonErrorPrefix:"Uncaught",source:Fe.SOURCE,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ce(window,"onerror",(({parameters:[t,e,n,A,i]})=>{let o;o=ke(i)?ce(i):ve(t,e,n,A),r(o,null!=i?i:t)})));var r;const{stop:A}=function(t){return Ce(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=ce(n);t(r,n)}))}(e);return{stop:()=>{n(),A()}}}function Ue(t,e){e.silentMultipleInit||i.error(`${t} is already initialized.`)}function Qe(t,e,n,r,A){return ze(t,e,[n],r,A)}function ze(t,e,n,r,{once:A,capture:i,passive:o}={}){const s=M((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(A&&l(),r(e))})),a=o?{capture:i,passive:o}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=S(u,"addEventListener");function l(){const t=S(u,"removeEventListener");n.forEach((n=>t.call(e,n,s,a)))}return n.forEach((t=>c.call(e,t,s,a))),{stop:l}}const Ve={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function qe(t,e){const n=[];e.includes(Ve.cspViolation)&&n.push(function(t){return new G((e=>{const{stop:n}=Qe(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return Ye({type:t.effectiveDirective,message:`${Ve.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:je(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${Y(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ve.cspViolation));return r.length&&n.push(function(t){return new G((e=>{if(!window.ReportingObserver)return;const n=M(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return Ye({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:je(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),U(...n)}function Ye(t){return{startClocks:_(),source:Fe.REPORT,handling:"unhandled",...t}}function je(t,e,n,r,A){return n?be({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=A?A:void 0}]}):void 0}function He(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function Xe(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=Xe(r[t],e[t],n);return r}const r="object"===nt(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=Xe(r[t],e[t],n));return r}function $e(t){return Xe(void 0,t)}function We(...t){let e;for(const n of t)null!=n&&(e=Xe(e,n));return e}function Ke(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function Ze(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const Je=500;function tn(){const t=[];return{add:e=>{t.push(e)>Je&&t.splice(0,1)},remove:e=>{Ze(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const en={log:"log",configuration:"configuration",usage:"usage"},nn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],rn=["ddog-gov.com"];let An=tn(),on=t=>{An.add((()=>on(t)))};function sn(t,e){let n;const r=new G,A=new Set,i=!rn.includes(e.site)&&c(e.telemetrySampleRate),o={[en.log]:i,[en.configuration]:i&&c(e.telemetryConfigurationSampleRate),[en.usage]:i&&c(e.telemetryUsageSampleRate)},s={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return on=i=>{const a=zt(i);if(o[i.type]&&A.size<e.maxTelemetryEventsPerPage&&!A.has(a)){const e=function(t,e,r){return We({type:"telemetry",date:g(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:We(e,{runtime_env:r,connectivity:Ke(),sdk_setup:"npm"}),experimental_features:Array.from(ae())},void 0!==n?n():{})}(t,i,s);r.notify(e),He("telemetry",e),A.add(a)}},D=un,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function an(t,n){R(e.debug,t,n),on({type:en.log,message:t,status:"debug",...n})}function un(t,e){on({type:en.log,status:"error",...cn(t),...e})}function cn(t){if(ke(t)){const e=ce(t);return{error:{kind:e.name,stack:be(ln(e))},message:e.message}}return{error:{stack:Oe},message:`Uncaught ${zt(t)}`}}function ln(t){return t.stack=t.stack.filter((t=>!t.url||nn.some((e=>t.url.startsWith(e))))),t}const fn=1/0,hn=f;function pn({expireDelay:t,maxEntries:e}){let n=[];const r=B((()=>function(){const e=y()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),hn);return{add:function(t,r){const A={value:t,startTime:r,endTime:fn,remove:()=>{Ze(n,A)},close:t=>{A.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(A),A},find:function(t=fn,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===fn&&e.close(t)},findAll:function(t=fn,e=0){const r=t+e;return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){F(r)}}}const dn=f,gn=At;function yn(t,e,n,r){const A=new G,i=new G,o=Ut(t.sessionStoreStrategyType,t,e,n),s=pn({expireDelay:gn});function a(){return{id:o.getSession().id,trackingType:o.getSession()[e],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return o.renewObservable.subscribe((()=>{s.add(a(),y()),A.notify()})),o.expireObservable.subscribe((()=>{i.notify(),s.closeActive(y())})),o.expandOrRenewSession(),s.add(a(),[0,v()][0]),r.observable.subscribe((()=>{r.isGranted()?o.expandOrRenewSession():o.expire()})),function(t,e){ze(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&o.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()};Qe(t,document,"visibilitychange",n),B(n,dn)}(t,(()=>o.expandSession())),function(t,e){Qe(t,window,"resume",e,{capture:!0})}(t,(()=>o.restartSession())),{findSession:(t,e)=>s.find(t,e),renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function _n(t){return t>=500}const mn=80*E,vn=32,En=3*w,wn=f,bn=l;function In(t,e,n,r,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?xn(t,e,n,{onSuccess:()=>Nn(0,e,n,r,A),onFailure:()=>{e.queuedPayloads.enqueue(t),Cn(e,n,r,A)}}):e.queuedPayloads.enqueue(t)}function Cn(t,e,n,r){2===t.transportStatus&&P((()=>{xn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=bn,Nn(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(wn,2*t.currentBackoffTime),Cn(t,e,n,r)}})}),t.currentBackoffTime)}function xn(t,e,n,{onSuccess:r,onFailure:A}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||_n(t.status))}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},A())}))}function Nn(t,e,n,r,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(A({message:`Reached max ${r} events size queued for upload: ${En/w}MiB`,source:Fe.AGENT,startClocks:_()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Sn();i.size()>0;)In(i.dequeue(),e,n,r,A)}function Sn(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=En}}}function Dn(t,e,n){const r={transportStatus:0,currentBackoffTime:bn,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=mn&&this.ongoingRequestCount<vn},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Sn(),queueFullReported:!1},A=(n,r)=>function(t,e,n,r){const A=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(A){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(M((t=>null==r?void 0:r({status:t.status,type:t.type}))),M((()=>{Tn(t.build("xhr",n),n.data,r)})))}else{Tn(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{In(e,r,A,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Ln||(Ln=!0,un(t))}(t)}const A=t.build("xhr",n);Tn(A,n.data)}(t,e,n)}}}let Ln=!1;function Tn(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Qe({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Mn(){const t=N().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const A=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:A}))}}}function On(t){var e;void 0===t&&(t=null===(e=N().location)||void 0===e?void 0:e.hostname);const n=Mn();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Rn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Pn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let A={};const o=n.flushObservable.subscribe((n=>function(n){const r=et(A).join("\n");A={};const i=(s=n.reason,et(Rn).includes(s)),o=i?e.sendOnExit:e.send;var s;if(i&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(kn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&o({data:n,bytesCount:I(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{o(kn(t))}))}(n)));function u(e,o){const u=zt(e),c=t.estimateEncodedBytesCount(u);c>=r?i.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==A[t]}(o)&&function(e){const r=A[e];delete A[e];const i=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(i)}(o),function(e,r,i){n.notifyBeforeAddMessage(r),void 0!==i?(A[i]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,c,o))}return{flushController:n,add:u,upsert:u,stop:o.unsubscribe}}function kn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function Bn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:A}){const i=r.subscribe((t=>l(t.reason))),o=A.subscribe((()=>l("session_expire"))),s=new G((()=>()=>{i.unsubscribe(),o.unsubscribe()}));let a,u=0,c=0;function l(t){if(0===c)return;const e=c,n=u;c=0,u=0,f(),s.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){k(a),a=void 0}return{flushObservable:s,get messagesCount(){return c},notifyBeforeAddMessage(t){u+t>=e&&l("bytes_limit"),c+=1,u+=t,void 0===a&&(a=P((()=>{l("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,c>=t?l("messages_limit"):u>=e&&l("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,c-=1,0===c&&f()}}}function Fn(t,e,n,r,A,i,o=Pn){const s=u(t,e),a=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return o({encoder:n,request:Dn(e,t.batchBytesLimit,r),flushController:Bn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:A,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add(t,e=!0){s.add(t),a&&e&&a.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{s.upsert(t,e),a&&a.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{s.stop(),a&&a.stop()}}}function Gn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const A=I(n);e+=A,t+=n,r&&r(A)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}let Un;const Qn=new WeakMap;function zn(t){return Un||(Un=function(t){return new G((e=>{const{stop:n}=Ce(XMLHttpRequest.prototype,"open",Vn),{stop:r}=Ce(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const A=Qn.get(t);if(!A)return;const i=A;i.state="start",i.startClocks=_(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let o=!1;const{stop:s}=Ce(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&a()})),a=()=>{if(u(),s(),o)return;o=!0;const e=A;var n,a;e.state="complete",e.duration=(n=i.startClocks.timeStamp,g()-n),e.status=t.status,r.notify((a=e,{...a}))},{stop:u}=Qe(n,t,"loadend",a);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:A}=Ce(XMLHttpRequest.prototype,"abort",qn);return()=>{n(),r(),A()}}))}(t)),Un}function Vn({target:t,parameters:[e,n]}){Qn.set(t,{state:"open",method:String(e).toUpperCase(),url:qt(String(n))})}function qn({target:t}){const e=Qn.get(t);e&&(e.isAborted=!0)}let Yn;function jn(){return Yn||(Yn=new G((t=>{if(!window.fetch)return;const{stop:e}=Ce(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[A,i]=t;let o=i&&i.method;void 0===o&&A instanceof Request&&(o=A.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=A instanceof Request?A.url:qt(String(A)),u=_(),c={state:"start",init:i,input:A,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e((t=>function(t,e,n){const r=n;function A(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(M((t=>{A({response:t,responseType:t.type,status:t.status,isAborted:!1})})),M((t=>{var e,n;A({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,c)))}(e,t)),{computeHandlingStack:!0});return e}))),Yn}let Hn={};function Xn(t){return U(...t.map((t=>(Hn[t]||(Hn[t]=function(t){return new G((r=>{const A=n[t];return n[t]=(...n)=>{A.apply(console,n);const i=we();O((()=>{r.notify(function(t,n,r){const A=t.map((t=>function(t){if("string"==typeof t)return De(t);if(ke(t))return Ie(ce(t));return zt(De(t),void 0,2)}(t))).join(" ");let i;if(n===e.error){const e=t.find(ke);i={stack:e?be(ce(e)):void 0,fingerprint:Pe(e),causes:e?Be(e,"console"):void 0,startClocks:_(),message:A,source:Fe.CONSOLE,handling:"handled",handlingStack:r}}return{api:n,message:A,error:i,handlingStack:r}}(n,t,i))}))},()=>{n[t]=A}}))}(t)),Hn[t]))))}function $n(t){let e={};const n=new G,r={getContext:()=>$e(e),setContext:A=>{"object"===nt(A)?(e=De(A),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,A)=>{e[r]=De(A),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const Wn="_dd_c",Kn=[];function Zn(t,e,n,r){const A=function(t,e){return`${Wn}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(A);return null!==t?JSON.parse(t):{}}Kn.push(Qe(t,window,"storage",(({key:t})=>{A===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(A,JSON.stringify(e.getContext()))})),e.setContext(We(i(),e.getContext()))}const Jn=3*E,tr=16*E,er=200;function nr(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const A=2===t?Jn:tr;let o=r;e.forEach((t=>{o+=t.getBytesCount()})),o>A&&(!function(t){i.warn(`Customer data exceeds the recommended ${t/E}KiB threshold. ${a} ${s}/#customer-data-exceeds-the-recommended-threshold-warning`)}(A),n=!0)}return{createDetachedTracker:()=>{const t=rr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,rr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function rr(t){let e=0;const{throttled:n,cancel:r}=Q((n=>{e=I(zt(n)),t()}),er),A=()=>{r(),e=0};return{updateCustomerData:t=>{x(t)?A():n(t)},resetCustomerData:A,getBytesCount:()=>e,stop:()=>{r()}}}const Ar="datadog-synthetics-public-id",ir="datadog-synthetics-result-id",or="datadog-synthetics-injects-rum";function sr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Z(or))}function ar(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Z(Ar);return"string"==typeof t?t:void 0}function ur(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||Z(ir);return"string"==typeof t?t:void 0}function cr(t,e,n){const r=n.getHandler(),A=Array.isArray(r)?r:[r];return fr[t]>=fr[n.getLevel()]&&A.includes(e)}const lr={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},fr={[lr.ok]:0,[lr.debug]:1,[lr.info]:2,[lr.notice]:4,[lr.warn]:5,[lr.error]:6,[lr.critical]:7,[lr.alert]:8,[lr.emerg]:9};function hr(t,{includeMessage:e=!1}={}){return{stack:t.stack,kind:t.type,message:e?t.message:void 0,causes:t.causes,fingerprint:t.fingerprint,handling:t.handling}}var pr=function(t,e,n,r){var A,i=arguments.length,o=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(A=t[s])&&(o=(i<3?A(o):i>3?A(e,n,o):A(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const dr={console:"console",http:"http",silent:"silent"},gr=Object.keys(lr);class yr{constructor(t,e,n,r=dr.http,A=lr.debug,i={}){this.handleLogStrategy=t,this.handlerType=r,this.level=A,this.contextManager=$n(e),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}logImplementation(t,e,n=lr.info,r,A){const i=De(e);let o;if(null!=r){o=We({error:hr(Re({stackTrace:ke(r)?ce(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Fe.LOGGER,handling:"handled",startClocks:_()}),{includeMessage:!0})},i)}else o=i;this.handleLogStrategy({message:De(t),context:o,status:n},this,A)}log(t,e,n=lr.info,r){let A;cr(n,dr.http,this)&&(A=we()),this.logImplementation(t,e,n,r,A)}setContext(t){this.contextManager.setContext(t)}getContext(){return this.contextManager.getContext()}setContextProperty(t,e){this.contextManager.setContextProperty(t,e)}removeContextProperty(t){this.contextManager.removeContextProperty(t)}clearContext(){this.contextManager.clearContext()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function _r(t){return function(e,n,r){let A;cr(t,dr.http,this)&&(A=we()),this.logImplementation(e,n,t,r,A)}}pr([function(t,e,n){const r=n.value;n.value=function(...t){return(D?M(r):r).apply(this,t)}}],yr.prototype,"logImplementation",null),yr.prototype.ok=_r(lr.ok),yr.prototype.debug=_r(lr.debug),yr.prototype.info=_r(lr.info),yr.prototype.notice=_r(lr.notice),yr.prototype.warn=_r(lr.warn),yr.prototype.error=_r(lr.error),yr.prototype.critical=_r(lr.critical),yr.prototype.alert=_r(lr.alert),yr.prototype.emerg=_r(lr.emerg);const mr=32*E;function vr(t,e,n){return void 0===t?[]:"all"===t||Array.isArray(t)&&t.every((t=>e.includes(t)))?"all"===t?e:function(t){const e=new Set;return t.forEach((t=>e.add(t))),Array.from(e)}(t):void i.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function Er(t,n,r){const A=tn();let o,s;const a=n.observable.subscribe(u);function u(){if(!s||!o||!n.isGranted())return;a.unsubscribe();const t=r(o,s);A.drain(t)}return{init(t){if(!t)return void i.error("Missing configuration");if(se(t.enableExperimentalFeatures),On()&&(t=function(t){return{...t,clientToken:"empty"}}(t)),o=t,s)return void Ue("DD_LOGS",t);const r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&i.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=Ae(t),r=vr(t.forwardConsoleLogs,et(e),"Forward Console Logs"),A=vr(t.forwardReports,et(Ve),"Forward Reports");if(n&&r&&A)return t.forwardErrorsToLogs&&!r.includes(e.error)&&r.push(e.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:A,requestErrorResponseLengthLimit:mr,...n}}(t);r&&(s=r,jn().subscribe(z),n.tryToInit(r.trackingConsent),u())},get initConfiguration(){return o},getInternalContext:z,handleLog(e,n,r,i=t(),o=g()){A.add((t=>t.handleLog(e,n,r,i,o)))}}}const wr="logs";const br="logs";function Ir(t,e){const n=yn(t,br,(e=>function(t,e){const n=function(t){return"0"===t||"1"===t}(e)?e:Cr(t);return{trackingType:n,isTracked:"1"===n}}(t,e)),e);return{findTrackedSession:(t,e={returnInactive:!1})=>{const r=n.findSession(t,e);return r&&"1"===r.trackingType?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}function Cr(t){return c(t.sessionSampleRate)?"1":"0"}let xr=!1;function Nr(t){const e=window;if(sr()){const t=n(e.DD_RUM_SYNTHETICS);return t||xr||(xr=!0,an("Logs sent before RUM is injected by the synthetics worker",{testId:ar(),resultId:ur()})),t}return n(e.DD_RUM);function n(e){if(e&&e.getInternalContext)return e.getInternalContext(t)}}function Sr(t,e,n,r,A){const i=gr.concat(["custom"]),o={};i.forEach((t=>{o[t]=function(t,e,n){let r=0,A=!1;return{isLimitReached(){if(0===r&&P((()=>{r=0}),f),r+=1,r<=e||A)return A=!1,!1;if(r===e+1){A=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Fe.AGENT,startClocks:_()})}finally{A=!1}}return!0}}}(t,e.eventRateLimiterThreshold,A)})),n.subscribe(0,(({rawLogsEvent:A,messageContext:i,savedCommonContext:s,domainContext:a})=>{var u,c;const l=A.date-v();const f=t.findTrackedSession(l);if(!t.findTrackedSession(l,{returnInactive:!0}))return;const h=s||r();f&&f.anonymousId&&!h.user.anonymous_id&&(h.user.anonymous_id=f.anonymousId);const p=We({service:e.service,session_id:f?f.id:void 0,session:f?{id:f.id}:void 0,usr:x(h.user)?void 0:h.user,view:h.view},h.context,Nr(l),A,i);!1===(null===(u=e.beforeSend)||void 0===u?void 0:u.call(e,p,a))||p.origin!==Fe.AGENT&&(null!==(c=o[p.status])&&void 0!==c?c:o.custom).isLimitReached()||n.notify(1,p)}))}const Dr={[e.log]:lr.info,[e.debug]:lr.debug,[e.info]:lr.info,[e.warn]:lr.warn,[e.error]:lr.error};function Lr(t,e){if(!t.forwardErrorsToLogs)return{stop:z};const n=zn(t).subscribe((t=>{"complete"===t.state&&A("xhr",t)})),r=jn().subscribe((t=>{"resolve"===t.state&&A("fetch",t)}));function A(n,r){var A;function i(t){const A={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${Mr(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:t||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:lr.error,origin:Fe.NETWORK},domainContext:A})}A=r.url,Kt.every((t=>A.includes(t)))||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!_n(r.status)||("xhr"in r?function(t,e,n){"string"==typeof t.response?n(Tr(t.response,e)):n(t.response)}(r.xhr,t,i):r.response?function(t,e,n){const r=function(t){try{return t.clone()}catch(t){return}}(t);r&&r.body?window.TextDecoder?function(t,e,n){!function(t,e,n){const r=t.getReader(),A=[];let i=0;function o(){let t,o;r.cancel().catch(z);{let e;if(1===A.length)e=A[0];else{e=new Uint8Array(i);let t=0;A.forEach((n=>{e.set(n,t),t+=n.length}))}t=e.slice(0,n.bytesLimit),o=e.length>n.bytesLimit}e(void 0,t,o)}!function t(){r.read().then(M((e=>{e.done?o():(A.push(e.value),i+=e.value.length,i>n.bytesLimit?o():t())})),M((t=>e(t))))}()}(t,((t,e,r)=>{if(t)n(t);else{let t=(new TextDecoder).decode(e);r&&(t+="..."),n(void 0,t)}}),{bytesLimit:e,collectStreamBody:!0})}(r.body,e.requestErrorResponseLengthLimit,((t,e)=>{n(t?`Unable to retrieve response: ${t}`:e)})):r.text().then(M((t=>n(Tr(t,e)))),M((t=>n(`Unable to retrieve response: ${t}`)))):n()}(r.response,t,i):r.error&&function(t,e,n){n(Tr(be(ce(t)),e))}(r.error,t,i))}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function Tr(t,e){return t.length>e.requestErrorResponseLengthLimit?`${t.substring(0,e.requestErrorResponseLengthLimit)}...`:t}function Mr(t){return"xhr"===t?"XHR":"Fetch"}const Or=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}};function Rr(t){return{handleLog:function(e,A,i,o,s){const a=We(A.getContext(),e.context);if(cr(e.status,dr.console,A)&&function({status:t,message:e},A){r[Pr[t]].call(n,e,A)}(e,a),cr(e.status,dr.http,A)){const n={rawLogsEvent:{date:s||g(),message:e.message,status:e.status,origin:Fe.LOGGER},messageContext:a,savedCommonContext:o};i&&(n.domainContext={handlingStack:i}),t.notify(0,n)}}}}const Pr={[lr.ok]:e.debug,[lr.debug]:e.debug,[lr.info]:e.info,[lr.notice]:e.info,[lr.warn]:e.warn,[lr.error]:e.error,[lr.critical]:e.error,[lr.alert]:e.error,[lr.emerg]:e.error};function kr(t,e,n,r,A){const i=sn("browser-logs-sdk",e);i.setContextProvider((()=>{var t,e,n,r,i,o;return{application:{id:null===(t=Nr())||void 0===t?void 0:t.application_id},session:{id:null===(e=A.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(r=null===(n=Nr())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(o=null===(i=Nr())||void 0===i?void 0:i.user_action)||void 0===o?void 0:o.id}}}));const o=[];if(On()){const t=Mn(),e=i.observable.subscribe((e=>t.send("internal_telemetry",e)));o.push((()=>e.unsubscribe()))}else{const t=Fn(e,{endpoint:e.rumEndpointBuilder,encoder:Gn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Gn()},n,r,A.expireObservable);o.push((()=>t.stop()));const s=i.observable.subscribe((n=>t.add(n,function(t){return t.site===Ht}(e))));o.push((()=>s.unsubscribe()))}return An.drain(),function(t){on({type:en.configuration,configuration:t})}(function(t){const e={session_sample_rate:(n=t).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}(t)),{telemetry:i,stop:()=>{o.forEach((t=>t()))}}}const Br=function(t){const e=nr(),n=$n(e.getOrCreateTracker(2)),r=$n(e.getOrCreateTracker(1)),A=function(t){const e=new G;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Qt.GRANTED,observable:e}}();function o(){return function(t,e){return{view:{referrer:document.referrer,url:window.location.href},context:t.getContext(),user:e.getContext()}}(n,r)}let s=Er(o,A,((e,i)=>{e.storeContextsAcrossPages&&(Zn(i,n,wr,2),Zn(i,r,wr,1));const a=t(e,i,o,A);return s=function(t,e){return{init:t=>{Ue("DD_LOGS",t)},initConfiguration:t,...e}}(e,a),a}));const a={};return function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>T,enumerable:!1}),e}({logger:new yr(((...t)=>s.handleLog(...t)),e.createDetachedTracker()),init:M((t=>s.init(t))),setTrackingConsent:M((t=>{var e;A.update(t),e={feature:"set-tracking-consent",tracking_consent:t},on({type:en.usage,usage:e})})),getGlobalContext:M((()=>n.getContext())),setGlobalContext:M((t=>n.setContext(t))),setGlobalContextProperty:M(((t,e)=>n.setContextProperty(t,e))),removeGlobalContextProperty:M((t=>n.removeContextProperty(t))),clearGlobalContext:M((()=>n.clearContext())),createLogger:M(((t,n={})=>(a[t]=new yr(((...t)=>s.handleLog(...t)),e.createDetachedTracker(),De(t),n.handler,n.level,De(n.context)),a[t]))),getLogger:M((t=>a[t])),getInitConfiguration:M((()=>$e(s.initConfiguration))),getInternalContext:M((t=>s.getInternalContext(t))),setUser:M((t=>{(function(t){const e="object"===nt(t);return e||i.error("Unsupported user:",t),e})(t)&&r.setContext(rt(t))})),getUser:M((()=>r.getContext())),setUserProperty:M(((t,e)=>{const n=rt({[t]:e})[t];r.setContextProperty(t,n)})),removeUserProperty:M((t=>r.removeContextProperty(t))),clearUser:M((()=>r.clearContext()))})}((function(t,e,n,r){const A=new Or,i=[];A.subscribe(1,(t=>He("logs",t)));const o=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Fe.AGENT,status:lr.error}}),an("Error reported to customer",{"error.message":e.message})}}(A),s=function(t){return new G((e=>{const{stop:n}=ze(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Rn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Rn.FROZEN})}),{capture:!0}),r=Qe(t,window,"beforeunload",(()=>{e.notify({reason:Rn.UNLOADING})})).stop;return()=>{n(),r()}}))}(e),a=!e.sessionStoreStrategyType||On()||sr()?function(t){const e="1"===Cr(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new G}}(e):Ir(e,r),{stop:u}=kr(t,e,o,s,a);i.push((()=>u())),Lr(e,A),function(t,e){if(!t.forwardErrorsToLogs)return{stop:z};const n=new G,{stop:r}=Ge(n),A=n.subscribe((t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,error:hr(t),origin:Fe.SOURCE,status:lr.error}})}))}(e,A),function(t,e){const n=Xn(t.forwardConsoleLogs).subscribe((t=>{const n={rawLogsEvent:{date:g(),message:t.message,origin:Fe.CONSOLE,error:t.error&&hr(t.error),status:Dr[t.api]},domainContext:{handlingStack:t.handlingStack}};e.notify(0,n)}))}(e,A),function(t,e){const n=qe(t,t.forwardReports).subscribe((t=>{let n,r=t.message;const A="deprecation"===t.originalError.type?lr.warn:lr.error;var i,o;A===lr.error?n=hr(t):t.stack&&(r+=` Found in ${i=t.stack,null===(o=/@ (.+)/.exec(i))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:g(),message:r,origin:Fe.REPORT,error:n,status:A}})}))}(e,A);const{handleLog:c}=Rr(A);if(Sr(a,e,A,n,o),On())!function(t){const e=Mn();t.subscribe(1,(t=>{e.send("log",t)}))}(A);else{const{stop:t}=function(t,e,n,r,A){const i=Fn(t,{endpoint:t.logsEndpointBuilder,encoder:Gn()},t.replica&&{endpoint:t.replica.logsEndpointBuilder,encoder:Gn()},n,r,A.expireObservable);return e.subscribe(1,(t=>{i.add(t)})),i}(e,A,o,s,a);i.push((()=>t()))}var l;return{handleLog:c,getInternalContext:(l=a,{get:t=>{const e=l.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,stop:()=>{i.forEach((t=>t()))}}}));!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&i.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>u(t,"onReady callback threw an error:")()))}(N(),"DD_LOGS",Br);const Fr="GET",Gr="POST",Ur="x-api-key",Qr="x-access-token",zr="content-type",Vr="/v4/partner-login",qr="/v4/partner-login-signed",Yr="/v4/partner-refresh-token",jr="/v5/users/me",Hr="[SkyPath SDK]: Old fetch request aborted",Xr="local",$r="development",Wr="staging",Kr="production",Zr={[Xr]:"https://staging-api.skypath.io",[$r]:"https://dev-api.skypath.io",[Wr]:"https://staging-api.skypath.io",[Kr]:"https://api.skypath.io"};const Jr="0.4.20",tA="SDKLogger",eA={SDK:`[SkyPathSDK v${Jr}]:`,NETWORK:"[Network]:"},nA="Invalid listener",rA="Missing authentication parameters",AA="Failed to authenticate with authCallback",iA="Failed to authenticate with API key",oA="Failed to get authentication token";class sA extends Error{constructor({error:t,context:e={}}){t||={message:"Unknown error"},super(t.message),this.name=this.constructor.name,this.context=e;const n=Br.getLogger(tA);n?.error(this.message,{context:e},e?.error||t)}}class aA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class uA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class cA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class lA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class fA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}const hA={INFO:"/v5/gtg/info",DATA:"/v5/gtg/{resolution}/{hexId}"};class pA{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:hA.INFO})).data}catch(t){throw new uA("Failed to get GTG info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=hA.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r};return(await this.#t({path:A,params:i})).data}catch(t){throw new uA("Failed to get GTG data",{error:t})}}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function dA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gA={exports:{}};!function(t){t.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",A="second",i="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",f="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},_={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),A=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(A,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),A=e.clone().add(r,u),i=n-A<0,o=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-A)/(i?A-o:o-A))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:l,w:a,d:s,D:f,h:o,m:i,s:A,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var E="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[E])},b=function t(e,n,r){var A;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();v[i]&&(A=i),n&&(v[i]=n,A=i);var o=e.split("-");if(!A&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,A=s}return!r&&A&&(m=A),A||!r&&m},I=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},C=_;C.l=b,C.i=w,C.w=function(t,e){return I(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=b(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[E]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(C.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var A=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=I(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return I(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<I(t)},y.$g=function(t,e,n){return C.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!C.u(e)||e,c=C.p(t),h=function(t,e){var A=C.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?A:A.endOf(s)},p=function(t,e){return C.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},d=this.$W,g=this.$M,y=this.$D,_="set"+(this.$u?"UTC":"");switch(c){case l:return r?h(1,0):h(31,11);case u:return r?h(1,g):h(0,g+1);case a:var m=this.$locale().weekStart||0,v=(d<m?d+7:d)-m;return h(r?y-v:y+(6-v),g);case s:case f:return p(_+"Hours",0);case o:return p(_+"Minutes",1);case i:return p(_+"Seconds",2);case A:return p(_+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,a=C.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[l]=c+"FullYear",n[o]=c+"Hours",n[i]=c+"Minutes",n[A]=c+"Seconds",n[r]=c+"Milliseconds",n)[a],p=a===s?this.$D+(e-this.$W):e;if(a===u||a===l){var d=this.clone().set(f,1);d.$d[h](p),d.init(),this.$d=d.set(f,Math.min(this.$D,d.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[C.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=C.p(c),d=function(t){var e=I(h);return C.w(e.date(e.date()+Math.round(t*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===s)return d(1);if(p===a)return d(7);var g=(f={},f[i]=e,f[o]=n,f[A]=t,f)[p]||1,y=this.$d.getTime()+r*g;return C.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=t||"YYYY-MM-DDTHH:mm:ssZ",A=C.z(this),i=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,A,i){return t&&(t[n]||t(e,r))||A[n].slice(0,i)},f=function(t){return C.s(i%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(d,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return C.s(e.$y,4,"0");case"M":return s+1;case"MM":return C.s(s+1,2,"0");case"MMM":return l(n.monthsShort,s,u,3);case"MMMM":return l(u,s);case"D":return e.$D;case"DD":return C.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(n.weekdaysMin,e.$W,a,2);case"ddd":return l(n.weekdaysShort,e.$W,a,3);case"dddd":return a[e.$W];case"H":return String(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(e.$s);case"ss":return C.s(e.$s,2,"0");case"SSS":return C.s(e.$ms,3,"0");case"Z":return A}return null}(t)||A.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=C.p(f),y=I(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return C.m(d,y)};switch(g){case l:p=v()/12;break;case u:p=v();break;case c:p=v()/3;break;case a:p=(m-_)/6048e5;break;case s:p=(m-_)/864e5;break;case o:p=m/n;break;case i:p=m/e;break;case A:p=m/t;break;default:p=m}return h?p:C.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return v[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=b(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return C.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),N=x.prototype;return I.prototype=N,[["$ms",r],["$s",A],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach((function(t){N[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),I.extend=function(t,e){return t.$i||(t(e,x,I),t.$i=!0),I},I.locale=b,I.isDayjs=w,I.unix=function(t){return I(1e3*t)},I.en=v[m],I.Ls=v,I.p={},I}()}(gA);var yA=dA(gA.exports),_A=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var A,i="";"undefined"!=typeof document&&document.currentScript&&(i=document.currentScript.src),i=0!==i.indexOf("blob:")?i.substr(0,i.lastIndexOf("/")+1):"",A=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var A=j(t);A?e(A.buffer):n()}},r.onerror=n,r.send(null)};var o=n.print||console.log.bind(console),s=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments;var a=0;var u=!1;function c(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||it("Assertion failed: "+e),r}function l(t,e,n,r,A){var i={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var A=n,i=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,p,e,n)})(t,e=K(n),n)}return e},array:function(t){var e=K(t.length);return function(t,e){h.set(t,e)}(t,e),e}};var o=c(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var l=i[n[u]];l?(0===a&&(a=J()),s[u]=l(r[u])):s[u]=r[u]}var f=o.apply(null,s);return f=function(t){return"string"===e?v(t):"boolean"===e?Boolean(t):t}(f),0!==a&&Z(a),f}var f,h,p,d,g,y,_,m="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function v(t,e){return t?function(t,e,n){for(var r=e+n,A=e;t[A]&&!(A>=r);)++A;if(A-e>16&&t.subarray&&m)return m.decode(t.subarray(e,A));for(var i="";e<A;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var a=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|a:(7&o)<<18|s<<12|a<<6|63&t[e++])<65536)i+=String.fromCharCode(o);else{var u=o-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}(p,t,e):""}function E(t,e){return t%e>0&&(t+=e-t%e),t}function w(t){f=t,n.HEAP8=h=new Int8Array(t),n.HEAP16=d=new Int16Array(t),n.HEAP32=g=new Int32Array(t),n.HEAPU8=p=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=y=new Float32Array(t),n.HEAPF64=_=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var b=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}b=(f=n.buffer?n.buffer:new ArrayBuffer(b)).byteLength,w(f),g[6032]=5267040;var C=[],x=[],N=[],S=[];var D=Math.abs,L=Math.ceil,T=Math.floor,M=Math.min,O=0,R=null;n.preloadedImages={},n.preloadedAudios={};var P,k,B=null,F="data:application/octet-stream;base64,";function G(t){return String.prototype.startsWith?t.startsWith(F):0===t.indexOf(F)}B="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function U(t){return t}function Q(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function z(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function V(){return h.length}function q(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(h),X(e),w(e),1}catch(t){}}var Y="function"==typeof atob?atob:function(t){var e,n,r,A,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(A=s.indexOf(t.charAt(u++)))>>4,n=(15&A)<<4|(i=s.indexOf(t.charAt(u++)))>>2,r=(3&i)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function j(t){if(G(t))return function(t){try{for(var e=Y(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(F.length))}var H=function(t,e,n){var r=new t.Int8Array(n),A=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var i=new t.Float64Array(n),o=0|e.o,s=0|e.p,a=t.Math.floor,u=t.Math.abs,c=t.Math.sqrt,l=t.Math.pow,f=t.Math.cos,h=t.Math.sin,p=t.Math.tan,d=t.Math.acos,g=t.Math.asin,y=t.Math.atan,_=t.Math.atan2,m=t.Math.ceil,v=t.Math.imul,E=t.Math.min,w=t.Math.max,b=t.Math.clz32,I=e.b,C=e.c,x=e.d,N=e.e,S=e.f,D=e.g,L=e.h,T=e.i,M=24160;function O(t,e,n,r){return 0|R(t|=0,e|=0,n|=0,r|=0,0)}function R(t,e,n,r,i){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|P(t|=0,e|=0,n|=0,r|=0,i|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,a)))break;a=0|A[(u=a)>>2],u=0|A[u+4>>2]}else c=0|Be(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|C(),s=0|Me(0|n,0|s,1,0),s=0|Me(0|(s=0|Be(0|c,0|u,0|s,0|C())),0|C(),1,0),u=0|C(),A[a>>2]=s,A[a+4>>2]=u,a=s;if(He(0|r,0,a<<3),0|i){He(0|i,0,a<<2),s=0|k(t,e,n,r,i,a,u,0);break}(s=0|Te(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Le(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function P(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,g=s+8|0,A[(d=o=s)>>2]=t,A[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(A[(a=r)>>2]=t,A[a+4>>2]=e,(a=!!(0|i))&&(A[i>>2]=0),0|Bt(t,e))return M=s,0|(g=9);A[g>>2]=0;t:do{if((0|n)>=1)if(a)for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,A[i+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else a=0}while(0);return M=s,0|(g=a)}function k(t,e,n,r,i,o,s,a){n|=0,r|=0,i|=0,a|=0;var u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0;if(l=M,M=M+16|0,u=l+8|0,c=l,f=0|Ge(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|C(),!(!(0|(_=0|A[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|A[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|Fe(0|(f=0|Me(0|f,0|p,1,0)),0|C(),0|o,0|s),p=0|C(),h=(0|(y=0|A[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|A[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=i+(f<<2)|0,h&&(0|A[f>>2])<=(0|a))return M=l,0|(_=0);if(A[(_=d)>>2]=t,A[_+4>>2]=e,A[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,A[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(A[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}return M=l,0|(_=0)}}while(0);return M=l,0|(_=f)}function B(t,e,n,r,i){t|=0,e|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if((n|=0)>>>0>6)return 0|(i=1);if(f=(0|A[(r|=0)>>2])%6|0,A[r>>2]=f,(0|f)>0){a=0;do{n=0|pt(n),a=a+1|0}while((0|a)<(0|A[r>>2]))}if(f=0|Qe(0|t,0|e,45),C(),(s=127&f)>>>0>121)return 0|(i=5);o=0|Ft(t,e),a=0|Qe(0|t,0|e,52),C(),a&=15;t:do{if(a){for(;;){if(c=0|Qe(0|t,0|e,0|(u=3*(15-a|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(p=!(0|Vt(a)),a=a+-1|0,h=0|ze(7,0,0|u),e&=~C(),t=0|ze(0|A[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|C(),!(n=0|A[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!a){l=8;break t}}return 0|e}l=8}while(0);8==(0|l)&&(t|=0|ze(0|(p=0|A[848+(28*s|0)+(n<<2)>>2]),0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|ze(0|A[848+(28*s|0)+20>>2],0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+20>>2],t=0|Ut(p|t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]))),c=0|Qe(0|t,0|e,45),C(),c&=127;t:do{if(0|U(c)){e:do{if(1==(0|Ft(t,e))){if((0|s)!=(0|c)){if(0|q(c,0|A[7696+(28*s|0)>>2])){t=0|zt(t,e),u=1,e=0|C();break}x(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ut(t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]),u=0;break e;case 5:t=0|zt(t,e),e=0|C(),A[r>>2]=5+(0|A[r>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){a=0;do{t=0|Gt(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|Q(c))){if(!!(0|u)|5!=(0|Ft(t,e)))break;A[r>>2]=1+(0|A[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Ft(t,e))&&(A[r>>2]=1+(0|A[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Ut(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return A[r>>2]=((0|A[r>>2])+n|0)%6|0,A[(p=i)>>2]=t,A[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0;for(s=M,M=M+16|0,i=s,o=s+8|0,a=(a=!(0|Bt(t|=0,e|=0)))?1:2;;){if(A[o>>2]=0,!(0|B(t,e,a,o,i))&((0|A[(u=i)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0)){t=4;break}if((a=a+1|0)>>>0>=7){a=7,t=4;break}}return 4==(0|t)?(M=s,0|a):0}function G(t,e,n,r,o,s,a){e|=0,n|=0,r|=0,o|=0,s|=0,a|=0;var u,c,l,f,h,p,d,g,y,_,m=0,v=0,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,P=0,k=0,B=0,F=0,G=0;if(_=M,M=M+64|0,d=_+48|0,g=_+32|0,y=_+24|0,u=_+8|0,c=_,(0|(v=0|A[(t|=0)>>2]))<=0)return M=_,0|(P=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(E=0|A[l>>2])+(O<<4)|0,A[d>>2]=A[T>>2],A[d+4>>2]=A[T+4>>2],A[d+8>>2]=A[T+8>>2],A[d+12>>2]=A[T+12>>2],(0|O)==(v+-1|0)?(A[g>>2]=A[E>>2],A[g+4>>2]=A[E+4>>2],A[g+8>>2]=A[E+8>>2],A[g+12>>2]=A[E+12>>2]):(T=E+(O+1<<4)|0,A[g>>2]=A[T>>2],A[g+4>>2]=A[T+4>>2],A[g+8>>2]=A[T+8>>2],A[g+12>>2]=A[T+12>>2]),v=0|W(d,g,r,y);t:do{if(v)E=0,m=v;else if(v=0|A[(E=y)>>2],(0|(E=0|A[E+4>>2]))>0|!(0|E)&v>>>0>0){L=0,T=0;e:for(;;){if(G=+i[d>>3],F=+((D=0|Oe(0|v,0|E,0|L,0|T))>>>0)+4294967296*+(0|C()),k=+(v>>>0)+4294967296*+(0|E),B=+(L>>>0)+4294967296*+(0|T),i[u>>3]=G*F/k+ +i[g>>3]*B/k,i[p>>3]=+i[f>>3]*F/k+ +i[h>>3]*B/k,0|(v=0|qt(u,r,c))){m=v;break}I=0|Ge(0|(S=0|A[(D=c)>>2]),0|(D=0|A[D+4>>2]),0|e,0|n),w=0|C(),E=0|A[(b=v=a+(I<<3)|0)>>2],b=0|A[b+4>>2];n:do{if(!(0|E)&!(0|b))R=v,P=16;else for(x=0,N=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&N>>>0>e>>>0){m=1;break e}if((0|E)==(0|S)&(0|b)==(0|D))break n;if(I=0|Fe(0|(v=0|Me(0|I,0|w,1,0)),0|C(),0|e,0|n),w=0|C(),N=0|Me(0|N,0|x,1,0),x=0|C(),!(0|(E=0|A[(b=v=a+(I<<3)|0)>>2]))&!(0|(b=0|A[b+4>>2]))){R=v,P=16;break}}}while(0);if(16!=(0|P)||(P=0,!(0|S)&!(0|D))||(A[(N=R)>>2]=S,A[N+4>>2]=D,N=s+(A[o>>2]<<3)|0,A[N>>2]=S,A[N+4>>2]=D,N=0|Me(0|A[(N=o)>>2],0|A[N+4>>2],1,0),S=0|C(),A[(D=o)>>2]=N,A[D+4>>2]=S),L=0|Me(0|L,0|T,1,0),T=0|C(),v=0|A[(E=y)>>2],!((0|(E=0|A[E+4>>2]))>(0|T)|(0|E)==(0|T)&v>>>0>L>>>0)){E=1;break t}}E=0}else E=1}while(0);if(O=O+1|0,!E){P=21;break}if((0|O)>=(0|(v=0|A[t>>2]))){m=0,P=21;break}}return 21==(0|P)?(M=_,0|m):0}function U(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|A[7696+(28*t|0)+16>>2])}function Q(t){return 4==(0|(t|=0))|117==(0|t)}function z(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)>>2]}function V(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)+4>>2]}function q(t,e){return e|=0,(0|A[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|A[7696+(28*t|0)+24>>2])==(0|e))}function Y(t,e){return 0|A[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function j(t,e){return e|=0,(0|A[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|A[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|A[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|A[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|A[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|A[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|A[848+(28*t|0)+24>>2])==(0|e)?6:7)}function H(t){return+i[(t|=0)+16>>3]<+i[t+24>>3]|0}function X(t,e){t|=0;var n,r,A=0;return(A=+i[(e|=0)>>3])>=+i[t+8>>3]&&A<=+i[t>>3]?(n=+i[t+16>>3],A=+i[t+24>>3],e=(r=+i[e+8>>3])>=A,t=r<=n&1,n<A?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function $(t,e,n){t|=0,e|=0,n|=0;var r,s,c,l,f,h,p,d=0,g=0,y=0,_=0,v=0,w=0,b=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{A[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|$t(e,y))?(M=h,0|(w=e)):(Ht(y=0|A[(g=y)>>2],g=0|A[g+4>>2],f),Xt(y,g,_),l=+te(f,_+8|0),i[f>>3]=+i[t>>3],i[(g=f+8|0)>>3]=+i[t+16>>3],i[_>>3]=+i[t+8>>3],i[(y=_+8|0)>>3]=+i[t+24>>3],s=+te(f,_),b=+i[g>>3]-+i[y>>3],c=+u(+b),p=+i[f>>3]-+i[_>>3],r=+u(+p),!(0==b|0==p)&&(b=+Ve(+c,+r),b=+m(+s*s/+qe(+b/+qe(+c,+r),3)/(l*(2.59807621135*l)*.8)),i[o>>3]=b,v=~~b>>>0,w=+u(b)>=1?b>0?~~+E(+a(b/4294967296),4294967295)>>>0:~~+m((b-+(~~b>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2])?(_=!(0|v)&!(0|w),A[(e=n)>>2]=_?1:v,A[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function W(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,l,f,h=0,p=0,d=0;f=M,M=M+288|0,c=f+264|0,l=f+96|0,s=(h=p=f)+96|0;do{A[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|$t(n,p))?(M=f,0|(r=n)):(Ht(h=0|A[(n=p)>>2],n=0|A[n+4>>2],c),Xt(h,n,l),d=+te(c,l+8|0),d=+m(+ +te(t,e)/(2*d)),i[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+E(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2]?(p=!(0|n)&!(0|h),A[r>>2]=p?1:n,A[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,A[(t|=0)>>2]=e,A[t+4>>2]=n,A[t+8>>2]=r}function Z(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;A[(s=(e|=0)+8|0)>>2]=0,r=+i[t>>3],f=+u(+r),o=+i[t+8>>3],f+=.5*(h=+u(+o)/.8660254037844386),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(A[e>>2]=a,h<.5*(f+1)){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,A[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,A[e>>2]=a;break}A[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,A[e>>2]=a,h<.5*f){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(h<1-f){if(A[e+4>>2]=t,2*f-1<h){A[e>>2]=a;break}}else t=t+1|0,A[e+4>>2]=t;a=a+1|0,A[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))+1)),A[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))),A[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,A[e>>2]=a,t=0-t|0,A[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,A[p>>2]=c,A[s>>2]=l,A[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,A[e>>2]=a,l=l-t|0,A[s>>2]=l,A[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(A[e>>2]=n,A[p>>2]=c,A[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(A[e>>2]=a-c,A[p>>2]=t-c,A[s>>2]=l-c)}function J(t){var e,n=0,r=0,i=0,o=0,s=0;n=0|A[(t|=0)>>2],r=0|A[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,A[e>>2]=r,A[(s=t+8|0)>>2]=(0|A[s>>2])-n,A[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,A[t>>2]=n,o=(0|A[(s=t+8|0)>>2])-r|0,A[s>>2]=o,A[e>>2]=0,r=0):(s=o=t+8|0,o=0|A[o>>2]),(0|o)<0&&(n=n-o|0,A[t>>2]=n,r=r-o|0,A[e>>2]=r,A[s>>2]=0,o=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(A[t>>2]=n-i,A[e>>2]=r-i,A[s>>2]=o-i)}function tt(t,e){e|=0;var n,r;r=0|A[(t|=0)+8>>2],n=+((0|A[t+4>>2])-r|0),i[e>>3]=+((0|A[t>>2])-r|0)-.5*n,i[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[e>>2])+(0|A[t>>2]),A[n+4>>2]=(0|A[e+4>>2])+(0|A[t+4>>2]),A[n+8>>2]=(0|A[e+8>>2])+(0|A[t+8>>2])}function nt(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[t>>2])-(0|A[e>>2]),A[n+4>>2]=(0|A[t+4>>2])-(0|A[e+4>>2]),A[n+8>>2]=(0|A[t+8>>2])-(0|A[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|v(0|A[(t|=0)>>2],e),A[t>>2]=r,n=0|v(0|A[(r=t+4|0)>>2],e),A[r>>2]=n,e=0|v(0|A[(t=t+8|0)>>2],e),A[t>>2]=e}function At(t){var e,n,r=0,i=0,o=0,s=0,a=0;a=(0|(n=0|A[(t|=0)>>2]))<0,t=(t=(i=(0|(s=((e=(0|(o=(0|A[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|A[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(i=(0|t)<(0|(i=(0|(r=(e?0:o)-(i?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(i?s:0)|0))?r:s))?t:i))>0)?i:0)|0,r=r-(o?i:0)|0;t:do{switch(s-(o?i:0)|0){case 0:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?1:7:0);case 1:return 0|(a=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(a=7)}function it(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(a=1)}else{if((-2147483648-s|0)>(0|s))return 0|(a=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(a=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1)}else if((-2147483648-o|0)>(0|o))return 0|(a=1);if(i=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(a=1)}else if((-2147483648^n)<(0|o))return 0|(a=1);if(r){if(!((2147483647-s|0)<(0|i))){r=i;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|i))){r=i;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);i=0|Se(+(n-o|0)/7),A[t>>2]=i,o=0|Se(+(r+s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,355,22455)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function ot(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1)}else if((-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(a=1)}else{if((-2147483648-o|0)>(0|o))return 0|(a=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(a=1)}if(i=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(a=1)}else if((-2147483648-n|0)>(0|o))return 0|(a=1);if((0|o)>-1){if((-2147483648|i)<(0|s)){r=i;break}return 0|(n=1)}if(!((-2147483648^i)<(0|s))){r=i;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);i=0|Se(+(n+o|0)/7),A[t>>2]=i,o=0|Se(+(r-s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,404,22469)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function st(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+((3*(r=(0|A[t>>2])-i|0)|0)-(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((i<<1)+r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function at(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+(((r=(0|A[t>>2])-i|0)<<1)+(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((3*i|0)-r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function ut(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(3*i|0)|0,A[t>>2]=a,o=s+(3*o|0)|0,A[n>>2]=o,i=(3*s|0)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ct(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(3*(i=0|A[(n=t+4|0)>>2])|0)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(3*a|0)|0,A[t>>2]=a,A[n>>2]=s,i=(3*o|0)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function lt(t,e){t|=0;var n,r,i,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|A[15440+(12*e|0)>>2])+(0|A[t>>2])|0,A[t>>2]=a,i=t+4|0,s=(0|A[15440+(12*e|0)+4>>2])+(0|A[i>>2])|0,A[i>>2]=s,r=t+8|0,e=(0|A[15440+(12*e|0)+8>>2])+(0|A[r>>2])|0,A[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,A[i>>2]=o,A[r>>2]=e,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,e=e-o|0,A[r>>2]=e,A[i>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(A[t>>2]=n,A[i>>2]=a,A[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(A[t>>2]=s-o,A[i>>2]=a-o,A[r>>2]=e-o))}function ft(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(i=0|A[(n=t+4|0)>>2])+a|0,a=(o=0|A[(r=t+8|0)>>2])+a|0,A[t>>2]=a,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ht(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],s=0|A[(n=t+4|0)>>2],o=0|A[(r=t+8|0)>>2],a=s+i|0,A[t>>2]=a,s=o+s|0,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function pt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function dt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function gt(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(i<<1)|0,A[t>>2]=a,o=s+(o<<1)|0,A[n>>2]=o,i=(s<<1)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function yt(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=((i=0|A[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(a<<1)|0,A[t>>2]=a,A[n>>2]=s,i=(o<<1)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function _t(t,e){e|=0;var n,r,i,o=0,s=0,a=0;return i=(0|(r=(0|A[(t|=0)>>2])-(0|A[e>>2])|0))<0,n=(0|(s=(0|A[t+4>>2])-(0|A[e+4>>2])-(i?r:0)|0))<0,e=(e=(t=(0|(a=(i?0-r|0:0)+(0|A[t+8>>2])-(0|A[e+8>>2])+(n?0-s|0:0)|0))<0)?0:a)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?a:0)|0))<(0|(a=(i?0:r)-(n?s:0)-(t?a:0)|0))?o:a))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=a-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function mt(t,e){e|=0;var n;n=0|A[(t|=0)+8>>2],A[e>>2]=(0|A[t>>2])-n,A[e+4>>2]=(0|A[t+4>>2])-n}function vt(t,e){e|=0;var n,r,i,o=0,s=0,a=0;s=0|A[(t|=0)>>2],A[e>>2]=s,a=0|A[t+4>>2],A[(r=e+4|0)>>2]=a,A[(i=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,o=o?a:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=a-s|0,(0|s)<0?(o=0-s|0,A[r>>2]=t,A[i>>2]=o,A[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,A[e>>2]=s,o=o-t|0,A[i>>2]=o,A[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(A[e>>2]=n,A[r>>2]=a,A[i>>2]=0,t=a,a=n,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|a)?t:a))?o:s))<=0||(A[e>>2]=a-s,A[r>>2]=t-s,A[i>>2]=o-s),0|(e=0)}function Et(t){var e,n,r,i;n=(i=0|A[(e=(t|=0)+8|0)>>2])-(0|A[t>>2])|0,A[t>>2]=n,t=(0|A[(r=t+4|0)>>2])-i|0,A[r>>2]=t,A[e>>2]=0-(t+n)}function wt(t){var e,n,r=0,i=0,o=0,s=0,a=0;r=0-(i=0|A[(t|=0)>>2])|0,A[t>>2]=r,A[(e=t+8|0)>>2]=0,s=(o=0|A[(n=t+4|0)>>2])+i|0,(0|i)>0?(A[n>>2]=s,A[e>>2]=i,A[t>>2]=0,r=0,o=s):i=0,(0|o)<0?(a=r-o|0,A[t>>2]=a,i=i-o|0,A[e>>2]=i,A[n>>2]=0,s=a-i|0,r=0-i|0,(0|i)<0?(A[t>>2]=s,A[n>>2]=r,A[e>>2]=0,o=r,i=0):(o=0,s=a)):s=r,(0|(r=(0|i)<(0|(r=(0|o)<(0|s)?o:s))?i:r))<=0||(A[t>>2]=s-r,A[n>>2]=o-r,A[e>>2]=i-r)}function bt(t,e,n){n|=0;var r,i,o=0,s=0;return i=M,M=M+16|0,r=i,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|Qe(0|(t|=0),0|e,56),C(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,i=0,o=0;if(o=M,M=M+16|0,i=o,r=0|Bt(t,e),(n+-1|0)>>>0>5)return M=o,0|(i=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(i=-1);do{if(!(0|me(t,e,i))){if(r){r=(5+(0|A[21936+(n<<2)>>2])-(0|A[i>>2])|0)%5|0;break}r=(6+(0|A[21968+(n<<2)>>2])-(0|A[i>>2])|0)%6|0;break}r=-1}while(0);return i=r,M=o,0|i}(t,s,7&o),-1==(0|o)?(A[n>>2]=0,M=i,0|(s=6)):(0|jt(t,s,r)&&x(23313,22484,282,22499),e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,s)?Nt(r,e,o,2,n):Tt(r,e,o,2,n),M=i,0|(s=0))):(M=i,0|(s=6))}function It(t,e,n,r){e|=0,r|=0;var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=M,M=M+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,A=0;n=+i[t>>3],r=+f(+n),n=+h(+n),i[e+16>>3]=n,n=+i[t+8>>3],A=r*+f(+n),i[e>>3]=A,n=r*+h(+n),i[e+8>>3]=n}(t,o),A[e>>2]=0,i[n>>3]=5,r=+_e(16400,o),r<+i[n>>3]&&(A[e>>2]=0,i[n>>3]=r);r=+_e(16424,o),r<+i[n>>3]&&(A[e>>2]=1,i[n>>3]=r);r=+_e(16448,o),r<+i[n>>3]&&(A[e>>2]=2,i[n>>3]=r);r=+_e(16472,o),r<+i[n>>3]&&(A[e>>2]=3,i[n>>3]=r);r=+_e(16496,o),r<+i[n>>3]&&(A[e>>2]=4,i[n>>3]=r);r=+_e(16520,o),r<+i[n>>3]&&(A[e>>2]=5,i[n>>3]=r);r=+_e(16544,o),r<+i[n>>3]&&(A[e>>2]=6,i[n>>3]=r);r=+_e(16568,o),r<+i[n>>3]&&(A[e>>2]=7,i[n>>3]=r);r=+_e(16592,o),r<+i[n>>3]&&(A[e>>2]=8,i[n>>3]=r);r=+_e(16616,o),r<+i[n>>3]&&(A[e>>2]=9,i[n>>3]=r);r=+_e(16640,o),r<+i[n>>3]&&(A[e>>2]=10,i[n>>3]=r);r=+_e(16664,o),r<+i[n>>3]&&(A[e>>2]=11,i[n>>3]=r);r=+_e(16688,o),r<+i[n>>3]&&(A[e>>2]=12,i[n>>3]=r);r=+_e(16712,o),r<+i[n>>3]&&(A[e>>2]=13,i[n>>3]=r);r=+_e(16736,o),r<+i[n>>3]&&(A[e>>2]=14,i[n>>3]=r);r=+_e(16760,o),r<+i[n>>3]&&(A[e>>2]=15,i[n>>3]=r);r=+_e(16784,o),r<+i[n>>3]&&(A[e>>2]=16,i[n>>3]=r);r=+_e(16808,o),r<+i[n>>3]&&(A[e>>2]=17,i[n>>3]=r);r=+_e(16832,o),r<+i[n>>3]&&(A[e>>2]=18,i[n>>3]=r);if(r=+_e(16856,o),!(r<+i[n>>3]))return void(M=s);A[e>>2]=19,i[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+i[c>>3])))<1e-16)return A[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=0,A[r+12>>2]=0,void(M=o);if(c=0|A[n>>2],s=+Zt((s=+i[15920+(24*c|0)>>3])-+Zt(+function(t,e){t|=0,e|=0;var n=0,r=0,A=0,o=0,s=0;return o=+i[e>>3],r=+f(+o),A=+i[e+8>>3]-+i[t+8>>3],s=r*+h(+A),n=+i[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+A)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|Vt(e)?+Zt(s+-.3334731722518321):s,s=+p(+a)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,i[r>>3]=a,u=+h(+u)*s,i[r+8>>3]=u,M=o}function Ct(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,a=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+i[t>>3],e=+i[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,A[o>>2]=A[e>>2],A[o+4>>2]=A[e+4>>2],A[o+8>>2]=A[e+8>>2],void(A[o+12>>2]=A[e+12>>2]);if(a=+_(+ +i[t+8>>3],+ +i[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Vt(n)),s=+y(.381966011250105*(n?s:s/2.6457513110645907))):(s=+y(.381966011250105*s),0|Vt(n)&&(a=+Zt(a+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,a=0,c=0;if(n<1e-16)return A[r>>2]=A[t>>2],A[r+4>>2]=A[t+4>>2],A[r+8>>2]=A[t+8>>2],void(A[r+12>>2]=A[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+u(+(s+-3.141592653589793))<1e-16,e=+i[t>>3],o){e-=n,i[r>>3]=e,o=r;break}if(a=+f(+n),n=+h(+n),e=a*+h(+e)+ +f(+s)*(n*+f(+e)),e=+g(+((e=e>1?1:e)<-1?-1:e)),i[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return i[r>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[r>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(c=+f(+e),s=n*+h(+s)/c,n=+i[t>>3],e=(a-+h(+e)*+h(+n))/+f(+n)/c,a=s>1?1:s,e=e>1?1:e,(e=+i[t+8>>3]+ +_(+(a<-1?-1:a),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(i[r+8>>3]=e)}e=+i[t>>3]+n,i[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return i[o>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[o>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(e=+i[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);i[r+8>>3]=e}(15600+(e<<4)|0,+Zt(+i[15920+(24*e|0)>>3]-a),s,o)}function xt(t,e,n){e|=0,n|=0;var r,i;r=M,M=M+16|0,tt((t|=0)+4|0,i=r),Ct(i,0|A[t>>2],e,0,n),M=r}function Nt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,E,w,b,I,C,N,S,D,L=0,T=0,O=0,R=0,P=0,k=0;if(D=M,M=M+272|0,R=D+240|0,C=D,N=D+224|0,S=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,E=D+128|0,w=D+112|0,b=D+96|0,I=D+80|0,A[(L=D+256|0)>>2]=e,A[R>>2]=A[t>>2],A[R+4>>2]=A[t+4>>2],A[R+8>>2]=A[t+8>>2],A[R+12>>2]=A[t+12>>2],St(R,L,C),A[o>>2]=0,(0|(R=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=N+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|A[L>>2])<<2)|0,f=16960+(s<<2)|0,h=E+8|0,p=w+8|0,d=b+8|0,g=S+4|0,O=n;t:for(;;){T=C+((0|O)%5<<4)|0,A[S>>2]=A[T>>2],A[S+4>>2]=A[T+4>>2],A[S+8>>2]=A[T+8>>2],A[S+12>>2]=A[T+12>>2];do{}while(2==(0|Dt(S,s,0,1)));if((0|O)>(0|n)&!!(0|Vt(e))){if(A[y>>2]=A[S>>2],A[y+4>>2]=A[S+4>>2],A[y+8>>2]=A[S+8>>2],A[y+12>>2]=A[S+12>>2],tt(a,_),r=0|A[y>>2],L=0|A[17040+(80*r|0)+(A[N>>2]<<2)>>2],A[y>>2]=A[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|A[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{ft(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,A[m>>2]=A[T>>2],A[m+4>>2]=A[T+4>>2],A[m+8>>2]=A[T+8>>2],rt(m,3*(0|A[l>>2])|0),et(u,m,u),J(u),tt(u,v),P=+(0|A[f>>2]),i[E>>3]=3*P,i[h>>3]=0,k=-1.5*P,i[w>>3]=k,i[p>>3]=2.598076211353316*P,i[b>>3]=k,i[d>>3]=-2.598076211353316*P,0|A[17040+(80*(0|A[y>>2])|0)+(A[S>>2]<<2)>>2]){case 1:t=w,r=E;break;case 3:t=b,r=w;break;case 2:t=E,r=b;break;default:t=12;break t}ge(_,v,r,t,I),Ct(I,0|A[y>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])}if((0|O)<(0|c)&&(tt(g,y),Ct(y,0|A[S>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),A[N>>2]=A[S>>2],A[N+4>>2]=A[S+4>>2],A[N+8>>2]=A[S+8>>2],A[N+12>>2]=A[S+12>>2],(0|(O=O+1|0))>=(0|R)){t=3;break}}3!=(0|t)?12==(0|t)&&x(22522,22569,571,22579):M=D}}function St(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=i=r+64|0)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,n=n+68|0),J(n),M=r}function Dt(t,e,n,r){n|=0,r|=0;var i,o,s,a,u,c,l=0,f=0,h=0,p=0,d=0;if(c=M,M=M+32|0,u=c+12|0,o=c,d=(t|=0)+4|0,p=0|A[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|A[d>>2],i=0|A[(s=t+8|0)>>2],a){if((0|(l=i+l+(r=0|A[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=i+l+(r=0|A[(h=t+12|0)>>2])|0;if((0|l)<=(0|p))return M=c,0|(d=0);do{if((0|r)>0){if(r=0|A[t>>2],(0|i)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(u,p,0,0),nt(d,u,o),ht(o),et(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|A[t>>2])|0)+20|0,r=t}while(0);if(A[r>>2]=A[f>>2],(0|A[(l=f+16|0)>>2])>0){r=0;do{ft(d),r=r+1|0}while((0|r)<(0|A[l>>2]))}return t=f+4|0,A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],e=0|A[16880+(e<<2)>>2],rt(u,a?3*e|0:e),et(d,u,d),J(d),r=a&&((0|A[s>>2])+(0|A[d>>2])+(0|A[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Lt(t,e){t|=0,e|=0;var n=0;do{n=0|Dt(t,e,0,1)}while(2==(0|n));return 0|n}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,E,w,b,I,C=0,N=0,S=0,D=0,L=0;if(I=M,M=M+240|0,v=I+208|0,E=I,w=I+192|0,b=I+176|0,d=I+160|0,g=I+144|0,y=I+128|0,_=I+112|0,m=I+96|0,A[(C=I+224|0)>>2]=e,A[v>>2]=A[t>>2],A[v+4>>2]=A[t+4>>2],A[v+8>>2]=A[t+8>>2],A[v+12>>2]=A[t+12>>2],Mt(v,C,E),A[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=I;else{a=n+6|0,u=16960+((s=0|A[C>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,N=0,S=n,r=-1;t:for(;;){if(t=E+((C=(0|S)%6|0)<<4)|0,A[w>>2]=A[t>>2],A[w+4>>2]=A[t+4>>2],A[w+8>>2]=A[t+8>>2],A[w+12>>2]=A[t+12>>2],t=N,N=0|Dt(w,s,0,1),(0|S)>(0|n)&!!(0|Vt(e))&&(1!=(0|t)&&(0|A[w>>2])!=(0|r))){switch(tt(E+((C+5|0)%6<<4)+4|0,b),tt(E+(C<<4)+4|0,d),D=+(0|A[u>>2]),i[g>>3]=3*D,i[c>>3]=0,L=-1.5*D,i[y>>3]=L,i[l>>3]=2.598076211353316*D,i[_>>3]=L,i[f>>3]=-2.598076211353316*D,C=0|A[v>>2],0|A[17040+(80*C|0)+(((0|r)==(0|C)?A[w>>2]:r)<<2)>>2]){case 1:t=y,r=g;break;case 3:t=_,r=y;break;case 2:t=g,r=_;break;default:t=8;break t}ge(b,d,r,t,m),0|ye(b,m)||0|ye(d,m)||(Ct(m,0|A[v>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2]))}if((0|S)<(0|a)&&(tt(h,b),Ct(b,0|A[w>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),(0|(S=S+1|0))>=(0|p)){t=3;break}r=0|A[w>>2]}3!=(0|t)?8==(0|t)&&x(22606,22569,736,22651):M=I}}function Mt(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=i=r+80|0)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,e=n+68|0),J(e),A[n+80>>2]=A[t>>2],et(o,i+60|0,n=n+84|0),J(n),M=r}function Ot(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),45),C(),127&e}function Rt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|Qe(0|(t|=0),0|e,45),C(),(o&=127)>>>0>121)return 0|(e=0);n=0|Qe(0|t,0|e,52),C(),n&=15;do{if(0|n){for(A=1,r=0;;){if(i=0|Qe(0|t,0|e,3*(15-A|0)|0),C(),!!(0|(i&=7))&(1^r)){if(1==(0|i)&!!(0|U(o))){s=0,r=13;break}r=1}if(7==(0|i)){s=0,r=13;break}if(!(A>>>0<n>>>0)){r=9;break}A=A+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Qe(0|t,0|e,3*(14-n|0)|0),C(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Pt(t,e,n,r){n|=0,r|=0;var i=0,o=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return A[r>>2]=t,A[r+4>>2]=e,0|(r=0);if(i=0|ze(0|n,0,52),i|=t,t=C()|-15728641&e,(0|o)>(0|n))do{e=0|ze(7,0,3*(14-n|0)|0),n=n+1|0,i|=e,t=C()|t}while((0|n)<(0|o));return A[r>>2]=i,A[r+4>>2]=t,0|(r=0)}function kt(t,e,n,r){n|=0,r|=0;var i=0,o=0,s=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);i=n-o|0,n=0|Qe(0|t,0|e,45),C();t:do{if(0|U(127&n)){e:do{if(0|o){for(n=1;!((s=0|ze(7,0,3*(15-n|0)|0))&t)&!(C()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C();break t}}while(0);n=0|Me(0|(n=0|Be(0|(n=0|le(7,0,i,((0|i)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),n=0|Me(0|(n=0|ke(0|n,0|C(),6,0)),0|C(),1,0),i=0|C()}else n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C()}while(0);return A[(s=r)>>2]=n,A[s+4>>2]=i,0|(s=0)}function Bt(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&A)))return 0|(A=0);A=0|Qe(0|t,0|e,52),C(),A&=15;t:do{if(A)for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7))break t;if(!(r>>>0<A>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(A=1&!(0|n))}function Ft(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(A&=15))return 0|(A=0);for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7)){r=5;break}if(!(r>>>0<A>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Gt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(A=0|Qe(0|t,0|e,0|(o=3*(15-n|0)|0)),C(),i=0|ze(7,0,0|o),e&=~C(),t=t&~i|(o=0|ze(0|pt(7&A),0,0|o)),e|=C(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return I(0|e),0|t}function Ut(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;o=0|Qe(0|t,0|e,0|(i=3*(15-n|0)|0)),C(),A=0|ze(7,0,0|i),e&=~C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~A,e=C()|e,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Qt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|dt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ze(7,0,0|(A=3*(15-n|0)|0)),o=e&~C(),e=0|Qe(0|t,0|e,0|A),C(),t=t&~i|(e=0|ze(0|dt(7&e),0,0|A)),e=o|C(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return I(0|e),0|t}function zt(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;i=0|ze(7,0,0|(o=3*(15-n|0)|0)),A=e&~C(),e=0|Qe(0|t,0|e,0|o),C(),t=(e=0|ze(0|dt(7&e),0,0|o))|t&~i,e=C()|A,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Vt(t){return(0|(t|=0))%2|0}function qt(t,e,n){n|=0;var r,i=0;return r=M,M=M+16|0,i=r,(e|=0)>>>0>15?(M=r,0|(i=4)):2146435072&~A[(t|=0)+4>>2]&&2146435072&~A[t+8+4>>2]?(function(t,e,n){var r,A;r=M,M=M+16|0,It(t|=0,e|=0,n|=0,A=r),Z(A,n+4|0),M=r}(t,e,i),e=0|function(t,e){t|=0;var n,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,i=n+24|0,o=n+12|0,s=n,ze(0|(e|=0),0,52),r=134225919|C(),!e)return(0|A[t+4>>2])>2||(0|A[t+8>>2])>2||(0|A[t+12>>2])>2?(u=0,I(0|(a=0)),M=n,0|u):(ze(0|z(t),0,45),a=C()|r,u=-1,I(0|a),M=n,0|u);if(A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],A[u+12>>2]=A[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;A[i>>2]=A[a>>2],A[i+4>>2]=A[a+4>>2],A[i+8>>2]=A[a+8>>2],1&e?(st(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ut(o)):(at(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ct(o)),nt(i,o,s),J(s),c=0|ze(7,0,0|(l=3*(15-e|0)|0)),r&=~C(),t=(l=0|ze(0|At(s),0,0|l))|t&~c,r=C()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|A[a>>2])<=2&&(0|A[u+8>>2])<=2&&(0|A[u+12>>2])<=2){if(e=0|ze(0|(i=0|z(u)),0,45),e|=t,t=C()|-1040385&r,s=0|V(u),!(0|U(i))){if((0|s)<=0)break;for(o=0;;){if(i=0|Qe(0|e,0|t,52),C(),i&=15)for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<i>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|Qe(0|e,0|t,52),C(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|Qe(0|e,0|t,3*(15-r|0)|0),C(),7&l){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|q(i,0|A[u>>2]))for(r=1;c=0|ze(7,0,0|(u=3*(15-r|0)|0)),l=t&~C(),t=0|Qe(0|e,0|t,0|u),C(),e=e&~c|(t=0|ze(0|dt(7&t),0,0|u)),t=l|C(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Gt(e,t),t=0|C(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,I(0|(c=t)),M=n,0|l}(i,e),i=0|C(),A[n>>2]=e,A[n+4>>2]=i,!(0|e)&!(0|i)&&x(23313,22674,786,22697),M=r,0|(i=0)):(M=r,0|(i=3))}function Yt(t,e,n){var r,i=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|Qe(0|(t|=0),0|(e|=0),52),C(),o&=15,s=0|Qe(0|t,0|e,45),C(),i=!(0|o),0|U(127&s)){if(i)return 0|(s=1);i=1}else{if(i)return 0|(s=0);i=0|A[r>>2]||0|A[n+8>>2]?1:1&!!(0|A[n+12>>2])}for(n=1;1&n?ut(r):ct(r),s=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),lt(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|i}function jt(t,e,n){n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+16|0,r=i,l=0|Qe(0|(t|=0),0|(e|=0),45),C(),(l&=127)>>>0>121)return A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,A[n+12>>2]=0,M=i,0|(l=5);t:do{if(0|U(l)&&(a=0|Qe(0|t,0|e,52),C(),0|(a&=15))){o=1;e:for(;;){switch(c=0|Qe(0|t,0|e,3*(15-o|0)|0),C(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<a>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;u=0|ze(7,0,0|(e=3*(15-s|0)|0)),c=o&~C(),o=0|Qe(0|t,0|o,0|e),C(),t=t&~u|(o=0|ze(0|dt(7&o),0,0|e)),o=c|C(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,A[n>>2]=A[c>>2],A[n+4>>2]=A[c+4>>2],A[n+8>>2]=A[c+8>>2],A[n+12>>2]=A[c+12>>2],!(0|Yt(t,o,n)))return M=i,0|(l=0);if(u=n+4|0,A[r>>2]=A[u>>2],A[r+4>>2]=A[u+4>>2],A[r+8>>2]=A[u+8>>2],a=0|Qe(0|t,0|o,52),C(),c=15&a,1&a?(ct(u),a=c+1|0):a=c,0|U(l)){t:do{if(c)for(e=1;;){if(s=0|Qe(0|t,0|o,3*(15-e|0)|0),C(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Dt(n,a,o,0)){if(0|U(l))do{}while(0|Dt(n,a,0,0));(0|a)!=(0|c)&&at(u)}else(0|a)!=(0|c)&&(A[u>>2]=A[r>>2],A[u+4>>2]=A[r+4>>2],A[u+8>>2]=A[r+8>>2]);return M=i,0|(l=0)}function Ht(t,e,n){n|=0;var r,A,i=0;return A=M,M=M+16|0,0|(i=0|jt(t|=0,e|=0,r=A))?(M=A,0|i):(i=0|Qe(0|t,0|e,52),C(),xt(r,15&i,n),M=A,0|(i=0))}function Xt(t,e,n){n|=0;var r,A=0,i=0,o=0;if(r=M,M=M+16|0,0|(A=0|jt(t|=0,e|=0,o=r)))return M=r,0|(o=A);A=0|Qe(0|t,0|e,45),C(),A=!(0|U(127&A)),i=0|Qe(0|t,0|e,52),C(),i&=15;t:do{if(!A){if(0|i)for(A=1;;){if(!(!((0|ze(7,0,3*(15-A|0)|0))&t)&!(C()&e)))break t;if(!(A>>>0<i>>>0))break;A=A+1|0}return Nt(o,i,0,5,n),M=r,0|0}}while(0);return Tt(o,i,0,6,n),M=r,0|0}function $t(t,e){e|=0;var n=0,r=0,i=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(ze(0|t,0,52),a=134225919|C(),!t){n=0,r=0;do{0|U(r)&&(ze(0|r,0,45),s=a|C(),A[(t=e+(n<<3)|0)>>2]=-1,A[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|U(s)){for(ze(0|s,0,45),r=1,i=-1,o=a|C();i&=~(u=0|ze(7,0,3*(15-r|0)|0)),o&=~C(),(0|r)!=(0|t);)r=r+1|0;A[(u=e+(n<<3)|0)>>2]=i,A[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Wt(t,e,n,r){t|=0,r|=0;var i=0,o=0;i=0|Qe(0|(e|=0),0|(n|=0),52),C(),!(0|e)&!(0|n)|(0|r)>15|(0|(i&=15))>(0|r)?(r=-1,i=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,I(0|(n=e)),0|r):(n=0|ze(-1,-1,3+(3*(r-n|0)|0)|0),r=0|ze(0|~n,0|~C(),3*(15-r|0)|0),n=~C()&e,r=~r&t,I(0|n),0|r)}(e,n,i+1|0,r),n=-15728641&C(),e=0|ze(0|r,0,52),r=(o=!(0|Bt(e|=o,n|=C())))?-1:r),A[(o=t)>>2]=e,A[o+4>>2]=n,A[t+8>>2]=i,A[t+12>>2]=r}function Kt(t){var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|A[(r=t|=0)>>2]))&!(0|(r=0|A[r+4>>2]))||(i=0|Qe(0|n,0|r,52),C(),n=0|Me(0|(u=0|ze(1,0,3*(15^(i&=15))|0)),0|C(),0|n,0|r),r=0|C(),A[(u=t)>>2]=n,A[u+4>>2]=r,(0|i)<(0|(a=0|A[(u=t+8|0)>>2]))))){for(e=t+12|0,s=i;;){if((0|s)==(0|a)){i=5;break}if(c=(0|s)==(0|A[e>>2]),i=0|Qe(0|n,0|r,0|(o=3*(15-s|0)|0)),C(),c&1==(0|(i&=7))&!0){i=7;break}if(!(7==(0|i)&!0)){i=10;break}if(n=0|Me(0|n,0|r,0|(c=0|ze(1,0,0|o)),0|C()),r=0|C(),A[(c=t)>>2]=n,A[c+4>>2]=r,!((0|s)>(0|a))){i=10;break}s=s+-1|0}if(5==(0|i))return A[(c=t)>>2]=0,A[c+4>>2]=0,A[u>>2]=-1,void(A[e>>2]=-1);if(7==(0|i))return a=0|Me(0|n,0|r,0|(a=0|ze(1,0,0|o)),0|C()),u=0|C(),A[(c=t)>>2]=a,A[c+4>>2]=u,void(A[e>>2]=s+-1)}}function Zt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<17453292519943298e-27?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Be(0|(n=0|le(7,0,t,((0|t)<0)<<31>>31)),0|C(),120,0),t=0|C(),A[e>>2]=2|n,A[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,A,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+i[(e|=0)>>3],o=+i[t>>3],g=+h(.5*(m-o)),l=+i[e+8>>3],A=+i[t+8>>3],d=+h(.5*(l-A)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+i[n>>3],m=+h(.5*(g-m)),a=+i[n+8>>3],l=+h(.5*(a-l)),u=+f(+g),l=2*+_(+ +c(+(l=m*m+l*(s*u*l))),+ +c(+(1-l))),g=+h(.5*(o-g)),a=+h(.5*(A-a)),a=2*+_(+ +c(+(a=g*g+a*(r*u*a))),+ +c(+(1-a))),4*+y(+ +c(+ +p(.5*(u=.5*(d+l+a)))*+p(.5*(u-d))*+p(.5*(u-l))*+p(.5*(u-a))))}function re(t,e,n){n|=0;var r,o,s,a=0,u=0;if(s=M,M=M+192|0,o=s,0|(u=0|Ht(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Xt(t,e,o)&&x(23313,22742,386,22751),(0|(e=0|A[o>>2]))>0){if(a=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ne(o+8+((u=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else a=0;return i[n>>3]=a,M=s,0|(n=0)}function Ae(t){t|=0;var e,n,r=0;return(e=0|Te(1,12))||x(22832,22787,49,22845),0|(r=0|A[(n=t+4|0)>>2])?(A[(r=r+8|0)>>2]=e,A[n>>2]=e,0|e):(0|A[t>>2]&&x(22862,22787,61,22885),A[(r=t)>>2]=e,A[n>>2]=e,0|e)}function ie(t,e){t|=0,e|=0;var n,r;return(r=0|De(24))||x(22899,22787,78,22913),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[r+16>>2]=0,0|(n=0|A[(e=t+4|0)>>2])?(A[n+16>>2]=r,A[e>>2]=r,0|r):(0|A[t>>2]&&x(22928,22787,82,22913),A[t>>2]=r,A[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,i=0;if(t|=0)for(r=1;;){if(0|(e=0|A[t>>2]))do{if(0|(n=0|A[e>>2]))do{i=n,n=0|A[n+16>>2],Le(i)}while(0|n);i=e,e=0|A[e+8>>2],Le(i)}while(0|e);if(e=t,t=0|A[t+8>>2],r||Le(e),!t)break;r=0}}function se(t){var e,n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,C=0,N=0,S=0,D=0,L=0,T=0,M=0,O=0,R=0,P=0,k=0;if(0|A[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|A[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|A[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|De(o<<2))||x(22948,22787,317,22967),(e=0|De(o<<5))||x(22989,22787,321,22967),A[t>>2]=0,A[(S=t+4|0)>>2]=0,A[a>>2]=0,o=0,R=0,N=0,g=0;t:for(;;){if(d=0|A[s>>2]){c=0,l=d;do{if(h=+i[l+8>>3],r=l,l=0|A[l+16>>2],f=+i[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+i[r>>3]+ +i[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{C=+i[r+8>>3],M=0|A[(O=r+16|0)>>2],I=+i[(M=0|M?M:d)+8>>3],c+=(+i[r>>3]+ +i[M>>3])*((I<0?I+6.283185307179586:I)-(C<0?C+6.283185307179586:C)),r=0|A[(0|r?O:s)>>2]}while(0|r)}c>0?(A[n+(R<<2)>>2]=s,R=R+1|0,a=N,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=S,l=g+8|0,r=s,o=t;break}if(0|A[t>>2]){k=27;break t}a=S,l=t,r=s,o=t;break}if(0|A[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|Te(1,12))){k=23;break t}A[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(A[l>>2]=s,A[a>>2]=s,l=e+(N<<5)|0,p=0|A[s>>2]){for(i[(d=e+(N<<5)+8|0)>>3]=17976931348623157e292,i[(g=e+(N<<5)+24|0)>>3]=17976931348623157e292,i[l>>3]=-17976931348623157e292,i[(y=e+(N<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,b=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,E=-17976931348623157e292,f=-17976931348623157e292;c=+i[_>>3],C=+i[_+8>>3],_=0|A[_+16>>2],I=+i[((m=!(0|_))?p:_)+8>>3],c<h&&(i[d>>3]=c,h=c),C<v&&(i[g>>3]=C,v=C),c>E?i[l>>3]=c:c=E,C>f&&(i[y>>3]=C,f=C),w=C>0&C<w?C:w,b=C<0&C>b?C:b,a|=+u(+(C-I))>3.141592653589793,!m;)E=c;a&&(i[y>>3]=b,i[g>>3]=w)}else A[l>>2]=0,A[l+4>>2]=0,A[l+8>>2]=0,A[l+12>>2]=0,A[l+16>>2]=0,A[l+20>>2]=0,A[l+24>>2]=0,A[l+28>>2]=0;a=N+1|0}if(s=0|A[(O=s+8|0)>>2],A[O>>2]=0,!s){k=45;break}N=a,g=r}if(21==(0|k))x(22765,22787,35,22799);else if(23==(0|k))x(22819,22787,37,22799);else if(27==(0|k))x(22862,22787,61,22885);else if(45==(0|k)){t:do{if((0|R)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|A[n+(L<<2)>>2],O)k=73;else{if(!(N=0|De(T))){k=50;break}if(!(S=0|De(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|ae(0|A[l>>2],s,0|A[D>>2])?(A[N+(o<<2)>>2]=l,A[S+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|A[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|A[N>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|A[g>>2],s=0,l=0;d=(0|(a=0|A[A[N+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&ae(a,0|A[S+(l<<2)>>2],0|A[p>>2]))|0,(0|(l=l+1|0))!=(0|m);)s=d;if(o=(a=(0|d)>(0|_))?g:o,(0|(s=y+1|0))==(0|m))break e;y=s,_=a?d:_,g=0|A[N+(s<<2)>>2]}else o=0}}while(0);if(Le(N),Le(S),o){if(s=0|A[(a=o+4|0)>>2])o=s+8|0;else if(0|A[o>>2]){k=70;break}A[o>>2]=D,A[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|A[D>>2]))do{S=r,r=0|A[r+16>>2],Le(S)}while(0|r);Le(D),r=1}if((0|(L=L+1|0))>=(0|R)){P=r;break t}}50==(0|k)?x(23004,22787,249,23023):52==(0|k)?x(23042,22787,252,23023):70==(0|k)&&x(22862,22787,61,22885)}else P=0}while(0);return Le(n),Le(e),0|(k=P)}return 0}function ae(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|X(e|=0,n|=0)))return 0|(t=0);if(e=0|H(e),r=+i[n>>3],o=e&(o=+i[n+8>>3])<0?o+6.283185307179586:o,!(t=0|A[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|A[n>>2])){n=22;break t}if(((c=(u=a<0?a+6.283185307179586:a)+(r-s)/(c-s)*((a=o<0?o+6.283185307179586:o)-u))<0?c+6.283185307179586:c)>(l=u==l|a==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|A[n>>2])){n=22;break t}if(a+(r-s)/(c-s)*(o-a)>(l=a==l|o==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a,u,c,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(c=M,M=M+32|0,v=c+16|0,u=c,l=0|Qe(0|(t|=0),0|(e|=0),52),C(),l&=15,y=0|Qe(0|n,0|i,52),C(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|Qe(0|t,0|e,45),C(),d&=127,g=0|Qe(0|n,0|i,45),C(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|j(d,g))))return M=c,0|(v=1);7==(0|(p=0|j(g,d)))?x(23066,23090,161,23100):(_=h,f=p)}else _=0,f=0;s=0|U(d),a=0|U(g),A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0;do{if(_){if(h=(0|(g=0|A[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=i;do{p=0|Qt(p,h),h=0|C(),1==(0|(f=0|dt(f)))&&(f=0|dt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;else if(h){d=0,p=n,h=i;do{p=0|zt(p,h),h=0|C(),f=0|dt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;if(Yt(d,p,v),y||x(23115,23090,191,23100),(h=!!(0|s))&(f=!!(0|a))&&x(23142,23090,192,23100),h){if(7==(0|(f=0|Ft(t,e)))){l=5;break}if(0|r[21872+(7*f|0)+_|0]){l=1;break}d=p=0|A[21040+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Ft(d,p)))){l=5;break}if(0|r[21872+(7*f|0)+g|0]){l=1;break}d=0,p=0|A[21040+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{ht(h),f=f+1|0}while((0|f)!=(0|p))}if(A[u>>2]=0,A[u+4>>2]=0,A[u+8>>2]=0,lt(u,_),0|l)for(;0|Vt(l)?ut(u):ct(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{ht(u),l=l+1|0}while((0|l)!=(0|d))}et(m=v+4|0,u,m),J(m),m=51}}else if(Yt(n,i,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(23173,23090,261,23100),7==(0|(f=0|Ft(t,e)))|7==(0|(l=0|Ft(n,i))))l=5;else if(0|r[21872+(7*f|0)+l|0])l=1;else if((0|(f=0|A[21040+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{ht(h),l=l+1|0}while((0|l)!=(0|f));m=51}else m=51;else m=51}while(0);return 51==(0|m)&&(l=v+4|0,A[o>>2]=A[l>>2],A[o+4>>2]=A[l+4>>2],A[o+8>>2]=A[l+8>>2],l=0),M=c,0|(v=l)}function ce(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(s=M,M=M+48|0,i=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|Qe(0|(t|=0),0|(e|=0),52),C(),a&=15,p=0|Qe(0|t,0|e,45),C(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|U(p),ze(0|a,0,52),y=134225919|C(),A[(u=r)>>2]=-1,A[u+4>>2]=y,!a)return 7==(0|(a=0|At(n)))||127==(0|(a=0|Y(p,a)))?(M=s,0|(y=1)):(d=0|ze(0|a,0,45),g=0|C(),g=-1040385&A[(p=r)+4>>2]|g,A[(y=r)>>2]=A[p>>2]|d,A[y+4>>2]=g,M=s,0|(y=0));for(A[i>>2]=A[n>>2],A[i+4>>2]=A[n+4>>2],A[i+8>>2]=A[n+8>>2],n=a;;){if(u=n,n=n+-1|0,A[c>>2]=A[i>>2],A[c+4>>2]=A[i+4>>2],A[c+8>>2]=A[i+8>>2],0|Vt(u)){if(0|(a=0|it(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ut(l)}else{if(0|(a=0|ot(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ct(l)}if(nt(c,l,f),J(f),m=0|A[(a=r)>>2],a=0|A[a+4>>2],_=0|ze(7,0,0|(v=3*(15-u|0)|0)),a&=~C(),v=0|ze(0|At(f),0,0|v),a=C()|a,A[(y=r)>>2]=v|m&~_,A[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|A[i>>2])<=1&&(0|A[i+4>>2])<=1&&(0|A[i+8>>2])<=1){f=127==(0|(a=0|Y(p,n=0|At(i))))?0:0|U(a);e:do{if(n){if(o){if(7==(0|(a=0|Ft(t,e)))){a=5;break t}if((0|(u=0|A[21248+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|pt(a),n=n+1|0}while((0|n)!=(0|u))}else a=n;if(1==(0|a)){a=9;break t}127==(0|(n=0|Y(p,a)))&&x(23200,23090,411,23230),0|U(n)?x(23245,23090,412,23230):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|A[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(23276,23090,419,23230),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];do{n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,a=a+1|0}while((0|a)<(0|d))}if((0|l)<=0){a=g,n=58;break}for(a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];;)if(n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|j(g,p)))&&x(23066,23090,428,23230),n=0|A[(a=r)>>2],a=0|A[a+4>>2],(0|l)>0){u=0;do{n=0|Ut(n,a),a=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Ft(n,a)))&&x(23313,23090,440,23230),n=0|Q(g),(0|(n=0|A[(n?21664:21456)+(28*c|0)+(a<<2)>>2]))<0&&x(23313,23090,454,23230),n){a=0,u=0|A[(c=r)>>2],c=0|A[c+4>>2];do{u=0|Gt(u,c),c=0|C(),A[(v=r)>>2]=u,A[v+4>>2]=c,a=a+1|0}while((0|a)<(0|n));a=g,n=58}else a=g,n=58}else if(!!(0|o)&!!(0|f)){if(7==(0|(n=0|Ft(t,e)))|7==(0|(u=0|Ft(0|A[(u=r)>>2],0|A[u+4>>2])))){a=5;break t}if((0|(u=0|A[21248+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|A[(l=r)>>2],l=0|A[l+4>>2];do{c=0|Ut(c,l),l=0|C(),A[(v=r)>>2]=c,A[v+4>>2]=l,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&f&&(n=59),59==(0|n)&&1==(0|Ft(0|A[(v=r)>>2],0|A[v+4>>2]))){a=9;break}_=0|A[(v=r)>>2],v=-1040385&A[v+4>>2],m=0|ze(0|a,0,45),v|=C(),A[(a=r)>>2]=_|m,A[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function le(t,e,n,r){t|=0,e|=0;var A=0,i=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return i=1,I(0|(A=0)),0|i;i=t,A=e,t=1,e=0;do{t=0|Be(0|((o=!0&!(1&n))?1:i),0|(o?0:A),0|t,0|e),e=0|C(),n=0|Ue(0|n,0|r,1),r=0|C(),i=0|Be(0|i,0|A,0|i,0|A),A=0|C()}while(!(!(0|n)&!(0|r)));return I(0|e),0|t}function fe(t,e,n){t|=0;var r,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if(!(0|X(e|=0,n|=0)))return 0|(p=0);if(e=0|H(e),o=+i[n>>3],s=e&(s=+i[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|A[t>>2]))<=0)return 0|(p=0);if(r=0|A[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(((l=(c=u<0?u+6.283185307179586:u)+(o-a)/(l-a)*((u=s<0?s+6.283185307179586:s)-c))<0?l+6.283185307179586:l)>(h=c==h|u==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(u+(o-a)/(l-a)*(s-u)>(h=u==h|s==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function he(t,e){e|=0;var n,r,o,s,a,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0;if(!(r=0|A[(t|=0)>>2]))return A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,void(A[e+28>>2]=0);if(i[(o=e+8|0)>>3]=17976931348623157e292,i[(s=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|A[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+i[n+(v<<4)>>3],d=+i[n+(v<<4)+8>>3],f=+i[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(i[o>>3]=c,h=c),d<p&&(i[s>>3]=d,p=d),c>g?i[e>>3]=c:c=g,d>l&&(i[a>>3]=d,l=d),y=d>0&d<y?d:y,_=d<0&d>_?d:_,m|=+u(+(d-f))>3.141592653589793,(0|(t=v+1|0))!=(0|r);)E=v,g=c,v=t,t=E;m&&(i[a>>3]=_,i[s>>3]=y)}}function pe(t,e){e|=0;var n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,C=0,x=0;if(_=0|A[(t|=0)>>2]){if(i[(m=e+8|0)>>3]=17976931348623157e292,i[(v=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(E=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|A[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+i[s+(w<<4)>>3],p=+i[s+(w<<4)+8>>3],l=+i[s+(((0|(C=r+2|0))==(0|_)?0:C)<<4)+8>>3],a<f&&(i[m>>3]=a,f=a),p<h&&(i[v>>3]=p,h=p),a>d?i[e>>3]=a:a=d,p>c&&(i[E>>3]=p,c=p),g=p>0&p<g?p:g,y=p<0&p>y?p:y,o|=+u(+(p-l))>3.141592653589793,(0|(r=w+1|0))!=(0|_);)C=w,d=a,w=r,r=C;o&&(i[E>>3]=y,i[v>>3]=g)}}else A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,A[e+28>>2]=0;if(!((0|(r=0|A[(C=t+8|0)>>2]))<=0)){n=t+12|0,I=0;do{if(s=0|A[n>>2],o=I,v=e+((I=I+1|0)<<5)|0,E=0|A[s+(o<<3)>>2]){if(i[(w=e+(I<<5)+8|0)>>3]=17976931348623157e292,i[(t=e+(I<<5)+24|0)>>3]=17976931348623157e292,i[v>>3]=-17976931348623157e292,i[(b=e+(I<<5)+16|0)>>3]=-17976931348623157e292,(0|E)>0){for(_=0|A[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+i[_+(m<<4)>>3],d=+i[_+(m<<4)+8>>3],l=+i[_+(((0|(o=o+2|0))==(0|E)?0:o)<<4)+8>>3],a<f&&(i[w>>3]=a,f=a),d<h&&(i[t>>3]=d,h=d),a>p?i[v>>3]=a:a=p,d>c&&(i[b>>3]=d,c=d),g=d>0&d<g?d:g,y=d<0&d>y?d:y,s|=+u(+(d-l))>3.141592653589793,(0|(o=m+1|0))!=(0|E);)x=m,m=o,p=a,o=x;s&&(i[b>>3]=y,i[t>>3]=g)}}else A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0,A[v+16>>2]=0,A[v+20>>2]=0,A[v+24>>2]=0,A[v+28>>2]=0,r=0|A[C>>2]}while((0|I)<(0|r))}}function de(t,e,n){var r=0,i=0,o=0;if(!(0|fe(t|=0,e|=0,n|=0)))return 0|(i=0);if((0|A[(i=t+8|0)>>2])<=0)return 0|(i=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|fe((0|A[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|A[i>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ge(t,e,n,r,A){e|=0,n|=0,r|=0,A|=0;var o,s,a,u,c,l,f,h=0;u=+i[(t|=0)>>3],a=+i[e>>3]-u,s=+i[t+8>>3],o=+i[e+8>>3]-s,l=+i[n>>3],h=((h=+i[r>>3]-l)*(s-(f=+i[n+8>>3]))-(u-l)*(c=+i[r+8>>3]-f))/(a*c-o*h),i[A>>3]=u+a*h,i[A+8>>3]=s+o*h}function ye(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function _e(t,e){e|=0;var n,r,A;return+((A=+i[(t|=0)>>3]-+i[e>>3])*A+(r=+i[t+8>>3]-+i[e+8>>3])*r+(n=+i[t+16>>3]-+i[e+16>>3])*n)}function me(t,e,n){n|=0;var r,i,o,s,a=0,u=0,c=0;if(s=M,M=M+32|0,c=s,0|(a=0|jt(t|=0,e|=0,i=s+16|0)))return M=s,0|(n=a);r=0|Ot(t,e),o=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,A[(e|=0)>>2]=A[t>>2],A[e+4>>2]=A[t+4>>2],A[e+8>>2]=A[t+8>>2],A[e+12>>2]=A[t+12>>2]}(r,c),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|A[11120+(216*e|0)>>2])!=(0|t))if((0|A[11120+(216*e|0)+8>>2])!=(0|t))if((0|A[11120+(216*e|0)+16>>2])!=(0|t))if((0|A[11120+(216*e|0)+24>>2])!=(0|t))if((0|A[11120+(216*e|0)+32>>2])!=(0|t))if((0|A[11120+(216*e|0)+40>>2])!=(0|t))if((0|A[11120+(216*e|0)+48>>2])!=(0|t))if((0|A[11120+(216*e|0)+56>>2])!=(0|t))if((0|A[11120+(216*e|0)+64>>2])!=(0|t))if((0|A[11120+(216*e|0)+72>>2])!=(0|t))if((0|A[11120+(216*e|0)+80>>2])!=(0|t))if((0|A[11120+(216*e|0)+88>>2])!=(0|t))if((0|A[11120+(216*e|0)+96>>2])!=(0|t))if((0|A[11120+(216*e|0)+104>>2])!=(0|t))if((0|A[11120+(216*e|0)+112>>2])!=(0|t))if((0|A[11120+(216*e|0)+120>>2])!=(0|t))if((0|A[11120+(216*e|0)+128>>2])!=(0|t)){if((0|A[11120+(216*e|0)+136>>2])!=(0|t)){if((0|A[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|A[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|A[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|A[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|A[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|A[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|A[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|A[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|A[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|A[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|A[i>>2]);t:do{if(0|U(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:a=1;break t}if(u=0|A[22e3+(24*t|0)+8>>2],e=0|A[22e3+(24*t|0)+16>>2],(0|(t=0|A[i>>2]))!=(0|A[c>>2])&&(c=0|Q(r))|(0|(t=0|A[i>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0,u=22;break}5==(0|o)&(0|t)==(0|u)?(a=(a+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(A[n>>2]=a,a=0),M=s,0|(n=a)}function ve(t,e,n,r){n|=0,r|=0;var i,o,s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(u=M,M=M+32|0,v=u+24|0,a=u+20|0,s=u+8|0,o=u+16|0,i=u,p=(p=!(0|Bt(t|=0,e|=0)))?6:5,g=0|Qe(0|t,0|e,52),C(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|ze(7,0,3*(15^g)|0))&t)&!(C()&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|Bt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|me(t,e,v))return M=u,0|(r=1);if(l=(0|A[v>>2])+n|0,7==(0|(_=0|A[(c=c?22288+((0|l)%5<<2)|0:22320+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);A[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|A[(h=s)>>2],l=(f=(h=0|A[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|ze(7,0,3*(15^g)|0)))&!(h&C()))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|Bt(t,e),(0|h)<0&&x(23313,23315,245,23324),(0|((p=!!(0|c))?4:5))<(0|h)&&x(23313,23315,245,23324),0|me(t,e,v)&&x(23313,23315,245,23324),c=(0|A[v>>2])+h|0,7==(0|(h=0|A[(c=p?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&x(23313,23315,245,23324),A[o>>2]=0,0|(c=0|B(t,e,h,o,i)))break;p=0|A[(d=i)>>2],d=0|A[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|Bt(p,d)?0|F(p,d,t,e):0|A[22384+(((0|A[o>>2])+(0|A[22352+(h<<2)>>2])|0)%6<<2)>>2],c=0|Bt(p,d),(l+-1|0)>>>0>5){c=-1,l=p,f=d;break}if(1==(0|l)&(c=!!(0|c))){c=-1,l=p,f=d;break}do{if(!(0|me(p,d,v))){if(c){c=(5+(0|A[21936+(l<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(l<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|A[(h=s)>>2],h=0|A[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|Bt(d,h)))?0|F(d,h,t,e):0|A[22384+(((0|A[a>>2])+(0|A[22352+(_<<2)>>2])|0)%6<<2)>>2],c=0|Bt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|me(d,h,v))){if(m){c=(5+(0|A[21936+(t<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(t<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}e=f,t=l;break t}}while(0);return M=u,0|(r=c)}}while(0);return m=0|ze(0|c,0,56),v=C()|-2130706433&e|536870912,A[r>>2]=m|t,A[r+4>>2]=v,M=u,0|(r=0)}function Ee(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Te(e,4),A[t>>2]=r,r||x(23337,23360,40,23374)):A[t>>2]=0,A[t+4>>2]=e,A[t+8>>2]=0,A[t+12>>2]=n}function we(t){var e,n,r,o=0,s=0,a=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|A[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|A[t>>2],c=0|A[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|A[n>>2])|0))*(+i[c>>3]+ +i[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|A[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))A[o>>2]=A[a>>2];else{if(!(o=0|A[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|A[(s=o+32|0)>>2]))break e;A[s>>2]=A[a>>2]}Le(c),A[r>>2]=(0|A[r>>2])-1}}while(0)}Le(0|A[t>>2])}function be(t){var e,n=0,r=0;for(e=0|A[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|A[(0|A[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Ie(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,n=(0|A[t>>2])+(n<<2)|0,!(r=0|A[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|A[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|A[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){A[r+32>>2]=A[s>>2];break}if(10==(0|o))return 0|n}else A[n>>2]=A[s>>2]}while(0);return Le(e),A[(s=t+8|0)>>2]=(0|A[s>>2])-1,0|(s=0)}function Ce(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|De(40))||x(23390,23360,98,23403),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[(s=r+16|0)>>2]=A[n>>2],A[s+4>>2]=A[n+4>>2],A[s+8>>2]=A[n+8>>2],A[s+12>>2]=A[n+12>>2],A[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|A[t+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,s=(0|A[t>>2])+(s<<2)|0,o=0|A[s>>2];do{if(o){for(;!(0|Jt(o,e)&&0|Jt(o+16|0,n));)if(s=0|A[o+32>>2],!(0|A[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){A[o+32>>2]=r;break}return Le(r),0|(a=o)}A[s>>2]=r}while(0);return A[(a=t+8|0)>>2]=1+(0|A[a>>2]),0|(a=r)}function xe(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(o=0|A[(0|A[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|Jt(t,e)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Ne(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(t=0|A[(0|A[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|A[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Se(t){return 0|+function(t){return+ +Xe(+(t=+t))}(t=+t)}function De(t){t|=0;var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0;e=M,M=M+16|0,p=e;do{if(t>>>0<245){if(t=(l=t>>>0<11?16:t+11&-8)>>>3,3&(r=(h=0|A[5857])>>>t))return i=0|A[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|A[(o=i+8|0)>>2]))==(0|t)?A[5857]=h&~(1<<n):(A[s+12>>2]=t,A[r>>2]=s),w=n<<3,A[i+4>>2]=3|w,A[(w=i+w+4|0)>>2]=1|A[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|A[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|A[(t=(n=23468+((i=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(i=(n>>>=t)>>>1&1))+(n>>>i)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|A[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<i),A[5857]=t):(A[r+12>>2]=n,A[t>>2]=r,t=h),a=(w=i<<3)-l|0,A[s+4>>2]=3|l,A[(o=s+l|0)+4>>2]=1|a,A[s+w>>2]=a,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=a,A[5862]=o,M=e,0|(w=u);if(s=0|A[5858]){for(r=(s&0-s)-1|0,r=c=0|A[23732+(((i=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=i)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&A[c+4>>2])-l|0;(t=0|A[r+16>>2])||(t=0|A[r+20>>2]);)r=t,u=(o=(a=(-8&A[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|A[(i=n+20|0)>>2])n=r,t=i;else{if(!(r=0|A[(i=n+16|0)>>2]))break;n=r,t=i}A[t>>2]=0,r=n}else r=0|A[u+8>>2],A[r+12>>2]=n,A[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|A[u+28>>2],(0|u)==(0|A[(t=23732+(n<<2)|0)>>2])){if(A[t>>2]=r,!r){A[5858]=s&~(1<<n);break}}else if(A[((0|A[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;A[r+24>>2]=o,0|(n=0|A[u+16>>2])&&(A[r+16>>2]=n,A[n+24>>2]=r),0|(n=0|A[u+20>>2])&&(A[r+20>>2]=n,A[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2]):(A[u+4>>2]=3|l,A[a+4>>2]=1|c,A[a+c>>2]=c,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|A[(t=r+8|0)>>2]:(A[5857]=n|h,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=c,A[5862]=a),M=e,0|(w=u+8|0)}h=l}else h=l}else h=l}else if(t>>>0<=4294967231)if(l=-8&(t=t+11|0),i=0|A[5858]){o=0-l|0,c=(t>>>=8)?l>>>0>16777215?31:l>>>((c=14-((u=((y=t<<(h=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|h|(c=((y<<=u)+245760|0)>>>16&2))+(y<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|A[23732+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((a=(-8&A[r+4>>2])-l|0)>>>0<o>>>0){if(!a){t=r,o=0,y=65;break t}t=r,o=a}if(s=!(0|(y=0|A[r+20>>2]))|(0|y)==(0|(r=0|A[r+16+(u>>>31<<2)>>2]))?s:y,!r){r=s,y=61;break}u<<=1}else r=0,t=0,y=61}while(0);if(61==(0|y)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&i)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|A[23732+(((s=(h>>>=a=h>>>12&16)>>>5&8)|a|(u=(h>>>=s)>>>2&4)|(c=(h>>>=u)>>>1&2)|(r=(h>>>=c)>>>1&1))+(h>>>r)<<2)>>2]}r?y=65:(u=t,a=o)}if(65==(0|y))for(s=r;;){if(o=(r=(h=(-8&A[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|A[s+16>>2])||(r=0|A[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|A[5859])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|A[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|A[(o=n+16|0)>>2]))break;n=r,t=o}A[t>>2]=0}else w=0|A[u+8>>2],A[w+12>>2]=n,A[n+8>>2]=w}while(0);do{if(s){if(t=0|A[u+28>>2],(0|u)==(0|A[(r=23732+(t<<2)|0)>>2])){if(A[r>>2]=n,!n){i&=~(1<<t),A[5858]=i;break}}else if(A[((0|A[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;A[n+24>>2]=s,0|(t=0|A[u+16>>2])&&(A[n+16>>2]=t,A[t+24>>2]=n),(t=0|A[u+20>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2];else{if(A[u+4>>2]=3|l,A[f+4>>2]=1|a,A[f+a>>2]=a,n=a>>>3,a>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=f,A[n+12>>2]=f,A[f+8>>2]=n,A[f+12>>2]=r;break}if(n=23732+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[f+28>>2]=r,A[(t=f+16|0)+4>>2]=0,A[t>>2]=0,!(i&(t=1<<r))){A[5858]=i|t,A[n>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break}n=0|A[n>>2];e:do{if((-8&A[n+4>>2])!=(0|a)){for(i=a<<(31==(0|r)?0:25-(r>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|a)){n=t;break e}i<<=1,n=t}A[r>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=f,A[E>>2]=f,A[f+8>>2]=w,A[f+12>>2]=n,A[f+24>>2]=0}}while(0);return M=e,0|(w=u+8|0)}h=l}else h=l;else h=-1}while(0);if((r=0|A[5859])>>>0>=h>>>0)return n=r-h|0,t=0|A[5862],n>>>0>15?(w=t+h|0,A[5862]=w,A[5859]=n,A[w+4>>2]=1|n,A[t+r>>2]=n,A[t+4>>2]=3|h):(A[5859]=0,A[5862]=0,A[t+4>>2]=3|r,A[(w=t+r+4|0)>>2]=1|A[w>>2]),M=e,0|(w=t+8|0);if((a=0|A[5860])>>>0>h>>>0)return v=a-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|A[5975]?t=0|A[5977]:(A[5977]=4096,A[5976]=4096,A[5978]=-1,A[5979]=-1,A[5980]=0,A[5968]=0,A[5975]=-16&p^1431655768,t=4096),u=h+48|0,(l=(s=t+(c=h+47|0)|0)&(o=0-t|0))>>>0<=h>>>0)return M=e,0|(w=0);if(0|(t=0|A[5967])&&(p=(f=0|A[5965])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&A[5968])n=0,y=143;else{r=0|A[5863];e:do{if(r){for(i=23876;!((p=0|A[i>>2])>>>0<=r>>>0&&(p+(0|A[i+4>>2])|0)>>>0>r>>>0);){if(!(t=0|A[i+8>>2])){y=128;break e}i=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|$e(0|n)))==((0|A[i>>2])+(0|A[i+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else i=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|$e(0)))&&(n=r,g=(n=((g=(d=0|A[5976])+-1|0)&n?(g+n&0-d)-n|0:0)+l|0)+(d=0|A[5965])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|A[5967])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|$e(0|n)))==(0|r)){a=n,s=r,y=145;break t}i=t,y=136}else n=0}while(0);do{if(136==(0|y)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|i))){if(-1==(0|i)){n=0;break}a=n,s=i,y=145;break t}if((t=c-n+(t=0|A[5977])&0-t)>>>0>=2147483647){a=n,s=i,y=145;break t}if(-1==(0|$e(0|t))){$e(0|r),n=0;break}a=t+n|0,s=i,y=145;break t}}while(0);A[5968]=4|A[5968],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|$e(0|l)))|1^(m=(_=(g=0|$e(0))-v|0)>>>0>(h+40|0)>>>0)|v>>>0<g>>>0&-1!=(0|v)&-1!=(0|g)^1)&&(a=m?_:n,s=v,y=145),145==(0|y)){n=(0|A[5965])+a|0,A[5965]=n,n>>>0>(0|A[5966])>>>0&&(A[5966]=n),c=0|A[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|A[n>>2])+(r=0|A[n+4>>2])|0)){y=154;break}if(!(i=0|A[n+8>>2]))break;n=i}if(!(154!=(0|y)||(E=n+4|0,8&A[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){A[E>>2]=r+a,E=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|A[5860])+a|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[c+w+4>>2]=40,A[5864]=A[5979];break}for(s>>>0<(0|A[5861])>>>0&&(A[5861]=s),r=s+a|0,n=23876;;){if((0|A[n>>2])==(0|r)){y=162;break}if(!(t=0|A[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&A[n+12>>2])){A[n>>2]=s,A[(f=n+4|0)>>2]=(0|A[f>>2])+a,l=(f=s+(7&(f=s+8|0)?0-f&7:0)|0)+h|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-f-h|0,A[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|A[5860])+u|0,A[5860]=w,A[5863]=l,A[l+4>>2]=1|w;else{if((0|A[5862])==(0|n)){w=(0|A[5859])+u|0,A[5859]=w,A[5862]=l,A[l+4>>2]=1|w,A[l+w>>2]=w;break}if(1==(3&(t=0|A[n+4>>2]))){a=-8&t,i=t>>>3;n:do{if(t>>>0<256){if(t=0|A[n+8>>2],(0|(r=0|A[n+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<i);break}A[t+12>>2]=r,A[r+8>>2]=t;break}s=0|A[n+24>>2],t=0|A[n+12>>2];do{if((0|t)==(0|n)){if(t=0|A[(i=(r=n+16|0)+4|0)>>2])r=i;else if(!(t=0|A[r>>2])){t=0;break}for(;;)if(i=0|A[(o=t+20|0)>>2])t=i,r=o;else{if(!(i=0|A[(o=t+16|0)>>2]))break;t=i,r=o}A[r>>2]=0}else w=0|A[n+8>>2],A[w+12>>2]=t,A[t+8>>2]=w}while(0);if(!s)break;i=23732+((r=0|A[n+28>>2])<<2)|0;do{if((0|A[i>>2])==(0|n)){if(A[i>>2]=t,0|t)break;A[5858]=A[5858]&~(1<<r);break n}if(A[((0|A[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(A[t+24>>2]=s,0|(i=0|A[(r=n+16|0)>>2])&&(A[t+16>>2]=i,A[i+24>>2]=t),!(r=0|A[r+4>>2]))break;A[t+20>>2]=r,A[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(A[(n=n+4|0)>>2]=-2&A[n>>2],A[l+4>>2]=1|o,A[l+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=l,A[n+12>>2]=l,A[l+8>>2]=n,A[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){i=31;break}i=o>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1}else i=0}while(0);if(n=23732+(i<<2)|0,A[l+28>>2]=i,A[(t=l+16|0)+4>>2]=0,A[t>>2]=0,!((t=0|A[5858])&(r=1<<i))){A[5858]=t|r,A[n>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break}n=0|A[n>>2];n:do{if((-8&A[n+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|o)){n=t;break n}i<<=1,n=t}A[r>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break e}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=l,A[E>>2]=l,A[l+8>>2]=w,A[l+12>>2]=n,A[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=23876;!((t=0|A[n>>2])>>>0<=c>>>0&&(w=t+(0|A[n+4>>2])|0)>>>0>c>>>0);)n=0|A[n+8>>2];n=(t=(t=(o=w+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+r+4>>2]=40,A[5864]=A[5979],A[(r=t+4|0)>>2]=27,A[n>>2]=A[5969],A[n+4>>2]=A[5970],A[n+8>>2]=A[5971],A[n+12>>2]=A[5972],A[5969]=s,A[5970]=a,A[5972]=0,A[5971]=n,n=t+24|0;do{E=n,A[(n=n+4|0)>>2]=7}while((E+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,A[r>>2]=-2&A[r>>2],A[c+4>>2]=1|s,A[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=c,A[n+12>>2]=c,A[c+8>>2]=n,A[c+12>>2]=r;break}if(r=23732+((i=(n=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,A[c+28>>2]=i,A[c+20>>2]=0,A[o>>2]=0,!((n=0|A[5858])&(t=1<<i))){A[5858]=n|t,A[r>>2]=c,A[c+24>>2]=r,A[c+12>>2]=c,A[c+8>>2]=c;break}n=0|A[r>>2];e:do{if((-8&A[n+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|s)){n=t;break e}i<<=1,n=t}A[r>>2]=c,A[c+24>>2]=n,A[c+12>>2]=c,A[c+8>>2]=c;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=c,A[E>>2]=c,A[c+8>>2]=w,A[c+12>>2]=n,A[c+24>>2]=0}}else!(0|(w=0|A[5861]))|s>>>0<w>>>0&&(A[5861]=s),A[5969]=s,A[5970]=a,A[5972]=0,A[5866]=A[5975],A[5865]=-1,A[5870]=23468,A[5869]=23468,A[5872]=23476,A[5871]=23476,A[5874]=23484,A[5873]=23484,A[5876]=23492,A[5875]=23492,A[5878]=23500,A[5877]=23500,A[5880]=23508,A[5879]=23508,A[5882]=23516,A[5881]=23516,A[5884]=23524,A[5883]=23524,A[5886]=23532,A[5885]=23532,A[5888]=23540,A[5887]=23540,A[5890]=23548,A[5889]=23548,A[5892]=23556,A[5891]=23556,A[5894]=23564,A[5893]=23564,A[5896]=23572,A[5895]=23572,A[5898]=23580,A[5897]=23580,A[5900]=23588,A[5899]=23588,A[5902]=23596,A[5901]=23596,A[5904]=23604,A[5903]=23604,A[5906]=23612,A[5905]=23612,A[5908]=23620,A[5907]=23620,A[5910]=23628,A[5909]=23628,A[5912]=23636,A[5911]=23636,A[5914]=23644,A[5913]=23644,A[5916]=23652,A[5915]=23652,A[5918]=23660,A[5917]=23660,A[5920]=23668,A[5919]=23668,A[5922]=23676,A[5921]=23676,A[5924]=23684,A[5923]=23684,A[5926]=23692,A[5925]=23692,A[5928]=23700,A[5927]=23700,A[5930]=23708,A[5929]=23708,A[5932]=23716,A[5931]=23716,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+w+4>>2]=40,A[5864]=A[5979]}while(0);if((n=0|A[5860])>>>0>h>>>0)return v=n-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return A[(w=23424)>>2]=12,M=e,0|(w=0)}function Le(t){var e=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,i=0|A[5861],u=n+(e=-8&(t=0|A[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|A[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<i>>>0)return;if((0|A[5862])==(0|s)){if(3&~(e=0|A[(t=u+4|0)>>2])){a=s,e=o;break}return A[5859]=o,A[t>>2]=-2&e,A[s+4>>2]=1|o,void(A[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|A[s+8>>2],(0|(e=0|A[s+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<n),a=s,e=o;break}A[t+12>>2]=e,A[e+8>>2]=t,a=s,e=o;break}i=0|A[s+24>>2],t=0|A[s+12>>2];do{if((0|t)==(0|s)){if(t=0|A[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){t=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0}else a=0|A[s+8>>2],A[a+12>>2]=t,A[t+8>>2]=a}while(0);if(i){if(e=0|A[s+28>>2],(0|A[(n=23732+(e<<2)|0)>>2])==(0|s)){if(A[n>>2]=t,!t){A[5858]=A[5858]&~(1<<e),a=s,e=o;break}}else if(A[((0|A[(a=i+16|0)>>2])==(0|s)?a:i+20)>>2]=t,!t){a=s,e=o;break}A[t+24>>2]=i,0|(n=0|A[(e=s+16|0)>>2])&&(A[t+16>>2]=n,A[n+24>>2]=t),(e=0|A[e+4>>2])?(A[t+20>>2]=e,A[e+24>>2]=t,a=s,e=o):(a=s,e=o)}else a=s,e=o}}while(0);if(!(s>>>0>=u>>>0)&&1&(r=0|A[(t=u+4|0)>>2])){if(2&r)A[t>>2]=-2&r,A[a+4>>2]=1|e,A[s+e>>2]=e,i=e;else{if((0|A[5863])==(0|u)){if(u=(0|A[5860])+e|0,A[5860]=u,A[5863]=a,A[a+4>>2]=1|u,(0|a)!=(0|A[5862]))return;return A[5862]=0,void(A[5859]=0)}if((0|A[5862])==(0|u))return u=(0|A[5859])+e|0,A[5859]=u,A[5862]=s,A[a+4>>2]=1|u,void(A[s+u>>2]=u);i=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|A[u+8>>2],(0|(t=0|A[u+12>>2]))==(0|e)){A[5857]=A[5857]&~(1<<n);break}A[e+12>>2]=t,A[t+8>>2]=e;break}o=0|A[u+24>>2],t=0|A[u+12>>2];do{if((0|t)==(0|u)){if(t=0|A[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){n=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0,n=t}else n=0|A[u+8>>2],A[n+12>>2]=t,A[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|A[u+28>>2],(0|A[(e=23732+(t<<2)|0)>>2])==(0|u)){if(A[e>>2]=n,!n){A[5858]=A[5858]&~(1<<t);break}}else if(A[((0|A[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;A[n+24>>2]=o,0|(e=0|A[(t=u+16|0)>>2])&&(A[n+16>>2]=e,A[e+24>>2]=n),0|(t=0|A[t+4>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);if(A[a+4>>2]=1|i,A[s+i>>2]=i,(0|a)==(0|A[5862]))return void(A[5859]=i)}if(t=i>>>3,i>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|A[5857])&(t=1<<t)?t=0|A[(e=n+8|0)>>2]:(A[5857]=e|t,t=n,e=n+8|0),A[e>>2]=a,A[t+12>>2]=a,A[a+8>>2]=t,void(A[a+12>>2]=n);t=23732+((r=(t=i>>>8)?i>>>0>16777215?31:i>>>((r=14-((o=((u=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((u<<=o)+245760|0)>>>16&2))+(u<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[a+28>>2]=r,A[a+20>>2]=0,A[a+16>>2]=0,e=0|A[5858],n=1<<r;t:do{if(e&n){t=0|A[t>>2];e:do{if((-8&A[t+4>>2])!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1));e=0|A[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&A[e+4>>2])==(0|i)){t=e;break e}r<<=1,t=e}A[n>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a;break t}}while(0);u=0|A[(s=t+8|0)>>2],A[u+12>>2]=a,A[s>>2]=a,A[a+8>>2]=u,A[a+12>>2]=t,A[a+24>>2]=0}else A[5858]=e|n,A[t>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a}while(0);if(u=(0|A[5865])-1|0,A[5865]=u,!(0|u)){for(t=23884;t=0|A[t>>2];)t=t+8|0;A[5865]=-1}}}}function Te(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|De(n))&&3&A[t+-4>>2]?(He(0|t,0,0|n),0|t):0|t}function Me(t,e,n,r){return 0|(I((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(I(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Re(t){return 0|((t|=0)?31-(0|b(t^t-1)):32)}function Pe(t,e,n,r,i){i|=0;var o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(l=t|=0,s=n|=0,a=h=r|=0,!(c=u=e|=0))return o=!!(0|i),a?o?(A[i>>2]=0|t,A[i+4>>2]=0,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i)):(o&&(A[i>>2]=(l>>>0)%(s>>>0),A[i+4>>2]=0),i=(l>>>0)/(s>>>0)>>>0,0|(I(0|(h=0)),i));o=!(0|a);do{if(s){if(!o){if((o=(0|b(0|a))-(0|b(0|c))|0)>>>0<=31){s=f=o+1|0,t=l>>>(f>>>0)&(e=o-31>>31)|c<<(a=31-o|0),e&=c>>>(f>>>0),o=0,a=l<<a;break}return i?(A[i>>2]=0|t,A[i+4>>2]=0|u,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i))}if((o=s-1|0)&s){s=a=33+(0|b(0|s))-(0|b(0|c))|0,t=(f=32-a|0)-1>>31&c>>>((p=a-32|0)>>>0)|(c<<f|l>>>(a>>>0))&(e=p>>31),e&=c>>>(a>>>0),o=l<<(d=64-a|0)&(u=f>>31),a=(c<<d|l>>>(p>>>0))&u|l<<f&a-33>>31;break}return 0|i&&(A[i>>2]=o&l,A[i+4>>2]=0),1==(0|s)?(d=0|t,0|(I(0|(p=0|u)),d)):(p=c>>>((d=0|Re(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(I(0|p),d))}if(o)return 0|i&&(A[i>>2]=(c>>>0)%(s>>>0),A[i+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(I(0|(p=0)),d);if(!l)return 0|i&&(A[i>>2]=0,A[i+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(I(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|i&&(A[i>>2]=0|t,A[i+4>>2]=o&c),p=0,d=c>>>((0|Re(0|a))>>>0),0|(I(0|p),d);if((o=(0|b(0|a))-(0|b(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(a=31-o|0)|l>>>(e>>>0),e=c>>>(e>>>0),o=0,a=l<<a;break}return i?(A[i>>2]=0|t,A[i+4>>2]=0|u,d=0,0|(I(0|(p=0)),d)):(d=0,0|(I(0|(p=0)),d))}while(0);if(s){c=0|Me(0|(f=0|n),0|(l=0|h),-1,-1),n=0|C(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|C())>>31|((0|d)<0?-1:0)<<1),t=0|Oe(0|r,0|h,p&f,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|C(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|i&&(A[i>>2]=t,A[i+4>>2]=e),d=o<<1&-2|a,0|(I(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function ke(t,e,n,r){n|=0;var A,i,o,s,a;return i=(r|=0)>>31|((0|r)<0?-1:0)<<1,A=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|s),t=i^a,e=A^s,0|Oe(Pe(o,0|C(),0|Oe(i^n,A^r,0|i,0|A),0|C(),0)^t,C()^e,0|t,0|e)}function Be(t,e,n,r){e|=0,r|=0;var A,i;return n=0|function(t,e){var n,r,A,i=0;return t=((n=0|v(i=65535&(e|=0),A=65535&(t|=0)))>>>16)+(0|v(i,r=t>>>16))|0,e=0|v(i=e>>>16,A),0|(I((t>>>16)+(0|v(i,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(A=t|=0,i=n|=0),t=0|C(),0|(I((0|v(e,i))+(0|v(r,A))+t|0),n)}function Fe(t,e,n,r){n|=0;var i,o,s,a,u,c;return i=M,M=M+16|0,a=0|i,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Pe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|C(),0|Oe(c^n,u^r,0|c,0|u),0|C(),a),r=0|Oe(A[a>>2]^s,A[a+4>>2]^o,0|s,0|o),n=0|C(),M=i,0|(I(0|n),r)}function Ge(t,e,n,r){var i,o;return o=M,M=M+16|0,Pe(t|=0,e|=0,n|=0,r|=0,i=0|o),M=o,0|(I(0|A[i+4>>2]),A[i>>2])}function Ue(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(I(0|((0|e)<0?-1:0)),e>>n-32)}function Qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(I(0),e>>>n-32|0)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(I(t<<n-32),0)}function Ve(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function qe(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+E(+t,+e)}function Ye(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function je(t,e,n){t|=0,e|=0;var i,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,i=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&i)-64|0;(0|t)<=(0|s);)A[t>>2]=A[e>>2],A[t+4>>2]=A[e+4>>2],A[t+8>>2]=A[e+8>>2],A[t+12>>2]=A[e+12>>2],A[t+16>>2]=A[e+16>>2],A[t+20>>2]=A[e+20>>2],A[t+24>>2]=A[e+24>>2],A[t+28>>2]=A[e+28>>2],A[t+32>>2]=A[e+32>>2],A[t+36>>2]=A[e+36>>2],A[t+40>>2]=A[e+40>>2],A[t+44>>2]=A[e+44>>2],A[t+48>>2]=A[e+48>>2],A[t+52>>2]=A[e+52>>2],A[t+56>>2]=A[e+56>>2],A[t+60>>2]=A[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)A[t>>2]=A[e>>2],t=t+4|0,e=e+4|0}else for(n=i-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|i);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function He(t,e,n){e|=0;var i,o=0,s=0,a=0;if(i=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(a=e|e<<8|e<<16|e<<24,s=(o=-4&i)-64|0;(0|t)<=(0|s);)A[t>>2]=a,A[t+4>>2]=a,A[t+8>>2]=a,A[t+12>>2]=a,A[t+16>>2]=a,A[t+20>>2]=a,A[t+24>>2]=a,A[t+28>>2]=a,A[t+32>>2]=a,A[t+36>>2]=a,A[t+40>>2]=a,A[t+44>>2]=a,A[t+48>>2]=a,A[t+52>>2]=a,A[t+56>>2]=a,A[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)A[t>>2]=a,t=t+4|0}for(;(0|t)<(0|i);)r[t|0]=e,t=t+1|0;return i-n|0}function Xe(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function $e(t){t|=0;var e,n,r;return r=0|S(),(0|t)>0&(0|(e=(n=0|A[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),N(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(N(12),-1):(A[s>>2]=e,0|n)}return{___divdi3:ke,___muldi3:Be,___remdi3:Fe,___uremdi3:Ge,_areNeighborCells:function(t,e,n,r,i){i|=0;var o,s,a,u=0,c=0,l=0,f=0;if(a=M,M=M+64|0,s=a,o=a+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return M=a,0|(i=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return A[i>>2]=0,M=a,0|(i=0);if(c=0|Qe(0|t,0|e,52),C(),c&=15,f=0|Qe(0|n,0|r,52),C(),(0|c)!=(15&f))return M=a,0|(i=12);if(u=c+-1|0,c>>>0>1){Pt(t,e,u,s),Pt(n,r,u,o),l=0|A[(f=s)>>2],f=0|A[f+4>>2];t:do{if((0|l)==(0|A[o>>2])&&(0|f)==(0|A[o+4>>2])){u=0|Qe(0|t,0|e,0|(c=3*(15^c)|0)),C(),u&=7,c=0|Qe(0|n,0|r,0|c),C(),c&=7;do{if(!(0|u)|!(0|c))A[i>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Bt(l,f)){u=5;break}if((0|A[15536+(u<<2)>>2])!=(0|c)&&(0|A[15568+(u<<2)>>2])!=(0|c))break t;A[i>>2]=1,u=0}}while(0);return M=a,0|(i=u)}}while(0)}c=(u=s)+56|0;do{A[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|A[(e=s)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+8|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+16|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+24|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+32|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+40|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)?1:1&((0|A[(u=s+48|0)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0),A[i>>2]=u,M=a,0|(i=0)},_bitshift64Ashr:Ue,_bitshift64Lshr:Qe,_bitshift64Shl:ze,_calloc:Te,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Xt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var i=0;return i=0|Qe(0|(t|=0),0|(e|=0),52),C(),(0|n)<16&(0|(i&=15))<=(0|n)?((0|i)<(0|n)&&(i=0|ze(-1,-1,3+(3*(n+-1-i|0)|0)|0),i=0|ze(0|~i,0|~C(),3*(15-n|0)|0),e=~C()&e,t&=~i),i=0|ze(0|n,0,52),n=-15728641&e|C(),A[r>>2]=t|i,A[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0;if(i=M,M=M+16|0,_=i,m=0|Qe(0|(t|=0),0|(e|=0),52),C(),m&=15,n>>>0>15)return M=i,0|(m=4);if((0|m)<(0|n))return M=i,0|(m=12);if((0|m)!=(0|n))if(s=0|ze(0|n,0,52),s|=t,u=C()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|ze(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=C()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|Qe(0|y,0|u,45),C();t:do{if(0|U(127&g)){if(c=0|Qe(0|y,0|u,52),C(),0|(c&=15))for(s=1;;){if(!(!((g=0|ze(7,0,3*(15-s|0)|0))&y)&!(C()&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(g=-15728641&e,d=m;;){if(p=d,(d=d+-1|0)>>>0>15|(0|m)<(0|d)){l=19;break}if((0|m)!=(0|d))if(s=0|ze(0|d,0,52),s|=t,c=C()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|ze(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=C()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|Qe(0|h,0|c,45),C(),0|U(127&f)){f=0|Qe(0|h,0|c,52),C(),f&=15;e:do{if(f)for(l=1;;){if(s=0|Qe(0|h,0|c,3*(15-l|0)|0),C(),0|(s&=7))break e;if(!(l>>>0<f>>>0)){s=0;break}l=l+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|Qe(0|t,0|e,3*(15-p|0)|0),C(),7==(0|(c&=7))){o=5,l=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,l=42;break}if(0|(h=c+((!!(0|c)&s)<<31>>31)|0)&&(l=0|le(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|C(),s?(s=0|Me(0|(s=0|Be(0|l,0|f,5,0)),0|C(),-5,-1),s=0|Me(0|(s=0|ke(0|s,0|C(),6,0)),0|C(),1,0),c=0|C()):(s=l,c=f),p=0|Me(0|s,0|c,0|(p=0|Be(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|C()),f=0|Me(0|p,0|(h=0|C()),0|A[(f=r)>>2],0|A[f+4>>2]),h=0|C(),A[(p=r)>>2]=f,A[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(23313,22674,1099,22710);else{if(37==(0|l)){o=0|A[(a=r)+4>>2],a=0|A[a>>2];break}if(42==(0|l))return M=i,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|Qe(0|t,0|e,3*(15-s|0)|0),C(),7==(0|(o&=7))){o=5;break}if(o=0|Be(0|(a=0|le(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|C(),0|o,0),a=0|C(),a=0|Me(0|A[(g=r)>>2],0|A[g+4>>2],0|o,0|a),o=0|C(),A[(g=r)>>2]=a,A[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=i,0|o}o=0,a=0}}while(0);return 0|kt(y,u,m,_)&&x(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|A[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|A[m>>2])>>>0>a>>>0:0))?(M=i,0|(m=0)):(x(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var i,o,s=0,a=0;if(o=M,M=M+16|0,Wt(i=o,t|=0,e|=0,n|=0),!(0|(t=0|A[(e=i)>>2]))&!(0|(e=0|A[e+4>>2])))return M=o,0;s=0,n=0;do{A[(a=r+(s<<3)|0)>>2]=t,A[a+4>>2]=e,s=0|Me(0|s,0|n,1,0),n=0|C(),Kt(i),t=0|A[(a=i)>>2],e=0|A[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:kt,_cellToLatLng:Ht,_cellToLocalIj:function(t,e,n,r,A,i){var o,s;return t|=0,e|=0,n|=0,r|=0,i|=0,s=M,M=M+16|0,o=s,(A|=0)?t=15:(t=0|ue(t,e,n,r,o))||(mt(o,i),t=0),M=s,0|t},_cellToParent:Pt,_cellToVertex:ve,_cellToVertexes:function(t,e,n){n|=0;var r,i=0,o=0;return o=!(0|Bt(t|=0,e|=0)),r=!(0|(i=0|ve(t,e,0,n))),o?r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||(i=0|ve(t,e,4,n+32|0))?0|(o=i):0|ve(t,e,5,n+40|0):0|(o=i):r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||0|(i=0|ve(t,e,4,n+32|0))?0|(o=i):(A[(o=n+40|0)>>2]=0,A[o+4>>2]=0,0|(o=0)):0|(o=i)},_cellsToDirectedEdge:function(t,e,n,r,i){return i|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,r|=0)))?0|(i=11):(r=0|ze(0|n,0,56),e=-2130706433&e|C()|268435456,A[i>>2]=t|r,A[i+4>>2]=e,0|(i=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,i,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+176|0,r=i,(0|(e|=0))<1)return Ee(n,0,0),M=i,0;for(c=0|Qe(0|A[(c=t)>>2],0|A[c+4>>2],52),C(),Ee(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Xt(0|A[(o=t+(c<<3)|0)>>2],0|A[o+4>>2],r)));){if((0|(o=0|A[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|xe(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?Ie(n,s):Ce(n,a,o),o=0|A[r>>2]}while((0|u)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,l=13;break}}return 13==(0|l)?(M=i,0|o):(we(n),M=i,0|(l=o))}(t|=0,e|=0,i=o+16|0),0|t)return M=o,0|(n=t);if(A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,0|(t=0|be(i)))do{e=0|Ae(n);do{ie(e,t),s=t+16|0,A[r>>2]=A[s>>2],A[r+4>>2]=A[s+4>>2],A[r+8>>2]=A[s+8>>2],A[r+12>>2]=A[s+12>>2],Ie(i,t),t=0|Ne(i,r)}while(0|t);t=0|be(i)}while(0|t);return we(i),(t=0|se(n))?(oe(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,i,o){t|=0,e|=0,o|=0;var s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,a=s,(i|=0)>>>0>15)return M=s,0|(o=4);if(u=0|Qe(0|(n|=0),0|(r|=0),52),C(),(0|(u&=15))>(0|i))return M=s,0|(o=12);if(0|kt(n,r,i,a)&&x(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|A[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|A[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=i-u|0,i=0|ze(0|i,0,52),c=C()|-15728641&r,A[(l=o)>>2]=i|n,A[l+4>>2]=c,l=0|Qe(0|n,0|r,45),C();t:do{if(0|U(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|ze(7,0,3*(15-a|0)|0))&n)&!(C()&r)))break t;if(!(a>>>0<u>>>0))break;a=a+1|0}if((0|f)<1)return M=s,0|(o=0);for(l=15^u,r=-1,c=1,a=1;;){u=0|le(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|C();do{if(a){if(a=0|ke(0|(a=0|Me(0|(a=0|Be(0|u,0|n,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(i=0|C()))|(0|e)==(0|i)&t>>>0>a>>>0){e=0|Oe(0|(e=0|Me(0|t,0|e,-1,-1)),0|C(),0|a,0|i),a=0|C(),d=0|A[(h=o)>>2],h=0|A[h+4>>2],p=0|ze(7,0,0|(g=3*(l+r|0)|0)),h&=~C(),g=0|ze(0|(i=0|Me(0|(r=0|ke(0|e,0|a,0|u,0|n)),0|(t=0|C()),2,0)),0|C(),0|g),h=C()|h,A[(i=o)>>2]=g|d&~p,A[i+4>>2]=h,t=0|Oe(0|e,0|a,0|(t=0|Be(0|r,0|t,0|u,0|n)),0|C()),a=0,e=0|C();break}p=0|A[(g=o)>>2],g=0|A[g+4>>2],d=0|ze(7,0,3*(l+r|0)|0),g&=~C(),A[(a=o)>>2]=p&~d,A[a+4>>2]=g,a=1;break}i=0|A[(p=o)>>2],p=0|A[p+4>>2],h=0|ze(7,0,0|(r=3*(l+r|0)|0)),p&=~C(),r=0|ze(0|(g=0|ke(0|t,0|e,0|u,0|n)),0|(a=0|C()),0|r),p=C()|p,A[(d=o)>>2]=r|i&~h,A[d+4>>2]=p,t=0|Oe(0|t,0|e,0|(a=0|Be(0|g,0|a,0|u,0|n)),0|C()),a=0,e=0|C()}while(0);if(!((0|f)>(0|c))){e=0;break}r=~c,c=c+1|0}return M=s,0|e}}while(0);if((0|f)<1)return M=s,0|(g=0);for(i=15^u,a=1;;){if(d=0|le(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|C(),n=0|A[(c=o)>>2],c=0|A[c+4>>2],r=0|ze(7,0,0|(u=3*(i-a|0)|0)),c&=~C(),u=0|ze(0|(h=0|ke(0|t,0|e,0|d,0|g)),0|(p=0|C()),0|u),c=C()|c,A[(l=o)>>2]=u|n&~r,A[l+4>>2]=c,t=0|Oe(0|t,0|e,0|(g=0|Be(0|h,0|p,0|d,0|g)),0|C()),e=0|C(),(0|f)<=(0|a)){e=0;break}a=a+1|0}return M=s,0|e},_compactCells:function(t,e,n,r){e|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,N=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(I=0);if(s=0|A[(o=t|=0)>>2],!0&!(15728640&(o=0|A[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(I=0);if(A[(I=e)>>2]=s,A[I+4>>2]=o,1==(0|n)&!(0|r))return 0|(I=0);o=1;do{b=0|A[(w=t+(o<<3)|0)+4>>2],A[(I=e+(o<<3)|0)>>2]=A[w>>2],A[I+4>>2]=b,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(b=0|De(i=n<<3)))return 0|(I=13);if(je(0|b,0|t,0|i),!(w=0|Te(n,8)))return Le(b),0|(I=13);t:do{if(0|n){e:for(;;){v=0|Qe(0|(m=0|A[(o=b)>>2]),0|(o=0|A[o+4>>2]),52),C(),E=(v&=15)+-1|0,_=(0|n)>0;n:do{if(!!(0|v)&_){if(d=((0|n)<0)<<31>>31,g=0|ze(0|E,0,52),y=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){I=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(y=0|A[(r=b+(s<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){o=r,I=17;break e}}}for(s=0,t=m,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){I=22;break e}if(u=0|Qe(0|t,0|r,52),C(),(0|(u&=15))<(0|E)){o=12,I=28;break e}if((0|u)!=(0|E)&&(t|=g,r=-15728641&r|y,u>>>0>=v>>>0)){a=E;do{p=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,t|=p,r=C()|r}while(a>>>0<u>>>0)}if(a=0|Ge(0|t,0|r,0|n,0|d),C(),!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2])))a=l;else for(p=0;;){if((0|p)>(0|n)){I=32;break e}if((0|c)==(0|t)&(-117440513&u)==(0|r)){f=0|Qe(0|c,0|u,56),C(),h=(f&=7)+1|0,N=0|Qe(0|c,0|u,45),C();r:do{if(0|U(127&N)){if(c=0|Qe(0|c,0|u,52),C(),!(c&=15)){u=6;break}for(u=1;;){if(!(!((N=0|ze(7,0,3*(15-u|0)|0))&t)&!(C()&r))){u=7;break r}if(!(u>>>0<c>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){I=42;break e}N=0|ze(0|h,0,56),r=C()|-117440513&r,A[(h=l)>>2]=0,A[h+4>>2]=0,t|=N}else a=(a+1|0)%(0|n)|0;if(!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2]))){a=l;break}p=p+1|0}A[(N=a)>>2]=t,A[N+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|A[(r=b+(s<<3)|0)>>2],r=0|A[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){I=85;break}if(!(y=0|Te((0|n)/6|0,8))){I=49;break}n:do{if(_){p=0,h=0;do{if(!(!(0|(s=0|A[(r=u=w+(p<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){c=0|Qe(0|s,0|r,56),C(),t=(c&=7)+1|0,l=-117440513&r,N=0|Qe(0|s,0|r,45),C();r:do{if(0|U(127&N)){if(f=0|Qe(0|s,0|r,52),C(),0|(f&=15))for(a=1;;){if(!(!(s&(N=0|ze(7,0,3*(15-a|0)|0)))&!(l&C())))break r;if(!(a>>>0<f>>>0))break;a=a+1|0}s|=r=0|ze(0|t,0,56),r=C()|l,A[(t=u)>>2]=s,A[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(A[(N=y+(h<<3)|0)>>2]=s,A[N+4>>2]=-117440513&r,h=h+1|0)}p=p+1|0}while((0|p)!=(0|n));if(_){if(p=((0|n)<0)<<31>>31,d=0|ze(0|E,0,52),g=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){o=4,I=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=h;break n}if(!(!(0|A[(N=b+(o<<3)|0)>>2])&!(0|A[N+4>>2]))){o=4,I=84;break e}}}for(f=0,s=0,l=m;;){do{if(!(!(0|l)&!(0|o))){if(u=0|Qe(0|l,0|o,52),C(),(0|(u&=15))<(0|E)){o=12,I=84;break e}do{if((0|u)==(0|E))r=l,u=o;else{if(r=l|d,t=-15728641&o|g,u>>>0<v>>>0){u=t;break}a=E;do{N=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,r|=N,t=C()|t}while(a>>>0<u>>>0);u=t}}while(0);for(a=0|Ge(0|r,0|u,0|n,0|p),C(),t=0;;){if((0|t)>(0|n)){I=77;break e}if((-117440513&(c=0|A[(N=w+(a<<3)|0)+4>>2]))==(0|u)&&(0|A[N>>2])==(0|r)){I=79;break}if((0|A[(N=w+((a=(a+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|A[N+4>>2])==(0|u))break;t=t+1|0}if(79==(0|I)&&(I=0,!0&100663296==(117440512&c)))break;A[(N=e+(s<<3)|0)>>2]=l,A[N+4>>2]=o,s=s+1|0}}while(0);if((0|(o=f+1|0))>=(0|n)){o=h;break n}f=o,l=0|A[(N=b+(o<<3)|0)>>2],o=0|A[N+4>>2]}}else s=0,o=h}else s=0,o=0}while(0);if(He(0|w,0,0|i),je(0|b,0|y,o<<3),Le(y),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|I))!0&!(117440512&o)?(o=4,I=28):I=22;else if(32==(0|I))x(23313,22674,362,22684);else{if(42==(0|I))return Le(b),Le(w),0|(N=10);if(49==(0|I))return Le(b),Le(w),0|(N=13);if(77==(0|I))x(23313,22674,462,22684);else{if(84==(0|I))return Le(y),Le(b),Le(w),0|(N=o);if(85==(0|I)){je(0|e,0|b,n<<3);break}}}if(22==(0|I))return Le(b),Le(w),0|(N=5);if(28==(0|I))return Le(b),Le(w),0|(N=o)}}while(0);return Le(b),Le(w),0|(N=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:bt,_directedEdgeToCells:function(t,e,n){t|=0;var r,i,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(i=-2130706433&e|134217728,A[(o=n|=0)>>2]=t,A[o+4>>2]=i,A[s>>2]=0,e=0|Qe(0|t,0|e,56),C(),s=0|B(t,i,7&e,s,n+8|0),M=r,0|s):(M=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return i[n>>3]=a,u=0,d=a,d*=6371.007180918475,i[n>>3]=d,M=r,0|u},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return i[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,i[n>>3]=d,M=r,0|u},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+o)*+f(+p)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)<(0|e));return i[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),A=new Int32Array(t),i=new Float64Array(t),n=t,!0},_free:Le,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,i,o=0;return r=M,M=M+16|0,A[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(i=0|Qe(0|t,0|e,56),C(),o=0|B(t,-2130706433&e|134217728,7&i,o,n),M=r,0|o):(M=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(A[n>>2]=t,A[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;i=M,M=M+128|0,f=i+112|0,a=i+96|0,h=i,s=0|Qe(0|(e|=0),0|(n|=0),52),C(),c=15&s,A[f>>2]=c,u=0|Qe(0|e,0|n,45),C(),u&=127;t:do{if(0|U(u)){if(0|c)for(o=1;;){if(!(!((l=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|ze(c+1|0,0,52),h=C()|-15728641&n,h=0|t((l|e)&~(f=0|ze(7,0,3*(14-c|0)|0)),h&~C(),r),M=i,0|h;s=1}else s=0}while(0);if(!(o=0|jt(e,n,a))){s?(St(a,f,h),l=5):(Mt(a,f,h),l=6);t:do{if(0|U(u))if(c)for(o=1;;){if(!(!((u=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);He(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Lt(u=h+(a<<4)|0,0|A[f>>2]),u=0|A[u>>2],-1==(0|(c=0|A[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Dt(u=h+(a<<4)|0,0|A[f>>2],0,1),u=0|A[u>>2],-1==(0|(c=0|A[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=i,0|(h=o)},_getNumCells:ee,_getPentagons:$t,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{ze(0|e,0,45),r=134225919|C(),A[(n=t+(e<<3)|0)>>2]=-1,A[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:R,_gridDistance:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|ue(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|ue(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|_t(a,u),A[(u=i)>>2]=a,A[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,N=0,S=0;if(o=M,M=M+48|0,c=o+12|0,N=o,!(s=0|ue(t|=0,e|=0,t,e,a=o+24|0))&&!(s=0|ue(t,e,n,r,c))){I=((0|(b=0|_t(a,c)))<0)<<31>>31,A[a>>2]=0,A[a+4>>2]=0,A[a+8>>2]=0,A[c>>2]=0,A[c+4>>2]=0,A[c+8>>2]=0,0|ue(t,e,t,e,a)&&x(23313,23090,691,23299),0|ue(t,e,n,r,c)&&x(23313,23090,696,23299),Et(a),Et(c),b?(y=+(0|b),w=a,r=p=0|A[a>>2],s=d=0|A[(v=a+4|0)>>2],n=g=0|A[(E=a+8|0)>>2],_=+((0|A[c>>2])-p|0)/y,m=+((0|A[c+4>>2])-d|0)/y,y=+((0|A[c+8>>2])-g|0)/y):(v=s=a+4|0,E=n=a+8|0,w=a,r=0|A[a>>2],s=0|A[s>>2],n=0|A[n>>2],_=0,m=0,y=0),A[N>>2]=r,A[(g=N+4|0)>>2]=s,A[(d=N+8|0)>>2]=n;t:do{if((0|b)<0)s=0;else for(h=0,p=0,s=r;;){S=_*(f=+(p>>>0)+4294967296*+(0|h))+ +(0|s),l=m*f+ +(0|A[v>>2]),f=y*f+ +(0|A[E>>2]),n=~~+Ye(+S),a=~~+Ye(+l),s=~~+Ye(+f),S=+u(+(+(0|n)-S)),l=+u(+(+(0|a)-l)),f=+u(+(+(0|s)-f));do{if(!(S>l&S>f)){if(c=0-n|0,l>f){r=c-s|0;break}r=a,s=c-a|0;break}n=0-(a+s)|0,r=a}while(0);if(A[N>>2]=n,A[g>>2]=r,A[d>>2]=s,wt(N),0|(s=0|ce(t,e,N,i+(p<<3)|0)))break t;if(!((0|h)<(0|I)|(0|h)==(0|I)&p>>>0<b>>>0)){s=0;break t}s=0|Me(0|p,0|h,1,0),h=c=0|C(),p=s,s=0|A[w>>2]}}while(0);return M=o,0|(N=s)}return M=o,0|(N=s)},_gridPathCellsSize:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|ue(t|=0,e|=0,t,e,a=o+12|0))||(s=0|ue(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|Me(0|(r=0|_t(a,u)),((0|r)<0)<<31>>31,1,0),a=0|C(),A[(u=i)>>2]=r,A[u+4>>2]=a,M=o,0|(u=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var i,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(o=M,M=M+16|0,d=o+8|0,A[(p=i=o)>>2]=t,A[p+4>>2]=e,!n)return A[(d=r)>>2]=t,A[d+4>>2]=e,M=o,0|(d=0);A[d>>2]=0;t:do{if(0|Bt(t,e))t=9;else{if(a=(0|n)>0){s=0,p=t;do{if(0|(t=0|B(p,e,4,d,i)))break t;if(s=s+1|0,0|Bt(p=0|A[(e=i)>>2],e=0|A[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(A[(h=r)>>2]=p,A[h+4>>2]=e,h=n+-1|0,a){f=0,t=1;do{if(s=22384+(f<<2)|0,5==(0|f))for(u=0|A[s>>2],a=0,s=t;;){if(0|(t=0|B(0|A[(t=i)>>2],0|A[t+4>>2],u,d,i)))break t;if((0|a)!=(0|h)){if(c=0|A[(l=i)>>2],l=0|A[l+4>>2],A[(t=r+(s<<3)|0)>>2]=c,A[t+4>>2]=l,0|Bt(c,l)){t=9;break t}t=s+1|0}else t=s;if((0|(a=a+1|0))>=(0|n))break;s=t}else for(u=i,l=0|A[s>>2],c=0,s=t,a=0|A[u>>2],u=0|A[u+4>>2];;){if(0|(t=0|B(a,u,l,d,i)))break t;if(a=0|A[(u=i)>>2],u=0|A[u+4>>2],A[(t=r+(s<<3)|0)>>2]=a,A[t+4>>2]=u,t=s+1|0,0|Bt(a,u)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}f=f+1|0}while(f>>>0<6);u=p,s=0|A[(t=i)>>2],a=e,t=0|A[t+4>>2]}else u=p,s=p,a=e,t=e}else A[(u=r)>>2]=t,A[u+4>>2]=e,u=t,s=t,a=e,t=e;t=(0|u)==(0|s)&(0|a)==(0|t)?0:9}}while(0);return M=o,0|(d=t)},_i64Add:Me,_i64Subtract:Oe,_isPentagon:Bt,_isResClassIII:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),1&e},_isValidCell:Rt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|Qe(0|(t|=0),0|(e|=0),56),C(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Bt(t,n))?0|(n=0):0|(n=0|Rt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,i=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|Rt(t,i=-2130706433&e|134217728)?(o=0|Qe(0|t,0|e,56),C(),i=(o=!(0|ve(t,i,7&o,n)))&((0|A[(i=n)>>2])==(0|t)?(0|A[i+4>>2])==(0|e):0)&1,M=r,0|i):(M=r,0|(i=0))},_latLngToCell:qt,_llvm_maxnum_f64:Ve,_llvm_minnum_f64:qe,_llvm_round_f64:Ye,_localIjToCell:function(t,e,n,r,A){var i,o;return t|=0,e|=0,n|=0,A|=0,o=M,M=M+16|0,i=o,(r|=0)?n=15:(n=0|vt(n,i))||(n=0|ce(t,e,i,A)),M=o,0|n},_malloc:De,_maxFaceCount:function(t,e,n){n|=0;var r=0,i=0;if(i=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&i)))return i=2,A[n>>2]=i,0;if(i=0|Qe(0|t,0|e,52),C(),!(i&=15))return i=5,A[n>>2]=i,0;for(r=1;;){if(!(!((0|ze(7,0,3*(15-r|0)|0))&t)&!(C()&e))){r=2,t=6;break}if(!(r>>>0<i>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(A[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,i=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(i=0|Be(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|C(),n=0|Me(0|t,0|n,1,0),n=0|Me(0|(n=0|Be(0|i,0|r,0|n,0|C())),0|C(),1,0),t=0|C(),A[e>>2]=n,A[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0;if(i=M,M=M+48|0,o=i+16|0,s=i+8|0,a=i,0|(n|=0))return M=i,0|(a=15);if(u=0|A[(c=t|=0)+4>>2],A[(n=s)>>2]=A[c>>2],A[n+4>>2]=u,he(s,o),!(e=0|$(o,e,a))){if(n=0|A[s>>2],(0|(s=0|A[t+8>>2]))>0){o=0|A[t+12>>2],e=0;do{n=(0|A[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|A[(e=a)>>2],(0|(e=0|A[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(A[(e=a)>>2]=n,A[e+4>>2]=s,e=s):n=o,u=0|Me(0|n,0|e,12,0),c=0|C(),A[(e=a)>>2]=u,A[e+4>>2]=c,A[(e=r)>>2]=u,A[e+4>>2]=c,e=0}return M=i,0|(c=e)},_memcpy:je,_memset:He,_originToDirectedEdges:function(t,e,n){n|=0;var r,i=0;return r=!(0|Bt(t|=0,e|=0)),e&=-2130706433,A[(i=n)>>2]=r?t:0,A[i+4>>2]=r?285212672|e:0,A[(i=n+8|0)>>2]=t,A[i+4>>2]=301989888|e,A[(i=n+16|0)>>2]=t,A[i+4>>2]=318767104|e,A[(i=n+24|0)>>2]=t,A[i+4>>2]=335544320|e,A[(i=n+32|0)>>2]=t,A[i+4>>2]=352321536|e,A[(n=n+40|0)>>2]=t,A[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var i,o,s,a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,R=0,B=0,F=0,U=0;if(a=M,M=M+112|0,i=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(n|=0))return M=a,0|(U=15);if(!(U=0|De(32+(A[(p=(t|=0)+8|0)>>2]<<5)|0)))return M=a,0|(U=13);if(pe(t,U),F=0|A[(B=t)+4>>2],A[(n=h)>>2]=A[B>>2],A[n+4>>2]=F,he(h,i),n=0|$(i,e,o))B=0,F=0;else{if(n=0|A[h>>2],(0|(c=0|A[p>>2]))>0){l=0|A[t+12>>2],u=0;do{n=(0|A[l+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|c));u=n}else u=n;c=0|A[(n=o)>>2],(0|(n=0|A[n+4>>2]))<(0|(l=((0|u)<0)<<31>>31))|(0|n)==(0|l)&c>>>0<u>>>0?(A[(n=o)>>2]=u,A[n+4>>2]=l,n=l):u=c,B=0|Me(0|u,0|n,12,0),F=0|C(),A[(n=o)>>2]=B,A[n+4>>2]=F,n=0}if(0|n)return Le(U),M=a,0|(U=n);if(!(u=0|Te(B,8)))return Le(U),M=a,0|(U=13);if(!(f=0|Te(B,8)))return Le(U),Le(u),M=a,0|(U=13);A[(O=i)>>2]=0,A[O+4>>2]=0,R=0|A[(O=t)+4>>2],A[(n=h)>>2]=A[O>>2],A[n+4>>2]=R,n=0|G(h,B,F,e,i,u,f);t:do{if(n)Le(u),Le(f),Le(U);else{e:do{if((0|A[p>>2])>0){for(l=t+12|0,c=0;n=0|G((0|A[l>>2])+(c<<3)|0,B,F,e,i,u,f),c=c+1|0,!(0|n);)if((0|c)>=(0|A[p>>2]))break e;Le(u),Le(f),Le(U);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&He(0|f,0,B<<3),O=0|A[(R=i)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|A[R>>2])>>>0>0){D=u,L=f,T=u,O=f,R=u,n=u,x=u,N=f,S=f,u=f;n:for(;;){for(E=0,w=0,b=0,I=0,c=0,l=0;;){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|P(p=0|A[(e=D+(E<<3)|0)>>2],e=0|A[e+4>>2],1,o,0)){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|Te(7,4))&&(k(p,e,1,o,f,7,0,0),Le(f))}for(v=0;;){_=0|A[(m=o+(v<<3)|0)>>2],m=0|A[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|Ge(0|_,0|m,0|B,0|F),p=0|C(),!(!(0|(h=0|A[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|A[e+4>>2])))){g=0,y=0;do{if((0|g)>(0|F)|(0|g)==(0|F)&y>>>0>B>>>0)break n;if((0|h)==(0|_)&(0|e)==(0|m)){f=c,h=l;break r}d=0|Fe(0|(f=0|Me(0|d,0|p,1,0)),0|C(),0|B,0|F),p=0|C(),y=0|Me(0|y,0|g,1,0),g=0|C(),h=0|A[(e=f=r+(d<<3)|0)>>2],e=0|A[e+4>>2]}while(!(!(0|h)&!(0|e)))}!(0|_)&!(0|m)?(f=c,h=l):(Ht(_,m,s),0|de(t,U,s)&&(y=0|Me(0|c,0|l,1,0),l=0|C(),A[(g=f)>>2]=_,A[g+4>>2]=m,A[(c=L+(c<<3)|0)>>2]=_,A[c+4>>2]=m,c=y),f=c,h=l)}}while(0);if((v=v+1|0)>>>0>=7)break;c=f,l=h}if(E=0|Me(0|E,0|w,1,0),w=0|C(),b=0|Me(0|b,0|I,1,0),I=0|C(),c=0|A[(l=i)>>2],!((0|I)<(0|(l=0|A[l+4>>2]))|(0|I)==(0|l)&b>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{A[(I=D+(c<<3)|0)>>2]=0,A[I+4>>2]=0,c=0|Me(0|c,0|l,1,0),l=0|C(),b=0|A[(I=i)+4>>2]}while((0|l)<(0|b)|((0|l)==(0|b)?c>>>0<(0|A[I>>2])>>>0:0))}if(A[(I=i)>>2]=f,A[I+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=u,E=S,w=R,b=N,I=L,u=x,S=n,N=T,x=v,n=E,R=O,O=w,T=b,L=D,D=I}Le(T),Le(O),Le(U),n=1;break t}n=f}while(0);Le(U),Le(u),Le(n),n=0}}while(0);return M=a,0|(U=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|A[(t|=0)>>2])>>>0)+4294967296*+(0|A[t+4>>2]))},_res0CellCount:function(){return 122},_round:Xe,_sbrk:$e,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,i,o,s){t|=0,r|=0,i|=0,o|=0;var a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(a=M,M=M+16|0,g=a,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return M=a,0|(g=0);if((0|(s|=0))>=16)return M=a,0|(g=12);p=0,d=0,h=0,u=0;t:for(;;){if(f=0|Qe(0|(c=0|A[(l=t+(p<<3)|0)>>2]),0|(l=0|A[l+4>>2]),52),C(),(15&f)>(0|s)){u=12,c=11;break}if(Wt(g,c,l,s),!(0|(l=0|A[(f=g)>>2]))&!(0|(f=0|A[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<i>>>0)){c=10;break t}A[(h=r+(c<<3)|0)>>2]=l,A[h+4>>2]=f,c=0|Me(0|c,0|u,1,0),u=0|C(),Kt(g),l=0|A[(h=g)>>2],f=0|A[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|Me(0|p,0|d,1,0),!((0|(d=0|C()))<(0|n)|(0|d)==(0|n)&p>>>0<e>>>0)){u=0,c=11;break}h=c}return 10==(0|c)?(M=a,0|(g=14)):11==(0|c)?(M=a,0|u):0},_uncompactCellsSize:function(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0;s=M,M=M+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(f=0,u=0,a=0,h=0;;){if(!(!(0|(c=0|A[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|A[l+4>>2]))||(l=!(0|kt(c,l,r,o)),u=0|Me(0|A[(c=o)>>2],0|A[c+4>>2],0|u,0|a),a=0|C(),l))){a=12;break}if(f=0|Me(0|f,0|h,1,0),!((0|(h=0|C()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return A[i>>2]=u,A[i+4>>2]=a,M=s,0|(i=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,i,o,s,a=0,u=0;return s=M,M=M+192|0,i=s,o=s+168|0,a=0|Qe(0|(t|=0),0|(e|=0),56),C(),a&=7,0|(r=0|jt(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,u)?Nt(o,e,a,1,i):Tt(o,e,a,1,i),u=i+8|0,A[n>>2]=A[u>>2],A[n+4>>2]=A[u+4>>2],A[n+8>>2]=A[u+8>>2],A[n+12>>2]=A[u+12>>2],M=s,0|(u=0))},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:it,b:function(t){a=t},c:function(){return a},d:function(t,e,n,r){it("Assertion failed: "+v(t)+", at: "+[e?v(e):"unknown filename",n,r?v(r):"unknown function"])},e:function(t){return n.___errno_location&&(g[n.___errno_location()>>2]=t),t},f:V,g:function(t,e,n){p.set(p.subarray(e,e+n),t)},h:function(t){var e=V(),n=16777216,r=2130706432;if(t>r)return!1;for(var A=Math.max(e,16777216);A<t;)A=A<=536870912?E(2*A,n):Math.min(E((3*A+2147483648)/4,n),r);return!!q(A)},i:function(t){it("OOM")},j:U,k:Q,l:q,m:z,n:function(){var t=z();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),Q(t)},o:24144,p:24128},f);n.___divdi3=H.___divdi3,n.___muldi3=H.___muldi3,n.___remdi3=H.___remdi3,n.___uremdi3=H.___uremdi3,n._areNeighborCells=H._areNeighborCells,n._bitshift64Ashr=H._bitshift64Ashr,n._bitshift64Lshr=H._bitshift64Lshr,n._bitshift64Shl=H._bitshift64Shl,n._calloc=H._calloc,n._cellAreaKm2=H._cellAreaKm2,n._cellAreaM2=H._cellAreaM2,n._cellAreaRads2=H._cellAreaRads2,n._cellToBoundary=H._cellToBoundary,n._cellToCenterChild=H._cellToCenterChild,n._cellToChildPos=H._cellToChildPos,n._cellToChildren=H._cellToChildren,n._cellToChildrenSize=H._cellToChildrenSize,n._cellToLatLng=H._cellToLatLng,n._cellToLocalIj=H._cellToLocalIj,n._cellToParent=H._cellToParent,n._cellToVertex=H._cellToVertex,n._cellToVertexes=H._cellToVertexes,n._cellsToDirectedEdge=H._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=H._cellsToLinkedMultiPolygon,n._childPosToCell=H._childPosToCell,n._compactCells=H._compactCells,n._destroyLinkedMultiPolygon=H._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=H._directedEdgeToBoundary,n._directedEdgeToCells=H._directedEdgeToCells,n._edgeLengthKm=H._edgeLengthKm,n._edgeLengthM=H._edgeLengthM,n._edgeLengthRads=H._edgeLengthRads;var X=n._emscripten_replace_memory=H._emscripten_replace_memory;n._free=H._free,n._getBaseCellNumber=H._getBaseCellNumber,n._getDirectedEdgeDestination=H._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=H._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=H._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=H._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=H._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=H._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=H._getIcosahedronFaces,n._getNumCells=H._getNumCells,n._getPentagons=H._getPentagons,n._getRes0Cells=H._getRes0Cells,n._getResolution=H._getResolution,n._greatCircleDistanceKm=H._greatCircleDistanceKm,n._greatCircleDistanceM=H._greatCircleDistanceM,n._greatCircleDistanceRads=H._greatCircleDistanceRads,n._gridDisk=H._gridDisk,n._gridDiskDistances=H._gridDiskDistances,n._gridDistance=H._gridDistance,n._gridPathCells=H._gridPathCells,n._gridPathCellsSize=H._gridPathCellsSize,n._gridRingUnsafe=H._gridRingUnsafe,n._i64Add=H._i64Add,n._i64Subtract=H._i64Subtract,n._isPentagon=H._isPentagon,n._isResClassIII=H._isResClassIII,n._isValidCell=H._isValidCell,n._isValidDirectedEdge=H._isValidDirectedEdge,n._isValidVertex=H._isValidVertex,n._latLngToCell=H._latLngToCell,n._llvm_maxnum_f64=H._llvm_maxnum_f64,n._llvm_minnum_f64=H._llvm_minnum_f64,n._llvm_round_f64=H._llvm_round_f64,n._localIjToCell=H._localIjToCell,n._malloc=H._malloc,n._maxFaceCount=H._maxFaceCount,n._maxGridDiskSize=H._maxGridDiskSize,n._maxPolygonToCellsSize=H._maxPolygonToCellsSize,n._memcpy=H._memcpy,n._memset=H._memset,n._originToDirectedEdges=H._originToDirectedEdges,n._pentagonCount=H._pentagonCount,n._polygonToCells=H._polygonToCells,n._readInt64AsDoubleFromPointer=H._readInt64AsDoubleFromPointer,n._res0CellCount=H._res0CellCount,n._round=H._round,n._sbrk=H._sbrk,n._sizeOfCellBoundary=H._sizeOfCellBoundary,n._sizeOfCoordIJ=H._sizeOfCoordIJ,n._sizeOfGeoLoop=H._sizeOfGeoLoop,n._sizeOfGeoPolygon=H._sizeOfGeoPolygon,n._sizeOfH3Index=H._sizeOfH3Index,n._sizeOfLatLng=H._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=H._sizeOfLinkedGeoPolygon,n._uncompactCells=H._uncompactCells,n._uncompactCellsSize=H._uncompactCellsSize,n._vertexToLatLng=H._vertexToLatLng,n.establishStackSpace=H.establishStackSpace;var $,W,K=n.stackAlloc=H.stackAlloc,Z=n.stackRestore=H.stackRestore,J=n.stackSave=H.stackSave;if(n.asm=H,n.cwrap=function(t,e,n,r){var A=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&A&&!r?c(t):function(){return l(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":h[t|0]=e;break;case"i16":d[t>>1]=e;break;case"i32":g[t>>2]=e;break;case"i64":k=[e>>>0,(P=e,+D(P)>=1?P>0?(0|M(+T(P/4294967296),4294967295))>>>0:~~+L((P-+(~~P>>>0))/4294967296)>>>0:0)],g[t>>2]=k[0],g[t+4>>2]=k[1];break;case"float":y[t>>2]=e;break;case"double":_[t>>3]=e;break;default:it("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return h[t|0];case"i16":return d[t>>1];case"i32":case"i64":return g[t>>2];case"float":return y[t>>2];case"double":return _[t>>3];default:it("invalid type for getValue: "+e)}return null},B){G(B)||($=B,B=n.locateFile?n.locateFile($,i):i+$),O++,n.monitorRunDependencies&&n.monitorRunDependencies(O);var tt=function(t){t.byteLength&&(t=new Uint8Array(t)),p.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(O--,n.monitorRunDependencies&&n.monitorRunDependencies(O),0==O&&R){var t=R;R=null,t()}}()},et=function(){A(B,tt,(function(){throw"could not load memory initializer "+B}))},nt=j(B);if(nt)tt(nt.buffer);else if(n.memoryInitializerRequest){var rt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=j(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+B),void et();e=r.buffer}tt(e)};n.memoryInitializerRequest.response?setTimeout(rt,0):n.memoryInitializerRequest.addEventListener("load",rt)}else et()}function At(t){function e(){W||(W=!0,u||(I(x),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),S.unshift(t);var t;I(S)}()))}O>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),C.unshift(t);var t;I(C)}(),O>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function it(t){throw n.onAbort&&n.onAbort(t),o(t+=""),s(t),u=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(R=function t(){W||At(),W||(R=t)},n.run=At,n.abort=it,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return At(),t}("object"==typeof _A?_A:{}),mA="number",vA=[["sizeOfH3Index",mA],["sizeOfLatLng",mA],["sizeOfCellBoundary",mA],["sizeOfGeoLoop",mA],["sizeOfGeoPolygon",mA],["sizeOfLinkedGeoPolygon",mA],["sizeOfCoordIJ",mA],["readInt64AsDoubleFromPointer",mA],["isValidCell",mA,[mA,mA]],["latLngToCell",mA,[mA,mA,mA,mA]],["cellToLatLng",mA,[mA,mA,mA]],["cellToBoundary",mA,[mA,mA,mA]],["maxGridDiskSize",mA,[mA,mA]],["gridDisk",mA,[mA,mA,mA,mA]],["gridDiskDistances",mA,[mA,mA,mA,mA,mA]],["gridRingUnsafe",mA,[mA,mA,mA,mA]],["maxPolygonToCellsSize",mA,[mA,mA,mA,mA]],["polygonToCells",mA,[mA,mA,mA,mA]],["cellsToLinkedMultiPolygon",mA,[mA,mA,mA]],["destroyLinkedMultiPolygon",null,[mA]],["compactCells",mA,[mA,mA,mA,mA]],["uncompactCells",mA,[mA,mA,mA,mA,mA,mA]],["uncompactCellsSize",mA,[mA,mA,mA,mA,mA]],["isPentagon",mA,[mA,mA]],["isResClassIII",mA,[mA,mA]],["getBaseCellNumber",mA,[mA,mA]],["getResolution",mA,[mA,mA]],["maxFaceCount",mA,[mA,mA,mA]],["getIcosahedronFaces",mA,[mA,mA,mA]],["cellToParent",mA,[mA,mA,mA,mA]],["cellToChildren",mA,[mA,mA,mA,mA]],["cellToCenterChild",mA,[mA,mA,mA,mA]],["cellToChildrenSize",mA,[mA,mA,mA,mA]],["cellToChildPos",mA,[mA,mA,mA,mA]],["childPosToCell",mA,[mA,mA,mA,mA,mA,mA]],["areNeighborCells",mA,[mA,mA,mA,mA,mA]],["cellsToDirectedEdge",mA,[mA,mA,mA,mA,mA]],["getDirectedEdgeOrigin",mA,[mA,mA,mA]],["getDirectedEdgeDestination",mA,[mA,mA,mA]],["isValidDirectedEdge",mA,[mA,mA]],["directedEdgeToCells",mA,[mA,mA,mA]],["originToDirectedEdges",mA,[mA,mA,mA]],["directedEdgeToBoundary",mA,[mA,mA,mA]],["gridDistance",mA,[mA,mA,mA,mA,mA]],["gridPathCells",mA,[mA,mA,mA,mA,mA]],["gridPathCellsSize",mA,[mA,mA,mA,mA,mA]],["cellToLocalIj",mA,[mA,mA,mA,mA,mA,mA]],["localIjToCell",mA,[mA,mA,mA,mA,mA]],["getHexagonAreaAvgM2",mA,[mA,mA]],["getHexagonAreaAvgKm2",mA,[mA,mA]],["getHexagonEdgeLengthAvgM",mA,[mA,mA]],["getHexagonEdgeLengthAvgKm",mA,[mA,mA]],["greatCircleDistanceM",mA,[mA,mA]],["greatCircleDistanceKm",mA,[mA,mA]],["greatCircleDistanceRads",mA,[mA,mA]],["cellAreaM2",mA,[mA,mA,mA]],["cellAreaKm2",mA,[mA,mA,mA]],["cellAreaRads2",mA,[mA,mA,mA]],["edgeLengthM",mA,[mA,mA,mA]],["edgeLengthKm",mA,[mA,mA,mA]],["edgeLengthRads",mA,[mA,mA,mA]],["getNumCells",mA,[mA,mA]],["getRes0Cells",mA,[mA]],["res0CellCount",mA],["getPentagons",mA,[mA,mA]],["pentagonCount",mA],["cellToVertex",mA,[mA,mA,mA,mA]],["cellToVertexes",mA,[mA,mA,mA]],["vertexToLatLng",mA,[mA,mA,mA]],["isValidVertex",mA,[mA,mA]]],EA=4,wA={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};wA[EA]="Resolution argument was outside of acceptable range",wA[5]="Cell argument was not valid",wA[6]="Directed edge argument was not valid",wA[7]="Undirected edge argument was not valid",wA[8]="Vertex argument was not valid",wA[9]="Pentagon distortion was encountered",wA[10]="Duplicate input",wA[11]="Cell arguments were not neighbors",wA[12]="Cell arguments had incompatible resolutions",wA[13]="Memory allocation failed",wA[14]="Bounds of provided memory were insufficient",wA[15]="Mode or flags argument was not valid";var bA=1001,IA=1002,CA={1e3:"Unknown unit"};CA[bA]="Array length out of bounds",CA[IA]="Got unexpected null value for H3 index";var xA="Unknown error";function NA(t,e,n){var r=n&&"value"in n,A=new Error((t[e]||xA)+" (code: "+e+(r?", value: "+n.value:"")+")");return A.code=e,A}function SA(t,e){return NA(wA,t,2===arguments.length?{value:e}:{})}function DA(t,e){return NA(CA,t,2===arguments.length?{value:e}:{})}function LA(t){if(0!==t)throw SA(t)}var TA={};vA.forEach((function(t){TA[t[0]]=_A.cwrap.apply(_A,t)}));var MA=16,OA=4,RA=8,PA=TA.sizeOfH3Index(),kA=TA.sizeOfLatLng(),BA=TA.sizeOfCellBoundary(),FA=TA.sizeOfGeoPolygon(),GA=TA.sizeOfGeoLoop();function UA(t){if(!t)throw DA(IA);return t}TA.sizeOfLinkedGeoPolygon(),TA.sizeOfCoordIJ();var QA=Math.pow(2,32)-1;var zA=/[^0-9a-fA-F]/;function VA(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||zA.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),MA);return[parseInt(t.substring(t.length-8),MA),e]}function qA(t){if(t>=0)return t.toString(MA);var e=YA(8,(t&=2147483647).toString(MA));return e=(parseInt(e[0],MA)+8).toString(MA)+e.substring(1)}function YA(t,e){for(var n=t-e.length,r="",A=0;A<n;A++)r+="0";return r+=e}var jA=Math.pow(2,32);function HA(t,e,n){for(var r=t.length,A=_A._calloc(r,kA),i=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)_A.HEAPF64.set([t[s/2][i],t[s/2][o]].map(ei),A/RA+s);return _A.HEAPU32.set([r,A],e/OA),e}function XA(t,e){void 0===e&&(e=0);var n=_A.getValue(t+PA*e,"i32"),r=_A.getValue(t+PA*e+OA,"i32");return r?function(t,e){return qA(e)+YA(8,qA(t))}(n,r):null}function $A(t){return function(t){return 180*t/Math.PI}(_A.getValue(t,"double"))}function WA(t){return[$A(t+RA),$A(t)]}function KA(t,e){var n=_A._malloc(BA),r=VA(t),A=r[0],i=r[1];try{return LA(TA.cellToBoundary(A,i,n)),function(t){for(var e=_A.getValue(t,"i32"),n=t+RA,r=[],A=WA,i=0;i<2*e;i+=2)r.push(A(n+RA*i));return r.push(r[0]),r}(n)}finally{_A._free(n)}}function ZA(t,e){var n=VA(t),r=n[0],A=n[1],i=_A._malloc(PA);try{return LA(TA.cellToParent(r,A,e,i)),UA(XA(i))}finally{_A._free(i)}}function JA(t,e,n){var r,A="number"!=typeof(r=t)?[0,0]:[0|r,r/jA|0],i=A[0],o=A[1],s=VA(e),a=s[0],u=s[1],c=_A._malloc(PA);try{return LA(TA.childPosToCell(i,o,a,u,n,c)),UA(XA(c))}finally{_A._free(c)}}function ti(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw SA(EA,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,A=function(t,e){var n,r=t.length-1,A=_A._calloc(FA),i=0+GA,o=i+OA;if(HA(t[0],A+0,e),r>0){n=_A._calloc(r,GA);for(var s=0;s<r;s++)HA(t[s+1],n+GA*s,e)}return _A.setValue(A+i,r,"i32"),_A.setValue(A+o,n,"i32"),A}("number"==typeof t[0][0]?[t]:t,n),i=_A._malloc(8);try{LA(TA.maxPolygonToCellsSize(A,e,0,i));var o=function(t){if(t>QA)throw DA(bA,t);return t}((r=i,TA.readInt64AsDoubleFromPointer(r))),s=_A._calloc(o,PA);try{return LA(TA.polygonToCells(A,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var A=XA(t,r);null!==A&&n.push(A)}return n}(s,o)}finally{_A._free(s)}}finally{_A._free(i),function(t){var e=0+GA,n=e+OA,r=OA;_A._free(_A.getValue(t+0+r,"i8*"));var A=_A.getValue(t+e,"i32");if(A>0){for(var i=_A.getValue(t+n,"i32"),o=0;o<A;o++)_A._free(_A.getValue(i+GA*o+r,"i8*"));_A._free(i)}_A._free(t)}(A)}}function ei(t){return t*Math.PI/180}const ni=({icao:t,mapping:e})=>{if(!t)throw new aA("Missing ICAO code.");if(!e)throw new aA("Missing aircraft mapping.");const n=e.find((e=>e.icao.toUpperCase()===t.toUpperCase()))?.group;if(!n)throw new aA(`Aircraft type not found for ICAO: ${t}`);return n},ri=t=>void 0===t,Ai=t=>"function"==typeof t,ii=t=>"object"==typeof t,oi=t=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},si=(t,e)=>{if(ri(e))return!1;const n=ii(e),r=Array.isArray(e);return n&&!r?Object.keys(e).some((n=>si(t?.[n],e[n]))):r?e.some(((e,n)=>si(t?.[n],e))):t!==e},ai=({current:t,next:e})=>Object.keys(e).reduce(((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t)),{...t}),ui=({current:t,next:e})=>{const n=new Set,r=!ri(t)&&ii(t);if(!(!ri(e)&&ii(e)))return n;const A=Object.keys(e);return r?(A.forEach((r=>{si(t[r],e[r])&&n.add(r)})),n):(A.forEach((t=>n.add(t))),n)};var ci=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:(t,e)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>t(...r)),e)}},getChangedFields:ui,getTimer:oi,isChanged:si,isFunction:Ai,isObject:ii,isUndefined:ri,mapAircraftIcaoToAircraftType:ni,mergeByProperty:(t,e,n)=>{const r=[...t];return e.forEach((t=>{let e=r.find((e=>t[n]===e[n]));e?Object.assign(e,t):r.push(t)})),r},mergeWithoutUndefined:ai,parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:(t,e)=>{let n=0;return(...r)=>{const A=(new Date).getTime();A-n<e||(n=A,t(...r))}}}),li=6371008.8,fi={centimeters:100*li,centimetres:100*li,degrees:li/111325,feet:3.28084*li,inches:39.37*li,kilometers:li/1e3,kilometres:li/1e3,meters:li,metres:li,miles:li/1609.344,millimeters:1e3*li,millimetres:1e3*li,nauticalmiles:li/1852,radians:1,yards:1.0936*li};function hi(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function pi(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ei(t[0])||!Ei(t[1]))throw new Error("coordinates must contain numbers");return hi({type:"Point",coordinates:t},e,n)}function di(t,e,n){void 0===n&&(n={});for(var r=0,A=t;r<A.length;r++){var i=A[r];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return hi({type:"Polygon",coordinates:t},e,n)}function gi(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function yi(t,e){void 0===e&&(e="kilometers");var n=fi[e];if(!n)throw new Error(e+" units is invalid");return t*n}function _i(t,e){void 0===e&&(e="kilometers");var n=fi[e];if(!n)throw new Error(e+" units is invalid");return t/n}function mi(t){return t%360*Math.PI/180}function vi(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return yi(_i(t,e),n)}function Ei(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function wi(t,e,n){if(null!==t)for(var r,A,i,o,s,a,u,c,l=0,f=0,h=t.type,p="FeatureCollection"===h,d="Feature"===h,g=p?t.features.length:1,y=0;y<g;y++){s=(c=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var m=0,v=0;if(null!==(o=c?u.geometries[_]:u)){a=o.coordinates;var E=o.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===e(a,f,y,m,v))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<a.length;r++){if(!1===e(a[r],f,y,m,v))return!1;f++,"MultiPoint"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(A=0;A<a[r].length-l;A++){if(!1===e(a[r][A],f,y,m,v))return!1;f++}"MultiLineString"===E&&m++,"Polygon"===E&&v++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,A=0;A<a[r].length;A++){for(i=0;i<a[r][A].length-l;i++){if(!1===e(a[r][A][i],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===wi(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bi(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Ii(t,e){var n,r,A,i,o,s,a,u,c,l,f=0,h="FeatureCollection"===t.type,p="Feature"===t.type,d=h?t.features.length:1;for(n=0;n<d;n++){for(s=h?t.features[n].geometry:p?t.geometry:t,u=h?t.features[n].properties:p?t.properties:{},c=h?t.features[n].bbox:p?t.bbox:void 0,l=h?t.features[n].id:p?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,A=0;A<o;A++)if(null!==(i=a?s.geometries[A]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===e(i.geometries[r],f,u,c,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,c,l))return!1;f++}}function Ci(t){var e=[1/0,1/0,-1/0,-1/0];return wi(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function xi(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ni(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Si(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return Si(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Li(t);default:throw new Error("unknown GeoJSON type")}}function Si(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=Di(t.properties),e.geometry=Li(t.geometry),e}function Di(t){var e={};return t?(Object.keys(t).forEach((function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map((function(t){return t})):e[n]=Di(r):e[n]=r})),e):e}function Li(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Li(t)})),e):(e.coordinates=Ti(t.coordinates),e)}function Ti(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Ti(t)}))}function Mi(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),A=Number(t[2]),i=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[n,r];return di([[o,[A,r],[A,i],[n,i],o]],e.properties,{bbox:t,id:e.id})}function Oi(t,e){void 0===e&&(e={});var n=Ci(t);return pi([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function Ri(t,e,n){void 0===n&&(n={});var r=xi(t),A=xi(e);A[0]+=A[0]-r[0]>180?-360:r[0]-A[0]>180?360:0;var i=function(t,e,n){var r=n=void 0===n?li:Number(n),A=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-A,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(A/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(A);return Math.sqrt(o*o+u*u*s*s)*r}(r,A);return vi(i,"meters",n.units)}Ci.default=Ci;var Pi=6378137;function ki(t){return function(t,e,n){var r=n;return Ii(t,(function(t,A,i,o,s){r=0===A&&void 0===n?t:e(r,t,A,i,o,s)})),r}(t,(function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Bi(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Bi(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}function Bi(t){var e=0;if(t&&t.length>0){e+=Math.abs(Fi(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Fi(t[n]))}return e}function Fi(t){var e,n,r,A,i,o,s=0,a=t.length;if(a>2){for(o=0;o<a;o++)o===a-2?(r=a-2,A=a-1,i=0):o===a-1?(r=a-1,A=0,i=1):(r=o,A=o+1,i=o+2),e=t[r],n=t[A],s+=(Gi(t[i][0])-Gi(e[0]))*Math.sin(Gi(n[1]));s=s*Pi*Pi/2}return s}function Gi(t){return t*Math.PI/180}function Ui(t,e){var n=mi(t[1]),r=mi(e[1]),A=mi(e[0]-t[0]);A>Math.PI&&(A-=2*Math.PI),A<-Math.PI&&(A+=2*Math.PI);var i=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(A,i))+360)%360}function Qi(t,e,n,r){void 0===r&&(r={});var A=e<0,i=vi(Math.abs(e),r.units,"meters");A&&(i=-Math.abs(i));var o=xi(t),s=function(t,e,n,r){r=void 0===r?li:Number(r);var A=e/r,i=t[0]*Math.PI/180,o=mi(t[1]),s=mi(n),a=A*Math.cos(s),u=o+a;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),l=Math.abs(c)>1e-11?a/c:Math.cos(o),f=A*Math.sin(s)/l;return[(180*(i+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,i,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,pi(s,r.properties)}function zi(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,A=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(A)||"object"==typeof A;return!0!==i&&(t=Ni(t)),"FeatureCollection"!==t.type||o?Vi(t,e,A):(bi(t,(function(n,r){t.features[r]=Vi(n,e,A)})),t)}function Vi(t,e,n){var r,A="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return xi(e);var n=t.bbox?t.bbox:Ci(t),r=n[0],A=n[1],i=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return pi([r,A]);case"se":case"southeast":case"eastsouth":case"bottomright":return pi([i,A]);case"nw":case"northwest":case"westnorth":case"topleft":return pi([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return pi([i,o]);case"center":return Oi(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,A=0;return wi(t,(function(t){n+=t[0],r+=t[1],A++}),!0),pi([n/A,r/A],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||A||wi(t,(function(t){var r,A,i,o,s=Ri(n,t),a=(r=n,A=t,void 0===i&&(i={}),(o=i.final?Ui(xi(A),xi(r)):Ui(xi(r),xi(A)))>180?-(360-o):o),u=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Qi(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)})),t}var qi={exports:{}};!function(t,e){!function(t){function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function A(t){this.message=t||""}function i(){}function o(t){return null===t?Rt:t.color}function s(t){return null===t?null:t.parent}function a(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function l(){this.root_=null,this.size_=0}function f(){}function h(){this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}function p(){}function d(t){this.message=t||""}function g(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var A=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(A=A<0?Math.max(n+arguments[2],0):Math.min(A,n);r<A;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},v={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},v.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,v);var E=function(){},w=function(){},b=function(){},I=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},C={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};I.prototype.setOrdinate=function(t,e){switch(t){case I.X:this.x=e;break;case I.Y:this.y=e;break;case I.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},I.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},I.prototype.getOrdinate=function(t){switch(t){case I.X:return this.x;case I.Y:return this.y;case I.Z:return this.z}throw new _("Invalid ordinate index: "+t)},I.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},I.prototype.equals=function(t){return t instanceof I&&this.equals2D(t)},I.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},I.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},I.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},I.prototype.hashCode=function(){var t=17;return 37*(t=37*t+I.hashCode(this.x))+I.hashCode(this.y)},I.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},I.prototype.interfaces_=function(){return[E,w,e]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(1===arguments.length){var t=arguments[0];return m.doubleToLongBits(t),Math.trunc(0)}},C.DimensionalComparator.get=function(){return x},C.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},C.NULL_ORDINATE.get=function(){return m.NaN},C.X.get=function(){return 0},C.Y.get=function(){return 1},C.Z.get=function(){return 2},Object.defineProperties(I,C);var x=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};x.prototype.compare=function(t,e){var n=t,r=e,A=x.compare(n.x,r.x);if(0!==A)return A;var i=x.compare(n.y,r.y);return 0!==i?i:this._dimensionsToTest<=2?0:x.compare(n.z,r.z)},x.prototype.interfaces_=function(){return[b]},x.prototype.getClass=function(){return x},x.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var N=function(){};N.prototype.create=function(){},N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N};var S=function(){},D={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new _("Unknown location value: "+t)},D.INTERIOR.get=function(){return 0},D.BOUNDARY.get=function(){return 1},D.EXTERIOR.get=function(){return 2},D.NONE.get=function(){return-1},Object.defineProperties(S,D);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},T=function(){},M={LOG_10:{configurable:!0}};T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var A=t;return e<A&&(A=e),n<A&&(A=n),r<A&&(A=r),A},T.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],A=arguments[1],i=arguments[2];return r<A?A:r>i?i:r}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],A=arguments[2],i=arguments[3],o=arguments[0];return r>o&&(o=r),A>o&&(o=A),i>o&&(o=i),o}},T.average=function(t,e){return(t+e)/2},M.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,M);var O=function(t){this.str=t};O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str};var R=function(t){this.value=t};R.prototype.intValue=function(){return this.value},R.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},R.isNaN=function(t){return Number.isNaN(t)};var P=function(){};P.isWhitespace=function(t){return t<=32&&t>=0||127===t},P.toUpperCase=function(t){return t.toUpperCase()};var k=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r,A)}},B={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}};k.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},k.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=k.magnitude(n._hi),A=k.TEN.pow(r);(n=n.divide(A)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var i=r+1,o=new O,s=k.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===i&&o.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,l=0;u>9?(c=!0,l="9"):l="0"+u,o.append(l),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var f=!0,h=k.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},k.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},k.prototype.isZero=function(){return 0===this._hi&&0===this._lo},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(t){return this.le(t)?this:t},k.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=null,i=null,o=null,s=null,a=null,u=null,c=null,l=null;return a=this._hi/n,l=(A=(u=k.SPLIT*a)-(A=u-a))*(o=(l=k.SPLIT*n)-(o=l-n))-(c=a*n)+A*(s=n-o)+(i=a-A)*o+i*s,l=a+(u=(this._hi-c-l+this._lo-a*r)/n),this._hi=l,this._lo=a-l+u,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var t=arguments[0],e=null,n=null,r=null,A=null,i=null,o=null,s=null,a=null;return n=(i=this._hi/t._hi)-(e=(o=k.SPLIT*i)-(e=o-i)),a=e*(r=(a=k.SPLIT*t._hi)-(r=a-t._hi))-(s=i*t._hi)+e*(A=t._hi-r)+n*r+n*A,o=(this._hi-s-a+this._lo-i*t._lo)/t._hi,new k(a=i+o,i-a+o)}if("number"==typeof arguments[0]){var u=arguments[0];return m.isNaN(u)?k.createNaN():k.copy(this).selfDivide(u,0)}},k.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},k.prototype.pow=function(t){if(0===t)return k.valueOf(1);var e=new k(this),n=k.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new k(t,e)},k.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},k.prototype.max=function(t){return this.ge(t)?this:t},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=k.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},k.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,A=null,i=null,o=null,s=null;return i=(A=this._hi+e)-(o=A-this._hi),r=(s=(i=e-o+(this._hi-i))+this._lo)+(A-(n=A+s)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var a=arguments[0],u=arguments[1],c=null,l=null,f=null,h=null,p=null,d=null,g=null;h=this._hi+a,l=this._lo+u,p=h-(d=h-this._hi),f=l-(g=l-this._lo);var y=(c=h+(d=(p=a-d+(this._hi-p))+l))+(d=(f=u-g+(this._lo-f))+(d+(h-c))),_=d+(c-y);return this._hi=y,this._lo=_,this}},k.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=null,i=null,o=null,s=null,a=null,u=null;A=(a=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,A=a-A,i=this._hi-A,o=u-n;var c=(a=this._hi*n)+(u=A*(o=u-o)-a+A*(s=n-o)+i*o+i*s+(this._hi*r+this._lo*n)),l=u+(A=a-c);return this._hi=c,this._lo=l,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new k(t,e)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var t=arguments[0];return t.isNaN()?k.createNaN():k.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return m.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var t=k.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,A=n;if("."===n.charAt(0))A="0"+n;else if(r<0)A="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var i=r-n.length;A=n+k.stringOfChar("0",i)+".0"}return this.isNegative()?"-"+A:A},k.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,A=null,i=null,o=null,s=null;e=(A=1/this._hi)-(t=(i=k.SPLIT*A)-(t=i-A)),n=(s=k.SPLIT*this._hi)-this._hi;var a=A+(i=(1-(o=A*this._hi)-(s=t*(n=s-n)-o+t*(r=this._hi-n)+e*n+e*r)-A*this._lo)/this._hi);return new k(a,A-a+i)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=k.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var A="";n.length>1&&(A=n.substring(1));var i=n.charAt(0)+"."+A;return this.isNegative()?"-"+i+r:i+r},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},k.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var t=arguments[0];return k.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return k.copy(this).selfAdd(e)}},k.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof k){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},k.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},k.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[e,E,w]},k.prototype.getClass=function(){return k},k.sqr=function(t){return k.valueOf(t).selfMultiply(t)},k.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return k.parse(t)}if("number"==typeof arguments[0])return new k(arguments[0])},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;P.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var A=t.charAt(e);"-"!==A&&"+"!==A||(e++,"-"===A&&(r=!0))}for(var i=new k,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,P.isDigit(u)){var c=u-"0";i.selfMultiply(k.TEN),i.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=R.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}s=o}}var f=i,h=o-s-a;if(0===h)f=i;else if(h>0){var p=k.TEN.pow(h);f=i.divide(p)}else if(h<0){var d=k.TEN.pow(-h);f=i.multiply(d)}return r?f.negate():f},k.createNaN=function(){return new k(m.NaN,m.NaN)},k.copy=function(t){return new k(t)},k.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},k.stringOfChar=function(t,e){for(var n=new O,r=0;r<e;r++)n.append(t);return n.toString()},B.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},B.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},B.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},B.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},B.NaN.get=function(){return new k(m.NaN,m.NaN)},B.EPS.get=function(){return 123259516440783e-46},B.SPLIT.get=function(){return 134217729},B.MAX_PRINT_DIGITS.get=function(){return 32},B.TEN.get=function(){return k.valueOf(10)},B.ONE.get=function(){return k.valueOf(1)},B.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},B.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,B);var F=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.orientationIndex=function(t,e,n){var r=F.orientationIndexFilter(t,e,n);if(r<=1)return r;var A=k.valueOf(e.x).selfAdd(-t.x),i=k.valueOf(e.y).selfAdd(-t.y),o=k.valueOf(n.x).selfAdd(-e.x),s=k.valueOf(n.y).selfAdd(-e.y);return A.selfMultiply(s).selfSubtract(i.selfMultiply(o)).signum()},F.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},F.intersection=function(t,e,n,r){var A=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),i=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),o=A.subtract(i),s=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),a=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),f=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new I(c,p)},F.orientationIndexFilter=function(t,e,n){var r=null,A=(t.x-n.x)*(e.y-n.y),i=(t.y-n.y)*(e.x-n.x),o=A-i;if(A>0){if(i<=0)return F.signum(o);r=A+i}else{if(!(A<0))return F.signum(o);if(i>=0)return F.signum(o);r=-A-i}var s=F.DP_SAFE_EPSILON*r;return o>=s||-o>=s?F.signum(o):2},F.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,G);var U=function(){},Q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Q.X.get=function(){return 0},Q.Y.get=function(){return 1},Q.Z.get=function(){return 2},Q.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,Q);var z=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(z),q=function(){};q.arraycopy=function(t,e,n,r,A){for(var i=0,o=e;o<e+A;o++)n[r+i]=t[o],i++},q.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var A=arguments[0],i=arguments[1];this.x=A.y*i.w-i.y*A.w,this.y=i.x*A.w-A.x*i.w,this.w=A.x*i.y-i.x*A.y}else if(arguments[0]instanceof I&&arguments[1]instanceof I){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2];this.x=a,this.y=u,this.w=c}else if(4===arguments.length){var l=arguments[0],f=arguments[1],h=arguments[2],p=arguments[3],d=l.y-f.y,g=f.x-l.x,y=l.x*f.y-f.x*l.y,_=h.y-p.y,m=p.x-h.x,v=h.x*p.y-p.x*h.y;this.x=g*v-m*y,this.y=_*y-d*v,this.w=d*m-_*g}};Y.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},Y.prototype.getCoordinate=function(){var t=new I;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var A=t.y-e.y,i=e.x-t.x,o=t.x*e.y-e.x*t.y,s=n.y-r.y,a=r.x-n.x,u=n.x*r.y-r.x*n.y,c=A*a-s*i,l=(i*u-a*o)/c,f=(s*o-A*u)/c;if(m.isNaN(l)||m.isInfinite(l)||m.isNaN(f)||m.isInfinite(f))throw new V;return new I(l,f)};var j=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof I){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r.x,A.x,r.y,A.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(i,o,s,a)}},H={serialVersionUID:{configurable:!0}};j.prototype.getArea=function(){return this.getWidth()*this.getHeight()},j.prototype.equals=function(t){if(!(t instanceof j))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},j.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new j;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,A=this._maxy<t._maxy?this._maxy:t._maxy;return new j(e,r,n,A)},j.prototype.isNull=function(){return this._maxx<this._minx},j.prototype.getMaxX=function(){return this._maxx},j.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof j){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},j.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof I){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},j.prototype.getMinY=function(){return this._miny},j.prototype.getMinX=function(){return this._minx},j.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},j.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},j.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},j.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},j.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},j.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},j.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},j.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},j.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},j.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},j.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof I){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},j.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},j.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];A<i?(this._minx=A,this._maxx=i):(this._minx=i,this._maxx=A),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},j.prototype.getMaxY=function(){return this._maxy},j.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},j.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+I.hashCode(this._minx))+I.hashCode(this._maxx))+I.hashCode(this._miny))+I.hashCode(this._maxy)},j.prototype.interfaces_=function(){return[E,e]},j.prototype.getClass=function(){return j},j.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=Math.min(i.x,o.x),a=Math.max(i.x,o.x),u=Math.min(r.x,A.x),c=Math.max(r.x,A.x);return!(u>a||c<s||(s=Math.min(i.y,o.y),a=Math.max(i.y,o.y),u=Math.min(r.y,A.y),c=Math.max(r.y,A.y),u>a||c<s))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(j,H);var X={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*$/},$=function(t){this.geometryFactory=t||new ye};$.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var A=X.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((A=X.emptyTypeStr.exec(t))[2]=void 0),A&&(n=A[1].toLowerCase(),r=A[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},$.prototype.write=function(t){return this.extractGeometry(t)},$.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!W[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+W[e].apply(this,[t])+")"};var W={coordinate:function(t){return t.x+" "+t.y},point:function(t){return W.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(W.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(W.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+W.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+W.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(X.spaces);return this.geometryFactory.createPoint(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(X.spaces),r.push(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(X.spaces),r.push(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(X.parenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,A,i=t.trim().split(X.parenComma),o=[],s=0,a=i.length;s<a;++s)e=i[s].replace(X.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?A=r:o.push(r);return this.geometryFactory.createPolygon(A,o)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(X.doubleParenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,A=e.length;r<A;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Z=function(t){this.parser=new $(t)};Z.prototype.write=function(t){return this.parser.write(t)},Z.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var J=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(J),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 I,this._intPt[1]=new I,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return Z.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Z.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),A=Math.abs(n.y-e.y),i=-1;if(t.equals(e))i=0;else if(t.equals(n))i=r>A?r:A;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(i=r>A?o:s)||t.equals(e)||(i=Math.max(o,s))}return et.isTrue(!(0===i&&!t.equals(e)),"Bad distance calculation"),i},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,A=t.y-e.y,i=Math.sqrt(r*r+A*A);return et.isTrue(!(0===i&&!t.equals(e)),"Invalid distance calculation"),i},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,j.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,A){A.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),A.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,A){var i=null;try{i=Y.intersection(t,n,r,A)}catch(o){if(!(o instanceof V))throw o;i=e.nearestEndpoint(t,n,r,A)}return i},e.prototype.intersection=function(t,n,r,A){var i=this.intersectionWithNormalization(t,n,r,A);return this.isInSegmentEnvelopes(i)||(i=new I(e.nearestEndpoint(t,n,r,A))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i},e.prototype.smallestInAbsValue=function(t,e,n,r){var A=t,i=Math.abs(A);return Math.abs(e)<i&&(A=e,i=Math.abs(e)),Math.abs(n)<i&&(A=n,i=Math.abs(n)),Math.abs(r)<i&&(A=r),A},e.prototype.checkDD=function(t,e,n,r,A){var i=F.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(i);q.out.println("DD in env = "+o+" --------------------- "+i),A.distance(i)>1e-4&&q.out.println("Distance = "+A.distance(i))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var A=new I(t),i=new I(e),o=new I(n),s=new I(r),a=new I;this.normalizeToEnvCentre(A,i,o,s,a);var u=this.safeHCoordinateIntersection(A,i,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,A){var i=j.intersects(e,n,r),o=j.intersects(e,n,A),s=j.intersects(r,A,e),a=j.intersects(r,A,n);return i&&o?(this._intPt[0]=r,this._intPt[1]=A,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):i&&a?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&s?(this._intPt[0]=A,this._intPt[1]=e,!A.equals(e)||i||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=A,this._intPt[1]=n,!A.equals(n)||i||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,A){var i=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,h=((i>u?i:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;A.x=h,A.y=p,t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.computeIntersect=function(e,n,r,A){if(this._isProper=!1,!j.intersects(e,n,r,A))return t.NO_INTERSECTION;var i=st.orientationIndex(e,n,r),o=st.orientationIndex(e,n,A);if(i>0&&o>0||i<0&&o<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,A,e),a=st.orientationIndex(r,A,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,A):(0===i||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(A)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(A)?this._intPt[0]=n:0===i?this._intPt[0]=new I(r):0===o?this._intPt[0]=new I(A):0===s?this._intPt[0]=new I(e):0===a&&(this._intPt[0]=new I(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,A)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var A=t,i=st.distancePointLine(t,n,r),o=st.distancePointLine(e,n,r);return o<i&&(i=o,A=e),(o=st.distancePointLine(n,t,e))<i&&(i=o,A=n),(o=st.distancePointLine(r,t,e))<i&&(i=o,A=r),A},e}(nt),it=function(){};it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},it.orientationIndex=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=n.x-e.x,o=n.y-e.y;return it.signOfDet2x2(r,A,i,o)},it.signOfDet2x2=function(t,e,n,r){var A=null,i=null,o=null;if(A=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-A:A:n>0?A:-A;if(0===e||0===n)return r>0?t>0?A:-A:t>0?-A:A;if(e>0?r>0?e<=r||(A=-A,i=t,t=n,n=i,i=e,e=r,r=i):e<=-r?(A=-A,n=-n,r=-r):(i=t,t=-n,n=i,i=e,e=-r,r=i):r>0?-e<=r?(A=-A,t=-t,e=-e):(i=-t,t=n,n=i,i=-e,e=r,r=i):e>=r?(t=-t,e=-e,n=-n,r=-r):(A=-A,i=-t,t=-n,n=i,i=-e,e=-r,r=i),t>0){if(!(n>0))return A;if(!(t<=n))return A}else{if(n>0)return-A;if(!(t>=n))return-A;A=-A,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-A;if(r>e)return A;if(t>(n-=o*t)+n){if(e<r+r)return A}else{if(e>r+r)return-A;n=t-n,r=e-r,A=-A}if(0===r)return 0===n?0:-A;if(0===n)return A;if((e-=(o=Math.floor(t/n))*r)<0)return A;if(e>r)return-A;if(n>(t-=o*n)+t){if(r<e+e)return-A}else{if(r>e+e)return A;t=n-t,e=r-e,A=-A}if(0===e)return 0===t?0:A;if(0===t)return-A}};var ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ot.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var A=t.x-this._p.x,i=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=it.signOfDet2x2(A,i,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<i&&(a=-a),a>0&&this._crossingCount++}},ot.prototype.isPointInPolygon=function(){return this.getLocation()!==S.EXTERIOR},ot.prototype.getLocation=function(){return this._isPointOnSegment?S.BOUNDARY:this._crossingCount%2==1?S.INTERIOR:S.EXTERIOR},ot.prototype.isOnSegment=function(){return this._isPointOnSegment},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.locatePointInRing=function(){if(arguments[0]instanceof I&&L(arguments[1],U)){for(var t=arguments[1],e=new ot(arguments[0]),n=new I,r=new I,A=1;A<t.size();A++)if(t.getCoordinate(A,n),t.getCoordinate(A-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof I&&arguments[1]instanceof Array){for(var i=arguments[1],o=new ot(arguments[0]),s=1;s<i.length;s++){var a=i[s],u=i[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var st=function(){},at={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return F.orientationIndex(t,e,n)},st.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var A=t[r].x-n,i=t[r+1].y;e+=A*(t[r-1].y-i)}return e/2}if(L(arguments[0],U)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new I,u=new I,c=new I;o.getCoordinate(0,u),o.getCoordinate(1,c);var l=u.x;c.x-=l;for(var f=0,h=1;h<s-1;h++)a.y=u.y,u.x=c.x,u.y=c.y,o.getCoordinate(h+1,c),c.x-=l,f+=u.x*(a.y-c.y);return f/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var A=!1;if(j.intersects(t,e,n,r)){var i=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===i)A=!0;else{var o=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/i,a=o/i;(a<0||a>1||s<0||s>1)&&(A=!0)}}else A=!0;return A?T.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==S.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new I;t.getCoordinate(0,r);for(var A=r.x,i=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-A,c=a-i;n+=Math.sqrt(u*u+c*c),A=s,i=a}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,A=1;A<=e;A++){var i=t[A];i.y>n.y&&(n=i,r=A)}var o=r;do{(o-=1)<0&&(o=e)}while(t[o].equals2D(n)&&o!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var a=t[o],u=t[s];if(a.equals2D(n)||u.equals2D(n)||a.equals2D(u))return!1;var c=st.computeOrientation(a,n,u);return 0===c?a.x>u.x:c>0},st.locatePointInRing=function(t,e){return ot.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),A=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(A)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var A=st.distancePointLine(t,e[r],e[r+1]);A<n&&(n=A)}return n}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return i.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((i.x-o.x)*(s.x-o.x)+(i.y-o.y)*(s.y-o.y))/a;if(u<=0)return i.distance(o);if(u>=1)return i.distance(s);var c=((o.y-i.y)*(s.x-o.x)-(o.x-i.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},st.isOnLine=function(t,e){for(var n=new At,r=1;r<e.length;r++){var A=e[r-1],i=e[r];if(n.computeIntersection(t,A,i),n.hasIntersection())return!0}return!1},at.CLOCKWISE.get=function(){return-1},at.RIGHT.get=function(){return st.CLOCKWISE},at.COUNTERCLOCKWISE.get=function(){return 1},at.LEFT.get=function(){return st.COUNTERCLOCKWISE},at.COLLINEAR.get=function(){return 0},at.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,at);var ut=function(){};ut.prototype.filter=function(t){},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},lt={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}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new j(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var A=n.next(),i=r.next(),o=A.compareTo(i);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,E,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},lt.serialVersionUID.get=function(){return 0x799ea46522854c00},lt.SORTINDEX_POINT.get=function(){return 0},lt.SORTINDEX_MULTIPOINT.get=function(){return 1},lt.SORTINDEX_LINESTRING.get=function(){return 2},lt.SORTINDEX_LINEARRING.get=function(){return 3},lt.SORTINDEX_MULTILINESTRING.get=function(){return 4},lt.SORTINDEX_POLYGON.get=function(){return 5},lt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},lt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},lt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,lt);var ft=function(){};ft.interfaces_=function(){return[ut]},ft.filter=function(t){t.geometryChangedAction()};var ht=function(){};ht.prototype.filter=function(t){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var pt=function(){},dt={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}};pt.prototype.isInBoundary=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},dt.Mod2BoundaryNodeRule.get=function(){return gt},dt.EndPointBoundaryNodeRule.get=function(){return yt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MOD2_BOUNDARY_RULE.get=function(){return new gt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return pt.MOD2_BOUNDARY_RULE},Object.defineProperties(pt,dt);var gt=function(){};gt.prototype.isInBoundary=function(t){return t%2==1},gt.prototype.interfaces_=function(){return[pt]},gt.prototype.getClass=function(){return gt};var yt=function(){};yt.prototype.isInBoundary=function(t){return t>0},yt.prototype.interfaces_=function(){return[pt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[pt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[pt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.add=function(){},vt.prototype.addAll=function(){},vt.prototype.isEmpty=function(){},vt.prototype.iterator=function(){},vt.prototype.size=function(){},vt.prototype.toArray=function(){},vt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Et=function(){};Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vt);(r.prototype=new Error).name="NoSuchElementException";var bt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new It(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),It=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Et),Ct=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof I&&"boolean"==typeof arguments[1]){var A=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(A))return null;t.prototype.add.call(this,A)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1];return this.add(i,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(var u=0;u<s.length;u++)this.add(s[u],a);else for(var c=s.length-1;c>=0;c--)this.add(s[c],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof I){var l=arguments[0],f=arguments[1];if(!arguments[2]){var h=this.size();if(h>0){if(l>0&&this.get(l-1).equals2D(f))return null;if(l<h&&this.get(l).equals2D(f))return null}}t.prototype.add.call(this,l,f)}}else if(4===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],y=arguments[3],_=1;g>y&&(_=-1);for(var m=g;m!==y;m+=_)this.add(p[m],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bt),xt=function(){},Nt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Nt.ForwardComparator.get=function(){return St},Nt.BidirectionalComparator.get=function(){return Dt},Nt.coordArrayType.get=function(){return new Array(0).fill(null)},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},xt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(xt.indexOf(r,e)<0)return r}return null},xt.scroll=function(t,e){var n=xt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);q.arraycopy(t,n,r,0,t.length-n),q.arraycopy(t,0,r,t.length-n,n),q.arraycopy(r,0,t,0,t.length)},xt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];if(r===A)return!0;if(null===r||null===A)return!1;if(r.length!==A.length)return!1;for(var o=0;o<r.length;o++)if(0!==i.compare(r[o],A[o]))return!1;return!0}},xt.intersection=function(t,e){for(var n=new Ct,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},xt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},xt.removeRepeatedPoints=function(t){return xt.hasRepeatedPoints(t)?new Ct(t,!1).toCoordinateArray():t},xt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var A=t[r];t[r]=t[e-r],t[e-r]=A}},xt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var A=0,i=0;i<t.length;i++)null!==t[i]&&(r[A++]=t[i]);return r},xt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new I(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)i[o+a]=new I(r[A+a])},xt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],A=e[t.length-n-1];if(0!==r.compareTo(A))return!1}return!0},xt.envelope=function(t){for(var e=new j,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},xt.toCoordinateArray=function(t){return t.toArray(xt.coordArrayType)},xt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},xt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},xt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},xt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},xt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},xt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var A=new Array(r).fill(null);if(0===r)return A;for(var i=0,o=e;o<=n;o++)A[i++]=t[o];return A},Object.defineProperties(xt,Nt);var St=function(){};St.prototype.compare=function(t,e){return xt.compare(t,e)},St.prototype.interfaces_=function(){return[b]},St.prototype.getClass=function(){return St};var Dt=function(){};Dt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var A=xt.compare(n,r);return xt.isEqualReversed(n,r)?0:A},Dt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var A=xt.increasingDirection(n),i=xt.increasingDirection(r),o=A>0?0:n.length-1,s=i>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=A,s+=i}return 0},Dt.prototype.interfaces_=function(){return[b]},Dt.prototype.getClass=function(){return Dt};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(A.prototype=new Error).name="OperationNotSupported",(i.prototype=new vt).contains=function(){};var Mt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Ot(this)},e}(i),Ot=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new A},e}(Et),Rt=0;(l.prototype=new Tt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},l.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,A=this.root_;do{if(n=A,(r=t.compareTo(A.key))<0)A=A.left;else{if(!(r>0)){var i=A.value;return A.value=e,i}A=A.right}}while(null!==A);var o={key:t,left:null,right:null,value:e,parent:n,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},l.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===u(s(s(t)))){var e=c(s(s(t)));1===o(e)?(a(s(t),Rt),a(e,Rt),a(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),a(s(t),Rt),a(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=u(s(s(t)));1===o(n)?(a(s(t),Rt),a(n,Rt),a(s(s(t)),1),t=s(s(t))):(t===u(s(t))&&(t=s(t),this.rotateRight(t)),a(s(t),Rt),a(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Rt},l.prototype.values=function(){var t=new bt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=l.successor(e));)t.add(e.value);return t},l.prototype.entrySet=function(){var t=new Mt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=l.successor(e));)t.add(e);return t},l.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},l.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},l.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},l.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},l.prototype.size=function(){return this.size_};var Pt=function(){};Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},f.prototype=new i,(h.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},h.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},h.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},h.prototype.remove=function(t){throw new A},h.prototype.size=function(){return this.array_.length},h.prototype.isEmpty=function(){return 0===this.array_.length},h.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},h.prototype.iterator=function(){return new kt(this)};var kt=function(t){this.treeSet_=t,this.position_=0};kt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},kt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},kt.prototype.remove=function(){throw new A};var Bt=function(){};Bt.sort=function(){var t,e,n,r,A=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},A.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},A.sort(r);else if(3===arguments.length){(e=A.slice(arguments[1],arguments[2])).sort();var i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length));for(A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])}else if(4===arguments.length)for(e=A.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length)),A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])},Bt.asList=function(t){for(var e=new bt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Ft=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.toDimensionSymbol=function(t){switch(t){case Ft.FALSE:return Ft.SYM_FALSE;case Ft.TRUE:return Ft.SYM_TRUE;case Ft.DONTCARE:return Ft.SYM_DONTCARE;case Ft.P:return Ft.SYM_P;case Ft.L:return Ft.SYM_L;case Ft.A:return Ft.SYM_A}throw new _("Unknown dimension value: "+t)},Ft.toDimensionValue=function(t){switch(P.toUpperCase(t)){case Ft.SYM_FALSE:return Ft.FALSE;case Ft.SYM_TRUE:return Ft.TRUE;case Ft.SYM_DONTCARE:return Ft.DONTCARE;case Ft.SYM_P:return Ft.P;case Ft.SYM_L:return Ft.L;case Ft.SYM_A:return Ft.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Ft,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Qt=function(){};Qt.prototype.filter=function(t,e){},Qt.prototype.isDone=function(){},Qt.prototype.isGeometryChanged=function(){},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var zt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new j,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),A=0;A<r.length;A++)t[++e]=r[A];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var A=0;A<this._geometries.length;A++)if(!this._geometries[A].equalsExact(r._geometries[A],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Bt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new h(Bt.asList(this._geometries)),n=new h(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],A=arguments[0],i=this.getNumGeometries(),o=A.getNumGeometries(),s=0;s<i&&s<o;){var a=this.getGeometryN(s),u=A.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<i?1:s<o?-1:0}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Ut)){var A=arguments[0];A.filter(this);for(var i=0;i<this._geometries.length;i++)this._geometries[i].apply(A)}else if(L(arguments[0],ut)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(o)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Vt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Pt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(zt),qt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=pt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};qt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},qt.prototype.getBoundary=function(){return this._geom instanceof $t?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},qt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},qt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},qt.prototype.computeBoundaryCoordinates=function(t){var e=new bt;this._endpointMap=new l;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var A=this._endpointMap.entrySet().iterator();A.hasNext();){var i=A.next(),o=i.getValue().count;this._bnRule.isInBoundary(o)&&e.add(i.getKey())}return xt.toCoordinateArray(e)},qt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.getBoundary=function(){return 1===arguments.length?new qt(arguments[0]).getBoundary():2===arguments.length?new qt(arguments[0],arguments[1]).getBoundary():void 0};var Yt=function(){this.count=null};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var jt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},jt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){};return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],A=arguments[1],i="",o=new function(){}(new function(){}(jt.getStackTrace(r))),s=0;s<A;s++)try{i+=o.readLine()+jt.NEWLINE}catch(t){if(!(t instanceof p))throw t;et.shouldNeverReachHere()}return i}},jt.split=function(t,e){for(var n=e.length,r=new bt,A=""+t,i=A.indexOf(e);i>=0;){var o=A.substring(0,i);r.add(o),i=(A=A.substring(i+n)).indexOf(e)}A.length>0&&r.add(A);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},jt.toString=function(){if(1===arguments.length){var t=arguments[0];return jt.SIMPLE_ORDINATE_FORMAT.format(t)}},jt.spaces=function(t){return jt.chars(" ",t)},Ht.NEWLINE.get=function(){return q.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}},Object.defineProperties(jt,Ht);var Xt=function(){};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.copyCoord=function(t,e,n,r){for(var A=Math.min(t.getDimension(),n.getDimension()),i=0;i<A;i++)n.setOrdinate(r,i,t.getOrdinate(e,i))},Xt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Xt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),A=0;A<n;A++)for(var i=0;i<r;i++){var o=t.getOrdinate(A,i),s=e.getOrdinate(A,i);if(!(t.getOrdinate(A,i)===e.getOrdinate(A,i)||m.isNaN(o)&&m.isNaN(s)))return!1}return!0},Xt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();if(Xt.copy(e,0,r,0,A),A>0)for(var i=A;i<n;i++)Xt.copy(e,A-1,r,i,1);return r},Xt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Xt.swap(t,r,e-r)},Xt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var A=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,A)}},Xt.copy=function(t,e,n,r,A){for(var i=0;i<A;i++)Xt.copyCoord(t,e+i,n,r+i)},Xt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;r.append("(");for(var A=0;A<e;A++){A>0&&r.append(" ");for(var i=0;i<n;i++)i>0&&r.append(","),r.append(jt.toString(t.getOrdinate(A,i)))}return r.append(")"),r.toString()}},Xt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Xt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Xt.createClosedRing(t,e,n+1)},Xt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();Xt.copy(e,0,r,0,A);for(var i=A;i<n;i++)Xt.copy(e,0,r,i,1);return r};var $t=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var A=0;A<this._points.size();A++)if(!this.equal(this._points.getCoordinate(A),r._points.getCoordinate(A),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Xt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var A=arguments[0];return arguments[1].compare(this._points,A._points)}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Pt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new j;var t=new j;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],ht)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],Qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Wt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var Jt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var A=0;A<this._holes.length;A++)for(var i=this._holes[A].getCoordinates(),o=0;o<i.length;o++)t[++e]=i[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var A=t.getY(n);if(A!==e.getMinY()&&A!==e.getMaxY())return!1}for(var i=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==i==(u!==o))return!1;i=a,o=u}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,A=this._shell,i=r._shell;if(!A.equalsExact(i,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(r._holes[o],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Bt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);q.arraycopy(e.getCoordinates(),0,r,0,r.length);var A=xt.minCoordinate(e.getCoordinates());xt.scroll(r,A),q.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&xt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],A=arguments[0],i=this._shell,o=A._shell,s=i.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=A.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=A.getInteriorRingN(c),h=l.compareToSameClass(f,r);if(0!==h)return h;c++}return c<a?1:c<u?-1:0}},e.prototype.apply=function(t){if(L(t,ht)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,Qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Ut))t.filter(this);else if(L(t,ut)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Wt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(zt),ee=function(t){function e(e,n){e instanceof I&&n instanceof ye&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}($t),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bt,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var A=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(A))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},Ae={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof zt?this.editGeometryCollection(t,e):t instanceof Jt?this.editPolygon(t,e):t instanceof Kt||t instanceof $t?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bt,A=0;A<n.getNumGeometries();A++){var i=this.edit(n.getGeometryN(A),e);null===i||i.isEmpty()||r.add(i)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var A=new bt,i=0;i<n.getNumInteriorRing();i++){var o=this.edit(n.getInteriorRingN(i),e);null===o||o.isEmpty()||A.add(o)}return this._factory.createPolygon(r,A.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},Ae.NoOpGeometryOperation.get=function(){return ie},Ae.CoordinateOperation.get=function(){return oe},Ae.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,Ae);var ie=function(){};ie.prototype.edit=function(t,e){return t},ie.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ie.prototype.getClass=function(){return ie};var oe=function(){};oe.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof $t?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new I}else if(L(arguments[0],U)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var A=arguments[0],i=arguments[1];this._coordinates=A,this._dimension=i,null===A&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var a=0;a<o;a++)this._coordinates[a]=new I}},ue={serialVersionUID:{configurable:!0}};ae.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ae.prototype.size=function(){return this._coordinates.length},ae.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return m.NaN},ae.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ae.prototype.getCoordinateCopy=function(t){return new I(this._coordinates[t])},ae.prototype.getDimension=function(){return this._dimension},ae.prototype.getX=function(t){return this._coordinates[t].x},ae.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ae(t,this._dimension)},ae.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ae.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ae(t,this._dimension)},ae.prototype.toString=function(){if(this._coordinates.length>0){var t=new O(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ae.prototype.getY=function(t){return this._coordinates[t].y},ae.prototype.toCoordinateArray=function(){return this._coordinates},ae.prototype.interfaces_=function(){return[U,e]},ae.prototype.getClass=function(){return ae},ue.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ae,ue);var ce=function(){},le={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ae(arguments[0]);if(L(arguments[0],U))return new ae(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ae(t):new ae(t,e)}},ce.prototype.interfaces_=function(){return[N,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},le.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},le.instanceObject.get=function(){return new ce},Object.defineProperties(ce,le);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Mt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),he=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},pe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};he.prototype.equals=function(t){if(!(t instanceof he))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},he.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new R(n).compareTo(new R(r))},he.prototype.getScale=function(){return this._scale},he.prototype.isFloating=function(){return this._modelType===he.FLOATING||this._modelType===he.FLOATING_SINGLE},he.prototype.getType=function(){return this._modelType},he.prototype.toString=function(){var t="UNKNOWN";return this._modelType===he.FLOATING?t="Floating":this._modelType===he.FLOATING_SINGLE?t="Floating-Single":this._modelType===he.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},he.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===he.FLOATING_SINGLE?t:this._modelType===he.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof I){var e=arguments[0];if(this._modelType===he.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},he.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===he.FLOATING?t=16:this._modelType===he.FLOATING_SINGLE?t=6:this._modelType===he.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},he.prototype.setScale=function(t){this._scale=Math.abs(t)},he.prototype.interfaces_=function(){return[e,E]},he.prototype.getClass=function(){return he},he.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},pe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},pe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(he,pe);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ge={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ge.serialVersionUID.get=function(){return-552860263173159e4},ge.nameToTypeMap.get=function(){return new fe},Object.defineProperties(de,ge),he.Type=de,he.FIXED=new de("FIXED"),he.FLOATING=new de("FLOATING"),he.FLOATING_SINGLE=new de("FLOATING SINGLE");var ye=function t(){this._precisionModel=new he,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],N)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof he&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new I(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new I(t.getMinX(),t.getMinY()),new I(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new I(t.getMinX(),t.getMinY()),new I(t.getMinX(),t.getMaxY()),new I(t.getMaxX(),t.getMaxY()),new I(t.getMaxX(),t.getMinY()),new I(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new $t(this.getCoordinateSequenceFactory().create(t),this):L(t,U)?new $t(t,this):void 0:new $t(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,A=t.iterator();A.hasNext();){var i=A.next(),o=i.getClass();null===e&&(e=o),o!==e&&(n=!0),i.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Jt)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof $t)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],U))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Jt(null,null,this);if(1===arguments.length){if(L(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Jt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var A=this.getCoordinateSequenceFactory().create(1,e.getDimension());Xt.copy(e,r,A,0,1),n[r]=this.createPoint(A)}return this.createMultiPoint(n)}}},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ye.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ye.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ye,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ve=function(t){this.geometryFactory=t||new ye};ve.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Ee[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?Ee[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Ee[n].apply(this,[e.geometries]):Ee[n].apply(this,[e])},ve.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var Ee={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Ee[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Ee.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new I(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new I(t[0],t[1]),new I(t[2],t[1]),new I(t[2],t[3]),new I(t[0],t[3]),new I(t[0],t[1])])},Point:function(t){var e=new I(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Ee.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Ee.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],A=1;A<t.length;++A){var i=t[A],o=Ee.coordinates.apply(this,[i]),s=this.geometryFactory.createLinearRing(o);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Ee.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.Point.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var A=n[r];e.push(we.coordinate.apply(this,[A]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.LineString.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var A=t._holes[r],i=we.LineString.apply(this,[A]);e.push(i.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.Polygon.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=r.getGeometryType();e.push(we[A].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},be=function(t){this.geometryFactory=t||new ye,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ve(this.geometryFactory)};be.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===he.FIXED&&this.reducePrecision(e),e},be.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ie=function(){this.parser=new ve(this.geometryFactory)};Ie.prototype.write=function(t){return this.parser.write(t)};var Ce=function(){},xe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.opposite=function(t){return t===Ce.LEFT?Ce.RIGHT:t===Ce.RIGHT?Ce.LEFT:t},xe.ON.get=function(){return 0},xe.LEFT.get=function(){return 1},xe.RIGHT.get=function(){return 2},Object.defineProperties(Ce,xe),(d.prototype=new Error).name="EmptyStackException",(g.prototype=new wt).add=function(t){return this.array_.push(t),!0},g.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},g.prototype.push=function(t){return this.array_.push(t),t},g.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},g.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},g.prototype.empty=function(){return 0===this.array_.length},g.prototype.isEmpty=function(){return this.empty()},g.prototype.search=function(t){return this.array_.indexOf(t)},g.prototype.size=function(){return this.array_.length},g.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ne=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ne.prototype.getCoordinate=function(){return this._minCoord},Ne.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ne.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=st.computeOrientation(this._minCoord,n,e),A=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(A=!0),A&&(this._minIndex=this._minIndex-1)},Ne.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ce.LEFT;return n[e].y<n[e+1].y&&(r=Ce.RIGHT),r},Ne.prototype.getEdge=function(){return this._orientedDe},Ne.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ne.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ne.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ce.LEFT&&(this._orientedDe=this._minDe.getSym())},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var Se=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new I(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(J),De=function(){this.array_=[]};De.prototype.addLast=function(t){this.array_.push(t)},De.prototype.removeFirst=function(){return this.array_.shift()},De.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new bt,this._nodes=new bt,this._rightMostCoord=null,this._env=null,this._finder=new Ne};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Se("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var A=t.getEdges().iterator();A.hasNext();){var i=A.next();i.setVisited(!0),this.copySymDepths(i)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ce.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ce.RIGHT)>=1&&e.getDepth(Ce.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new Mt,n=new De,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var A=n.removeFirst();e.add(A),this.computeNodeDepth(A);for(var i=A.getEdges().iterator();i.hasNext();){var o=i.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new g;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ce.LEFT,t.getDepth(Ce.RIGHT)),e.setDepth(Ce.RIGHT,t.getDepth(Ce.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var A=r.getSym().getNode();A.isVisited()||e.push(A)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[E]},Le.prototype.getClass=function(){return Le};var Te=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Ce.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var A=0;A<this.location.length;A++)this.location[A]=r.location[A]}}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Ce.ON]=i,this.location[Ce.LEFT]=o,this.location[Ce.RIGHT]=s}};Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==S.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===S.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ce.ON]=this.location[Ce.ON],e[Ce.LEFT]=S.NONE,e[Ce.RIGHT]=S.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===S.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ce.LEFT];this.location[Ce.LEFT]=this.location[Ce.RIGHT],this.location[Ce.RIGHT]=t},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(S.toLocationSymbol(this.location[Ce.LEFT])),t.append(S.toLocationSymbol(this.location[Ce.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[Ce.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ce.ON]=t,this.location[Ce.LEFT]=e,this.location[Ce.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:S.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===S.NONE)return!0;return!1},Te.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ce.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(S.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Me=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.elt[0]=new Te(S.NONE),this.elt[1]=new Te(S.NONE),this.elt[r].setLocation(A)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Te(i,o,s),this.elt[1]=new Te(i,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new Te(S.NONE,S.NONE,S.NONE),this.elt[1]=new Te(S.NONE,S.NONE,S.NONE),this.elt[a].setLocations(u,c,l)}};Me.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Me.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Me.prototype.isNull=function(t){return this.elt[t].isNull()},Me.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Me.prototype.isLine=function(t){return this.elt[t].isLine()},Me.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Me.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Me.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ce.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Me.prototype.toString=function(){var t=new O;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Me.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Me.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Me.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ce.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this.elt[n].setLocation(r,A)}},Me.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Me.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Me.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toLineLabel=function(t){for(var e=new Me(S.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Oe=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bt,this._pts=new bt,this._label=new Me(S.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Oe.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Se("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Se("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Oe.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var A=1;n&&(A=0);for(var i=A;i<r.length;i++)this._pts.add(r[i])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ce.RIGHT);if(n===S.NONE)return null;if(this._label.getLocation(e)===S.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Pe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Re(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),ke=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};ke.prototype.setVisited=function(t){this._isVisited=t},ke.prototype.setInResult=function(t){this._isInResult=t},ke.prototype.isCovered=function(){return this._isCovered},ke.prototype.isCoveredSet=function(){return this._isCoveredSet},ke.prototype.setLabel=function(t){this._label=t},ke.prototype.getLabel=function(){return this._label},ke.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ke.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ke.prototype.isInResult=function(){return this._isInResult},ke.prototype.isVisited=function(){return this._isVisited},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Be=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Me(0,S.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=S.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==S.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Me(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Me)for(var n=arguments[0],r=0;r<2;r++){var A=this.computeMergedLocation(n,r);this._label.getLocation(r)===S.NONE&&this._label.setLocation(r,A)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=S.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:default:n=S.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),Fe=function(){this.nodeMap=new l,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof I){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Be){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new bt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===S.BOUNDARY&&e.add(r)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var Qe=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,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._edge=A,this.init(i,o),this._label=s}};Qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Qe.prototype.getDy=function(){return this._dy},Qe.prototype.getCoordinate=function(){return this._p0},Qe.prototype.setNode=function(t){this._node=t},Qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),A=n.substring(r+1);t.print(" "+A+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Qe.prototype.getDirectedCoordinate=function(){return this._p1},Qe.prototype.getDx=function(){return this._dx},Qe.prototype.getLabel=function(){return this._label},Qe.prototype.getEdge=function(){return this._edge},Qe.prototype.getQuadrant=function(){return this._quadrant},Qe.prototype.getNode=function(){return this._node},Qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Qe.prototype.computeLabel=function(t){},Qe.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Qe.prototype.interfaces_=function(){return[E]},Qe.prototype.getClass=function(){return Qe};var ze=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),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=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Me(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Se("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ce.LEFT)===S.INTERIOR&&this._label.getLocation(e,Ce.RIGHT)===S.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ce.LEFT]+"/"+this._depth[Ce.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,S.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,S.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ce.LEFT&&(r=-1);var A=Ce.opposite(t),i=e+n*r;this.setDepth(t,e),this.setDepth(A,i)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===S.EXTERIOR&&e===S.INTERIOR?1:t===S.INTERIOR&&e===S.EXTERIOR?-1:0},e}(Qe),Ve=function(){};Ve.prototype.createNode=function(t){return new Be(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var qe=function(){if(this._edges=new bt,this._nodes=null,this._edgeEndList=new bt,0===arguments.length)this._nodes=new Fe(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new Fe(t)}};qe.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},qe.prototype.find=function(t){return this._nodes.find(t)},qe.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof I){var e=arguments[0];return this._nodes.addNode(e)}},qe.prototype.getNodeIterator=function(){return this._nodes.iterator()},qe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},qe.prototype.debugPrintln=function(t){q.out.println(t)},qe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===S.BOUNDARY},qe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},qe.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},qe.prototype.getEdgeEnds=function(){return this._edgeEndList},qe.prototype.debugPrint=function(t){q.out.print(t)},qe.prototype.getEdgeIterator=function(){return this._edges.iterator()},qe.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(this.matchInSameDirection(t,e,A[0],A[1]))return r;if(this.matchInSameDirection(t,e,A[A.length-1],A[A.length-2]))return r}return null},qe.prototype.insertEdge=function(t){this._edges.add(t)},qe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},qe.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),A=new ze(n,!1);r.setSym(A),A.setSym(r),this.add(r),this.add(A)}},qe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},qe.prototype.getNodes=function(){return this._nodes.values()},qe.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(t.equals(A[0])&&e.equals(A[1]))return r}return null},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=function(){this._geometryFactory=null,this._shellList=new bt;var t=arguments[0];this._geometryFactory=t};Ye.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var A=r.next();A.isHole()?n.add(A):e.add(A)}},Ye.prototype.computePolygons=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ye.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var A=this.findEdgeRingContaining(r,t);if(null===A)throw new Se("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(A)}}},Ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bt,A=t.iterator();A.hasNext();){var i=A.next();if(i.getMaxNodeDegree()>2){i.linkDirectedEdgesForMinimalEdgeRings();var o=i.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(i)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var A=new Pe(r,this._geometryFactory);e.add(A),A.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),A=n.getCoordinateN(0),i=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==i&&(o=i.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&st.isPointInRing(A,u.getCoordinates())&&(l=!0),l&&(null===i||o.contains(c))&&(i=a)}return i},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var A=r.next();A.isHole()||(n=A,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];qe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),A=new bt,i=this.buildMinimalEdgeRings(r,this._shellList,A);this.sortShellsAndHoles(i,this._shellList,A),this.placeFreeHoles(this._shellList,A)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var je=function(){};je.prototype.getBounds=function(){},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[je,e]},He.prototype.getClass=function(){return He};var Xe=function(){this._size=null,this._items=null,this._size=0,this._items=new bt,this._items.add(null)};Xe.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},Xe.prototype.size=function(){return this._size},Xe.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Xe.prototype.clear=function(){this._size=0,this._items.clear()},Xe.prototype.isEmpty=function(){return 0===this._size},Xe.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var $e=function(){};$e.prototype.visitItem=function(t){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var We=function(){};We.prototype.insert=function(t,e){},We.prototype.remove=function(t,e){},We.prototype.query=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Ke=function(){if(this._childBoundables=new bt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ze={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[je,e]},Ke.prototype.getClass=function(){return Ke},Ze.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Ze);var Je=function(){};Je.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Je.min=function(t){return Je.sort(t),t.get(0)},Je.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),A=0,i=n.length;A<i;A++)r.next(),r.set(n[A])},Je.singletonList=function(t){var e=new bt;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var A=t.getChildBoundables().iterator();A.hasNext();){var i=A.next(),o=new tn(i,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[E]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var A=r.next();A instanceof He&&A.getItem()===e&&(n=A)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bt:t}if(1===arguments.length){for(var e=arguments[0],n=new bt,r=e.getChildBoundables().iterator();r.hasNext();){var A=r.next();if(A instanceof Ke){var i=this.itemsTree(A);null!==i&&n.add(i)}else A instanceof He?n.add(A.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return A.add(r),null;for(var i=r.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Ke?this.boundablesAtLevel(n,o,A):(et.isTrue(o instanceof He),-1===n&&A.add(o))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var A=arguments[0],i=arguments[2],o=arguments[1].getChildBoundables(),s=0;s<o.size();s++){var a=o.get(s);this.getIntersectsOp().intersects(a.getBounds(),A)&&(a instanceof Ke?this.query(A,a,i):a instanceof He?i.visitItem(a.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var u=arguments[0],c=arguments[2],l=arguments[1].getChildBoundables(),f=0;f<l.size();f++){var h=l.get(f);this.getIntersectsOp().intersects(h.getBounds(),u)&&(h instanceof Ke?this.query(u,h,c):h instanceof He?c.add(h.getItem()):et.shouldNeverReachHere())}},en.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},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2],i=this.removeItem(r,A);if(i)return!0;for(var o=null,s=r.getChildBoundables().iterator();s.hasNext();){var a=s.next();if(this.getIntersectsOp().intersects(a.getBounds(),n)&&a instanceof Ke&&(i=this.remove(n,a,A))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),i}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new bt;n.add(this.createNode(e));var r=new bt(t);Je.sort(r,this.getComparator());for(var A=r.iterator();A.hasNext();){var i=A.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(i)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},An=function(){};An.prototype.distance=function(t,e){},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var on=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new bt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),A=t.iterator(),i=0;i<e;i++){r[i]=new bt;for(var o=0;A.hasNext()&&o<n;){var s=A.next();r[i].add(s),o++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var A=arguments[0],i=arguments[1],o=arguments[2];t.prototype.query.call(this,A,i,o)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),A=new bt(t);Je.sort(A,n.xComparator);var i=this.verticalSlices(A,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(i,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],An)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],An)){var A=arguments[0],i=arguments[1],o=new tn(this.getRoot(),A.getRoot(),i);return this.nearestNeighbour(o)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Xe;for(c.add(s);!c.isEmpty()&&a>0;){var l=c.poll(),f=l.getDistance();if(f>=a)break;l.isLeaves()?(a=f,u=l):l.expandToQueue(c,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[2],p=new He(arguments[0],arguments[1]),d=new tn(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[We,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),an=function(){};an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.relativeSign=function(t,e){return t<e?-1:t>e?1:0},an.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=an.relativeSign(e.x,n.x),A=an.relativeSign(e.y,n.y);switch(t){case 0:return an.compareValue(r,A);case 1:return an.compareValue(A,r);case 2:return an.compareValue(A,-r);case 3:return an.compareValue(-r,A);case 4:return an.compareValue(-r,-A);case 5:return an.compareValue(-A,-r);case 6:return an.compareValue(-A,r);case 7:return an.compareValue(r,-A)}return et.shouldNeverReachHere("invalid octant value"),0},an.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new I(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:an.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[E]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new l,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new Ct;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new bt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new R(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);n.add(new I(t.coord),!1);for(var i=t.segmentIndex+1;i<=e.segmentIndex;i++)n.add(this._edge.getCoordinate(i));A&&n.add(new I(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var A=n.next();this.findCollapseIndex(r,A,e)&&t.add(new R(e[0])),r=A}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this._edge.getCoordinate(s);return A&&(i[o]=new I(e.coord)),new pn(i,this._edge.getData())},cn.prototype.add=function(t,e){var n=new un(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new J("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),A=r[r.length-1];if(!A.equals2D(e[e.length-1]))throw new J("bad split edge end point at "+A)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof I&&arguments[1]instanceof I){var A=arguments[0],i=arguments[1],o=i.x-A.x,s=i.y-A.y;if(0===o&&0===s)throw new _("Cannot compute the octant for two identical points "+A);return ln.octant(o,s)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var hn=function(){};hn.prototype.addIntersection=function(t,e){},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn};var pn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};pn.prototype.getCoordinates=function(){return this._pts},pn.prototype.size=function(){return this._pts.length},pn.prototype.getCoordinate=function(t){return this._pts[t]},pn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},pn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},pn.prototype.setData=function(t){this._data=t},pn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ln.octant(t,e)},pn.prototype.getData=function(){return this._data},pn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],A=new I(arguments[0].getIntersection(r));this.addIntersection(A,n)}},pn.prototype.toString=function(){return Z.toLineString(new ae(this._pts))},pn.prototype.getNodeList=function(){return this._nodeList},pn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var A=this._pts[r];t.equals2D(A)&&(n=r)}return this._nodeList.add(t,n)},pn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},pn.prototype.interfaces_=function(){return[hn]},pn.prototype.getClass=function(){return pn},pn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return pn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new I,this.p1=new I;else if(1===arguments.length){var t=arguments[0];this.p0=new I(t.p0),this.p1=new I(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],A=arguments[3];this.p0=new I(e,n),this.p1=new I(r,A)}},gn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof I){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new At;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof I){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new I(t);var e=this.projectionFactor(t),n=new I;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof dn){var r=arguments[0],A=this.projectionFactor(r.p0),i=this.projectionFactor(r.p1);if(A>=1&&i>=1)return null;if(A<=0&&i<=0)return null;var o=this.project(r.p0);A<0&&(o=this.p0),A>1&&(o=this.p1);var s=this.project(r.p1);return i<0&&(s=this.p0),i>1&&(s=this.p1),new dn(o,s)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,A=null,i=this.closestPoint(t.p0);r=i.distance(t.p0),n[0]=i,n[1]=t.p0;var o=this.closestPoint(t.p1);(A=o.distance(t.p1))<r&&(r=A,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(A=s.distance(this.p0))<r&&(r=A,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(A=a.distance(this.p1))<r&&(r=A,n[0]=this.p1,n[1]=a),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return Y.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),A=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,o=Math.sqrt(A*A+i*i),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*A/o,a=e*i/o}return new I(n-a,r+s)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof I){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new I;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},dn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[E,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new I((t.x+e.x)/2,(t.y+e.y)/2)},gn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,gn);var yn=function(){this.tempEnv1=new j,this.tempEnv2=new j,this._overlapSeg1=new dn,this._overlapSeg2=new dn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var _n=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var A=this._pts[e],i=this._pts[n];if(r.tempEnv1.init(A,i),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var o=Math.trunc((e+n)/2);e<o&&this.computeSelect(t,e,o,r),o<n&&this.computeSelect(t,o,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new j(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,A,i){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[A];if(e-t==1&&A-r==1)return i.overlap(this,t,n,r),null;if(i.tempEnv1.init(o,s),i.tempEnv2.init(a,u),!i.tempEnv1.intersects(i.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+A)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,i),l<A&&this.computeOverlapsInternal(t,c,n,l,A,i)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,i),l<A&&this.computeOverlapsInternal(c,e,n,l,A,i))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new R(e));do{var r=mn.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),A=e+1;A<t.length&&(t[A-1].equals2D(t[A])||Ge.quadrant(t[A-1],t[A])===r);)A++;return A-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bt,A=mn.getChainStartIndices(e),i=0;i<A.length-1;i++){var o=new _n(e,A[i],A[i+1],n);r.add(o)}return r}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var vn=function(){};vn.prototype.computeNodes=function(t){},vn.prototype.getNodedSubstrings=function(){},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var En=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[vn]},En.prototype.getClass=function(){return En};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bt,this._index=new on,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new bn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var A=r.next();if(A.getId()>n.getId()&&(n.computeOverlaps(A,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return bn},Object.defineProperties(e,n),e}(En),bn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],A=arguments[0].getContext(),i=n.getContext();this._si.processIntersections(A,e,i,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),In=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(A),this.setEndCapStyle(i),this.setJoinStyle(o),this.setMitreLimit(s)}},Cn={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}};In.prototype.getEndCapStyle=function(){return this._endCapStyle},In.prototype.isSingleSided=function(){return this._isSingleSided},In.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=In.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=In.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==In.JOIN_ROUND&&(this._quadrantSegments=In.DEFAULT_QUADRANT_SEGMENTS)},In.prototype.getJoinStyle=function(){return this._joinStyle},In.prototype.setJoinStyle=function(t){this._joinStyle=t},In.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},In.prototype.getSimplifyFactor=function(){return this._simplifyFactor},In.prototype.getQuadrantSegments=function(){return this._quadrantSegments},In.prototype.setEndCapStyle=function(t){this._endCapStyle=t},In.prototype.getMitreLimit=function(){return this._mitreLimit},In.prototype.setMitreLimit=function(t){this._mitreLimit=t},In.prototype.setSingleSided=function(t){this._isSingleSided=t},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Cn.CAP_ROUND.get=function(){return 1},Cn.CAP_FLAT.get=function(){return 2},Cn.CAP_SQUARE.get=function(){return 3},Cn.JOIN_ROUND.get=function(){return 1},Cn.JOIN_MITRE.get=function(){return 2},Cn.JOIN_BEVEL.get=function(){return 3},Cn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Cn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Cn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(In,Cn);var xn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Nn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};xn.prototype.isDeletable=function(t,e,n,r){var A=this._inputLine[t],i=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(A,i,o)&&!!this.isShallow(A,i,o,r)&&this.isShallowSampled(A,i,t,n,r)},xn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var A=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=xn.DELETE,A=!0,r=!0),t=A?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},xn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},xn.prototype.isShallowSampled=function(t,e,n,r,A){var i=Math.trunc((r-n)/xn.NUM_PTS_TO_CHECK);i<=0&&(i=1);for(var o=n;o<r;o+=i)if(!this.isShallow(t,e,this._inputLine[o],A))return!1;return!0},xn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},xn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},xn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===xn.DELETE;)e++;return e},xn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},xn.prototype.collapseLine=function(){for(var t=new Ct,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==xn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.simplify=function(t,e){return new xn(t).simplify(e)},Nn.INIT.get=function(){return 0},Nn.DELETE.get=function(){return 1},Nn.KEEP.get=function(){return 1},Nn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(xn,Nn);var Sn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bt},Dn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Sn.prototype.getCoordinates=function(){return this._ptList.toArray(Sn.COORDINATE_ARRAY_TYPE)},Sn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Sn.prototype.addPt=function(t){var e=new I(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Sn.prototype.revere=function(){},Sn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Sn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Sn.prototype.toString=function(){return(new ye).createLineString(this.getCoordinates()).toString()},Sn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new I(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Sn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Dn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Sn,Dn);var Ln=function(){},Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,A=n.y-e.y;return Math.atan2(A,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n);return Math.abs(A-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n);return Ln.diff(r,A)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n)-r;return A<=-Math.PI?A+Ln.PI_TIMES_2:A>Math.PI?A-Ln.PI_TIMES_2:A},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return st.CLOCKWISE},Tn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Ln,Tn);var Mn=function t(){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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new At,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===In.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},On={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}};Mn.prototype.addNextSegment=function(t,e){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 n=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Ce.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Ce.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Mn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ce.LEFT,this._distance,r);var A=new dn;this.computeOffsetSegment(n,Ce.RIGHT,this._distance,A);var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i);switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(A.p1);break;case In.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(A.p1);break;case In.CAP_SQUARE:var a=new I;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new I(r.p1.x+a.x,r.p1.y+a.y),c=new I(A.p1.x+a.x,A.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},Mn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Mn.prototype.addMitreJoin=function(t,e,n,r){var A=!0,i=null;try{i=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:i.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(A=!1)}catch(t){if(!(t instanceof V))throw t;i=new I(0,0),A=!1}A?this._segList.addPt(i):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Mn.prototype.addFilletCorner=function(t,e,n,r,A){var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,A),this._segList.addPt(n)},Mn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===In.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===In.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&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))},Mn.prototype.createSquare=function(t){this._segList.addPt(new I(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new I(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Mn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Mn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Mn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Mn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Mn.prototype.addLimitedMitreJoin=function(t,e,n,r){var A=this._seg0.p1,i=Ln.angle(A,this._seg0.p0),o=Ln.angleBetweenOriented(this._seg0.p0,A,this._seg1.p1)/2,s=Ln.normalize(i+o),a=Ln.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=A.x+u*Math.cos(a),f=A.y+u*Math.sin(a),h=new I(l,f),p=new dn(A,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===Ce.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},Mn.prototype.computeOffsetSegment=function(t,e,n,r){var A=e===Ce.LEFT?1:-1,i=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(i*i+o*o),a=A*n*i/s,u=A*n*o/s;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+a,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+a},Mn.prototype.addFilletArc=function(t,e,n,r,A){var i=r===st.CLOCKWISE?-1:1,o=Math.abs(e-n),s=Math.trunc(o/this._filletAngleQuantum+.5);if(s<1)return null;for(var a=o/s,u=0,c=new I;u<o;){var l=e+i*u;c.x=t.x+A*Math.cos(l),c.y=t.y+A*Math.sin(l),this._segList.addPt(c),u+=a}},Mn.prototype.addInsideTurn=function(t,e){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*Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new I((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(n);var r=new I((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Mn.prototype.createCircle=function(t){var e=new I(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Mn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Mn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Mn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===In.JOIN_BEVEL||this._bufParams.getJoinStyle()===In.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,st.CLOCKWISE,this._distance))},Mn.prototype.closeRing=function(){this._segList.closeRing()},Mn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Mn,On);var Rn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Rn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),A=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],A):this.computeOffsetCurve(t,n,A);var i=A.getCoordinates();return n&&xt.reverse(i),i},Rn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var A=xn.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],Ce.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{n.addSegments(t,!1);var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ce.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},Rn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ce.RIGHT&&(r=-r);var A=xn.simplify(t,r),i=A.length-1;n.initSideSegments(A[i-1],A[0],e);for(var o=1;o<=i;o++){var s=1!==o;n.addNextSegment(A[o],s)}n.closeRing()},Rn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=xn.simplify(t,n),A=r.length-1;e.initSideSegments(r[0],r[1],Ce.LEFT);for(var i=2;i<=A;i++)e.addNextSegment(r[i],!0);e.addLastSegment(),e.addLineEndCap(r[A-1],r[A]);var o=xn.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ce.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},Rn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:e.createCircle(t);break;case In.CAP_SQUARE:e.createSquare(t)}},Rn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var A=e<0;this.computeSingleSidedBufferCurve(t,A,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Rn.prototype.getBufferParameters=function(){return this._bufParams},Rn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Rn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Rn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Rn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var A=xn.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],Ce.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ce.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},Rn.prototype.getSegGen=function(t){return new Mn(this._precisionModel,this._bufParams,t)},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},Rn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new I(t[n]);return e};var Pn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new st;var t=arguments[0];this._subgraphs=t},kn={DepthSegment:{configurable:!0}};Pn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bt,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),A=r.getEnvelope();t.y<A.getMinY()||t.y>A.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof I&&arguments[1]instanceof ze){for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getEdge().getCoordinates(),u=0;u<a.length-1;u++)if(this._seg.p0=a[u],this._seg.p1=a[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<i.x||this._seg.isHorizontal()||i.y<this._seg.p0.y||i.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,i)===st.RIGHT)){var c=o.getDepth(Ce.LEFT);this._seg.p0.equals(a[u])||(c=o.getDepth(Ce.RIGHT));var l=new Bn(this._seg,c);s.add(l)}}else if(L(arguments[2],wt)&&arguments[0]instanceof I&&L(arguments[1],wt))for(var f=arguments[0],h=arguments[2],p=arguments[1].iterator();p.hasNext();){var d=p.next();d.isForward()&&this.findStabbedSegments(f,d,h)}},Pn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Je.min(e)._leftDepth},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Pn,kn);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};Bn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[E]},Bn.prototype.getClass=function(){return Bn};var Fn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Fn.prototype.area=function(){return Fn.area(this.p0,this.p1,this.p2)},Fn.prototype.signedArea=function(){return Fn.signedArea(this.p0,this.p1,this.p2)},Fn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Fn.interpolateZ(t,this.p0,this.p1,this.p2)},Fn.prototype.longestSideLength=function(){return Fn.longestSideLength(this.p0,this.p1,this.p2)},Fn.prototype.isAcute=function(){return Fn.isAcute(this.p0,this.p1,this.p2)},Fn.prototype.circumcentre=function(){return Fn.circumcentre(this.p0,this.p1,this.p2)},Fn.prototype.area3D=function(){return Fn.area3D(this.p0,this.p1,this.p2)},Fn.prototype.centroid=function(){return Fn.centroid(this.p0,this.p1,this.p2)},Fn.prototype.inCentre=function(){return Fn.inCentre(this.p0,this.p1,this.p2)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Fn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Fn.det=function(t,e,n,r){return t*r-e*n},Fn.interpolateZ=function(t,e,n,r){var A=e.x,i=e.y,o=n.x-A,s=r.x-A,a=n.y-i,u=r.y-i,c=o*u-s*a,l=t.x-A,f=t.y-i,h=(u*l-s*f)/c,p=(-a*l+o*f)/c;return e.z+h*(n.z-e.z)+p*(r.z-e.z)},Fn.longestSideLength=function(t,e,n){var r=t.distance(e),A=e.distance(n),i=n.distance(t),o=r;return A>o&&(o=A),i>o&&(o=i),o},Fn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},Fn.circumcentre=function(t,e,n){var r=n.x,A=n.y,i=t.x-r,o=t.y-A,s=e.x-r,a=e.y-A,u=2*Fn.det(i,o,s,a),c=Fn.det(o,i*i+o*o,a,s*s+a*a),l=Fn.det(i,i*i+o*o,s,s*s+a*a);return new I(r-c/u,A+l/u)},Fn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,A=new Y(t.x+n/2,t.y+r/2,1),i=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(A,i)},Fn.angleBisector=function(t,e,n){var r=e.distance(t),A=r/(r+e.distance(n)),i=n.x-t.x,o=n.y-t.y;return new I(t.x+A*i,t.y+A*o)},Fn.area3D=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=A*a-i*s,c=i*o-r*a,l=r*s-A*o,f=u*u+c*c+l*l;return Math.sqrt(f)/2},Fn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,A=(t.y+e.y+n.y)/3;return new I(r,A)},Fn.inCentre=function(t,e,n){var r=e.distance(n),A=t.distance(n),i=t.distance(e),o=r+A+i,s=(r*t.x+A*e.x+i*n.x)/o,a=(r*t.y+A*e.y+i*n.y)/o;return new I(s,a)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ce.LEFT;this._distance<0&&(e=-this._distance,n=Ce.RIGHT);var r=t.getExteriorRing(),A=xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&A.length<3)return null;this.addPolygonRing(A,e,n,S.EXTERIOR,S.INTERIOR);for(var i=0;i<t.getNumInteriorRing();i++){var o=t.getInteriorRingN(i),s=xt.removeRepeatedPoints(o.getCoordinates());this._distance>0&&this.isErodedCompletely(o,-this._distance)||this.addPolygonRing(s,e,Ce.opposite(n),S.INTERIOR,S.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Fn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=xt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new pn(t,new Me(0,S.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,A){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var i=r,o=A;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(i=A,o=r,n=Ce.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,i,o)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Jt?this.addPolygon(t):t instanceof $t?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),A=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>A},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Qn=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()};Qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof zt?(this._subcollectionIterator=new Qn(t),this._subcollectionIterator.next()):t},Qn.prototype.remove=function(){throw new Error(this.getClass().getName())},Qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Qn.prototype.interfaces_=function(){return[Et]},Qn.prototype.getClass=function(){return Qn},Qn.isAtomic=function(t){return!(t instanceof zt)};var zn=function(){this._geom=null;var t=arguments[0];this._geom=t};zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var A=e.getInteriorRingN(r);if(zn.isPointInRing(t,A))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Jt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new Qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:zn.containsPoint(t,e)?S.INTERIOR:S.EXTERIOR};var Vn=function(){this._edgeMap=new l,this._edgeList=null,this._ptInAreaLocation=[S.NONE,S.NONE]};Vn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Vn.prototype.propagateSideLabels=function(t){for(var e=S.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ce.LEFT)!==S.NONE&&(e=r.getLocation(t,Ce.LEFT))}if(e===S.NONE)return null;for(var A=e,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();if(s.getLocation(t,Ce.ON)===S.NONE&&s.setLocation(t,Ce.ON,A),s.isArea(t)){var a=s.getLocation(t,Ce.LEFT),u=s.getLocation(t,Ce.RIGHT);if(u!==S.NONE){if(u!==A)throw new Se("side location conflict",o.getCoordinate());a===S.NONE&&et.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),A=a}else et.isTrue(s.getLocation(t,Ce.LEFT)===S.NONE,"found single null side"),s.setLocation(t,Ce.RIGHT,A),s.setLocation(t,Ce.LEFT,A)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){q.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ce.LEFT);et.isTrue(r!==S.NONE,"Found unlabelled area edge");for(var A=r,i=this.iterator();i.hasNext();){var o=i.next().getLabel();et.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,Ce.LEFT),a=o.getLocation(t,Ce.RIGHT);if(s===a)return!1;if(a!==A)return!1;A=s}return!0},Vn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bt(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===S.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new O;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),A=0;A<2;A++)r.isLine(A)&&r.getLocation(A)===S.BOUNDARY&&(e[A]=!0);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=S.NONE;if(e[a])u=S.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var qn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var A=this._resultAreaEdgeList.get(r),i=A.getSym();if(A.getLabel().isArea())switch(null===t&&A.isInResult()&&(t=A),n){case this._SCANNING_FOR_INCOMING:if(!i.isInResult())continue;e=i,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!A.isInResult())continue;e.setNext(A),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Se("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),A=n.getQuadrant(),i=r.getQuadrant();return Ge.isNorthern(A)&&Ge.isNorthern(i)?n:Ge.isNorthern(A)||Ge.isNorthern(i)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){q.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),A=r.getSym();null===e&&(e=A),null!==t&&A.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ce.LEFT),r=t.getDepth(Ce.RIGHT),A=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,A)!==r)throw new Se("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var i=arguments[1],o=arguments[2],s=arguments[0];s<i;s++){var a=this._edgeList.get(s);a.setEdgeDepths(Ce.RIGHT,o),o=a.getDepth(Ce.LEFT)}return o}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,A=this._resultAreaEdgeList.size()-1;A>=0;A--){var i=this._resultAreaEdgeList.get(A),o=i.getSym();switch(null===e&&i.getEdgeRing()===t&&(e=i),r){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(i.getEdgeRing()!==t)continue;n.setNextMin(i),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,A=this.iterator();A.hasNext();)A.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(r.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var A=t,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(A===S.INTERIOR):(o.isInResult()&&(A=S.EXTERIOR),s.isInResult()&&(A=S.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Me(S.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),A=0;A<2;A++){var i=r.getLocation(A);i!==S.INTERIOR&&i!==S.BOUNDARY||this._label.setLocation(A,S.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Be(t,new qn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};jn.prototype.compareTo=function(t){var e=t;return jn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},jn.prototype.interfaces_=function(){return[E]},jn.prototype.getClass=function(){return jn},jn.orientation=function(t){return 1===xt.increasingDirection(t)},jn.compareOriented=function(t,e,n,r){for(var A=e?1:-1,i=r?1:-1,o=e?t.length:-1,s=r?n.length:-1,a=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[a].compareTo(n[u]);if(0!==c)return c;var l=(a+=A)===o,f=(u+=i)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Hn=function(){this._edges=new bt,this._ocaMap=new l};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),A=0;A<r.length;A++)A>0&&t.print(","),t.print(r[A].x+" "+r[A].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new jn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new jn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Xn=function(){};Xn.prototype.processIntersections=function(t,e,n,r){},Xn.prototype.isDone=function(){},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var $n=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};$n.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if($n.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.size()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},$n.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},$n.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},$n.prototype.getLineIntersector=function(){return this._li},$n.prototype.hasProperIntersection=function(){return this._hasProper},$n.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},$n.prototype.hasIntersection=function(){return this._hasIntersection},$n.prototype.isDone=function(){return!1},$n.prototype.hasInteriorIntersection=function(){return this._hasInterior},$n.prototype.interfaces_=function(){return[Xn]},$n.prototype.getClass=function(){return $n},$n.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Wn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new I(t),this.segmentIndex=e,this.dist=n};Wn.prototype.getSegmentIndex=function(){return this.segmentIndex},Wn.prototype.getCoordinate=function(){return this.coord},Wn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Wn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Wn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Wn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Wn.prototype.getDistance=function(){return this.dist},Wn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Wn.prototype.interfaces_=function(){return[E]},Wn.prototype.getClass=function(){return Wn};var Kn=function(){this._nodeMap=new l,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},Kn.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)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],A=e.dist>0||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this.edge.pts[s];return A&&(i[o]=e.coord),new nr(i,new Me(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new Wn(t,e,n),A=this._nodeMap.get(r);return null!==A?A:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Zn=function(){};Zn.prototype.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new R(e));do{var r=this.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return Zn.toIntArray(n)},Zn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Jn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new j,this.env2=new j;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Zn;this.startIndex=e.getChainStartIndices(this.pts)};Jn.prototype.getCoordinates=function(){return this.pts},Jn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Jn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Jn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[A],l=this.pts[i],f=o.pts[s],h=o.pts[a];if(i-A==1&&a-s==1)return u.addIntersections(this.e,A,o.e,s),null;if(this.env1.init(c,l),this.env2.init(f,h),!this.env1.intersects(this.env2))return null;var p=Math.trunc((A+i)/2),d=Math.trunc((s+a)/2);A<p&&(s<d&&this.computeIntersectsForChain(A,p,o,s,d,u),d<a&&this.computeIntersectsForChain(A,p,o,d,a,u)),p<i&&(s<d&&this.computeIntersectsForChain(p,i,o,s,d,u),d<a&&this.computeIntersectsForChain(p,i,o,d,a,u))}},Jn.prototype.getStartIndexes=function(){return this.startIndex},Jn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],A=arguments[1];return this._depth[r][A]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ce.RIGHT]-this._depth[t][Ce.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==S.EXTERIOR&&r!==S.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var A=arguments[0],i=arguments[1];arguments[2]===S.INTERIOR&&this._depth[A][i]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.pts=r,this._label=A}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Me.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,A=!0,i=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(n.pts[o])||(r=!1),this.pts[o].equals2D(n.pts[--i])||(A=!1),!r&&!A)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Jn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new j;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var A=new I(t.getIntersection(r)),i=e,o=t.getEdgeDistance(n,r),s=i+1;if(s<this.pts.length){var a=this.pts[s];A.equals2D(a)&&(i=s,o=0)}this.eiList.add(A,i,o)},e.prototype.toString=function(){var t=new O;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ce.ON),e.getLocation(1,Ce.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ce.LEFT),e.getLocation(1,Ce.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ce.RIGHT),e.getLocation(1,Ce.RIGHT),2))},e}(ke),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip(),n.merge(r);var A=rr.depthDelta(r),i=e.getDepthDelta()+A;e.setDepthDelta(i)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new bt,r=t.iterator();r.hasNext();){var A=r.next(),i=A.getRightmostCoordinate(),o=new Pn(n).getDepth(i);A.computeDepth(o),A.findResultEdges(),n.add(A),e.add(A.getDirectedEdges(),A.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new bt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var A=new Le;A.create(r),e.add(A)}}return Je.sort(e,Je.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new At;return n.setPrecisionModel(t),e.setSegmentIntersector(new $n(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Rn(n,this._bufParams),A=new Gn(t,e,r).getCurves();if(A.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(A,n),this._graph=new qe(new Yn),this._graph.addEdges(this._edgeList.getEdges());var i=this.createSubgraphs(this._graph),o=new Ye(this._geomFact);this.buildSubgraphs(i,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var A=r.next(),i=A.getCoordinates();if(2!==i.length||!i[0].equals2D(i[1])){var o=A.getData(),s=new nr(A.getCoordinates(),new Me(o));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ce.LEFT),n=t.getLocation(0,Ce.RIGHT);return e===S.INTERIOR&&n===S.EXTERIOR?1:e===S.EXTERIOR&&n===S.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ye,n=new bt;t.hasNext();){var r=t.next(),A=e.createLineString(r.getCoordinates());n.add(A)}return e.buildGeometry(n)};var Ar=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2],i=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=A,this._offsetY=i,this._isScaled=!this.isIntegerPrecision()}};Ar.prototype.rescale=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&q.out.println(n)}},Ar.prototype.scale=function(){if(L(arguments[0],vt)){for(var t=arguments[0],e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new pn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var A=arguments[0],i=new Array(A.length).fill(null),o=0;o<A.length;o++)i[o]=new I(Math.round((A[o].x-this._offsetX)*this._scaleFactor),Math.round((A[o].y-this._offsetY)*this._scaleFactor),A[o].z);return xt.removeRepeatedPoints(i)}},Ar.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},Ar.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},Ar.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},Ar.prototype.interfaces_=function(){return[vn]},Ar.prototype.getClass=function(){return Ar};var ir=function(){this._li=new At,this._segStrings=null;var t=arguments[0];this._segStrings=t},or={fact:{configurable:!0}};ir.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var A=r.next().getCoordinates(),i=1;i<A.length-1;i++)if(A[i].equals(n))throw new J("found endpt/interior pt intersection at index "+i+" :pt "+n)},ir.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var A=arguments[0],i=arguments[1],o=A.getCoordinates(),s=i.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(A,a,i,u);else if(4===arguments.length){var c=arguments[0],l=arguments[1],f=arguments[2],h=arguments[3];if(c===f&&l===h)return null;var p=c.getCoordinates()[l],d=c.getCoordinates()[l+1],g=f.getCoordinates()[h],y=f.getCoordinates()[h+1];if(this._li.computeIntersection(p,d,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,p,d)||this.hasInteriorIntersection(this._li,g,y)))throw new J("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},ir.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},ir.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},ir.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var A=t.getIntersection(r);if(!A.equals(e)&&!A.equals(n))return!0}return!1},ir.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new J("found non-noded collapse at "+ir.fact.createLineString([t,e,n]))},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},or.fact.get=function(){return new ye},Object.defineProperties(ir,or);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],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _("Scale factor must be non-zero");1!==e&&(this._pt=new I(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new I,this._p1Scaled=new I),this.initCorners(this._pt)},ar={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),A=Math.min(t.y,e.y),i=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<A||this._miny>i;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(o&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,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,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sr.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},sr.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,ar);var ur=function(){this.tempEnv1=new j,this.selectedSegment=new dn};ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._index=null;var t=arguments[0];this._index=t},lr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],A=e.getSafeEnvelope(),i=new fr(e,n,r);return this._index.query(A,{interfaces_:function(){return[$e]},visitItem:function(t){t.select(A,i)}}),i.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},lr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,lr);var fr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur),hr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bt};hr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)this._interiorIntersections.add(this._li.getIntersection(a));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},hr.prototype.isDone=function(){return!1},hr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},hr.prototype.interfaces_=function(){return[Xn]},hr.prototype.getClass=function(){return hr};var pr=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 At,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};pr.prototype.checkCorrectness=function(t){var e=pn.getNodedSubstrings(t),n=new ir(e);try{n.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},pr.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},pr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},pr.prototype.findInteriorIntersections=function(t,e){var n=new hr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},pr.prototype.computeVertexSnaps=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof pn)for(var n=arguments[0],r=n.getCoordinates(),A=0;A<r.length;A++){var i=new sr(r[A],this._scaleFactor,this._li);this._pointSnapper.snap(i,n,A)&&n.addIntersection(r[A],A)}},pr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},pr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},pr.prototype.interfaces_=function(){return[vn]},pr.prototype.getClass=function(){return pr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new In,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},gr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new Ar(new pr(new he(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Se))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),A=new he(r);this.bufferFixedPrecision(A)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===he.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof J))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new dr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new dr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof In&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var A=arguments[1];return new dr(arguments[0],arguments[2]).getResultGeometry(A)}}else if(4===arguments.length){var i=arguments[1],o=arguments[2],s=arguments[3],a=new dr(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(i)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),A=T.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),i=n-Math.trunc(Math.log(A)/Math.log(10)+1);return Math.pow(10,i)},gr.CAP_ROUND.get=function(){return In.CAP_ROUND},gr.CAP_BUTT.get=function(){return In.CAP_FLAT},gr.CAP_FLAT.get=function(){return In.CAP_FLAT},gr.CAP_SQUARE.get=function(){return In.CAP_SQUARE},gr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,gr);var yr=function(){this._pt=[new I,new I],this._distance=m.NaN,this._isNull=!0};yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(t){return this._pt[t]},yr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},yr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},yr.prototype.getDistance=function(){return this._distance},yr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new dn,A=0;A<n.length-1;A++){r.setCoordinates(n[A],n[A+1]);var i=r.closestPoint(t);e.setMinimum(i,t)}else if(arguments[2]instanceof yr&&arguments[0]instanceof Jt&&arguments[1]instanceof I){var o=arguments[0],s=arguments[1],a=arguments[2];_r.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)_r.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof yr&&arguments[0]instanceof ct&&arguments[1]instanceof I){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof $t)_r.computeDistance(c,l,f);else if(c instanceof Jt)_r.computeDistance(c,l,f);else if(c instanceof zt)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);_r.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof yr&&arguments[0]instanceof dn&&arguments[1]instanceof I){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var mr=function(t){this._maxPtDist=new yr,this._inputGeom=t||null},vr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},vr.MaxPointDistanceFilter.get=function(){return Er},vr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,vr);var Er=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ht]},Er.prototype.getClass=function(){return Er};var wr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=new I((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,A,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[Qt]},wr.prototype.getClass=function(){return wr};var br=function(t){this._comps=t||null};br.prototype.filter=function(t){t instanceof Jt&&this._comps.add(t)},br.prototype.interfaces_=function(){return[Ut]},br.prototype.getClass=function(){return br},br.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return br.getPolygons(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Jt?n.add(e):e instanceof zt&&e.apply(new br(n)),n}};var Ir=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Ir.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof $t&&this._lines.add(t)},Ir.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ir.prototype.interfaces_=function(){return[ut]},Ir.prototype.getClass=function(){return Ir},Ir.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Ir.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ir.getLines(e,n))}},Ir.getLines=function(){if(1===arguments.length){var t=arguments[0];return Ir.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],vt)&&L(arguments[1],vt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Ir.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var A=arguments[0],i=arguments[1],o=new bt;return A.apply(new Ir(o,i)),o}if(arguments[0]instanceof ct&&L(arguments[1],vt)){var s=arguments[0],a=arguments[1];return s instanceof $t?a.add(s):s.apply(new Ir(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],vt)&&L(arguments[1],vt)){for(var u=arguments[1],c=arguments[2],l=arguments[0].iterator();l.hasNext();){var f=l.next();Ir.getLines(f,u,c)}return u}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],vt)){var h=arguments[1],p=arguments[2];return arguments[0].apply(new Ir(h,p)),h}}};var Cr=function(){if(this._boundaryRule=pt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Cr.prototype.locateInternal=function(){if(arguments[0]instanceof I&&arguments[1]instanceof Jt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===S.EXTERIOR)return S.EXTERIOR;if(r===S.BOUNDARY)return S.BOUNDARY;for(var A=0;A<e.getNumInteriorRing();A++){var i=e.getInteriorRingN(A),o=this.locateInPolygonRing(t,i);if(o===S.INTERIOR)return S.EXTERIOR;if(o===S.BOUNDARY)return S.BOUNDARY}return S.INTERIOR}if(arguments[0]instanceof I&&arguments[1]instanceof $t){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return S.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?st.isOnLine(s,u)?S.INTERIOR:S.EXTERIOR:S.BOUNDARY}if(arguments[0]instanceof I&&arguments[1]instanceof Kt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?S.INTERIOR:S.EXTERIOR}},Cr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):S.EXTERIOR},Cr.prototype.intersects=function(t,e){return this.locate(t,e)!==S.EXTERIOR},Cr.prototype.updateLocationInfo=function(t){t===S.INTERIOR&&(this._isIn=!0),t===S.BOUNDARY&&this._numBoundaries++},Cr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var A=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,A))}else if(e instanceof ne)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof zt)for(var a=new Qn(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},Cr.prototype.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:e instanceof $t||e instanceof Jt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?S.BOUNDARY:this._numBoundaries>0||this._isIn?S.INTERIOR:S.EXTERIOR)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var xr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Nr={INSIDE_AREA:{configurable:!0}};xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Nr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Nr);var Sr=function(t){this._pts=t||null};Sr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Sr.prototype.interfaces_=function(){return[Ut]},Sr.prototype.getClass=function(){return Sr},Sr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Je.singletonList(t):Sr.getPoints(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof zt&&e.apply(new Sr(n)),n}};var Dr=function(){this._locations=null;var t=arguments[0];this._locations=t};Dr.prototype.filter=function(t){(t instanceof Kt||t instanceof $t||t instanceof Jt)&&this._locations.add(new xr(t,0,t.getCoordinate()))},Dr.prototype.interfaces_=function(){return[Ut]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(t){var e=new bt;return t.apply(new Dr(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Cr,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=A}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,A=br.getPolygons(this._geom[e]);if(A.size()>0){var i=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(i,A,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=0;u<o.size();u++)for(var c=o.get(u),l=0;l<s.size();l++)if(this.computeContainmentDistance(c,s.get(l),a),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof xr&&arguments[1]instanceof Jt){var f=arguments[0],h=arguments[1],p=arguments[2],d=f.getCoordinate();if(S.EXTERIOR!==this._ptLocator.locate(d,h))return this._minDistance=0,p[0]=f,p[1]=new xr(h,d),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i);if(this.computeMinDistance(A,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ir.getLines(this._geom[0]),n=Ir.getLines(this._geom[1]),r=Sr.getPoints(this._geom[0]),A=Sr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,A,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,A,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),A=e.getCoordinate(),i=0;i<r.length-1;i++){var o=st.distancePointLine(A,r[i],r[i+1]);if(o<this._minDistance){this._minDistance=o;var s=new dn(r[i],r[i+1]).closestPoint(A);n[0]=new xr(t,i,s),n[1]=new xr(e,0,A)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof $t){var a=arguments[0],u=arguments[1],c=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var l=a.getCoordinates(),f=u.getCoordinates(),h=0;h<l.length-1;h++)for(var p=0;p<f.length-1;p++){var d=st.distanceLineLine(l[h],l[h+1],f[p],f[p+1]);if(d<this._minDistance){this._minDistance=d;var g=new dn(l[h],l[h+1]),y=new dn(f[p],f[p+1]),_=g.closestPoints(y);c[0]=new xr(a,h,_[0]),c[1]=new xr(u,p,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i),s=A.getCoordinate().distance(o.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new xr(A,0,A.getCoordinate()),n[1]=new xr(o,0,o.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i);if(this.computeMinDistance(A,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Tr=function(){this._pt=[new I,new I],this._distance=m.NaN,this._isNull=!0};Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Tr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},Tr.prototype.toString=function(){return Z.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Mr=function(){};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.computeDistance=function(){if(arguments[2]instanceof Tr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,A=t.getCoordinates(),i=0;i<A.length-1;i++){r.setCoordinates(A[i],A[i+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof Jt&&arguments[1]instanceof I){var s=arguments[0],a=arguments[1],u=arguments[2];Mr.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)Mr.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof I){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof $t)Mr.computeDistance(l,f,h);else if(l instanceof Jt)Mr.computeDistance(l,f,h);else if(l instanceof zt)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);Mr.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof I){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var Or=function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.prototype.computeOrientedDistance=function(t,e,n){var r=new Pr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var A=new kr(e,this._densifyFrac);t.apply(A),n.setMaximum(A.getMaxPointDistance())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Rr.MaxPointDistanceFilter.get=function(){return Pr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Or,Rr);var Pr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Mr,this._geom=null;var t=arguments[0];this._geom=t};Pr.prototype.filter=function(t){this._minPtDist.initialize(),Mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Pr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Pr.prototype.interfaces_=function(){return[ht]},Pr.prototype.getClass=function(){return Pr};var kr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=(r.x-n.x)/this._numSubSegs,i=(r.y-n.y)/this._numSubSegs,o=0;o<this._numSubSegs;o++){var s=n.x+o*A,a=n.y+o*i,u=new I(s,a);this._minPtDist.initialize(),Mr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},kr.prototype.isDone=function(){return!1},kr.prototype.isGeometryChanged=function(){return!1},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Qt]},kr.prototype.getClass=function(){return kr};var Br=function(t,e,n){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=e||null,this._result=n||null},Fr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var A=r.getCoordinates();this._errorLocation=A[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Z.toLineString(A[0],A[1])+")"}},Br.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Br.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Br.VERBOSE&&q.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Br.prototype.checkNegativeValid=function(){if(!(this._input instanceof Jt||this._input instanceof ne||this._input instanceof zt))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)},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var A=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Z.toLineString(A[0],A[1])+" )"}},Br.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)},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.prototype.getPolygonLines=function(t){for(var e=new bt,n=new Ir(e),r=br.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Br.prototype.getErrorMessage=function(){return this._errMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Fr.VERBOSE.get=function(){return!1},Fr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Fr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new j(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new j(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new Br(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")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Jt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;q.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Qr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Qr.prototype.getCoordinates=function(){return this._pts},Qr.prototype.size=function(){return this._pts.length},Qr.prototype.getCoordinate=function(t){return this._pts[t]},Qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ln.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Qr.prototype.setData=function(t){this._data=t},Qr.prototype.getData=function(){return this._data},Qr.prototype.toString=function(){return Z.toLineString(new ae(this._pts))},Qr.prototype.interfaces_=function(){return[fn]},Qr.prototype.getClass=function(){return Qr};var zr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=A,this._intSegments[1]=i,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Xn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new At,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Se(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Z.toLineString(t[0],t[1])+" and "+Z.toLineString(t[2],t[3])},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};qr.prototype.checkValid=function(){this._nv.checkValid()},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.toSegmentStrings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Qr(r.getCoordinates(),r))}return e},qr.checkValid=function(t){new qr(t).checkValid()};var Yr=function(t){this._mapOp=t};Yr.prototype.map=function(t){for(var e=new bt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ye.toGeometryArray(e))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(e).map(t)};var jr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bt,this._resultLineList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};jr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},jr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},jr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},jr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),A=t.getEdge();t.isLineEdge()&&(t.isVisited()||!xA.isResultOfOp(r,e)||A.isCovered()||(n.add(A),t.setVisitedEdge(!0)))},jr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var A=this._op.isCoveredByA(n.getCoordinate());r.setCovered(A)}}},jr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},jr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},jr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(xA.isResultOfOp(r,e)&&e===xA.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==xA.INTERSECTION)){var r=n.getLabel();xA.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Xr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Xr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var A=new bt,i=0;i<t.getNumInteriorRing();i++){var o=this.transformLinearRing(t.getInteriorRingN(i),t);null===o||o.isEmpty()||(o instanceof ee||(n=!1),A.add(o))}if(n)return this._factory.createPolygon(r,A.toArray([]));var s=new bt;return null!==r&&s.add(r),s.addAll(A),this._factory.buildGeometry(s)},Xr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Xr.prototype.getInputGeometry=function(){return this._inputGeom},Xr.prototype.transformMultiLineString=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformLineString(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Xr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformMultiPoint=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformPoint(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.transformMultiPolygon=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformPolygon(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.copy=function(t){return t.copy()},Xr.prototype.transformGeometryCollection=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transform(t.getGeometryN(r));null!==A&&(this._pruneEmptyGeometry&&A.isEmpty()||n.add(A))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ye.toGeometryArray(n)):this._factory.buildGeometry(n)},Xr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof $t)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Jt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Xr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var $r=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $t&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};$r.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var A=t.get(r),i=this.findSnapForVertex(A,e);null!==i&&(t.set(r,new I(i)),0===r&&this._isClosed&&t.set(t.size()-1,new I(i)))}},$r.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},$r.prototype.snapTo=function(t){var e=new Ct(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},$r.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var A=e[r],i=this.findSegmentIndexToSnap(A,t);i>=0&&t.add(i+1,new I(A),!1)}},$r.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,A=0;A<e.size()-1;A++){if(this._seg.p0=e.get(A),this._seg.p1=e.get(A+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var i=this._seg.distance(t);i<this._snapTolerance&&i<n&&(n=i,r=A)}return r},$r.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Wr=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};Wr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Zr(e,n).transform(this._srcGeom)},Wr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Zr(t,n,!0).transform(this._srcGeom),A=r;return e&&L(A,Zt)&&(A=r.buffer(0)),A},Wr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Wr.prototype.extractTargetCoordinates=function(t){for(var e=new h,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Wr.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.snap=function(t,e,n){var r=new Array(2).fill(null),A=new Wr(t);r[0]=A.snapTo(e,n);var i=new Wr(e);return r[1]=i.snapTo(r[0],n),r},Wr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Wr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===he.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var A=arguments[0],i=arguments[1];return Math.min(Wr.computeOverlaySnapTolerance(A),Wr.computeOverlaySnapTolerance(i))}},Wr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Wr.SNAP_PRECISION_FACTOR},Wr.snapToSelf=function(t,e,n){return new Wr(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Wr,Kr);var Zr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new $r(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr),Jr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Jr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Jr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Jr.signExpBits(this._commonBits),this._isFirst=!1,null):Jr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Jr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Jr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Jr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.getBit=function(t,e){return t&1<<e?1:0},Jr.signExpBits=function(t){return t>>52},Jr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Jr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Jr.getBit(t,r)!==Jr.getBit(e,r))return n;n++}return 52};var tA=function(){this._commonCoord=null,this._ccFilter=new nA},eA={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};tA.prototype.addCommonBits=function(t){var e=new rA(this._commonCoord);t.apply(e),t.geometryChanged()},tA.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new rA(e);return t.apply(n),t.geometryChanged(),t},tA.prototype.getCommonCoordinate=function(){return this._commonCoord},tA.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},tA.prototype.interfaces_=function(){return[]},tA.prototype.getClass=function(){return tA},eA.CommonCoordinateFilter.get=function(){return nA},eA.Translater.get=function(){return rA},Object.defineProperties(tA,eA);var nA=function(){this._commonBitsX=new Jr,this._commonBitsY=new Jr};nA.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},nA.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},nA.prototype.interfaces_=function(){return[ht]},nA.prototype.getClass=function(){return nA};var rA=function(){this.trans=null;var t=arguments[0];this.trans=t};rA.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},rA.prototype.isDone=function(){return!1},rA.prototype.isGeometryChanged=function(){return!0},rA.prototype.interfaces_=function(){return[Qt]},rA.prototype.getClass=function(){return rA};var AA=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};AA.prototype.selfSnap=function(t){return new Wr(t).snapTo(t,this._snapTolerance)},AA.prototype.removeCommonBits=function(t){this._cbr=new tA,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},AA.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},AA.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=xA.overlayOp(e[0],e[1],t);return this.prepareResult(n)},AA.prototype.checkValid=function(t){t.isValid()||q.out.println("Snapped geometry is invalid")},AA.prototype.computeSnapTolerance=function(){this._snapTolerance=Wr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},AA.prototype.snap=function(t){var e=this.removeCommonBits(t);return Wr.snap(e[0],e[1],this._snapTolerance)},AA.prototype.interfaces_=function(){return[]},AA.prototype.getClass=function(){return AA},AA.overlayOp=function(t,e,n){return new AA(t,e).getResultGeometry(n)},AA.union=function(t,e){return AA.overlayOp(t,e,xA.UNION)},AA.intersection=function(t,e){return AA.overlayOp(t,e,xA.INTERSECTION)},AA.symDifference=function(t,e){return AA.overlayOp(t,e,xA.SYMDIFFERENCE)},AA.difference=function(t,e){return AA.overlayOp(t,e,xA.DIFFERENCE)};var iA=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};iA.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=xA.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof J))throw t;r=t}if(!n)try{e=AA.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof J?r:t}return e},iA.prototype.interfaces_=function(){return[]},iA.prototype.getClass=function(){return iA},iA.overlayOp=function(t,e,n){return new iA(t,e).getResultGeometry(n)},iA.union=function(t,e){return iA.overlayOp(t,e,xA.UNION)},iA.intersection=function(t,e){return iA.overlayOp(t,e,xA.INTERSECTION)},iA.symDifference=function(t,e){return iA.overlayOp(t,e,xA.SYMDIFFERENCE)},iA.difference=function(t,e){return iA.overlayOp(t,e,xA.DIFFERENCE)};var oA=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};oA.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},oA.prototype.interfaces_=function(){return[]},oA.prototype.getClass=function(){return oA};var sA=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=A,this._obj=i}},aA={INSERT:{configurable:!0},DELETE:{configurable:!0}};sA.prototype.isDelete=function(){return this._eventType===sA.DELETE},sA.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},sA.prototype.getObject=function(){return this._obj},sA.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},sA.prototype.getInsertEvent=function(){return this._insertEvent},sA.prototype.isInsert=function(){return this._eventType===sA.INSERT},sA.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},sA.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},sA.prototype.interfaces_=function(){return[E]},sA.prototype.getClass=function(){return sA},aA.INSERT.get=function(){return 1},aA.DELETE.get=function(){return 2},Object.defineProperties(sA,aA);var uA=function(){};uA.prototype.interfaces_=function(){return[]},uA.prototype.getClass=function(){return uA};var cA=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],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};cA.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(cA.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.getNumPoints()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},cA.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cA.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},cA.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cA.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},cA.prototype.hasProperIntersection=function(){return this._hasProper},cA.prototype.hasIntersection=function(){return this._hasIntersection},cA.prototype.isDone=function(){return this._isDone},cA.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},cA.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},cA.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,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))))},cA.prototype.interfaces_=function(){return[]},cA.prototype.getClass=function(){return cA},cA.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lA=function(t){function e(){t.call(this),this.events=new bt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Je.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof cA&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],A=arguments[1],i=arguments[2];this.addEdges(r,r),this.addEdges(A,A),this.computeIntersections(i)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof cA){var o=arguments[0],s=arguments[1];arguments[2]?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),A=0;A<r.length-1;A++){var i=new oA(n,A),o=new sA(e,n.getMinX(A),i);this.events.add(o),this.events.add(new sA(n.getMaxX(A),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var A=n.getObject(),i=t;i<e;i++){var o=this.events.get(i);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(A.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var A=r.next();this.addEdge(A,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(uA),fA=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},hA={NodeComparator:{configurable:!0}};fA.prototype.getMin=function(){return this._min},fA.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fA.prototype.getMax=function(){return this._max},fA.prototype.toString=function(){return Z.toLineString(new I(this._min,0),new I(this._max,0))},fA.prototype.interfaces_=function(){return[]},fA.prototype.getClass=function(){return fA},hA.NodeComparator.get=function(){return pA},Object.defineProperties(fA,hA);var pA=function(){};pA.prototype.compare=function(t,e){var n=t,r=e,A=(n._min+n._max)/2,i=(r._min+r._max)/2;return A<i?-1:A>i?1:0},pA.prototype.interfaces_=function(){return[b]},pA.prototype.getClass=function(){return pA};var dA=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fA),gA=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fA),yA=function(){this._leaves=new bt,this._root=null,this._level=0};yA.prototype.buildTree=function(){Je.sort(this._leaves,new fA.NodeComparator);for(var t=this._leaves,e=null,n=new bt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yA.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new dA(t,e,n))},yA.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yA.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yA.prototype.printNode=function(t){q.out.println(Z.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},yA.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yA.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var A=new gA(t.get(n),t.get(n+1));e.add(A)}}},yA.prototype.interfaces_=function(){return[]},yA.prototype.getClass=function(){return yA};var _A=function(){this._items=new bt};_A.prototype.visitItem=function(t){this._items.add(t)},_A.prototype.getItems=function(){return this._items},_A.prototype.interfaces_=function(){return[$e]},_A.prototype.getClass=function(){return _A};var mA=function(){this._index=null;var t=arguments[0];if(!L(t,Zt))throw new _("Argument must be Polygonal");this._index=new wA(t)},vA={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mA.prototype.locate=function(t){var e=new ot(t),n=new EA(e);return this._index.query(t.y,t.y,n),e.getLocation()},mA.prototype.interfaces_=function(){return[Un]},mA.prototype.getClass=function(){return mA},vA.SegmentVisitor.get=function(){return EA},vA.IntervalIndexedGeometry.get=function(){return wA},Object.defineProperties(mA,vA);var EA=function(){this._counter=null;var t=arguments[0];this._counter=t};EA.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},EA.prototype.interfaces_=function(){return[$e]},EA.prototype.getClass=function(){return EA};var wA=function(){this._index=new yA;var t=arguments[0];this.init(t)};wA.prototype.init=function(t){for(var e=Ir.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wA.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),A=Math.max(n.p0.y,n.p1.y);this._index.insert(r,A,n)}},wA.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _A;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._index.query(r,A,i)}},wA.prototype.interfaces_=function(){return[]},wA.prototype.getClass=function(){return wA};var bA=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Cr,2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];this._argIndex=A,this._parentGeom=i,this._boundaryNodeRule=o,null!==i&&this.add(i)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),A=1;S.NONE,r.getLocation(t,Ce.ON)===S.BOUNDARY&&A++;var i=e.determineBoundary(this._boundaryNodeRule,A);r.setLocation(t,i)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],A=new cA(arguments[0],!0,!1);A.setIsDoneIfProperInt(r);var i=this.createEdgeSetIntersector(),o=this._parentGeom instanceof ee||this._parentGeom instanceof Jt||this._parentGeom instanceof ne,s=n||!o;return i.computeIntersections(this._edges,A,s),this.addSelfIntersectionNodes(this._argIndex),A}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new cA(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,S.INTERIOR)}else if(arguments[0]instanceof I){var e=arguments[0];this.insertPoint(this._argIndex,e,S.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),S.EXTERIOR,S.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,S.INTERIOR,S.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],S.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],S.BOUNDARY)},e.prototype.addLineString=function(t){var e=xt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Me(this._argIndex,S.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var A=r.next();e[n++]=A.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===S.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=xt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var A=e,i=n;st.isCCW(r)&&(A=n,i=e);var o=new nr(r,new Me(this._argIndex,S.BOUNDARY,A,i));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],S.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),A=r.getLabel();null===A?r._label=new Me(t,n):A.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lA},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),A=n.eiList.iterator();A.hasNext();){var i=A.next();this.addSelfIntersectionNode(t,i.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Jt)this.addPolygon(e);else if(e instanceof $t)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,Zt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mA(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e}(qe),IA=function(){if(this._li=new At,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bA(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bA(0,e,r),this._arg[1]=new bA(1,n,r)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];A.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(A.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bA(0,A,o),this._arg[1]=new bA(1,i,o)}};IA.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},IA.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},IA.prototype.interfaces_=function(){return[]},IA.prototype.getClass=function(){return IA};var CA=function(){};CA.prototype.interfaces_=function(){return[]},CA.prototype.getClass=function(){return CA},CA.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],CA.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bt,r=0;r<t.getNumGeometries();r++){var A=e.map(t.getGeometryN(r));null!==A&&n.add(A)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],vt)&&L(arguments[1],CA.MapOp)){for(var i=arguments[0],o=arguments[1],s=new bt,a=i.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},CA.MapOp=function(){};var xA=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Cr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new bt,this._resultLineList=new bt,this._resultPointList=new bt,this._graph=new qe(new Yn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip();var A=e.getDepth();A.isNull()&&A.add(n),A.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,A){var i=new bt;return i.addAll(t),i.addAll(n),i.addAll(r),i.isEmpty()?e.createEmptyResult(A,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(i)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==S.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){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 e=new bt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new jr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var A=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=A.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),A=r.getLabel();A.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(A.getLocation(0,Ce.RIGHT),A.getLocation(1,Ce.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var A=0;A<2;A++)n.isNull(A)||!n.isArea()||r.isNull(A)||(0===r.getDelta(A)?n.toLine(A):(et.isTrue(!r.isNull(A,Ce.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(A,Ce.LEFT,r.getLocation(A,Ce.LEFT)),et.isTrue(!r.isNull(A,Ce.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(A,Ce.RIGHT,r.getLocation(A,Ce.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(IA);xA.overlayOp=function(t,e,n){return new xA(t,e).getResultGeometry(n)},xA.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return xA.createEmptyResult(xA.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[CA.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.INTERSECTION)},xA.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xA.createEmptyResult(xA.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.SYMDIFFERENCE)},xA.resultDimension=function(t,e,n){var r=e.getDimension(),A=n.getDimension(),i=-1;switch(t){case xA.INTERSECTION:i=Math.min(r,A);break;case xA.UNION:i=Math.max(r,A);break;case xA.DIFFERENCE:i=r;break;case xA.SYMDIFFERENCE:i=Math.max(r,A)}return i},xA.createEmptyResult=function(t,e,n,r){var A=null;switch(xA.resultDimension(t,e,n)){case-1:A=r.createGeometryCollection(new Array(0).fill(null));break;case 0:A=r.createPoint();break;case 1:A=r.createLineString();break;case 2:A=r.createPolygon()}return A},xA.difference=function(t,e){return t.isEmpty()?xA.createEmptyResult(xA.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.DIFFERENCE))},xA.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return xA.isResultOfOp(n,r,e)}if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];switch(A===S.BOUNDARY&&(A=S.INTERIOR),i===S.BOUNDARY&&(i=S.INTERIOR),o){case xA.INTERSECTION:return A===S.INTERIOR&&i===S.INTERIOR;case xA.UNION:return A===S.INTERIOR||i===S.INTERIOR;case xA.DIFFERENCE:return A===S.INTERIOR&&i!==S.INTERIOR;case xA.SYMDIFFERENCE:return A===S.INTERIOR&&i!==S.INTERIOR||A!==S.INTERIOR&&i===S.INTERIOR}return!1}},xA.INTERSECTION=1,xA.UNION=2,xA.DIFFERENCE=3,xA.SYMDIFFERENCE=4;var NA=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Cr,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};NA.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},NA.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?S.BOUNDARY:this._ptLocator.locate(t,this._g)},NA.prototype.extractLinework=function(t){var e=new SA;t.apply(e);var n=e.getLinework(),r=ye.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},NA.prototype.interfaces_=function(){return[]},NA.prototype.getClass=function(){return NA};var SA=function(){this._linework=null,this._linework=new bt};SA.prototype.getLinework=function(){return this._linework},SA.prototype.filter=function(t){if(t instanceof Jt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},SA.prototype.interfaces_=function(){return[Ut]},SA.prototype.getClass=function(){return SA};var DA=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};DA.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),A=0;A<r.length-1;A++)this.computeOffsetPoints(r[A],r[A+1],e,n)},DA.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},DA.prototype.getPoints=function(t){for(var e=new bt,n=Ir.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},DA.prototype.computeOffsetPoints=function(t,e,n,r){var A=e.x-t.x,i=e.y-t.y,o=Math.sqrt(A*A+i*i),s=n*A/o,a=n*i/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new I(u-a,c+s);r.add(l)}if(this._doRight){var f=new I(u+a,c-s);r.add(f)}},DA.prototype.interfaces_=function(){return[]},DA.prototype.getClass=function(){return DA};var LA=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new NA(this._geom[0],this._boundaryDistanceTolerance),new NA(this._geom[1],this._boundaryDistanceTolerance),new NA(this._geom[2],this._boundaryDistanceTolerance)]},TA={TOLERANCE:{configurable:!0}};LA.prototype.reportResult=function(t,e,n){q.out.println("Overlay result invalid - A:"+S.toLocationSymbol(e[0])+" B:"+S.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+S.toLocationSymbol(e[2]))},LA.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},LA.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=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),!!LA.hasLocation(this._location,S.BOUNDARY)||this.isValidResult(r,this._location)}},LA.prototype.addTestPts=function(t){var e=new DA(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},LA.prototype.isValidResult=function(t,e){var n=xA.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===S.INTERIOR);return r||this.reportResult(t,e,n),r},LA.prototype.getInvalidLocation=function(){return this._invalidLocation},LA.prototype.interfaces_=function(){return[]},LA.prototype.getClass=function(){return LA},LA.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},LA.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Wr.computeSizeBasedSnapTolerance(t),Wr.computeSizeBasedSnapTolerance(e))},LA.isValid=function(t,e,n,r){return new LA(t,e,r).isValid(n)},TA.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(LA,TA);var MA=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};MA.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},MA.prototype.combine=function(){for(var t=new bt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},MA.prototype.interfaces_=function(){return[]},MA.prototype.getClass=function(){return MA},MA.combine=function(){if(1===arguments.length)return new MA(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new MA(MA.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];return new MA(MA.createList(n,r,A)).combine()}},MA.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},MA.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=new bt;return o.add(r),o.add(A),o.add(i),o}};var OA=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bt)},RA={STRTREE_NODE_CAPACITY:{configurable:!0}};OA.prototype.reduceToGeometries=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next(),A=null;L(r,wt)?A=this.unionTree(r):r instanceof ct&&(A=r),e.add(A)}return e},OA.prototype.extractByEnvelope=function(t,e,n){for(var r=new bt,A=0;A<e.getNumGeometries();A++){var i=e.getGeometryN(A);i.getEnvelopeInternal().intersects(t)?r.add(i):n.add(i)}return this._geomFactory.buildGeometry(r)},OA.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return MA.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var A=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,A)},OA.prototype.union=function(){if(null===this._inputPolys)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 on(OA.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},OA.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var A=OA.getGeometry(e,n);return this.unionSafe(A,null)}if(r-n==2)return this.unionSafe(OA.getGeometry(e,n),OA.getGeometry(e,n+1));var i=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,i),s=this.binaryUnion(e,i,r);return this.unionSafe(o,s)}},OA.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},OA.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},OA.prototype.unionActual=function(t,e){return OA.restrictToPolygons(t.union(e))},OA.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},OA.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bt,A=this.extractByEnvelope(n,t,r),i=this.extractByEnvelope(n,e,r),o=this.unionActual(A,i);return r.add(o),MA.combine(r)},OA.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},OA.prototype.interfaces_=function(){return[]},OA.prototype.getClass=function(){return OA},OA.restrictToPolygons=function(t){if(L(t,Zt))return t;var e=br.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ye.toPolygonArray(e))},OA.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},OA.union=function(t){return new OA(t).union()},RA.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(OA,RA);var PA=function(){};PA.prototype.interfaces_=function(){return[]},PA.prototype.getClass=function(){return PA},PA.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xA.createEmptyResult(xA.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.UNION)},t.GeoJSONReader=be,t.GeoJSONWriter=Ie,t.OverlayOp=xA,t.UnionOp=PA,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,qi.exports);var Yi=qi.exports;function ji(){return new Hi}function Hi(){this.reset()}Hi.prototype={constructor:Hi,reset:function(){this.s=this.t=0},add:function(t){$i(Xi,t,this.t),$i(this,Xi.s,this.s),this.s?this.t+=Xi.t:this.s=Xi.t},valueOf:function(){return this.s}};var Xi=new Hi;function $i(t,e,n){var r=t.s=e+n,A=r-e,i=r-A;t.t=e-i+(n-A)}var Wi=1e-6,Ki=Math.PI,Zi=Ki/2,Ji=Ki/4,to=2*Ki,eo=180/Ki,no=Ki/180,ro=Math.abs,Ao=Math.atan,io=Math.atan2,oo=Math.cos,so=Math.sin,ao=Math.sqrt;function uo(t){return t>1?0:t<-1?Ki:Math.acos(t)}function co(t){return t>1?Zi:t<-1?-Zi:Math.asin(t)}function lo(){}function fo(t,e){t&&yo.hasOwnProperty(t.type)&&yo[t.type](t,e)}var ho,po,go={Feature:function(t,e){fo(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,A=n.length;++r<A;)fo(n[r].geometry,e)}},yo={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){_o(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)_o(n[r],e,0)},Polygon:function(t,e){mo(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)mo(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,A=n.length;++r<A;)fo(n[r],e)}};function _o(t,e,n){var r,A=-1,i=t.length-n;for(e.lineStart();++A<i;)r=t[A],e.point(r[0],r[1],r[2]);e.lineEnd()}function mo(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)_o(t[n],e,1);e.polygonEnd()}function vo(t){return[io(t[1],t[0]),co(t[2])]}function Eo(t){var e=t[0],n=t[1],r=oo(n);return[r*oo(e),r*so(e),so(n)]}function wo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bo(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Io(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Co(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function xo(t){var e=ao(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function No(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function So(t,e){return[t>Ki?t-to:t<-Ki?t+to:t,e]}function Do(t){return function(e,n){return[(e+=t)>Ki?e-to:e<-Ki?e+to:e,n]}}function Lo(t){var e=Do(t);return e.invert=Do(-t),e}function To(t,e){var n=oo(t),r=so(t),A=oo(e),i=so(e);function o(t,e){var o=oo(e),s=oo(t)*o,a=so(t)*o,u=so(e),c=u*n+s*r;return[io(a*A-c*i,s*n-u*r),co(c*A+a*i)]}return o.invert=function(t,e){var o=oo(e),s=oo(t)*o,a=so(t)*o,u=so(e),c=u*A-a*i;return[io(a*A+u*i,s*n+c*r),co(c*n-s*r)]},o}function Mo(t,e){(e=Eo(e))[0]-=t,xo(e);var n=uo(-e[1]);return((-e[2]<0?-n:n)+to-Wi)%to}function Oo(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:lo,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ro(t,e){return ro(t[0]-e[0])<Wi&&ro(t[1]-e[1])<Wi}function Po(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ko(t,e,n,r,A){var i,o,s=[],a=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Ro(r,o)){for(A.lineStart(),i=0;i<e;++i)A.point((r=t[i])[0],r[1]);A.lineEnd()}else s.push(n=new Po(r,t,null,!0)),a.push(n.o=new Po(r,null,n,!1)),s.push(n=new Po(o,t,null,!1)),a.push(n.o=new Po(o,null,n,!0))}})),s.length){for(a.sort(e),Bo(s),Bo(a),i=0,o=a.length;i<o;++i)a[i].e=n=!n;for(var u,c,l=s[0];;){for(var f=l,h=!0;f.v;)if((f=f.n)===l)return;u=f.z,A.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(i=0,o=u.length;i<o;++i)A.point((c=u[i])[0],c[1]);else r(f.x,f.n.x,1,A);f=f.n}else{if(h)for(u=f.p.z,i=u.length-1;i>=0;--i)A.point((c=u[i])[0],c[1]);else r(f.x,f.p.x,-1,A);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);A.lineEnd()}}}function Bo(t){if(e=t.length){for(var e,n,r=0,A=t[0];++r<e;)A.n=n=t[r],n.p=A,A=n;A.n=n=t[0],n.p=A}}function Fo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Go(t){for(var e,n,r,A=t.length,i=-1,o=0;++i<A;)o+=t[i].length;for(n=new Array(o);--A>=0;)for(e=(r=t[A]).length;--e>=0;)n[--o]=r[e];return n}ji(),ji(),ji(),So.invert=So,1===(ho=Fo).length&&(po=ho,ho=function(t,e){return Fo(po(t),e)});var Uo=1e9,Qo=-Uo;function zo(t,e,n,r){function A(A,i){return t<=A&&A<=n&&e<=i&&i<=r}function i(A,i,s,u){var c=0,l=0;if(null==A||(c=o(A,s))!==(l=o(i,s))||a(A,i)<0^s>0)do{u.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==l);else u.point(i[0],i[1])}function o(r,A){return ro(r[0]-t)<Wi?A>0?0:3:ro(r[0]-n)<Wi?A>0?2:1:ro(r[1]-e)<Wi?A>0?1:0:A>0?3:2}function s(t,e){return a(t.x,e.x)}function a(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var a,u,c,l,f,h,p,d,g,y,_,m=o,v=Oo(),E={point:w,lineStart:function(){E.point=b,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(b(l,f),h&&g&&v.rejoin(),a.push(v.result()));E.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,A=u.length;n<A;++n)for(var i,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)i=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-i)*(r-o)>(h-o)*(t-i)&&++e:h<=r&&(f-i)*(r-o)<(h-o)*(t-i)&&--e;return e}(),n=_&&e,A=(a=Go(a)).length;(n||A)&&(o.polygonStart(),n&&(o.lineStart(),i(null,null,1,o),o.lineEnd()),A&&ko(a,s,e,i,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){A(t,e)&&m.point(t,e)}function b(i,o){var s=A(i,o);if(u&&c.push([i,o]),y)l=i,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(i,o));else if(s&&g)m.point(i,o);else{var a=[p=Math.max(Qo,Math.min(Uo,p)),d=Math.max(Qo,Math.min(Uo,d))],v=[i=Math.max(Qo,Math.min(Uo,i)),o=Math.max(Qo,Math.min(Uo,o))];!function(t,e,n,r,A,i){var o,s=t[0],a=t[1],u=0,c=1,l=e[0]-s,f=e[1]-a;if(o=n-s,l||!(o>0)){if(o/=l,l<0){if(o<u)return;o<c&&(c=o)}else if(l>0){if(o>c)return;o>u&&(u=o)}if(o=A-s,l||!(o<0)){if(o/=l,l<0){if(o>c)return;o>u&&(u=o)}else if(l>0){if(o<u)return;o<c&&(c=o)}if(o=r-a,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>u&&(u=o)}if(o=i-a,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<c&&(c=o)}return u>0&&(t[0]=s+u*l,t[1]=a+u*f),c<1&&(e[0]=s+c*l,e[1]=a+c*f),!0}}}}}(a,v,t,e,n,r)?s&&(m.lineStart(),m.point(i,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=i,d=o,g=s}return E}}var Vo=ji();function qo(t){return t}ji(),ji(),ji();var Yo=1/0,jo=Yo,Ho=-Yo,Xo=Ho,$o={point:function(t,e){t<Yo&&(Yo=t);t>Ho&&(Ho=t);e<jo&&(jo=e);e>Xo&&(Xo=e)},lineStart:lo,lineEnd:lo,polygonStart:lo,polygonEnd:lo,result:function(){var t=[[Yo,jo],[Ho,Xo]];return Ho=Xo=-(jo=Yo=1/0),t}};function Wo(t,e,n,r){return function(A,i){var o,s,a,u=e(i),c=A.invert(r[0],r[1]),l=Oo(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=E,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=Go(s);var t=function(t,e){var n=e[0],r=e[1],A=[so(n),-oo(n),0],i=0,o=0;Vo.reset();for(var s=0,a=t.length;s<a;++s)if(c=(u=t[s]).length)for(var u,c,l=u[c-1],f=l[0],h=l[1]/2+Ji,p=so(h),d=oo(h),g=0;g<c;++g,f=_,p=v,d=E,l=y){var y=u[g],_=y[0],m=y[1]/2+Ji,v=so(m),E=oo(m),w=_-f,b=w>=0?1:-1,I=b*w,C=I>Ki,x=p*v;if(Vo.add(io(x*b*so(I),d*E+x*oo(I))),i+=C?w+b*to:w,C^f>=n^_>=n){var N=bo(Eo(l),Eo(y));xo(N);var S=bo(A,N);xo(S);var D=(C^w>=0?-1:1)*co(S[2]);(r>D||r===D&&(N[0]||N[1]))&&(o+=C^w>=0?1:-1)}}return(i<-Wi||i<Wi&&Vo<-Wi)^1&o}(o,c);s.length?(h||(i.polygonStart(),h=!0),ko(s,Zo,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){var r=A(e,n);t(e=r[0],n=r[1])&&i.point(e,n)}function g(t,e){var n=A(t,e);u.point(n[0],n[1])}function y(){p.point=g,u.lineStart()}function _(){p.point=d,u.lineEnd()}function m(t,e){a.push([t,e]);var n=A(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function E(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,A=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&A){if((e=(n=u[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else c>1&&2&A&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Ko))}return p}}function Ko(t){return t.length>1}function Zo(t,e){return((t=t.x)[0]<0?t[1]-Zi-Wi:Zi-t[1])-((e=e.x)[0]<0?e[1]-Zi-Wi:Zi-e[1])}ji();var Jo=Wo((function(){return!0}),(function(t){var e,n=NaN,r=NaN,A=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Ki:-Ki,a=ro(i-n);ro(a-Ki)<Wi?(t.point(n,r=(r+o)/2>0?Zi:-Zi),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(i,r),e=0):A!==s&&a>=Ki&&(ro(n-A)<Wi&&(n-=A*Wi),ro(i-s)<Wi&&(i-=s*Wi),r=function(t,e,n,r){var A,i,o=so(t-n);return ro(o)>Wi?Ao((so(e)*(i=oo(r))*so(n)-so(r)*(A=oo(e))*so(t))/(A*i*o)):(e+r)/2}(n,r,i,o),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=i,r=o),A=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var A;if(null==t)A=n*Zi,r.point(-Ki,A),r.point(0,A),r.point(Ki,A),r.point(Ki,0),r.point(Ki,-A),r.point(0,-A),r.point(-Ki,-A),r.point(-Ki,0),r.point(-Ki,A);else if(ro(t[0]-e[0])>Wi){var i=t[0]<e[0]?Ki:-Ki;A=n*i/2,r.point(-i,A),r.point(0,A),r.point(i,A)}else r.point(e[0],e[1])}),[-Ki,-Zi]);function ts(t,e){var n=oo(t),r=n>0,A=ro(n)>Wi;function i(t,e){return oo(t)*oo(e)>n}function o(t,e,r){var A=[1,0,0],i=bo(Eo(t),Eo(e)),o=wo(i,i),s=i[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=bo(A,i),f=Co(A,u);Io(f,Co(i,c));var h=l,p=wo(f,h),d=wo(h,h),g=p*p-d*(wo(f,f)-1);if(!(g<0)){var y=ao(g),_=Co(h,(-p-y)/d);if(Io(_,f),_=vo(_),!r)return _;var m,v=t[0],E=e[0],w=t[1],b=e[1];E<v&&(m=v,v=E,E=m);var I=E-v,C=ro(I-Ki)<Wi;if(!C&&b<w&&(m=w,w=b,b=m),C||I<Wi?C?w+b>0^_[1]<(ro(_[0]-v)<Wi?w:b):w<=_[1]&&_[1]<=b:I>Ki^(v<=_[0]&&_[0]<=E)){var x=Co(h,(-p+y)/d);return Io(x,f),[_,vo(x)]}}}function s(e,n){var A=r?t:Ki-t,i=0;return e<-A?i|=1:e>A&&(i|=2),n<-A?i|=4:n>A&&(i|=8),i}return Wo(i,(function(t){var e,n,a,u,c;return{lineStart:function(){u=a=!1,c=1},point:function(l,f){var h,p=[l,f],d=i(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Ki:-Ki),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||Ro(e,h)||Ro(p,h))&&(p[0]+=Wi,p[1]+=Wi,d=i(p[0],p[1])),d!==a)c=0,d?(t.lineStart(),h=o(p,e),t.point(h[0],h[1])):(h=o(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(A&&e&&r^d){var y;g&n||!(y=o(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!d||e&&Ro(e,p)||t.point(p[0],p[1]),e=p,a=d,n=g},lineEnd:function(){a&&t.lineEnd(),e=null},clean:function(){return c|(u&&a)<<1}}}),(function(n,r,A,i){!function(t,e,n,r,A,i){if(n){var o=oo(e),s=so(e),a=r*n;null==A?(A=e+r*to,i=e-a/2):(A=Mo(o,A),i=Mo(o,i),(r>0?A<i:A>i)&&(A+=r*to));for(var u,c=A;r>0?c>i:c<i;c-=a)u=vo([o,-s*oo(c),-s*so(c)]),t.point(u[0],u[1])}}(i,t,e,A,n,r)}),r?[0,-t]:[-Ki,t-Ki])}function es(t){return function(e){var n=new ns;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ns(){}function rs(t,e,n){var r=e[1][0]-e[0][0],A=e[1][1]-e[0][1],i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&go.hasOwnProperty(t.type)?go[t.type](t,e):fo(t,e)}(n,t.stream($o));var o=$o.result(),s=Math.min(r/(o[1][0]-o[0][0]),A/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(A-s*(o[1][1]+o[0][1]))/2;return null!=i&&t.clipExtent(i),t.scale(150*s).translate([a,u])}ns.prototype={constructor:ns,point:function(t,e){this.stream.point(t,e)},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()}};var As=16,is=oo(30*no);function os(t,e){return+e?function(t,e){function n(r,A,i,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-A,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,E=s+h,w=a+p,b=ao(v*v+E*E+w*w),I=co(w/=b),C=ro(ro(w)-1)<Wi||ro(i-l)<Wi?(i+l)/2:io(E,v),x=t(C,I),N=x[0],S=x[1],D=N-r,L=S-A,T=_*D-y*L;(T*T/m>e||ro((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<is)&&(n(r,A,i,o,s,a,N,S,C,v/=b,E/=b,w,d,g),g.point(N,S),n(N,S,C,v,E,w,u,c,l,f,h,p,d,g))}}return function(e){var r,A,i,o,s,a,u,c,l,f,h,p,d={point:g,lineStart:y,lineEnd:m,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,d.point=_,e.lineStart()}function _(r,A){var i=Eo([r,A]),o=t(r,A);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=i[0],h=i[1],p=i[2],As,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=E,d.lineEnd=w}function E(t,e){_(r=t,e),A=c,i=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,A,i,r,o,s,a,As,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return es({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var ss=es({point:function(t,e){this.stream.point(t*no,e*no)}});function as(t){return function(t){var e,n,r,A,i,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Jo,E=null,w=qo,b=.5,I=os(N,b);function C(t){return[(t=i(t[0]*no,t[1]*no))[0]*l+n,r-t[1]*l]}function x(t){return(t=i.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*eo,t[1]*eo]}function N(t,A){return[(t=e(t,A))[0]*l+n,r-t[1]*l]}function S(){i=No(A=function(t,e,n){return(t%=to)?e||n?No(Lo(t),To(e,n)):Lo(t):e||n?To(e,n):So}(g,y,_),e);var t=e(p,d);return n=f-t[0]*l,r=h+t[1]*l,D()}function D(){return u=c=null,C}return C.stream=function(t){return u&&c===t?u:u=ss(v(A,I(w(c=t))))},C.clipAngle=function(t){return arguments.length?(v=+t?ts(m=t*no,6*no):(m=null,Jo),D()):m*eo},C.clipExtent=function(t){return arguments.length?(w=null==t?(E=o=s=a=null,qo):zo(E=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==E?null:[[E,o],[s,a]]},C.scale=function(t){return arguments.length?(l=+t,S()):l},C.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],S()):[f,h]},C.center=function(t){return arguments.length?(p=t[0]%360*no,d=t[1]%360*no,S()):[p*eo,d*eo]},C.rotate=function(t){return arguments.length?(g=t[0]%360*no,y=t[1]%360*no,_=t.length>2?t[2]%360*no:0,S()):[g*eo,y*eo,_*eo]},C.precision=function(t){return arguments.length?(I=os(N,b=t*t),D()):ao(b)},C.fitExtent=function(t,e){return rs(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return rs(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&x,S()}}((function(){return t}))()}function us(t){return function(e,n){var r=oo(e),A=oo(n),i=t(r*A);return[i*A*so(e),i*so(n)]}}function cs(t){return function(e,n){var r=ao(e*e+n*n),A=t(r),i=so(A),o=oo(A);return[io(e*i,r*o),co(r&&n*i/r)]}}us((function(t){return ao(2/(1+t))})).invert=cs((function(t){return 2*co(t/2)}));var ls=us((function(t){return(t=uo(t))&&t/so(t)}));function fs(){return as(ls).scale(79.4188).clipAngle(179.999)}function hs(t,e){return[t,e]}function ps(t,e,n,r){var A=t.properties||{},i="Feature"===t.type?t.geometry:t;if("GeometryCollection"===i.type){var o=[];return Ii(t,(function(t){var A=ps(t,e,n,r);A&&o.push(A)})),gi(o)}var s=function(t){var e=Oi(t).geometry.coordinates,n=[-e[0],-e[1]];return fs().rotate(n).scale(li)}(i),a={type:i.type,coordinates:gs(i.coordinates,s)},u=(new Yi.GeoJSONReader).read(a),c=yi(_i(e,n),"meters"),l=Yi.BufferOp.bufferOp(u,c,r);if(!ds((l=(new Yi.GeoJSONWriter).write(l)).coordinates))return hi({type:l.type,coordinates:ys(l.coordinates,s)},A)}function ds(t){return Array.isArray(t[0])?ds(t[0]):isNaN(t[0])}function gs(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return gs(t,e)}))}function ys(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return ys(t,e)}))}ls.invert=cs((function(t){return t})),hs.invert=hs;const _s={HOURS_AGO:2,SEVERITY:0,ALT_FROM:5,ALT_TO:52},ms="[SkyPath SDK]: Flow is not running",vs="[SkyPath SDK]: Flow already started",Es="[SkyPath SDK]: Flow already terminated",ws={INITIALIZED:"initialized",RUNNING:"running",STOPPED:"stopped",TERMINATED:"terminated"},bs=t=>{const e=structuredClone(t);return Is(e)},Is=t=>t.map(((e,n)=>{const r=t.at(n-1);return r&&Math.abs(r[0]-e[0])>180?(e[0]-r[0]>180?e[0]-=360:r[0]-e[0]>180&&(e[0]+=360),e):e})),Cs=([t,e])=>[Math.max(-180,Math.min(180,t)),Math.max(-90,Math.min(90,e))],xs=(t,e)=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[KA(t)]}}),Ns=t=>t/1852/1852,Ss=(t,e)=>{const n=[];for(let r=0;r<t.length;r++){const A=t[r],i=e?.(A)||{};n.push(xs(A,i))}return{type:"FeatureCollection",features:n}},Ds=(t=[],e=1)=>{if(!t||!t.length)return;const n=t.reduce(((t,e)=>(t[e.hexId]=e,t)),{}),r=Ss(t.map((({hexId:t})=>t)),(t=>n[t])).features.map((t=>{const n=zi(di(t.geometry.coordinates),e);return{...t,geometry:n.geometry}}));return{type:"FeatureCollection",features:r}},Ls=({hexagons:t})=>t.reduce(((t,e)=>{const{hexId:n,sev:r,alt:A,observationTime:i}=e;return(!t[n]||t[n].sev<r)&&(t[n]={hexId:n,sev:r,alt:A,observationTime:i}),t}),{}),Ts=([t,e])=>[e,t],Ms=(t,e=0)=>{const n=Mi(t).geometry.coordinates.map((t=>t.map(Ts)));return ti(n,e)},Os=(t,e=0,n=!0)=>{const r=t.map((t=>n?Ts(t):t));return ti(r,e)},Rs=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{hoursAgo:n=_s.HOURS_AGO,altitudeFrom:r=_s.ALT_FROM,altitudeTo:A=_s.ALT_TO,severity:i=_s.SEVERITY}=e,o=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=r&&t<=A)).filter((({sev:t})=>t>=i)).filter((({observationTime:t})=>yA().unix()-t<=3600*n))])).filter((([,t])=>t.length>0));return Object.fromEntries(o)},Ps=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{altitudeFrom:n=_s.ALT_FROM,altitudeTo:r=_s.ALT_TO,severity:A=_s.SEVERITY}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=n&&t<=r)).map((t=>{const e=t.severities.filter((({sev:t})=>t>=A));return{...t,severities:e}})).filter((({severities:t})=>t.length>0))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},ks=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>Array.isArray(n)?n.map((({hexId:n,...r})=>({hexId:JA(n,t,e),...r}))):null)).filter(Boolean)},Bs=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.map((({hexId:n,alt:r,severities:A})=>({hexId:JA(n,t,e),alt:r,...A[0]})))))},Fs={0:700,1:300},Gs=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",A=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof A)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(A<=0)throw new Error("steps must be greater than 0");var i=[];switch(t.type){case"GeometryCollection":return Ii(t,(function(t){var n=ps(t,e,r,A);n&&i.push(n)})),gi(i);case"FeatureCollection":return bi(t,(function(t){var n=ps(t,e,r,A);n&&bi(n,(function(t){t&&i.push(t)}))})),gi(i)}return ps(t,e,r,A)}(di([t]),Fs[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},Us=25e5,Qs=({polygon:t})=>{const e=ki(di([t]));if(Ns(e)>Us)throw new Error("Corridor area is too large, maximum allowed area is 2500000 nautical miles")},zs=({polygon:t,precision:e=1})=>{const n=di([t]);return Number(Math.log2(360/(Ci(n)[2]-Ci(n)[0])).toFixed(e))},Vs={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE",CORRIDOR:"CORRIDOR"},qs={[Vs.LARGE]:2,[Vs.MEDIUM]:3.5,[Vs.SMALL]:1/0},Ys=(t,e=qs)=>{const n=zs({polygon:t});return Object.entries(e).find((([,t])=>n<=t))[0]};function js(t){return t*Math.PI/180}function Hs(t){return 180*t/Math.PI}function Xs(t){const e=6378137,[n,r,A,i]=t,o=js(n),s=js(r),a=js(A),u=js(i),c=e*o,l=e*a,f=(e*Math.log(Math.tan(Math.PI/4+s/2))+e*Math.log(Math.tan(Math.PI/4+u/2)))/2,h=(c+l)/2/e,p=2*Math.atan(Math.exp(f/e))-Math.PI/2;return[Hs(h),Hs(p)]}const $s=({polygon:t,resolution:e,extensionFactor:n})=>{const r=Ci(di([t])),A=Mi(Ci(pi(Xs(r)))).geometry.coordinates[0];return Gs({polygon:A,resolution:e,extensionFactor:n})};var Ws=Object.freeze({__proto__:null,CORRIDOR_POLYGON_MAX_AREA_NM:Us,HEX_RESOLUTION_BUFFERS:Fs,POLYGON_TYPE:Vs,adjustAntiMeridianCrossing:bs,adjustFeatureCoordinates:t=>bs(t).map(Cs),clampCoordinates:Cs,extendPolygonByResolution:Gs,getHexIdsByMapBoundsAndResolution:Ms,getHexIdsByPolygonAndResolution:Os,getHexIdsFromMapboxMap:(t,e)=>{if(!t)return;const n=t.getBounds().toArray().flat();return Ms(n,e)},getHexagonsDataSlice:Rs,getHexagonsFeatureCollection:Ds,getMapPolygon:t=>{const e=t.getBounds().toArray().flat(),[n,r,A,i]=e;return[[n,i],[n,r],[A,r],[A,i],[n,i]]},getMercatorCenterFromBbox:Xs,getMiddleArea:$s,getOneLayerHexagonsDataSlice:Ps,getPolygonSize:Ys,getZoomLevel:zs,groupByHexIdAndSelectMostSevere:Ls,h3SetToFeatureCollection:Ss,h3ToFeature:xs,invertLatLng:Ts,normalizeAntiMeridian:Is,prepareHexagonsDataForMapHexagons:ks,prepareOneLayerHexagonsDataForMapHexagons:Bs,squareMetersToNauticalMiles:Ns,validateCorridorArea:Qs});const Ks=({event:t,listener:e})=>{if("string"!=typeof t||"function"!=typeof e)throw new aA(`Invalid params - event must be a string and listener must be a function,\n received event - ${t}, listener - ${e}`)};class Zs{constructor(){this.#e=new Map}#e;on(t,e){Ks({event:t,listener:e}),this.#e.has(t)||this.#e.set(t,[]),this.#e.get(t).push(e)}off(t,e){if(Ks({event:t,listener:e}),!this.#e.has(t))return;const n=this.#e.get(t).filter((t=>t!==e));n.length>0?this.#e.set(t,n):this.#e.delete(t)}emit(t,...e){(({event:t})=>{if("string"!=typeof t)throw new aA(`Invalid params - event must be a string, received event - ${t}`)})({event:t}),this.#e.has(t)&&this.#e.get(t).forEach((t=>{t(...e)}))}once(t,e){Ks({event:t,listener:e});const n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n)}clear(){this.#e.clear()}}class Js{#n=ws.INITIALIZED;start(){if(this.#n===ws.RUNNING)throw new Error(vs);this.#n=ws.RUNNING}stop(){if(this.#n===ws.TERMINATED)throw new Error(Es);if(this.#n===ws.INITIALIZED)throw new Error(ms);this.#n=ws.STOPPED}terminate(){if(this.#n===ws.TERMINATED)throw new Error(Es);if(this.#n===ws.INITIALIZED)throw new Error(ms);this.#n=ws.TERMINATED}get isInitialRun(){return[ws.INITIALIZED,ws.TERMINATED].includes(this.#n)}get state(){return this.#n}get isRunning(){return this.#n===ws.RUNNING}get isStopped(){return this.#n===ws.STOPPED}get isTerminated(){return this.#n===ws.TERMINATED}}const ta={INFO:"/v5/nowcasting/info",DATA:"/v5/nowcasting/{resolution}/{hexId}"},ea="DATA",na="UPDATE_CONFIG",ra="UPDATE_INTERVAL",Aa="LOAD_NOWCASTING_DATA",ia="IS_PENDING_CHANGE",oa={FORECAST:0,SEVERITY:2,ALTITUDE:35},sa=({edrValue:t})=>t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;class aa{constructor({cacheTokenService:t,nowcastingService:e}){this.#r=9e5,this.#A=t,this.#i=e,this.#o=new Js,this.#s=new Set}#r;#o;#s;#a=new Zs;onData=t=>{if(!Ai(t))throw new aA(nA);this.#a.on(ea,t)};updateConfig=(t={})=>{this.#a.emit(na,t)};onChangeIsPending=t=>{if(!Ai(t))throw new aA(nA);this.#a.on(ia,t)};#A;#i;#u=[];#c=[];#l=null;#f=null;#h=new Map;#p=async()=>await this.#A.getToken();#d=async()=>await(this.#i?.getInfo()?.lastUpdatedAt)||yA().unix();#g=async(t,e,n,r,A)=>{try{if(this.#A.checkToken(t)||(t=await this.#p()),!r?.length)return{token:t};A&&e.clear();const i=r.filter((t=>!this.#s.has(t)));i.forEach((t=>this.#s.add(t)));const o=i.filter((t=>!e.has(t)));if(0===o.length)return{token:t};const s=await Promise.allSettled(o.map((e=>{return this.#i.getData({token:t.token,lastUpdatedAt:n,resolution:(r=e,A=VA(r),i=A[0],o=A[1],TA.isValidCell(i,o)?TA.getResolution(i,o):-1),hexId:e}).then((t=>({...t,hexId:e}))).finally((()=>this.#s.delete(e)));var r,A,i,o})));s.map((t=>"rejected"===t.status?null:t.value)).forEach((t=>{if(!t?.hexId)return;const n=t.items.map((({hexIds:t,...e})=>({sev:sa({edrValue:e?.edr}),...e,hexIds:t})));e.set(t.hexId,n)}));return{nowcastingData:Object.fromEntries(e),token:t}}catch(t){throw new fA("Failed to load nowcasting data",{error:t})}};#y=null;start(){try{const t=this.#o.state===ws.INITIALIZED||this.#o.state===ws.TERMINATED;this.#o.start(),this.#y=setInterval((()=>this.#a.emit(ra,{})),this.#r),t&&(this.#a.on(ra,this.#_),this.#a.on(Aa,this.#m),this.#a.on(na,this.#v));const e=t?[]:this.#c;this.#v({hexIds:e})}catch(t){throw new fA("Failed to start nowcasting flow",{error:t})}}stop(){this.#o.stop(),clearInterval(this.#y),this.#y=null,this.#s.clear()}terminate(){this.#o.terminate(),clearInterval(this.#y),this.#y=null,this.#l=null,this.#f=null,this.#u=[],this.#h.clear(),this.#s.clear(),this.#a.clear()}getState=()=>this.#o.state;#m=async({shouldEraseOldData:t=!1,hexIds:e=this.#u,token:n=this.#l,currentDataMap:r=this.#h,lastUpdatedAt:A=this.#f})=>{if(this.#o.state!==ws.RUNNING)return;this.#a.emit(ia,!0);const{token:i,nowcastingData:o}=await this.#g(n,r,A,e,t);this.#a.emit(ia,!1),this.#l=i,this.#f=A,this.#u=e,o&&this.#a.emit(ea,o)};#_=async({lastUpdatedAt:t=this.#f})=>{if(this.#o.state!==ws.RUNNING)return;const e=await this.#d();if(!(e!==t))return;this.#f=e;const n={lastUpdatedAt:t=e,shouldEraseOldData:!0};this.#a.emit(Aa,n)};#v=async({hexIds:t,polygon:e})=>{let n,r,A=e?Os(e):t||this.#u;if(this.#o.state!==ws.RUNNING)return void(this.#c=A);this.#l||(n=await this.#p(),this.#l=n),this.#f||(r=await this.#d(),this.#f=r);const i={token:n,currentDataMap:this.#h,lastUpdatedAt:r,hexIds:A};this.#a.emit(Aa,i)}}class ua{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:ta.INFO})).data}catch(t){throw new uA("Failed to get nowcasting info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=ta.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r,forecastH:13};return(await this.#t({path:A,params:i})).data}catch(t){throw new uA("Failed to get nowcasting data",{error:t})}}}const ca="/v4/aircraft";class la{constructor({fetcher:t}){this.#t=t}#t;async getMapping(){try{const t=ca;return await this.#t({path:t,method:Fr})}catch(t){throw new uA("Failed to get aircraft mapping",{error:t})}}}const fa="/v5/cache-token",ha=t=>{if(!t?.expireAt)return!1;const e=(new Date).getTime();return new Date(t.expireAt).getTime()>e};class pa{#t;constructor({fetcher:t}){this.#t=t}getToken=async()=>{try{return(await this.#t({path:fa})).data}catch(t){throw new uA("Failed to get cache token",{error:t})}};checkToken=ha}const da=async({response:t})=>{const e=t.status,n=t.statusText;let r={400:"Bad request, please check the request body;",401:"Unauthorized, please check the API key or JWT;",403:"Forbidden;",404:"Endpoint is not found, please check the URL;",500:"Internal server error;"}[e]||n||"Unknown error";const A=(await t.json().catch((()=>{})))?.message?.split(":")?.at(1)?.trim()||"";return[r,A?`(${A})`:""].join(" ")};class ga{#E;constructor({environment:t,proxyUrl:e}){this.#E=e||Zr[t?.toLowerCase()]||Zr[Wr]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(![t,e,n,r].filter(Boolean).length)throw new aA(rA);return r?await this.#w({authCallback:r}):await this.#b({apiKey:t,userId:e,companyName:n})};async#I({token:t}){const e=`${this.#E}${jr}`,n={method:Fr,headers:{[Qr]:t}},r=await fetch(e,n);if(!r.ok){const t=await da({response:r});throw new Error(t)}const{companyId:A,id:i}=await r.json();return{companyId:A,userId:i}}async#b({apiKey:t,userId:e,companyName:n}){try{const r=await this.#C({apiKey:t,userId:e,companyName:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new lA(iA,{error:t})}}async#w({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#N({jwt:e,partnerId:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new lA(AA,{error:t})}}#S=async({path:t,headers:e={},body:n})=>{try{const r=`${this.#E}${t}`,A={method:Gr,headers:{[zr]:"application/json",...e},body:n?JSON.stringify(n):null},i=await fetch(r,A);if(!i.ok){const t=await da({response:i});throw new Error(t)}const{token:o}=await i.json();return o}catch(t){throw new uA(oA,{error:t})}};#C=async({apiKey:t,userId:e,companyName:n})=>await this.#S({path:Vr,headers:{[Ur]:t},body:{user_id:e,airline_icao:n}});#N=async({jwt:t,partnerId:e})=>await this.#S({path:qr,body:{signedJwt:t,partnerId:e}});#D=async({token:t})=>await this.#S({path:Yr,body:{token:t}});#x=({token:t})=>async({path:e="",method:n=Fr,params:r,headers:A={},body:i=null,signal:o=null,retry:s=3})=>{let a=0;const u=r?"?"+new URLSearchParams(Object.fromEntries(Object.entries(r||{}).filter((([,t])=>null!=t)))):"",c={url:`${this.#E}${e}${u}`,options:{method:n,headers:{...A,[Qr]:t,[zr]:"application/json"},body:n!==Fr?JSON.stringify(i):null,signal:o}};let l=null;for(;a<s;){a+=1;let e=!1;if(l=await fetch(c.url,c.options).catch((t=>{if(t===Hr)return e=!0,null})),e)return{data:null,aborted:!0};if(!l||204===l.status)return{data:null};if(l.ok)return await l.json();401===l.status&&(t=await this.#D({token:t}),c.options.headers[Qr]=t)}const f=await da({response:l});throw new uA(f,{...l})}}const ya={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},_a=5,ma=52,va={[Vs.SMALL]:1,[Vs.MEDIUM]:0,[Vs.LARGE]:0,[Vs.CORRIDOR]:1},Ea={[Vs.SMALL]:0,[Vs.MEDIUM]:1,[Vs.LARGE]:1,[Vs.CORRIDOR]:1},wa={[Vs.SMALL]:2,[Vs.MEDIUM]:1,[Vs.LARGE]:2.5,[Vs.CORRIDOR]:1},ba="polygon",Ia="isCorridorMode",Ca=(t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=JA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)},xa=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map(((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],observationTime:e.observationTime[n]})))};class Na{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async(t,e)=>{const{polygon:n,polygonSize:r}=t;if(!n||!r)return null;r===Vs.CORRIDOR&&Qs({polygon:n});const A=Ea[r],{hexIds:i,childCells:o}=(({polygon:t,polygonSize:e})=>{let n=t;const r=va[e],A=wa[e];let i,o;switch(e){case Vs.LARGE:n=$s({polygon:n,resolution:r,extensionFactor:A});break;case Vs.CORRIDOR:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Gs({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}})({polygon:n,polygonSize:r});r===Vs.LARGE&&([...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),[...this.#L.keys()].forEach((t=>!i.includes(t.split(",")[0])&&this.#L.delete(t))));const s=i.filter((t=>{const e=String([t,r,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:i,updatedAt:o}=n,s=yA().unix()-i,a=yA().unix()-o;return!(s<60)&&!(a<60)}));if(!s.length)return Ca(this.#L,[r,A],{childCells:o});const a=s.map((t=>{const n=ya.DATA.replace("{hexId}",t).replace("{resolution}",String(va[r])),i=String([t,r,A]),o=this.#L.get(i)?.updatedAt;return this.#t({path:n,method:Fr,params:{minSev:A,hoursAgo:4,maxAlt:ma,minAlt:_a,since:o},signal:e})}));return(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:xa(t),updatedAt:t.value.data?.updatedAt},i=s[e],o=String([i,r,A]),a=this.#L.get(o);if(!!a?.updatedAt&&!!a?.reports?.length&&a?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=a.reports,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),s={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(o,s)}else this.#L.set(o,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),Ca(this.#L,[r,A],{childCells:o})};expire=()=>{const t=[...this.#L.entries()],e=yA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class Sa{constructor({fetcher:t}){this.#T=new Na({fetcher:t}),this.#M=new AbortController,this.#O=oi(500),this.#R=oi(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1}}#P;#T;#M;#k;#B;#F;#O;#R;#G;#U;#Q;#z=async()=>{if(this.#k)try{this.#T.expire(),this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch(this.#P,this.#M.signal);this.#V(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new fA("Failed to run ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai(t))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai(t))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai(t))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!ri(t)){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=ui({current:this.#P,next:{polygon:t,isCorridorMode:e}}),r={...this.#P};if(n.has(Ia)&&(r.isCorridorMode=e),n.has(ba)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?Vs.CORRIDOR:Ys(t)),this.#P=r,!this.#k)return;this.#O.run(this.#z.bind(this))}catch(n){const r=new fA("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#U)throw r;this.#U(r)}}}const Da={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},La={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},Ta=5,Ma=52,Oa={[Vs.SMALL]:1,[Vs.MEDIUM]:0,[Vs.LARGE]:0,[Vs.CORRIDOR]:1},Ra={[Vs.SMALL]:0,[Vs.MEDIUM]:1,[Vs.LARGE]:1,[Vs.CORRIDOR]:1},Pa={[Vs.SMALL]:2,[Vs.MEDIUM]:1,[Vs.LARGE]:2.5,[Vs.CORRIDOR]:1},ka="polygon",Ba="isCorridorMode",Fa="aircraftCategory",Ga={getNowcastingDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{forecast:n=oa.FORECAST,severity:r=oa.SEVERITY,altitude:A=oa.ALTITUDE}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({forecast:t})=>t===n)).filter((({alt:t})=>t===A)).filter((({sev:t})=>t>=r))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},prepareNowcastingDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.flatMap((({hexIds:n,...r})=>n.map((n=>{let A;try{A=JA(n,t,e)}catch(r){return console.warn(`[SkyPath SDK]: Hexagon skipped; ${r?.message||"Error while converting hexId to cellHexId"}`,{hexId:n,cell:t,resolution:e}),null}return{hexId:A,...r}})))).filter(Boolean)))}},Ua={availableConfigInputs:{aircraftCategory:Da,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:52,minAltitude:5,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},Qa={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},za={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},Va={DATA:"/one-layer/v5/{res}/{hexId}"},qa=0,Ya=5,ja=52,Ha={[Vs.SMALL]:1,[Vs.MEDIUM]:0,[Vs.LARGE]:0,[Vs.CORRIDOR]:1},Xa={[Vs.SMALL]:0,[Vs.MEDIUM]:1,[Vs.LARGE]:1,[Vs.CORRIDOR]:1},$a={[Vs.SMALL]:2,[Vs.MEDIUM]:1,[Vs.LARGE]:2.5,[Vs.CORRIDOR]:1},Wa="polygon",Ka="isCorridorMode",Za="aircraftCategory",Ja="hoursAgo",tu=({polygon:t,polygonSize:e})=>{let n=t;const r=Ha[e],A=$a[e];let i,o;switch(e){case Vs.LARGE:n=$s({polygon:n,resolution:r,extensionFactor:A});break;case Vs.CORRIDOR:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Gs({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}},eu=({forecastTs:t})=>{let e;return e=!t||yA.unix(t).isBefore(yA())||yA.unix(t).isBefore(yA().add(3,"minute"))?yA().unix():t,e},nu=({oneLayer:t,nowcasting:e,forecastTs:n,nowcastingAlt:r})=>{const A=new Map;t.forEach((t=>A.set(`${t.hexId}-${t.alt}`,t)));const i=(({nowcasting:t,forecastTs:e,nowcastingAlt:n})=>{const r=eu({forecastTs:e}),A=Math.floor((r-yA().unix())/3600);return t?.filter((t=>t.alt===n&&t.forecast===A))})({nowcasting:e,forecastTs:n,nowcastingAlt:r});return i?.forEach((t=>{t.hexIds.forEach((e=>{const n=`${e}-${t.alt}`;if(A.has(n)){const t=A.get(n);t.severities[0].sources.push(0),A.set(n,t)}else A.set(n,(({hexId:t,nowcastItem:e})=>({hexId:t,alt:e.alt,severities:[{edr:null,sev:2===e.sev?1:e.sev,sources:[0],observationTime:yA().add(e.forecast+1,"hour").startOf("hour").unix(),usedSource:0,usedSourceTs:yA().add(e.forecast,"hour").startOf("hour").unix()}]}))({hexId:e,nowcastItem:t}))}))})),[...A.values()]},ru=({oneLayerStore:t,nowcastingData:e,selector:n,options:r})=>{const{childCells:A,forecastTs:i,nowcastingAlt:o,hoursAgo:s}=r,a=[...t.entries()].filter((([t])=>{const[,...e]=t.split(",");return e.join(",")===n.join(",")})).map((([t,n])=>{const[r]=t.split(","),{reports:a}=n,u=(({reports:t,forecastTs:e,hoursAgo:n})=>{const r=eu({forecastTs:e});return t.map((t=>({...t,severities:[t.severities?.find(((t,e,A)=>{const i=A[e+1],o=t.observationTime,s=i?i.observationTime:yA.unix(t.observationTime).add(Number(n),"hour").unix();return r>=o&&r<s}))].filter(Boolean)}))).filter((t=>t.severities.length))})({reports:a,forecastTs:i,hoursAgo:s}),c=e&&e[r]?nu({oneLayer:u,nowcasting:e[r],forecastTs:i,nowcastingAlt:o}):a;if(!A?.length)return[r,c];const l=c.filter((t=>{const{hexId:e}=t,n=JA(e,r,5);return A.includes(n)}));return[r,l]}));return Object.fromEntries(a)},Au=({responseData:t})=>t?t.hexId.map(((e,n)=>({hexId:e,alt:t.alt[n],severities:t.severities.sev[n].map(((e,r)=>({edr:t.severities.edr[n][r],sev:t.severities.sev[n][r],sources:t.severities.sources[n][r],observationTime:t.severities.ts[n][r],usedSource:t.severities.usedSource[n][r],usedSourceTs:t.severities.usedSourceTs[n][r]})))}))):[],iu=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?Bs({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=Bs({data:t}),n=Ls({hexagons:e});return Ds(Object.values(n))}});class ou{constructor({fetcher:t}){this.#t=t,this.#L=new Map,this.#i=new ua({fetcher:t}),this.#A=new pa({fetcher:t}),this.#Y={}}#L;#t;#i;#A;#Y;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A,hoursAgo:i}=t;if(!n||!r)return null;r===Vs.CORRIDOR&&Qs({polygon:n});const o=Xa[r],{hexIds:s}=tu({polygon:n,polygonSize:r});r===Vs.LARGE&&[...this.#L.keys()].forEach((t=>!s.includes(t.split(",")[0])&&this.#L.delete(t)));const a=s.filter((t=>{const e=String([t,r,o,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:s,updatedAt:a}=n,u=yA().unix()-s,c=yA().unix()-a;return!(u<60)&&!(c<60)}));if(!a.length)return;await new Promise((t=>{const e=new aa({cacheTokenService:this.#A,nowcastingService:this.#i});e.onData((n=>{this.#Y={...this.#Y,...n},e.terminate(),t(n)})),e.start(),e.updateConfig({hexIds:a})}));const u=a.map((t=>{const n=Va.DATA.replace("{hexId}",t).replace("{res}",String(Ha[r])),s=String([t,r,o,i,A]),a=this.#L.get(s)?.updatedAt;return this.#t({path:n,method:Fr,params:{acCat:A,hoursAgo:i,minAlt:Ya,maxAlt:ja,since:a},signal:e})}));(await Promise.allSettled(u)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:Au({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},s=a[e],u=String([s,r,o,i,A]),c=this.#L.get(u);if(!!c?.updatedAt&&!!c?.reports?.length&&c?.updatedAt!==n.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=t=>`${t.hexId}-${t.alt}`;return t.forEach((t=>n.set(r(t),t))),e.forEach((t=>n.set(r(t),t))),Array.from(n.values())})({oldReports:c.reports,newReports:n.reports}),e={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:t};this.#L.set(u,e)}else this.#L.set(u,n)}));for(const[t,{reports:e,...n}]of this.#L.entries()){const r=e.map((t=>({...t,severities:t?.severities?.filter((t=>t.sev>=o))}))).filter((t=>t.severities.length));r.length?this.#L.set(t,{...n,reports:r}):this.#L.delete(t)}[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t)))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A,hoursAgo:i}=t,{maxAltitude:o,minAltitude:s,minSeverity:a,forecastTs:u,nowcastingAlt:c}=e;if(!n||!r)return iu();const l=Xa[r],{childCells:f}=tu({polygon:n,polygonSize:r}),h=ru({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[r,l,i,A],options:{childCells:f,forecastTs:u,nowcastingAlt:c,hoursAgo:i}}),p=Ps({data:h,filters:{altitudeFrom:s,altitudeTo:o,severity:a}});return iu(p)};expire=({hoursAgo:t})=>{this.#L=(({store:t,hoursAgo:e})=>{const n=new Map(t);return[...n.entries()].forEach((t=>{const[r,A]=t,{reports:i,...o}=A,s=[];i.forEach((t=>{const n=t?.severities?.filter((t=>yA.unix(t.observationTime).add(e,"hour").unix()>yA().unix()));n.length&&s.push({...t,severities:n})})),s.length?n.set(r,{...o,reports:s}):n.delete(r)})),n})({store:this.#L,hoursAgo:t})};dispose=()=>this.#L.clear()}class su{constructor({fetcher:t}){this.#T=new ou({fetcher:t}),this.#M=new AbortController,this.#O=oi(500),this.#R=oi(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,hoursAgo:Number(za.oneHour),aircraftCategory:Qa.C60},this.#j={forecastTs:null,nowcastingAlt:35,maxAltitude:ja,minAltitude:Ya,minSeverity:qa}}#P;#j;#T;#M;#H;#k;#B;#F=iu();#O;#R;#G;#U;#Q;#z=async()=>{if(this.#k)try{if(this.#T.expire({hoursAgo:this.#P.hoursAgo}),this.#H){this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch({config:this.#P,signal:this.#M.signal});this.#V(t),await t}const t=this.#T.getData({config:this.#P,filters:this.#j});this.#G?.(t,this.#F),this.#F=t,this.#H=!1}catch(t){const e=new fA("Failed to run OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai(t))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai(t))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai(t))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,maxAltitude:A,minAltitude:i,minSeverity:o,forecastTs:s,nowcastingAlt:a})=>{if(!ri(t)){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ri(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(Qa).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ri(r)){if("string"!=typeof r)throw new Error("hoursAgo must be a string");if(!Object.values(za).includes(r))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!ri(A)){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!ri(i)){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!ri(o)){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}if(!ri(s)){if("number"!=typeof s)throw new Error("hoursAgo must be a number");if(!yA.unix(s).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!ri(a)){if("number"!=typeof a)throw new Error("nowcastingAlt must be a number");if(a<5||a>52)throw new Error("nowcastingAlt must be a number between 5 and 52")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a});const u={...this.#P},c=ui({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:Number(r)}});c.has(Ka)&&(u.isCorridorMode=e),c.has(Wa)&&(u.polygon=t,u.polygonSize=u.isCorridorMode?Vs.CORRIDOR:Ys(t)),c.has(Za)&&(u.aircraftCategory=n),c.has(Ja)&&(u.hoursAgo=Number(r)),this.#P=u,this.#j=ai({current:this.#j,next:{forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a}}),this.#H=c.size>0,this.#O.run(this.#z.bind(this))}catch(r){const A=new fA("Failed to update config for OneLayerFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}const au=({polygon:t,polygonSize:e})=>{let n=t;const r=Oa[e],A=Pa[e];let i,o;switch(e){case Vs.LARGE:n=$s({polygon:n,resolution:r,extensionFactor:A});break;case Vs.CORRIDOR:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Gs({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}},uu=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map(((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],edr:e.edr[n],observationTime:e.observationTime[n]})))},cu=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?ks({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=ks({data:t}),n=Ls({hexagons:e});return Ds(Object.values(n))}});class lu{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return;r===Vs.CORRIDOR&&Qs({polygon:n});const i=Ra[r],{hexIds:o}=au({polygon:n,polygonSize:r});r===Vs.LARGE&&[...this.#L.keys()].forEach((t=>!o.includes(t.split(",")[0])&&this.#L.delete(t)));const s=o.filter((t=>{const e=String([t,r,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:o,updatedAt:s}=n,a=yA().unix()-o,u=yA().unix()-s;return!(a<60)&&!(u<60)}));if(!s.length)return;const a=s.map((t=>{const n=La.DATA.replace("{hexId}",t).replace("{resolution}",String(Oa[r])),o=String([t,r,i,A]),s=this.#L.get(o)?.updatedAt;return this.#t({path:n,method:Fr,params:{minSev:i,hoursAgo:4,maxAlt:Ma,minAlt:Ta,acCat:A,since:s},signal:e})}));(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:uu(t),updatedAt:t.value.data?.updatedAt},o=s[e],a=String([o,r,i,A]),u=this.#L.get(a);if(!!u?.updatedAt&&!!u?.reports?.length&&u?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=u.reports,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),o={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(a,o)}else this.#L.set(a,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t)))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return cu();const i=Ra[r],{childCells:o}=au({polygon:n,polygonSize:r}),s=((t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=JA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)})(this.#L,[r,i,A],{childCells:o}),{historyHours:a,maxAltitude:u,minAltitude:c,minSeverity:l}=e,f=Rs({data:s,filters:{hoursAgo:a,altitudeFrom:c,altitudeTo:u,severity:l}});return cu(f)};expire=()=>{const t=[...this.#L.entries()],e=yA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class fu{constructor({fetcher:t}){this.#T=new lu({fetcher:t}),this.#M=new AbortController,this.#O=oi(500),this.#R=oi(6e4),this.#P={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:Da.C60},this.#j={historyHours:2,maxAltitude:52,minAltitude:5,minSeverity:0}}#P;#j;#T;#M;#H;#k;#B;#O;#R;#F=cu();#G;#U;#Q;#z=async()=>{if(this.#k)try{if(this.#T.expire(),this.#H){this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch({config:this.#P,signal:this.#M.signal});this.#V(t),await t}const t=this.#T.getData({config:this.#P,filters:this.#j});this.#G?.(t,this.#F),this.#F=t,this.#H=!1}catch(t){const e=new fA("Failed to run Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#R.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#R.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai(t))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai(t))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai(t))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{if(!ri(t)){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri(e)&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ri(n)){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(Da).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ri(r)){if("number"!=typeof r)throw new Error("historyHours must be a number");if(![.5,1,2,3,4].includes(r))throw new Error("historyHours must be one of the allowed values, 0.5, 1, 2, 4")}if(!ri(A)){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!ri(i)){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!ri(o)){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o});const s={...this.#P},a=ui({current:this.#P,next:{polygon:t,isCorridorMode:e,aircraftCategory:n}});a.has(Ba)&&(s.isCorridorMode=e),a.has(ka)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?Vs.CORRIDOR:Ys(t)),a.has(Fa)&&(s.aircraftCategory=n),this.#P=s,this.#j=ai({current:this.#j,next:{historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o}}),this.#H=a.size>0,this.#O.run(this.#z.bind(this))}catch(r){const A=new fA("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}return t.CoreUtils=ci,t.GeoUtils=Ws,t.Nowcasting=Ga,t.Observations=Ua,t.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:A=Wr,proxyUrl:i,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new ga({environment:A,proxyUrl:i}),{fetcher:l,me:f}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:A,companyId:i,userId:o})=>{t&&A?.toLowerCase()!==Xr&&(Br.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:A,version:Jr,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[tA]:eA.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[eA.NETWORK,t.message].join(" ")),!0}default:return!1}}}),Br.setGlobalContext({applicationId:r,companyId:i,userId:o}),Br.createLogger(tA,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:A,companyId:f?.companyId,userId:f?.userId});const h=new la({fetcher:l}),p=await h.getMapping(),d=new pA({fetcher:l}),g=new ua({fetcher:l}),y=new pa({fetcher:l});return{createNowcastingFlow:()=>new aa({cacheTokenService:y,nowcastingService:g}),createGtgFlow:()=>new aa({cacheTokenService:y,nowcastingService:d}),createObservationsFlow:()=>new fu({fetcher:l}),createOneLayerFlow:()=>new su({fetcher:l}),createAdsbFlow:()=>new Sa({fetcher:l}),mapAircraftIcaoToAircraftType:({icao:t})=>ni({icao:t,mapping:p})}}catch(t){throw new cA(t.message,{error:t})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
6
|
+
var SkyPathSDK=function(t){"use strict";const e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},n=console,r={};Object.keys(e).forEach((t=>{r[t]=n[t]}));const A="Datadog Browser SDK:",i={debug:r.debug.bind(n,A),log:r.log.bind(n,A),info:r.info.bind(n,A),warn:r.warn.bind(n,A),error:r.error.bind(n,A)},o="https://docs.datadoghq.com",s=`${o}/real_user_monitoring/browser/troubleshooting`,a="More details:";function u(t,e){return(...n)=>{try{return t(...n)}catch(t){i.error(e,t)}}}function c(t){return 0!==t&&100*Math.random()<=t}const l=1e3,f=60*l,h=60*f,p=365*(24*h);function d(){return(new Date).getTime()}function g(){return d()}function y(){return performance.now()}function _(){return{relative:y(),timeStamp:g()}}let m;function v(){return void 0===m&&(m=performance.timing.navigationStart),m}const E=1024,w=1024*E,b=/[^\u0000-\u007F]/;function I(t){return b.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function C(t,e){return Object.keys(t).some((n=>t[n]===e))}function x(t){return 0===Object.keys(t).length}function N(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function S(t,e){const n=N();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let D,L=!1;function T(t){L=t}function M(t){return function(){return O(t,this,arguments)}}function O(t,e,n){try{return t.apply(e,n)}catch(t){!function(t){if(P(t),D)try{D(t)}catch(t){P(t)}}(t)}}function P(...t){L&&i.error("[MONITOR]",...t)}function R(t,e){return S(N(),"setTimeout")(M(t),e)}function k(t){S(N(),"clearTimeout")(t)}function B(t,e){return S(N(),"setInterval")(M(t),e)}function F(t){S(N(),"clearInterval")(t)}class G{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function U(...t){return new G((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function Q(t,e,n){let r,A,i=!1;return{throttled:(...n)=>{i?r=n:(t(...n),i=!0,A=R((()=>{r&&t(...r),i=!1,r=void 0}),e))},cancel:()=>{k(A),i=!1,r=void 0}}}function z(){}function V(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,V)}const q=/([\w-]+)\s*=\s*([^;]+)/g;function Y(t,e,n=""){const r=t.charCodeAt(e-1),A=r>=55296&&r<=56319?e+1:e;return t.length<=A?t:`${t.slice(0,A)}${n}`}function j(){return 0===(null!=H?H:H=function(t=window){var e;const n=t.navigator.userAgent;return t.chrome||/HeadlessChrome/.test(n)?0:0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}())}let H,X,$;function W(t,e,n=0,r){const A=new Date;A.setTime(A.getTime()+n);const i=`expires=${A.toUTCString()}`,o=r&&r.crossSite?"none":"strict",s=r&&r.domain?`;domain=${r.domain}`:"",a=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${o}${s}${a}${u}`}function K(t){return function(t,e){for(q.lastIndex=0;;){const n=q.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function Z(t){return X||(X=function(t){const e=new Map;for(q.lastIndex=0;;){const n=q.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),X.get(t)}function J(t,e){W(t,"",0,e)}const tt="_dd_s";function et(t){return Object.values(t)}function nt(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function rt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const At=4*h,it=15*f,ot=p,st={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},at=/^([a-zA-Z]+)=([a-z0-9-]+)$/,ut="&";const ct="1";function lt(t,e){const n={isExpired:ct};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function ft(t){return x(t)}function ht(t){return!ft(t)}function pt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||d()-Number(e.created)<At)&&(void 0===e.expire||d()<Number(e.expire)));var e}function dt(t){t.expire=String(d()+it)}function gt(t){return(e=t,Object.entries(e)).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join(ut);var e}function yt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf(ut)||at.test(t))}(t)&&t.split(ut).forEach((t=>{const n=at.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}const _t="_dd",mt="_dd_r",vt="_dd_l",Et="rum",wt="logs";function bt(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===$){const t=`dd_site_test_${V()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!K(t);)r=`${n.pop()}.${r}`,W(t,e,l,{domain:r});J(t,{domain:r}),$=r}return $}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${V()}`,n="test";W(e,n,f,t);const r=K(e)===n;return J(e,t),r}catch(t){return i.error(t),!1}}(e)?{type:st.COOKIE,cookieOptions:e}:void 0}function It(t,e){const n={isLockEnabled:j(),persistSession:(r=e,t=>{W(tt,gt(t),it,r)}),retrieveSession:Ct,expireSession:n=>function(t,e,n){const r=lt(e,n);W(tt,gt(r),n.trackAnonymousUser?ot:At,t)}(e,n,t)};var r;return function(t){if(!Z(tt)){const e=Z(_t),n=Z(mt),r=Z(vt),A={};e&&(A.id=e),r&&/^[01]$/.test(r)&&(A[wt]=r),n&&/^[012]$/.test(n)&&(A[Et]=n),ht(A)&&(dt(A),t.persistSession(A))}}(n),n}function Ct(){return yt(K(tt))}const xt="_dd_test_";function Nt(){try{const t=V(),e=`${xt}${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:st.LOCAL_STORAGE}:void 0}catch(t){return}}function St(t){return{isLockEnabled:!1,persistSession:Dt,retrieveSession:Lt,expireSession:e=>function(t,e){Dt(lt(t,e))}(e,t)}}function Dt(t){localStorage.setItem(tt,gt(t))}function Lt(){return yt(localStorage.getItem(tt))}const Tt=10,Mt=100,Ot=[];let Pt;function Rt(t,e,n=0){var r;const{isLockEnabled:A,persistSession:i,expireSession:o}=e,s=t=>i({...t,lock:u}),a=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Pt||(Pt=t),t!==Pt)return void Ot.push(t);if(A&&n>=Mt)return void Bt(e);let u,c=a();if(A){if(c.lock)return void kt(t,e,n);if(u=V(),s(c.session),c=a(),c.lock!==u)return void kt(t,e,n)}let l=t.process(c.session);if(A&&(c=a(),c.lock!==u))kt(t,e,n);else{if(l&&(pt(l)?o(l):(dt(l),A?s(l):i(l))),A&&(!l||!pt(l))){if(c=a(),c.lock!==u)return void kt(t,e,n);i(c.session),l=c.session}null===(r=t.after)||void 0===r||r.call(t,l||c.session),Bt(e)}}function kt(t,e,n){R((()=>{Rt(t,e,n+1)}),Tt)}function Bt(t){Pt=void 0;const e=Ot.shift();e&&Rt(e,t)}const Ft=l;function Gt(t){switch(t.sessionPersistence){case st.COOKIE:return bt(t);case st.LOCAL_STORAGE:return Nt();case void 0:{let e=bt(t);return!e&&t.allowFallbackToLocalStorage&&(e=Nt()),e}default:i.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Ut(t,e,n,r){const A=new G,i=new G,o=new G,s=t.type===st.COOKIE?It(e,t.cookieOptions):St(e),{expireSession:a}=s,u=B((function(){Rt({process:t=>pt(t)?lt(t,e):void 0,after:h},s)}),Ft);let c;p();const{throttled:l,cancel:f}=Q((()=>{Rt({process:t=>{if(ft(t))return;const e=h(t);return function(t){if(ft(t))return!1;const{trackingType:e,isTracked:A}=r(t[n]);t[n]=e,delete t.isExpired,A&&!t.id&&(t.id=V(),t.created=String(d()))}(e),e},after:t=>{ht(t)&&!g()&&function(t){c=t,A.notify()}(t),c=t}},s)}),Ft);function h(t){return pt(t)&&(t=lt(t,e)),g()&&(!function(t){return c.id!==t.id||c[n]!==t[n]}(t)?(o.notify({previousState:c,newState:t}),c=t):(c=lt(c,e),i.notify())),t}function p(){Rt({process:t=>{if(ft(t))return lt(t,e)},after:t=>{c=t}},s)}function g(){return void 0!==c[n]}return{expandOrRenewSession:l,expandSession:function(){Rt({process:t=>g()?h(t):void 0},s)},getSession:()=>c,renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o,restartSession:p,expire:()=>{f(),a(c),h(lt(c,e))},stop:()=>{F(u)},updateSessionState:function(t){Rt({process:e=>({...e,...t}),after:h},s)}}}const Qt={GRANTED:"granted",NOT_GRANTED:"not-granted"};function zt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=Vt(Object.prototype),A=Vt(Array.prototype),i=Vt(Object.getPrototypeOf(t)),o=Vt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),A(),i(),o()}}function Vt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):z}function qt(t){return function(t,e){const n=function(){if(void 0===jt)try{const t=new Yt("http://test/path");jt="http://test/path"===t.href}catch(t){jt=!1}return jt?Yt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${zt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const A=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(A)}return A.href=t,A}(t,location.href).href}const Yt=URL;let jt;const Ht="datad0g.com",Xt="dd0g-gov.com",$t="datadoghq.com",Wt="pci.browser-intake-datadoghq.com",Kt=["ddsource","ddtags"];function Zt(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=qt(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const A=function(t,e){const{site:n=$t,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===$t)return Wt;if(r&&n===$t)return`${r}.${$t}`;if(n===Xt)return`http-intake.logs.${n}`;const A=n.split("."),i=A.pop();return`browser-intake-${A.join("-")}.${i}`}(e,t);return t=>`https://${A}${n}?${t}`}(t,e);return{build(A,i){const o=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,A,{retry:i,encoding:o}){const s=["sdk_version:6.0.0",`api:${A}`].concat(r);i&&s.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const a=["ddsource=browser",`ddtags=${encodeURIComponent(s.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${V()}`];o&&a.push(`dd-evp-encoding=${o}`);"rum"===n&&a.push(`batch_time=${g()}`);e&&a.reverse();return a.join("&")}(t,e,n,A,i);return r(o)},urlPrefix:r(""),trackType:e}}const Jt=200;function te(t,e){const n=Jt-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&i.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${a} ${o}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function ee(t){const e=t.site||$t,n=function(t){const{env:e,service:n,version:r,datacenter:A}=t,i=[];return e&&i.push(te("env",e)),n&&i.push(te("service",n)),r&&i.push(te("version",r)),A&&i.push(te("datacenter",A)),i}(t),r=function(t,e){return{logsEndpointBuilder:Zt(t,"logs",e),rumEndpointBuilder:Zt(t,"rum",e),sessionReplayEndpointBuilder:Zt(t,"replay",e)}}(t,n),A=function(t,e){if(!t.replica)return;const n={...t,site:$t,clientToken:t.replica.clientToken},r={logsEndpointBuilder:Zt(n,"logs",e),rumEndpointBuilder:Zt(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:A,site:e,...r}}function ne(t,e){return null==t||"string"==typeof t||(i.error(`${e} must be defined as a string`),!1)}function re(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(i.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function Ae(t){var e,n,r,A,s,c;if(t&&t.clientToken){if((!(f=t.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(i.error(`Site should be a valid Datadog site. ${a} ${o}/getting_started/site/.`),0))&&re(t.sessionSampleRate,"Session")&&re(t.telemetrySampleRate,"Telemetry")&&re(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&re(t.telemetryUsageSampleRate,"Telemetry Usage")&&ne(t.version,"Version")&&ne(t.env,"Env")&&ne(t.service,"Service")){var f;if(void 0===t.trackingConsent||C(Qt,t.trackingConsent))return{beforeSend:t.beforeSend&&u(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Gt(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(A=t.telemetryUsageSampleRate)&&void 0!==A?A:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(s=t.trackingConsent)&&void 0!==s?s:Qt.GRANTED,trackAnonymousUser:null===(c=t.trackAnonymousUser)||void 0===c||c,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*l,batchMessagesLimit:50,messageBytesLimit:256*E,...ee(t)};i.error('Tracking Consent should be either "granted" or "not-granted"')}}else i.error("Client Token is not configured, we will not send any data.")}var ie;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ie||(ie={}));const oe=new Set;function se(t){Array.isArray(t)&&t.filter((t=>C(ie,t))).forEach((t=>{oe.add(t)}))}function ae(){return oe}const ue="?";function ce(t){const e=[];let n=me(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=he.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),A=pe.exec(e[2]);r&&A&&(e[2]=A[1],e[3]=A[2],e[4]=A[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||ue,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=de.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:ue,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=ge.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||ue,line:+e[3],url:e[2]}}(t)||function(t){const e=ye.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=_e.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||ue,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=ue),e.push(n))})),{message:me(t,"message"),name:me(t,"name"),stack:e}}const le="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",he=new RegExp(`^\\s*at (.*?) ?\\(${le}${fe}?${fe}?\\)?\\s*$`,"i"),pe=new RegExp(`\\((\\S*)${fe}${fe}\\)`);const de=new RegExp(`^\\s*at ?${le}${fe}?${fe}??\\s*$`,"i");const ge=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const ye=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,_e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function me(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function ve(t,e,n,r){const A=[{url:e,column:r,line:n}],{name:i,message:o}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=Ee.exec(t));return{name:e,message:n}}(t);return{name:i,message:o,stack:A}}const Ee=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function we(){const t=new Error;let e;return O((()=>{const n=ce(t);n.stack=n.stack.slice(2),e=be(n)})),e}function be(t){let e=Ie(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",A=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${A}${i}`})),e}function Ie(t){return`${t.name||"Error"}: ${t.message}`}function Ce(t,e,n,{computeHandlingStack:r}={}){let A=t[e];if("function"!=typeof A){if(!(e in t)||!e.startsWith("on"))return{stop:z};A=z}let i=!1;const o=function(){if(i)return A.apply(this,arguments);const t=Array.from(arguments);let e;O(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?we():void 0}]);const o=A.apply(this,t);return e&&O(e,null,[o]),o};return t[e]=o,{stop:()=>{i=!0,t[e]===o&&(t[e]=A)}}}const xe=220*E,Ne="$",Se=3;function De(t,e=xe){const n=Vt(Object.prototype),r=Vt(Array.prototype),A=[],i=new WeakMap,o=Le(t,Ne,void 0,A,i),s=JSON.stringify(o);let a=s?s.length:0;if(!(a>e)){for(;A.length>0&&a<e;){const n=A.shift();let r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){const s=Le(n.source[o],n.path,o,A,i);if(a+=void 0!==s?JSON.stringify(s).length:4,a+=r,r=1,a>e){Me(e,"truncated",t);break}n.target[o]=s}else for(const o in n.source)if(Object.prototype.hasOwnProperty.call(n.source,o)){const s=Le(n.source[o],n.path,o,A,i);if(void 0!==s&&(a+=JSON.stringify(s).length+r+o.length+Se,r=1),a>e){Me(e,"truncated",t);break}n.target[o]=s}}return n(),r(),o}Me(e,"discarded",t)}function Le(t,e,n,r,A){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const o=Te(i);if("[Object]"!==o&&"[Array]"!==o&&"[Error]"!==o)return o;const s=t;if(A.has(s))return`[Reference seen at ${A.get(s)}]`;const a=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return A.set(s,a),r.push({source:i,target:u,path:a}),u}function Te(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Te(e.currentTarget):null,target:e.target?Te(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function Me(t,e,n){i.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Oe="No stack, consider using an instance of Error";function Pe({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:A,source:i,handling:o}){const s=ke(e),a=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${zt(De(r))}`}(t,s,A,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(s,t)?be(t):Oe,c=s?Be(e,i):void 0;return{startClocks:r,source:i,handling:o,handlingStack:n,originalError:e,type:t?t.name:void 0,message:a,stack:u,causes:c,fingerprint:Re(e)}}function Re(t){return ke(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function ke(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Be(t,e){let n=t;const r=[];for(;ke(null==n?void 0:n.cause)&&r.length<10;){const t=ce(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&be(t)}),n=n.cause}return r.length?r:void 0}const Fe={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Ge(t){const e=(e,n)=>{const r=Pe({stackTrace:e,originalError:n,startClocks:_(),nonErrorPrefix:"Uncaught",source:Fe.SOURCE,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ce(window,"onerror",(({parameters:[t,e,n,A,i]})=>{let o;o=ke(i)?ce(i):ve(t,e,n,A),r(o,null!=i?i:t)})));var r;const{stop:A}=function(t){return Ce(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=ce(n);t(r,n)}))}(e);return{stop:()=>{n(),A()}}}function Ue(t,e){e.silentMultipleInit||i.error(`${t} is already initialized.`)}function Qe(t,e,n,r,A){return ze(t,e,[n],r,A)}function ze(t,e,n,r,{once:A,capture:i,passive:o}={}){const s=M((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(A&&l(),r(e))})),a=o?{capture:i,passive:o}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,c=S(u,"addEventListener");function l(){const t=S(u,"removeEventListener");n.forEach((n=>t.call(e,n,s,a)))}return n.forEach((t=>c.call(e,t,s,a))),{stop:l}}const Ve={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function qe(t,e){const n=[];e.includes(Ve.cspViolation)&&n.push(function(t){return new G((e=>{const{stop:n}=Qe(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return Ye({type:t.effectiveDirective,message:`${Ve.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:je(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${Y(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ve.cspViolation));return r.length&&n.push(function(t){return new G((e=>{if(!window.ReportingObserver)return;const n=M(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return Ye({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:je(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),U(...n)}function Ye(t){return{startClocks:_(),source:Fe.REPORT,handling:"unhandled",...t}}function je(t,e,n,r,A){return n?be({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=A?A:void 0}]}):void 0}function He(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function Xe(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=Xe(r[t],e[t],n);return r}const r="object"===nt(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=Xe(r[t],e[t],n));return r}function $e(t){return Xe(void 0,t)}function We(...t){let e;for(const n of t)null!=n&&(e=Xe(e,n));return e}function Ke(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function Ze(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const Je=500;function tn(){const t=[];return{add:e=>{t.push(e)>Je&&t.splice(0,1)},remove:e=>{Ze(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const en={log:"log",configuration:"configuration",usage:"usage"},nn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],rn=["ddog-gov.com"];let An=tn(),on=t=>{An.add((()=>on(t)))};function sn(t,e){let n;const r=new G,A=new Set,i=!rn.includes(e.site)&&c(e.telemetrySampleRate),o={[en.log]:i,[en.configuration]:i&&c(e.telemetryConfigurationSampleRate),[en.usage]:i&&c(e.telemetryUsageSampleRate)},s={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return on=i=>{const a=zt(i);if(o[i.type]&&A.size<e.maxTelemetryEventsPerPage&&!A.has(a)){const e=function(t,e,r){return We({type:"telemetry",date:g(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:We(e,{runtime_env:r,connectivity:Ke(),sdk_setup:"npm"}),experimental_features:Array.from(ae())},void 0!==n?n():{})}(t,i,s);r.notify(e),He("telemetry",e),A.add(a)}},D=un,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function an(t,n){P(e.debug,t,n),on({type:en.log,message:t,status:"debug",...n})}function un(t,e){on({type:en.log,status:"error",...cn(t),...e})}function cn(t){if(ke(t)){const e=ce(t);return{error:{kind:e.name,stack:be(ln(e))},message:e.message}}return{error:{stack:Oe},message:`Uncaught ${zt(t)}`}}function ln(t){return t.stack=t.stack.filter((t=>!t.url||nn.some((e=>t.url.startsWith(e))))),t}const fn=1/0,hn=f;function pn({expireDelay:t,maxEntries:e}){let n=[];const r=B((()=>function(){const e=y()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),hn);return{add:function(t,r){const A={value:t,startTime:r,endTime:fn,remove:()=>{Ze(n,A)},close:t=>{A.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(A),A},find:function(t=fn,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===fn&&e.close(t)},findAll:function(t=fn,e=0){const r=t+e;return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){F(r)}}}const dn=f,gn=At;function yn(t,e,n,r){const A=new G,i=new G,o=Ut(t.sessionStoreStrategyType,t,e,n),s=pn({expireDelay:gn});function a(){return{id:o.getSession().id,trackingType:o.getSession()[e],isReplayForced:!!o.getSession().forcedReplay,anonymousId:o.getSession().anonymousId}}return o.renewObservable.subscribe((()=>{s.add(a(),y()),A.notify()})),o.expireObservable.subscribe((()=>{i.notify(),s.closeActive(y())})),o.expandOrRenewSession(),s.add(a(),[0,v()][0]),r.observable.subscribe((()=>{r.isGranted()?o.expandOrRenewSession():o.expire()})),function(t,e){const{stop:n}=ze(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&o.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=Qe(t,document,"visibilitychange",n);B(n,dn)}(t,(()=>o.expandSession())),function(t,e){const{stop:n}=Qe(t,window,"resume",e,{capture:!0})}(t,(()=>o.restartSession())),{findSession:(t,e)=>s.find(t,e),renewObservable:A,expireObservable:i,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function _n(t){return t>=500}const mn=80*E,vn=32,En=3*w,wn=f,bn=l;function In(t,e,n,r,A){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?xn(t,e,n,{onSuccess:()=>Nn(0,e,n,r,A),onFailure:()=>{e.queuedPayloads.enqueue(t),Cn(e,n,r,A)}}):e.queuedPayloads.enqueue(t)}function Cn(t,e,n,r){2===t.transportStatus&&R((()=>{xn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=bn,Nn(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(wn,2*t.currentBackoffTime),Cn(t,e,n,r)}})}),t.currentBackoffTime)}function xn(t,e,n,{onSuccess:r,onFailure:A}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||_n(t.status))}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},A())}))}function Nn(t,e,n,r,A){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(A({message:`Reached max ${r} events size queued for upload: ${En/w}MiB`,source:Fe.AGENT,startClocks:_()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Sn();i.size()>0;)In(i.dequeue(),e,n,r,A)}function Sn(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=En}}}function Dn(t,e,n){const r={transportStatus:0,currentBackoffTime:bn,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=mn&&this.ongoingRequestCount<vn},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Sn(),queueFullReported:!1},A=(n,r)=>function(t,e,n,r){const A=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(A){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(M((t=>null==r?void 0:r({status:t.status,type:t.type}))),M((()=>{Tn(t.build("xhr",n),n.data,r)})))}else{Tn(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{In(e,r,A,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Ln||(Ln=!0,un(t))}(t)}const A=t.build("xhr",n);Tn(A,n.data)}(t,e,n)}}}let Ln=!1;function Tn(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Qe({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Mn(){const t=N().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const A=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:A}))}}}function On(t){var e;void 0===t&&(t=null===(e=N().location)||void 0===e?void 0:e.hostname);const n=Mn();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Pn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Rn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let A={};const o=n.flushObservable.subscribe((n=>function(n){const r=et(A).join("\n");A={};const i=(s=n.reason,et(Pn).includes(s)),o=i?e.sendOnExit:e.send;var s;if(i&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&o(kn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&o({data:n,bytesCount:I(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{o(kn(t))}))}(n)));function u(e,o){const u=zt(e),c=t.estimateEncodedBytesCount(u);c>=r?i.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==A[t]}(o)&&function(e){const r=A[e];delete A[e];const i=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(i)}(o),function(e,r,i){n.notifyBeforeAddMessage(r),void 0!==i?(A[i]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,c,o))}return{flushController:n,add:u,upsert:u,stop:o.unsubscribe}}function kn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function Bn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:A}){const i=r.subscribe((t=>l(t.reason))),o=A.subscribe((()=>l("session_expire"))),s=new G((()=>()=>{i.unsubscribe(),o.unsubscribe()}));let a,u=0,c=0;function l(t){if(0===c)return;const e=c,n=u;c=0,u=0,f(),s.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){k(a),a=void 0}return{flushObservable:s,get messagesCount(){return c},notifyBeforeAddMessage(t){u+t>=e&&l("bytes_limit"),c+=1,u+=t,void 0===a&&(a=R((()=>{l("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,c>=t?l("messages_limit"):u>=e&&l("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,c-=1,0===c&&f()}}}function Fn(t,e,n,r,A,i,o=Rn){const s=u(t,e),a=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return o({encoder:n,request:Dn(e,t.batchBytesLimit,r),flushController:Bn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:A,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add(t,e=!0){s.add(t),a&&e&&a.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{s.upsert(t,e),a&&a.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{s.stop(),a&&a.stop()}}}function Gn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const A=I(n);e+=A,t+=n,r&&r(A)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}let Un;const Qn=new WeakMap;function zn(t){return Un||(Un=function(t){return new G((e=>{const{stop:n}=Ce(XMLHttpRequest.prototype,"open",Vn),{stop:r}=Ce(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const A=Qn.get(t);if(!A)return;const i=A;i.state="start",i.startClocks=_(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let o=!1;const{stop:s}=Ce(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&a()})),a=()=>{if(u(),s(),o)return;o=!0;const e=A;var n,a;e.state="complete",e.duration=(n=i.startClocks.timeStamp,g()-n),e.status=t.status,r.notify((a=e,{...a}))},{stop:u}=Qe(n,t,"loadend",a);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:A}=Ce(XMLHttpRequest.prototype,"abort",qn);return()=>{n(),r(),A()}}))}(t)),Un}function Vn({target:t,parameters:[e,n]}){Qn.set(t,{state:"open",method:String(e).toUpperCase(),url:qt(String(n))})}function qn({target:t}){const e=Qn.get(t);e&&(e.isAborted=!0)}let Yn;function jn(){return Yn||(Yn=new G((t=>{if(!window.fetch)return;const{stop:e}=Ce(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[A,i]=t;let o=i&&i.method;void 0===o&&A instanceof Request&&(o=A.method);const s=void 0!==o?String(o).toUpperCase():"GET",a=A instanceof Request?A.url:qt(String(A)),u=_(),c={state:"start",init:i,input:A,method:s,startClocks:u,url:a,handlingStack:n};r.notify(c),t[0]=c.input,t[1]=c.init,e((t=>function(t,e,n){const r=n;function A(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(M((t=>{A({response:t,responseType:t.type,status:t.status,isAborted:!1})})),M((t=>{var e,n;A({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,c)))}(e,t)),{computeHandlingStack:!0});return e}))),Yn}let Hn={};function Xn(t){return U(...t.map((t=>(Hn[t]||(Hn[t]=function(t){return new G((r=>{const A=n[t];return n[t]=(...n)=>{A.apply(console,n);const i=we();O((()=>{r.notify(function(t,n,r){const A=t.map((t=>function(t){if("string"==typeof t)return De(t);if(ke(t))return Ie(ce(t));return zt(De(t),void 0,2)}(t))).join(" ");let i;if(n===e.error){const e=t.find(ke);i={stack:e?be(ce(e)):void 0,fingerprint:Re(e),causes:e?Be(e,"console"):void 0,startClocks:_(),message:A,source:Fe.CONSOLE,handling:"handled",handlingStack:r}}return{api:n,message:A,error:i,handlingStack:r}}(n,t,i))}))},()=>{n[t]=A}}))}(t)),Hn[t]))))}function $n(t){let e={};const n=new G,r={getContext:()=>$e(e),setContext:A=>{"object"===nt(A)?(e=De(A),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,A)=>{e[r]=De(A),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const Wn="_dd_c",Kn=[];function Zn(t,e,n,r){const A=function(t,e){return`${Wn}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(A);return null!==t?JSON.parse(t):{}}Kn.push(Qe(t,window,"storage",(({key:t})=>{A===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(A,JSON.stringify(e.getContext()))})),e.setContext(We(i(),e.getContext()))}const Jn=3*E,tr=16*E,er=200;function nr(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const A=2===t?Jn:tr;let o=r;e.forEach((t=>{o+=t.getBytesCount()})),o>A&&(!function(t){i.warn(`Customer data exceeds the recommended ${t/E}KiB threshold. ${a} ${s}/#customer-data-exceeds-the-recommended-threshold-warning`)}(A),n=!0)}return{createDetachedTracker:()=>{const t=rr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,rr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function rr(t){let e=0;const{throttled:n,cancel:r}=Q((n=>{e=I(zt(n)),t()}),er),A=()=>{r(),e=0};return{updateCustomerData:t=>{x(t)?A():n(t)},resetCustomerData:A,getBytesCount:()=>e,stop:()=>{r()}}}const Ar="datadog-synthetics-public-id",ir="datadog-synthetics-result-id",or="datadog-synthetics-injects-rum";function sr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Z(or))}function ar(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Z(Ar);return"string"==typeof t?t:void 0}function ur(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||Z(ir);return"string"==typeof t?t:void 0}function cr(t,e,n){const r=n.getHandler(),A=Array.isArray(r)?r:[r];return fr[t]>=fr[n.getLevel()]&&A.includes(e)}const lr={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},fr={[lr.ok]:0,[lr.debug]:1,[lr.info]:2,[lr.notice]:4,[lr.warn]:5,[lr.error]:6,[lr.critical]:7,[lr.alert]:8,[lr.emerg]:9};function hr(t,{includeMessage:e=!1}={}){return{stack:t.stack,kind:t.type,message:e?t.message:void 0,causes:t.causes,fingerprint:t.fingerprint,handling:t.handling}}var pr=function(t,e,n,r){var A,i=arguments.length,o=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(A=t[s])&&(o=(i<3?A(o):i>3?A(e,n,o):A(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const dr={console:"console",http:"http"},gr=Object.keys(lr);class yr{constructor(t,e,n,r=dr.http,A=lr.debug,i={}){this.handleLogStrategy=t,this.handlerType=r,this.level=A,this.contextManager=$n(e),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}logImplementation(t,e,n=lr.info,r,A){const i=De(e);let o;if(null!=r){o=We({error:hr(Pe({stackTrace:ke(r)?ce(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Fe.LOGGER,handling:"handled",startClocks:_()}),{includeMessage:!0})},i)}else o=i;this.handleLogStrategy({message:De(t),context:o,status:n},this,A)}log(t,e,n=lr.info,r){let A;cr(n,dr.http,this)&&(A=we()),this.logImplementation(t,e,n,r,A)}setContext(t){this.contextManager.setContext(t)}getContext(){return this.contextManager.getContext()}setContextProperty(t,e){this.contextManager.setContextProperty(t,e)}removeContextProperty(t){this.contextManager.removeContextProperty(t)}clearContext(){this.contextManager.clearContext()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function _r(t){return function(e,n,r){let A;cr(t,dr.http,this)&&(A=we()),this.logImplementation(e,n,t,r,A)}}pr([function(t,e,n){const r=n.value;n.value=function(...t){return(D?M(r):r).apply(this,t)}}],yr.prototype,"logImplementation",null),yr.prototype.ok=_r(lr.ok),yr.prototype.debug=_r(lr.debug),yr.prototype.info=_r(lr.info),yr.prototype.notice=_r(lr.notice),yr.prototype.warn=_r(lr.warn),yr.prototype.error=_r(lr.error),yr.prototype.critical=_r(lr.critical),yr.prototype.alert=_r(lr.alert),yr.prototype.emerg=_r(lr.emerg);const mr=32*E;function vr(t,e,n){return void 0===t?[]:"all"===t||Array.isArray(t)&&t.every((t=>e.includes(t)))?"all"===t?e:function(t){const e=new Set;return t.forEach((t=>e.add(t))),Array.from(e)}(t):void i.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function Er(t,n,r){const A=tn();let o,s;const a=n.observable.subscribe(u);function u(){if(!s||!o||!n.isGranted())return;a.unsubscribe();const t=r(o,s);A.drain(t)}return{init(t){if(!t)return void i.error("Missing configuration");if(se(t.enableExperimentalFeatures),On()&&(t=function(t){return{...t,clientToken:"empty"}}(t)),o=t,s)return void Ue("DD_LOGS",t);const r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&i.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=Ae(t),r=vr(t.forwardConsoleLogs,et(e),"Forward Console Logs"),A=vr(t.forwardReports,et(Ve),"Forward Reports");if(n&&r&&A)return t.forwardErrorsToLogs&&!r.includes(e.error)&&r.push(e.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:A,requestErrorResponseLengthLimit:mr,...n}}(t);r&&(s=r,jn().subscribe(z),n.tryToInit(r.trackingConsent),u())},get initConfiguration(){return o},getInternalContext:z,handleLog(e,n,r,i=t(),o=g()){A.add((t=>t.handleLog(e,n,r,i,o)))}}}const wr="logs";const br="logs";function Ir(t,e){const n=yn(t,br,(e=>function(t,e){const n=function(t){return"0"===t||"1"===t}(e)?e:Cr(t);return{trackingType:n,isTracked:"1"===n}}(t,e)),e);return{findTrackedSession:(t,e={returnInactive:!1})=>{const r=n.findSession(t,e);return r&&"1"===r.trackingType?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}function Cr(t){return c(t.sessionSampleRate)?"1":"0"}let xr=!1;function Nr(t){const e=window;if(sr()){const t=n(e.DD_RUM_SYNTHETICS);return t||xr||(xr=!0,an("Logs sent before RUM is injected by the synthetics worker",{testId:ar(),resultId:ur()})),t}return n(e.DD_RUM);function n(e){if(e&&e.getInternalContext)return e.getInternalContext(t)}}function Sr(t,e,n,r,A){const i=gr.concat(["custom"]),o={};i.forEach((t=>{o[t]=function(t,e,n){let r=0,A=!1;return{isLimitReached(){if(0===r&&R((()=>{r=0}),f),r+=1,r<=e||A)return A=!1,!1;if(r===e+1){A=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Fe.AGENT,startClocks:_()})}finally{A=!1}}return!0}}}(t,e.eventRateLimiterThreshold,A)})),n.subscribe(0,(({rawLogsEvent:A,messageContext:i,savedCommonContext:s,domainContext:a})=>{var u,c;const l=A.date-v();const f=t.findTrackedSession(l);if(!t.findTrackedSession(l,{returnInactive:!0}))return;const h=s||r();f&&f.anonymousId&&!h.user.anonymous_id&&(h.user.anonymous_id=f.anonymousId);const p=We({service:e.service,session_id:f?f.id:void 0,session:f?{id:f.id}:void 0,usr:x(h.user)?void 0:h.user,view:h.view},h.context,Nr(l),A,i);!1===(null===(u=e.beforeSend)||void 0===u?void 0:u.call(e,p,a))||p.origin!==Fe.AGENT&&(null!==(c=o[p.status])&&void 0!==c?c:o.custom).isLimitReached()||n.notify(1,p)}))}const Dr={[e.log]:lr.info,[e.debug]:lr.debug,[e.info]:lr.info,[e.warn]:lr.warn,[e.error]:lr.error};function Lr(t,e){if(!t.forwardErrorsToLogs)return{stop:z};const n=zn(t).subscribe((t=>{"complete"===t.state&&A("xhr",t)})),r=jn().subscribe((t=>{"resolve"===t.state&&A("fetch",t)}));function A(n,r){var A;function i(t){const A={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${Mr(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:t||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:lr.error,origin:Fe.NETWORK},domainContext:A})}A=r.url,Kt.every((t=>A.includes(t)))||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!_n(r.status)||("xhr"in r?function(t,e,n){"string"==typeof t.response?n(Tr(t.response,e)):n(t.response)}(r.xhr,t,i):r.response?function(t,e,n){const r=function(t){try{return t.clone()}catch(t){return}}(t);r&&r.body?window.TextDecoder?function(t,e,n){!function(t,e,n){const r=t.getReader(),A=[];let i=0;function o(){let t,o;r.cancel().catch(z);{let e;if(1===A.length)e=A[0];else{e=new Uint8Array(i);let t=0;A.forEach((n=>{e.set(n,t),t+=n.length}))}t=e.slice(0,n.bytesLimit),o=e.length>n.bytesLimit}e(void 0,t,o)}!function t(){r.read().then(M((e=>{e.done?o():(A.push(e.value),i+=e.value.length,i>n.bytesLimit?o():t())})),M((t=>e(t))))}()}(t,((t,e,r)=>{if(t)n(t);else{let t=(new TextDecoder).decode(e);r&&(t+="..."),n(void 0,t)}}),{bytesLimit:e})}(r.body,e.requestErrorResponseLengthLimit,((t,e)=>{n(t?`Unable to retrieve response: ${t}`:e)})):r.text().then(M((t=>n(Tr(t,e)))),M((t=>n(`Unable to retrieve response: ${t}`)))):n()}(r.response,t,i):r.error&&function(t,e,n){n(Tr(be(ce(t)),e))}(r.error,t,i))}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function Tr(t,e){return t.length>e.requestErrorResponseLengthLimit?`${t.substring(0,e.requestErrorResponseLengthLimit)}...`:t}function Mr(t){return"xhr"===t?"XHR":"Fetch"}const Or=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}};function Pr(t){return{handleLog:function(e,A,i,o,s){const a=We(A.getContext(),e.context);if(cr(e.status,dr.console,A)&&function({status:t,message:e},A){r[Rr[t]].call(n,e,A)}(e,a),cr(e.status,dr.http,A)){const n={rawLogsEvent:{date:s||g(),message:e.message,status:e.status,origin:Fe.LOGGER},messageContext:a,savedCommonContext:o};i&&(n.domainContext={handlingStack:i}),t.notify(0,n)}}}}const Rr={[lr.ok]:e.debug,[lr.debug]:e.debug,[lr.info]:e.info,[lr.notice]:e.info,[lr.warn]:e.warn,[lr.error]:e.error,[lr.critical]:e.error,[lr.alert]:e.error,[lr.emerg]:e.error};function kr(t,e,n,r,A){const i=sn("browser-logs-sdk",e);i.setContextProvider((()=>{var t,e,n,r,i,o;return{application:{id:null===(t=Nr())||void 0===t?void 0:t.application_id},session:{id:null===(e=A.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(r=null===(n=Nr())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(o=null===(i=Nr())||void 0===i?void 0:i.user_action)||void 0===o?void 0:o.id}}}));const o=[];if(On()){const t=Mn(),e=i.observable.subscribe((e=>t.send("internal_telemetry",e)));o.push((()=>e.unsubscribe()))}else{const t=Fn(e,{endpoint:e.rumEndpointBuilder,encoder:Gn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Gn()},n,r,A.expireObservable);o.push((()=>t.stop()));const s=i.observable.subscribe((n=>t.add(n,function(t){return t.site===Ht}(e))));o.push((()=>s.unsubscribe()))}return An.drain(),function(t){on({type:en.configuration,configuration:t})}(function(t){const e={session_sample_rate:(n=t).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}(t)),{telemetry:i,stop:()=>{o.forEach((t=>t()))}}}const Br=function(t){const e=nr(),n=$n(e.getOrCreateTracker(2)),r=$n(e.getOrCreateTracker(1)),A=function(t){const e=new G;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Qt.GRANTED,observable:e}}();function o(){return function(t,e){return{view:{referrer:document.referrer,url:window.location.href},context:t.getContext(),user:e.getContext()}}(n,r)}let s=Er(o,A,((e,i)=>{e.storeContextsAcrossPages&&(Zn(i,n,wr,2),Zn(i,r,wr,1));const a=t(e,i,o,A);return s=function(t,e){return{init:t=>{Ue("DD_LOGS",t)},initConfiguration:t,...e}}(e,a),a}));const a={};return function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>T,enumerable:!1}),e}({logger:new yr(((...t)=>s.handleLog(...t)),e.createDetachedTracker()),init:M((t=>s.init(t))),setTrackingConsent:M((t=>{var e;A.update(t),e={feature:"set-tracking-consent",tracking_consent:t},on({type:en.usage,usage:e})})),getGlobalContext:M((()=>n.getContext())),setGlobalContext:M((t=>n.setContext(t))),setGlobalContextProperty:M(((t,e)=>n.setContextProperty(t,e))),removeGlobalContextProperty:M((t=>n.removeContextProperty(t))),clearGlobalContext:M((()=>n.clearContext())),createLogger:M(((t,n={})=>(a[t]=new yr(((...t)=>s.handleLog(...t)),e.createDetachedTracker(),De(t),n.handler,n.level,De(n.context)),a[t]))),getLogger:M((t=>a[t])),getInitConfiguration:M((()=>$e(s.initConfiguration))),getInternalContext:M((t=>s.getInternalContext(t))),setUser:M((t=>{(function(t){const e="object"===nt(t);return e||i.error("Unsupported user:",t),e})(t)&&r.setContext(rt(t))})),getUser:M((()=>r.getContext())),setUserProperty:M(((t,e)=>{const n=rt({[t]:e})[t];r.setContextProperty(t,n)})),removeUserProperty:M((t=>r.removeContextProperty(t))),clearUser:M((()=>r.clearContext()))})}((function(t,e,n,r){const A=new Or,i=[];A.subscribe(1,(t=>He("logs",t)));const o=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Fe.AGENT,status:lr.error}}),an("Error reported to customer",{"error.message":e.message})}}(A),s=function(t){return new G((e=>{const{stop:n}=ze(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Pn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Pn.FROZEN})}),{capture:!0}),r=Qe(t,window,"beforeunload",(()=>{e.notify({reason:Pn.UNLOADING})})).stop;return()=>{n(),r()}}))}(e),a=!e.sessionStoreStrategyType||On()||sr()?function(t){const e="1"===Cr(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new G}}(e):Ir(e,r),{stop:u}=kr(t,e,o,s,a);i.push((()=>u())),Lr(e,A),function(t,e){if(!t.forwardErrorsToLogs)return{stop:z};const n=new G,{stop:r}=Ge(n),A=n.subscribe((t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,error:hr(t),origin:Fe.SOURCE,status:lr.error}})}))}(e,A),function(t,e){const n=Xn(t.forwardConsoleLogs).subscribe((t=>{const n={rawLogsEvent:{date:g(),message:t.message,origin:Fe.CONSOLE,error:t.error&&hr(t.error),status:Dr[t.api]},domainContext:{handlingStack:t.handlingStack}};e.notify(0,n)}))}(e,A),function(t,e){const n=qe(t,t.forwardReports).subscribe((t=>{let n,r=t.message;const A="deprecation"===t.originalError.type?lr.warn:lr.error;var i,o;A===lr.error?n=hr(t):t.stack&&(r+=` Found in ${i=t.stack,null===(o=/@ (.+)/.exec(i))||void 0===o?void 0:o[1]}`),e.notify(0,{rawLogsEvent:{date:g(),message:r,origin:Fe.REPORT,error:n,status:A}})}))}(e,A);const{handleLog:c}=Pr(A);if(Sr(a,e,A,n,o),On())!function(t){const e=Mn();t.subscribe(1,(t=>{e.send("log",t)}))}(A);else{const{stop:t}=function(t,e,n,r,A){const i=Fn(t,{endpoint:t.logsEndpointBuilder,encoder:Gn()},t.replica&&{endpoint:t.replica.logsEndpointBuilder,encoder:Gn()},n,r,A.expireObservable);return e.subscribe(1,(t=>{i.add(t)})),i}(e,A,o,s,a);i.push((()=>t()))}var l;return{handleLog:c,getInternalContext:(l=a,{get:t=>{const e=l.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,stop:()=>{i.forEach((t=>t()))}}}));!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&i.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>u(t,"onReady callback threw an error:")()))}(N(),"DD_LOGS",Br);const Fr="GET",Gr="POST",Ur="x-api-key",Qr="x-access-token",zr="content-type",Vr="/auth/v5/partner/login",qr="/auth/v5/partner/login-signed",Yr="/auth/v5/partner/refresh-token",jr="/auth/v5/users/me",Hr="[SkyPath SDK]: Old fetch request aborted",Xr="local",$r="development",Wr="staging",Kr="production",Zr={[Xr]:"https://staging-api.skypath.io",[$r]:"https://dev-api.skypath.io",[Wr]:"https://staging-api.skypath.io",[Kr]:"https://api.skypath.io"};const Jr="0.4.22",tA="SDKLogger",eA={SDK:`[SkyPathSDK v${Jr}]:`,NETWORK:"[Network]:"},nA="Invalid listener",rA="Missing authentication parameters",AA="Failed to authenticate with authCallback",iA="Failed to authenticate with API key",oA="Failed to get authentication token";class sA extends Error{constructor({error:t,context:e={}}){t||={message:"Unknown error"},super(t.message),this.name=this.constructor.name,this.context=e;const n=Br.getLogger(tA);n?.error(this.message,{context:e},e?.error||t)}}class aA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class uA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class cA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class lA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}class fA extends sA{constructor(t,e={}){super({error:new Error(t),context:e})}}const hA={INFO:"/v5/gtg/info",DATA:"/v5/gtg/{resolution}/{hexId}"};class pA{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:hA.INFO})).data}catch(t){throw new uA("Failed to get GTG info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=hA.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r};return(await this.#t({path:A,params:i})).data}catch(t){throw new uA("Failed to get GTG data",{error:t})}}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function dA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gA={exports:{}};gA.exports=function(){var t=1e3,e=6e4,n=36e5,r="millisecond",A="second",i="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",f="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},_={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),A=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(A,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),A=e.clone().add(r,u),i=n-A<0,o=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-A)/(i?A-o:o-A))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:l,w:a,d:s,D:f,h:o,m:i,s:A,ms:r,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",v={};v[m]=g;var E="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[E])},b=function t(e,n,r){var A;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();v[i]&&(A=i),n&&(v[i]=n,A=i);var o=e.split("-");if(!A&&o.length>1)return t(o[0])}else{var s=e.name;v[s]=e,A=s}return!r&&A&&(m=A),A||!r&&m},I=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new x(n)},C=_;C.l=b,C.i=w,C.w=function(t,e){return I(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function g(t){this.$L=b(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[E]=!0}var y=g.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(C.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var A=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],A,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return C},y.isValid=function(){return!(this.$d.toString()===h)},y.isSame=function(t,e){var n=I(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return I(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<I(t)},y.$g=function(t,e,n){return C.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,r=!!C.u(e)||e,c=C.p(t),h=function(t,e){var A=C.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?A:A.endOf(s)},p=function(t,e){return C.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},d=this.$W,g=this.$M,y=this.$D,_="set"+(this.$u?"UTC":"");switch(c){case l:return r?h(1,0):h(31,11);case u:return r?h(1,g):h(0,g+1);case a:var m=this.$locale().weekStart||0,v=(d<m?d+7:d)-m;return h(r?y-v:y+(6-v),g);case s:case f:return p(_+"Hours",0);case o:return p(_+"Minutes",1);case i:return p(_+"Seconds",2);case A:return p(_+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var n,a=C.p(t),c="set"+(this.$u?"UTC":""),h=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[l]=c+"FullYear",n[o]=c+"Hours",n[i]=c+"Minutes",n[A]=c+"Seconds",n[r]=c+"Milliseconds",n)[a],p=a===s?this.$D+(e-this.$W):e;if(a===u||a===l){var d=this.clone().set(f,1);d.$d[h](p),d.init(),this.$d=d.set(f,Math.min(this.$D,d.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[C.p(t)]()},y.add=function(r,c){var f,h=this;r=Number(r);var p=C.p(c),d=function(t){var e=I(h);return C.w(e.date(e.date()+Math.round(t*r)),h)};if(p===u)return this.set(u,this.$M+r);if(p===l)return this.set(l,this.$y+r);if(p===s)return d(1);if(p===a)return d(7);var g=(f={},f[i]=e,f[o]=n,f[A]=t,f)[p]||1,y=this.$d.getTime()+r*g;return C.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=t||"YYYY-MM-DDTHH:mm:ssZ",A=C.z(this),i=this.$H,o=this.$m,s=this.$M,a=n.weekdays,u=n.months,c=n.meridiem,l=function(t,n,A,i){return t&&(t[n]||t(e,r))||A[n].slice(0,i)},f=function(t){return C.s(i%12||12,t,"0")},p=c||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(d,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return C.s(e.$y,4,"0");case"M":return s+1;case"MM":return C.s(s+1,2,"0");case"MMM":return l(n.monthsShort,s,u,3);case"MMMM":return l(u,s);case"D":return e.$D;case"DD":return C.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(n.weekdaysMin,e.$W,a,2);case"ddd":return l(n.weekdaysShort,e.$W,a,3);case"dddd":return a[e.$W];case"H":return String(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(i,o,!0);case"A":return p(i,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(e.$s);case"ss":return C.s(e.$s,2,"0");case"SSS":return C.s(e.$ms,3,"0");case"Z":return A}return null}(t)||A.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,f,h){var p,d=this,g=C.p(f),y=I(r),_=(y.utcOffset()-this.utcOffset())*e,m=this-y,v=function(){return C.m(d,y)};switch(g){case l:p=v()/12;break;case u:p=v();break;case c:p=v()/3;break;case a:p=(m-_)/6048e5;break;case s:p=(m-_)/864e5;break;case o:p=m/n;break;case i:p=m/e;break;case A:p=m/t;break;default:p=m}return h?p:C.a(p)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return v[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=b(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return C.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),N=x.prototype;return I.prototype=N,[["$ms",r],["$s",A],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",f]].forEach((function(t){N[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),I.extend=function(t,e){return t.$i||(t(e,x,I),t.$i=!0),I},I.locale=b,I.isDayjs=w,I.unix=function(t){return I(1e3*t)},I.en=v[m],I.Ls=v,I.p={},I}();var yA=dA(gA.exports),_A=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var A,i="";"undefined"!=typeof document&&document.currentScript&&(i=document.currentScript.src),i=0!==i.indexOf("blob:")?i.substr(0,i.lastIndexOf("/")+1):"",A=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var A=z(t);A?e(A.buffer):n()}},r.onerror=n,r.send(null)};var o=n.print||console.log.bind(console),s=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments;var a=0;var u=!1;function c(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||et("Assertion failed: "+e),r}function l(t,e,n,r,A){var i={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var A=n,i=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=i)break;e[n++]=s}else if(s<=2047){if(n+1>=i)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=i)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=i)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,p,e,n)})(t,e=H(n),n)}return e},array:function(t){var e=H(t.length);return function(t,e){h.set(t,e)}(t,e),e}};var o=c(t),s=[],a=0;if(r)for(var u=0;u<r.length;u++){var l=i[n[u]];l?(0===a&&(a=$()),s[u]=l(r[u])):s[u]=r[u]}var f=o.apply(null,s);return f=function(t){return"string"===e?v(t):"boolean"===e?Boolean(t):t}(f),0!==a&&X(a),f}var f,h,p,d,g,y,_,m="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function v(t,e){return t?function(t,e,n){for(var r=e+n,A=e;t[A]&&!(A>=r);)++A;if(A-e>16&&t.subarray&&m)return m.decode(t.subarray(e,A));for(var i="";e<A;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var a=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|a:(7&o)<<18|s<<12|a<<6|63&t[e++])<65536)i+=String.fromCharCode(o);else{var u=o-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&o)<<6|s)}else i+=String.fromCharCode(o)}return i}(p,t,e):""}function E(t,e){return t%e>0&&(t+=e-t%e),t}function w(t){f=t,n.HEAP8=h=new Int8Array(t),n.HEAP16=d=new Int16Array(t),n.HEAP32=g=new Int32Array(t),n.HEAPU8=p=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=y=new Float32Array(t),n.HEAPF64=_=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var b=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}b=(f=n.buffer?n.buffer:new ArrayBuffer(b)).byteLength,w(f),g[6032]=5267040;var C=[],x=[],N=[],S=[];var D=Math.abs,L=Math.ceil,T=Math.floor,M=Math.min,O=0,P=null;n.preloadedImages={},n.preloadedAudios={};var R,k,B=null,F="data:application/octet-stream;base64,";function G(t){return String.prototype.startsWith?t.startsWith(F):0===t.indexOf(F)}B="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function U(){return h.length}var Q="function"==typeof atob?atob:function(t){var e,n,r,A,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(u++))<<2|(A=s.indexOf(t.charAt(u++)))>>4,n=(15&A)<<4|(i=s.indexOf(t.charAt(u++)))>>2,r=(3&i)<<6|(o=s.indexOf(t.charAt(u++))),a+=String.fromCharCode(e),64!==i&&(a+=String.fromCharCode(n)),64!==o&&(a+=String.fromCharCode(r))}while(u<t.length);return a};function z(t){if(G(t))return function(t){try{for(var e=Q(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(F.length))}var V=function(t,e,n){var r=new t.Int8Array(n),A=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var i=new t.Float64Array(n),o=0|e.o,s=0|e.p,a=t.Math.floor,u=t.Math.abs,c=t.Math.sqrt,l=t.Math.pow,f=t.Math.cos,h=t.Math.sin,p=t.Math.tan,d=t.Math.acos,g=t.Math.asin,y=t.Math.atan,_=t.Math.atan2,m=t.Math.ceil,v=t.Math.imul,E=t.Math.min,w=t.Math.max,b=t.Math.clz32,I=e.b,C=e.c,x=e.d,N=e.e,S=e.f,D=e.g,L=e.h,T=e.i,M=24160;function O(t,e,n,r){return 0|P(t|=0,e|=0,n|=0,r|=0,0)}function P(t,e,n,r,i){var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,a=o,!(0|R(t|=0,e|=0,n|=0,r|=0,i|=0)))return M=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,a)))break;a=0|A[(u=a)>>2],u=0|A[u+4>>2]}else c=0|Be(0|n,0|(s=((0|n)<0)<<31>>31),3,0),u=0|C(),s=0|Me(0|n,0|s,1,0),s=0|Me(0|(s=0|Be(0|c,0|u,0|s,0|C())),0|C(),1,0),u=0|C(),A[a>>2]=s,A[a+4>>2]=u,a=s;if(He(0|r,0,a<<3),0|i){He(0|i,0,a<<2),s=0|k(t,e,n,r,i,a,u,0);break}(s=0|Te(a,4))?(c=0|k(t,e,n,r,s,a,u,0),Le(s),s=c):s=13}else s=2}while(0);return M=o,0|(c=s)}function R(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,g=s+8|0,A[(d=o=s)>>2]=t,A[d+4>>2]=e,(0|n)<0)return M=s,0|(g=2);if(A[(a=r)>>2]=t,A[a+4>>2]=e,(a=!!(0|i))&&(A[i>>2]=0),0|Bt(t,e))return M=s,0|(g=9);A[g>>2]=0;t:do{if((0|n)>=1)if(a)for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,A[i+(h<<2)>>2]=d,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else for(h=1,f=0,p=0,d=1,a=t;;){if(!(f|p)){if(0|(a=0|B(a,e,4,g,o)))break t;if(0|Bt(a=0|A[(e=o)>>2],e=0|A[e+4>>2])){a=9;break t}}if(0|(a=0|B(a,e,0|A[22384+(p<<2)>>2],g,o)))break t;if(a=0|A[(e=o)>>2],e=0|A[e+4>>2],A[(t=r+(h<<3)|0)>>2]=a,A[t+4>>2]=e,u=(0|(t=f+1|0))==(0|d),l=6==(0|(c=p+1|0)),0|Bt(a,e)){a=9;break t}if((0|(d=d+(l&u&1)|0))>(0|n)){a=0;break}h=h+1|0,f=u?0:t,p=u?l?0:c:p}else a=0}while(0);return M=s,0|(g=a)}function k(t,e,n,r,i,o,s,a){n|=0,r|=0,i|=0,a|=0;var u,c,l,f=0,h=0,p=0,d=0,g=0,y=0,_=0;if(l=M,M=M+16|0,u=l+8|0,c=l,f=0|Ge(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),p=0|C(),!(!(0|(_=0|A[(y=d=r+(f<<3)|0)>>2]))&!(0|(y=0|A[y+4>>2]))|(h=(0|_)==(0|t)&(0|y)==(0|e))))do{f=0|Fe(0|(f=0|Me(0|f,0|p,1,0)),0|C(),0|o,0|s),p=0|C(),h=(0|(y=0|A[(_=d=r+(f<<3)|0)>>2]))==(0|t)&(0|(_=0|A[_+4>>2]))==(0|e)}while(!(!(0|y)&!(0|_)|h));if(f=i+(f<<2)|0,h&&(0|A[f>>2])<=(0|a))return M=l,0|(_=0);if(A[(_=d)>>2]=t,A[_+4>>2]=e,A[f>>2]=a,(0|a)>=(0|n))return M=l,0|(_=0);switch(h=a+1|0,A[u>>2]=0,0|(f=0|B(t,e,2,u,c))){case 9:g=9;break;case 0:(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h))||(g=9)}t:do{if(9==(0|g)){switch(A[u>>2]=0,0|(f=0|B(t,e,3,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,1,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,5,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,4,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}switch(A[u>>2]=0,0|(f=0|B(t,e,6,u,c))){case 9:break;case 0:if(0|(f=0|k(0|A[(f=c)>>2],0|A[f+4>>2],n,r,i,o,s,h)))break t;break;default:break t}return M=l,0|(_=0)}}while(0);return M=l,0|(_=f)}function B(t,e,n,r,i){t|=0,e|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if((n|=0)>>>0>6)return 0|(i=1);if(f=(0|A[(r|=0)>>2])%6|0,A[r>>2]=f,(0|f)>0){a=0;do{n=0|pt(n),a=a+1|0}while((0|a)<(0|A[r>>2]))}if(f=0|Qe(0|t,0|e,45),C(),(s=127&f)>>>0>121)return 0|(i=5);o=0|Ft(t,e),a=0|Qe(0|t,0|e,52),C(),a&=15;t:do{if(a){for(;;){if(c=0|Qe(0|t,0|e,0|(u=3*(15-a|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(p=!(0|Vt(a)),a=a+-1|0,h=0|ze(7,0,0|u),e&=~C(),t=0|ze(0|A[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|t&~h,e|=u=0|C(),!(n=0|A[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!a){l=8;break t}}return 0|e}l=8}while(0);8==(0|l)&&(t|=0|ze(0|(p=0|A[848+(28*s|0)+(n<<2)>>2]),0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+(n<<2)>>2],127&~p||(p=0|ze(0|A[848+(28*s|0)+20>>2],0,45),e=C()|-1040385&e,n=0|A[4272+(28*s|0)+20>>2],t=0|Ut(p|t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]))),c=0|Qe(0|t,0|e,45),C(),c&=127;t:do{if(0|U(c)){e:do{if(1==(0|Ft(t,e))){if((0|s)!=(0|c)){if(0|q(c,0|A[7696+(28*s|0)>>2])){t=0|zt(t,e),u=1,e=0|C();break}x(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ut(t,e),e=0|C(),A[r>>2]=1+(0|A[r>>2]),u=0;break e;case 5:t=0|zt(t,e),e=0|C(),A[r>>2]=5+(0|A[r>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){a=0;do{t=0|Gt(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}if((0|s)!=(0|c)){if(!(0|Q(c))){if(!!(0|u)|5!=(0|Ft(t,e)))break;A[r>>2]=1+(0|A[r>>2]);break}switch(127&f){case 8:case 118:break t}3!=(0|Ft(t,e))&&(A[r>>2]=1+(0|A[r>>2]))}}else if((0|n)>0){a=0;do{t=0|Ut(t,e),e=0|C(),a=a+1|0}while((0|a)!=(0|n))}}while(0);return A[r>>2]=((0|A[r>>2])+n|0)%6|0,A[(p=i)>>2]=t,A[p+4>>2]=e,0|(p=0)}function F(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0;for(s=M,M=M+16|0,i=s,o=s+8|0,a=(a=!(0|Bt(t|=0,e|=0)))?1:2;;){if(A[o>>2]=0,!(0|B(t,e,a,o,i))&((0|A[(u=i)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0)){t=4;break}if((a=a+1|0)>>>0>=7){a=7,t=4;break}}return 4==(0|t)?(M=s,0|a):0}function G(t,e,n,r,o,s,a){e|=0,n|=0,r|=0,o|=0,s|=0,a|=0;var u,c,l,f,h,p,d,g,y,_,m=0,v=0,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,P=0,R=0,k=0,B=0,F=0,G=0;if(_=M,M=M+64|0,d=_+48|0,g=_+32|0,y=_+24|0,u=_+8|0,c=_,(0|(v=0|A[(t|=0)>>2]))<=0)return M=_,0|(R=0);for(l=t+4|0,f=d+8|0,h=g+8|0,p=u+8|0,m=0,O=0;;){T=(E=0|A[l>>2])+(O<<4)|0,A[d>>2]=A[T>>2],A[d+4>>2]=A[T+4>>2],A[d+8>>2]=A[T+8>>2],A[d+12>>2]=A[T+12>>2],(0|O)==(v+-1|0)?(A[g>>2]=A[E>>2],A[g+4>>2]=A[E+4>>2],A[g+8>>2]=A[E+8>>2],A[g+12>>2]=A[E+12>>2]):(T=E+(O+1<<4)|0,A[g>>2]=A[T>>2],A[g+4>>2]=A[T+4>>2],A[g+8>>2]=A[T+8>>2],A[g+12>>2]=A[T+12>>2]),v=0|W(d,g,r,y);t:do{if(v)E=0,m=v;else if(v=0|A[(E=y)>>2],(0|(E=0|A[E+4>>2]))>0|!(0|E)&v>>>0>0){L=0,T=0;e:for(;;){if(G=+i[d>>3],F=+((D=0|Oe(0|v,0|E,0|L,0|T))>>>0)+4294967296*+(0|C()),k=+(v>>>0)+4294967296*+(0|E),B=+(L>>>0)+4294967296*+(0|T),i[u>>3]=G*F/k+ +i[g>>3]*B/k,i[p>>3]=+i[f>>3]*F/k+ +i[h>>3]*B/k,0|(v=0|qt(u,r,c))){m=v;break}I=0|Ge(0|(S=0|A[(D=c)>>2]),0|(D=0|A[D+4>>2]),0|e,0|n),w=0|C(),E=0|A[(b=v=a+(I<<3)|0)>>2],b=0|A[b+4>>2];n:do{if(!(0|E)&!(0|b))P=v,R=16;else for(x=0,N=0;;){if((0|x)>(0|n)|(0|x)==(0|n)&N>>>0>e>>>0){m=1;break e}if((0|E)==(0|S)&(0|b)==(0|D))break n;if(I=0|Fe(0|(v=0|Me(0|I,0|w,1,0)),0|C(),0|e,0|n),w=0|C(),N=0|Me(0|N,0|x,1,0),x=0|C(),!(0|(E=0|A[(b=v=a+(I<<3)|0)>>2]))&!(0|(b=0|A[b+4>>2]))){P=v,R=16;break}}}while(0);if(16!=(0|R)||(R=0,!(0|S)&!(0|D))||(A[(N=P)>>2]=S,A[N+4>>2]=D,N=s+(A[o>>2]<<3)|0,A[N>>2]=S,A[N+4>>2]=D,N=0|Me(0|A[(N=o)>>2],0|A[N+4>>2],1,0),S=0|C(),A[(D=o)>>2]=N,A[D+4>>2]=S),L=0|Me(0|L,0|T,1,0),T=0|C(),v=0|A[(E=y)>>2],!((0|(E=0|A[E+4>>2]))>(0|T)|(0|E)==(0|T)&v>>>0>L>>>0)){E=1;break t}}E=0}else E=1}while(0);if(O=O+1|0,!E){R=21;break}if((0|O)>=(0|(v=0|A[t>>2]))){m=0,R=21;break}}return 21==(0|R)?(M=_,0|m):0}function U(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|A[7696+(28*t|0)+16>>2])}function Q(t){return 4==(0|(t|=0))|117==(0|t)}function z(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)>>2]}function V(t){return 0|A[11120+(216*(0|A[(t|=0)>>2])|0)+(72*(0|A[t+4>>2])|0)+(24*(0|A[t+8>>2])|0)+(A[t+12>>2]<<3)+4>>2]}function q(t,e){return e|=0,(0|A[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|A[7696+(28*t|0)+24>>2])==(0|e))}function Y(t,e){return 0|A[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function j(t,e){return e|=0,(0|A[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|A[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|A[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|A[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|A[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|A[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|A[848+(28*t|0)+24>>2])==(0|e)?6:7)}function H(t){return+i[(t|=0)+16>>3]<+i[t+24>>3]|0}function X(t,e){t|=0;var n,r,A=0;return(A=+i[(e|=0)>>3])>=+i[t+8>>3]&&A<=+i[t>>3]?(n=+i[t+16>>3],A=+i[t+24>>3],e=(r=+i[e+8>>3])>=A,t=r<=n&1,n<A?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function $(t,e,n){t|=0,e|=0,n|=0;var r,s,c,l,f,h,p,d=0,g=0,y=0,_=0,v=0,w=0,b=0;h=M,M=M+288|0,f=h+264|0,_=h+96|0,g=(d=y=h)+96|0;do{A[d>>2]=0,d=d+4|0}while((0|d)<(0|g));return 0|(e=0|$t(e,y))?(M=h,0|(w=e)):(Ht(y=0|A[(g=y)>>2],g=0|A[g+4>>2],f),Xt(y,g,_),l=+te(f,_+8|0),i[f>>3]=+i[t>>3],i[(g=f+8|0)>>3]=+i[t+16>>3],i[_>>3]=+i[t+8>>3],i[(y=_+8|0)>>3]=+i[t+24>>3],s=+te(f,_),b=+i[g>>3]-+i[y>>3],c=+u(+b),p=+i[f>>3]-+i[_>>3],r=+u(+p),!(0==b|0==p)&&(b=+Ve(+c,+r),b=+m(+s*s/+qe(+b/+qe(+c,+r),3)/(l*(2.59807621135*l)*.8)),i[o>>3]=b,v=~~b>>>0,w=+u(b)>=1?b>0?~~+E(+a(b/4294967296),4294967295)>>>0:~~+m((b-+(~~b>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2])?(_=!(0|v)&!(0|w),A[(e=n)>>2]=_?1:v,A[e+4>>2]=_?0:w,e=0):e=1,M=h,0|(w=e))}function W(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,l,f,h=0,p=0,d=0;f=M,M=M+288|0,c=f+264|0,l=f+96|0,s=(h=p=f)+96|0;do{A[h>>2]=0,h=h+4|0}while((0|h)<(0|s));return 0|(n=0|$t(n,p))?(M=f,0|(r=n)):(Ht(h=0|A[(n=p)>>2],n=0|A[n+4>>2],c),Xt(h,n,l),d=+te(c,l+8|0),d=+m(+ +te(t,e)/(2*d)),i[o>>3]=d,n=~~d>>>0,h=+u(d)>=1?d>0?~~+E(+a(d/4294967296),4294967295)>>>0:~~+m((d-+(~~d>>>0))/4294967296)>>>0:0,2146435072&~A[o+4>>2]?(p=!(0|n)&!(0|h),A[r>>2]=p?1:n,A[r+4>>2]=p?0:h,M=f,0|(r=0)):(M=f,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,A[(t|=0)>>2]=e,A[t+4>>2]=n,A[t+8>>2]=r}function Z(t,e){t|=0;var n,r,o,s,a=0,c=0,l=0,f=0,h=0,p=0,d=0;A[(s=(e|=0)+8|0)>>2]=0,r=+i[t>>3],f=+u(+r),o=+i[t+8>>3],f+=.5*(h=+u(+o)/.8660254037844386),f-=+(0|(a=~~f)),h-=+(0|(t=~~h));do{if(f<.5){if(f<.3333333333333333){if(A[e>>2]=a,h<.5*(f+1)){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(t=(1&!(h<(d=1-f)))+t|0,A[e+4>>2]=t,d<=h&h<2*f){a=a+1|0,A[e>>2]=a;break}A[e>>2]=a;break}if(!(f<.6666666666666666)){if(a=a+1|0,A[e>>2]=a,h<.5*f){A[e+4>>2]=t;break}t=t+1|0,A[e+4>>2]=t;break}if(h<1-f){if(A[e+4>>2]=t,2*f-1<h){A[e>>2]=a;break}}else t=t+1|0,A[e+4>>2]=t;a=a+1|0,A[e>>2]=a}while(0);do{if(r<0){if(1&t){a=~~(+(0|a)-(2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))+1)),A[e>>2]=a;break}a=~~(+(0|a)-2*(+((p=0|Oe(0|a,((0|a)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|C()))),A[e>>2]=a;break}}while(0);p=e+4|0,o<0&&(a=a-((1|t<<1)/2|0)|0,A[e>>2]=a,t=0-t|0,A[p>>2]=t),c=t-a|0,(0|a)<0?(l=0-a|0,A[p>>2]=c,A[s>>2]=l,A[e>>2]=0,t=c,a=0):l=0,(0|t)<0&&(a=a-t|0,A[e>>2]=a,l=l-t|0,A[s>>2]=l,A[p>>2]=0,t=0),n=a-l|0,c=t-l|0,(0|l)<0&&(A[e>>2]=n,A[p>>2]=c,A[s>>2]=0,t=c,a=n,l=0),(0|(c=(0|l)<(0|(c=(0|t)<(0|a)?t:a))?l:c))<=0||(A[e>>2]=a-c,A[p>>2]=t-c,A[s>>2]=l-c)}function J(t){var e,n=0,r=0,i=0,o=0,s=0;n=0|A[(t|=0)>>2],r=0|A[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,A[e>>2]=r,A[(s=t+8|0)>>2]=(0|A[s>>2])-n,A[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,A[t>>2]=n,o=(0|A[(s=t+8|0)>>2])-r|0,A[s>>2]=o,A[e>>2]=0,r=0):(s=o=t+8|0,o=0|A[o>>2]),(0|o)<0&&(n=n-o|0,A[t>>2]=n,r=r-o|0,A[e>>2]=r,A[s>>2]=0,o=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(A[t>>2]=n-i,A[e>>2]=r-i,A[s>>2]=o-i)}function tt(t,e){e|=0;var n,r;r=0|A[(t|=0)+8>>2],n=+((0|A[t+4>>2])-r|0),i[e>>3]=+((0|A[t>>2])-r|0)-.5*n,i[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[e>>2])+(0|A[t>>2]),A[n+4>>2]=(0|A[e+4>>2])+(0|A[t+4>>2]),A[n+8>>2]=(0|A[e+8>>2])+(0|A[t+8>>2])}function nt(t,e,n){t|=0,e|=0,A[(n|=0)>>2]=(0|A[t>>2])-(0|A[e>>2]),A[n+4>>2]=(0|A[t+4>>2])-(0|A[e+4>>2]),A[n+8>>2]=(0|A[t+8>>2])-(0|A[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|v(0|A[(t|=0)>>2],e),A[t>>2]=r,n=0|v(0|A[(r=t+4|0)>>2],e),A[r>>2]=n,e=0|v(0|A[(t=t+8|0)>>2],e),A[t>>2]=e}function At(t){var e,n,r=0,i=0,o=0,s=0,a=0;a=(0|(n=0|A[(t|=0)>>2]))<0,t=(t=(i=(0|(s=((e=(0|(o=(0|A[t+4>>2])-(a?n:0)|0))<0)?0-o|0:0)+((0|A[t+8>>2])-(a?n:0))|0))<0)?0:s)-((o=(0|(i=(0|t)<(0|(i=(0|(r=(e?0:o)-(i?s:0)|0))<(0|(s=(a?0:n)-(e?o:0)-(i?s:0)|0))?r:s))?t:i))>0)?i:0)|0,r=r-(o?i:0)|0;t:do{switch(s-(o?i:0)|0){case 0:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?1:7:0);case 1:return 0|(a=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(a=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(a=7)}function it(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(a=1)}else{if((-2147483648-s|0)>(0|s))return 0|(a=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(a=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1)}else if((-2147483648-o|0)>(0|o))return 0|(a=1);if(i=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(a=1)}else if((-2147483648^n)<(0|o))return 0|(a=1);if(r){if(!((2147483647-s|0)<(0|i))){r=i;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|i))){r=i;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);i=0|Se(+(n-o|0)/7),A[t>>2]=i,o=0|Se(+(r+s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,355,22455)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function ot(t){var e,n=0,r=0,i=0,o=0,s=0,a=0;o=0|A[(e=(t|=0)+8|0)>>2],s=(0|A[t>>2])-o|0,o=(0|A[(a=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(a=1)}else if((-2147483648-s|0)>(0|s))return 0|(a=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(a=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(a=1)}else{if((-2147483648-o|0)>(0|o))return 0|(a=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(a=1)}if(i=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(a=1)}else if((-2147483648-n|0)>(0|o))return 0|(a=1);if((0|o)>-1){if((-2147483648|i)<(0|s)){r=i;break}return 0|(n=1)}if(!((-2147483648^i)<(0|s))){r=i;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);i=0|Se(+(n+o|0)/7),A[t>>2]=i,o=0|Se(+(r-s|0)/7),A[a>>2]=o,A[e>>2]=0,n=(r=(0|o)<(0|i))?i:o,r=r?o:i;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;x(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&x(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;x(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;x(23313,22444,404,22469)}}}while(0);return n=o-i|0,(0|i)<0?(r=0-i|0,A[a>>2]=n,A[e>>2]=r,A[t>>2]=0,i=0):(n=o,r=0),(0|n)<0&&(i=i-n|0,A[t>>2]=i,r=r-n|0,A[e>>2]=r,A[a>>2]=0,n=0),s=i-r|0,o=n-r|0,(0|r)<0?(A[t>>2]=s,A[a>>2]=o,A[e>>2]=0,n=o,o=s,r=0):o=i,(0|(i=(0|r)<(0|(i=(0|n)<(0|o)?n:o))?r:i))<=0||(A[t>>2]=o-i,A[a>>2]=n-i,A[e>>2]=r-i),0|(a=0)}function st(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+((3*(r=(0|A[t>>2])-i|0)|0)-(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((i<<1)+r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function at(t){var e,n,r=0,i=0,o=0,s=0,a=0;i=0|A[(e=(t|=0)+8|0)>>2],o=0|Se(+(((r=(0|A[t>>2])-i|0)<<1)+(i=(0|A[(n=t+4|0)>>2])-i|0)|0)/7),A[t>>2]=o,r=0|Se(+((3*i|0)-r|0)/7),A[n>>2]=r,A[e>>2]=0,i=r-o|0,(0|o)<0?(a=0-o|0,A[n>>2]=i,A[e>>2]=a,A[t>>2]=0,r=i,o=0,i=a):i=0,(0|r)<0&&(o=o-r|0,A[t>>2]=o,i=i-r|0,A[e>>2]=i,A[n>>2]=0,r=0),a=o-i|0,s=r-i|0,(0|i)<0?(A[t>>2]=a,A[n>>2]=s,A[e>>2]=0,r=s,s=a,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|s)?r:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=r-o,A[e>>2]=i-o)}function ut(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(3*i|0)|0,A[t>>2]=a,o=s+(3*o|0)|0,A[n>>2]=o,i=(3*s|0)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ct(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(3*(i=0|A[(n=t+4|0)>>2])|0)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(3*a|0)|0,A[t>>2]=a,A[n>>2]=s,i=(3*o|0)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function lt(t,e){t|=0;var n,r,i,o=0,s=0,a=0;((e|=0)+-1|0)>>>0>=6||(a=(0|A[15440+(12*e|0)>>2])+(0|A[t>>2])|0,A[t>>2]=a,i=t+4|0,s=(0|A[15440+(12*e|0)+4>>2])+(0|A[i>>2])|0,A[i>>2]=s,r=t+8|0,e=(0|A[15440+(12*e|0)+8>>2])+(0|A[r>>2])|0,A[r>>2]=e,o=s-a|0,(0|a)<0?(e=e-a|0,A[i>>2]=o,A[r>>2]=e,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,e=e-o|0,A[r>>2]=e,A[i>>2]=0,o=0),n=s-e|0,a=o-e|0,(0|e)<0?(A[t>>2]=n,A[i>>2]=a,A[r>>2]=0,s=n,e=0):a=o,(0|(o=(0|e)<(0|(o=(0|a)<(0|s)?a:s))?e:o))<=0||(A[t>>2]=s-o,A[i>>2]=a-o,A[r>>2]=e-o))}function ft(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=(i=0|A[(n=t+4|0)>>2])+a|0,a=(o=0|A[(r=t+8|0)>>2])+a|0,A[t>>2]=a,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function ht(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],s=0|A[(n=t+4|0)>>2],o=0|A[(r=t+8|0)>>2],a=s+i|0,A[t>>2]=a,s=o+s|0,A[n>>2]=s,i=o+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,s=0):(o=s,s=a),(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function pt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function dt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function gt(t){var e,n,r,i=0,o=0,s=0,a=0;i=0|A[(t|=0)>>2],o=0|A[(n=t+4|0)>>2],s=0|A[(r=t+8|0)>>2],a=o+(i<<1)|0,A[t>>2]=a,o=s+(o<<1)|0,A[n>>2]=o,i=(s<<1)+i|0,A[r>>2]=i,s=o-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=s,A[r>>2]=i,A[t>>2]=0,o=s,s=0):s=a,(0|o)<0&&(s=s-o|0,A[t>>2]=s,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=s-i|0,a=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=a,A[r>>2]=0,s=e,i=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(A[t>>2]=s-o,A[n>>2]=a-o,A[r>>2]=i-o)}function yt(t){var e,n,r,i=0,o=0,s=0,a=0;a=0|A[(t|=0)>>2],s=((i=0|A[(n=t+4|0)>>2])<<1)+a|0,a=(o=0|A[(r=t+8|0)>>2])+(a<<1)|0,A[t>>2]=a,A[n>>2]=s,i=(o<<1)+i|0,A[r>>2]=i,o=s-a|0,(0|a)<0?(i=i-a|0,A[n>>2]=o,A[r>>2]=i,A[t>>2]=0,a=0):o=s,(0|o)<0&&(a=a-o|0,A[t>>2]=a,i=i-o|0,A[r>>2]=i,A[n>>2]=0,o=0),e=a-i|0,s=o-i|0,(0|i)<0?(A[t>>2]=e,A[n>>2]=s,A[r>>2]=0,a=e,i=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(A[t>>2]=a-o,A[n>>2]=s-o,A[r>>2]=i-o)}function _t(t,e){e|=0;var n,r,i,o=0,s=0,a=0;return i=(0|(r=(0|A[(t|=0)>>2])-(0|A[e>>2])|0))<0,n=(0|(s=(0|A[t+4>>2])-(0|A[e+4>>2])-(i?r:0)|0))<0,e=(e=(t=(0|(a=(i?0-r|0:0)+(0|A[t+8>>2])-(0|A[e+8>>2])+(n?0-s|0:0)|0))<0)?0:a)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?a:0)|0))<(0|(a=(i?0:r)-(n?s:0)-(t?a:0)|0))?o:a))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=a-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function mt(t,e){e|=0;var n;n=0|A[(t|=0)+8>>2],A[e>>2]=(0|A[t>>2])-n,A[e+4>>2]=(0|A[t+4>>2])-n}function vt(t,e){e|=0;var n,r,i,o=0,s=0,a=0;s=0|A[(t|=0)>>2],A[e>>2]=s,a=0|A[t+4>>2],A[(r=e+4|0)>>2]=a,A[(i=e+8|0)>>2]=0,t=(o=(0|a)<(0|s))?s:a,o=o?a:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=a-s|0,(0|s)<0?(o=0-s|0,A[r>>2]=t,A[i>>2]=o,A[e>>2]=0,s=0):(t=a,o=0),(0|t)<0&&(s=s-t|0,A[e>>2]=s,o=o-t|0,A[i>>2]=o,A[r>>2]=0,t=0),n=s-o|0,a=t-o|0,(0|o)<0?(A[e>>2]=n,A[r>>2]=a,A[i>>2]=0,t=a,a=n,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|a)?t:a))?o:s))<=0||(A[e>>2]=a-s,A[r>>2]=t-s,A[i>>2]=o-s),0|(e=0)}function Et(t){var e,n,r,i;n=(i=0|A[(e=(t|=0)+8|0)>>2])-(0|A[t>>2])|0,A[t>>2]=n,t=(0|A[(r=t+4|0)>>2])-i|0,A[r>>2]=t,A[e>>2]=0-(t+n)}function wt(t){var e,n,r=0,i=0,o=0,s=0,a=0;r=0-(i=0|A[(t|=0)>>2])|0,A[t>>2]=r,A[(e=t+8|0)>>2]=0,s=(o=0|A[(n=t+4|0)>>2])+i|0,(0|i)>0?(A[n>>2]=s,A[e>>2]=i,A[t>>2]=0,r=0,o=s):i=0,(0|o)<0?(a=r-o|0,A[t>>2]=a,i=i-o|0,A[e>>2]=i,A[n>>2]=0,s=a-i|0,r=0-i|0,(0|i)<0?(A[t>>2]=s,A[n>>2]=r,A[e>>2]=0,o=r,i=0):(o=0,s=a)):s=r,(0|(r=(0|i)<(0|(r=(0|o)<(0|s)?o:s))?i:r))<=0||(A[t>>2]=s-r,A[n>>2]=o-r,A[e>>2]=i-r)}function bt(t,e,n){n|=0;var r,i,o=0,s=0;return i=M,M=M+16|0,r=i,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|Qe(0|(t|=0),0|e,56),C(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,i=0,o=0;if(o=M,M=M+16|0,i=o,r=0|Bt(t,e),(n+-1|0)>>>0>5)return M=o,0|(i=-1);if(r=!!(0|r),1==(0|n)&r)return M=o,0|(i=-1);do{if(!(0|me(t,e,i))){if(r){r=(5+(0|A[21936+(n<<2)>>2])-(0|A[i>>2])|0)%5|0;break}r=(6+(0|A[21968+(n<<2)>>2])-(0|A[i>>2])|0)%6|0;break}r=-1}while(0);return i=r,M=o,0|i}(t,s,7&o),-1==(0|o)?(A[n>>2]=0,M=i,0|(s=6)):(0|jt(t,s,r)&&x(23313,22484,282,22499),e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,s)?Nt(r,e,o,2,n):Tt(r,e,o,2,n),M=i,0|(s=0))):(M=i,0|(s=6))}function It(t,e,n,r){e|=0,r|=0;var o,s=0,a=0,u=0,c=0;if(o=M,M=M+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=M,M=M+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,A=0;n=+i[t>>3],r=+f(+n),n=+h(+n),i[e+16>>3]=n,n=+i[t+8>>3],A=r*+f(+n),i[e>>3]=A,n=r*+h(+n),i[e+8>>3]=n}(t,o),A[e>>2]=0,i[n>>3]=5,r=+_e(16400,o),r<+i[n>>3]&&(A[e>>2]=0,i[n>>3]=r);r=+_e(16424,o),r<+i[n>>3]&&(A[e>>2]=1,i[n>>3]=r);r=+_e(16448,o),r<+i[n>>3]&&(A[e>>2]=2,i[n>>3]=r);r=+_e(16472,o),r<+i[n>>3]&&(A[e>>2]=3,i[n>>3]=r);r=+_e(16496,o),r<+i[n>>3]&&(A[e>>2]=4,i[n>>3]=r);r=+_e(16520,o),r<+i[n>>3]&&(A[e>>2]=5,i[n>>3]=r);r=+_e(16544,o),r<+i[n>>3]&&(A[e>>2]=6,i[n>>3]=r);r=+_e(16568,o),r<+i[n>>3]&&(A[e>>2]=7,i[n>>3]=r);r=+_e(16592,o),r<+i[n>>3]&&(A[e>>2]=8,i[n>>3]=r);r=+_e(16616,o),r<+i[n>>3]&&(A[e>>2]=9,i[n>>3]=r);r=+_e(16640,o),r<+i[n>>3]&&(A[e>>2]=10,i[n>>3]=r);r=+_e(16664,o),r<+i[n>>3]&&(A[e>>2]=11,i[n>>3]=r);r=+_e(16688,o),r<+i[n>>3]&&(A[e>>2]=12,i[n>>3]=r);r=+_e(16712,o),r<+i[n>>3]&&(A[e>>2]=13,i[n>>3]=r);r=+_e(16736,o),r<+i[n>>3]&&(A[e>>2]=14,i[n>>3]=r);r=+_e(16760,o),r<+i[n>>3]&&(A[e>>2]=15,i[n>>3]=r);r=+_e(16784,o),r<+i[n>>3]&&(A[e>>2]=16,i[n>>3]=r);r=+_e(16808,o),r<+i[n>>3]&&(A[e>>2]=17,i[n>>3]=r);r=+_e(16832,o),r<+i[n>>3]&&(A[e>>2]=18,i[n>>3]=r);if(r=+_e(16856,o),!(r<+i[n>>3]))return void(M=s);A[e>>2]=19,i[n>>3]=r,M=s}(t|=0,n|=0,c=o),(a=+d(+(1-.5*+i[c>>3])))<1e-16)return A[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=0,A[r+12>>2]=0,void(M=o);if(c=0|A[n>>2],s=+Zt((s=+i[15920+(24*c|0)>>3])-+Zt(+function(t,e){t|=0,e|=0;var n=0,r=0,A=0,o=0,s=0;return o=+i[e>>3],r=+f(+o),A=+i[e+8>>3]-+i[t+8>>3],s=r*+h(+A),n=+i[t>>3],+ +_(+s,+(+h(+o)*+f(+n)-+f(+A)*(r*+h(+n))))}(15600+(c<<4)|0,t))),u=0|Vt(e)?+Zt(s+-.3334731722518321):s,s=+p(+a)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}a=+f(+u)*s,i[r>>3]=a,u=+h(+u)*s,i[r+8>>3]=u,M=o}function Ct(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,a=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+i[t>>3],e=+i[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,A[o>>2]=A[e>>2],A[o+4>>2]=A[e+4>>2],A[o+8>>2]=A[e+8>>2],void(A[o+12>>2]=A[e+12>>2]);if(a=+_(+ +i[t+8>>3],+ +i[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Vt(n)),s=+y(.381966011250105*(n?s:s/2.6457513110645907))):(s=+y(.381966011250105*s),0|Vt(n)&&(a=+Zt(a+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,a=0,c=0;if(n<1e-16)return A[r>>2]=A[t>>2],A[r+4>>2]=A[t+4>>2],A[r+8>>2]=A[t+8>>2],void(A[r+12>>2]=A[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+u(+(s+-3.141592653589793))<1e-16,e=+i[t>>3],o){e-=n,i[r>>3]=e,o=r;break}if(a=+f(+n),n=+h(+n),e=a*+h(+e)+ +f(+s)*(n*+f(+e)),e=+g(+((e=e>1?1:e)<-1?-1:e)),i[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return i[r>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[r>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(c=+f(+e),s=n*+h(+s)/c,n=+i[t>>3],e=(a-+h(+e)*+h(+n))/+f(+n)/c,a=s>1?1:s,e=e>1?1:e,(e=+i[t+8>>3]+ +_(+(a<-1?-1:a),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(i[r+8>>3]=e)}e=+i[t>>3]+n,i[r>>3]=e,o=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return i[o>>3]=1.5707963267948966,void(i[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return i[o>>3]=-1.5707963267948966,void(i[r+8>>3]=0);if(e=+i[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);i[r+8>>3]=e}(15600+(e<<4)|0,+Zt(+i[15920+(24*e|0)>>3]-a),s,o)}function xt(t,e,n){e|=0,n|=0;var r,i;r=M,M=M+16|0,tt((t|=0)+4|0,i=r),Ct(i,0|A[t>>2],e,0,n),M=r}function Nt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,E,w,b,I,C,N,S,D,L=0,T=0,O=0,P=0,R=0,k=0;if(D=M,M=M+272|0,P=D+240|0,C=D,N=D+224|0,S=D+208|0,y=D+176|0,_=D+160|0,m=D+192|0,v=D+144|0,E=D+128|0,w=D+112|0,b=D+96|0,I=D+80|0,A[(L=D+256|0)>>2]=e,A[P>>2]=A[t>>2],A[P+4>>2]=A[t+4>>2],A[P+8>>2]=A[t+8>>2],A[P+12>>2]=A[t+12>>2],St(P,L,C),A[o>>2]=0,(0|(P=r+n+(5==(0|r)&1)|0))<=(0|n))M=D;else{a=N+4|0,u=y+4|0,c=n+5|0,l=16880+((s=0|A[L>>2])<<2)|0,f=16960+(s<<2)|0,h=E+8|0,p=w+8|0,d=b+8|0,g=S+4|0,O=n;t:for(;;){T=C+((0|O)%5<<4)|0,A[S>>2]=A[T>>2],A[S+4>>2]=A[T+4>>2],A[S+8>>2]=A[T+8>>2],A[S+12>>2]=A[T+12>>2];do{}while(2==(0|Dt(S,s,0,1)));if((0|O)>(0|n)&!!(0|Vt(e))){if(A[y>>2]=A[S>>2],A[y+4>>2]=A[S+4>>2],A[y+8>>2]=A[S+8>>2],A[y+12>>2]=A[S+12>>2],tt(a,_),r=0|A[y>>2],L=0|A[17040+(80*r|0)+(A[N>>2]<<2)>>2],A[y>>2]=A[18640+(80*r|0)+(20*L|0)>>2],(0|(T=0|A[18640+(80*r|0)+(20*L|0)+16>>2]))>0){t=0;do{ft(u),t=t+1|0}while((0|t)<(0|T))}switch(T=18640+(80*r|0)+(20*L|0)+4|0,A[m>>2]=A[T>>2],A[m+4>>2]=A[T+4>>2],A[m+8>>2]=A[T+8>>2],rt(m,3*(0|A[l>>2])|0),et(u,m,u),J(u),tt(u,v),R=+(0|A[f>>2]),i[E>>3]=3*R,i[h>>3]=0,k=-1.5*R,i[w>>3]=k,i[p>>3]=2.598076211353316*R,i[b>>3]=k,i[d>>3]=-2.598076211353316*R,0|A[17040+(80*(0|A[y>>2])|0)+(A[S>>2]<<2)>>2]){case 1:t=w,r=E;break;case 3:t=b,r=w;break;case 2:t=E,r=b;break;default:t=12;break t}ge(_,v,r,t,I),Ct(I,0|A[y>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])}if((0|O)<(0|c)&&(tt(g,y),Ct(y,0|A[S>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),A[N>>2]=A[S>>2],A[N+4>>2]=A[S+4>>2],A[N+8>>2]=A[S+8>>2],A[N+12>>2]=A[S+12>>2],(0|(O=O+1|0))>=(0|P)){t=3;break}}3!=(0|t)?12==(0|t)&&x(22522,22569,571,22579):M=D}}function St(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+128|0,o=r,a=20240,u=(s=i=r+64|0)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20304,u=(s=o)+60|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,n=n+68|0),J(n),M=r}function Dt(t,e,n,r){n|=0,r|=0;var i,o,s,a,u,c,l=0,f=0,h=0,p=0,d=0;if(c=M,M=M+32|0,u=c+12|0,o=c,d=(t|=0)+4|0,p=0|A[16960+((e|=0)<<2)>>2],p=(a=!!(0|r))?3*p|0:p,l=0|A[d>>2],i=0|A[(s=t+8|0)>>2],a){if((0|(l=i+l+(r=0|A[(f=t+12|0)>>2])|0))==(0|p))return M=c,0|(d=1);h=f}else l=i+l+(r=0|A[(h=t+12|0)>>2])|0;if((0|l)<=(0|p))return M=c,0|(d=0);do{if((0|r)>0){if(r=0|A[t>>2],(0|i)>0){f=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(u,p,0,0),nt(d,u,o),ht(o),et(o,u,d),f=r,r=t):(f=r,r=t)}else f=18640+(80*(0|A[t>>2])|0)+20|0,r=t}while(0);if(A[r>>2]=A[f>>2],(0|A[(l=f+16|0)>>2])>0){r=0;do{ft(d),r=r+1|0}while((0|r)<(0|A[l>>2]))}return t=f+4|0,A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],e=0|A[16880+(e<<2)>>2],rt(u,a?3*e|0:e),et(d,u,d),J(d),r=a&&((0|A[s>>2])+(0|A[d>>2])+(0|A[h>>2])|0)==(0|p)?1:2,M=c,0|(d=r)}function Lt(t,e){t|=0,e|=0;var n=0;do{n=0|Dt(t,e,0,1)}while(2==(0|n));return 0|n}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,a,u,c,l,f,h,p,d,g,y,_,m,v,E,w,b,I,C=0,N=0,S=0,D=0,L=0;if(I=M,M=M+240|0,v=I+208|0,E=I,w=I+192|0,b=I+176|0,d=I+160|0,g=I+144|0,y=I+128|0,_=I+112|0,m=I+96|0,A[(C=I+224|0)>>2]=e,A[v>>2]=A[t>>2],A[v+4>>2]=A[t+4>>2],A[v+8>>2]=A[t+8>>2],A[v+12>>2]=A[t+12>>2],Mt(v,C,E),A[o>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))M=I;else{a=n+6|0,u=16960+((s=0|A[C>>2])<<2)|0,c=g+8|0,l=y+8|0,f=_+8|0,h=w+4|0,N=0,S=n,r=-1;t:for(;;){if(t=E+((C=(0|S)%6|0)<<4)|0,A[w>>2]=A[t>>2],A[w+4>>2]=A[t+4>>2],A[w+8>>2]=A[t+8>>2],A[w+12>>2]=A[t+12>>2],t=N,N=0|Dt(w,s,0,1),(0|S)>(0|n)&!!(0|Vt(e))&&(1!=(0|t)&&(0|A[w>>2])!=(0|r))){switch(tt(E+((C+5|0)%6<<4)+4|0,b),tt(E+(C<<4)+4|0,d),D=+(0|A[u>>2]),i[g>>3]=3*D,i[c>>3]=0,L=-1.5*D,i[y>>3]=L,i[l>>3]=2.598076211353316*D,i[_>>3]=L,i[f>>3]=-2.598076211353316*D,C=0|A[v>>2],0|A[17040+(80*C|0)+(((0|r)==(0|C)?A[w>>2]:r)<<2)>>2]){case 1:t=y,r=g;break;case 3:t=_,r=y;break;case 2:t=g,r=_;break;default:t=8;break t}ge(b,d,r,t,m),0|ye(b,m)||0|ye(d,m)||(Ct(m,0|A[v>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2]))}if((0|S)<(0|a)&&(tt(h,b),Ct(b,0|A[w>>2],s,1,o+8+(A[o>>2]<<4)|0),A[o>>2]=1+(0|A[o>>2])),(0|(S=S+1|0))>=(0|p)){t=3;break}r=0|A[w>>2]}3!=(0|t)?8==(0|t)&&x(22606,22569,736,22651):M=I}}function Mt(t,e,n){t|=0,e|=0,n|=0;var r,i=0,o=0,s=0,a=0,u=0;r=M,M=M+160|0,o=r,a=20368,u=(s=i=r+80|0)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));a=20448,u=(s=o)+72|0;do{A[s>>2]=A[a>>2],s=s+4|0,a=a+4|0}while((0|s)<(0|u));i=(u=!(0|Vt(0|A[e>>2])))?i:o,gt(o=t+4|0),yt(o),0|Vt(0|A[e>>2])&&(ct(o),A[e>>2]=1+(0|A[e>>2])),A[n>>2]=A[t>>2],et(o,i,e=n+4|0),J(e),A[n+16>>2]=A[t>>2],et(o,i+12|0,e=n+20|0),J(e),A[n+32>>2]=A[t>>2],et(o,i+24|0,e=n+36|0),J(e),A[n+48>>2]=A[t>>2],et(o,i+36|0,e=n+52|0),J(e),A[n+64>>2]=A[t>>2],et(o,i+48|0,e=n+68|0),J(e),A[n+80>>2]=A[t>>2],et(o,i+60|0,n=n+84|0),J(n),M=r}function Ot(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),45),C(),127&e}function Pt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|Qe(0|(t|=0),0|e,45),C(),(o&=127)>>>0>121)return 0|(e=0);n=0|Qe(0|t,0|e,52),C(),n&=15;do{if(0|n){for(A=1,r=0;;){if(i=0|Qe(0|t,0|e,3*(15-A|0)|0),C(),!!(0|(i&=7))&(1^r)){if(1==(0|i)&!!(0|U(o))){s=0,r=13;break}r=1}if(7==(0|i)){s=0,r=13;break}if(!(A>>>0<n>>>0)){r=9;break}A=A+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Qe(0|t,0|e,3*(14-n|0)|0),C(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Rt(t,e,n,r){n|=0,r|=0;var i=0,o=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return A[r>>2]=t,A[r+4>>2]=e,0|(r=0);if(i=0|ze(0|n,0,52),i|=t,t=C()|-15728641&e,(0|o)>(0|n))do{e=0|ze(7,0,3*(14-n|0)|0),n=n+1|0,i|=e,t=C()|t}while((0|n)<(0|o));return A[r>>2]=i,A[r+4>>2]=t,0|(r=0)}function kt(t,e,n,r){n|=0,r|=0;var i=0,o=0,s=0;if(o=0|Qe(0|(t|=0),0|(e|=0),52),C(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);i=n-o|0,n=0|Qe(0|t,0|e,45),C();t:do{if(0|U(127&n)){e:do{if(0|o){for(n=1;!((s=0|ze(7,0,3*(15-n|0)|0))&t)&!(C()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C();break t}}while(0);n=0|Me(0|(n=0|Be(0|(n=0|le(7,0,i,((0|i)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),n=0|Me(0|(n=0|ke(0|n,0|C(),6,0)),0|C(),1,0),i=0|C()}else n=0|le(7,0,i,((0|i)<0)<<31>>31),i=0|C()}while(0);return A[(s=r)>>2]=n,A[s+4>>2]=i,0|(s=0)}function Bt(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&A)))return 0|(A=0);A=0|Qe(0|t,0|e,52),C(),A&=15;t:do{if(A)for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7))break t;if(!(r>>>0<A>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(A=1&!(0|n))}function Ft(t,e){var n=0,r=0,A=0;if(A=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(A&=15))return 0|(A=0);for(r=1;;){if(n=0|Qe(0|t,0|e,3*(15-r|0)|0),C(),0|(n&=7)){r=5;break}if(!(r>>>0<A>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Gt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(A=0|Qe(0|t,0|e,0|(o=3*(15-n|0)|0)),C(),i=0|ze(7,0,0|o),e&=~C(),t=t&~i|(o=0|ze(0|pt(7&A),0,0|o)),e|=C(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return I(0|e),0|t}function Ut(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;o=0|Qe(0|t,0|e,0|(i=3*(15-n|0)|0)),C(),A=0|ze(7,0,0|i),e&=~C(),t=(i=0|ze(0|pt(7&o),0,0|i))|t&~A,e=C()|e,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Qt(t,e){var n=0,r=0,A=0,i=0,o=0,s=0,a=0;if(a=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(a&=15))return a=t,I(0|(s=e)),0|a;for(s=1,n=0;;){r=0|ze(7,0,0|(i=3*(15-s|0)|0)),A=0|C(),o=0|Qe(0|t,0|e,0|i),C(),t=(i=0|ze(0|dt(7&o),0,0|i))|t&~r,e=(o=0|C())|e&~A;t:do{if(!n)if(!(i&r)&!(o&A))n=0;else if(r=0|Qe(0|t,0|e,52),C(),r&=15){n=1;e:for(;;){switch(o=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ze(7,0,0|(A=3*(15-n|0)|0)),o=e&~C(),e=0|Qe(0|t,0|e,0|A),C(),t=t&~i|(e=0|ze(0|dt(7&e),0,0|A)),e=o|C(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<a>>>0))break;s=s+1|0}return I(0|e),0|t}function zt(t,e){var n=0,r=0,A=0,i=0,o=0;if(r=0|Qe(0|(t|=0),0|(e|=0),52),C(),!(r&=15))return r=t,I(0|(n=e)),0|r;for(n=1;i=0|ze(7,0,0|(o=3*(15-n|0)|0)),A=e&~C(),e=0|Qe(0|t,0|e,0|o),C(),t=(e=0|ze(0|dt(7&e),0,0|o))|t&~i,e=C()|A,n>>>0<r>>>0;)n=n+1|0;return I(0|e),0|t}function Vt(t){return(0|(t|=0))%2|0}function qt(t,e,n){n|=0;var r,i=0;return r=M,M=M+16|0,i=r,(e|=0)>>>0>15?(M=r,0|(i=4)):2146435072&~A[(t|=0)+4>>2]&&2146435072&~A[t+8+4>>2]?(function(t,e,n){var r,A;r=M,M=M+16|0,It(t|=0,e|=0,n|=0,A=r),Z(A,n+4|0),M=r}(t,e,i),e=0|function(t,e){t|=0;var n,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0;if(n=M,M=M+64|0,u=n+40|0,i=n+24|0,o=n+12|0,s=n,ze(0|(e|=0),0,52),r=134225919|C(),!e)return(0|A[t+4>>2])>2||(0|A[t+8>>2])>2||(0|A[t+12>>2])>2?(u=0,I(0|(a=0)),M=n,0|u):(ze(0|z(t),0,45),a=C()|r,u=-1,I(0|a),M=n,0|u);if(A[u>>2]=A[t>>2],A[u+4>>2]=A[t+4>>2],A[u+8>>2]=A[t+8>>2],A[u+12>>2]=A[t+12>>2],a=u+4|0,(0|e)>0)for(t=-1;A[i>>2]=A[a>>2],A[i+4>>2]=A[a+4>>2],A[i+8>>2]=A[a+8>>2],1&e?(st(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ut(o)):(at(a),A[o>>2]=A[a>>2],A[o+4>>2]=A[a+4>>2],A[o+8>>2]=A[a+8>>2],ct(o)),nt(i,o,s),J(s),c=0|ze(7,0,0|(l=3*(15-e|0)|0)),r&=~C(),t=(l=0|ze(0|At(s),0,0|l))|t&~c,r=C()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|A[a>>2])<=2&&(0|A[u+8>>2])<=2&&(0|A[u+12>>2])<=2){if(e=0|ze(0|(i=0|z(u)),0,45),e|=t,t=C()|-1040385&r,s=0|V(u),!(0|U(i))){if((0|s)<=0)break;for(o=0;;){if(i=0|Qe(0|e,0|t,52),C(),i&=15)for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<i>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|Qe(0|e,0|t,52),C(),o&=15;e:do{if(o){r=1;n:for(;;){switch(l=0|Qe(0|e,0|t,3*(15-r|0)|0),C(),7&l){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|q(i,0|A[u>>2]))for(r=1;c=0|ze(7,0,0|(u=3*(15-r|0)|0)),l=t&~C(),t=0|Qe(0|e,0|t,0|u),C(),e=e&~c|(t=0|ze(0|dt(7&t),0,0|u)),t=l|C(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;u=0|Qe(0|e,0|t,0|(l=3*(15-r|0)|0)),C(),c=0|ze(7,0,0|l),t&=~C(),e=e&~c|(l=0|ze(0|pt(7&u),0,0|l)),t|=C(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Gt(e,t),t=0|C(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return l=e,I(0|(c=t)),M=n,0|l}(i,e),i=0|C(),A[n>>2]=e,A[n+4>>2]=i,!(0|e)&!(0|i)&&x(23313,22674,786,22697),M=r,0|(i=0)):(M=r,0|(i=3))}function Yt(t,e,n){var r,i=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|Qe(0|(t|=0),0|(e|=0),52),C(),o&=15,s=0|Qe(0|t,0|e,45),C(),i=!(0|o),0|U(127&s)){if(i)return 0|(s=1);i=1}else{if(i)return 0|(s=0);i=0|A[r>>2]||0|A[n+8>>2]?1:1&!!(0|A[n+12>>2])}for(n=1;1&n?ut(r):ct(r),s=0|Qe(0|t,0|e,3*(15-n|0)|0),C(),lt(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|i}function jt(t,e,n){n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+16|0,r=i,l=0|Qe(0|(t|=0),0|(e|=0),45),C(),(l&=127)>>>0>121)return A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,A[n+12>>2]=0,M=i,0|(l=5);t:do{if(0|U(l)&&(a=0|Qe(0|t,0|e,52),C(),0|(a&=15))){o=1;e:for(;;){switch(c=0|Qe(0|t,0|e,3*(15-o|0)|0),C(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<a>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;u=0|ze(7,0,0|(e=3*(15-s|0)|0)),c=o&~C(),o=0|Qe(0|t,0|o,0|e),C(),t=t&~u|(o=0|ze(0|dt(7&o),0,0|e)),o=c|C(),s>>>0<a>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*l|0)|0,A[n>>2]=A[c>>2],A[n+4>>2]=A[c+4>>2],A[n+8>>2]=A[c+8>>2],A[n+12>>2]=A[c+12>>2],!(0|Yt(t,o,n)))return M=i,0|(l=0);if(u=n+4|0,A[r>>2]=A[u>>2],A[r+4>>2]=A[u+4>>2],A[r+8>>2]=A[u+8>>2],a=0|Qe(0|t,0|o,52),C(),c=15&a,1&a?(ct(u),a=c+1|0):a=c,0|U(l)){t:do{if(c)for(e=1;;){if(s=0|Qe(0|t,0|o,3*(15-e|0)|0),C(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Dt(n,a,o,0)){if(0|U(l))do{}while(0|Dt(n,a,0,0));(0|a)!=(0|c)&&at(u)}else(0|a)!=(0|c)&&(A[u>>2]=A[r>>2],A[u+4>>2]=A[r+4>>2],A[u+8>>2]=A[r+8>>2]);return M=i,0|(l=0)}function Ht(t,e,n){n|=0;var r,A,i=0;return A=M,M=M+16|0,0|(i=0|jt(t|=0,e|=0,r=A))?(M=A,0|i):(i=0|Qe(0|t,0|e,52),C(),xt(r,15&i,n),M=A,0|(i=0))}function Xt(t,e,n){n|=0;var r,A=0,i=0,o=0;if(r=M,M=M+16|0,0|(A=0|jt(t|=0,e|=0,o=r)))return M=r,0|(o=A);A=0|Qe(0|t,0|e,45),C(),A=!(0|U(127&A)),i=0|Qe(0|t,0|e,52),C(),i&=15;t:do{if(!A){if(0|i)for(A=1;;){if(!(!((0|ze(7,0,3*(15-A|0)|0))&t)&!(C()&e)))break t;if(!(A>>>0<i>>>0))break;A=A+1|0}return Nt(o,i,0,5,n),M=r,0|0}}while(0);return Tt(o,i,0,6,n),M=r,0|0}function $t(t,e){e|=0;var n=0,r=0,i=0,o=0,s=0,a=0,u=0;if((t|=0)>>>0>15)return 0|(a=4);if(ze(0|t,0,52),a=134225919|C(),!t){n=0,r=0;do{0|U(r)&&(ze(0|r,0,45),s=a|C(),A[(t=e+(n<<3)|0)>>2]=-1,A[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|U(s)){for(ze(0|s,0,45),r=1,i=-1,o=a|C();i&=~(u=0|ze(7,0,3*(15-r|0)|0)),o&=~C(),(0|r)!=(0|t);)r=r+1|0;A[(u=e+(n<<3)|0)>>2]=i,A[u+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Wt(t,e,n,r){t|=0,r|=0;var i=0,o=0;i=0|Qe(0|(e|=0),0|(n|=0),52),C(),!(0|e)&!(0|n)|(0|r)>15|(0|(i&=15))>(0|r)?(r=-1,i=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,I(0|(n=e)),0|r):(n=0|ze(-1,-1,3+(3*(r-n|0)|0)|0),r=0|ze(0|~n,0|~C(),3*(15-r|0)|0),n=~C()&e,r=~r&t,I(0|n),0|r)}(e,n,i+1|0,r),n=-15728641&C(),e=0|ze(0|r,0,52),r=(o=!(0|Bt(e|=o,n|=C())))?-1:r),A[(o=t)>>2]=e,A[o+4>>2]=n,A[t+8>>2]=i,A[t+12>>2]=r}function Kt(t){var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0;if(!(!(0|(n=0|A[(r=t|=0)>>2]))&!(0|(r=0|A[r+4>>2]))||(i=0|Qe(0|n,0|r,52),C(),n=0|Me(0|(u=0|ze(1,0,3*(15^(i&=15))|0)),0|C(),0|n,0|r),r=0|C(),A[(u=t)>>2]=n,A[u+4>>2]=r,(0|i)<(0|(a=0|A[(u=t+8|0)>>2]))))){for(e=t+12|0,s=i;;){if((0|s)==(0|a)){i=5;break}if(c=(0|s)==(0|A[e>>2]),i=0|Qe(0|n,0|r,0|(o=3*(15-s|0)|0)),C(),c&1==(0|(i&=7))&!0){i=7;break}if(!(7==(0|i)&!0)){i=10;break}if(n=0|Me(0|n,0|r,0|(c=0|ze(1,0,0|o)),0|C()),r=0|C(),A[(c=t)>>2]=n,A[c+4>>2]=r,!((0|s)>(0|a))){i=10;break}s=s+-1|0}if(5==(0|i))return A[(c=t)>>2]=0,A[c+4>>2]=0,A[u>>2]=-1,void(A[e>>2]=-1);if(7==(0|i))return a=0|Me(0|n,0|r,0|(a=0|ze(1,0,0|o)),0|C()),u=0|C(),A[(c=t)>>2]=a,A[c+4>>2]=u,void(A[e>>2]=s+-1)}}function Zt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<17453292519943298e-27?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Be(0|(n=0|le(7,0,t,((0|t)<0)<<31>>31)),0|C(),120,0),t=0|C(),A[e>>2]=2|n,A[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,A,o,s,a=0,u=0,l=0,d=0,g=0,m=0;return m=+i[(e|=0)>>3],o=+i[t>>3],g=+h(.5*(m-o)),l=+i[e+8>>3],A=+i[t+8>>3],d=+h(.5*(l-A)),r=+f(+o),s=+f(+m),d=2*+_(+ +c(+(d=g*g+d*(s*r*d))),+ +c(+(1-d))),g=+i[n>>3],m=+h(.5*(g-m)),a=+i[n+8>>3],l=+h(.5*(a-l)),u=+f(+g),l=2*+_(+ +c(+(l=m*m+l*(s*u*l))),+ +c(+(1-l))),g=+h(.5*(o-g)),a=+h(.5*(A-a)),a=2*+_(+ +c(+(a=g*g+a*(r*u*a))),+ +c(+(1-a))),4*+y(+ +c(+ +p(.5*(u=.5*(d+l+a)))*+p(.5*(u-d))*+p(.5*(u-l))*+p(.5*(u-a))))}function re(t,e,n){n|=0;var r,o,s,a=0,u=0;if(s=M,M=M+192|0,o=s,0|(u=0|Ht(t|=0,e|=0,r=s+168|0)))return M=s,0|(n=u);if(0|Xt(t,e,o)&&x(23313,22742,386,22751),(0|(e=0|A[o>>2]))>0){if(a=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{a+=+ne(o+8+((u=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else a=0;return i[n>>3]=a,M=s,0|(n=0)}function Ae(t){t|=0;var e,n,r=0;return(e=0|Te(1,12))||x(22832,22787,49,22845),0|(r=0|A[(n=t+4|0)>>2])?(A[(r=r+8|0)>>2]=e,A[n>>2]=e,0|e):(0|A[t>>2]&&x(22862,22787,61,22885),A[(r=t)>>2]=e,A[n>>2]=e,0|e)}function ie(t,e){t|=0,e|=0;var n,r;return(r=0|De(24))||x(22899,22787,78,22913),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[r+16>>2]=0,0|(n=0|A[(e=t+4|0)>>2])?(A[n+16>>2]=r,A[e>>2]=r,0|r):(0|A[t>>2]&&x(22928,22787,82,22913),A[t>>2]=r,A[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,i=0;if(t|=0)for(r=1;;){if(0|(e=0|A[t>>2]))do{if(0|(n=0|A[e>>2]))do{i=n,n=0|A[n+16>>2],Le(i)}while(0|n);i=e,e=0|A[e+8>>2],Le(i)}while(0|e);if(e=t,t=0|A[t+8>>2],r||Le(e),!t)break;r=0}}function se(t){var e,n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,C=0,N=0,S=0,D=0,L=0,T=0,M=0,O=0,P=0,R=0,k=0;if(0|A[(a=(t|=0)+8|0)>>2])return 0|(k=1);if(!(s=0|A[t>>2]))return 0|(k=0);r=s,o=0;do{o=o+1|0,r=0|A[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(k=0);(n=0|De(o<<2))||x(22948,22787,317,22967),(e=0|De(o<<5))||x(22989,22787,321,22967),A[t>>2]=0,A[(S=t+4|0)>>2]=0,A[a>>2]=0,o=0,P=0,N=0,g=0;t:for(;;){if(d=0|A[s>>2]){c=0,l=d;do{if(h=+i[l+8>>3],r=l,l=0|A[l+16>>2],f=+i[(a=(p=!(0|l))?d:l)+8>>3],+u(+(h-f))>3.141592653589793){k=14;break}c+=(f-h)*(+i[r>>3]+ +i[a>>3])}while(!p);if(14==(0|k)){k=0,c=0,r=d;do{C=+i[r+8>>3],M=0|A[(O=r+16|0)>>2],I=+i[(M=0|M?M:d)+8>>3],c+=(+i[r>>3]+ +i[M>>3])*((I<0?I+6.283185307179586:I)-(C<0?C+6.283185307179586:C)),r=0|A[(0|r?O:s)>>2]}while(0|r)}c>0?(A[n+(P<<2)>>2]=s,P=P+1|0,a=N,r=g):k=19}else k=19;if(19==(0|k)){k=0;do{if(!o){if(g){a=S,l=g+8|0,r=s,o=t;break}if(0|A[t>>2]){k=27;break t}a=S,l=t,r=s,o=t;break}if(0|A[(r=o+8|0)>>2]){k=21;break t}if(!(o=0|Te(1,12))){k=23;break t}A[r>>2]=o,a=o+4|0,l=o,r=g}while(0);if(A[l>>2]=s,A[a>>2]=s,l=e+(N<<5)|0,p=0|A[s>>2]){for(i[(d=e+(N<<5)+8|0)>>3]=17976931348623157e292,i[(g=e+(N<<5)+24|0)>>3]=17976931348623157e292,i[l>>3]=-17976931348623157e292,i[(y=e+(N<<5)+16|0)>>3]=-17976931348623157e292,w=17976931348623157e292,b=-17976931348623157e292,a=0,_=p,h=17976931348623157e292,v=17976931348623157e292,E=-17976931348623157e292,f=-17976931348623157e292;c=+i[_>>3],C=+i[_+8>>3],_=0|A[_+16>>2],I=+i[((m=!(0|_))?p:_)+8>>3],c<h&&(i[d>>3]=c,h=c),C<v&&(i[g>>3]=C,v=C),c>E?i[l>>3]=c:c=E,C>f&&(i[y>>3]=C,f=C),w=C>0&C<w?C:w,b=C<0&C>b?C:b,a|=+u(+(C-I))>3.141592653589793,!m;)E=c;a&&(i[y>>3]=b,i[g>>3]=w)}else A[l>>2]=0,A[l+4>>2]=0,A[l+8>>2]=0,A[l+12>>2]=0,A[l+16>>2]=0,A[l+20>>2]=0,A[l+24>>2]=0,A[l+28>>2]=0;a=N+1|0}if(s=0|A[(O=s+8|0)>>2],A[O>>2]=0,!s){k=45;break}N=a,g=r}if(21==(0|k))x(22765,22787,35,22799);else if(23==(0|k))x(22819,22787,37,22799);else if(27==(0|k))x(22862,22787,61,22885);else if(45==(0|k)){t:do{if((0|P)>0){for(O=!(0|a),T=a<<2,M=!(0|t),L=0,r=0;;){if(D=0|A[n+(L<<2)>>2],O)k=73;else{if(!(N=0|De(T))){k=50;break}if(!(S=0|De(T))){k=52;break}e:do{if(M)o=0;else{for(a=0,o=0,l=t;s=e+(a<<5)|0,0|ae(0|A[l>>2],s,0|A[D>>2])?(A[N+(o<<2)>>2]=l,A[S+(o<<2)>>2]=s,m=o+1|0):m=o,l=0|A[l+8>>2];)a=a+1|0,o=m;if((0|m)>0)if(s=0|A[N>>2],1==(0|m))o=s;else for(y=0,_=-1,o=s,g=s;;){for(p=0|A[g>>2],s=0,l=0;d=(0|(a=0|A[A[N+(l<<2)>>2]>>2]))==(0|p)?s:s+(1&ae(a,0|A[S+(l<<2)>>2],0|A[p>>2]))|0,(0|(l=l+1|0))!=(0|m);)s=d;if(o=(a=(0|d)>(0|_))?g:o,(0|(s=y+1|0))==(0|m))break e;y=s,_=a?d:_,g=0|A[N+(s<<2)>>2]}else o=0}}while(0);if(Le(N),Le(S),o){if(s=0|A[(a=o+4|0)>>2])o=s+8|0;else if(0|A[o>>2]){k=70;break}A[o>>2]=D,A[a>>2]=D}else k=73}if(73==(0|k)){if(k=0,0|(r=0|A[D>>2]))do{S=r,r=0|A[r+16>>2],Le(S)}while(0|r);Le(D),r=1}if((0|(L=L+1|0))>=(0|P)){R=r;break t}}50==(0|k)?x(23004,22787,249,23023):52==(0|k)?x(23042,22787,252,23023):70==(0|k)&&x(22862,22787,61,22885)}else R=0}while(0);return Le(n),Le(e),0|(k=R)}return 0}function ae(t,e,n){t|=0;var r=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0;if(!(0|X(e|=0,n|=0)))return 0|(t=0);if(e=0|H(e),r=+i[n>>3],o=e&(o=+i[n+8>>3])<0?o+6.283185307179586:o,!(t=0|A[t>>2]))return 0|(t=0);if(e){e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|A[n>>2])){n=22;break t}if(((c=(u=a<0?a+6.283185307179586:a)+(r-s)/(c-s)*((a=o<0?o+6.283185307179586:o)-u))<0?c+6.283185307179586:c)>(l=u==l|a==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,l=o,n=t;t:for(;;){for(;a=+i[n>>3],o=+i[n+8>>3],f=0|A[(n=n+16|0)>>2],s=+i[(f=0|f?f:t)>>3],u=+i[f+8>>3],a>s?(c=a,a=u):(c=s,s=a,a=o,o=u),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|A[n>>2])){n=22;break t}if(a+(r-s)/(c-s)*(o-a)>(l=a==l|o==l?l+-2220446049250313e-31:l)&&(e^=1),!(n=0|A[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,i,o){n|=0,i|=0,o|=0;var s,a,u,c,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(c=M,M=M+32|0,v=c+16|0,u=c,l=0|Qe(0|(t|=0),0|(e|=0),52),C(),l&=15,y=0|Qe(0|n,0|i,52),C(),(0|l)!=(15&y))return M=c,0|(v=12);if(d=0|Qe(0|t,0|e,45),C(),d&=127,g=0|Qe(0|n,0|i,45),C(),d>>>0>121|(g&=127)>>>0>121)return M=c,0|(v=5);if(y=(0|d)!=(0|g)){if(7==(0|(h=0|j(d,g))))return M=c,0|(v=1);7==(0|(p=0|j(g,d)))?x(23066,23090,161,23100):(_=h,f=p)}else _=0,f=0;s=0|U(d),a=0|U(g),A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0;do{if(_){if(h=(0|(g=0|A[4272+(28*d|0)+(_<<2)>>2]))>0,a)if(h){d=0,p=n,h=i;do{p=0|Qt(p,h),h=0|C(),1==(0|(f=0|dt(f)))&&(f=0|dt(1)),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;else if(h){d=0,p=n,h=i;do{p=0|zt(p,h),h=0|C(),f=0|dt(f),d=d+1|0}while((0|d)!=(0|g));g=f,d=p,p=h}else g=f,d=n,p=i;if(Yt(d,p,v),y||x(23115,23090,191,23100),(h=!!(0|s))&(f=!!(0|a))&&x(23142,23090,192,23100),h){if(7==(0|(f=0|Ft(t,e)))){l=5;break}if(0|r[21872+(7*f|0)+_|0]){l=1;break}d=p=0|A[21040+(28*f|0)+(_<<2)>>2]}else if(f){if(7==(0|(f=0|Ft(d,p)))){l=5;break}if(0|r[21872+(7*f|0)+g|0]){l=1;break}d=0,p=0|A[21040+(28*g|0)+(f<<2)>>2]}else d=0,p=0;if((d|p)<0)l=5;else{if((0|p)>0){h=v+4|0,f=0;do{ht(h),f=f+1|0}while((0|f)!=(0|p))}if(A[u>>2]=0,A[u+4>>2]=0,A[u+8>>2]=0,lt(u,_),0|l)for(;0|Vt(l)?ut(u):ct(u),(0|l)>1;)l=l+-1|0;if((0|d)>0){l=0;do{ht(u),l=l+1|0}while((0|l)!=(0|d))}et(m=v+4|0,u,m),J(m),m=51}}else if(Yt(n,i,v),!!(0|s)&!!(0|a))if((0|g)!=(0|d)&&x(23173,23090,261,23100),7==(0|(f=0|Ft(t,e)))|7==(0|(l=0|Ft(n,i))))l=5;else if(0|r[21872+(7*f|0)+l|0])l=1;else if((0|(f=0|A[21040+(28*f|0)+(l<<2)>>2]))>0){h=v+4|0,l=0;do{ht(h),l=l+1|0}while((0|l)!=(0|f));m=51}else m=51;else m=51}while(0);return 51==(0|m)&&(l=v+4|0,A[o>>2]=A[l>>2],A[o+4>>2]=A[l+4>>2],A[o+8>>2]=A[l+8>>2],l=0),M=c,0|(v=l)}function ce(t,e,n,r){n|=0,r|=0;var i,o,s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(s=M,M=M+48|0,i=s+36|0,c=s+24|0,l=s+12|0,f=s,a=0|Qe(0|(t|=0),0|(e|=0),52),C(),a&=15,p=0|Qe(0|t,0|e,45),C(),(p&=127)>>>0>121)return M=s,0|(r=5);if(o=0|U(p),ze(0|a,0,52),y=134225919|C(),A[(u=r)>>2]=-1,A[u+4>>2]=y,!a)return 7==(0|(a=0|At(n)))||127==(0|(a=0|Y(p,a)))?(M=s,0|(y=1)):(d=0|ze(0|a,0,45),g=0|C(),g=-1040385&A[(p=r)+4>>2]|g,A[(y=r)>>2]=A[p>>2]|d,A[y+4>>2]=g,M=s,0|(y=0));for(A[i>>2]=A[n>>2],A[i+4>>2]=A[n+4>>2],A[i+8>>2]=A[n+8>>2],n=a;;){if(u=n,n=n+-1|0,A[c>>2]=A[i>>2],A[c+4>>2]=A[i+4>>2],A[c+8>>2]=A[i+8>>2],0|Vt(u)){if(0|(a=0|it(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ut(l)}else{if(0|(a=0|ot(i))){n=13;break}A[l>>2]=A[i>>2],A[l+4>>2]=A[i+4>>2],A[l+8>>2]=A[i+8>>2],ct(l)}if(nt(c,l,f),J(f),m=0|A[(a=r)>>2],a=0|A[a+4>>2],_=0|ze(7,0,0|(v=3*(15-u|0)|0)),a&=~C(),v=0|ze(0|At(f),0,0|v),a=C()|a,A[(y=r)>>2]=v|m&~_,A[y+4>>2]=a,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|A[i>>2])<=1&&(0|A[i+4>>2])<=1&&(0|A[i+8>>2])<=1){f=127==(0|(a=0|Y(p,n=0|At(i))))?0:0|U(a);e:do{if(n){if(o){if(7==(0|(a=0|Ft(t,e)))){a=5;break t}if((0|(u=0|A[21248+(28*a|0)+(n<<2)>>2]))>0){a=n,n=0;do{a=0|pt(a),n=n+1|0}while((0|n)!=(0|u))}else a=n;if(1==(0|a)){a=9;break t}127==(0|(n=0|Y(p,a)))&&x(23200,23090,411,23230),0|U(n)?x(23245,23090,412,23230):(g=n,d=u,h=a)}else g=a,d=0,h=n;if((0|(l=0|A[4272+(28*p|0)+(h<<2)>>2]))<=-1&&x(23276,23090,419,23230),!f){if((0|d)<0){a=5;break t}if(0|d){a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];do{n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,a=a+1|0}while((0|a)<(0|d))}if((0|l)<=0){a=g,n=58;break}for(a=0,n=0|A[(u=r)>>2],u=0|A[u+4>>2];;)if(n=0|Ut(n,u),u=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=u,(0|(a=a+1|0))==(0|l)){a=g,n=58;break e}}if(7==(0|(c=0|j(g,p)))&&x(23066,23090,428,23230),n=0|A[(a=r)>>2],a=0|A[a+4>>2],(0|l)>0){u=0;do{n=0|Ut(n,a),a=0|C(),A[(v=r)>>2]=n,A[v+4>>2]=a,u=u+1|0}while((0|u)!=(0|l))}if(7==(0|(a=0|Ft(n,a)))&&x(23313,23090,440,23230),n=0|Q(g),(0|(n=0|A[(n?21664:21456)+(28*c|0)+(a<<2)>>2]))<0&&x(23313,23090,454,23230),n){a=0,u=0|A[(c=r)>>2],c=0|A[c+4>>2];do{u=0|Gt(u,c),c=0|C(),A[(v=r)>>2]=u,A[v+4>>2]=c,a=a+1|0}while((0|a)<(0|n));a=g,n=58}else a=g,n=58}else if(!!(0|o)&!!(0|f)){if(7==(0|(n=0|Ft(t,e)))|7==(0|(u=0|Ft(0|A[(u=r)>>2],0|A[u+4>>2])))){a=5;break t}if((0|(u=0|A[21248+(28*n|0)+(u<<2)>>2]))<0){a=5;break t}if(u){n=0,c=0|A[(l=r)>>2],l=0|A[l+4>>2];do{c=0|Ut(c,l),l=0|C(),A[(v=r)>>2]=c,A[v+4>>2]=l,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&f&&(n=59),59==(0|n)&&1==(0|Ft(0|A[(v=r)>>2],0|A[v+4>>2]))){a=9;break}_=0|A[(v=r)>>2],v=-1040385&A[v+4>>2],m=0|ze(0|a,0,45),v|=C(),A[(a=r)>>2]=_|m,A[a+4>>2]=v,a=0}else a=1}while(0);return M=s,0|(v=a)}function le(t,e,n,r){t|=0,e|=0;var A=0,i=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return i=1,I(0|(A=0)),0|i;i=t,A=e,t=1,e=0;do{t=0|Be(0|((o=!0&!(1&n))?1:i),0|(o?0:A),0|t,0|e),e=0|C(),n=0|Ue(0|n,0|r,1),r=0|C(),i=0|Be(0|i,0|A,0|i,0|A),A=0|C()}while(!(!(0|n)&!(0|r)));return I(0|e),0|t}function fe(t,e,n){t|=0;var r,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0;if(!(0|X(e|=0,n|=0)))return 0|(p=0);if(e=0|H(e),o=+i[n>>3],s=e&(s=+i[n+8>>3])<0?s+6.283185307179586:s,(0|(p=0|A[t>>2]))<=0)return 0|(p=0);if(r=0|A[t+4>>2],e){e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(((l=(c=u<0?u+6.283185307179586:u)+(o-a)/(l-a)*((u=s<0?s+6.283185307179586:s)-c))<0?l+6.283185307179586:l)>(h=c==h|u==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}else{e=0,h=s,n=-1,t=0;t:for(;;){for(f=t;u=+i[r+(f<<4)>>3],s=+i[r+(f<<4)+8>>3],a=+i[r+((t=(n+2|0)%(0|p)|0)<<4)>>3],c=+i[r+(t<<4)+8>>3],u>a?(l=u,u=c):(l=a,a=u,u=s,s=c),(o=o==a|o==l?o+2220446049250313e-31:o)<a|o>l;){if((0|(n=f+1|0))>=(0|p)){n=22;break t}t=f,f=n,n=t}if(u+(o-a)/(l-a)*(s-u)>(h=u==h|s==h?h+-2220446049250313e-31:h)&&(e^=1),(0|(t=f+1|0))>=(0|p)){n=22;break}n=f}if(22==(0|n))return 0|e}return 0}function he(t,e){e|=0;var n,r,o,s,a,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0;if(!(r=0|A[(t|=0)>>2]))return A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,void(A[e+28>>2]=0);if(i[(o=e+8|0)>>3]=17976931348623157e292,i[(s=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(a=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|A[t+4>>2],y=17976931348623157e292,_=-17976931348623157e292,m=0,t=-1,h=17976931348623157e292,p=17976931348623157e292,g=-17976931348623157e292,l=-17976931348623157e292,v=0;c=+i[n+(v<<4)>>3],d=+i[n+(v<<4)+8>>3],f=+i[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<h&&(i[o>>3]=c,h=c),d<p&&(i[s>>3]=d,p=d),c>g?i[e>>3]=c:c=g,d>l&&(i[a>>3]=d,l=d),y=d>0&d<y?d:y,_=d<0&d>_?d:_,m|=+u(+(d-f))>3.141592653589793,(0|(t=v+1|0))!=(0|r);)E=v,g=c,v=t,t=E;m&&(i[a>>3]=_,i[s>>3]=y)}}function pe(t,e){e|=0;var n,r=0,o=0,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,C=0,x=0;if(_=0|A[(t|=0)>>2]){if(i[(m=e+8|0)>>3]=17976931348623157e292,i[(v=e+24|0)>>3]=17976931348623157e292,i[e>>3]=-17976931348623157e292,i[(E=e+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(s=0|A[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,o=0,r=-1,f=17976931348623157e292,h=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292,w=0;a=+i[s+(w<<4)>>3],p=+i[s+(w<<4)+8>>3],l=+i[s+(((0|(C=r+2|0))==(0|_)?0:C)<<4)+8>>3],a<f&&(i[m>>3]=a,f=a),p<h&&(i[v>>3]=p,h=p),a>d?i[e>>3]=a:a=d,p>c&&(i[E>>3]=p,c=p),g=p>0&p<g?p:g,y=p<0&p>y?p:y,o|=+u(+(p-l))>3.141592653589793,(0|(r=w+1|0))!=(0|_);)C=w,d=a,w=r,r=C;o&&(i[E>>3]=y,i[v>>3]=g)}}else A[e>>2]=0,A[e+4>>2]=0,A[e+8>>2]=0,A[e+12>>2]=0,A[e+16>>2]=0,A[e+20>>2]=0,A[e+24>>2]=0,A[e+28>>2]=0;if(!((0|(r=0|A[(C=t+8|0)>>2]))<=0)){n=t+12|0,I=0;do{if(s=0|A[n>>2],o=I,v=e+((I=I+1|0)<<5)|0,E=0|A[s+(o<<3)>>2]){if(i[(w=e+(I<<5)+8|0)>>3]=17976931348623157e292,i[(t=e+(I<<5)+24|0)>>3]=17976931348623157e292,i[v>>3]=-17976931348623157e292,i[(b=e+(I<<5)+16|0)>>3]=-17976931348623157e292,(0|E)>0){for(_=0|A[s+(o<<3)+4>>2],g=17976931348623157e292,y=-17976931348623157e292,s=0,o=-1,m=0,f=17976931348623157e292,h=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;a=+i[_+(m<<4)>>3],d=+i[_+(m<<4)+8>>3],l=+i[_+(((0|(o=o+2|0))==(0|E)?0:o)<<4)+8>>3],a<f&&(i[w>>3]=a,f=a),d<h&&(i[t>>3]=d,h=d),a>p?i[v>>3]=a:a=p,d>c&&(i[b>>3]=d,c=d),g=d>0&d<g?d:g,y=d<0&d>y?d:y,s|=+u(+(d-l))>3.141592653589793,(0|(o=m+1|0))!=(0|E);)x=m,m=o,p=a,o=x;s&&(i[b>>3]=y,i[t>>3]=g)}}else A[v>>2]=0,A[v+4>>2]=0,A[v+8>>2]=0,A[v+12>>2]=0,A[v+16>>2]=0,A[v+20>>2]=0,A[v+24>>2]=0,A[v+28>>2]=0,r=0|A[C>>2]}while((0|I)<(0|r))}}function de(t,e,n){var r=0,i=0,o=0;if(!(0|fe(t|=0,e|=0,n|=0)))return 0|(i=0);if((0|A[(i=t+8|0)>>2])<=0)return 0|(i=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|fe((0|A[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|A[i>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ge(t,e,n,r,A){e|=0,n|=0,r|=0,A|=0;var o,s,a,u,c,l,f,h=0;u=+i[(t|=0)>>3],a=+i[e>>3]-u,s=+i[t+8>>3],o=+i[e+8>>3]-s,l=+i[n>>3],h=((h=+i[r>>3]-l)*(s-(f=+i[n+8>>3]))-(u-l)*(c=+i[r+8>>3]-f))/(a*c-o*h),i[A>>3]=u+a*h,i[A+8>>3]=s+o*h}function ye(t,e){return e|=0,+u(+(+i[(t|=0)>>3]-+i[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+i[t+8>>3]-+i[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function _e(t,e){e|=0;var n,r,A;return+((A=+i[(t|=0)>>3]-+i[e>>3])*A+(r=+i[t+8>>3]-+i[e+8>>3])*r+(n=+i[t+16>>3]-+i[e+16>>3])*n)}function me(t,e,n){n|=0;var r,i,o,s,a=0,u=0,c=0;if(s=M,M=M+32|0,c=s,0|(a=0|jt(t|=0,e|=0,i=s+16|0)))return M=s,0|(n=a);r=0|Ot(t,e),o=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,A[(e|=0)>>2]=A[t>>2],A[e+4>>2]=A[t+4>>2],A[e+8>>2]=A[t+8>>2],A[e+12>>2]=A[t+12>>2]}(r,c),a=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|A[11120+(216*e|0)>>2])!=(0|t))if((0|A[11120+(216*e|0)+8>>2])!=(0|t))if((0|A[11120+(216*e|0)+16>>2])!=(0|t))if((0|A[11120+(216*e|0)+24>>2])!=(0|t))if((0|A[11120+(216*e|0)+32>>2])!=(0|t))if((0|A[11120+(216*e|0)+40>>2])!=(0|t))if((0|A[11120+(216*e|0)+48>>2])!=(0|t))if((0|A[11120+(216*e|0)+56>>2])!=(0|t))if((0|A[11120+(216*e|0)+64>>2])!=(0|t))if((0|A[11120+(216*e|0)+72>>2])!=(0|t))if((0|A[11120+(216*e|0)+80>>2])!=(0|t))if((0|A[11120+(216*e|0)+88>>2])!=(0|t))if((0|A[11120+(216*e|0)+96>>2])!=(0|t))if((0|A[11120+(216*e|0)+104>>2])!=(0|t))if((0|A[11120+(216*e|0)+112>>2])!=(0|t))if((0|A[11120+(216*e|0)+120>>2])!=(0|t))if((0|A[11120+(216*e|0)+128>>2])!=(0|t)){if((0|A[11120+(216*e|0)+136>>2])!=(0|t)){if((0|A[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|A[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|A[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|A[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|A[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|A[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|A[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|A[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|A[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|A[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|A[i>>2]);t:do{if(0|U(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:a=1;break t}if(u=0|A[22e3+(24*t|0)+8>>2],e=0|A[22e3+(24*t|0)+16>>2],(0|(t=0|A[i>>2]))!=(0|A[c>>2])&&(c=0|Q(r))|(0|(t=0|A[i>>2]))==(0|e)&&(a=(a+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){a=(a+5|0)%6|0,u=22;break}5==(0|o)&(0|t)==(0|u)?(a=(a+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(A[n>>2]=a,a=0),M=s,0|(n=a)}function ve(t,e,n,r){n|=0,r|=0;var i,o,s,a,u,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0;if(u=M,M=M+32|0,v=u+24|0,a=u+20|0,s=u+8|0,o=u+16|0,i=u,p=(p=!(0|Bt(t|=0,e|=0)))?6:5,g=0|Qe(0|t,0|e,52),C(),p>>>0<=n>>>0)return M=u,0|(r=2);!(y=!(0|(g&=15)))&&!((_=0|ze(7,0,3*(15^g)|0))&t)&!(C()&e)?c=n:l=4;t:do{if(4==(0|l)){if((0|((c=!!(0|Bt(t,e)))?4:5))<(0|n))return M=u,0|(r=1);if(0|me(t,e,v))return M=u,0|(r=1);if(l=(0|A[v>>2])+n|0,7==(0|(_=0|A[(c=c?22288+((0|l)%5<<2)|0:22320+((0|l)%6<<2)|0)>>2])))return M=u,0|(r=1);A[a>>2]=0,c=0|B(t,e,_,a,s);do{if(!c){if(d=0|A[(h=s)>>2],l=(f=(h=0|A[h+4>>2])>>>0<e>>>0|(0|h)==(0|e)&d>>>0<t>>>0)?d:t,f=f?h:e,!y&&!(d&(y=0|ze(7,0,3*(15^g)|0)))&!(h&C()))c=n;else{if(h=(n+-1+p|0)%(0|p)|0,c=0|Bt(t,e),(0|h)<0&&x(23313,23315,245,23324),(0|((p=!!(0|c))?4:5))<(0|h)&&x(23313,23315,245,23324),0|me(t,e,v)&&x(23313,23315,245,23324),c=(0|A[v>>2])+h|0,7==(0|(h=0|A[(c=p?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&x(23313,23315,245,23324),A[o>>2]=0,0|(c=0|B(t,e,h,o,i)))break;p=0|A[(d=i)>>2],d=0|A[d+4>>2];do{if(d>>>0<f>>>0|(0|d)==(0|f)&p>>>0<l>>>0){if(l=0|Bt(p,d)?0|F(p,d,t,e):0|A[22384+(((0|A[o>>2])+(0|A[22352+(h<<2)>>2])|0)%6<<2)>>2],c=0|Bt(p,d),(l+-1|0)>>>0>5){c=-1,l=p,f=d;break}if(1==(0|l)&(c=!!(0|c))){c=-1,l=p,f=d;break}do{if(!(0|me(p,d,v))){if(c){c=(5+(0|A[21936+(l<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(l<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);l=p,f=d}else c=n}while(0);d=0|A[(h=s)>>2],h=0|A[h+4>>2]}if((0|l)==(0|d)&(0|f)==(0|h)){if(t=(p=!!(0|Bt(d,h)))?0|F(d,h,t,e):0|A[22384+(((0|A[a>>2])+(0|A[22352+(_<<2)>>2])|0)%6<<2)>>2],c=0|Bt(d,h),(t+-1|0)>>>0<=5&&!(1==(0|t)&(m=!!(0|c))))do{if(!(0|me(d,h,v))){if(m){c=(5+(0|A[21936+(t<<2)>>2])-(0|A[v>>2])|0)%5|0;break}c=(6+(0|A[21968+(t<<2)>>2])-(0|A[v>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}e=f,t=l;break t}}while(0);return M=u,0|(r=c)}}while(0);return m=0|ze(0|c,0,56),v=C()|-2130706433&e|536870912,A[r>>2]=m|t,A[r+4>>2]=v,M=u,0|(r=0)}function Ee(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Te(e,4),A[t>>2]=r,r||x(23337,23360,40,23374)):A[t>>2]=0,A[t+4>>2]=e,A[t+8>>2]=0,A[t+12>>2]=n}function we(t){var e,n,r,o=0,s=0,a=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|A[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(a=0|A[t>>2],c=0|A[a+(o<<2)>>2])break;o=o+1|0}o=a+(~~(+u(+ +l(10,+ +(15-(0|A[n>>2])|0))*(+i[c>>3]+ +i[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|A[o>>2];e:do{if(0|s){if(a=c+32|0,(0|s)==(0|c))A[o>>2]=A[a>>2];else{if(!(o=0|A[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|A[(s=o+32|0)>>2]))break e;A[s>>2]=A[a>>2]}Le(c),A[r>>2]=(0|A[r>>2])-1}}while(0)}Le(0|A[t>>2])}function be(t){var e,n=0,r=0;for(e=0|A[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|A[(0|A[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Ie(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,n=(0|A[t>>2])+(n<<2)|0,!(r=0|A[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|A[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|A[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){A[r+32>>2]=A[s>>2];break}if(10==(0|o))return 0|n}else A[n>>2]=A[s>>2]}while(0);return Le(e),A[(s=t+8|0)>>2]=(0|A[s>>2])-1,0|(s=0)}function Ce(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,a=0;(r=0|De(40))||x(23390,23360,98,23403),A[r>>2]=A[e>>2],A[r+4>>2]=A[e+4>>2],A[r+8>>2]=A[e+8>>2],A[r+12>>2]=A[e+12>>2],A[(s=r+16|0)>>2]=A[n>>2],A[s+4>>2]=A[n+4>>2],A[s+8>>2]=A[n+8>>2],A[s+12>>2]=A[n+12>>2],A[r+32>>2]=0,s=~~(+u(+ +l(10,+ +(15-(0|A[t+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,s=(0|A[t>>2])+(s<<2)|0,o=0|A[s>>2];do{if(o){for(;!(0|Jt(o,e)&&0|Jt(o+16|0,n));)if(s=0|A[o+32>>2],!(0|A[(o=0|s?s:o)+32>>2])){a=10;break}if(10==(0|a)){A[o+32>>2]=r;break}return Le(r),0|(a=o)}A[s>>2]=r}while(0);return A[(a=t+8|0)>>2]=1+(0|A[a>>2]),0|(a=r)}function xe(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(o=0|A[(0|A[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|Jt(t,e)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){r=10;break}if(!(t=0|A[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Ne(t,e){e|=0;var n=0;if(n=~~(+u(+ +l(10,+ +(15-(0|A[(t|=0)+12>>2])|0))*(+i[e>>3]+ +i[e+8>>3]))%+(0|A[t+4>>2]))>>>0,!(t=0|A[(0|A[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|A[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Se(t){return 0|+function(t){return+ +Xe(+(t=+t))}(t=+t)}function De(t){t|=0;var e,n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0;e=M,M=M+16|0,p=e;do{if(t>>>0<245){if(t=(l=t>>>0<11?16:t+11&-8)>>>3,3&(r=(h=0|A[5857])>>>t))return i=0|A[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|A[(o=i+8|0)>>2]))==(0|t)?A[5857]=h&~(1<<n):(A[s+12>>2]=t,A[r>>2]=s),w=n<<3,A[i+4>>2]=3|w,A[(w=i+w+4|0)>>2]=1|A[w>>2],M=e,0|(w=o);if(l>>>0>(f=0|A[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|A[(t=(n=23468+((i=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(i=(n>>>=t)>>>1&1))+(n>>>i)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|A[(u=s+8|0)>>2]))==(0|n)?(t=h&~(1<<i),A[5857]=t):(A[r+12>>2]=n,A[t>>2]=r,t=h),a=(w=i<<3)-l|0,A[s+4>>2]=3|l,A[(o=s+l|0)+4>>2]=1|a,A[s+w>>2]=a,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=a,A[5862]=o,M=e,0|(w=u);if(s=0|A[5858]){for(r=(s&0-s)-1|0,r=c=0|A[23732+(((i=(r>>>=o=r>>>12&16)>>>5&8)|o|(a=(r>>>=i)>>>2&4)|(u=(r>>>=a)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&A[c+4>>2])-l|0;(t=0|A[r+16>>2])||(t=0|A[r+20>>2]);)r=t,u=(o=(a=(-8&A[t+4>>2])-l|0)>>>0<c>>>0)?t:u,c=o?a:c;if((a=u+l|0)>>>0>u>>>0){o=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){r=0;break}for(;;)if(r=0|A[(i=n+20|0)>>2])n=r,t=i;else{if(!(r=0|A[(i=n+16|0)>>2]))break;n=r,t=i}A[t>>2]=0,r=n}else r=0|A[u+8>>2],A[r+12>>2]=n,A[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|A[u+28>>2],(0|u)==(0|A[(t=23732+(n<<2)|0)>>2])){if(A[t>>2]=r,!r){A[5858]=s&~(1<<n);break}}else if(A[((0|A[(w=o+16|0)>>2])==(0|u)?w:o+20)>>2]=r,!r)break;A[r+24>>2]=o,0|(n=0|A[u+16>>2])&&(A[r+16>>2]=n,A[n+24>>2]=r),0|(n=0|A[u+20>>2])&&(A[r+20>>2]=n,A[n+24>>2]=r)}}while(0);return c>>>0<16?(w=c+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2]):(A[u+4>>2]=3|l,A[a+4>>2]=1|c,A[a+c>>2]=c,0|f&&(i=0|A[5862],r=23468+((n=f>>>3)<<1<<2)|0,(n=1<<n)&h?n=0|A[(t=r+8|0)>>2]:(A[5857]=n|h,n=r,t=r+8|0),A[t>>2]=i,A[n+12>>2]=i,A[i+8>>2]=n,A[i+12>>2]=r),A[5859]=c,A[5862]=a),M=e,0|(w=u+8|0)}h=l}else h=l}else h=l}else if(t>>>0<=4294967231)if(l=-8&(t=t+11|0),i=0|A[5858]){o=0-l|0,c=(t>>>=8)?l>>>0>16777215?31:l>>>((c=14-((u=((y=t<<(h=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|h|(c=((y<<=u)+245760|0)>>>16&2))+(y<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|A[23732+(c<<2)>>2];t:do{if(r)for(t=0,u=l<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((a=(-8&A[r+4>>2])-l|0)>>>0<o>>>0){if(!a){t=r,o=0,y=65;break t}t=r,o=a}if(s=!(0|(y=0|A[r+20>>2]))|(0|y)==(0|(r=0|A[r+16+(u>>>31<<2)>>2]))?s:y,!r){r=s,y=61;break}u<<=1}else r=0,t=0,y=61}while(0);if(61==(0|y)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&i)){h=l;break}h=(t&0-t)-1|0,t=0,r=0|A[23732+(((s=(h>>>=a=h>>>12&16)>>>5&8)|a|(u=(h>>>=s)>>>2&4)|(c=(h>>>=u)>>>1&2)|(r=(h>>>=c)>>>1&1))+(h>>>r)<<2)>>2]}r?y=65:(u=t,a=o)}if(65==(0|y))for(s=r;;){if(o=(r=(h=(-8&A[s+4>>2])-l|0)>>>0<o>>>0)?h:o,t=r?s:t,(r=0|A[s+16>>2])||(r=0|A[s+20>>2]),!r){u=t,a=o;break}s=r}if(0|u&&a>>>0<((0|A[5859])-l|0)>>>0&&(f=u+l|0)>>>0>u>>>0){s=0|A[u+24>>2],n=0|A[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|A[(t=u+20|0)>>2])&&!(n=0|A[(t=u+16|0)>>2])){n=0;break}for(;;)if(r=0|A[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|A[(o=n+16|0)>>2]))break;n=r,t=o}A[t>>2]=0}else w=0|A[u+8>>2],A[w+12>>2]=n,A[n+8>>2]=w}while(0);do{if(s){if(t=0|A[u+28>>2],(0|u)==(0|A[(r=23732+(t<<2)|0)>>2])){if(A[r>>2]=n,!n){i&=~(1<<t),A[5858]=i;break}}else if(A[((0|A[(w=s+16|0)>>2])==(0|u)?w:s+20)>>2]=n,!n)break;A[n+24>>2]=s,0|(t=0|A[u+16>>2])&&(A[n+16>>2]=t,A[t+24>>2]=n),(t=0|A[u+20>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);t:do{if(a>>>0<16)w=a+l|0,A[u+4>>2]=3|w,A[(w=u+w+4|0)>>2]=1|A[w>>2];else{if(A[u+4>>2]=3|l,A[f+4>>2]=1|a,A[f+a>>2]=a,n=a>>>3,a>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=f,A[n+12>>2]=f,A[f+8>>2]=n,A[f+12>>2]=r;break}if(n=23732+((r=(n=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(r=((w<<=v)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[f+28>>2]=r,A[(t=f+16|0)+4>>2]=0,A[t>>2]=0,!(i&(t=1<<r))){A[5858]=i|t,A[n>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break}n=0|A[n>>2];e:do{if((-8&A[n+4>>2])!=(0|a)){for(i=a<<(31==(0|r)?0:25-(r>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|a)){n=t;break e}i<<=1,n=t}A[r>>2]=f,A[f+24>>2]=n,A[f+12>>2]=f,A[f+8>>2]=f;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=f,A[E>>2]=f,A[f+8>>2]=w,A[f+12>>2]=n,A[f+24>>2]=0}}while(0);return M=e,0|(w=u+8|0)}h=l}else h=l;else h=-1}while(0);if((r=0|A[5859])>>>0>=h>>>0)return n=r-h|0,t=0|A[5862],n>>>0>15?(w=t+h|0,A[5862]=w,A[5859]=n,A[w+4>>2]=1|n,A[t+r>>2]=n,A[t+4>>2]=3|h):(A[5859]=0,A[5862]=0,A[t+4>>2]=3|r,A[(w=t+r+4|0)>>2]=1|A[w>>2]),M=e,0|(w=t+8|0);if((a=0|A[5860])>>>0>h>>>0)return v=a-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0);if(0|A[5975]?t=0|A[5977]:(A[5977]=4096,A[5976]=4096,A[5978]=-1,A[5979]=-1,A[5980]=0,A[5968]=0,A[5975]=-16&p^1431655768,t=4096),u=h+48|0,(l=(s=t+(c=h+47|0)|0)&(o=0-t|0))>>>0<=h>>>0)return M=e,0|(w=0);if(0|(t=0|A[5967])&&(p=(f=0|A[5965])+l|0)>>>0<=f>>>0|p>>>0>t>>>0)return M=e,0|(w=0);t:do{if(4&A[5968])n=0,y=143;else{r=0|A[5863];e:do{if(r){for(i=23876;!((p=0|A[i>>2])>>>0<=r>>>0&&(p+(0|A[i+4>>2])|0)>>>0>r>>>0);){if(!(t=0|A[i+8>>2])){y=128;break e}i=t}if((n=s-a&o)>>>0<2147483647)if((0|(t=0|$e(0|n)))==((0|A[i>>2])+(0|A[i+4>>2])|0)){if(-1!=(0|t)){a=n,s=t,y=145;break t}}else i=t,y=136;else n=0}else y=128}while(0);do{if(128==(0|y))if(-1!=(0|(r=0|$e(0)))&&(n=r,g=(n=((g=(d=0|A[5976])+-1|0)&n?(g+n&0-d)-n|0:0)+l|0)+(d=0|A[5965])|0,n>>>0>h>>>0&n>>>0<2147483647)){if(0|(p=0|A[5967])&&g>>>0<=d>>>0|g>>>0>p>>>0){n=0;break}if((0|(t=0|$e(0|n)))==(0|r)){a=n,s=r,y=145;break t}i=t,y=136}else n=0}while(0);do{if(136==(0|y)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|i))){if(-1==(0|i)){n=0;break}a=n,s=i,y=145;break t}if((t=c-n+(t=0|A[5977])&0-t)>>>0>=2147483647){a=n,s=i,y=145;break t}if(-1==(0|$e(0|t))){$e(0|r),n=0;break}a=t+n|0,s=i,y=145;break t}}while(0);A[5968]=4|A[5968],y=143}}while(0);if(143==(0|y)&&l>>>0<2147483647&&!(-1==(0|(v=0|$e(0|l)))|1^(m=(_=(g=0|$e(0))-v|0)>>>0>(h+40|0)>>>0)|v>>>0<g>>>0&-1!=(0|v)&-1!=(0|g)^1)&&(a=m?_:n,s=v,y=145),145==(0|y)){n=(0|A[5965])+a|0,A[5965]=n,n>>>0>(0|A[5966])>>>0&&(A[5966]=n),c=0|A[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|A[n>>2])+(r=0|A[n+4>>2])|0)){y=154;break}if(!(i=0|A[n+8>>2]))break;n=i}if(!(154!=(0|y)||(E=n+4|0,8&A[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){A[E>>2]=r+a,E=c+(v=7&(v=c+8|0)?0-v&7:0)|0,v=(w=(0|A[5860])+a|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[c+w+4>>2]=40,A[5864]=A[5979];break}for(s>>>0<(0|A[5861])>>>0&&(A[5861]=s),r=s+a|0,n=23876;;){if((0|A[n>>2])==(0|r)){y=162;break}if(!(t=0|A[n+8>>2]))break;n=t}if(162==(0|y)&&!(8&A[n+12>>2])){A[n>>2]=s,A[(f=n+4|0)>>2]=(0|A[f>>2])+a,l=(f=s+(7&(f=s+8|0)?0-f&7:0)|0)+h|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-f-h|0,A[f+4>>2]=3|h;e:do{if((0|c)==(0|n))w=(0|A[5860])+u|0,A[5860]=w,A[5863]=l,A[l+4>>2]=1|w;else{if((0|A[5862])==(0|n)){w=(0|A[5859])+u|0,A[5859]=w,A[5862]=l,A[l+4>>2]=1|w,A[l+w>>2]=w;break}if(1==(3&(t=0|A[n+4>>2]))){a=-8&t,i=t>>>3;n:do{if(t>>>0<256){if(t=0|A[n+8>>2],(0|(r=0|A[n+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<i);break}A[t+12>>2]=r,A[r+8>>2]=t;break}s=0|A[n+24>>2],t=0|A[n+12>>2];do{if((0|t)==(0|n)){if(t=0|A[(i=(r=n+16|0)+4|0)>>2])r=i;else if(!(t=0|A[r>>2])){t=0;break}for(;;)if(i=0|A[(o=t+20|0)>>2])t=i,r=o;else{if(!(i=0|A[(o=t+16|0)>>2]))break;t=i,r=o}A[r>>2]=0}else w=0|A[n+8>>2],A[w+12>>2]=t,A[t+8>>2]=w}while(0);if(!s)break;i=23732+((r=0|A[n+28>>2])<<2)|0;do{if((0|A[i>>2])==(0|n)){if(A[i>>2]=t,0|t)break;A[5858]=A[5858]&~(1<<r);break n}if(A[((0|A[(w=s+16|0)>>2])==(0|n)?w:s+20)>>2]=t,!t)break n}while(0);if(A[t+24>>2]=s,0|(i=0|A[(r=n+16|0)>>2])&&(A[t+16>>2]=i,A[i+24>>2]=t),!(r=0|A[r+4>>2]))break;A[t+20>>2]=r,A[r+24>>2]=t}while(0);n=n+a|0,o=a+u|0}else o=u;if(A[(n=n+4|0)>>2]=-2&A[n>>2],A[l+4>>2]=1|o,A[l+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=l,A[n+12>>2]=l,A[l+8>>2]=n,A[l+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){i=31;break}i=o>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1}else i=0}while(0);if(n=23732+(i<<2)|0,A[l+28>>2]=i,A[(t=l+16|0)+4>>2]=0,A[t>>2]=0,!((t=0|A[5858])&(r=1<<i))){A[5858]=t|r,A[n>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break}n=0|A[n>>2];n:do{if((-8&A[n+4>>2])!=(0|o)){for(i=o<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|o)){n=t;break n}i<<=1,n=t}A[r>>2]=l,A[l+24>>2]=n,A[l+12>>2]=l,A[l+8>>2]=l;break e}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=l,A[E>>2]=l,A[l+8>>2]=w,A[l+12>>2]=n,A[l+24>>2]=0}}while(0);return M=e,0|(w=f+8|0)}for(n=23876;!((t=0|A[n>>2])>>>0<=c>>>0&&(w=t+(0|A[n+4>>2])|0)>>>0>c>>>0);)n=0|A[n+8>>2];n=(t=(t=(o=w+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(r=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+r+4>>2]=40,A[5864]=A[5979],A[(r=t+4|0)>>2]=27,A[n>>2]=A[5969],A[n+4>>2]=A[5970],A[n+8>>2]=A[5971],A[n+12>>2]=A[5972],A[5969]=s,A[5970]=a,A[5972]=0,A[5971]=n,n=t+24|0;do{E=n,A[(n=n+4|0)>>2]=7}while((E+8|0)>>>0<w>>>0);if((0|t)!=(0|c)){if(s=t-c|0,A[r>>2]=-2&A[r>>2],A[c+4>>2]=1|s,A[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|A[5857])&(n=1<<n)?n=0|A[(t=r+8|0)>>2]:(A[5857]=t|n,n=r,t=r+8|0),A[t>>2]=c,A[n+12>>2]=c,A[c+8>>2]=n,A[c+12>>2]=r;break}if(r=23732+((i=(n=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((v=((w=n<<(E=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|E|(i=((w<<=v)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,A[c+28>>2]=i,A[c+20>>2]=0,A[o>>2]=0,!((n=0|A[5858])&(t=1<<i))){A[5858]=n|t,A[r>>2]=c,A[c+24>>2]=r,A[c+12>>2]=c,A[c+8>>2]=c;break}n=0|A[r>>2];e:do{if((-8&A[n+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));t=0|A[(r=n+16+(i>>>31<<2)|0)>>2];){if((-8&A[t+4>>2])==(0|s)){n=t;break e}i<<=1,n=t}A[r>>2]=c,A[c+24>>2]=n,A[c+12>>2]=c,A[c+8>>2]=c;break t}}while(0);w=0|A[(E=n+8|0)>>2],A[w+12>>2]=c,A[E>>2]=c,A[c+8>>2]=w,A[c+12>>2]=n,A[c+24>>2]=0}}else!(0|(w=0|A[5861]))|s>>>0<w>>>0&&(A[5861]=s),A[5969]=s,A[5970]=a,A[5972]=0,A[5866]=A[5975],A[5865]=-1,A[5870]=23468,A[5869]=23468,A[5872]=23476,A[5871]=23476,A[5874]=23484,A[5873]=23484,A[5876]=23492,A[5875]=23492,A[5878]=23500,A[5877]=23500,A[5880]=23508,A[5879]=23508,A[5882]=23516,A[5881]=23516,A[5884]=23524,A[5883]=23524,A[5886]=23532,A[5885]=23532,A[5888]=23540,A[5887]=23540,A[5890]=23548,A[5889]=23548,A[5892]=23556,A[5891]=23556,A[5894]=23564,A[5893]=23564,A[5896]=23572,A[5895]=23572,A[5898]=23580,A[5897]=23580,A[5900]=23588,A[5899]=23588,A[5902]=23596,A[5901]=23596,A[5904]=23604,A[5903]=23604,A[5906]=23612,A[5905]=23612,A[5908]=23620,A[5907]=23620,A[5910]=23628,A[5909]=23628,A[5912]=23636,A[5911]=23636,A[5914]=23644,A[5913]=23644,A[5916]=23652,A[5915]=23652,A[5918]=23660,A[5917]=23660,A[5920]=23668,A[5919]=23668,A[5922]=23676,A[5921]=23676,A[5924]=23684,A[5923]=23684,A[5926]=23692,A[5925]=23692,A[5928]=23700,A[5927]=23700,A[5930]=23708,A[5929]=23708,A[5932]=23716,A[5931]=23716,E=s+(v=7&(v=s+8|0)?0-v&7:0)|0,v=(w=a+-40|0)-v|0,A[5863]=E,A[5860]=v,A[E+4>>2]=1|v,A[s+w+4>>2]=40,A[5864]=A[5979]}while(0);if((n=0|A[5860])>>>0>h>>>0)return v=n-h|0,A[5860]=v,E=(w=0|A[5863])+h|0,A[5863]=E,A[E+4>>2]=1|v,A[w+4>>2]=3|h,M=e,0|(w=w+8|0)}return A[(w=23424)>>2]=12,M=e,0|(w=0)}function Le(t){var e=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0;if(t|=0){n=t+-8|0,i=0|A[5861],u=n+(e=-8&(t=0|A[t+-4>>2]))|0;do{if(1&t)a=n,s=n;else{if(r=0|A[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<i>>>0)return;if((0|A[5862])==(0|s)){if(3&~(e=0|A[(t=u+4|0)>>2])){a=s,e=o;break}return A[5859]=o,A[t>>2]=-2&e,A[s+4>>2]=1|o,void(A[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|A[s+8>>2],(0|(e=0|A[s+12>>2]))==(0|t)){A[5857]=A[5857]&~(1<<n),a=s,e=o;break}A[t+12>>2]=e,A[e+8>>2]=t,a=s,e=o;break}i=0|A[s+24>>2],t=0|A[s+12>>2];do{if((0|t)==(0|s)){if(t=0|A[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){t=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0}else a=0|A[s+8>>2],A[a+12>>2]=t,A[t+8>>2]=a}while(0);if(i){if(e=0|A[s+28>>2],(0|A[(n=23732+(e<<2)|0)>>2])==(0|s)){if(A[n>>2]=t,!t){A[5858]=A[5858]&~(1<<e),a=s,e=o;break}}else if(A[((0|A[(a=i+16|0)>>2])==(0|s)?a:i+20)>>2]=t,!t){a=s,e=o;break}A[t+24>>2]=i,0|(n=0|A[(e=s+16|0)>>2])&&(A[t+16>>2]=n,A[n+24>>2]=t),(e=0|A[e+4>>2])?(A[t+20>>2]=e,A[e+24>>2]=t,a=s,e=o):(a=s,e=o)}else a=s,e=o}}while(0);if(!(s>>>0>=u>>>0)&&1&(r=0|A[(t=u+4|0)>>2])){if(2&r)A[t>>2]=-2&r,A[a+4>>2]=1|e,A[s+e>>2]=e,i=e;else{if((0|A[5863])==(0|u)){if(u=(0|A[5860])+e|0,A[5860]=u,A[5863]=a,A[a+4>>2]=1|u,(0|a)!=(0|A[5862]))return;return A[5862]=0,void(A[5859]=0)}if((0|A[5862])==(0|u))return u=(0|A[5859])+e|0,A[5859]=u,A[5862]=s,A[a+4>>2]=1|u,void(A[s+u>>2]=u);i=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|A[u+8>>2],(0|(t=0|A[u+12>>2]))==(0|e)){A[5857]=A[5857]&~(1<<n);break}A[e+12>>2]=t,A[t+8>>2]=e;break}o=0|A[u+24>>2],t=0|A[u+12>>2];do{if((0|t)==(0|u)){if(t=0|A[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|A[e>>2])){n=0;break}for(;;)if(n=0|A[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|A[(r=t+16|0)>>2]))break;t=n,e=r}A[e>>2]=0,n=t}else n=0|A[u+8>>2],A[n+12>>2]=t,A[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|A[u+28>>2],(0|A[(e=23732+(t<<2)|0)>>2])==(0|u)){if(A[e>>2]=n,!n){A[5858]=A[5858]&~(1<<t);break}}else if(A[((0|A[(r=o+16|0)>>2])==(0|u)?r:o+20)>>2]=n,!n)break;A[n+24>>2]=o,0|(e=0|A[(t=u+16|0)>>2])&&(A[n+16>>2]=e,A[e+24>>2]=n),0|(t=0|A[t+4>>2])&&(A[n+20>>2]=t,A[t+24>>2]=n)}}while(0);if(A[a+4>>2]=1|i,A[s+i>>2]=i,(0|a)==(0|A[5862]))return void(A[5859]=i)}if(t=i>>>3,i>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|A[5857])&(t=1<<t)?t=0|A[(e=n+8|0)>>2]:(A[5857]=e|t,t=n,e=n+8|0),A[e>>2]=a,A[t+12>>2]=a,A[a+8>>2]=t,void(A[a+12>>2]=n);t=23732+((r=(t=i>>>8)?i>>>0>16777215?31:i>>>((r=14-((o=((u=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((u<<=o)+245760|0)>>>16&2))+(u<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,A[a+28>>2]=r,A[a+20>>2]=0,A[a+16>>2]=0,e=0|A[5858],n=1<<r;t:do{if(e&n){t=0|A[t>>2];e:do{if((-8&A[t+4>>2])!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1));e=0|A[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&A[e+4>>2])==(0|i)){t=e;break e}r<<=1,t=e}A[n>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a;break t}}while(0);u=0|A[(s=t+8|0)>>2],A[u+12>>2]=a,A[s>>2]=a,A[a+8>>2]=u,A[a+12>>2]=t,A[a+24>>2]=0}else A[5858]=e|n,A[t>>2]=a,A[a+24>>2]=t,A[a+12>>2]=a,A[a+8>>2]=a}while(0);if(u=(0|A[5865])-1|0,A[5865]=u,!(0|u)){for(t=23884;t=0|A[t>>2];)t=t+8|0;A[5865]=-1}}}}function Te(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|De(n))&&3&A[t+-4>>2]?(He(0|t,0,0|n),0|t):0|t}function Me(t,e,n,r){return 0|(I((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(I(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Pe(t){return 0|((t|=0)?31-(0|b(t^t-1)):32)}function Re(t,e,n,r,i){i|=0;var o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(l=t|=0,s=n|=0,a=h=r|=0,!(c=u=e|=0))return o=!!(0|i),a?o?(A[i>>2]=0|t,A[i+4>>2]=0,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i)):(o&&(A[i>>2]=(l>>>0)%(s>>>0),A[i+4>>2]=0),i=(l>>>0)/(s>>>0)>>>0,0|(I(0|(h=0)),i));o=!(0|a);do{if(s){if(!o){if((o=(0|b(0|a))-(0|b(0|c))|0)>>>0<=31){s=f=o+1|0,t=l>>>(f>>>0)&(e=o-31>>31)|c<<(a=31-o|0),e&=c>>>(f>>>0),o=0,a=l<<a;break}return i?(A[i>>2]=0|t,A[i+4>>2]=0|u,i=0,0|(I(0|(h=0)),i)):(i=0,0|(I(0|(h=0)),i))}if((o=s-1|0)&s){s=a=33+(0|b(0|s))-(0|b(0|c))|0,t=(f=32-a|0)-1>>31&c>>>((p=a-32|0)>>>0)|(c<<f|l>>>(a>>>0))&(e=p>>31),e&=c>>>(a>>>0),o=l<<(d=64-a|0)&(u=f>>31),a=(c<<d|l>>>(p>>>0))&u|l<<f&a-33>>31;break}return 0|i&&(A[i>>2]=o&l,A[i+4>>2]=0),1==(0|s)?(d=0|t,0|(I(0|(p=0|u)),d)):(p=c>>>((d=0|Pe(0|s))>>>0)|0,d=c<<32-d|l>>>(d>>>0),0|(I(0|p),d))}if(o)return 0|i&&(A[i>>2]=(c>>>0)%(s>>>0),A[i+4>>2]=0),d=(c>>>0)/(s>>>0)>>>0,0|(I(0|(p=0)),d);if(!l)return 0|i&&(A[i>>2]=0,A[i+4>>2]=(c>>>0)%(a>>>0)),d=(c>>>0)/(a>>>0)>>>0,0|(I(0|(p=0)),d);if(!((o=a-1|0)&a))return 0|i&&(A[i>>2]=0|t,A[i+4>>2]=o&c),p=0,d=c>>>((0|Pe(0|a))>>>0),0|(I(0|p),d);if((o=(0|b(0|a))-(0|b(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(a=31-o|0)|l>>>(e>>>0),e=c>>>(e>>>0),o=0,a=l<<a;break}return i?(A[i>>2]=0|t,A[i+4>>2]=0|u,d=0,0|(I(0|(p=0)),d)):(d=0,0|(I(0|(p=0)),d))}while(0);if(s){c=0|Me(0|(f=0|n),0|(l=0|h),-1,-1),n=0|C(),u=a,a=0;do{r=u,u=o>>>31|u<<1,o=a|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(h=t>>>31|e<<1)),a=1&(p=(d=0|C())>>31|((0|d)<0?-1:0)<<1),t=0|Oe(0|r,0|h,p&f,(((0|d)<0?-1:0)>>31|((0|d)<0?-1:0)<<1)&l),e=0|C(),s=s-1|0}while(0|s);c=u,u=0}else c=a,u=0,a=0;return s=0,0|i&&(A[i>>2]=t,A[i+4>>2]=e),d=o<<1&-2|a,0|(I(0|(p=(0|o)>>>31|(c|s)<<1|u)),d)}function ke(t,e,n,r){n|=0;var A,i,o,s,a;return i=(r|=0)>>31|((0|r)<0?-1:0)<<1,A=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((a=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|a,0|s),t=i^a,e=A^s,0|Oe(Re(o,0|C(),0|Oe(i^n,A^r,0|i,0|A),0|C(),0)^t,C()^e,0|t,0|e)}function Be(t,e,n,r){e|=0,r|=0;var A,i;return n=0|function(t,e){var n,r,A,i=0;return t=((n=0|v(i=65535&(e|=0),A=65535&(t|=0)))>>>16)+(0|v(i,r=t>>>16))|0,e=0|v(i=e>>>16,A),0|(I((t>>>16)+(0|v(i,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(A=t|=0,i=n|=0),t=0|C(),0|(I((0|v(e,i))+(0|v(r,A))+t|0),n)}function Fe(t,e,n,r){n|=0;var i,o,s,a,u,c;return i=M,M=M+16|0,a=0|i,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,Re(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|C(),0|Oe(c^n,u^r,0|c,0|u),0|C(),a),r=0|Oe(A[a>>2]^s,A[a+4>>2]^o,0|s,0|o),n=0|C(),M=i,0|(I(0|n),r)}function Ge(t,e,n,r){var i,o;return o=M,M=M+16|0,Re(t|=0,e|=0,n|=0,r|=0,i=0|o),M=o,0|(I(0|A[i+4>>2]),A[i>>2])}function Ue(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(I(0|((0|e)<0?-1:0)),e>>n-32)}function Qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(I(0),e>>>n-32|0)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(I(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(I(t<<n-32),0)}function Ve(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+w(+t,+e)}function qe(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+E(+t,+e)}function Ye(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function je(t,e,n){t|=0,e|=0;var i,o,s=0;if((0|(n|=0))>=8192)return D(0|t,0|e,0|n),0|t;if(o=0|t,i=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&i)-64|0;(0|t)<=(0|s);)A[t>>2]=A[e>>2],A[t+4>>2]=A[e+4>>2],A[t+8>>2]=A[e+8>>2],A[t+12>>2]=A[e+12>>2],A[t+16>>2]=A[e+16>>2],A[t+20>>2]=A[e+20>>2],A[t+24>>2]=A[e+24>>2],A[t+28>>2]=A[e+28>>2],A[t+32>>2]=A[e+32>>2],A[t+36>>2]=A[e+36>>2],A[t+40>>2]=A[e+40>>2],A[t+44>>2]=A[e+44>>2],A[t+48>>2]=A[e+48>>2],A[t+52>>2]=A[e+52>>2],A[t+56>>2]=A[e+56>>2],A[t+60>>2]=A[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)A[t>>2]=A[e>>2],t=t+4|0,e=e+4|0}else for(n=i-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|i);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function He(t,e,n){e|=0;var i,o=0,s=0,a=0;if(i=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(a=e|e<<8|e<<16|e<<24,s=(o=-4&i)-64|0;(0|t)<=(0|s);)A[t>>2]=a,A[t+4>>2]=a,A[t+8>>2]=a,A[t+12>>2]=a,A[t+16>>2]=a,A[t+20>>2]=a,A[t+24>>2]=a,A[t+28>>2]=a,A[t+32>>2]=a,A[t+36>>2]=a,A[t+40>>2]=a,A[t+44>>2]=a,A[t+48>>2]=a,A[t+52>>2]=a,A[t+56>>2]=a,A[t+60>>2]=a,t=t+64|0;for(;(0|t)<(0|o);)A[t>>2]=a,t=t+4|0}for(;(0|t)<(0|i);)r[t|0]=e,t=t+1|0;return i-n|0}function Xe(t){return(t=+t)>=0?+a(t+.5):+m(t-.5)}function $e(t){t|=0;var e,n,r;return r=0|S(),(0|t)>0&(0|(e=(n=0|A[s>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),N(12),-1):(0|e)>(0|r)&&!(0|L(0|e))?(N(12),-1):(A[s>>2]=e,0|n)}return{___divdi3:ke,___muldi3:Be,___remdi3:Fe,___uremdi3:Ge,_areNeighborCells:function(t,e,n,r,i){i|=0;var o,s,a,u=0,c=0,l=0,f=0;if(a=M,M=M+64|0,s=a,o=a+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return M=a,0|(i=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return A[i>>2]=0,M=a,0|(i=0);if(c=0|Qe(0|t,0|e,52),C(),c&=15,f=0|Qe(0|n,0|r,52),C(),(0|c)!=(15&f))return M=a,0|(i=12);if(u=c+-1|0,c>>>0>1){Rt(t,e,u,s),Rt(n,r,u,o),l=0|A[(f=s)>>2],f=0|A[f+4>>2];t:do{if((0|l)==(0|A[o>>2])&&(0|f)==(0|A[o+4>>2])){u=0|Qe(0|t,0|e,0|(c=3*(15^c)|0)),C(),u&=7,c=0|Qe(0|n,0|r,0|c),C(),c&=7;do{if(!(0|u)|!(0|c))A[i>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Bt(l,f)){u=5;break}if((0|A[15536+(u<<2)>>2])!=(0|c)&&(0|A[15568+(u<<2)>>2])!=(0|c))break t;A[i>>2]=1,u=0}}while(0);return M=a,0|(i=u)}}while(0)}c=(u=s)+56|0;do{A[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return O(t,e,1,s),u=(0|A[(e=s)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+8|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+16|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+24|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+32|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)||(0|A[(e=s+40|0)>>2])==(0|n)&&(0|A[e+4>>2])==(0|r)?1:1&((0|A[(u=s+48|0)>>2])==(0|n)?(0|A[u+4>>2])==(0|r):0),A[i>>2]=u,M=a,0|(i=0)},_bitshift64Ashr:Ue,_bitshift64Lshr:Qe,_bitshift64Shl:ze,_calloc:Te,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(i[n>>3]=6371.007180918475*+i[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Xt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var i=0;return i=0|Qe(0|(t|=0),0|(e|=0),52),C(),(0|n)<16&(0|(i&=15))<=(0|n)?((0|i)<(0|n)&&(i=0|ze(-1,-1,3+(3*(n+-1-i|0)|0)|0),i=0|ze(0|~i,0|~C(),3*(15-n|0)|0),e=~C()&e,t&=~i),i=0|ze(0|n,0,52),n=-15728641&e|C(),A[r>>2]=t|i,A[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0;if(i=M,M=M+16|0,_=i,m=0|Qe(0|(t|=0),0|(e|=0),52),C(),m&=15,n>>>0>15)return M=i,0|(m=4);if((0|m)<(0|n))return M=i,0|(m=12);if((0|m)!=(0|n))if(s=0|ze(0|n,0,52),s|=t,u=C()|-15728641&e,(0|m)>(0|n)){c=n;do{y=0|ze(7,0,3*(14-c|0)|0),c=c+1|0,s|=y,u=C()|u}while((0|c)<(0|m));y=s}else y=s;else y=t,u=e;g=0|Qe(0|y,0|u,45),C();t:do{if(0|U(127&g)){if(c=0|Qe(0|y,0|u,52),C(),0|(c&=15))for(s=1;;){if(!(!((g=0|ze(7,0,3*(15-s|0)|0))&y)&!(C()&u))){l=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(g=-15728641&e,d=m;;){if(p=d,(d=d+-1|0)>>>0>15|(0|m)<(0|d)){l=19;break}if((0|m)!=(0|d))if(s=0|ze(0|d,0,52),s|=t,c=C()|g,(0|m)<(0|p))h=s;else{l=d;do{h=0|ze(7,0,3*(14-l|0)|0),l=l+1|0,s|=h,c=C()|c}while((0|l)<(0|m));h=s}else h=t,c=e;if(f=0|Qe(0|h,0|c,45),C(),0|U(127&f)){f=0|Qe(0|h,0|c,52),C(),f&=15;e:do{if(f)for(l=1;;){if(s=0|Qe(0|h,0|c,3*(15-l|0)|0),C(),0|(s&=7))break e;if(!(l>>>0<f>>>0)){s=0;break}l=l+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|Qe(0|t,0|e,3*(15-p|0)|0),C(),7==(0|(c&=7))){o=5,l=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,l=42;break}if(0|(h=c+((!!(0|c)&s)<<31>>31)|0)&&(l=0|le(7,0,l=m-p|0,((0|l)<0)<<31>>31),f=0|C(),s?(s=0|Me(0|(s=0|Be(0|l,0|f,5,0)),0|C(),-5,-1),s=0|Me(0|(s=0|ke(0|s,0|C(),6,0)),0|C(),1,0),c=0|C()):(s=l,c=f),p=0|Me(0|s,0|c,0|(p=0|Be(0|l,0|f,0|(p=h+-1|0),((0|p)<0)<<31>>31)),0|C()),f=0|Me(0|p,0|(h=0|C()),0|A[(f=r)>>2],0|A[f+4>>2]),h=0|C(),A[(p=r)>>2]=f,A[p+4>>2]=h),(0|d)<=(0|n)){l=37;break}}if(19==(0|l))x(23313,22674,1099,22710);else{if(37==(0|l)){o=0|A[(a=r)+4>>2],a=0|A[a>>2];break}if(42==(0|l))return M=i,0|o}}else o=0,a=0}else l=33}while(0);t:do{if(33==(0|l)){if(A[(g=r)>>2]=0,A[g+4>>2]=0,(0|m)>(0|n)){for(s=m;;){if(o=0|Qe(0|t,0|e,3*(15-s|0)|0),C(),7==(0|(o&=7))){o=5;break}if(o=0|Be(0|(a=0|le(7,0,a=m-s|0,((0|a)<0)<<31>>31)),0|C(),0|o,0),a=0|C(),a=0|Me(0|A[(g=r)>>2],0|A[g+4>>2],0|o,0|a),o=0|C(),A[(g=r)>>2]=a,A[g+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return M=i,0|o}o=0,a=0}}while(0);return 0|kt(y,u,m,_)&&x(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&a>>>0>4294967295)&((0|(_=0|A[(m=_)+4>>2]))>(0|o)|((0|_)==(0|o)?(0|A[m>>2])>>>0>a>>>0:0))?(M=i,0|(m=0)):(x(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var i,o,s=0,a=0;if(o=M,M=M+16|0,Wt(i=o,t|=0,e|=0,n|=0),!(0|(t=0|A[(e=i)>>2]))&!(0|(e=0|A[e+4>>2])))return M=o,0;s=0,n=0;do{A[(a=r+(s<<3)|0)>>2]=t,A[a+4>>2]=e,s=0|Me(0|s,0|n,1,0),n=0|C(),Kt(i),t=0|A[(a=i)>>2],e=0|A[a+4>>2]}while(!(!(0|t)&!(0|e)));return M=o,0},_cellToChildrenSize:kt,_cellToLatLng:Ht,_cellToLocalIj:function(t,e,n,r,A,i){var o,s;return t|=0,e|=0,n|=0,r|=0,i|=0,s=M,M=M+16|0,o=s,(A|=0)?t=15:(t=0|ue(t,e,n,r,o))||(mt(o,i),t=0),M=s,0|t},_cellToParent:Rt,_cellToVertex:ve,_cellToVertexes:function(t,e,n){n|=0;var r,i=0,o=0;return o=!(0|Bt(t|=0,e|=0)),r=!(0|(i=0|ve(t,e,0,n))),o?r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||(i=0|ve(t,e,4,n+32|0))?0|(o=i):0|ve(t,e,5,n+40|0):0|(o=i):r?0|(i=0|ve(t,e,1,n+8|0))||0|(i=0|ve(t,e,2,n+16|0))||0|(i=0|ve(t,e,3,n+24|0))||0|(i=0|ve(t,e,4,n+32|0))?0|(o=i):(A[(o=n+40|0)>>2]=0,A[o+4>>2]=0,0|(o=0)):0|(o=i)},_cellsToDirectedEdge:function(t,e,n,r,i){return i|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,r|=0)))?0|(i=11):(r=0|ze(0|n,0,56),e=-2130706433&e|C()|268435456,A[i>>2]=t|r,A[i+4>>2]=e,0|(i=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,i,o,s=0;if(o=M,M=M+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,i,o=0,s=0,a=0,u=0,c=0,l=0;if(i=M,M=M+176|0,r=i,(0|(e|=0))<1)return Ee(n,0,0),M=i,0;for(c=0|Qe(0|A[(c=t)>>2],0|A[c+4>>2],52),C(),Ee(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Xt(0|A[(o=t+(c<<3)|0)>>2],0|A[o+4>>2],r)));){if((0|(o=0|A[r>>2]))>0){u=0;do{a=r+8+(u<<4)|0,(s=0|xe(n,o=r+8+((0|(u=u+1|0))%(0|o)<<4)|0,a))?Ie(n,s):Ce(n,a,o),o=0|A[r>>2]}while((0|u)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,l=13;break}}return 13==(0|l)?(M=i,0|o):(we(n),M=i,0|(l=o))}(t|=0,e|=0,i=o+16|0),0|t)return M=o,0|(n=t);if(A[n>>2]=0,A[n+4>>2]=0,A[n+8>>2]=0,0|(t=0|be(i)))do{e=0|Ae(n);do{ie(e,t),s=t+16|0,A[r>>2]=A[s>>2],A[r+4>>2]=A[s+4>>2],A[r+8>>2]=A[s+8>>2],A[r+12>>2]=A[s+12>>2],Ie(i,t),t=0|Ne(i,r)}while(0|t);t=0|be(i)}while(0|t);return we(i),(t=0|se(n))?(oe(n),M=o,0|(s=t)):(M=o,0|(s=0))},_childPosToCell:function(t,e,n,r,i,o){t|=0,e|=0,o|=0;var s,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(s=M,M=M+16|0,a=s,(i|=0)>>>0>15)return M=s,0|(o=4);if(u=0|Qe(0|(n|=0),0|(r|=0),52),C(),(0|(u&=15))>(0|i))return M=s,0|(o=12);if(0|kt(n,r,i,a)&&x(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(l=0|A[(f=a)+4>>2]))>(0|e)|((0|l)==(0|e)?(0|A[f>>2])>>>0>t>>>0:0))))return M=s,0|(o=2);f=i-u|0,i=0|ze(0|i,0,52),c=C()|-15728641&r,A[(l=o)>>2]=i|n,A[l+4>>2]=c,l=0|Qe(0|n,0|r,45),C();t:do{if(0|U(127&l)){if(0|u)for(a=1;;){if(!(!((l=0|ze(7,0,3*(15-a|0)|0))&n)&!(C()&r)))break t;if(!(a>>>0<u>>>0))break;a=a+1|0}if((0|f)<1)return M=s,0|(o=0);for(l=15^u,r=-1,c=1,a=1;;){u=0|le(7,0,u=f-c|0,((0|u)<0)<<31>>31),n=0|C();do{if(a){if(a=0|ke(0|(a=0|Me(0|(a=0|Be(0|u,0|n,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(i=0|C()))|(0|e)==(0|i)&t>>>0>a>>>0){e=0|Oe(0|(e=0|Me(0|t,0|e,-1,-1)),0|C(),0|a,0|i),a=0|C(),d=0|A[(h=o)>>2],h=0|A[h+4>>2],p=0|ze(7,0,0|(g=3*(l+r|0)|0)),h&=~C(),g=0|ze(0|(i=0|Me(0|(r=0|ke(0|e,0|a,0|u,0|n)),0|(t=0|C()),2,0)),0|C(),0|g),h=C()|h,A[(i=o)>>2]=g|d&~p,A[i+4>>2]=h,t=0|Oe(0|e,0|a,0|(t=0|Be(0|r,0|t,0|u,0|n)),0|C()),a=0,e=0|C();break}p=0|A[(g=o)>>2],g=0|A[g+4>>2],d=0|ze(7,0,3*(l+r|0)|0),g&=~C(),A[(a=o)>>2]=p&~d,A[a+4>>2]=g,a=1;break}i=0|A[(p=o)>>2],p=0|A[p+4>>2],h=0|ze(7,0,0|(r=3*(l+r|0)|0)),p&=~C(),r=0|ze(0|(g=0|ke(0|t,0|e,0|u,0|n)),0|(a=0|C()),0|r),p=C()|p,A[(d=o)>>2]=r|i&~h,A[d+4>>2]=p,t=0|Oe(0|t,0|e,0|(a=0|Be(0|g,0|a,0|u,0|n)),0|C()),a=0,e=0|C()}while(0);if(!((0|f)>(0|c))){e=0;break}r=~c,c=c+1|0}return M=s,0|e}}while(0);if((0|f)<1)return M=s,0|(g=0);for(i=15^u,a=1;;){if(d=0|le(7,0,d=f-a|0,((0|d)<0)<<31>>31),g=0|C(),n=0|A[(c=o)>>2],c=0|A[c+4>>2],r=0|ze(7,0,0|(u=3*(i-a|0)|0)),c&=~C(),u=0|ze(0|(h=0|ke(0|t,0|e,0|d,0|g)),0|(p=0|C()),0|u),c=C()|c,A[(l=o)>>2]=u|n&~r,A[l+4>>2]=c,t=0|Oe(0|t,0|e,0|(g=0|Be(0|h,0|p,0|d,0|g)),0|C()),e=0|C(),(0|f)<=(0|a)){e=0;break}a=a+1|0}return M=s,0|e},_compactCells:function(t,e,n,r){e|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,N=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(I=0);if(s=0|A[(o=t|=0)>>2],!0&!(15728640&(o=0|A[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(I=0);if(A[(I=e)>>2]=s,A[I+4>>2]=o,1==(0|n)&!(0|r))return 0|(I=0);o=1;do{b=0|A[(w=t+(o<<3)|0)+4>>2],A[(I=e+(o<<3)|0)>>2]=A[w>>2],A[I+4>>2]=b,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(b=0|De(i=n<<3)))return 0|(I=13);if(je(0|b,0|t,0|i),!(w=0|Te(n,8)))return Le(b),0|(I=13);t:do{if(0|n){e:for(;;){v=0|Qe(0|(m=0|A[(o=b)>>2]),0|(o=0|A[o+4>>2]),52),C(),E=(v&=15)+-1|0,_=(0|n)>0;n:do{if(!!(0|v)&_){if(d=((0|n)<0)<<31>>31,g=0|ze(0|E,0,52),y=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){I=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(y=0|A[(r=b+(s<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){o=r,I=17;break e}}}for(s=0,t=m,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){I=22;break e}if(u=0|Qe(0|t,0|r,52),C(),(0|(u&=15))<(0|E)){o=12,I=28;break e}if((0|u)!=(0|E)&&(t|=g,r=-15728641&r|y,u>>>0>=v>>>0)){a=E;do{p=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,t|=p,r=C()|r}while(a>>>0<u>>>0)}if(a=0|Ge(0|t,0|r,0|n,0|d),C(),!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2])))a=l;else for(p=0;;){if((0|p)>(0|n)){I=32;break e}if((0|c)==(0|t)&(-117440513&u)==(0|r)){f=0|Qe(0|c,0|u,56),C(),h=(f&=7)+1|0,N=0|Qe(0|c,0|u,45),C();r:do{if(0|U(127&N)){if(c=0|Qe(0|c,0|u,52),C(),!(c&=15)){u=6;break}for(u=1;;){if(!(!((N=0|ze(7,0,3*(15-u|0)|0))&t)&!(C()&r))){u=7;break r}if(!(u>>>0<c>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((f+2|0)>>>0>u>>>0){I=42;break e}N=0|ze(0|h,0,56),r=C()|-117440513&r,A[(h=l)>>2]=0,A[h+4>>2]=0,t|=N}else a=(a+1|0)%(0|n)|0;if(!(0|(c=0|A[(u=l=w+(a<<3)|0)>>2]))&!(0|(u=0|A[u+4>>2]))){a=l;break}p=p+1|0}A[(N=a)>>2]=t,A[N+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|A[(r=b+(s<<3)|0)>>2],r=0|A[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){I=85;break}if(!(y=0|Te((0|n)/6|0,8))){I=49;break}n:do{if(_){p=0,h=0;do{if(!(!(0|(s=0|A[(r=u=w+(p<<3)|0)>>2]))&!(0|(r=0|A[r+4>>2])))){c=0|Qe(0|s,0|r,56),C(),t=(c&=7)+1|0,l=-117440513&r,N=0|Qe(0|s,0|r,45),C();r:do{if(0|U(127&N)){if(f=0|Qe(0|s,0|r,52),C(),0|(f&=15))for(a=1;;){if(!(!(s&(N=0|ze(7,0,3*(15-a|0)|0)))&!(l&C())))break r;if(!(a>>>0<f>>>0))break;a=a+1|0}s|=r=0|ze(0|t,0,56),r=C()|l,A[(t=u)>>2]=s,A[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(A[(N=y+(h<<3)|0)>>2]=s,A[N+4>>2]=-117440513&r,h=h+1|0)}p=p+1|0}while((0|p)!=(0|n));if(_){if(p=((0|n)<0)<<31>>31,d=0|ze(0|E,0,52),g=0|C(),E>>>0>15){if(!(!(0|m)&!(0|o))){o=4,I=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=h;break n}if(!(!(0|A[(N=b+(o<<3)|0)>>2])&!(0|A[N+4>>2]))){o=4,I=84;break e}}}for(f=0,s=0,l=m;;){do{if(!(!(0|l)&!(0|o))){if(u=0|Qe(0|l,0|o,52),C(),(0|(u&=15))<(0|E)){o=12,I=84;break e}do{if((0|u)==(0|E))r=l,u=o;else{if(r=l|d,t=-15728641&o|g,u>>>0<v>>>0){u=t;break}a=E;do{N=0|ze(7,0,3*(14-a|0)|0),a=a+1|0,r|=N,t=C()|t}while(a>>>0<u>>>0);u=t}}while(0);for(a=0|Ge(0|r,0|u,0|n,0|p),C(),t=0;;){if((0|t)>(0|n)){I=77;break e}if((-117440513&(c=0|A[(N=w+(a<<3)|0)+4>>2]))==(0|u)&&(0|A[N>>2])==(0|r)){I=79;break}if((0|A[(N=w+((a=(a+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|A[N+4>>2])==(0|u))break;t=t+1|0}if(79==(0|I)&&(I=0,!0&100663296==(117440512&c)))break;A[(N=e+(s<<3)|0)>>2]=l,A[N+4>>2]=o,s=s+1|0}}while(0);if((0|(o=f+1|0))>=(0|n)){o=h;break n}f=o,l=0|A[(N=b+(o<<3)|0)>>2],o=0|A[N+4>>2]}}else s=0,o=h}else s=0,o=0}while(0);if(He(0|w,0,0|i),je(0|b,0|y,o<<3),Le(y),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|I))!0&!(117440512&o)?(o=4,I=28):I=22;else if(32==(0|I))x(23313,22674,362,22684);else{if(42==(0|I))return Le(b),Le(w),0|(N=10);if(49==(0|I))return Le(b),Le(w),0|(N=13);if(77==(0|I))x(23313,22674,462,22684);else{if(84==(0|I))return Le(y),Le(b),Le(w),0|(N=o);if(85==(0|I)){je(0|e,0|b,n<<3);break}}}if(22==(0|I))return Le(b),Le(w),0|(N=5);if(28==(0|I))return Le(b),Le(w),0|(N=o)}}while(0);return Le(b),Le(w),0|(N=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:bt,_directedEdgeToCells:function(t,e,n){t|=0;var r,i,o,s=0;return r=M,M=M+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(i=-2130706433&e|134217728,A[(o=n|=0)>>2]=t,A[o+4>>2]=i,A[s>>2]=0,e=0|Qe(0|t,0|e,56),C(),s=0|B(t,i,7&e,s,n+8|0),M=r,0|s):(M=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return i[n>>3]=a,u=0,d=a,d*=6371.007180918475,i[n>>3]=d,M=r,0|u},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return u=t,a=+i[n>>3],a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return u=0,a=0,a*=6371.007180918475,a*=1e3,i[n>>3]=a,M=r,0|u;e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+p)*+f(+o)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)!=(0|e));return i[n>>3]=a,u=0,d=a,d*=6371.007180918475,d*=1e3,i[n>>3]=d,M=r,0|u},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,a=0,u=0,l=0,p=0,d=0;if(r=M,M=M+176|0,0|(t=0|bt(t|=0,e|=0,u=r)))return M=r,0|(u=t);if(i[n>>3]=0,(0|(t=0|A[u>>2]))<=1)return M=r,0|(u=0);e=t+-1|0,t=0,o=+i[u+8>>3],s=+i[u+16>>3],a=0;do{p=o,o=+i[u+8+((t=t+1|0)<<4)>>3],d=+h(.5*(o-p)),l=s,s=+i[u+8+(t<<4)+8>>3],l=d*d+(l=+h(.5*(s-l)))*(+f(+o)*+f(+p)*l),a+=2*+_(+ +c(+l),+ +c(+(1-l)))}while((0|t)<(0|e));return i[n>>3]=a,M=r,0|(u=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),A=new Int32Array(t),i=new Float64Array(t),n=t,!0},_free:Le,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,i,o=0;return r=M,M=M+16|0,A[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(i=0|Qe(0|t,0|e,56),C(),o=0|B(t,-2130706433&e|134217728,7&i,o,n),M=r,0|o):(M=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(A[n>>2]=t,A[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(i[e>>3]=+i[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var i,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0;i=M,M=M+128|0,f=i+112|0,a=i+96|0,h=i,s=0|Qe(0|(e|=0),0|(n|=0),52),C(),c=15&s,A[f>>2]=c,u=0|Qe(0|e,0|n,45),C(),u&=127;t:do{if(0|U(u)){if(0|c)for(o=1;;){if(!(!((l=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return l=0|ze(c+1|0,0,52),h=C()|-15728641&n,h=0|t((l|e)&~(f=0|ze(7,0,3*(14-c|0)|0)),h&~C(),r),M=i,0|h;s=1}else s=0}while(0);if(!(o=0|jt(e,n,a))){s?(St(a,f,h),l=5):(Mt(a,f,h),l=6);t:do{if(0|U(u))if(c)for(o=1;;){if(!(!((u=0|ze(7,0,3*(15-o|0)|0))&e)&!(C()&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);He(0|r,-1,e<<2);t:do{if(s)for(a=0;;){if(Lt(u=h+(a<<4)|0,0|A[f>>2]),u=0|A[u>>2],-1==(0|(c=0|A[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}else for(a=0;;){if(Dt(u=h+(a<<4)|0,0|A[f>>2],0,1),u=0|A[u>>2],-1==(0|(c=0|A[r>>2]))|(0|c)==(0|u))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|A[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(A[o>>2]=u,(a=a+1|0)>>>0>=l>>>0){o=0;break}}}while(0)}return M=i,0|(h=o)},_getNumCells:ee,_getPentagons:$t,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{ze(0|e,0,45),r=134225919|C(),A[(n=t+(e<<3)|0)>>2]=-1,A[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,A,o=0;return r=+i[(e|=0)>>3],n=+i[t>>3],o=(A=+h(.5*(r-n)))*A+(o=+h(.5*(+i[e+8>>3]-+i[t+8>>3])))*(+f(+r)*+f(+n)*o),2*+_(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:P,_gridDistance:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s,a=0,u=0;return s=M,M=M+32|0,u=s,0|(o=0|ue(t|=0,e|=0,t,e,a=s+12|0))?(M=s,0|(u=o)):0|(t=0|ue(t,e,n,r,u))?(M=s,0|(u=t)):(a=0|_t(a,u),A[(u=i)>>2]=a,A[u+4>>2]=((0|a)<0)<<31>>31,M=s,0|(u=0))},_gridPathCells:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,N=0,S=0;if(o=M,M=M+48|0,c=o+12|0,N=o,!(s=0|ue(t|=0,e|=0,t,e,a=o+24|0))&&!(s=0|ue(t,e,n,r,c))){I=((0|(b=0|_t(a,c)))<0)<<31>>31,A[a>>2]=0,A[a+4>>2]=0,A[a+8>>2]=0,A[c>>2]=0,A[c+4>>2]=0,A[c+8>>2]=0,0|ue(t,e,t,e,a)&&x(23313,23090,691,23299),0|ue(t,e,n,r,c)&&x(23313,23090,696,23299),Et(a),Et(c),b?(y=+(0|b),w=a,r=p=0|A[a>>2],s=d=0|A[(v=a+4|0)>>2],n=g=0|A[(E=a+8|0)>>2],_=+((0|A[c>>2])-p|0)/y,m=+((0|A[c+4>>2])-d|0)/y,y=+((0|A[c+8>>2])-g|0)/y):(v=s=a+4|0,E=n=a+8|0,w=a,r=0|A[a>>2],s=0|A[s>>2],n=0|A[n>>2],_=0,m=0,y=0),A[N>>2]=r,A[(g=N+4|0)>>2]=s,A[(d=N+8|0)>>2]=n;t:do{if((0|b)<0)s=0;else for(h=0,p=0,s=r;;){S=_*(f=+(p>>>0)+4294967296*+(0|h))+ +(0|s),l=m*f+ +(0|A[v>>2]),f=y*f+ +(0|A[E>>2]),n=~~+Ye(+S),a=~~+Ye(+l),s=~~+Ye(+f),S=+u(+(+(0|n)-S)),l=+u(+(+(0|a)-l)),f=+u(+(+(0|s)-f));do{if(!(S>l&S>f)){if(c=0-n|0,l>f){r=c-s|0;break}r=a,s=c-a|0;break}n=0-(a+s)|0,r=a}while(0);if(A[N>>2]=n,A[g>>2]=r,A[d>>2]=s,wt(N),0|(s=0|ce(t,e,N,i+(p<<3)|0)))break t;if(!((0|h)<(0|I)|(0|h)==(0|I)&p>>>0<b>>>0)){s=0;break t}s=0|Me(0|p,0|h,1,0),h=c=0|C(),p=s,s=0|A[w>>2]}}while(0);return M=o,0|(N=s)}return M=o,0|(N=s)},_gridPathCellsSize:function(t,e,n,r,i){n|=0,r|=0,i|=0;var o,s=0,a=0,u=0;return o=M,M=M+32|0,u=o,(s=0|ue(t|=0,e|=0,t,e,a=o+12|0))||(s=0|ue(t,e,n,r,u))?(M=o,0|(u=s)):(r=0|Me(0|(r=0|_t(a,u)),((0|r)<0)<<31>>31,1,0),a=0|C(),A[(u=i)>>2]=r,A[u+4>>2]=a,M=o,0|(u=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var i,o,s=0,a=0,u=0,c=0,l=0,f=0,h=0,p=0,d=0;if(o=M,M=M+16|0,d=o+8|0,A[(p=i=o)>>2]=t,A[p+4>>2]=e,!n)return A[(d=r)>>2]=t,A[d+4>>2]=e,M=o,0|(d=0);A[d>>2]=0;t:do{if(0|Bt(t,e))t=9;else{if(a=(0|n)>0){s=0,p=t;do{if(0|(t=0|B(p,e,4,d,i)))break t;if(s=s+1|0,0|Bt(p=0|A[(e=i)>>2],e=0|A[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(A[(h=r)>>2]=p,A[h+4>>2]=e,h=n+-1|0,a){f=0,t=1;do{if(s=22384+(f<<2)|0,5==(0|f))for(u=0|A[s>>2],a=0,s=t;;){if(0|(t=0|B(0|A[(t=i)>>2],0|A[t+4>>2],u,d,i)))break t;if((0|a)!=(0|h)){if(c=0|A[(l=i)>>2],l=0|A[l+4>>2],A[(t=r+(s<<3)|0)>>2]=c,A[t+4>>2]=l,0|Bt(c,l)){t=9;break t}t=s+1|0}else t=s;if((0|(a=a+1|0))>=(0|n))break;s=t}else for(u=i,l=0|A[s>>2],c=0,s=t,a=0|A[u>>2],u=0|A[u+4>>2];;){if(0|(t=0|B(a,u,l,d,i)))break t;if(a=0|A[(u=i)>>2],u=0|A[u+4>>2],A[(t=r+(s<<3)|0)>>2]=a,A[t+4>>2]=u,t=s+1|0,0|Bt(a,u)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}f=f+1|0}while(f>>>0<6);u=p,s=0|A[(t=i)>>2],a=e,t=0|A[t+4>>2]}else u=p,s=p,a=e,t=e}else A[(u=r)>>2]=t,A[u+4>>2]=e,u=t,s=t,a=e,t=e;t=(0|u)==(0|s)&(0|a)==(0|t)?0:9}}while(0);return M=o,0|(d=t)},_i64Add:Me,_i64Subtract:Oe,_isPentagon:Bt,_isResClassIII:function(t,e){return e=0|Qe(0|(t|=0),0|(e|=0),52),C(),1&e},_isValidCell:Pt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|Qe(0|(t|=0),0|(e|=0),56),C(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Bt(t,n))?0|(n=0):0|(n=0|Pt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,i=0,o=0;return r=M,M=M+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|Pt(t,i=-2130706433&e|134217728)?(o=0|Qe(0|t,0|e,56),C(),i=(o=!(0|ve(t,i,7&o,n)))&((0|A[(i=n)>>2])==(0|t)?(0|A[i+4>>2])==(0|e):0)&1,M=r,0|i):(M=r,0|(i=0))},_latLngToCell:qt,_llvm_maxnum_f64:Ve,_llvm_minnum_f64:qe,_llvm_round_f64:Ye,_localIjToCell:function(t,e,n,r,A){var i,o;return t|=0,e|=0,n|=0,A|=0,o=M,M=M+16|0,i=o,(r|=0)?n=15:(n=0|vt(n,i))||(n=0|ce(t,e,i,A)),M=o,0|n},_malloc:De,_maxFaceCount:function(t,e,n){n|=0;var r=0,i=0;if(i=0|Qe(0|(t|=0),0|(e|=0),45),C(),!(0|U(127&i)))return i=2,A[n>>2]=i,0;if(i=0|Qe(0|t,0|e,52),C(),!(i&=15))return i=5,A[n>>2]=i,0;for(r=1;;){if(!(!((0|ze(7,0,3*(15-r|0)|0))&t)&!(C()&e))){r=2,t=6;break}if(!(r>>>0<i>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(A[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,i=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(i=0|Be(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|C(),n=0|Me(0|t,0|n,1,0),n=0|Me(0|(n=0|Be(0|i,0|r,0|n,0|C())),0|C(),1,0),t=0|C(),A[e>>2]=n,A[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var i,o=0,s=0,a=0,u=0,c=0;if(i=M,M=M+48|0,o=i+16|0,s=i+8|0,a=i,0|(n|=0))return M=i,0|(a=15);if(u=0|A[(c=t|=0)+4>>2],A[(n=s)>>2]=A[c>>2],A[n+4>>2]=u,he(s,o),!(e=0|$(o,e,a))){if(n=0|A[s>>2],(0|(s=0|A[t+8>>2]))>0){o=0|A[t+12>>2],e=0;do{n=(0|A[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|A[(e=a)>>2],(0|(e=0|A[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(A[(e=a)>>2]=n,A[e+4>>2]=s,e=s):n=o,u=0|Me(0|n,0|e,12,0),c=0|C(),A[(e=a)>>2]=u,A[e+4>>2]=c,A[(e=r)>>2]=u,A[e+4>>2]=c,e=0}return M=i,0|(c=e)},_memcpy:je,_memset:He,_originToDirectedEdges:function(t,e,n){n|=0;var r,i=0;return r=!(0|Bt(t|=0,e|=0)),e&=-2130706433,A[(i=n)>>2]=r?t:0,A[i+4>>2]=r?285212672|e:0,A[(i=n+8|0)>>2]=t,A[i+4>>2]=301989888|e,A[(i=n+16|0)>>2]=t,A[i+4>>2]=318767104|e,A[(i=n+24|0)>>2]=t,A[i+4>>2]=335544320|e,A[(i=n+32|0)>>2]=t,A[i+4>>2]=352321536|e,A[(n=n+40|0)>>2]=t,A[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var i,o,s,a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0,y=0,_=0,m=0,v=0,E=0,w=0,b=0,I=0,x=0,N=0,S=0,D=0,L=0,T=0,O=0,P=0,B=0,F=0,U=0;if(a=M,M=M+112|0,i=a+80|0,h=a+72|0,o=a,s=a+56|0,0|(n|=0))return M=a,0|(U=15);if(!(U=0|De(32+(A[(p=(t|=0)+8|0)>>2]<<5)|0)))return M=a,0|(U=13);if(pe(t,U),F=0|A[(B=t)+4>>2],A[(n=h)>>2]=A[B>>2],A[n+4>>2]=F,he(h,i),n=0|$(i,e,o))B=0,F=0;else{if(n=0|A[h>>2],(0|(c=0|A[p>>2]))>0){l=0|A[t+12>>2],u=0;do{n=(0|A[l+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|c));u=n}else u=n;c=0|A[(n=o)>>2],(0|(n=0|A[n+4>>2]))<(0|(l=((0|u)<0)<<31>>31))|(0|n)==(0|l)&c>>>0<u>>>0?(A[(n=o)>>2]=u,A[n+4>>2]=l,n=l):u=c,B=0|Me(0|u,0|n,12,0),F=0|C(),A[(n=o)>>2]=B,A[n+4>>2]=F,n=0}if(0|n)return Le(U),M=a,0|(U=n);if(!(u=0|Te(B,8)))return Le(U),M=a,0|(U=13);if(!(f=0|Te(B,8)))return Le(U),Le(u),M=a,0|(U=13);A[(O=i)>>2]=0,A[O+4>>2]=0,P=0|A[(O=t)+4>>2],A[(n=h)>>2]=A[O>>2],A[n+4>>2]=P,n=0|G(h,B,F,e,i,u,f);t:do{if(n)Le(u),Le(f),Le(U);else{e:do{if((0|A[p>>2])>0){for(l=t+12|0,c=0;n=0|G((0|A[l>>2])+(c<<3)|0,B,F,e,i,u,f),c=c+1|0,!(0|n);)if((0|c)>=(0|A[p>>2]))break e;Le(u),Le(f),Le(U);break t}}while(0);(0|F)>0|!(0|F)&B>>>0>0&&He(0|f,0,B<<3),O=0|A[(P=i)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|A[P>>2])>>>0>0){D=u,L=f,T=u,O=f,P=u,n=u,x=u,N=f,S=f,u=f;n:for(;;){for(E=0,w=0,b=0,I=0,c=0,l=0;;){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));if(0|R(p=0|A[(e=D+(E<<3)|0)>>2],e=0|A[e+4>>2],1,o,0)){h=(f=o)+56|0;do{A[f>>2]=0,f=f+4|0}while((0|f)<(0|h));0|(f=0|Te(7,4))&&(k(p,e,1,o,f,7,0,0),Le(f))}for(v=0;;){_=0|A[(m=o+(v<<3)|0)>>2],m=0|A[m+4>>2];r:do{if(!(0|_)&!(0|m))f=c,h=l;else{if(d=0|Ge(0|_,0|m,0|B,0|F),p=0|C(),!(!(0|(h=0|A[(e=f=r+(d<<3)|0)>>2]))&!(0|(e=0|A[e+4>>2])))){g=0,y=0;do{if((0|g)>(0|F)|(0|g)==(0|F)&y>>>0>B>>>0)break n;if((0|h)==(0|_)&(0|e)==(0|m)){f=c,h=l;break r}d=0|Fe(0|(f=0|Me(0|d,0|p,1,0)),0|C(),0|B,0|F),p=0|C(),y=0|Me(0|y,0|g,1,0),g=0|C(),h=0|A[(e=f=r+(d<<3)|0)>>2],e=0|A[e+4>>2]}while(!(!(0|h)&!(0|e)))}!(0|_)&!(0|m)?(f=c,h=l):(Ht(_,m,s),0|de(t,U,s)&&(y=0|Me(0|c,0|l,1,0),l=0|C(),A[(g=f)>>2]=_,A[g+4>>2]=m,A[(c=L+(c<<3)|0)>>2]=_,A[c+4>>2]=m,c=y),f=c,h=l)}}while(0);if((v=v+1|0)>>>0>=7)break;c=f,l=h}if(E=0|Me(0|E,0|w,1,0),w=0|C(),b=0|Me(0|b,0|I,1,0),I=0|C(),c=0|A[(l=i)>>2],!((0|I)<(0|(l=0|A[l+4>>2]))|(0|I)==(0|l)&b>>>0<c>>>0))break;c=f,l=h}if((0|l)>0|!(0|l)&c>>>0>0){c=0,l=0;do{A[(I=D+(c<<3)|0)>>2]=0,A[I+4>>2]=0,c=0|Me(0|c,0|l,1,0),l=0|C(),b=0|A[(I=i)+4>>2]}while((0|l)<(0|b)|((0|l)==(0|b)?c>>>0<(0|A[I>>2])>>>0:0))}if(A[(I=i)>>2]=f,A[I+4>>2]=h,!((0|h)>0|!(0|h)&f>>>0>0))break e;v=u,E=S,w=P,b=N,I=L,u=x,S=n,N=T,x=v,n=E,P=O,O=w,T=b,L=D,D=I}Le(T),Le(O),Le(U),n=1;break t}n=f}while(0);Le(U),Le(u),Le(n),n=0}}while(0);return M=a,0|(U=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|A[(t|=0)>>2])>>>0)+4294967296*+(0|A[t+4>>2]))},_res0CellCount:function(){return 122},_round:Xe,_sbrk:$e,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,i,o,s){t|=0,r|=0,i|=0,o|=0;var a,u=0,c=0,l=0,f=0,h=0,p=0,d=0,g=0;if(a=M,M=M+16|0,g=a,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return M=a,0|(g=0);if((0|(s|=0))>=16)return M=a,0|(g=12);p=0,d=0,h=0,u=0;t:for(;;){if(f=0|Qe(0|(c=0|A[(l=t+(p<<3)|0)>>2]),0|(l=0|A[l+4>>2]),52),C(),(15&f)>(0|s)){u=12,c=11;break}if(Wt(g,c,l,s),!(0|(l=0|A[(f=g)>>2]))&!(0|(f=0|A[f+4>>2])))c=h;else{c=h;do{if(!((0|u)<(0|o)|(0|u)==(0|o)&c>>>0<i>>>0)){c=10;break t}A[(h=r+(c<<3)|0)>>2]=l,A[h+4>>2]=f,c=0|Me(0|c,0|u,1,0),u=0|C(),Kt(g),l=0|A[(h=g)>>2],f=0|A[h+4>>2]}while(!(!(0|l)&!(0|f)))}if(p=0|Me(0|p,0|d,1,0),!((0|(d=0|C()))<(0|n)|(0|d)==(0|n)&p>>>0<e>>>0)){u=0,c=11;break}h=c}return 10==(0|c)?(M=a,0|(g=14)):11==(0|c)?(M=a,0|u):0},_uncompactCellsSize:function(t,e,n,r,i){t|=0,e|=0,n|=0,r|=0,i|=0;var o,s,a=0,u=0,c=0,l=0,f=0,h=0;s=M,M=M+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(f=0,u=0,a=0,h=0;;){if(!(!(0|(c=0|A[(l=t+(f<<3)|0)>>2]))&!(0|(l=0|A[l+4>>2]))||(l=!(0|kt(c,l,r,o)),u=0|Me(0|A[(c=o)>>2],0|A[c+4>>2],0|u,0|a),a=0|C(),l))){a=12;break}if(f=0|Me(0|f,0|h,1,0),!((0|(h=0|C()))<(0|n)|(0|h)==(0|n)&f>>>0<e>>>0))break t}return M=s,0|a}u=0,a=0}while(0);return A[i>>2]=u,A[i+4>>2]=a,M=s,0|(i=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,i,o,s,a=0,u=0;return s=M,M=M+192|0,i=s,o=s+168|0,a=0|Qe(0|(t|=0),0|(e|=0),56),C(),a&=7,0|(r=0|jt(t,u=-2130706433&e|134217728,o))?(M=s,0|(u=r)):(e=0|Qe(0|t,0|e,52),C(),e&=15,0|Bt(t,u)?Nt(o,e,a,1,i):Tt(o,e,a,1,i),u=i+8|0,A[n>>2]=A[u>>2],A[n+4>>2]=A[u+4>>2],A[n+8>>2]=A[u+8>>2],A[n+12>>2]=A[u+12>>2],M=s,0|(u=0))},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(t){a=t},c:function(){return a},d:function(t,e,n,r){et("Assertion failed: "+v(t)+", at: "+[e?v(e):"unknown filename",n,r?v(r):"unknown function"])},e:function(t){return n.___errno_location&&(g[n.___errno_location()>>2]=t),t},f:U,g:function(t,e,n){p.set(p.subarray(e,e+n),t)},h:function(t){var e=U(),n=16777216,r=2130706432;if(t>r)return!1;for(var A=Math.max(e,16777216);A<t;)A=A<=536870912?E(2*A,n):Math.min(E((3*A+2147483648)/4,n),r);return!!function(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(h),q(e),w(e),1}catch(t){}}(A)},i:function(t){et("OOM")},o:24144,p:24128},f);n.___divdi3=V.___divdi3,n.___muldi3=V.___muldi3,n.___remdi3=V.___remdi3,n.___uremdi3=V.___uremdi3,n._areNeighborCells=V._areNeighborCells,n._bitshift64Ashr=V._bitshift64Ashr,n._bitshift64Lshr=V._bitshift64Lshr,n._bitshift64Shl=V._bitshift64Shl,n._calloc=V._calloc,n._cellAreaKm2=V._cellAreaKm2,n._cellAreaM2=V._cellAreaM2,n._cellAreaRads2=V._cellAreaRads2,n._cellToBoundary=V._cellToBoundary,n._cellToCenterChild=V._cellToCenterChild,n._cellToChildPos=V._cellToChildPos,n._cellToChildren=V._cellToChildren,n._cellToChildrenSize=V._cellToChildrenSize,n._cellToLatLng=V._cellToLatLng,n._cellToLocalIj=V._cellToLocalIj,n._cellToParent=V._cellToParent,n._cellToVertex=V._cellToVertex,n._cellToVertexes=V._cellToVertexes,n._cellsToDirectedEdge=V._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=V._cellsToLinkedMultiPolygon,n._childPosToCell=V._childPosToCell,n._compactCells=V._compactCells,n._destroyLinkedMultiPolygon=V._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=V._directedEdgeToBoundary,n._directedEdgeToCells=V._directedEdgeToCells,n._edgeLengthKm=V._edgeLengthKm,n._edgeLengthM=V._edgeLengthM,n._edgeLengthRads=V._edgeLengthRads;var q=n._emscripten_replace_memory=V._emscripten_replace_memory;n._free=V._free,n._getBaseCellNumber=V._getBaseCellNumber,n._getDirectedEdgeDestination=V._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=V._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=V._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=V._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=V._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=V._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=V._getIcosahedronFaces,n._getNumCells=V._getNumCells,n._getPentagons=V._getPentagons,n._getRes0Cells=V._getRes0Cells,n._getResolution=V._getResolution,n._greatCircleDistanceKm=V._greatCircleDistanceKm,n._greatCircleDistanceM=V._greatCircleDistanceM,n._greatCircleDistanceRads=V._greatCircleDistanceRads,n._gridDisk=V._gridDisk,n._gridDiskDistances=V._gridDiskDistances,n._gridDistance=V._gridDistance,n._gridPathCells=V._gridPathCells,n._gridPathCellsSize=V._gridPathCellsSize,n._gridRingUnsafe=V._gridRingUnsafe,n._i64Add=V._i64Add,n._i64Subtract=V._i64Subtract,n._isPentagon=V._isPentagon,n._isResClassIII=V._isResClassIII,n._isValidCell=V._isValidCell,n._isValidDirectedEdge=V._isValidDirectedEdge,n._isValidVertex=V._isValidVertex,n._latLngToCell=V._latLngToCell,n._llvm_maxnum_f64=V._llvm_maxnum_f64,n._llvm_minnum_f64=V._llvm_minnum_f64,n._llvm_round_f64=V._llvm_round_f64,n._localIjToCell=V._localIjToCell,n._malloc=V._malloc,n._maxFaceCount=V._maxFaceCount,n._maxGridDiskSize=V._maxGridDiskSize,n._maxPolygonToCellsSize=V._maxPolygonToCellsSize,n._memcpy=V._memcpy,n._memset=V._memset,n._originToDirectedEdges=V._originToDirectedEdges,n._pentagonCount=V._pentagonCount,n._polygonToCells=V._polygonToCells,n._readInt64AsDoubleFromPointer=V._readInt64AsDoubleFromPointer,n._res0CellCount=V._res0CellCount,n._round=V._round,n._sbrk=V._sbrk,n._sizeOfCellBoundary=V._sizeOfCellBoundary,n._sizeOfCoordIJ=V._sizeOfCoordIJ,n._sizeOfGeoLoop=V._sizeOfGeoLoop,n._sizeOfGeoPolygon=V._sizeOfGeoPolygon,n._sizeOfH3Index=V._sizeOfH3Index,n._sizeOfLatLng=V._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=V._sizeOfLinkedGeoPolygon,n._uncompactCells=V._uncompactCells,n._uncompactCellsSize=V._uncompactCellsSize,n._vertexToLatLng=V._vertexToLatLng,n.establishStackSpace=V.establishStackSpace;var Y,j,H=n.stackAlloc=V.stackAlloc,X=n.stackRestore=V.stackRestore,$=n.stackSave=V.stackSave;if(n.asm=V,n.cwrap=function(t,e,n,r){var A=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&A&&!r?c(t):function(){return l(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":h[t|0]=e;break;case"i16":d[t>>1]=e;break;case"i32":g[t>>2]=e;break;case"i64":k=[e>>>0,(R=e,+D(R)>=1?R>0?(0|M(+T(R/4294967296),4294967295))>>>0:~~+L((R-+(~~R>>>0))/4294967296)>>>0:0)],g[t>>2]=k[0],g[t+4>>2]=k[1];break;case"float":y[t>>2]=e;break;case"double":_[t>>3]=e;break;default:et("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return h[t|0];case"i16":return d[t>>1];case"i32":case"i64":return g[t>>2];case"float":return y[t>>2];case"double":return _[t>>3];default:et("invalid type for getValue: "+e)}return null},B){G(B)||(Y=B,B=n.locateFile?n.locateFile(Y,i):i+Y),O++,n.monitorRunDependencies&&n.monitorRunDependencies(O);var W=function(t){t.byteLength&&(t=new Uint8Array(t)),p.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(O--,n.monitorRunDependencies&&n.monitorRunDependencies(O),0==O&&P){var t=P;P=null,t()}}()},K=function(){A(B,W,(function(){throw"could not load memory initializer "+B}))},Z=z(B);if(Z)W(Z.buffer);else if(n.memoryInitializerRequest){var J=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=z(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+B),void K();e=r.buffer}W(e)};n.memoryInitializerRequest.response?setTimeout(J,0):n.memoryInitializerRequest.addEventListener("load",J)}else K()}function tt(t){function e(){j||(j=!0,u||(I(x),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),S.unshift(t);var t;I(S)}()))}O>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),C.unshift(t);var t;I(C)}(),O>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function et(t){throw n.onAbort&&n.onAbort(t),o(t+=""),s(t),u=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(P=function t(){j||tt(),j||(P=t)},n.run=tt,n.abort=et,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return tt(),t}("object"==typeof _A?_A:{}),mA="number",vA=[["sizeOfH3Index",mA],["sizeOfLatLng",mA],["sizeOfCellBoundary",mA],["sizeOfGeoLoop",mA],["sizeOfGeoPolygon",mA],["sizeOfLinkedGeoPolygon",mA],["sizeOfCoordIJ",mA],["readInt64AsDoubleFromPointer",mA],["isValidCell",mA,[mA,mA]],["latLngToCell",mA,[mA,mA,mA,mA]],["cellToLatLng",mA,[mA,mA,mA]],["cellToBoundary",mA,[mA,mA,mA]],["maxGridDiskSize",mA,[mA,mA]],["gridDisk",mA,[mA,mA,mA,mA]],["gridDiskDistances",mA,[mA,mA,mA,mA,mA]],["gridRingUnsafe",mA,[mA,mA,mA,mA]],["maxPolygonToCellsSize",mA,[mA,mA,mA,mA]],["polygonToCells",mA,[mA,mA,mA,mA]],["cellsToLinkedMultiPolygon",mA,[mA,mA,mA]],["destroyLinkedMultiPolygon",null,[mA]],["compactCells",mA,[mA,mA,mA,mA]],["uncompactCells",mA,[mA,mA,mA,mA,mA,mA]],["uncompactCellsSize",mA,[mA,mA,mA,mA,mA]],["isPentagon",mA,[mA,mA]],["isResClassIII",mA,[mA,mA]],["getBaseCellNumber",mA,[mA,mA]],["getResolution",mA,[mA,mA]],["maxFaceCount",mA,[mA,mA,mA]],["getIcosahedronFaces",mA,[mA,mA,mA]],["cellToParent",mA,[mA,mA,mA,mA]],["cellToChildren",mA,[mA,mA,mA,mA]],["cellToCenterChild",mA,[mA,mA,mA,mA]],["cellToChildrenSize",mA,[mA,mA,mA,mA]],["cellToChildPos",mA,[mA,mA,mA,mA]],["childPosToCell",mA,[mA,mA,mA,mA,mA,mA]],["areNeighborCells",mA,[mA,mA,mA,mA,mA]],["cellsToDirectedEdge",mA,[mA,mA,mA,mA,mA]],["getDirectedEdgeOrigin",mA,[mA,mA,mA]],["getDirectedEdgeDestination",mA,[mA,mA,mA]],["isValidDirectedEdge",mA,[mA,mA]],["directedEdgeToCells",mA,[mA,mA,mA]],["originToDirectedEdges",mA,[mA,mA,mA]],["directedEdgeToBoundary",mA,[mA,mA,mA]],["gridDistance",mA,[mA,mA,mA,mA,mA]],["gridPathCells",mA,[mA,mA,mA,mA,mA]],["gridPathCellsSize",mA,[mA,mA,mA,mA,mA]],["cellToLocalIj",mA,[mA,mA,mA,mA,mA,mA]],["localIjToCell",mA,[mA,mA,mA,mA,mA]],["getHexagonAreaAvgM2",mA,[mA,mA]],["getHexagonAreaAvgKm2",mA,[mA,mA]],["getHexagonEdgeLengthAvgM",mA,[mA,mA]],["getHexagonEdgeLengthAvgKm",mA,[mA,mA]],["greatCircleDistanceM",mA,[mA,mA]],["greatCircleDistanceKm",mA,[mA,mA]],["greatCircleDistanceRads",mA,[mA,mA]],["cellAreaM2",mA,[mA,mA,mA]],["cellAreaKm2",mA,[mA,mA,mA]],["cellAreaRads2",mA,[mA,mA,mA]],["edgeLengthM",mA,[mA,mA,mA]],["edgeLengthKm",mA,[mA,mA,mA]],["edgeLengthRads",mA,[mA,mA,mA]],["getNumCells",mA,[mA,mA]],["getRes0Cells",mA,[mA]],["res0CellCount",mA],["getPentagons",mA,[mA,mA]],["pentagonCount",mA],["cellToVertex",mA,[mA,mA,mA,mA]],["cellToVertexes",mA,[mA,mA,mA]],["vertexToLatLng",mA,[mA,mA,mA]],["isValidVertex",mA,[mA,mA]]],EA=4,wA={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};wA[EA]="Resolution argument was outside of acceptable range",wA[5]="Cell argument was not valid",wA[6]="Directed edge argument was not valid",wA[7]="Undirected edge argument was not valid",wA[8]="Vertex argument was not valid",wA[9]="Pentagon distortion was encountered",wA[10]="Duplicate input",wA[11]="Cell arguments were not neighbors",wA[12]="Cell arguments had incompatible resolutions",wA[13]="Memory allocation failed",wA[14]="Bounds of provided memory were insufficient",wA[15]="Mode or flags argument was not valid";var bA=1001,IA=1002,CA={1e3:"Unknown unit"};CA[bA]="Array length out of bounds",CA[IA]="Got unexpected null value for H3 index";var xA="Unknown error";function NA(t,e,n){var r=n&&"value"in n,A=new Error((t[e]||xA)+" (code: "+e+(r?", value: "+n.value:"")+")");return A.code=e,A}function SA(t,e){return NA(wA,t,2===arguments.length?{value:e}:{})}function DA(t,e){return NA(CA,t,2===arguments.length?{value:e}:{})}function LA(t){if(0!==t)throw SA(t)}var TA={};vA.forEach((function(t){TA[t[0]]=_A.cwrap.apply(_A,t)}));var MA=16,OA=4,PA=8,RA=TA.sizeOfH3Index(),kA=TA.sizeOfLatLng(),BA=TA.sizeOfCellBoundary(),FA=TA.sizeOfGeoPolygon(),GA=TA.sizeOfGeoLoop();function UA(t){if(!t)throw DA(IA);return t}TA.sizeOfLinkedGeoPolygon(),TA.sizeOfCoordIJ();var QA=Math.pow(2,32)-1;var zA=/[^0-9a-fA-F]/;function VA(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||zA.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),MA);return[parseInt(t.substring(t.length-8),MA),e]}function qA(t){if(t>=0)return t.toString(MA);var e=YA(8,(t&=2147483647).toString(MA));return e=(parseInt(e[0],MA)+8).toString(MA)+e.substring(1)}function YA(t,e){for(var n=t-e.length,r="",A=0;A<n;A++)r+="0";return r+=e}var jA=Math.pow(2,32);function HA(t,e,n){for(var r=t.length,A=_A._calloc(r,kA),i=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)_A.HEAPF64.set([t[s/2][i],t[s/2][o]].map(ei),A/PA+s);return _A.HEAPU32.set([r,A],e/OA),e}function XA(t,e){void 0===e&&(e=0);var n=_A.getValue(t+RA*e,"i32"),r=_A.getValue(t+RA*e+OA,"i32");return r?function(t,e){return qA(e)+YA(8,qA(t))}(n,r):null}function $A(t){return function(t){return 180*t/Math.PI}(_A.getValue(t,"double"))}function WA(t){return[$A(t+PA),$A(t)]}function KA(t,e){var n=_A._malloc(BA),r=VA(t),A=r[0],i=r[1];try{return LA(TA.cellToBoundary(A,i,n)),function(t){for(var e=_A.getValue(t,"i32"),n=t+PA,r=[],A=WA,i=0;i<2*e;i+=2)r.push(A(n+PA*i));return r.push(r[0]),r}(n)}finally{_A._free(n)}}function ZA(t,e){var n=VA(t),r=n[0],A=n[1],i=_A._malloc(RA);try{return LA(TA.cellToParent(r,A,e,i)),UA(XA(i))}finally{_A._free(i)}}function JA(t,e,n){var r,A="number"!=typeof(r=t)?[0,0]:[0|r,r/jA|0],i=A[0],o=A[1],s=VA(e),a=s[0],u=s[1],c=_A._malloc(RA);try{return LA(TA.childPosToCell(i,o,a,u,n,c)),UA(XA(c))}finally{_A._free(c)}}function ti(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw SA(EA,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,A=function(t,e){var n,r=t.length-1,A=_A._calloc(FA),i=0+GA,o=i+OA;if(HA(t[0],A+0,e),r>0){n=_A._calloc(r,GA);for(var s=0;s<r;s++)HA(t[s+1],n+GA*s,e)}return _A.setValue(A+i,r,"i32"),_A.setValue(A+o,n,"i32"),A}("number"==typeof t[0][0]?[t]:t,n),i=_A._malloc(8);try{LA(TA.maxPolygonToCellsSize(A,e,0,i));var o=function(t){if(t>QA)throw DA(bA,t);return t}((r=i,TA.readInt64AsDoubleFromPointer(r))),s=_A._calloc(o,RA);try{return LA(TA.polygonToCells(A,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var A=XA(t,r);null!==A&&n.push(A)}return n}(s,o)}finally{_A._free(s)}}finally{_A._free(i),function(t){var e=0+GA,n=e+OA,r=OA;_A._free(_A.getValue(t+0+r,"i8*"));var A=_A.getValue(t+e,"i32");if(A>0){for(var i=_A.getValue(t+n,"i32"),o=0;o<A;o++)_A._free(_A.getValue(i+GA*o+r,"i8*"));_A._free(i)}_A._free(t)}(A)}}function ei(t){return t*Math.PI/180}const ni=({icao:t,mapping:e})=>{if(!t)throw new aA("Missing ICAO code.");if(!e)throw new aA("Missing aircraft mapping.");const n=e.find((e=>e.icao.toUpperCase()===t.toUpperCase()))?.group;if(!n)throw new aA(`Aircraft type not found for ICAO: ${t}`);return n},ri=({value:t})=>void 0===t,Ai=({fn:t})=>"function"==typeof t,ii=({value:t})=>"object"==typeof t,oi=({time:t})=>{let e;const n=()=>{clearTimeout(e),e=null};return{run:r=>{n(),e=setTimeout(r,t)},cancel:n}},si=({current:t,next:e})=>{if(ri({value:e}))return!1;const n=ii({value:e}),r=Array.isArray(e);return n&&!r?Object.keys(e).some((n=>si({current:t?.[n],next:e[n]}))):r?e.some(((e,n)=>si({current:t?.[n],next:e}))):t!==e},ai=({current:t,next:e})=>Object.keys(e).reduce(((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t)),{...t}),ui=({current:t,next:e})=>{const n=new Set,r=!ri({value:t})&&ii({value:t});if(!(!ri({value:e})&&ii({value:e})))return n;const A=Object.keys(e);return r?(A.forEach((r=>{si({current:t[r],next:e[r]})&&n.add(r)})),n):(A.forEach((t=>n.add(t))),n)};var ci=Object.freeze({__proto__:null,buildDataKeyFromComponents:({components:t,separator:e="-"})=>t.join(e),debounce:({fn:t,delay:e})=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>t(...r)),e)}},getChangedFields:ui,getTimer:oi,isChanged:si,isFunction:Ai,isObject:ii,isUndefined:ri,mapAircraftIcaoToAircraftType:ni,mergeByProperty:({target:t,source:e,propName:n})=>{const r=[...t];return e.forEach((t=>{let e=r.find((e=>t[n]===e[n]));e?Object.assign(e,t):r.push(t)})),r},mergeWithoutUndefined:ai,parseDataKeyToComponents:({dataKey:t,separator:e="-"})=>t.split(e),throttle:({fn:t,delay:e})=>{let n=0;return(...r)=>{const A=(new Date).getTime();A-n<e||(n=A,t(...r))}}}),li=6371008.8,fi={centimeters:100*li,centimetres:100*li,degrees:li/111325,feet:3.28084*li,inches:39.37*li,kilometers:li/1e3,kilometres:li/1e3,meters:li,metres:li,miles:li/1609.344,millimeters:1e3*li,millimetres:1e3*li,nauticalmiles:li/1852,radians:1,yards:1.0936*li};function hi(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function pi(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ei(t[0])||!Ei(t[1]))throw new Error("coordinates must contain numbers");return hi({type:"Point",coordinates:t},e,n)}function di(t,e,n){void 0===n&&(n={});for(var r=0,A=t;r<A.length;r++){var i=A[r];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return hi({type:"Polygon",coordinates:t},e,n)}function gi(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function yi(t,e){void 0===e&&(e="kilometers");var n=fi[e];if(!n)throw new Error(e+" units is invalid");return t*n}function _i(t,e){void 0===e&&(e="kilometers");var n=fi[e];if(!n)throw new Error(e+" units is invalid");return t/n}function mi(t){return t%360*Math.PI/180}function vi(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return yi(_i(t,e),n)}function Ei(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function wi(t,e,n){if(null!==t)for(var r,A,i,o,s,a,u,c,l=0,f=0,h=t.type,p="FeatureCollection"===h,d="Feature"===h,g=p?t.features.length:1,y=0;y<g;y++){s=(c=!!(u=p?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var _=0;_<s;_++){var m=0,v=0;if(null!==(o=c?u.geometries[_]:u)){a=o.coordinates;var E=o.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===e(a,f,y,m,v))return!1;f++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<a.length;r++){if(!1===e(a[r],f,y,m,v))return!1;f++,"MultiPoint"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<a.length;r++){for(A=0;A<a[r].length-l;A++){if(!1===e(a[r][A],f,y,m,v))return!1;f++}"MultiLineString"===E&&m++,"Polygon"===E&&v++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<a.length;r++){for(v=0,A=0;A<a[r].length;A++){for(i=0;i<a[r][A].length-l;i++){if(!1===e(a[r][A][i],f,y,m,v))return!1;f++}v++}m++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===wi(o.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bi(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Ii(t,e){var n,r,A,i,o,s,a,u,c,l,f=0,h="FeatureCollection"===t.type,p="Feature"===t.type,d=h?t.features.length:1;for(n=0;n<d;n++){for(s=h?t.features[n].geometry:p?t.geometry:t,u=h?t.features[n].properties:p?t.properties:{},c=h?t.features[n].bbox:p?t.bbox:void 0,l=h?t.features[n].id:p?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,A=0;A<o;A++)if(null!==(i=a?s.geometries[A]:s))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,f,u,c,l))return!1;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===e(i.geometries[r],f,u,c,l))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,u,c,l))return!1;f++}}function Ci(t){var e=[1/0,1/0,-1/0,-1/0];return wi(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function xi(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ni(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Si(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return Si(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Li(t);default:throw new Error("unknown GeoJSON type")}}function Si(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=Di(t.properties),e.geometry=Li(t.geometry),e}function Di(t){var e={};return t?(Object.keys(t).forEach((function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map((function(t){return t})):e[n]=Di(r):e[n]=r})),e):e}function Li(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Li(t)})),e):(e.coordinates=Ti(t.coordinates),e)}function Ti(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Ti(t)}))}function Mi(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),A=Number(t[2]),i=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[n,r];return di([[o,[A,r],[A,i],[n,i],o]],e.properties,{bbox:t,id:e.id})}function Oi(t,e){void 0===e&&(e={});var n=Ci(t);return pi([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}function Pi(t,e,n){void 0===n&&(n={});var r=xi(t),A=xi(e);A[0]+=A[0]-r[0]>180?-360:r[0]-A[0]>180?360:0;var i=function(t,e,n){var r=n=void 0===n?li:Number(n),A=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-A,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var a=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(A/2+Math.PI/4)),u=Math.abs(a)>1e-11?o/a:Math.cos(A);return Math.sqrt(o*o+u*u*s*s)*r}(r,A);return vi(i,"meters",n.units)}Ci.default=Ci;var Ri=6378137;function ki(t){return function(t,e,n){var r=n;return Ii(t,(function(t,n,A,i,o){r=e(r,t,n,A,i,o)})),r}(t,(function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Bi(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Bi(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}function Bi(t){var e=0;if(t&&t.length>0){e+=Math.abs(Fi(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Fi(t[n]))}return e}function Fi(t){var e,n,r,A,i,o,s=0,a=t.length;if(a>2){for(o=0;o<a;o++)o===a-2?(r=a-2,A=a-1,i=0):o===a-1?(r=a-1,A=0,i=1):(r=o,A=o+1,i=o+2),e=t[r],n=t[A],s+=(Gi(t[i][0])-Gi(e[0]))*Math.sin(Gi(n[1]));s=s*Ri*Ri/2}return s}function Gi(t){return t*Math.PI/180}function Ui(t,e){var n=mi(t[1]),r=mi(e[1]),A=mi(e[0]-t[0]);A>Math.PI&&(A-=2*Math.PI),A<-Math.PI&&(A+=2*Math.PI);var i=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(function(t){return t%(2*Math.PI)*180/Math.PI}(Math.atan2(A,i))+360)%360}function Qi(t,e,n,r){void 0===r&&(r={});var A=e<0,i=vi(Math.abs(e),r.units,"meters");A&&(i=-Math.abs(i));var o=xi(t),s=function(t,e,n,r){r=void 0===r?li:Number(r);var A=e/r,i=t[0]*Math.PI/180,o=mi(t[1]),s=mi(n),a=A*Math.cos(s),u=o+a;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),l=Math.abs(c)>1e-11?a/c:Math.cos(o),f=A*Math.sin(s)/l;return[(180*(i+f)/Math.PI+540)%360-180,180*u/Math.PI]}(o,i,n);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,pi(s,r.properties)}function zi(t,e,n){if(!(r=n=n||{})||r.constructor!==Object)throw new Error("options is invalid");var r,A=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(A)||"object"==typeof A;return!0!==i&&(t=Ni(t)),"FeatureCollection"!==t.type||o?Vi(t,e,A):(bi(t,(function(n,r){t.features[r]=Vi(n,e,A)})),t)}function Vi(t,e,n){var r,A="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":"Feature"===r.type&&null!==r.geometry?r.geometry.type:r.type);return n=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"==typeof e)return xi(e);var n=t.bbox?t.bbox:Ci(t),r=n[0],A=n[1],i=n[2],o=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return pi([r,A]);case"se":case"southeast":case"eastsouth":case"bottomright":return pi([i,A]);case"nw":case"northwest":case"westnorth":case"topleft":return pi([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return pi([i,o]);case"center":return Oi(t);case void 0:case null:case"centroid":return function(t,e){void 0===e&&(e={});var n=0,r=0,A=0;return wi(t,(function(t){n+=t[0],r+=t[1],A++}),!0),pi([n/A,r/A],e.properties)}(t);default:throw new Error("invalid origin")}}(t,n),1===e||A||wi(t,(function(t){var r,A,i,o,s=Pi(n,t),a=(r=n,A=t,void 0===i&&(i={}),(o=i.final?Ui(xi(A),xi(r)):Ui(xi(r),xi(A)))>180?-(360-o):o),u=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(Qi(n,s*e,a));t[0]=u[0],t[1]=u[1],3===t.length&&(t[2]*=e)})),t}var qi={exports:{}};!function(t,e){!function(t){function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function A(t){this.message=t||""}function i(){}function o(t){return null===t?Pt:t.color}function s(t){return null===t?null:t.parent}function a(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function l(){this.root_=null,this.size_=0}function f(){}function h(){this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}function p(){}function d(t){this.message=t||""}function g(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var A=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(A=A<0?Math.max(n+arguments[2],0):Math.min(A,n);r<A;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},v={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},v.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,v);var E=function(){},w=function(){},b=function(){},I=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},C={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};I.prototype.setOrdinate=function(t,e){switch(t){case I.X:this.x=e;break;case I.Y:this.y=e;break;case I.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},I.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},I.prototype.getOrdinate=function(t){switch(t){case I.X:return this.x;case I.Y:return this.y;case I.Z:return this.z}throw new _("Invalid ordinate index: "+t)},I.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},I.prototype.equals=function(t){return t instanceof I&&this.equals2D(t)},I.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},I.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},I.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},I.prototype.hashCode=function(){var t=17;return 37*(t=37*t+I.hashCode(this.x))+I.hashCode(this.y)},I.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},I.prototype.interfaces_=function(){return[E,w,e]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(1===arguments.length){var t=arguments[0];return m.doubleToLongBits(t),Math.trunc(0)}},C.DimensionalComparator.get=function(){return x},C.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},C.NULL_ORDINATE.get=function(){return m.NaN},C.X.get=function(){return 0},C.Y.get=function(){return 1},C.Z.get=function(){return 2},Object.defineProperties(I,C);var x=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};x.prototype.compare=function(t,e){var n=t,r=e,A=x.compare(n.x,r.x);if(0!==A)return A;var i=x.compare(n.y,r.y);return 0!==i?i:this._dimensionsToTest<=2?0:x.compare(n.z,r.z)},x.prototype.interfaces_=function(){return[b]},x.prototype.getClass=function(){return x},x.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var N=function(){};N.prototype.create=function(){},N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N};var S=function(){},D={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new _("Unknown location value: "+t)},D.INTERIOR.get=function(){return 0},D.BOUNDARY.get=function(){return 1},D.EXTERIOR.get=function(){return 2},D.NONE.get=function(){return-1},Object.defineProperties(S,D);var L=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},T=function(){},M={LOG_10:{configurable:!0}};T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var A=t;return e<A&&(A=e),n<A&&(A=n),r<A&&(A=r),A},T.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],A=arguments[1],i=arguments[2];return r<A?A:r>i?i:r}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],A=arguments[2],i=arguments[3],o=arguments[0];return r>o&&(o=r),A>o&&(o=A),i>o&&(o=i),o}},T.average=function(t,e){return(t+e)/2},M.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,M);var O=function(t){this.str=t};O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str};var P=function(t){this.value=t};P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},P.isNaN=function(t){return Number.isNaN(t)};var R=function(){};R.isWhitespace=function(t){return t<=32&&t>=0||127===t},R.toUpperCase=function(t){return t.toUpperCase()};var k=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r,A)}},B={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}};k.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},k.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=k.magnitude(n._hi),A=k.TEN.pow(r);(n=n.divide(A)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var i=r+1,o=new O,s=k.MAX_PRINT_DIGITS-1,a=0;a<=s;a++){t&&a===i&&o.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,l=0;u>9?(c=!0,l="9"):l="0"+u,o.append(l),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var f=!0,h=k.magnitude(n._hi);if(h<0&&Math.abs(h)>=s-a&&(f=!1),!f)break}return e[0]=r,o.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},k.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},k.prototype.isZero=function(){return 0===this._hi&&0===this._lo},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(t){return this.le(t)?this:t},k.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=null,i=null,o=null,s=null,a=null,u=null,c=null,l=null;return a=this._hi/n,l=(A=(u=k.SPLIT*a)-(A=u-a))*(o=(l=k.SPLIT*n)-(o=l-n))-(c=a*n)+A*(s=n-o)+(i=a-A)*o+i*s,l=a+(u=(this._hi-c-l+this._lo-a*r)/n),this._hi=l,this._lo=a-l+u,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var t=arguments[0],e=null,n=null,r=null,A=null,i=null,o=null,s=null,a=null;return n=(i=this._hi/t._hi)-(e=(o=k.SPLIT*i)-(e=o-i)),a=e*(r=(a=k.SPLIT*t._hi)-(r=a-t._hi))-(s=i*t._hi)+e*(A=t._hi-r)+n*r+n*A,o=(this._hi-s-a+this._lo-i*t._lo)/t._hi,new k(a=i+o,i-a+o)}if("number"==typeof arguments[0]){var u=arguments[0];return m.isNaN(u)?k.createNaN():k.copy(this).selfDivide(u,0)}},k.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},k.prototype.pow=function(t){if(0===t)return k.valueOf(1);var e=new k(this),n=k.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new k(t,e)},k.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},k.prototype.max=function(t){return this.ge(t)?this:t},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=k.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},k.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,A=null,i=null,o=null,s=null;return i=(A=this._hi+e)-(o=A-this._hi),r=(s=(i=e-o+(this._hi-i))+this._lo)+(A-(n=A+s)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var a=arguments[0],u=arguments[1],c=null,l=null,f=null,h=null,p=null,d=null,g=null;h=this._hi+a,l=this._lo+u,p=h-(d=h-this._hi),f=l-(g=l-this._lo);var y=(c=h+(d=(p=a-d+(this._hi-p))+l))+(d=(f=u-g+(this._lo-f))+(d+(h-c))),_=d+(c-y);return this._hi=y,this._lo=_,this}},k.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],A=null,i=null,o=null,s=null,a=null,u=null;A=(a=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,A=a-A,i=this._hi-A,o=u-n;var c=(a=this._hi*n)+(u=A*(o=u-o)-a+A*(s=n-o)+i*o+i*s+(this._hi*r+this._lo*n)),l=u+(A=a-c);return this._hi=c,this._lo=l,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new k(t,e)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var t=arguments[0];return t.isNaN()?k.createNaN():k.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return m.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var t=k.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,A=n;if("."===n.charAt(0))A="0"+n;else if(r<0)A="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var i=r-n.length;A=n+k.stringOfChar("0",i)+".0"}return this.isNegative()?"-"+A:A},k.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,A=null,i=null,o=null,s=null;e=(A=1/this._hi)-(t=(i=k.SPLIT*A)-(t=i-A)),n=(s=k.SPLIT*this._hi)-this._hi;var a=A+(i=(1-(o=A*this._hi)-(s=t*(n=s-n)-o+t*(r=this._hi-n)+e*n+e*r)-A*this._lo)/this._hi);return new k(a,A-a+i)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=k.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var A="";n.length>1&&(A=n.substring(1));var i=n.charAt(0)+"."+A;return this.isNegative()?"-"+i+r:i+r},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},k.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var t=arguments[0];return k.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return k.copy(this).selfAdd(e)}},k.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof k){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},k.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},k.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[e,E,w]},k.prototype.getClass=function(){return k},k.sqr=function(t){return k.valueOf(t).selfMultiply(t)},k.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return k.parse(t)}if("number"==typeof arguments[0])return new k(arguments[0])},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;R.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var A=t.charAt(e);"-"!==A&&"+"!==A||(e++,"-"===A&&(r=!0))}for(var i=new k,o=0,s=0,a=0;!(e>=n);){var u=t.charAt(e);if(e++,R.isDigit(u)){var c=u-"0";i.selfMultiply(k.TEN),i.selfAdd(c),o++}else{if("."!==u){if("e"===u||"E"===u){var l=t.substring(e);try{a=P.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}s=o}}var f=i,h=o-s-a;if(0===h)f=i;else if(h>0){var p=k.TEN.pow(h);f=i.divide(p)}else if(h<0){var d=k.TEN.pow(-h);f=i.multiply(d)}return r?f.negate():f},k.createNaN=function(){return new k(m.NaN,m.NaN)},k.copy=function(t){return new k(t)},k.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},k.stringOfChar=function(t,e){for(var n=new O,r=0;r<e;r++)n.append(t);return n.toString()},B.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},B.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},B.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},B.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},B.NaN.get=function(){return new k(m.NaN,m.NaN)},B.EPS.get=function(){return 123259516440783e-46},B.SPLIT.get=function(){return 134217729},B.MAX_PRINT_DIGITS.get=function(){return 32},B.TEN.get=function(){return k.valueOf(10)},B.ONE.get=function(){return k.valueOf(1)},B.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},B.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,B);var F=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.orientationIndex=function(t,e,n){var r=F.orientationIndexFilter(t,e,n);if(r<=1)return r;var A=k.valueOf(e.x).selfAdd(-t.x),i=k.valueOf(e.y).selfAdd(-t.y),o=k.valueOf(n.x).selfAdd(-e.x),s=k.valueOf(n.y).selfAdd(-e.y);return A.selfMultiply(s).selfSubtract(i.selfMultiply(o)).signum()},F.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},F.intersection=function(t,e,n,r){var A=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),i=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),o=A.subtract(i),s=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),a=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(a).selfDivide(o).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),l=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),f=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),h=l.subtract(f).selfDivide(o).doubleValue(),p=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(h)).doubleValue();return new I(c,p)},F.orientationIndexFilter=function(t,e,n){var r=null,A=(t.x-n.x)*(e.y-n.y),i=(t.y-n.y)*(e.x-n.x),o=A-i;if(A>0){if(i<=0)return F.signum(o);r=A+i}else{if(!(A<0))return F.signum(o);if(i>=0)return F.signum(o);r=-A-i}var s=F.DP_SAFE_EPSILON*r;return o>=s||-o>=s?F.signum(o):2},F.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,G);var U=function(){},Q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Q.X.get=function(){return 0},Q.Y.get=function(){return 1},Q.Z.get=function(){return 2},Q.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[w]},U.prototype.getClass=function(){return U},Object.defineProperties(U,Q);var z=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(z),q=function(){};q.arraycopy=function(t,e,n,r,A){for(var i=0,o=e;o<e+A;o++)n[r+i]=t[o],i++},q.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var A=arguments[0],i=arguments[1];this.x=A.y*i.w-i.y*A.w,this.y=i.x*A.w-A.x*i.w,this.w=A.x*i.y-i.x*A.y}else if(arguments[0]instanceof I&&arguments[1]instanceof I){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2];this.x=a,this.y=u,this.w=c}else if(4===arguments.length){var l=arguments[0],f=arguments[1],h=arguments[2],p=arguments[3],d=l.y-f.y,g=f.x-l.x,y=l.x*f.y-f.x*l.y,_=h.y-p.y,m=p.x-h.x,v=h.x*p.y-p.x*h.y;this.x=g*v-m*y,this.y=_*y-d*v,this.w=d*m-_*g}};Y.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},Y.prototype.getCoordinate=function(){var t=new I;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var A=t.y-e.y,i=e.x-t.x,o=t.x*e.y-e.x*t.y,s=n.y-r.y,a=r.x-n.x,u=n.x*r.y-r.x*n.y,c=A*a-s*i,l=(i*u-a*o)/c,f=(s*o-A*u)/c;if(m.isNaN(l)||m.isInfinite(l)||m.isNaN(f)||m.isInfinite(f))throw new V;return new I(l,f)};var j=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof I){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.init(r.x,A.x,r.y,A.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(i,o,s,a)}},H={serialVersionUID:{configurable:!0}};j.prototype.getArea=function(){return this.getWidth()*this.getHeight()},j.prototype.equals=function(t){if(!(t instanceof j))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},j.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new j;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,A=this._maxy<t._maxy?this._maxy:t._maxy;return new j(e,r,n,A)},j.prototype.isNull=function(){return this._maxx<this._minx},j.prototype.getMaxX=function(){return this._maxx},j.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof j){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},j.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof I){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},j.prototype.getMinY=function(){return this._miny},j.prototype.getMinX=function(){return this._minx},j.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},j.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},j.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},j.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},j.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},j.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},j.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},j.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},j.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},j.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},j.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof I){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},j.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},j.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];A<i?(this._minx=A,this._maxx=i):(this._minx=i,this._maxx=A),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},j.prototype.getMaxY=function(){return this._maxy},j.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},j.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+I.hashCode(this._minx))+I.hashCode(this._maxx))+I.hashCode(this._miny))+I.hashCode(this._maxy)},j.prototype.interfaces_=function(){return[E,e]},j.prototype.getClass=function(){return j},j.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=Math.min(i.x,o.x),a=Math.max(i.x,o.x),u=Math.min(r.x,A.x),c=Math.max(r.x,A.x);return!(u>a||c<s||(s=Math.min(i.y,o.y),a=Math.max(i.y,o.y),u=Math.min(r.y,A.y),c=Math.max(r.y,A.y),u>a||c<s))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(j,H);var X={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*$/},$=function(t){this.geometryFactory=t||new ye};$.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var A=X.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((A=X.emptyTypeStr.exec(t))[2]=void 0),A&&(n=A[1].toLowerCase(),r=A[2],K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},$.prototype.write=function(t){return this.extractGeometry(t)},$.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!W[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+W[e].apply(this,[t])+")"};var W={coordinate:function(t){return t.x+" "+t.y},point:function(t){return W.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(W.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(W.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+W.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+W.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+W.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(X.spaces);return this.geometryFactory.createPoint(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(X.spaces),r.push(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],A=0,i=n.length;A<i;++A)e=n[A].trim().split(X.spaces),r.push(new I(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(X.parenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,A,i=t.trim().split(X.parenComma),o=[],s=0,a=i.length;s<a;++s)e=i[s].replace(X.trimParens,"$1"),n=K.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?A=r:o.push(r);return this.geometryFactory.createPolygon(A,o)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(X.doubleParenComma),r=[],A=0,i=n.length;A<i;++A)e=n[A].replace(X.trimParens,"$1"),r.push(K.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,A=e.length;r<A;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Z=function(t){this.parser=new $(t)};Z.prototype.write=function(t){return this.parser.write(t)},Z.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var J=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(J),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 I,this._intPt[1]=new I,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return Z.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Z.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),A=Math.abs(n.y-e.y),i=-1;if(t.equals(e))i=0;else if(t.equals(n))i=r>A?r:A;else{var o=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(i=r>A?o:s)||t.equals(e)||(i=Math.max(o,s))}return et.isTrue(!(0===i&&!t.equals(e)),"Bad distance calculation"),i},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,A=t.y-e.y,i=Math.sqrt(r*r+A*A);return et.isTrue(!(0===i&&!t.equals(e)),"Invalid distance calculation"),i},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,j.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,A){A.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),A.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,A){var i=null;try{i=Y.intersection(t,n,r,A)}catch(o){if(!(o instanceof V))throw o;i=e.nearestEndpoint(t,n,r,A)}return i},e.prototype.intersection=function(t,n,r,A){var i=this.intersectionWithNormalization(t,n,r,A);return this.isInSegmentEnvelopes(i)||(i=new I(e.nearestEndpoint(t,n,r,A))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i},e.prototype.smallestInAbsValue=function(t,e,n,r){var A=t,i=Math.abs(A);return Math.abs(e)<i&&(A=e,i=Math.abs(e)),Math.abs(n)<i&&(A=n,i=Math.abs(n)),Math.abs(r)<i&&(A=r),A},e.prototype.checkDD=function(t,e,n,r,A){var i=F.intersection(t,e,n,r),o=this.isInSegmentEnvelopes(i);q.out.println("DD in env = "+o+" --------------------- "+i),A.distance(i)>1e-4&&q.out.println("Distance = "+A.distance(i))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var A=new I(t),i=new I(e),o=new I(n),s=new I(r),a=new I;this.normalizeToEnvCentre(A,i,o,s,a);var u=this.safeHCoordinateIntersection(A,i,o,s);return u.x+=a.x,u.y+=a.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,A){var i=j.intersects(e,n,r),o=j.intersects(e,n,A),s=j.intersects(r,A,e),a=j.intersects(r,A,n);return i&&o?(this._intPt[0]=r,this._intPt[1]=A,t.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):i&&a?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&s?(this._intPt[0]=A,this._intPt[1]=e,!A.equals(e)||i||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&a?(this._intPt[0]=A,this._intPt[1]=n,!A.equals(n)||i||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,A){var i=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,f=n.y>r.y?n.y:r.y,h=((i>u?i:u)+(s<l?s:l))/2,p=((o>c?o:c)+(a<f?a:f))/2;A.x=h,A.y=p,t.x-=A.x,t.y-=A.y,e.x-=A.x,e.y-=A.y,n.x-=A.x,n.y-=A.y,r.x-=A.x,r.y-=A.y},e.prototype.computeIntersect=function(e,n,r,A){if(this._isProper=!1,!j.intersects(e,n,r,A))return t.NO_INTERSECTION;var i=st.orientationIndex(e,n,r),o=st.orientationIndex(e,n,A);if(i>0&&o>0||i<0&&o<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,A,e),a=st.orientationIndex(r,A,n);return s>0&&a>0||s<0&&a<0?t.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(e,n,r,A):(0===i||0===o||0===s||0===a?(this._isProper=!1,e.equals2D(r)||e.equals2D(A)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(A)?this._intPt[0]=n:0===i?this._intPt[0]=new I(r):0===o?this._intPt[0]=new I(A):0===s?this._intPt[0]=new I(e):0===a&&(this._intPt[0]=new I(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,A)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var A=t,i=st.distancePointLine(t,n,r),o=st.distancePointLine(e,n,r);return o<i&&(i=o,A=e),(o=st.distancePointLine(n,t,e))<i&&(i=o,A=n),(o=st.distancePointLine(r,t,e))<i&&(i=o,A=r),A},e}(nt),it=function(){};it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},it.orientationIndex=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=n.x-e.x,o=n.y-e.y;return it.signOfDet2x2(r,A,i,o)},it.signOfDet2x2=function(t,e,n,r){var A=null,i=null,o=null;if(A=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-A:A:n>0?A:-A;if(0===e||0===n)return r>0?t>0?A:-A:t>0?-A:A;if(e>0?r>0?e<=r||(A=-A,i=t,t=n,n=i,i=e,e=r,r=i):e<=-r?(A=-A,n=-n,r=-r):(i=t,t=-n,n=i,i=e,e=-r,r=i):r>0?-e<=r?(A=-A,t=-t,e=-e):(i=-t,t=n,n=i,i=-e,e=r,r=i):e>=r?(t=-t,e=-e,n=-n,r=-r):(A=-A,i=-t,t=-n,n=i,i=-e,e=-r,r=i),t>0){if(!(n>0))return A;if(!(t<=n))return A}else{if(n>0)return-A;if(!(t>=n))return-A;A=-A,t=-t,n=-n}for(;;){if((r-=(o=Math.floor(n/t))*e)<0)return-A;if(r>e)return A;if(t>(n-=o*t)+n){if(e<r+r)return A}else{if(e>r+r)return-A;n=t-n,r=e-r,A=-A}if(0===r)return 0===n?0:-A;if(0===n)return A;if((e-=(o=Math.floor(t/n))*r)<0)return A;if(e>r)return-A;if(n>(t-=o*n)+t){if(r<e+e)return-A}else{if(r>e+e)return A;t=n-t,e=r-e,A=-A}if(0===e)return 0===t?0:A;if(0===t)return-A}};var ot=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ot.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var A=t.x-this._p.x,i=t.y-this._p.y,o=e.x-this._p.x,s=e.y-this._p.y,a=it.signOfDet2x2(A,i,o,s);if(0===a)return this._isPointOnSegment=!0,null;s<i&&(a=-a),a>0&&this._crossingCount++}},ot.prototype.isPointInPolygon=function(){return this.getLocation()!==S.EXTERIOR},ot.prototype.getLocation=function(){return this._isPointOnSegment?S.BOUNDARY:this._crossingCount%2==1?S.INTERIOR:S.EXTERIOR},ot.prototype.isOnSegment=function(){return this._isPointOnSegment},ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.locatePointInRing=function(){if(arguments[0]instanceof I&&L(arguments[1],U)){for(var t=arguments[1],e=new ot(arguments[0]),n=new I,r=new I,A=1;A<t.size();A++)if(t.getCoordinate(A,n),t.getCoordinate(A-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof I&&arguments[1]instanceof Array){for(var i=arguments[1],o=new ot(arguments[0]),s=1;s<i.length;s++){var a=i[s],u=i[s-1];if(o.countSegment(a,u),o.isOnSegment())return o.getLocation()}return o.getLocation()}};var st=function(){},at={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return F.orientationIndex(t,e,n)},st.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var A=t[r].x-n,i=t[r+1].y;e+=A*(t[r-1].y-i)}return e/2}if(L(arguments[0],U)){var o=arguments[0],s=o.size();if(s<3)return 0;var a=new I,u=new I,c=new I;o.getCoordinate(0,u),o.getCoordinate(1,c);var l=u.x;c.x-=l;for(var f=0,h=1;h<s-1;h++)a.y=u.y,u.x=c.x,u.y=c.y,o.getCoordinate(h+1,c),c.x-=l,f+=u.x*(a.y-c.y);return f/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var A=!1;if(j.intersects(t,e,n,r)){var i=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===i)A=!0;else{var o=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/i,a=o/i;(a<0||a>1||s<0||s>1)&&(A=!0)}}else A=!0;return A?T.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==S.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new I;t.getCoordinate(0,r);for(var A=r.x,i=r.y,o=1;o<e;o++){t.getCoordinate(o,r);var s=r.x,a=r.y,u=s-A,c=a-i;n+=Math.sqrt(u*u+c*c),A=s,i=a}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,A=1;A<=e;A++){var i=t[A];i.y>n.y&&(n=i,r=A)}var o=r;do{(o-=1)<0&&(o=e)}while(t[o].equals2D(n)&&o!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var a=t[o],u=t[s];if(a.equals2D(n)||u.equals2D(n)||a.equals2D(u))return!1;var c=st.computeOrientation(a,n,u);return 0===c?a.x>u.x:c>0},st.locatePointInRing=function(t,e){return ot.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),A=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(A)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var A=st.distancePointLine(t,e[r],e[r+1]);A<n&&(n=A)}return n}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return i.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((i.x-o.x)*(s.x-o.x)+(i.y-o.y)*(s.y-o.y))/a;if(u<=0)return i.distance(o);if(u>=1)return i.distance(s);var c=((o.y-i.y)*(s.x-o.x)-(o.x-i.x)*(s.y-o.y))/a;return Math.abs(c)*Math.sqrt(a)}},st.isOnLine=function(t,e){for(var n=new At,r=1;r<e.length;r++){var A=e[r-1],i=e[r];if(n.computeIntersection(t,A,i),n.hasIntersection())return!0}return!1},at.CLOCKWISE.get=function(){return-1},at.RIGHT.get=function(){return st.CLOCKWISE},at.COUNTERCLOCKWISE.get=function(){return 1},at.LEFT.get=function(){return st.COUNTERCLOCKWISE},at.COLLINEAR.get=function(){return 0},at.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,at);var ut=function(){};ut.prototype.filter=function(t){},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},lt={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}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new j(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var A=n.next(),i=r.next(),o=A.compareTo(i);if(0!==o)return o}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[w,E,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},lt.serialVersionUID.get=function(){return 0x799ea46522854c00},lt.SORTINDEX_POINT.get=function(){return 0},lt.SORTINDEX_MULTIPOINT.get=function(){return 1},lt.SORTINDEX_LINESTRING.get=function(){return 2},lt.SORTINDEX_LINEARRING.get=function(){return 3},lt.SORTINDEX_MULTILINESTRING.get=function(){return 4},lt.SORTINDEX_POLYGON.get=function(){return 5},lt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},lt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},lt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ct,lt);var ft=function(){};ft.interfaces_=function(){return[ut]},ft.filter=function(t){t.geometryChangedAction()};var ht=function(){};ht.prototype.filter=function(t){},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht};var pt=function(){},dt={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}};pt.prototype.isInBoundary=function(t){},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},dt.Mod2BoundaryNodeRule.get=function(){return gt},dt.EndPointBoundaryNodeRule.get=function(){return yt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MOD2_BOUNDARY_RULE.get=function(){return new gt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new yt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return pt.MOD2_BOUNDARY_RULE},Object.defineProperties(pt,dt);var gt=function(){};gt.prototype.isInBoundary=function(t){return t%2==1},gt.prototype.interfaces_=function(){return[pt]},gt.prototype.getClass=function(){return gt};var yt=function(){};yt.prototype.isInBoundary=function(t){return t>0},yt.prototype.interfaces_=function(){return[pt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[pt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[pt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.add=function(){},vt.prototype.addAll=function(){},vt.prototype.isEmpty=function(){},vt.prototype.iterator=function(){},vt.prototype.size=function(){},vt.prototype.toArray=function(){},vt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Et=function(){};Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){};var wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(vt);(r.prototype=new Error).name="NoSuchElementException";var bt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,vt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new It(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wt),It=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Et),Ct=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof I&&"boolean"==typeof arguments[1]){var A=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(A))return null;t.prototype.add.call(this,A)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1];return this.add(i,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];if(arguments[2])for(var u=0;u<s.length;u++)this.add(s[u],a);else for(var c=s.length-1;c>=0;c--)this.add(s[c],a);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof I){var l=arguments[0],f=arguments[1];if(!arguments[2]){var h=this.size();if(h>0){if(l>0&&this.get(l-1).equals2D(f))return null;if(l<h&&this.get(l).equals2D(f))return null}}t.prototype.add.call(this,l,f)}}else if(4===arguments.length){var p=arguments[0],d=arguments[1],g=arguments[2],y=arguments[3],_=1;g>y&&(_=-1);for(var m=g;m!==y;m+=_)this.add(p[m],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bt),xt=function(){},Nt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Nt.ForwardComparator.get=function(){return St},Nt.BidirectionalComparator.get=function(){return Dt},Nt.coordArrayType.get=function(){return new Array(0).fill(null)},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},xt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(xt.indexOf(r,e)<0)return r}return null},xt.scroll=function(t,e){var n=xt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);q.arraycopy(t,n,r,0,t.length-n),q.arraycopy(t,0,r,t.length-n,n),q.arraycopy(r,0,t,0,t.length)},xt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];if(r===A)return!0;if(null===r||null===A)return!1;if(r.length!==A.length)return!1;for(var o=0;o<r.length;o++)if(0!==i.compare(r[o],A[o]))return!1;return!0}},xt.intersection=function(t,e){for(var n=new Ct,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},xt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},xt.removeRepeatedPoints=function(t){return xt.hasRepeatedPoints(t)?new Ct(t,!1).toCoordinateArray():t},xt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var A=t[r];t[r]=t[e-r],t[e-r]=A}},xt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var A=0,i=0;i<t.length;i++)null!==t[i]&&(r[A++]=t[i]);return r},xt.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new I(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],A=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=0;a<s;a++)i[o+a]=new I(r[A+a])},xt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],A=e[t.length-n-1];if(0!==r.compareTo(A))return!1}return!0},xt.envelope=function(t){for(var e=new j,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},xt.toCoordinateArray=function(t){return t.toArray(xt.coordArrayType)},xt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},xt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},xt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},xt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},xt.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},xt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var A=new Array(r).fill(null);if(0===r)return A;for(var i=0,o=e;o<=n;o++)A[i++]=t[o];return A},Object.defineProperties(xt,Nt);var St=function(){};St.prototype.compare=function(t,e){return xt.compare(t,e)},St.prototype.interfaces_=function(){return[b]},St.prototype.getClass=function(){return St};var Dt=function(){};Dt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var A=xt.compare(n,r);return xt.isEqualReversed(n,r)?0:A},Dt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var A=xt.increasingDirection(n),i=xt.increasingDirection(r),o=A>0?0:n.length-1,s=i>0?0:n.length-1,a=0;a<n.length;a++){var u=n[o].compareTo(r[s]);if(0!==u)return u;o+=A,s+=i}return 0},Dt.prototype.interfaces_=function(){return[b]},Dt.prototype.getClass=function(){return Dt};var Lt=function(){};Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Lt);(A.prototype=new Error).name="OperationNotSupported",(i.prototype=new vt).contains=function(){};var Mt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Ot(this)},e}(i),Ot=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new A},e}(Et),Pt=0;(l.prototype=new Tt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},l.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Pt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,A=this.root_;do{if(n=A,(r=t.compareTo(A.key))<0)A=A.left;else{if(!(r>0)){var i=A.value;return A.value=e,i}A=A.right}}while(null!==A);var o={key:t,left:null,right:null,value:e,parent:n,color:Pt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},l.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===u(s(s(t)))){var e=c(s(s(t)));1===o(e)?(a(s(t),Pt),a(e,Pt),a(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=u(s(s(t)));1===o(n)?(a(s(t),Pt),a(n,Pt),a(s(s(t)),1),t=s(s(t))):(t===u(s(t))&&(t=s(t),this.rotateRight(t)),a(s(t),Pt),a(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Pt},l.prototype.values=function(){var t=new bt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=l.successor(e));)t.add(e.value);return t},l.prototype.entrySet=function(){var t=new Mt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=l.successor(e));)t.add(e);return t},l.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},l.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},l.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},l.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},l.prototype.size=function(){return this.size_};var Rt=function(){};Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},f.prototype=new i,(h.prototype=new f).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},h.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},h.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},h.prototype.remove=function(t){throw new A},h.prototype.size=function(){return this.array_.length},h.prototype.isEmpty=function(){return 0===this.array_.length},h.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},h.prototype.iterator=function(){return new kt(this)};var kt=function(t){this.treeSet_=t,this.position_=0};kt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},kt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},kt.prototype.remove=function(){throw new A};var Bt=function(){};Bt.sort=function(){var t,e,n,r,A=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},A.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},A.sort(r);else if(3===arguments.length){(e=A.slice(arguments[1],arguments[2])).sort();var i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length));for(A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])}else if(4===arguments.length)for(e=A.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),i=A.slice(0,arguments[1]).concat(e,A.slice(arguments[2],A.length)),A.splice(0,A.length),t=0;t<i.length;t++)A.push(i[t])},Bt.asList=function(t){for(var e=new bt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Ft=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Ft.toDimensionSymbol=function(t){switch(t){case Ft.FALSE:return Ft.SYM_FALSE;case Ft.TRUE:return Ft.SYM_TRUE;case Ft.DONTCARE:return Ft.SYM_DONTCARE;case Ft.P:return Ft.SYM_P;case Ft.L:return Ft.SYM_L;case Ft.A:return Ft.SYM_A}throw new _("Unknown dimension value: "+t)},Ft.toDimensionValue=function(t){switch(R.toUpperCase(t)){case Ft.SYM_FALSE:return Ft.FALSE;case Ft.SYM_TRUE:return Ft.TRUE;case Ft.SYM_DONTCARE:return Ft.DONTCARE;case Ft.SYM_P:return Ft.P;case Ft.SYM_L:return Ft.L;case Ft.SYM_A:return Ft.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Ft,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Qt=function(){};Qt.prototype.filter=function(t,e){},Qt.prototype.isDone=function(){},Qt.prototype.isGeometryChanged=function(){},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var zt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new j,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),A=0;A<r.length;A++)t[++e]=r[A];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var A=0;A<this._geometries.length;A++)if(!this._geometries[A].equalsExact(r._geometries[A],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Bt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Ft.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new h(Bt.asList(this._geometries)),n=new h(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],A=arguments[0],i=this.getNumGeometries(),o=A.getNumGeometries(),s=0;s<i&&s<o;){var a=this.getGeometryN(s),u=A.getGeometryN(s),c=a.compareToSameClass(u,r);if(0!==c)return c;s++}return s<i?1:s<o?-1:0}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Ut)){var A=arguments[0];A.filter(this);for(var i=0;i<this._geometries.length;i++)this._geometries[i].apply(A)}else if(L(arguments[0],ut)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(o)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Vt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(zt),qt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=pt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};qt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},qt.prototype.getBoundary=function(){return this._geom instanceof $t?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},qt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},qt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},qt.prototype.computeBoundaryCoordinates=function(t){var e=new bt;this._endpointMap=new l;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var A=this._endpointMap.entrySet().iterator();A.hasNext();){var i=A.next(),o=i.getValue().count;this._bnRule.isInBoundary(o)&&e.add(i.getKey())}return xt.toCoordinateArray(e)},qt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.getBoundary=function(){return 1===arguments.length?new qt(arguments[0]).getBoundary():2===arguments.length?new qt(arguments[0],arguments[1]).getBoundary():void 0};var Yt=function(){this.count=null};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var jt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},jt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){};return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],A=arguments[1],i="",o=new function(){}(new function(){}(jt.getStackTrace(r))),s=0;s<A;s++)try{i+=o.readLine()+jt.NEWLINE}catch(t){if(!(t instanceof p))throw t;et.shouldNeverReachHere()}return i}},jt.split=function(t,e){for(var n=e.length,r=new bt,A=""+t,i=A.indexOf(e);i>=0;){var o=A.substring(0,i);r.add(o),i=(A=A.substring(i+n)).indexOf(e)}A.length>0&&r.add(A);for(var s=new Array(r.size()).fill(null),a=0;a<s.length;a++)s[a]=r.get(a);return s},jt.toString=function(){if(1===arguments.length){var t=arguments[0];return jt.SIMPLE_ORDINATE_FORMAT.format(t)}},jt.spaces=function(t){return jt.chars(" ",t)},Ht.NEWLINE.get=function(){return q.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}},Object.defineProperties(jt,Ht);var Xt=function(){};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.copyCoord=function(t,e,n,r){for(var A=Math.min(t.getDimension(),n.getDimension()),i=0;i<A;i++)n.setOrdinate(r,i,t.getOrdinate(e,i))},Xt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Xt.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),A=0;A<n;A++)for(var i=0;i<r;i++){var o=t.getOrdinate(A,i),s=e.getOrdinate(A,i);if(!(t.getOrdinate(A,i)===e.getOrdinate(A,i)||m.isNaN(o)&&m.isNaN(s)))return!1}return!0},Xt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();if(Xt.copy(e,0,r,0,A),A>0)for(var i=A;i<n;i++)Xt.copy(e,A-1,r,i,1);return r},Xt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Xt.swap(t,r,e-r)},Xt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var A=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,A)}},Xt.copy=function(t,e,n,r,A){for(var i=0;i<A;i++)Xt.copyCoord(t,e+i,n,r+i)},Xt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;r.append("(");for(var A=0;A<e;A++){A>0&&r.append(" ");for(var i=0;i<n;i++)i>0&&r.append(","),r.append(jt.toString(t.getOrdinate(A,i)))}return r.append(")"),r.toString()}},Xt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Xt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Xt.createClosedRing(t,e,n+1)},Xt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),A=e.size();Xt.copy(e,0,r,0,A);for(var i=A;i<n;i++)Xt.copy(e,0,r,i,1);return r};var $t=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var A=0;A<this._points.size();A++)if(!this.equal(this._points.getCoordinate(A),r._points.getCoordinate(A),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Xt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var A=arguments[0];return arguments[1].compare(this._points,A._points)}},e.prototype.apply=function(){if(L(arguments[0],ht))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],Qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Rt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt};var Kt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new j;var t=new j;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(L(arguments[0],ht)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],Qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Ut)||L(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Wt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var Jt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var A=0;A<this._holes.length;A++)for(var i=this._holes[A].getCoordinates(),o=0;o<i.length;o++)t[++e]=i[o];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var A=t.getY(n);if(A!==e.getMinY()&&A!==e.getMaxY())return!1}for(var i=t.getX(0),o=t.getY(0),s=1;s<=4;s++){var a=t.getX(s),u=t.getY(s);if(a!==i==(u!==o))return!1;i=a,o=u}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,A=this._shell,i=r._shell;if(!A.equalsExact(i,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(r._holes[o],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Bt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);q.arraycopy(e.getCoordinates(),0,r,0,r.length);var A=xt.minCoordinate(e.getCoordinates());xt.scroll(r,A),q.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&xt.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],A=arguments[0],i=this._shell,o=A._shell,s=i.compareToSameClass(o,r);if(0!==s)return s;for(var a=this.getNumInteriorRing(),u=A.getNumInteriorRing(),c=0;c<a&&c<u;){var l=this.getInteriorRingN(c),f=A.getInteriorRingN(c),h=l.compareToSameClass(f,r);if(0!==h)return h;c++}return c<a?1:c<u?-1:0}},e.prototype.apply=function(t){if(L(t,ht)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,Qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Ut))t.filter(this);else if(L(t,ut)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Wt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(zt),ee=function(t){function e(e,n){e instanceof I&&n instanceof ye&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ft.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Xt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}($t),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bt,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var A=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(A))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},Ae={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof zt?this.editGeometryCollection(t,e):t instanceof Jt?this.editPolygon(t,e):t instanceof Kt||t instanceof $t?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bt,A=0;A<n.getNumGeometries();A++){var i=this.edit(n.getGeometryN(A),e);null===i||i.isEmpty()||r.add(i)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var A=new bt,i=0;i<n.getNumInteriorRing();i++){var o=this.edit(n.getInteriorRingN(i),e);null===o||o.isEmpty()||A.add(o)}return this._factory.createPolygon(r,A.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},Ae.NoOpGeometryOperation.get=function(){return ie},Ae.CoordinateOperation.get=function(){return oe},Ae.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,Ae);var ie=function(){};ie.prototype.edit=function(t,e){return t},ie.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ie.prototype.getClass=function(){return ie};var oe=function(){};oe.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof $t?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new I}else if(L(arguments[0],U)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var A=arguments[0],i=arguments[1];this._coordinates=A,this._dimension=i,null===A&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var a=0;a<o;a++)this._coordinates[a]=new I}},ue={serialVersionUID:{configurable:!0}};ae.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ae.prototype.size=function(){return this._coordinates.length},ae.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return m.NaN},ae.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ae.prototype.getCoordinateCopy=function(t){return new I(this._coordinates[t])},ae.prototype.getDimension=function(){return this._dimension},ae.prototype.getX=function(t){return this._coordinates[t].x},ae.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ae(t,this._dimension)},ae.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ae.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ae(t,this._dimension)},ae.prototype.toString=function(){if(this._coordinates.length>0){var t=new O(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ae.prototype.getY=function(t){return this._coordinates[t].y},ae.prototype.toCoordinateArray=function(){return this._coordinates},ae.prototype.interfaces_=function(){return[U,e]},ae.prototype.getClass=function(){return ae},ue.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ae,ue);var ce=function(){},le={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ae(arguments[0]);if(L(arguments[0],U))return new ae(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ae(t):new ae(t,e)}},ce.prototype.interfaces_=function(){return[N,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},le.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},le.instanceObject.get=function(){return new ce},Object.defineProperties(ce,le);var fe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Mt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Lt),he=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},pe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};he.prototype.equals=function(t){if(!(t instanceof he))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},he.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new P(n).compareTo(new P(r))},he.prototype.getScale=function(){return this._scale},he.prototype.isFloating=function(){return this._modelType===he.FLOATING||this._modelType===he.FLOATING_SINGLE},he.prototype.getType=function(){return this._modelType},he.prototype.toString=function(){var t="UNKNOWN";return this._modelType===he.FLOATING?t="Floating":this._modelType===he.FLOATING_SINGLE?t="Floating-Single":this._modelType===he.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},he.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===he.FLOATING_SINGLE?t:this._modelType===he.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof I){var e=arguments[0];if(this._modelType===he.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},he.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===he.FLOATING?t=16:this._modelType===he.FLOATING_SINGLE?t=6:this._modelType===he.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},he.prototype.setScale=function(t){this._scale=Math.abs(t)},he.prototype.interfaces_=function(){return[e,E]},he.prototype.getClass=function(){return he},he.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},pe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},pe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(he,pe);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ge={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ge.serialVersionUID.get=function(){return-552860263173159e4},ge.nameToTypeMap.get=function(){return new fe},Object.defineProperties(de,ge),he.Type=de,he.FIXED=new de("FIXED"),he.FLOATING=new de("FLOATING"),he.FLOATING_SINGLE=new de("FLOATING SINGLE");var ye=function t(){this._precisionModel=new he,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?L(arguments[0],N)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof he&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new I(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new I(t.getMinX(),t.getMinY()),new I(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new I(t.getMinX(),t.getMinY()),new I(t.getMinX(),t.getMaxY()),new I(t.getMaxX(),t.getMaxY()),new I(t.getMaxX(),t.getMinY()),new I(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new $t(this.getCoordinateSequenceFactory().create(t),this):L(t,U)?new $t(t,this):void 0:new $t(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ye.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,A=t.iterator();A.hasNext();){var i=A.next(),o=i.getClass();null===e&&(e=o),o!==e&&(n=!0),i.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Jt)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof $t)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],U))return new Kt(arguments[0],this)}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new Jt(null,null,this);if(1===arguments.length){if(L(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Jt(arguments[0],arguments[1],this)},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},ye.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U))return new ee(arguments[0],this)}},ye.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(L(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var A=this.getCoordinateSequenceFactory().create(1,e.getDimension());Xt.copy(e,r,A,0,1),n[r]=this.createPoint(A)}return this.createMultiPoint(n)}}},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ye.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},ye.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ye.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(ye,_e);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ve=function(t){this.geometryFactory=t||new ye};ve.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Ee[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?Ee[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Ee[n].apply(this,[e.geometries]):Ee[n].apply(this,[e])},ve.prototype.write=function(t){var e=t.getGeometryType();if(!we[e])throw new Error("Geometry is not supported");return we[e].apply(this,[t])};var Ee={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Ee[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Ee.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new I(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new I(t[0],t[1]),new I(t[2],t[1]),new I(t[2],t[3]),new I(t[0],t[3]),new I(t[0],t[1])])},Point:function(t){var e=new I(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Ee.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Ee.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],A=1;A<t.length;++A){var i=t[A],o=Ee.coordinates.apply(this,[i]),s=this.geometryFactory.createLinearRing(o);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Ee.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},we={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:we.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.Point.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var A=n[r];e.push(we.coordinate.apply(this,[A]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.LineString.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=we.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var A=t._holes[r],i=we.LineString.apply(this,[A]);e.push(i.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=we.Polygon.apply(this,[r]);e.push(A.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],A=r.getGeometryType();e.push(we[A].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},be=function(t){this.geometryFactory=t||new ye,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ve(this.geometryFactory)};be.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===he.FIXED&&this.reducePrecision(e),e},be.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ie=function(){this.parser=new ve(this.geometryFactory)};Ie.prototype.write=function(t){return this.parser.write(t)};var Ce=function(){},xe={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce},Ce.opposite=function(t){return t===Ce.LEFT?Ce.RIGHT:t===Ce.RIGHT?Ce.LEFT:t},xe.ON.get=function(){return 0},xe.LEFT.get=function(){return 1},xe.RIGHT.get=function(){return 2},Object.defineProperties(Ce,xe),(d.prototype=new Error).name="EmptyStackException",(g.prototype=new wt).add=function(t){return this.array_.push(t),!0},g.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},g.prototype.push=function(t){return this.array_.push(t),t},g.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},g.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},g.prototype.empty=function(){return 0===this.array_.length},g.prototype.isEmpty=function(){return this.empty()},g.prototype.search=function(t){return this.array_.indexOf(t)},g.prototype.size=function(){return this.array_.length},g.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ne=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ne.prototype.getCoordinate=function(){return this._minCoord},Ne.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ne.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=st.computeOrientation(this._minCoord,n,e),A=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(A=!0),A&&(this._minIndex=this._minIndex-1)},Ne.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ce.LEFT;return n[e].y<n[e+1].y&&(r=Ce.RIGHT),r},Ne.prototype.getEdge=function(){return this._orientedDe},Ne.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ne.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ne.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ce.LEFT&&(this._orientedDe=this._minDe.getSym())},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var Se=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new I(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(J),De=function(){this.array_=[]};De.prototype.addLast=function(t){this.array_.push(t)},De.prototype.removeFirst=function(){return this.array_.shift()},De.prototype.isEmpty=function(){return 0===this.array_.length};var Le=function(){this._finder=null,this._dirEdgeList=new bt,this._nodes=new bt,this._rightMostCoord=null,this._env=null,this._finder=new Ne};Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Se("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var A=t.getEdges().iterator();A.hasNext();){var i=A.next();i.setVisited(!0),this.copySymDepths(i)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ce.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ce.RIGHT)>=1&&e.getDepth(Ce.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.prototype.computeDepths=function(t){var e=new Mt,n=new De,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var A=n.removeFirst();e.add(A),this.computeNodeDepth(A);for(var i=A.getEdges().iterator();i.hasNext();){var o=i.next().getSym();if(!o.isVisited()){var s=o.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Le.prototype.addReachable=function(t){var e=new g;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ce.LEFT,t.getDepth(Ce.RIGHT)),e.setDepth(Ce.RIGHT,t.getDepth(Ce.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var A=r.getSym().getNode();A.isVisited()||e.push(A)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[E]},Le.prototype.getClass=function(){return Le};var Te=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Ce.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var A=0;A<this.location.length;A++)this.location[A]=r.location[A]}}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Ce.ON]=i,this.location[Ce.LEFT]=o,this.location[Ce.RIGHT]=s}};Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==S.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===S.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ce.ON]=this.location[Ce.ON],e[Ce.LEFT]=S.NONE,e[Ce.RIGHT]=S.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===S.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ce.LEFT];this.location[Ce.LEFT]=this.location[Ce.RIGHT],this.location[Ce.RIGHT]=t},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(S.toLocationSymbol(this.location[Ce.LEFT])),t.append(S.toLocationSymbol(this.location[Ce.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[Ce.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ce.ON]=t,this.location[Ce.LEFT]=e,this.location[Ce.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:S.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===S.NONE)return!0;return!1},Te.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ce.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(S.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Me=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.elt[0]=new Te(S.NONE),this.elt[1]=new Te(S.NONE),this.elt[r].setLocation(A)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Te(i,o,s),this.elt[1]=new Te(i,o,s)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new Te(S.NONE,S.NONE,S.NONE),this.elt[1]=new Te(S.NONE,S.NONE,S.NONE),this.elt[a].setLocations(u,c,l)}};Me.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Me.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Me.prototype.isNull=function(t){return this.elt[t].isNull()},Me.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Me.prototype.isLine=function(t){return this.elt[t].isLine()},Me.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Me.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Me.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ce.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Me.prototype.toString=function(){var t=new O;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Me.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Me.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Me.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ce.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this.elt[n].setLocation(r,A)}},Me.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Me.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Me.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toLineLabel=function(t){for(var e=new Me(S.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Oe=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bt,this._pts=new bt,this._label=new Me(S.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Oe.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Se("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Se("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Oe.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var A=1;n&&(A=0);for(var i=A;i<r.length;i++)this._pts.add(r[i])}else{var o=r.length-2;n&&(o=r.length-1);for(var s=o;s>=0;s--)this._pts.add(r[s])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ce.RIGHT);if(n===S.NONE)return null;if(this._label.getLocation(e)===S.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Pe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Pe(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Oe),ke=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};ke.prototype.setVisited=function(t){this._isVisited=t},ke.prototype.setInResult=function(t){this._isInResult=t},ke.prototype.isCovered=function(){return this._isCovered},ke.prototype.isCoveredSet=function(){return this._isCoveredSet},ke.prototype.setLabel=function(t){this._label=t},ke.prototype.getLabel=function(){return this._label},ke.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ke.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ke.prototype.isInResult=function(){return this._isInResult},ke.prototype.isVisited=function(){return this._isVisited},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Be=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Me(0,S.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=S.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==S.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Me(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Me)for(var n=arguments[0],r=0;r<2;r++){var A=this.computeMergedLocation(n,r);this._label.getLocation(r)===S.NONE&&this._label.setLocation(r,A)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=S.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:default:n=S.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),Fe=function(){this.nodeMap=new l,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof I){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Be){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new bt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===S.BOUNDARY&&e.add(r)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var Qe=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,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._edge=A,this.init(i,o),this._label=s}};Qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Qe.prototype.getDy=function(){return this._dy},Qe.prototype.getCoordinate=function(){return this._p0},Qe.prototype.setNode=function(t){this._node=t},Qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),A=n.substring(r+1);t.print(" "+A+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Qe.prototype.getDirectedCoordinate=function(){return this._p1},Qe.prototype.getDx=function(){return this._dx},Qe.prototype.getLabel=function(){return this._label},Qe.prototype.getEdge=function(){return this._edge},Qe.prototype.getQuadrant=function(){return this._quadrant},Qe.prototype.getNode=function(){return this._node},Qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Qe.prototype.computeLabel=function(t){},Qe.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Qe.prototype.interfaces_=function(){return[E]},Qe.prototype.getClass=function(){return Qe};var ze=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),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=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Me(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Se("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ce.LEFT)===S.INTERIOR&&this._label.getLocation(e,Ce.RIGHT)===S.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ce.LEFT]+"/"+this._depth[Ce.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,S.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,S.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ce.LEFT&&(r=-1);var A=Ce.opposite(t),i=e+n*r;this.setDepth(t,e),this.setDepth(A,i)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===S.EXTERIOR&&e===S.INTERIOR?1:t===S.INTERIOR&&e===S.EXTERIOR?-1:0},e}(Qe),Ve=function(){};Ve.prototype.createNode=function(t){return new Be(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var qe=function(){if(this._edges=new bt,this._nodes=null,this._edgeEndList=new bt,0===arguments.length)this._nodes=new Fe(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new Fe(t)}};qe.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},qe.prototype.find=function(t){return this._nodes.find(t)},qe.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof I){var e=arguments[0];return this._nodes.addNode(e)}},qe.prototype.getNodeIterator=function(){return this._nodes.iterator()},qe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},qe.prototype.debugPrintln=function(t){q.out.println(t)},qe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===S.BOUNDARY},qe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},qe.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},qe.prototype.getEdgeEnds=function(){return this._edgeEndList},qe.prototype.debugPrint=function(t){q.out.print(t)},qe.prototype.getEdgeIterator=function(){return this._edges.iterator()},qe.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(this.matchInSameDirection(t,e,A[0],A[1]))return r;if(this.matchInSameDirection(t,e,A[A.length-1],A[A.length-2]))return r}return null},qe.prototype.insertEdge=function(t){this._edges.add(t)},qe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},qe.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),A=new ze(n,!1);r.setSym(A),A.setSym(r),this.add(r),this.add(A)}},qe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},qe.prototype.getNodes=function(){return this._nodes.values()},qe.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),A=r.getCoordinates();if(t.equals(A[0])&&e.equals(A[1]))return r}return null},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=function(){this._geometryFactory=null,this._shellList=new bt;var t=arguments[0];this._geometryFactory=t};Ye.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var A=r.next();A.isHole()?n.add(A):e.add(A)}},Ye.prototype.computePolygons=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ye.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var A=this.findEdgeRingContaining(r,t);if(null===A)throw new Se("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(A)}}},Ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bt,A=t.iterator();A.hasNext();){var i=A.next();if(i.getMaxNodeDegree()>2){i.linkDirectedEdgesForMinimalEdgeRings();var o=i.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),e.add(s)):n.addAll(o)}else r.add(i)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var A=new Re(r,this._geometryFactory);e.add(A),A.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),A=n.getCoordinateN(0),i=null,o=null,s=e.iterator();s.hasNext();){var a=s.next(),u=a.getLinearRing(),c=u.getEnvelopeInternal();null!==i&&(o=i.getLinearRing().getEnvelopeInternal());var l=!1;c.contains(r)&&st.isPointInRing(A,u.getCoordinates())&&(l=!0),l&&(null===i||o.contains(c))&&(i=a)}return i},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var A=r.next();A.isHole()||(n=A,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];qe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),A=new bt,i=this.buildMinimalEdgeRings(r,this._shellList,A);this.sortShellsAndHoles(i,this._shellList,A),this.placeFreeHoles(this._shellList,A)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var je=function(){};je.prototype.getBounds=function(){},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[je,e]},He.prototype.getClass=function(){return He};var Xe=function(){this._size=null,this._items=null,this._size=0,this._items=new bt,this._items.add(null)};Xe.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},Xe.prototype.size=function(){return this._size},Xe.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},Xe.prototype.clear=function(){this._size=0,this._items.clear()},Xe.prototype.isEmpty=function(){return 0===this._size},Xe.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var $e=function(){};$e.prototype.visitItem=function(t){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var We=function(){};We.prototype.insert=function(t,e){},We.prototype.remove=function(t,e){},We.prototype.query=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Ke=function(){if(this._childBoundables=new bt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ze={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[je,e]},Ke.prototype.getClass=function(){return Ke},Ze.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Ze);var Je=function(){};Je.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Je.min=function(t){return Je.sort(t),t.get(0)},Je.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),A=0,i=n.length;A<i;A++)r.next(),r.set(n[A])},Je.singletonList=function(t){var e=new bt;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var A=t.getChildBoundables().iterator();A.hasNext();){var i=A.next(),o=new tn(i,e,this._itemDistance);o.getDistance()<r&&n.add(o)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[E]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var A=r.next();A instanceof He&&A.getItem()===e&&(n=A)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bt:t}if(1===arguments.length){for(var e=arguments[0],n=new bt,r=e.getChildBoundables().iterator();r.hasNext();){var A=r.next();if(A instanceof Ke){var i=this.itemsTree(A);null!==i&&n.add(i)}else A instanceof He?n.add(A.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return A.add(r),null;for(var i=r.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Ke?this.boundablesAtLevel(n,o,A):(et.isTrue(o instanceof He),-1===n&&A.add(o))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(L(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var A=arguments[0],i=arguments[2],o=arguments[1].getChildBoundables(),s=0;s<o.size();s++){var a=o.get(s);this.getIntersectsOp().intersects(a.getBounds(),A)&&(a instanceof Ke?this.query(A,a,i):a instanceof He?i.visitItem(a.getItem()):et.shouldNeverReachHere())}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var u=arguments[0],c=arguments[2],l=arguments[1].getChildBoundables(),f=0;f<l.size();f++){var h=l.get(f);this.getIntersectsOp().intersects(h.getBounds(),u)&&(h instanceof Ke?this.query(u,h,c):h instanceof He?c.add(h.getItem()):et.shouldNeverReachHere())}},en.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},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2],i=this.removeItem(r,A);if(i)return!0;for(var o=null,s=r.getChildBoundables().iterator();s.hasNext();){var a=s.next();if(this.getIntersectsOp().intersects(a.getBounds(),n)&&a instanceof Ke&&(i=this.remove(n,a,A))){o=a;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),i}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new bt;n.add(this.createNode(e));var r=new bt(t);Je.sort(r,this.getComparator());for(var A=r.iterator();A.hasNext();){var i=A.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(i)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},An=function(){};An.prototype.distance=function(t,e){},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var on=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new bt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),A=t.iterator(),i=0;i<e;i++){r[i]=new bt;for(var o=0;A.hasNext()&&o<n;){var s=A.next();r[i].add(s),o++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(L(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var A=arguments[0],i=arguments[1],o=arguments[2];t.prototype.query.call(this,A,i,o)}else if(L(arguments[2],wt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),A=new bt(t);Je.sort(A,n.xComparator);var i=this.verticalSlices(A,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(i,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(L(arguments[0],An)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&L(arguments[1],An)){var A=arguments[0],i=arguments[1],o=new tn(this.getRoot(),A.getRoot(),i);return this.nearestNeighbour(o)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=null,c=new Xe;for(c.add(s);!c.isEmpty()&&a>0;){var l=c.poll(),f=l.getDistance();if(f>=a)break;l.isLeaves()?(a=f,u=l):l.expandToQueue(c,a)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var h=arguments[2],p=new He(arguments[0],arguments[1]),d=new tn(this.getRoot(),p,h);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[We,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),an=function(){};an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},an.relativeSign=function(t,e){return t<e?-1:t>e?1:0},an.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=an.relativeSign(e.x,n.x),A=an.relativeSign(e.y,n.y);switch(t){case 0:return an.compareValue(r,A);case 1:return an.compareValue(A,r);case 2:return an.compareValue(A,-r);case 3:return an.compareValue(-r,A);case 4:return an.compareValue(-r,-A);case 5:return an.compareValue(-A,-r);case 6:return an.compareValue(-A,r);case 7:return an.compareValue(r,-A)}return et.shouldNeverReachHere("invalid octant value"),0},an.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new I(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:an.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[E]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new l,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new Ct;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new bt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new P(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);n.add(new I(t.coord),!1);for(var i=t.segmentIndex+1;i<=e.segmentIndex;i++)n.add(this._edge.getCoordinate(i));A&&n.add(new I(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var A=n.next();this.findCollapseIndex(r,A,e)&&t.add(new P(e[0])),r=A}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),A=e.isInterior()||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this._edge.getCoordinate(s);return A&&(i[o]=new I(e.coord)),new pn(i,this._edge.getData())},cn.prototype.add=function(t,e){var n=new un(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new J("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),A=r[r.length-1];if(!A.equals2D(e[e.length-1]))throw new J("bad split edge end point at "+A)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof I&&arguments[1]instanceof I){var A=arguments[0],i=arguments[1],o=i.x-A.x,s=i.y-A.y;if(0===o&&0===s)throw new _("Cannot compute the octant for two identical points "+A);return ln.octant(o,s)}};var fn=function(){};fn.prototype.getCoordinates=function(){},fn.prototype.size=function(){},fn.prototype.getCoordinate=function(t){},fn.prototype.isClosed=function(){},fn.prototype.setData=function(t){},fn.prototype.getData=function(){},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn};var hn=function(){};hn.prototype.addIntersection=function(t,e){},hn.prototype.interfaces_=function(){return[fn]},hn.prototype.getClass=function(){return hn};var pn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};pn.prototype.getCoordinates=function(){return this._pts},pn.prototype.size=function(){return this._pts.length},pn.prototype.getCoordinate=function(t){return this._pts[t]},pn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},pn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},pn.prototype.setData=function(t){this._data=t},pn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ln.octant(t,e)},pn.prototype.getData=function(){return this._data},pn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],A=new I(arguments[0].getIntersection(r));this.addIntersection(A,n)}},pn.prototype.toString=function(){return Z.toLineString(new ae(this._pts))},pn.prototype.getNodeList=function(){return this._nodeList},pn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var A=this._pts[r];t.equals2D(A)&&(n=r)}return this._nodeList.add(t,n)},pn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},pn.prototype.interfaces_=function(){return[hn]},pn.prototype.getClass=function(){return pn},pn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return pn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new I,this.p1=new I;else if(1===arguments.length){var t=arguments[0];this.p0=new I(t.p0),this.p1=new I(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],A=arguments[3];this.p0=new I(e,n),this.p1=new I(r,A)}},gn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof I){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new At;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof I){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new I(t);var e=this.projectionFactor(t),n=new I;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof dn){var r=arguments[0],A=this.projectionFactor(r.p0),i=this.projectionFactor(r.p1);if(A>=1&&i>=1)return null;if(A<=0&&i<=0)return null;var o=this.project(r.p0);A<0&&(o=this.p0),A>1&&(o=this.p1);var s=this.project(r.p1);return i<0&&(s=this.p0),i>1&&(s=this.p1),new dn(o,s)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,A=null,i=this.closestPoint(t.p0);r=i.distance(t.p0),n[0]=i,n[1]=t.p0;var o=this.closestPoint(t.p1);(A=o.distance(t.p1))<r&&(r=A,n[0]=o,n[1]=t.p1);var s=t.closestPoint(this.p0);(A=s.distance(this.p0))<r&&(r=A,n[0]=this.p0,n[1]=s);var a=t.closestPoint(this.p1);return(A=a.distance(this.p1))<r&&(r=A,n[0]=this.p1,n[1]=a),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return Y.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),A=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,o=Math.sqrt(A*A+i*i),s=0,a=0;if(0!==e){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*A/o,a=e*i/o}return new I(n-a,r+s)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof I){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new I;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},dn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[E,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new I((t.x+e.x)/2,(t.y+e.y)/2)},gn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,gn);var yn=function(){this.tempEnv1=new j,this.tempEnv2=new j,this._overlapSeg1=new dn,this._overlapSeg2=new dn};yn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var _n=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var A=this._pts[e],i=this._pts[n];if(r.tempEnv1.init(A,i),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var o=Math.trunc((e+n)/2);e<o&&this.computeSelect(t,e,o,r),o<n&&this.computeSelect(t,o,n,r)},_n.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new j(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,A,i){var o=this._pts[t],s=this._pts[e],a=n._pts[r],u=n._pts[A];if(e-t==1&&A-r==1)return i.overlap(this,t,n,r),null;if(i.tempEnv1.init(o,s),i.tempEnv2.init(a,u),!i.tempEnv1.intersects(i.tempEnv2))return null;var c=Math.trunc((t+e)/2),l=Math.trunc((r+A)/2);t<c&&(r<l&&this.computeOverlapsInternal(t,c,n,r,l,i),l<A&&this.computeOverlapsInternal(t,c,n,l,A,i)),c<e&&(r<l&&this.computeOverlapsInternal(c,e,n,r,l,i),l<A&&this.computeOverlapsInternal(c,e,n,l,A,i))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new P(e));do{var r=mn.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),A=e+1;A<t.length&&(t[A-1].equals2D(t[A])||Ge.quadrant(t[A-1],t[A])===r);)A++;return A-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bt,A=mn.getChainStartIndices(e),i=0;i<A.length-1;i++){var o=new _n(e,A[i],A[i+1],n);r.add(o)}return r}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var vn=function(){};vn.prototype.computeNodes=function(t){},vn.prototype.getNodedSubstrings=function(){},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var En=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[vn]},En.prototype.getClass=function(){return En};var wn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bt,this._index=new on,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new bn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var A=r.next();if(A.getId()>n.getId()&&(n.computeOverlaps(A,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return bn},Object.defineProperties(e,n),e}(En),bn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],A=arguments[0].getContext(),i=n.getContext();this._si.processIntersections(A,e,i,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(yn),In=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(A),this.setEndCapStyle(i),this.setJoinStyle(o),this.setMitreLimit(s)}},Cn={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}};In.prototype.getEndCapStyle=function(){return this._endCapStyle},In.prototype.isSingleSided=function(){return this._isSingleSided},In.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=In.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=In.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==In.JOIN_ROUND&&(this._quadrantSegments=In.DEFAULT_QUADRANT_SEGMENTS)},In.prototype.getJoinStyle=function(){return this._joinStyle},In.prototype.setJoinStyle=function(t){this._joinStyle=t},In.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},In.prototype.getSimplifyFactor=function(){return this._simplifyFactor},In.prototype.getQuadrantSegments=function(){return this._quadrantSegments},In.prototype.setEndCapStyle=function(t){this._endCapStyle=t},In.prototype.getMitreLimit=function(){return this._mitreLimit},In.prototype.setMitreLimit=function(t){this._mitreLimit=t},In.prototype.setSingleSided=function(t){this._isSingleSided=t},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Cn.CAP_ROUND.get=function(){return 1},Cn.CAP_FLAT.get=function(){return 2},Cn.CAP_SQUARE.get=function(){return 3},Cn.JOIN_ROUND.get=function(){return 1},Cn.JOIN_MITRE.get=function(){return 2},Cn.JOIN_BEVEL.get=function(){return 3},Cn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Cn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Cn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(In,Cn);var xn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Nn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};xn.prototype.isDeletable=function(t,e,n,r){var A=this._inputLine[t],i=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(A,i,o)&&!!this.isShallow(A,i,o,r)&&this.isShallowSampled(A,i,t,n,r)},xn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var A=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=xn.DELETE,A=!0,r=!0),t=A?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},xn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},xn.prototype.isShallowSampled=function(t,e,n,r,A){var i=Math.trunc((r-n)/xn.NUM_PTS_TO_CHECK);i<=0&&(i=1);for(var o=n;o<r;o+=i)if(!this.isShallow(t,e,this._inputLine[o],A))return!1;return!0},xn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},xn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},xn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===xn.DELETE;)e++;return e},xn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},xn.prototype.collapseLine=function(){for(var t=new Ct,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==xn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},xn.simplify=function(t,e){return new xn(t).simplify(e)},Nn.INIT.get=function(){return 0},Nn.DELETE.get=function(){return 1},Nn.KEEP.get=function(){return 1},Nn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(xn,Nn);var Sn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bt},Dn={COORDINATE_ARRAY_TYPE:{configurable:!0}};Sn.prototype.getCoordinates=function(){return this._ptList.toArray(Sn.COORDINATE_ARRAY_TYPE)},Sn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Sn.prototype.addPt=function(t){var e=new I(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Sn.prototype.revere=function(){},Sn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Sn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Sn.prototype.toString=function(){return(new ye).createLineString(this.getCoordinates()).toString()},Sn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new I(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Sn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Dn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Sn,Dn);var Ln=function(){},Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,A=n.y-e.y;return Math.atan2(A,r)}},Ln.isAcute=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)>0},Ln.isObtuse=function(t,e,n){var r=t.x-e.x,A=t.y-e.y;return r*(n.x-e.x)+A*(n.y-e.y)<0},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n);return Math.abs(A-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n);return Ln.diff(r,A)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),A=Ln.angle(e,n)-r;return A<=-Math.PI?A+Ln.PI_TIMES_2:A>Math.PI?A-Ln.PI_TIMES_2:A},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return st.CLOCKWISE},Tn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Ln,Tn);var Mn=function t(){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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new At,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===In.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},On={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}};Mn.prototype.addNextSegment=function(t,e){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 n=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Ce.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Ce.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Mn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ce.LEFT,this._distance,r);var A=new dn;this.computeOffsetSegment(n,Ce.RIGHT,this._distance,A);var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i);switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(A.p1);break;case In.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(A.p1);break;case In.CAP_SQUARE:var a=new I;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new I(r.p1.x+a.x,r.p1.y+a.y),c=new I(A.p1.x+a.x,A.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(c)}},Mn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Mn.prototype.addMitreJoin=function(t,e,n,r){var A=!0,i=null;try{i=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:i.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(A=!1)}catch(t){if(!(t instanceof V))throw t;i=new I(0,0),A=!1}A?this._segList.addPt(i):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Mn.prototype.addFilletCorner=function(t,e,n,r,A){var i=e.x-t.x,o=e.y-t.y,s=Math.atan2(o,i),a=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,a);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,A),this._segList.addPt(n)},Mn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===In.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===In.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&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))},Mn.prototype.createSquare=function(t){this._segList.addPt(new I(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new I(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Mn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Mn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Mn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Mn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Mn.prototype.addLimitedMitreJoin=function(t,e,n,r){var A=this._seg0.p1,i=Ln.angle(A,this._seg0.p0),o=Ln.angleBetweenOriented(this._seg0.p0,A,this._seg1.p1)/2,s=Ln.normalize(i+o),a=Ln.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(o)),l=A.x+u*Math.cos(a),f=A.y+u*Math.sin(a),h=new I(l,f),p=new dn(A,h),d=p.pointAlongOffset(1,c),g=p.pointAlongOffset(1,-c);this._side===Ce.LEFT?(this._segList.addPt(d),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(d))},Mn.prototype.computeOffsetSegment=function(t,e,n,r){var A=e===Ce.LEFT?1:-1,i=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,s=Math.sqrt(i*i+o*o),a=A*n*i/s,u=A*n*o/s;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+a,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+a},Mn.prototype.addFilletArc=function(t,e,n,r,A){var i=r===st.CLOCKWISE?-1:1,o=Math.abs(e-n),s=Math.trunc(o/this._filletAngleQuantum+.5);if(s<1)return null;for(var a=o/s,u=0,c=new I;u<o;){var l=e+i*u;c.x=t.x+A*Math.cos(l),c.y=t.y+A*Math.sin(l),this._segList.addPt(c),u+=a}},Mn.prototype.addInsideTurn=function(t,e){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*Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new I((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(n);var r=new I((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Mn.prototype.createCircle=function(t){var e=new I(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Mn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Mn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Mn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===In.JOIN_BEVEL||this._bufParams.getJoinStyle()===In.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,st.CLOCKWISE,this._distance))},Mn.prototype.closeRing=function(){this._segList.closeRing()},Mn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Mn,On);var Pn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Pn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),A=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],A):this.computeOffsetCurve(t,n,A);var i=A.getCoordinates();return n&&xt.reverse(i),i},Pn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var A=xn.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],Ce.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{n.addSegments(t,!1);var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ce.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},Pn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ce.RIGHT&&(r=-r);var A=xn.simplify(t,r),i=A.length-1;n.initSideSegments(A[i-1],A[0],e);for(var o=1;o<=i;o++){var s=1!==o;n.addNextSegment(A[o],s)}n.closeRing()},Pn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=xn.simplify(t,n),A=r.length-1;e.initSideSegments(r[0],r[1],Ce.LEFT);for(var i=2;i<=A;i++)e.addNextSegment(r[i],!0);e.addLastSegment(),e.addLineEndCap(r[A-1],r[A]);var o=xn.simplify(t,-n),s=o.length-1;e.initSideSegments(o[s],o[s-1],Ce.LEFT);for(var a=s-2;a>=0;a--)e.addNextSegment(o[a],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},Pn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:e.createCircle(t);break;case In.CAP_SQUARE:e.createSquare(t)}},Pn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var A=e<0;this.computeSingleSidedBufferCurve(t,A,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},Pn.prototype.getBufferParameters=function(){return this._bufParams},Pn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Pn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Pn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Pn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var A=xn.simplify(t,-r),i=A.length-1;n.initSideSegments(A[i],A[i-1],Ce.LEFT),n.addFirstSegment();for(var o=i-2;o>=0;o--)n.addNextSegment(A[o],!0)}else{var s=xn.simplify(t,r),a=s.length-1;n.initSideSegments(s[0],s[1],Ce.LEFT),n.addFirstSegment();for(var u=2;u<=a;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},Pn.prototype.getSegGen=function(t){return new Mn(this._precisionModel,this._bufParams,t)},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new I(t[n]);return e};var Rn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new st;var t=arguments[0];this._subgraphs=t},kn={DepthSegment:{configurable:!0}};Rn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bt,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),A=r.getEnvelope();t.y<A.getMinY()||t.y>A.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(L(arguments[2],wt)&&arguments[0]instanceof I&&arguments[1]instanceof ze){for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getEdge().getCoordinates(),u=0;u<a.length-1;u++)if(this._seg.p0=a[u],this._seg.p1=a[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<i.x||this._seg.isHorizontal()||i.y<this._seg.p0.y||i.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,i)===st.RIGHT)){var c=o.getDepth(Ce.LEFT);this._seg.p0.equals(a[u])||(c=o.getDepth(Ce.RIGHT));var l=new Bn(this._seg,c);s.add(l)}}else if(L(arguments[2],wt)&&arguments[0]instanceof I&&L(arguments[1],wt))for(var f=arguments[0],h=arguments[2],p=arguments[1].iterator();p.hasNext();){var d=p.next();d.isForward()&&this.findStabbedSegments(f,d,h)}},Rn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Je.min(e)._leftDepth},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Rn,kn);var Bn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};Bn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Bn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Bn.prototype.toString=function(){return this._upwardSeg.toString()},Bn.prototype.interfaces_=function(){return[E]},Bn.prototype.getClass=function(){return Bn};var Fn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Fn.prototype.area=function(){return Fn.area(this.p0,this.p1,this.p2)},Fn.prototype.signedArea=function(){return Fn.signedArea(this.p0,this.p1,this.p2)},Fn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Fn.interpolateZ(t,this.p0,this.p1,this.p2)},Fn.prototype.longestSideLength=function(){return Fn.longestSideLength(this.p0,this.p1,this.p2)},Fn.prototype.isAcute=function(){return Fn.isAcute(this.p0,this.p1,this.p2)},Fn.prototype.circumcentre=function(){return Fn.circumcentre(this.p0,this.p1,this.p2)},Fn.prototype.area3D=function(){return Fn.area3D(this.p0,this.p1,this.p2)},Fn.prototype.centroid=function(){return Fn.centroid(this.p0,this.p1,this.p2)},Fn.prototype.inCentre=function(){return Fn.inCentre(this.p0,this.p1,this.p2)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Fn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Fn.det=function(t,e,n,r){return t*r-e*n},Fn.interpolateZ=function(t,e,n,r){var A=e.x,i=e.y,o=n.x-A,s=r.x-A,a=n.y-i,u=r.y-i,c=o*u-s*a,l=t.x-A,f=t.y-i,h=(u*l-s*f)/c,p=(-a*l+o*f)/c;return e.z+h*(n.z-e.z)+p*(r.z-e.z)},Fn.longestSideLength=function(t,e,n){var r=t.distance(e),A=e.distance(n),i=n.distance(t),o=r;return A>o&&(o=A),i>o&&(o=i),o},Fn.isAcute=function(t,e,n){return!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.isAcute(n,t,e)},Fn.circumcentre=function(t,e,n){var r=n.x,A=n.y,i=t.x-r,o=t.y-A,s=e.x-r,a=e.y-A,u=2*Fn.det(i,o,s,a),c=Fn.det(o,i*i+o*o,a,s*s+a*a),l=Fn.det(i,i*i+o*o,s,s*s+a*a);return new I(r-c/u,A+l/u)},Fn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,A=new Y(t.x+n/2,t.y+r/2,1),i=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(A,i)},Fn.angleBisector=function(t,e,n){var r=e.distance(t),A=r/(r+e.distance(n)),i=n.x-t.x,o=n.y-t.y;return new I(t.x+A*i,t.y+A*o)},Fn.area3D=function(t,e,n){var r=e.x-t.x,A=e.y-t.y,i=e.z-t.z,o=n.x-t.x,s=n.y-t.y,a=n.z-t.z,u=A*a-i*s,c=i*o-r*a,l=r*s-A*o,f=u*u+c*c+l*l;return Math.sqrt(f)/2},Fn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,A=(t.y+e.y+n.y)/3;return new I(r,A)},Fn.inCentre=function(t,e,n){var r=e.distance(n),A=t.distance(n),i=t.distance(e),o=r+A+i,s=(r*t.x+A*e.x+i*n.x)/o,a=(r*t.y+A*e.y+i*n.y)/o;return new I(s,a)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ce.LEFT;this._distance<0&&(e=-this._distance,n=Ce.RIGHT);var r=t.getExteriorRing(),A=xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&A.length<3)return null;this.addPolygonRing(A,e,n,S.EXTERIOR,S.INTERIOR);for(var i=0;i<t.getNumInteriorRing();i++){var o=t.getInteriorRingN(i),s=xt.removeRepeatedPoints(o.getCoordinates());this._distance>0&&this.isErodedCompletely(o,-this._distance)||this.addPolygonRing(s,e,Ce.opposite(n),S.INTERIOR,S.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Fn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=xt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new pn(t,new Me(0,S.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,A){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var i=r,o=A;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(i=A,o=r,n=Ce.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,i,o)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Jt?this.addPolygon(t):t instanceof $t?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),A=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>A},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Qn=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()};Qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof zt?(this._subcollectionIterator=new Qn(t),this._subcollectionIterator.next()):t},Qn.prototype.remove=function(){throw new Error(this.getClass().getName())},Qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Qn.prototype.interfaces_=function(){return[Et]},Qn.prototype.getClass=function(){return Qn},Qn.isAtomic=function(t){return!(t instanceof zt)};var zn=function(){this._geom=null;var t=arguments[0];this._geom=t};zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var A=e.getInteriorRingN(r);if(zn.isPointInRing(t,A))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Jt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new Qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:zn.containsPoint(t,e)?S.INTERIOR:S.EXTERIOR};var Vn=function(){this._edgeMap=new l,this._edgeList=null,this._ptInAreaLocation=[S.NONE,S.NONE]};Vn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Vn.prototype.propagateSideLabels=function(t){for(var e=S.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ce.LEFT)!==S.NONE&&(e=r.getLocation(t,Ce.LEFT))}if(e===S.NONE)return null;for(var A=e,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();if(s.getLocation(t,Ce.ON)===S.NONE&&s.setLocation(t,Ce.ON,A),s.isArea(t)){var a=s.getLocation(t,Ce.LEFT),u=s.getLocation(t,Ce.RIGHT);if(u!==S.NONE){if(u!==A)throw new Se("side location conflict",o.getCoordinate());a===S.NONE&&et.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),A=a}else et.isTrue(s.getLocation(t,Ce.LEFT)===S.NONE,"found single null side"),s.setLocation(t,Ce.RIGHT,A),s.setLocation(t,Ce.LEFT,A)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){q.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ce.LEFT);et.isTrue(r!==S.NONE,"Found unlabelled area edge");for(var A=r,i=this.iterator();i.hasNext();){var o=i.next().getLabel();et.isTrue(o.isArea(t),"Found non-area edge");var s=o.getLocation(t,Ce.LEFT),a=o.getLocation(t,Ce.RIGHT);if(s===a)return!1;if(a!==A)return!1;A=s}return!0},Vn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bt(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===S.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new O;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),A=0;A<2;A++)r.isLine(A)&&r.getLocation(A)===S.BOUNDARY&&(e[A]=!0);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)if(s.isAnyNull(a)){var u=S.NONE;if(e[a])u=S.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(a,c,t)}s.setAllLocationsIfNull(a,u)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var qn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var A=this._resultAreaEdgeList.get(r),i=A.getSym();if(A.getLabel().isArea())switch(null===t&&A.isInResult()&&(t=A),n){case this._SCANNING_FOR_INCOMING:if(!i.isInResult())continue;e=i,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!A.isInResult())continue;e.setNext(A),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Se("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),A=n.getQuadrant(),i=r.getQuadrant();return Ge.isNorthern(A)&&Ge.isNorthern(i)?n:Ge.isNorthern(A)||Ge.isNorthern(i)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){q.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),A=r.getSym();null===e&&(e=A),null!==t&&A.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ce.LEFT),r=t.getDepth(Ce.RIGHT),A=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,A)!==r)throw new Se("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var i=arguments[1],o=arguments[2],s=arguments[0];s<i;s++){var a=this._edgeList.get(s);a.setEdgeDepths(Ce.RIGHT,o),o=a.getDepth(Ce.LEFT)}return o}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,A=this._resultAreaEdgeList.size()-1;A>=0;A--){var i=this._resultAreaEdgeList.get(A),o=i.getSym();switch(null===e&&i.getEdgeRing()===t&&(e=i),r){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(i.getEdgeRing()!==t)continue;n.setNextMin(i),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,A=this.iterator();A.hasNext();)A.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(r.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var A=t,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(A===S.INTERIOR):(o.isInResult()&&(A=S.EXTERIOR),s.isInResult()&&(A=S.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Me(S.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),A=0;A<2;A++){var i=r.getLocation(A);i!==S.INTERIOR&&i!==S.BOUNDARY||this._label.setLocation(A,S.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Be(t,new qn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};jn.prototype.compareTo=function(t){var e=t;return jn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},jn.prototype.interfaces_=function(){return[E]},jn.prototype.getClass=function(){return jn},jn.orientation=function(t){return 1===xt.increasingDirection(t)},jn.compareOriented=function(t,e,n,r){for(var A=e?1:-1,i=r?1:-1,o=e?t.length:-1,s=r?n.length:-1,a=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[a].compareTo(n[u]);if(0!==c)return c;var l=(a+=A)===o,f=(u+=i)===s;if(l&&!f)return-1;if(!l&&f)return 1;if(l&&f)return 0}};var Hn=function(){this._edges=new bt,this._ocaMap=new l};Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),A=0;A<r.length;A++)A>0&&t.print(","),t.print(r[A].x+" "+r[A].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new jn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new jn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Xn=function(){};Xn.prototype.processIntersections=function(t,e,n,r){},Xn.prototype.isDone=function(){},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn};var $n=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};$n.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if($n.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.size()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},$n.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},$n.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},$n.prototype.getLineIntersector=function(){return this._li},$n.prototype.hasProperIntersection=function(){return this._hasProper},$n.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},$n.prototype.hasIntersection=function(){return this._hasIntersection},$n.prototype.isDone=function(){return!1},$n.prototype.hasInteriorIntersection=function(){return this._hasInterior},$n.prototype.interfaces_=function(){return[Xn]},$n.prototype.getClass=function(){return $n},$n.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Wn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new I(t),this.segmentIndex=e,this.dist=n};Wn.prototype.getSegmentIndex=function(){return this.segmentIndex},Wn.prototype.getCoordinate=function(){return this.coord},Wn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Wn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Wn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Wn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Wn.prototype.getDistance=function(){return this.dist},Wn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Wn.prototype.interfaces_=function(){return[E]},Wn.prototype.getClass=function(){return Wn};var Kn=function(){this._nodeMap=new l,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),A=this.createSplitEdge(n,r);t.add(A),n=r}},Kn.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)},Kn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],A=e.dist>0||!e.coord.equals2D(r);A||n--;var i=new Array(n).fill(null),o=0;i[o++]=new I(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)i[o++]=this.edge.pts[s];return A&&(i[o]=e.coord),new nr(i,new Me(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new Wn(t,e,n),A=this._nodeMap.get(r);return null!==A?A:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Zn=function(){};Zn.prototype.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new P(e));do{var r=this.findChainEnd(t,e);n.add(new P(r)),e=r}while(e<t.length-1);return Zn.toIntArray(n)},Zn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Jn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new j,this.env2=new j;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Zn;this.startIndex=e.getChainStartIndices(this.pts)};Jn.prototype.getCoordinates=function(){return this.pts},Jn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Jn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Jn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=arguments[5],c=this.pts[A],l=this.pts[i],f=o.pts[s],h=o.pts[a];if(i-A==1&&a-s==1)return u.addIntersections(this.e,A,o.e,s),null;if(this.env1.init(c,l),this.env2.init(f,h),!this.env1.intersects(this.env2))return null;var p=Math.trunc((A+i)/2),d=Math.trunc((s+a)/2);A<p&&(s<d&&this.computeIntersectsForChain(A,p,o,s,d,u),d<a&&this.computeIntersectsForChain(A,p,o,d,a,u)),p<i&&(s<d&&this.computeIntersectsForChain(p,i,o,s,d,u),d<a&&this.computeIntersectsForChain(p,i,o,d,a,u))}},Jn.prototype.getStartIndexes=function(){return this.startIndex},Jn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],A=arguments[1];return this._depth[r][A]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ce.RIGHT]-this._depth[t][Ce.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==S.EXTERIOR&&r!==S.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var A=arguments[0],i=arguments[1];arguments[2]===S.INTERIOR&&this._depth[A][i]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],A=arguments[1];this.pts=r,this._label=A}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Me.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,A=!0,i=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(n.pts[o])||(r=!1),this.pts[o].equals2D(n.pts[--i])||(A=!1),!r&&!A)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Jn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new j;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var A=new I(t.getIntersection(r)),i=e,o=t.getEdgeDistance(n,r),s=i+1;if(s<this.pts.length){var a=this.pts[s];A.equals2D(a)&&(i=s,o=0)}this.eiList.add(A,i,o)},e.prototype.toString=function(){var t=new O;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ce.ON),e.getLocation(1,Ce.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ce.LEFT),e.getLocation(1,Ce.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ce.RIGHT),e.getLocation(1,Ce.RIGHT),2))},e}(ke),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip(),n.merge(r);var A=rr.depthDelta(r),i=e.getDepthDelta()+A;e.setDepthDelta(i)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new bt,r=t.iterator();r.hasNext();){var A=r.next(),i=A.getRightmostCoordinate(),o=new Rn(n).getDepth(i);A.computeDepth(o),A.findResultEdges(),n.add(A),e.add(A.getDirectedEdges(),A.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new bt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var A=new Le;A.create(r),e.add(A)}}return Je.sort(e,Je.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new wn,n=new At;return n.setPrecisionModel(t),e.setSegmentIntersector(new $n(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Pn(n,this._bufParams),A=new Gn(t,e,r).getCurves();if(A.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(A,n),this._graph=new qe(new Yn),this._graph.addEdges(this._edgeList.getEdges());var i=this.createSubgraphs(this._graph),o=new Ye(this._geomFact);this.buildSubgraphs(i,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var A=r.next(),i=A.getCoordinates();if(2!==i.length||!i[0].equals2D(i[1])){var o=A.getData(),s=new nr(A.getCoordinates(),new Me(o));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ce.LEFT),n=t.getLocation(0,Ce.RIGHT);return e===S.INTERIOR&&n===S.EXTERIOR?1:e===S.EXTERIOR&&n===S.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new ye,n=new bt;t.hasNext();){var r=t.next(),A=e.createLineString(r.getCoordinates());n.add(A)}return e.buildGeometry(n)};var Ar=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2],i=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=A,this._offsetY=i,this._isScaled=!this.isIntegerPrecision()}};Ar.prototype.rescale=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&q.out.println(n)}},Ar.prototype.scale=function(){if(L(arguments[0],vt)){for(var t=arguments[0],e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new pn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var A=arguments[0],i=new Array(A.length).fill(null),o=0;o<A.length;o++)i[o]=new I(Math.round((A[o].x-this._offsetX)*this._scaleFactor),Math.round((A[o].y-this._offsetY)*this._scaleFactor),A[o].z);return xt.removeRepeatedPoints(i)}},Ar.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},Ar.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},Ar.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},Ar.prototype.interfaces_=function(){return[vn]},Ar.prototype.getClass=function(){return Ar};var ir=function(){this._li=new At,this._segStrings=null;var t=arguments[0];this._segStrings=t},or={fact:{configurable:!0}};ir.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var A=r.next().getCoordinates(),i=1;i<A.length-1;i++)if(A[i].equals(n))throw new J("found endpt/interior pt intersection at index "+i+" :pt "+n)},ir.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var A=arguments[0],i=arguments[1],o=A.getCoordinates(),s=i.getCoordinates(),a=0;a<o.length-1;a++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(A,a,i,u);else if(4===arguments.length){var c=arguments[0],l=arguments[1],f=arguments[2],h=arguments[3];if(c===f&&l===h)return null;var p=c.getCoordinates()[l],d=c.getCoordinates()[l+1],g=f.getCoordinates()[h],y=f.getCoordinates()[h+1];if(this._li.computeIntersection(p,d,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,p,d)||this.hasInteriorIntersection(this._li,g,y)))throw new J("found non-noded intersection at "+p+"-"+d+" and "+g+"-"+y)}},ir.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},ir.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},ir.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var A=t.getIntersection(r);if(!A.equals(e)&&!A.equals(n))return!0}return!1},ir.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new J("found non-noded collapse at "+ir.fact.createLineString([t,e,n]))},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},or.fact.get=function(){return new ye},Object.defineProperties(ir,or);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],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _("Scale factor must be non-zero");1!==e&&(this._pt=new I(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new I,this._p1Scaled=new I),this.initCorners(this._pt)},ar={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),A=Math.min(t.y,e.y),i=Math.max(t.y,e.y),o=this._maxx<n||this._minx>r||this._maxy<A||this._miny>i;if(o)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(o&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,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,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sr.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},sr.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,ar);var ur=function(){this.tempEnv1=new j,this.selectedSegment=new dn};ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._index=null;var t=arguments[0];this._index=t},lr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],A=e.getSafeEnvelope(),i=new fr(e,n,r);return this._index.query(A,{interfaces_:function(){return[$e]},visitItem:function(t){t.select(A,i)}}),i.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},lr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(cr,lr);var fr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur),hr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bt};hr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)this._interiorIntersections.add(this._li.getIntersection(a));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},hr.prototype.isDone=function(){return!1},hr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},hr.prototype.interfaces_=function(){return[Xn]},hr.prototype.getClass=function(){return hr};var pr=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 At,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};pr.prototype.checkCorrectness=function(t){var e=pn.getNodedSubstrings(t),n=new ir(e);try{n.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},pr.prototype.getNodedSubstrings=function(){return pn.getNodedSubstrings(this._nodedSegStrings)},pr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},pr.prototype.findInteriorIntersections=function(t,e){var n=new hr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},pr.prototype.computeVertexSnaps=function(){if(L(arguments[0],vt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof pn)for(var n=arguments[0],r=n.getCoordinates(),A=0;A<r.length;A++){var i=new sr(r[A],this._scaleFactor,this._li);this._pointSnapper.snap(i,n,A)&&n.addIntersection(r[A],A)}},pr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new wn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},pr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},pr.prototype.interfaces_=function(){return[vn]},pr.prototype.getClass=function(){return pr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new In,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},gr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new Ar(new pr(new he(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Se))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),A=new he(r);this.bufferFixedPrecision(A)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===he.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof J))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new dr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new dr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof In&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var A=arguments[1];return new dr(arguments[0],arguments[2]).getResultGeometry(A)}}else if(4===arguments.length){var i=arguments[1],o=arguments[2],s=arguments[3],a=new dr(arguments[0]);return a.setQuadrantSegments(o),a.setEndCapStyle(s),a.getResultGeometry(i)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),A=T.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),i=n-Math.trunc(Math.log(A)/Math.log(10)+1);return Math.pow(10,i)},gr.CAP_ROUND.get=function(){return In.CAP_ROUND},gr.CAP_BUTT.get=function(){return In.CAP_FLAT},gr.CAP_FLAT.get=function(){return In.CAP_FLAT},gr.CAP_SQUARE.get=function(){return In.CAP_SQUARE},gr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,gr);var yr=function(){this._pt=[new I,new I],this._distance=m.NaN,this._isNull=!0};yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(t){return this._pt[t]},yr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},yr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},yr.prototype.getDistance=function(){return this._distance},yr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr};var _r=function(){};_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new dn,A=0;A<n.length-1;A++){r.setCoordinates(n[A],n[A+1]);var i=r.closestPoint(t);e.setMinimum(i,t)}else if(arguments[2]instanceof yr&&arguments[0]instanceof Jt&&arguments[1]instanceof I){var o=arguments[0],s=arguments[1],a=arguments[2];_r.computeDistance(o.getExteriorRing(),s,a);for(var u=0;u<o.getNumInteriorRing();u++)_r.computeDistance(o.getInteriorRingN(u),s,a)}else if(arguments[2]instanceof yr&&arguments[0]instanceof ct&&arguments[1]instanceof I){var c=arguments[0],l=arguments[1],f=arguments[2];if(c instanceof $t)_r.computeDistance(c,l,f);else if(c instanceof Jt)_r.computeDistance(c,l,f);else if(c instanceof zt)for(var h=c,p=0;p<h.getNumGeometries();p++){var d=h.getGeometryN(p);_r.computeDistance(d,l,f)}else f.setMinimum(c.getCoordinate(),l)}else if(arguments[2]instanceof yr&&arguments[0]instanceof dn&&arguments[1]instanceof I){var g=arguments[1],y=arguments[2],_=arguments[0].closestPoint(g);y.setMinimum(_,g)}};var mr=function(t){this._maxPtDist=new yr,this._inputGeom=t||null},vr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},vr.MaxPointDistanceFilter.get=function(){return Er},vr.MaxMidpointDistanceFilter.get=function(){return wr},Object.defineProperties(mr,vr);var Er=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ht]},Er.prototype.getClass=function(){return Er};var wr=function(t){this._maxPtDist=new yr,this._minPtDist=new yr,this._geom=t||null};wr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=new I((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,A,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.isDone=function(){return!1},wr.prototype.isGeometryChanged=function(){return!1},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[Qt]},wr.prototype.getClass=function(){return wr};var br=function(t){this._comps=t||null};br.prototype.filter=function(t){t instanceof Jt&&this._comps.add(t)},br.prototype.interfaces_=function(){return[Ut]},br.prototype.getClass=function(){return br},br.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return br.getPolygons(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Jt?n.add(e):e instanceof zt&&e.apply(new br(n)),n}};var Ir=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Ir.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof $t&&this._lines.add(t)},Ir.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ir.prototype.interfaces_=function(){return[ut]},Ir.prototype.getClass=function(){return Ir},Ir.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Ir.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ir.getLines(e,n))}},Ir.getLines=function(){if(1===arguments.length){var t=arguments[0];return Ir.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],vt)&&L(arguments[1],vt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();Ir.getLines(r,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var A=arguments[0],i=arguments[1],o=new bt;return A.apply(new Ir(o,i)),o}if(arguments[0]instanceof ct&&L(arguments[1],vt)){var s=arguments[0],a=arguments[1];return s instanceof $t?a.add(s):s.apply(new Ir(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],vt)&&L(arguments[1],vt)){for(var u=arguments[1],c=arguments[2],l=arguments[0].iterator();l.hasNext();){var f=l.next();Ir.getLines(f,u,c)}return u}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&L(arguments[1],vt)){var h=arguments[1],p=arguments[2];return arguments[0].apply(new Ir(h,p)),h}}};var Cr=function(){if(this._boundaryRule=pt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}};Cr.prototype.locateInternal=function(){if(arguments[0]instanceof I&&arguments[1]instanceof Jt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===S.EXTERIOR)return S.EXTERIOR;if(r===S.BOUNDARY)return S.BOUNDARY;for(var A=0;A<e.getNumInteriorRing();A++){var i=e.getInteriorRingN(A),o=this.locateInPolygonRing(t,i);if(o===S.INTERIOR)return S.EXTERIOR;if(o===S.BOUNDARY)return S.BOUNDARY}return S.INTERIOR}if(arguments[0]instanceof I&&arguments[1]instanceof $t){var s=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(s))return S.EXTERIOR;var u=a.getCoordinates();return a.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?st.isOnLine(s,u)?S.INTERIOR:S.EXTERIOR:S.BOUNDARY}if(arguments[0]instanceof I&&arguments[1]instanceof Kt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?S.INTERIOR:S.EXTERIOR}},Cr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):S.EXTERIOR},Cr.prototype.intersects=function(t,e){return this.locate(t,e)!==S.EXTERIOR},Cr.prototype.updateLocationInfo=function(t){t===S.INTERIOR&&(this._isIn=!0),t===S.BOUNDARY&&this._numBoundaries++},Cr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var A=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,A))}else if(e instanceof ne)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof zt)for(var a=new Qn(e);a.hasNext();){var u=a.next();u!==e&&this.computeLocation(t,u)}},Cr.prototype.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:e instanceof $t||e instanceof Jt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?S.BOUNDARY:this._numBoundaries>0||this._isIn?S.INTERIOR:S.EXTERIOR)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var xr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Nr={INSIDE_AREA:{configurable:!0}};xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Nr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Nr);var Sr=function(t){this._pts=t||null};Sr.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Sr.prototype.interfaces_=function(){return[Ut]},Sr.prototype.getClass=function(){return Sr},Sr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Je.singletonList(t):Sr.getPoints(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof zt&&e.apply(new Sr(n)),n}};var Dr=function(){this._locations=null;var t=arguments[0];this._locations=t};Dr.prototype.filter=function(t){(t instanceof Kt||t instanceof $t||t instanceof Jt)&&this._locations.add(new xr(t,0,t.getCoordinate()))},Dr.prototype.interfaces_=function(){return[Ut]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(t){var e=new bt;return t.apply(new Dr(e)),e};var Lr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Cr,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=A}};Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,A=br.getPolygons(this._geom[e]);if(A.size()>0){var i=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(i,A,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=0;u<o.size();u++)for(var c=o.get(u),l=0;l<s.size();l++)if(this.computeContainmentDistance(c,s.get(l),a),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof xr&&arguments[1]instanceof Jt){var f=arguments[0],h=arguments[1],p=arguments[2],d=f.getCoordinate();if(S.EXTERIOR!==this._ptLocator.locate(d,h))return this._minDistance=0,p[0]=f,p[1]=new xr(h,d),null}},Lr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i);if(this.computeMinDistance(A,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ir.getLines(this._geom[0]),n=Ir.getLines(this._geom[1]),r=Sr.getPoints(this._geom[0]),A=Sr.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,A,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,A,t),void this.updateMinDistance(t,!1))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof Kt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),A=e.getCoordinate(),i=0;i<r.length-1;i++){var o=st.distancePointLine(A,r[i],r[i+1]);if(o<this._minDistance){this._minDistance=o;var s=new dn(r[i],r[i+1]).closestPoint(A);n[0]=new xr(t,i,s),n[1]=new xr(e,0,A)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof $t){var a=arguments[0],u=arguments[1],c=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var l=a.getCoordinates(),f=u.getCoordinates(),h=0;h<l.length-1;h++)for(var p=0;p<f.length-1;p++){var d=st.distanceLineLine(l[h],l[h+1],f[p],f[p+1]);if(d<this._minDistance){this._minDistance=d;var g=new dn(l[h],l[h+1]),y=new dn(f[p],f[p+1]),_=g.closestPoints(y);c[0]=new xr(a,h,_[0]),c[1]=new xr(u,p,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i),s=A.getCoordinate().distance(o.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new xr(A,0,A.getCoordinate()),n[1]=new xr(o,0,o.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var A=t.get(r),i=0;i<e.size();i++){var o=e.get(i);if(this.computeMinDistance(A,o,n),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Tr=function(){this._pt=[new I,new I],this._distance=m.NaN,this._isNull=!0};Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Tr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=A,this._isNull=!1}},Tr.prototype.toString=function(){return Z.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr};var Mr=function(){};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.computeDistance=function(){if(arguments[2]instanceof Tr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,A=t.getCoordinates(),i=0;i<A.length-1;i++){r.setCoordinates(A[i],A[i+1]);var o=r.closestPoint(e);n.setMinimum(o,e)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof Jt&&arguments[1]instanceof I){var s=arguments[0],a=arguments[1],u=arguments[2];Mr.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)Mr.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof I){var l=arguments[0],f=arguments[1],h=arguments[2];if(l instanceof $t)Mr.computeDistance(l,f,h);else if(l instanceof Jt)Mr.computeDistance(l,f,h);else if(l instanceof zt)for(var p=l,d=0;d<p.getNumGeometries();d++){var g=p.getGeometryN(d);Mr.computeDistance(g,f,h)}else h.setMinimum(l.getCoordinate(),f)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof I){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var Or=function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Pr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.prototype.computeOrientedDistance=function(t,e,n){var r=new Rr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var A=new kr(e,this._densifyFrac);t.apply(A),n.setMaximum(A.getMaxPointDistance())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Pr.MaxPointDistanceFilter.get=function(){return Rr},Pr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Or,Pr);var Rr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Mr,this._geom=null;var t=arguments[0];this._geom=t};Rr.prototype.filter=function(t){this._minPtDist.initialize(),Mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Rr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rr.prototype.interfaces_=function(){return[ht]},Rr.prototype.getClass=function(){return Rr};var kr=function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),A=(r.x-n.x)/this._numSubSegs,i=(r.y-n.y)/this._numSubSegs,o=0;o<this._numSubSegs;o++){var s=n.x+o*A,a=n.y+o*i,u=new I(s,a);this._minPtDist.initialize(),Mr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},kr.prototype.isDone=function(){return!1},kr.prototype.isGeometryChanged=function(){return!1},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Qt]},kr.prototype.getClass=function(){return kr};var Br=function(t,e,n){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=e||null,this._result=n||null},Fr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var A=r.getCoordinates();this._errorLocation=A[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Z.toLineString(A[0],A[1])+")"}},Br.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Br.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Br.VERBOSE&&q.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Br.prototype.checkNegativeValid=function(){if(!(this._input instanceof Jt||this._input instanceof ne||this._input instanceof zt))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)},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var A=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(A),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Z.toLineString(A[0],A[1])+" )"}},Br.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)},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.prototype.getPolygonLines=function(t){for(var e=new bt,n=new Ir(e),r=br.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Br.prototype.getErrorMessage=function(){return this._errMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Fr.VERBOSE.get=function(){return!1},Fr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Fr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new j(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new j(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new Br(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")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Jt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;q.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Qr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Qr.prototype.getCoordinates=function(){return this._pts},Qr.prototype.size=function(){return this._pts.length},Qr.prototype.getCoordinate=function(t){return this._pts[t]},Qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ln.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Qr.prototype.setData=function(t){this._data=t},Qr.prototype.getData=function(){return this._data},Qr.prototype.toString=function(){return Z.toLineString(new ae(this._pts))},Qr.prototype.interfaces_=function(){return[fn]},Qr.prototype.getClass=function(){return Qr};var zr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=A,this._intSegments[1]=i,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Xn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new At,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new wn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Se(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Z.toLineString(t[0],t[1])+" and "+Z.toLineString(t[2],t[3])},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};qr.prototype.checkValid=function(){this._nv.checkValid()},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.toSegmentStrings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Qr(r.getCoordinates(),r))}return e},qr.checkValid=function(t){new qr(t).checkValid()};var Yr=function(t){this._mapOp=t};Yr.prototype.map=function(t){for(var e=new bt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(ye.toGeometryArray(e))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(e).map(t)};var jr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bt,this._resultLineList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};jr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},jr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},jr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},jr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),A=t.getEdge();t.isLineEdge()&&(t.isVisited()||!xA.isResultOfOp(r,e)||A.isCovered()||(n.add(A),t.setVisitedEdge(!0)))},jr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var A=this._op.isCoveredByA(n.getCoordinate());r.setCovered(A)}}},jr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},jr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},jr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(xA.isResultOfOp(r,e)&&e===xA.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==xA.INTERSECTION)){var r=n.getLabel();xA.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Xr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Xr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var A=new bt,i=0;i<t.getNumInteriorRing();i++){var o=this.transformLinearRing(t.getInteriorRingN(i),t);null===o||o.isEmpty()||(o instanceof ee||(n=!1),A.add(o))}if(n)return this._factory.createPolygon(r,A.toArray([]));var s=new bt;return null!==r&&s.add(r),s.addAll(A),this._factory.buildGeometry(s)},Xr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Xr.prototype.getInputGeometry=function(){return this._inputGeom},Xr.prototype.transformMultiLineString=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformLineString(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Xr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Xr.prototype.transformMultiPoint=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformPoint(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.transformMultiPolygon=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transformPolygon(t.getGeometryN(r),t);null!==A&&(A.isEmpty()||n.add(A))}return this._factory.buildGeometry(n)},Xr.prototype.copy=function(t){return t.copy()},Xr.prototype.transformGeometryCollection=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var A=this.transform(t.getGeometryN(r));null!==A&&(this._pruneEmptyGeometry&&A.isEmpty()||n.add(A))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ye.toGeometryArray(n)):this._factory.buildGeometry(n)},Xr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof $t)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Jt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Xr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var $r=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $t&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};$r.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var A=t.get(r),i=this.findSnapForVertex(A,e);null!==i&&(t.set(r,new I(i)),0===r&&this._isClosed&&t.set(t.size()-1,new I(i)))}},$r.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},$r.prototype.snapTo=function(t){var e=new Ct(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},$r.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var A=e[r],i=this.findSegmentIndexToSnap(A,t);i>=0&&t.add(i+1,new I(A),!1)}},$r.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,A=0;A<e.size()-1;A++){if(this._seg.p0=e.get(A),this._seg.p1=e.get(A+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var i=this._seg.distance(t);i<this._snapTolerance&&i<n&&(n=i,r=A)}return r},$r.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Wr=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};Wr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Zr(e,n).transform(this._srcGeom)},Wr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Zr(t,n,!0).transform(this._srcGeom),A=r;return e&&L(A,Zt)&&(A=r.buffer(0)),A},Wr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Wr.prototype.extractTargetCoordinates=function(t){for(var e=new h,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Wr.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Wr.snap=function(t,e,n){var r=new Array(2).fill(null),A=new Wr(t);r[0]=A.snapTo(e,n);var i=new Wr(e);return r[1]=i.snapTo(r[0],n),r},Wr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Wr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===he.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var A=arguments[0],i=arguments[1];return Math.min(Wr.computeOverlaySnapTolerance(A),Wr.computeOverlaySnapTolerance(i))}},Wr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Wr.SNAP_PRECISION_FACTOR},Wr.snapToSelf=function(t,e,n){return new Wr(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Wr,Kr);var Zr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new $r(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr),Jr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Jr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Jr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Jr.signExpBits(this._commonBits),this._isFirst=!1,null):Jr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Jr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Jr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Jr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.getBit=function(t,e){return t&1<<e?1:0},Jr.signExpBits=function(t){return t>>52},Jr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Jr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Jr.getBit(t,r)!==Jr.getBit(e,r))return n;n++}return 52};var tA=function(){this._commonCoord=null,this._ccFilter=new nA},eA={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};tA.prototype.addCommonBits=function(t){var e=new rA(this._commonCoord);t.apply(e),t.geometryChanged()},tA.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new rA(e);return t.apply(n),t.geometryChanged(),t},tA.prototype.getCommonCoordinate=function(){return this._commonCoord},tA.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},tA.prototype.interfaces_=function(){return[]},tA.prototype.getClass=function(){return tA},eA.CommonCoordinateFilter.get=function(){return nA},eA.Translater.get=function(){return rA},Object.defineProperties(tA,eA);var nA=function(){this._commonBitsX=new Jr,this._commonBitsY=new Jr};nA.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},nA.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},nA.prototype.interfaces_=function(){return[ht]},nA.prototype.getClass=function(){return nA};var rA=function(){this.trans=null;var t=arguments[0];this.trans=t};rA.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},rA.prototype.isDone=function(){return!1},rA.prototype.isGeometryChanged=function(){return!0},rA.prototype.interfaces_=function(){return[Qt]},rA.prototype.getClass=function(){return rA};var AA=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};AA.prototype.selfSnap=function(t){return new Wr(t).snapTo(t,this._snapTolerance)},AA.prototype.removeCommonBits=function(t){this._cbr=new tA,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},AA.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},AA.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=xA.overlayOp(e[0],e[1],t);return this.prepareResult(n)},AA.prototype.checkValid=function(t){t.isValid()||q.out.println("Snapped geometry is invalid")},AA.prototype.computeSnapTolerance=function(){this._snapTolerance=Wr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},AA.prototype.snap=function(t){var e=this.removeCommonBits(t);return Wr.snap(e[0],e[1],this._snapTolerance)},AA.prototype.interfaces_=function(){return[]},AA.prototype.getClass=function(){return AA},AA.overlayOp=function(t,e,n){return new AA(t,e).getResultGeometry(n)},AA.union=function(t,e){return AA.overlayOp(t,e,xA.UNION)},AA.intersection=function(t,e){return AA.overlayOp(t,e,xA.INTERSECTION)},AA.symDifference=function(t,e){return AA.overlayOp(t,e,xA.SYMDIFFERENCE)},AA.difference=function(t,e){return AA.overlayOp(t,e,xA.DIFFERENCE)};var iA=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};iA.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=xA.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof J))throw t;r=t}if(!n)try{e=AA.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof J?r:t}return e},iA.prototype.interfaces_=function(){return[]},iA.prototype.getClass=function(){return iA},iA.overlayOp=function(t,e,n){return new iA(t,e).getResultGeometry(n)},iA.union=function(t,e){return iA.overlayOp(t,e,xA.UNION)},iA.intersection=function(t,e){return iA.overlayOp(t,e,xA.INTERSECTION)},iA.symDifference=function(t,e){return iA.overlayOp(t,e,xA.SYMDIFFERENCE)},iA.difference=function(t,e){return iA.overlayOp(t,e,xA.DIFFERENCE)};var oA=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};oA.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},oA.prototype.interfaces_=function(){return[]},oA.prototype.getClass=function(){return oA};var sA=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=A,this._obj=i}},aA={INSERT:{configurable:!0},DELETE:{configurable:!0}};sA.prototype.isDelete=function(){return this._eventType===sA.DELETE},sA.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},sA.prototype.getObject=function(){return this._obj},sA.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},sA.prototype.getInsertEvent=function(){return this._insertEvent},sA.prototype.isInsert=function(){return this._eventType===sA.INSERT},sA.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},sA.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},sA.prototype.interfaces_=function(){return[E]},sA.prototype.getClass=function(){return sA},aA.INSERT.get=function(){return 1},aA.DELETE.get=function(){return 2},Object.defineProperties(sA,aA);var uA=function(){};uA.prototype.interfaces_=function(){return[]},uA.prototype.getClass=function(){return uA};var cA=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],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};cA.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(cA.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var A=t.getNumPoints()-1;if(0===e&&r===A||0===r&&e===A)return!0}}return!1},cA.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cA.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},cA.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cA.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},cA.prototype.hasProperIntersection=function(){return this._hasProper},cA.prototype.hasIntersection=function(){return this._hasIntersection},cA.prototype.isDone=function(){return this._isDone},cA.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},cA.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},cA.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var A=t.getCoordinates()[e],i=t.getCoordinates()[e+1],o=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(A,i,o,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,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))))},cA.prototype.interfaces_=function(){return[]},cA.prototype.getClass=function(){return cA},cA.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lA=function(t){function e(){t.call(this),this.events=new bt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Je.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof cA&&L(arguments[0],wt)&&L(arguments[1],wt)){var r=arguments[0],A=arguments[1],i=arguments[2];this.addEdges(r,r),this.addEdges(A,A),this.computeIntersections(i)}else if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&arguments[1]instanceof cA){var o=arguments[0],s=arguments[1];arguments[2]?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),A=0;A<r.length-1;A++){var i=new oA(n,A),o=new sA(e,n.getMinX(A),i);this.events.add(o),this.events.add(new sA(n.getMaxX(A),o))}},e.prototype.processOverlaps=function(t,e,n,r){for(var A=n.getObject(),i=t;i<e;i++){var o=this.events.get(i);if(o.isInsert()){var s=o.getObject();n.isSameLabel(o)||(A.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var A=r.next();this.addEdge(A,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(uA),fA=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},hA={NodeComparator:{configurable:!0}};fA.prototype.getMin=function(){return this._min},fA.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fA.prototype.getMax=function(){return this._max},fA.prototype.toString=function(){return Z.toLineString(new I(this._min,0),new I(this._max,0))},fA.prototype.interfaces_=function(){return[]},fA.prototype.getClass=function(){return fA},hA.NodeComparator.get=function(){return pA},Object.defineProperties(fA,hA);var pA=function(){};pA.prototype.compare=function(t,e){var n=t,r=e,A=(n._min+n._max)/2,i=(r._min+r._max)/2;return A<i?-1:A>i?1:0},pA.prototype.interfaces_=function(){return[b]},pA.prototype.getClass=function(){return pA};var dA=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fA),gA=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fA),yA=function(){this._leaves=new bt,this._root=null,this._level=0};yA.prototype.buildTree=function(){Je.sort(this._leaves,new fA.NodeComparator);for(var t=this._leaves,e=null,n=new bt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},yA.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new dA(t,e,n))},yA.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},yA.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yA.prototype.printNode=function(t){q.out.println(Z.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},yA.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yA.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var A=new gA(t.get(n),t.get(n+1));e.add(A)}}},yA.prototype.interfaces_=function(){return[]},yA.prototype.getClass=function(){return yA};var _A=function(){this._items=new bt};_A.prototype.visitItem=function(t){this._items.add(t)},_A.prototype.getItems=function(){return this._items},_A.prototype.interfaces_=function(){return[$e]},_A.prototype.getClass=function(){return _A};var mA=function(){this._index=null;var t=arguments[0];if(!L(t,Zt))throw new _("Argument must be Polygonal");this._index=new wA(t)},vA={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mA.prototype.locate=function(t){var e=new ot(t),n=new EA(e);return this._index.query(t.y,t.y,n),e.getLocation()},mA.prototype.interfaces_=function(){return[Un]},mA.prototype.getClass=function(){return mA},vA.SegmentVisitor.get=function(){return EA},vA.IntervalIndexedGeometry.get=function(){return wA},Object.defineProperties(mA,vA);var EA=function(){this._counter=null;var t=arguments[0];this._counter=t};EA.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},EA.prototype.interfaces_=function(){return[$e]},EA.prototype.getClass=function(){return EA};var wA=function(){this._index=new yA;var t=arguments[0];this.init(t)};wA.prototype.init=function(t){for(var e=Ir.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wA.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),A=Math.max(n.p0.y,n.p1.y);this._index.insert(r,A,n)}},wA.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _A;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2];this._index.query(r,A,i)}},wA.prototype.interfaces_=function(){return[]},wA.prototype.getClass=function(){return wA};var bA=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new fe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Cr,2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];this._argIndex=A,this._parentGeom=i,this._boundaryNodeRule=o,null!==i&&this.add(i)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),A=1;S.NONE,r.getLocation(t,Ce.ON)===S.BOUNDARY&&A++;var i=e.determineBoundary(this._boundaryNodeRule,A);r.setLocation(t,i)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],A=new cA(arguments[0],!0,!1);A.setIsDoneIfProperInt(r);var i=this.createEdgeSetIntersector(),o=this._parentGeom instanceof ee||this._parentGeom instanceof Jt||this._parentGeom instanceof ne,s=n||!o;return i.computeIntersections(this._edges,A,s),this.addSelfIntersectionNodes(this._argIndex),A}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new cA(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,S.INTERIOR)}else if(arguments[0]instanceof I){var e=arguments[0];this.insertPoint(this._argIndex,e,S.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),S.EXTERIOR,S.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,S.INTERIOR,S.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],S.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],S.BOUNDARY)},e.prototype.addLineString=function(t){var e=xt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Me(this._argIndex,S.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var A=r.next();e[n++]=A.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===S.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=xt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var A=e,i=n;st.isCCW(r)&&(A=n,i=e);var o=new nr(r,new Me(this._argIndex,S.BOUNDARY,A,i));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],S.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),A=r.getLabel();null===A?r._label=new Me(t,n):A.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lA},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),A=n.eiList.iterator();A.hasNext();){var i=A.next();this.addSelfIntersectionNode(t,i.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Jt)this.addPolygon(e);else if(e instanceof $t)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,Zt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mA(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e}(qe),IA=function(){if(this._li=new At,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bA(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=pt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bA(0,e,r),this._arg[1]=new bA(1,n,r)}else if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];A.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(A.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bA(0,A,o),this._arg[1]=new bA(1,i,o)}};IA.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},IA.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},IA.prototype.interfaces_=function(){return[]},IA.prototype.getClass=function(){return IA};var CA=function(){};CA.prototype.interfaces_=function(){return[]},CA.prototype.getClass=function(){return CA},CA.map=function(){if(arguments[0]instanceof ct&&L(arguments[1],CA.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bt,r=0;r<t.getNumGeometries();r++){var A=e.map(t.getGeometryN(r));null!==A&&n.add(A)}return t.getFactory().buildGeometry(n)}if(L(arguments[0],vt)&&L(arguments[1],CA.MapOp)){for(var i=arguments[0],o=arguments[1],s=new bt,a=i.iterator();a.hasNext();){var u=a.next(),c=o.map(u);null!==c&&s.add(c)}return s}},CA.MapOp=function(){};var xA=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Cr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new bt,this._resultLineList=new bt,this._resultPointList=new bt,this._graph=new qe(new Yn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip();var A=e.getDepth();A.isNull()&&A.add(n),A.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,A){var i=new bt;return i.addAll(t),i.addAll(n),i.addAll(r),i.isEmpty()?e.createEmptyResult(A,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(i)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==S.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){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 e=new bt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new jr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var A=new Hr(this,this._geomFact,this._ptLocator);this._resultPointList=A.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),A=r.getLabel();A.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(A.getLocation(0,Ce.RIGHT),A.getLocation(1,Ce.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var A=0;A<2;A++)n.isNull(A)||!n.isArea()||r.isNull(A)||(0===r.getDelta(A)?n.toLine(A):(et.isTrue(!r.isNull(A,Ce.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(A,Ce.LEFT,r.getLocation(A,Ce.LEFT)),et.isTrue(!r.isNull(A,Ce.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(A,Ce.RIGHT,r.getLocation(A,Ce.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(IA);xA.overlayOp=function(t,e,n){return new xA(t,e).getResultGeometry(n)},xA.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return xA.createEmptyResult(xA.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[CA.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.INTERSECTION)},xA.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xA.createEmptyResult(xA.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.SYMDIFFERENCE)},xA.resultDimension=function(t,e,n){var r=e.getDimension(),A=n.getDimension(),i=-1;switch(t){case xA.INTERSECTION:i=Math.min(r,A);break;case xA.UNION:i=Math.max(r,A);break;case xA.DIFFERENCE:i=r;break;case xA.SYMDIFFERENCE:i=Math.max(r,A)}return i},xA.createEmptyResult=function(t,e,n,r){var A=null;switch(xA.resultDimension(t,e,n)){case-1:A=r.createGeometryCollection(new Array(0).fill(null));break;case 0:A=r.createPoint();break;case 1:A=r.createLineString();break;case 2:A=r.createPolygon()}return A},xA.difference=function(t,e){return t.isEmpty()?xA.createEmptyResult(xA.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.DIFFERENCE))},xA.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return xA.isResultOfOp(n,r,e)}if(3===arguments.length){var A=arguments[0],i=arguments[1],o=arguments[2];switch(A===S.BOUNDARY&&(A=S.INTERIOR),i===S.BOUNDARY&&(i=S.INTERIOR),o){case xA.INTERSECTION:return A===S.INTERIOR&&i===S.INTERIOR;case xA.UNION:return A===S.INTERIOR||i===S.INTERIOR;case xA.DIFFERENCE:return A===S.INTERIOR&&i!==S.INTERIOR;case xA.SYMDIFFERENCE:return A===S.INTERIOR&&i!==S.INTERIOR||A!==S.INTERIOR&&i===S.INTERIOR}return!1}},xA.INTERSECTION=1,xA.UNION=2,xA.DIFFERENCE=3,xA.SYMDIFFERENCE=4;var NA=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Cr,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};NA.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},NA.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?S.BOUNDARY:this._ptLocator.locate(t,this._g)},NA.prototype.extractLinework=function(t){var e=new SA;t.apply(e);var n=e.getLinework(),r=ye.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},NA.prototype.interfaces_=function(){return[]},NA.prototype.getClass=function(){return NA};var SA=function(){this._linework=null,this._linework=new bt};SA.prototype.getLinework=function(){return this._linework},SA.prototype.filter=function(t){if(t instanceof Jt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},SA.prototype.interfaces_=function(){return[Ut]},SA.prototype.getClass=function(){return SA};var DA=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};DA.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),A=0;A<r.length-1;A++)this.computeOffsetPoints(r[A],r[A+1],e,n)},DA.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},DA.prototype.getPoints=function(t){for(var e=new bt,n=Ir.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},DA.prototype.computeOffsetPoints=function(t,e,n,r){var A=e.x-t.x,i=e.y-t.y,o=Math.sqrt(A*A+i*i),s=n*A/o,a=n*i/o,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var l=new I(u-a,c+s);r.add(l)}if(this._doRight){var f=new I(u+a,c-s);r.add(f)}},DA.prototype.interfaces_=function(){return[]},DA.prototype.getClass=function(){return DA};var LA=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new NA(this._geom[0],this._boundaryDistanceTolerance),new NA(this._geom[1],this._boundaryDistanceTolerance),new NA(this._geom[2],this._boundaryDistanceTolerance)]},TA={TOLERANCE:{configurable:!0}};LA.prototype.reportResult=function(t,e,n){q.out.println("Overlay result invalid - A:"+S.toLocationSymbol(e[0])+" B:"+S.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+S.toLocationSymbol(e[2]))},LA.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},LA.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=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),!!LA.hasLocation(this._location,S.BOUNDARY)||this.isValidResult(r,this._location)}},LA.prototype.addTestPts=function(t){var e=new DA(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},LA.prototype.isValidResult=function(t,e){var n=xA.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===S.INTERIOR);return r||this.reportResult(t,e,n),r},LA.prototype.getInvalidLocation=function(){return this._invalidLocation},LA.prototype.interfaces_=function(){return[]},LA.prototype.getClass=function(){return LA},LA.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},LA.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Wr.computeSizeBasedSnapTolerance(t),Wr.computeSizeBasedSnapTolerance(e))},LA.isValid=function(t,e,n,r){return new LA(t,e,r).isValid(n)},TA.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(LA,TA);var MA=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};MA.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},MA.prototype.combine=function(){for(var t=new bt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},MA.prototype.interfaces_=function(){return[]},MA.prototype.getClass=function(){return MA},MA.combine=function(){if(1===arguments.length)return new MA(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new MA(MA.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],A=arguments[2];return new MA(MA.createList(n,r,A)).combine()}},MA.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},MA.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],A=arguments[1],i=arguments[2],o=new bt;return o.add(r),o.add(A),o.add(i),o}};var OA=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bt)},PA={STRTREE_NODE_CAPACITY:{configurable:!0}};OA.prototype.reduceToGeometries=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next(),A=null;L(r,wt)?A=this.unionTree(r):r instanceof ct&&(A=r),e.add(A)}return e},OA.prototype.extractByEnvelope=function(t,e,n){for(var r=new bt,A=0;A<e.getNumGeometries();A++){var i=e.getGeometryN(A);i.getEnvelopeInternal().intersects(t)?r.add(i):n.add(i)}return this._geomFactory.buildGeometry(r)},OA.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return MA.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var A=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,A)},OA.prototype.union=function(){if(null===this._inputPolys)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 on(OA.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},OA.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var A=OA.getGeometry(e,n);return this.unionSafe(A,null)}if(r-n==2)return this.unionSafe(OA.getGeometry(e,n),OA.getGeometry(e,n+1));var i=Math.trunc((r+n)/2),o=this.binaryUnion(e,n,i),s=this.binaryUnion(e,i,r);return this.unionSafe(o,s)}},OA.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},OA.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},OA.prototype.unionActual=function(t,e){return OA.restrictToPolygons(t.union(e))},OA.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},OA.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bt,A=this.extractByEnvelope(n,t,r),i=this.extractByEnvelope(n,e,r),o=this.unionActual(A,i);return r.add(o),MA.combine(r)},OA.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},OA.prototype.interfaces_=function(){return[]},OA.prototype.getClass=function(){return OA},OA.restrictToPolygons=function(t){if(L(t,Zt))return t;var e=br.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(ye.toPolygonArray(e))},OA.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},OA.union=function(t){return new OA(t).union()},PA.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(OA,PA);var RA=function(){};RA.prototype.interfaces_=function(){return[]},RA.prototype.getClass=function(){return RA},RA.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return xA.createEmptyResult(xA.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,xA.UNION)},t.GeoJSONReader=be,t.GeoJSONWriter=Ie,t.OverlayOp=xA,t.UnionOp=RA,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,qi.exports);var Yi=qi.exports;function ji(){return new Hi}function Hi(){this.reset()}Hi.prototype={constructor:Hi,reset:function(){this.s=this.t=0},add:function(t){$i(Xi,t,this.t),$i(this,Xi.s,this.s),this.s?this.t+=Xi.t:this.s=Xi.t},valueOf:function(){return this.s}};var Xi=new Hi;function $i(t,e,n){var r=t.s=e+n,A=r-e,i=r-A;t.t=e-i+(n-A)}var Wi=1e-6,Ki=Math.PI,Zi=Ki/2,Ji=Ki/4,to=2*Ki,eo=180/Ki,no=Ki/180,ro=Math.abs,Ao=Math.atan,io=Math.atan2,oo=Math.cos,so=Math.sin,ao=Math.sqrt;function uo(t){return t>1?0:t<-1?Ki:Math.acos(t)}function co(t){return t>1?Zi:t<-1?-Zi:Math.asin(t)}function lo(){}function fo(t,e){t&&yo.hasOwnProperty(t.type)&&yo[t.type](t,e)}var ho,po,go={Feature:function(t,e){fo(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,A=n.length;++r<A;)fo(n[r].geometry,e)}},yo={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){_o(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)_o(n[r],e,0)},Polygon:function(t,e){mo(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,A=n.length;++r<A;)mo(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,A=n.length;++r<A;)fo(n[r],e)}};function _o(t,e,n){var r,A=-1,i=t.length-n;for(e.lineStart();++A<i;)r=t[A],e.point(r[0],r[1],r[2]);e.lineEnd()}function mo(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)_o(t[n],e,1);e.polygonEnd()}function vo(t){return[io(t[1],t[0]),co(t[2])]}function Eo(t){var e=t[0],n=t[1],r=oo(n);return[r*oo(e),r*so(e),so(n)]}function wo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bo(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Io(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Co(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function xo(t){var e=ao(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function No(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function So(t,e){return[t>Ki?t-to:t<-Ki?t+to:t,e]}function Do(t){return function(e,n){return[(e+=t)>Ki?e-to:e<-Ki?e+to:e,n]}}function Lo(t){var e=Do(t);return e.invert=Do(-t),e}function To(t,e){var n=oo(t),r=so(t),A=oo(e),i=so(e);function o(t,e){var o=oo(e),s=oo(t)*o,a=so(t)*o,u=so(e),c=u*n+s*r;return[io(a*A-c*i,s*n-u*r),co(c*A+a*i)]}return o.invert=function(t,e){var o=oo(e),s=oo(t)*o,a=so(t)*o,u=so(e),c=u*A-a*i;return[io(a*A+u*i,s*n+c*r),co(c*n-s*r)]},o}function Mo(t,e){(e=Eo(e))[0]-=t,xo(e);var n=uo(-e[1]);return((-e[2]<0?-n:n)+to-Wi)%to}function Oo(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:lo,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Po(t,e){return ro(t[0]-e[0])<Wi&&ro(t[1]-e[1])<Wi}function Ro(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ko(t,e,n,r,A){var i,o,s=[],a=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Po(r,o)){for(A.lineStart(),i=0;i<e;++i)A.point((r=t[i])[0],r[1]);A.lineEnd()}else s.push(n=new Ro(r,t,null,!0)),a.push(n.o=new Ro(r,null,n,!1)),s.push(n=new Ro(o,t,null,!1)),a.push(n.o=new Ro(o,null,n,!0))}})),s.length){for(a.sort(e),Bo(s),Bo(a),i=0,o=a.length;i<o;++i)a[i].e=n=!n;for(var u,c,l=s[0];;){for(var f=l,h=!0;f.v;)if((f=f.n)===l)return;u=f.z,A.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(i=0,o=u.length;i<o;++i)A.point((c=u[i])[0],c[1]);else r(f.x,f.n.x,1,A);f=f.n}else{if(h)for(u=f.p.z,i=u.length-1;i>=0;--i)A.point((c=u[i])[0],c[1]);else r(f.x,f.p.x,-1,A);f=f.p}u=(f=f.o).z,h=!h}while(!f.v);A.lineEnd()}}}function Bo(t){if(e=t.length){for(var e,n,r=0,A=t[0];++r<e;)A.n=n=t[r],n.p=A,A=n;A.n=n=t[0],n.p=A}}function Fo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Go(t){for(var e,n,r,A=t.length,i=-1,o=0;++i<A;)o+=t[i].length;for(n=new Array(o);--A>=0;)for(e=(r=t[A]).length;--e>=0;)n[--o]=r[e];return n}ji(),ji(),ji(),So.invert=So,1===(ho=Fo).length&&(po=ho,ho=function(t,e){return Fo(po(t),e)});var Uo=1e9,Qo=-1e9;function zo(t,e,n,r){function A(A,i){return t<=A&&A<=n&&e<=i&&i<=r}function i(A,i,s,u){var c=0,l=0;if(null==A||(c=o(A,s))!==(l=o(i,s))||a(A,i)<0^s>0)do{u.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==l);else u.point(i[0],i[1])}function o(r,A){return ro(r[0]-t)<Wi?A>0?0:3:ro(r[0]-n)<Wi?A>0?2:1:ro(r[1]-e)<Wi?A>0?1:0:A>0?3:2}function s(t,e){return a(t.x,e.x)}function a(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var a,u,c,l,f,h,p,d,g,y,_,m=o,v=Oo(),E={point:w,lineStart:function(){E.point=b,u&&u.push(c=[]);y=!0,g=!1,p=d=NaN},lineEnd:function(){a&&(b(l,f),h&&g&&v.rejoin(),a.push(v.result()));E.point=w,g&&m.lineEnd()},polygonStart:function(){m=v,a=[],u=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,A=u.length;n<A;++n)for(var i,o,s=u[n],a=1,c=s.length,l=s[0],f=l[0],h=l[1];a<c;++a)i=f,o=h,f=(l=s[a])[0],h=l[1],o<=r?h>r&&(f-i)*(r-o)>(h-o)*(t-i)&&++e:h<=r&&(f-i)*(r-o)<(h-o)*(t-i)&&--e;return e}(),n=_&&e,A=(a=Go(a)).length;(n||A)&&(o.polygonStart(),n&&(o.lineStart(),i(null,null,1,o),o.lineEnd()),A&&ko(a,s,e,i,o),o.polygonEnd());m=o,a=u=c=null}};function w(t,e){A(t,e)&&m.point(t,e)}function b(i,o){var s=A(i,o);if(u&&c.push([i,o]),y)l=i,f=o,h=s,y=!1,s&&(m.lineStart(),m.point(i,o));else if(s&&g)m.point(i,o);else{var a=[p=Math.max(Qo,Math.min(Uo,p)),d=Math.max(Qo,Math.min(Uo,d))],v=[i=Math.max(Qo,Math.min(Uo,i)),o=Math.max(Qo,Math.min(Uo,o))];!function(t,e,n,r,A,i){var o,s=t[0],a=t[1],u=0,c=1,l=e[0]-s,f=e[1]-a;if(o=n-s,l||!(o>0)){if(o/=l,l<0){if(o<u)return;o<c&&(c=o)}else if(l>0){if(o>c)return;o>u&&(u=o)}if(o=A-s,l||!(o<0)){if(o/=l,l<0){if(o>c)return;o>u&&(u=o)}else if(l>0){if(o<u)return;o<c&&(c=o)}if(o=r-a,f||!(o>0)){if(o/=f,f<0){if(o<u)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>u&&(u=o)}if(o=i-a,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>u&&(u=o)}else if(f>0){if(o<u)return;o<c&&(c=o)}return u>0&&(t[0]=s+u*l,t[1]=a+u*f),c<1&&(e[0]=s+c*l,e[1]=a+c*f),!0}}}}}(a,v,t,e,n,r)?s&&(m.lineStart(),m.point(i,o),_=!1):(g||(m.lineStart(),m.point(a[0],a[1])),m.point(v[0],v[1]),s||m.lineEnd(),_=!1)}p=i,d=o,g=s}return E}}var Vo=ji();function qo(t){return t}ji(),ji(),ji();var Yo=1/0,jo=Yo,Ho=-Yo,Xo=Ho,$o={point:function(t,e){t<Yo&&(Yo=t);t>Ho&&(Ho=t);e<jo&&(jo=e);e>Xo&&(Xo=e)},lineStart:lo,lineEnd:lo,polygonStart:lo,polygonEnd:lo,result:function(){var t=[[Yo,jo],[Ho,Xo]];return Ho=Xo=-(jo=Yo=1/0),t}};function Wo(t,e,n,r){return function(A,i){var o,s,a,u=e(i),c=A.invert(r[0],r[1]),l=Oo(),f=e(l),h=!1,p={point:d,lineStart:y,lineEnd:_,polygonStart:function(){p.point=m,p.lineStart=v,p.lineEnd=E,s=[],o=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=_,s=Go(s);var t=function(t,e){var n=e[0],r=e[1],A=[so(n),-oo(n),0],i=0,o=0;Vo.reset();for(var s=0,a=t.length;s<a;++s)if(c=(u=t[s]).length)for(var u,c,l=u[c-1],f=l[0],h=l[1]/2+Ji,p=so(h),d=oo(h),g=0;g<c;++g,f=_,p=v,d=E,l=y){var y=u[g],_=y[0],m=y[1]/2+Ji,v=so(m),E=oo(m),w=_-f,b=w>=0?1:-1,I=b*w,C=I>Ki,x=p*v;if(Vo.add(io(x*b*so(I),d*E+x*oo(I))),i+=C?w+b*to:w,C^f>=n^_>=n){var N=bo(Eo(l),Eo(y));xo(N);var S=bo(A,N);xo(S);var D=(C^w>=0?-1:1)*co(S[2]);(r>D||r===D&&(N[0]||N[1]))&&(o+=C^w>=0?1:-1)}}return(i<-1e-6||i<Wi&&Vo<-1e-6)^1&o}(o,c);s.length?(h||(i.polygonStart(),h=!0),ko(s,Zo,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){var r=A(e,n);t(e=r[0],n=r[1])&&i.point(e,n)}function g(t,e){var n=A(t,e);u.point(n[0],n[1])}function y(){p.point=g,u.lineStart()}function _(){p.point=d,u.lineEnd()}function m(t,e){a.push([t,e]);var n=A(t,e);f.point(n[0],n[1])}function v(){f.lineStart(),a=[]}function E(){m(a[0][0],a[0][1]),f.lineEnd();var t,e,n,r,A=f.clean(),u=l.result(),c=u.length;if(a.pop(),o.push(a),a=null,c)if(1&A){if((e=(n=u[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else c>1&&2&A&&u.push(u.pop().concat(u.shift())),s.push(u.filter(Ko))}return p}}function Ko(t){return t.length>1}function Zo(t,e){return((t=t.x)[0]<0?t[1]-Zi-Wi:Zi-t[1])-((e=e.x)[0]<0?e[1]-Zi-Wi:Zi-e[1])}ji();var Jo=Wo((function(){return!0}),(function(t){var e,n=NaN,r=NaN,A=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Ki:-Ki,a=ro(i-n);ro(a-Ki)<Wi?(t.point(n,r=(r+o)/2>0?Zi:-Zi),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(i,r),e=0):A!==s&&a>=Ki&&(ro(n-A)<Wi&&(n-=A*Wi),ro(i-s)<Wi&&(i-=s*Wi),r=function(t,e,n,r){var A,i,o=so(t-n);return ro(o)>Wi?Ao((so(e)*(i=oo(r))*so(n)-so(r)*(A=oo(e))*so(t))/(A*i*o)):(e+r)/2}(n,r,i,o),t.point(A,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=i,r=o),A=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var A;if(null==t)A=n*Zi,r.point(-Ki,A),r.point(0,A),r.point(Ki,A),r.point(Ki,0),r.point(Ki,-A),r.point(0,-A),r.point(-Ki,-A),r.point(-Ki,0),r.point(-Ki,A);else if(ro(t[0]-e[0])>Wi){var i=t[0]<e[0]?Ki:-Ki;A=n*i/2,r.point(-i,A),r.point(0,A),r.point(i,A)}else r.point(e[0],e[1])}),[-Ki,-Zi]);function ts(t,e){var n=oo(t),r=n>0,A=ro(n)>Wi;function i(t,e){return oo(t)*oo(e)>n}function o(t,e,r){var A=[1,0,0],i=bo(Eo(t),Eo(e)),o=wo(i,i),s=i[0],a=o-s*s;if(!a)return!r&&t;var u=n*o/a,c=-n*s/a,l=bo(A,i),f=Co(A,u);Io(f,Co(i,c));var h=l,p=wo(f,h),d=wo(h,h),g=p*p-d*(wo(f,f)-1);if(!(g<0)){var y=ao(g),_=Co(h,(-p-y)/d);if(Io(_,f),_=vo(_),!r)return _;var m,v=t[0],E=e[0],w=t[1],b=e[1];E<v&&(m=v,v=E,E=m);var I=E-v,C=ro(I-Ki)<Wi;if(!C&&b<w&&(m=w,w=b,b=m),C||I<Wi?C?w+b>0^_[1]<(ro(_[0]-v)<Wi?w:b):w<=_[1]&&_[1]<=b:I>Ki^(v<=_[0]&&_[0]<=E)){var x=Co(h,(-p+y)/d);return Io(x,f),[_,vo(x)]}}}function s(e,n){var A=r?t:Ki-t,i=0;return e<-A?i|=1:e>A&&(i|=2),n<-A?i|=4:n>A&&(i|=8),i}return Wo(i,(function(t){var e,n,a,u,c;return{lineStart:function(){u=a=!1,c=1},point:function(l,f){var h,p=[l,f],d=i(l,f),g=r?d?0:s(l,f):d?s(l+(l<0?Ki:-Ki),f):0;if(!e&&(u=a=d)&&t.lineStart(),d!==a&&(!(h=o(e,p))||Po(e,h)||Po(p,h))&&(p[0]+=Wi,p[1]+=Wi,d=i(p[0],p[1])),d!==a)c=0,d?(t.lineStart(),h=o(p,e),t.point(h[0],h[1])):(h=o(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(A&&e&&r^d){var y;g&n||!(y=o(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!d||e&&Po(e,p)||t.point(p[0],p[1]),e=p,a=d,n=g},lineEnd:function(){a&&t.lineEnd(),e=null},clean:function(){return c|(u&&a)<<1}}}),(function(n,r,A,i){!function(t,e,n,r,A,i){if(n){var o=oo(e),s=so(e),a=r*n;null==A?(A=e+r*to,i=e-a/2):(A=Mo(o,A),i=Mo(o,i),(r>0?A<i:A>i)&&(A+=r*to));for(var u,c=A;r>0?c>i:c<i;c-=a)u=vo([o,-s*oo(c),-s*so(c)]),t.point(u[0],u[1])}}(i,t,e,A,n,r)}),r?[0,-t]:[-Ki,t-Ki])}function es(t){return function(e){var n=new ns;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ns(){}function rs(t,e,n){var r=e[1][0]-e[0][0],A=e[1][1]-e[0][1],i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&go.hasOwnProperty(t.type)?go[t.type](t,e):fo(t,e)}(n,t.stream($o));var o=$o.result(),s=Math.min(r/(o[1][0]-o[0][0]),A/(o[1][1]-o[0][1])),a=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(A-s*(o[1][1]+o[0][1]))/2;return null!=i&&t.clipExtent(i),t.scale(150*s).translate([a,u])}ns.prototype={constructor:ns,point:function(t,e){this.stream.point(t,e)},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()}};var As=16,is=oo(30*no);function os(t,e){return+e?function(t,e){function n(r,A,i,o,s,a,u,c,l,f,h,p,d,g){var y=u-r,_=c-A,m=y*y+_*_;if(m>4*e&&d--){var v=o+f,E=s+h,w=a+p,b=ao(v*v+E*E+w*w),I=co(w/=b),C=ro(ro(w)-1)<Wi||ro(i-l)<Wi?(i+l)/2:io(E,v),x=t(C,I),N=x[0],S=x[1],D=N-r,L=S-A,T=_*D-y*L;(T*T/m>e||ro((y*D+_*L)/m-.5)>.3||o*f+s*h+a*p<is)&&(n(r,A,i,o,s,a,N,S,C,v/=b,E/=b,w,d,g),g.point(N,S),n(N,S,C,v,E,w,u,c,l,f,h,p,d,g))}}return function(e){var r,A,i,o,s,a,u,c,l,f,h,p,d={point:g,lineStart:y,lineEnd:m,polygonStart:function(){e.polygonStart(),d.lineStart=v},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,d.point=_,e.lineStart()}function _(r,A){var i=Eo([r,A]),o=t(r,A);n(c,l,u,f,h,p,c=o[0],l=o[1],u=r,f=i[0],h=i[1],p=i[2],As,e),e.point(c,l)}function m(){d.point=g,e.lineEnd()}function v(){y(),d.point=E,d.lineEnd=w}function E(t,e){_(r=t,e),A=c,i=l,o=f,s=h,a=p,d.point=_}function w(){n(c,l,u,f,h,p,A,i,r,o,s,a,As,e),d.lineEnd=m,m()}return d}}(t,e):function(t){return es({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var ss=es({point:function(t,e){this.stream.point(t*no,e*no)}});function as(t){return function(t){var e,n,r,A,i,o,s,a,u,c,l=150,f=480,h=250,p=0,d=0,g=0,y=0,_=0,m=null,v=Jo,E=null,w=qo,b=.5,I=os(N,b);function C(t){return[(t=i(t[0]*no,t[1]*no))[0]*l+n,r-t[1]*l]}function x(t){return(t=i.invert((t[0]-n)/l,(r-t[1])/l))&&[t[0]*eo,t[1]*eo]}function N(t,A){return[(t=e(t,A))[0]*l+n,r-t[1]*l]}function S(){i=No(A=function(t,e,n){return(t%=to)?e||n?No(Lo(t),To(e,n)):Lo(t):e||n?To(e,n):So}(g,y,_),e);var t=e(p,d);return n=f-t[0]*l,r=h+t[1]*l,D()}function D(){return u=c=null,C}return C.stream=function(t){return u&&c===t?u:u=ss(v(A,I(w(c=t))))},C.clipAngle=function(t){return arguments.length?(v=+t?ts(m=t*no,6*no):(m=null,Jo),D()):m*eo},C.clipExtent=function(t){return arguments.length?(w=null==t?(E=o=s=a=null,qo):zo(E=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1]),D()):null==E?null:[[E,o],[s,a]]},C.scale=function(t){return arguments.length?(l=+t,S()):l},C.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],S()):[f,h]},C.center=function(t){return arguments.length?(p=t[0]%360*no,d=t[1]%360*no,S()):[p*eo,d*eo]},C.rotate=function(t){return arguments.length?(g=t[0]%360*no,y=t[1]%360*no,_=t.length>2?t[2]%360*no:0,S()):[g*eo,y*eo,_*eo]},C.precision=function(t){return arguments.length?(I=os(N,b=t*t),D()):ao(b)},C.fitExtent=function(t,e){return rs(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return rs(t,[[0,0],e],n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&x,S()}}((function(){return t}))()}function us(t){return function(e,n){var r=oo(e),A=oo(n),i=t(r*A);return[i*A*so(e),i*so(n)]}}function cs(t){return function(e,n){var r=ao(e*e+n*n),A=t(r),i=so(A),o=oo(A);return[io(e*i,r*o),co(r&&n*i/r)]}}us((function(t){return ao(2/(1+t))})).invert=cs((function(t){return 2*co(t/2)}));var ls=us((function(t){return(t=uo(t))&&t/so(t)}));function fs(){return as(ls).scale(79.4188).clipAngle(179.999)}function hs(t,e){return[t,e]}function ps(t,e,n,r){var A=t.properties||{},i="Feature"===t.type?t.geometry:t;if("GeometryCollection"===i.type){var o=[];return Ii(t,(function(t){var A=ps(t,e,n,r);A&&o.push(A)})),gi(o)}var s=function(t){var e=Oi(t).geometry.coordinates,n=[-e[0],-e[1]];return fs().rotate(n).scale(li)}(i),a={type:i.type,coordinates:gs(i.coordinates,s)},u=(new Yi.GeoJSONReader).read(a),c=yi(_i(e,n),"meters"),l=Yi.BufferOp.bufferOp(u,c,r);if(!ds((l=(new Yi.GeoJSONWriter).write(l)).coordinates))return hi({type:l.type,coordinates:ys(l.coordinates,s)},A)}function ds(t){return Array.isArray(t[0])?ds(t[0]):isNaN(t[0])}function gs(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return gs(t,e)}))}function ys(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return ys(t,e)}))}ls.invert=cs((function(t){return t})),hs.invert=hs;const _s="SMALL",ms="MEDIUM",vs="LARGE",Es="CORRIDOR",ws={[vs]:2,[ms]:3.5,[_s]:1/0},bs={HOURS_AGO:2,SEVERITY:0,ALT_FROM:5,ALT_TO:52},Is={[_s]:1,[ms]:0,[vs]:0,[Es]:1},Cs="[SkyPath SDK]: Flow is not running",xs="[SkyPath SDK]: Flow already started",Ns="[SkyPath SDK]: Flow already terminated",Ss={INITIALIZED:"initialized",RUNNING:"running",STOPPED:"stopped",TERMINATED:"terminated"},Ds=({coordinates:t})=>{const e=structuredClone(t);return Ls({coordinates:e})},Ls=({coordinates:t})=>t.map(((e,n)=>{const r=t.at(n-1);return r&&Math.abs(r[0]-e[0])>180?(e[0]-r[0]>180?e[0]-=360:r[0]-e[0]>180&&(e[0]+=360),e):e})),Ts=({coordinate:t})=>{const[e,n]=t;return[Math.max(-180,Math.min(180,e)),Math.max(-90,Math.min(90,n))]},Ms=({h3Index:t,properties:e})=>(void 0===e&&(e={}),{type:"Feature",id:t,properties:e,geometry:{type:"Polygon",coordinates:[KA(t)]}}),Os=({squareMeters:t})=>t/1852/1852,Ps=({hexagons:t,getProperties:e})=>{const n=[];for(let r=0;r<t.length;r++){const A=t[r],i=e?.(A)||{};n.push(Ms({h3Index:A,properties:i}))}return{type:"FeatureCollection",features:n}},Rs=({hexagons:t=[],scale:e=1})=>{if(!t||!t?.length)return;const n=t.reduce(((t,e)=>(t[e.hexId]=e,t)),{}),r=Ps({hexagons:t.map((({hexId:t})=>t)),getProperties:t=>n[t]}).features.map((t=>{const n=zi(di(t.geometry.coordinates),e);return{...t,geometry:n.geometry}}));return{type:"FeatureCollection",features:r}},ks=({hexagons:t})=>t.reduce(((t,e)=>{const{hexId:n,sev:r,alt:A,observationTime:i}=e;return(!t[n]||t[n].sev<r)&&(t[n]={hexId:n,sev:r,alt:A,observationTime:i}),t}),{}),Bs=({coordinate:t})=>t?.reverse(),Fs=({mapBounds:t,resolution:e=0})=>{const n=Mi(t).geometry.coordinates.map((t=>t.map((t=>Bs({coordinate:t})))));return ti(n,e)},Gs=({polygon:t,resolution:e=0,shouldInvertLatLng:n=!0})=>{const r=t.map((t=>n?Bs({coordinate:t}):t));return ti(r,e)},Us=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{hoursAgo:n=bs.HOURS_AGO,altitudeFrom:r=bs.ALT_FROM,altitudeTo:A=bs.ALT_TO,severity:i=bs.SEVERITY}=e,o=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=r&&t<=A)).filter((({sev:t})=>t>=i)).filter((({observationTime:t})=>yA().unix()-t<=3600*n))])).filter((([,t])=>t.length>0));return Object.fromEntries(o)},Qs=({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{altitudeFrom:n=bs.ALT_FROM,altitudeTo:r=bs.ALT_TO,severity:A=bs.SEVERITY}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({alt:t})=>t>=n&&t<=r)).map((t=>{const e=t.severities.filter((({sev:t})=>t>=A));return{...t,severities:e}})).filter((({severities:t})=>t.length>0))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},zs=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>Array.isArray(n)?n.map((({hexId:n,...r})=>({hexId:JA(n,t,e),...r}))):null)).filter(Boolean)},Vs=({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.map((({hexId:n,alt:r,severities:A})=>({hexId:JA(n,t,e),alt:r,...A[0]})))))},qs={0:700,1:300},Ys=({polygon:t,resolution:e,extensionFactor:n=1})=>{const r=function(t,e,n){var r=(n=n||{}).units||"kilometers",A=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof A)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(A<=0)throw new Error("steps must be greater than 0");var i=[];switch(t.type){case"GeometryCollection":return Ii(t,(function(t){var n=ps(t,e,r,A);n&&i.push(n)})),gi(i);case"FeatureCollection":return bi(t,(function(t){var n=ps(t,e,r,A);n&&bi(n,(function(t){t&&i.push(t)}))})),gi(i)}return ps(t,e,r,A)}(di([t]),qs[e]*n,{units:"kilometers"});return r.geometry.coordinates[0]},js=25e5,Hs=({polygon:t})=>{const e=ki(di([t]));if(Os({squareMeters:e})>js)throw new Error("Corridor area is too large, maximum allowed area is 2500000 nautical miles")},Xs=({polygon:t,precision:e=1})=>{const n=di([t]);return Number(Math.log2(360/(Ci(n)[2]-Ci(n)[0])).toFixed(e))},$s=({polygon:t,mapping:e=ws})=>{const n=Xs({polygon:t});return Object.entries(e).find((([,t])=>n<=t))[0]},Ws=({deg:t})=>t*Math.PI/180,Ks=({rad:t})=>180*t/Math.PI,Zs=({bbox:t})=>{const e=6378137,[n,r,A,i]=t,o=Ws({deg:n}),s=Ws({deg:r}),a=Ws({deg:A}),u=Ws({deg:i}),c=e*o,l=e*a,f=(e*Math.log(Math.tan(Math.PI/4+s/2))+e*Math.log(Math.tan(Math.PI/4+u/2)))/2,h=(c+l)/2/e,p=2*Math.atan(Math.exp(f/e))-Math.PI/2;return[Ks({rad:h}),Ks({rad:p})]},Js=({polygon:t,resolution:e,extensionFactor:n})=>{const r=Ci(di([t])),A=Mi(Ci(pi(Zs({bbox:r})))).geometry.coordinates[0];return Ys({polygon:A,resolution:e,extensionFactor:n})};var ta=Object.freeze({__proto__:null,CORRIDOR_POLYGON_MAX_AREA_NM:js,HEX_RESOLUTION_BUFFERS:qs,adjustAntiMeridianCrossing:Ds,adjustFeatureCoordinates:({coordinates:t})=>Ds({coordinates:t}).map((t=>Ts({coordinate:t}))),clampCoordinates:Ts,extendPolygonByResolution:Ys,getHexIdsByMapBoundsAndResolution:Fs,getHexIdsByPolygonAndResolution:Gs,getHexIdsFromMapboxMap:({map:t,resolution:e})=>{if(!t)return;const n=t.getBounds().toArray().flat();return Fs({mapBounds:n,resolution:e})},getHexagonsDataSlice:Us,getHexagonsFeatureCollection:Rs,getMapPolygon:({map:t})=>{const e=t.getBounds().toArray().flat(),[n,r,A,i]=e;return[[n,i],[n,r],[A,r],[A,i],[n,i]]},getMercatorCenterFromBbox:Zs,getMiddleArea:Js,getOneLayerHexagonsDataSlice:Qs,getPolygonSize:$s,getZoomLevel:Xs,groupByHexIdAndSelectMostSevere:ks,h3SetToFeatureCollection:Ps,h3ToFeature:Ms,invertLatLng:Bs,normalizeAntiMeridian:Ls,prepareHexagonsDataForMapHexagons:zs,prepareOneLayerHexagonsDataForMapHexagons:Vs,squareMetersToNauticalMiles:Os,validateCorridorArea:Hs});const ea=({event:t,listener:e})=>{if("string"!=typeof t||"function"!=typeof e)throw new aA(`Invalid params - event must be a string and listener must be a function,\n received event - ${t}, listener - ${e}`)};class na{constructor(){this.#e=new Map}#e;on(t,e){ea({event:t,listener:e}),this.#e.has(t)||this.#e.set(t,[]),this.#e.get(t).push(e)}off(t,e){if(ea({event:t,listener:e}),!this.#e.has(t))return;const n=this.#e.get(t).filter((t=>t!==e));n.length>0?this.#e.set(t,n):this.#e.delete(t)}emit(t,...e){(({event:t})=>{if("string"!=typeof t)throw new aA(`Invalid params - event must be a string, received event - ${t}`)})({event:t}),this.#e.has(t)&&this.#e.get(t).forEach((t=>{t(...e)}))}once(t,e){ea({event:t,listener:e});const n=(...r)=>{e(...r),this.off(t,n)};this.on(t,n)}clear(){this.#e.clear()}}class ra{#n=Ss.INITIALIZED;start(){if(this.#n===Ss.RUNNING)throw new Error(xs);this.#n=Ss.RUNNING}stop(){if(this.#n===Ss.TERMINATED)throw new Error(Ns);if(this.#n===Ss.INITIALIZED)throw new Error(Cs);this.#n=Ss.STOPPED}terminate(){if(this.#n===Ss.TERMINATED)throw new Error(Ns);if(this.#n===Ss.INITIALIZED)throw new Error(Cs);this.#n=Ss.TERMINATED}get isInitialRun(){return[Ss.INITIALIZED,Ss.TERMINATED].includes(this.#n)}get state(){return this.#n}get isRunning(){return this.#n===Ss.RUNNING}get isStopped(){return this.#n===Ss.STOPPED}get isTerminated(){return this.#n===Ss.TERMINATED}}const Aa={INFO:"/v5/nowcasting/info",DATA:"/v5/nowcasting/{resolution}/{hexId}"},ia="DATA",oa="UPDATE_CONFIG",sa="UPDATE_INTERVAL",aa="LOAD_NOWCASTING_DATA",ua="IS_PENDING_CHANGE",ca={FORECAST:0,SEVERITY:2,ALTITUDE:35},la=({edrValue:t})=>t<=.13?0:t<=.18?1:t<=.25?2:t<=.4?3:4;class fa{constructor({cacheTokenService:t,nowcastingService:e}){this.#r=9e5,this.#A=t,this.#i=e,this.#o=new ra,this.#s=new Set}#r;#o;#s;#a=new na;onData=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#a.on(ia,t)};updateConfig=(t={})=>{this.#a.emit(oa,t)};onChangeIsPending=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#a.on(ua,t)};#A;#i;#u=[];#c=[];#l=null;#f=null;#h=new Map;#p=async()=>await this.#A.getToken();#d=async()=>await(this.#i?.getInfo()?.lastUpdatedAt)||yA().unix();#g=async(t,e,n,r,A)=>{try{if(this.#A.checkToken(t)||(t=await this.#p()),!r?.length)return{token:t};A&&e.clear();const i=r.filter((t=>!this.#s.has(t)));i.forEach((t=>this.#s.add(t)));const o=i.filter((t=>!e.has(t)));if(0===o.length)return{token:t};const s=await Promise.allSettled(o.map((e=>{return this.#i.getData({token:t.token,lastUpdatedAt:n,resolution:(r=e,A=VA(r),i=A[0],o=A[1],TA.isValidCell(i,o)?TA.getResolution(i,o):-1),hexId:e}).then((t=>({...t,hexId:e}))).finally((()=>this.#s.delete(e)));var r,A,i,o})));s.map((t=>"rejected"===t.status?null:t.value)).forEach((t=>{if(!t?.hexId)return;const n=t.items.map((({hexIds:t,...e})=>({sev:la({edrValue:e?.edr}),...e,hexIds:t})));e.set(t.hexId,n)}));return{nowcastingData:Object.fromEntries(e),token:t}}catch(t){throw new fA("Failed to load nowcasting data",{error:t})}};#y=null;start(){try{const t=this.#o.state===Ss.INITIALIZED||this.#o.state===Ss.TERMINATED;this.#o.start(),this.#y=setInterval((()=>this.#a.emit(sa,{})),this.#r),t&&(this.#a.on(sa,this.#_),this.#a.on(aa,this.#m),this.#a.on(oa,this.#v));const e=t?[]:this.#c;this.#v({hexIds:e})}catch(t){throw new fA("Failed to start nowcasting flow",{error:t})}}stop(){this.#o.stop(),clearInterval(this.#y),this.#y=null,this.#s.clear()}terminate(){this.#o.terminate(),clearInterval(this.#y),this.#y=null,this.#l=null,this.#f=null,this.#u=[],this.#h.clear(),this.#s.clear(),this.#a.clear()}getState=()=>this.#o.state;#m=async({shouldEraseOldData:t=!1,hexIds:e=this.#u,token:n=this.#l,currentDataMap:r=this.#h,lastUpdatedAt:A=this.#f})=>{if(this.#o.state!==Ss.RUNNING)return;this.#a.emit(ua,!0);const{token:i,nowcastingData:o}=await this.#g(n,r,A,e,t);this.#a.emit(ua,!1),this.#l=i,this.#f=A,this.#u=e,o&&this.#a.emit(ia,o)};#_=async({lastUpdatedAt:t=this.#f})=>{if(this.#o.state!==Ss.RUNNING)return;const e=await this.#d();if(!(e!==t))return;this.#f=e;const n={lastUpdatedAt:t=e,shouldEraseOldData:!0};this.#a.emit(aa,n)};#v=async({hexIds:t,polygon:e})=>{let n,r,A=e?Gs({polygon:e}):t||this.#u;if(this.#o.state!==Ss.RUNNING)return void(this.#c=A);this.#l||(n=await this.#p(),this.#l=n),this.#f||(r=await this.#d(),this.#f=r);const i={token:n,currentDataMap:this.#h,lastUpdatedAt:r,hexIds:A};this.#a.emit(aa,i)}}class ha{constructor({fetcher:t}){this.#t=t}#t;async getInfo(){try{return(await this.#t({path:Aa.INFO})).data}catch(t){throw new uA("Failed to get nowcasting info",{error:t})}}async getData({resolution:t,hexId:e,lastUpdatedAt:n,token:r}){try{const A=Aa.DATA.replace("{resolution}",t).replace("{hexId}",e),i={lastUpdatedAt:n,token:r,forecastH:13};return(await this.#t({path:A,params:i})).data}catch(t){throw new uA("Failed to get nowcasting data",{error:t})}}}const pa="/v4/aircraft";class da{constructor({fetcher:t}){this.#t=t}#t;async getMapping(){try{const t=pa;return await this.#t({path:t,method:Fr})}catch(t){throw new uA("Failed to get aircraft mapping",{error:t})}}}const ga="/v5/cache-token",ya=t=>{if(!t?.expireAt)return!1;const e=(new Date).getTime();return new Date(t.expireAt).getTime()>e};class _a{#t;constructor({fetcher:t}){this.#t=t}getToken=async()=>{try{return(await this.#t({path:ga})).data}catch(t){throw new uA("Failed to get cache token",{error:t})}};checkToken=ya}const ma=async({response:t})=>{const e=t.status,n=t.statusText;let r={400:"Bad request, please check the request body;",401:"Unauthorized, please check the API key or JWT;",403:"Forbidden;",404:"Endpoint is not found, please check the URL;",500:"Internal server error;"}[e]||n||"Unknown error";const A=(await t.json().catch((()=>{})))?.message?.split(":")?.at(1)?.trim()||"";return[r,A?`(${A})`:""].join(" ")};class va{#E;constructor({environment:t,proxyUrl:e}){this.#E=e||Zr[t?.toLowerCase()]||Zr[Wr]}authenticate=async({apiKey:t,userId:e,companyName:n,authCallback:r})=>{if(![t,e,n,r].filter(Boolean).length)throw new aA(rA);return r?await this.#w({authCallback:r}):await this.#b({apiKey:t,userId:e,companyName:n})};async#I({token:t}){const e=`${this.#E}${jr}`,n={method:Fr,headers:{[Qr]:t}},r=await fetch(e,n);if(!r.ok){const t=await ma({response:r});throw new Error(t)}const{data:A}=await r.json(),{companyId:i,id:o}=A;return{companyId:i,userId:o}}async#b({apiKey:t,userId:e,companyName:n}){try{const r=await this.#C({apiKey:t,userId:e,companyName:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new lA(iA,{error:t})}}async#w({authCallback:t}){try{const{jwt:e,partnerId:n}=await t(),r=await this.#N({jwt:e,partnerId:n}),A=await this.#I({token:r});return{fetcher:this.#x({token:r}),me:A}}catch(t){throw new lA(AA,{error:t})}}#S=async({path:t,headers:e={},body:n})=>{try{const r=`${this.#E}${t}`,A={method:Gr,headers:{[zr]:"application/json",...e},body:n?JSON.stringify(n):null},i=await fetch(r,A);if(!i.ok){const t=await ma({response:i});throw new Error(t)}const{data:o}=await i.json(),{token:s}=o;return s}catch(t){throw new uA(oA,{error:t})}};#C=async({apiKey:t,userId:e,companyName:n})=>await this.#S({path:Vr,headers:{[Ur]:t},body:{userId:e,companyName:n}});#N=async({jwt:t,partnerId:e})=>await this.#S({path:qr,body:{signedJwt:t,partnerId:e}});#D=async({token:t})=>await this.#S({path:Yr,body:{token:t}});#x=({token:t})=>async({path:e="",method:n=Fr,params:r,headers:A={},body:i=null,signal:o=null,retry:s=3})=>{let a=0;const u=r?"?"+new URLSearchParams(Object.fromEntries(Object.entries(r||{}).filter((([,t])=>null!=t)))):"",c={url:`${this.#E}${e}${u}`,options:{method:n,headers:{...A,[Qr]:t,[zr]:"application/json"},body:n!==Fr?JSON.stringify(i):null,signal:o}};let l=null;for(;a<s;){a+=1;let e=!1;if(l=await fetch(c.url,c.options).catch((t=>{if(t===Hr)return e=!0,null})),e)return{data:null,aborted:!0};if(!l||204===l.status)return{data:null};if(l.ok)return await l.json();401===l.status&&(t=await this.#D({token:t}),c.options.headers[Qr]=t)}const f=await ma({response:l});throw new uA(f,{...l})}}const Ea={DATA:"/adsb/v5/hexagons/{resolution}/{hexId}"},wa={[_s]:0,[ms]:1,[vs]:1,[Es]:1},ba={[_s]:2,[ms]:1,[vs]:2.5,[Es]:1},Ia="polygon",Ca="isCorridorMode",xa=(t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=JA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)},Na=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map(((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],observationTime:e.observationTime[n]})))};class Sa{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async(t,e)=>{const{polygon:n,polygonSize:r}=t;if(!n||!r)return null;r===Es&&Hs({polygon:n});const A=wa[r],{hexIds:i,childCells:o}=(({polygon:t,polygonSize:e})=>{let n=t;const r=Is[e],A=ba[e];let i,o;switch(e){case vs:n=Js({polygon:n,resolution:r,extensionFactor:A});break;case Es:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Ys({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}})({polygon:n,polygonSize:r});r===vs&&([...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),[...this.#L.keys()].forEach((t=>!i.includes(t.split(",")[0])&&this.#L.delete(t))));const s=i.filter((t=>{const e=String([t,r,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:i,updatedAt:o}=n,s=yA().unix()-i,a=yA().unix()-o;return!(s<60)&&!(a<60)}));if(!s.length)return xa(this.#L,[r,A],{childCells:o});const a=s.map((t=>{const n=Ea.DATA.replace("{hexId}",t).replace("{resolution}",String(Is[r])),i=String([t,r,A]),o=this.#L.get(i)?.updatedAt;return this.#t({path:n,method:Fr,params:{minSev:A,hoursAgo:4,maxAlt:bs.ALT_TO,minAlt:bs.ALT_FROM,since:o},signal:e})}));return(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:Na(t),updatedAt:t.value.data?.updatedAt},i=s[e],o=String([i,r,A]),a=this.#L.get(o);if(!!a?.updatedAt&&!!a?.reports?.length&&a?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=a.reports,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),s={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(o,s)}else this.#L.set(o,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t))),xa(this.#L,[r,A],{childCells:o})};expire=()=>{const t=[...this.#L.entries()],e=yA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class Da{constructor({fetcher:t}){this.#T=new Sa({fetcher:t}),this.#M=new AbortController,this.#O=oi({time:500}),this.#P=oi({time:6e4}),this.#R={polygon:null,polygonSize:null,isCorridorMode:!1}}#R;#T;#M;#k;#B;#F;#O;#P;#G;#U;#Q;#z=async()=>{if(this.#k)try{this.#T.expire(),this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch(this.#R,this.#M.signal);this.#V(t);const e=await t;this.#G?.(e,this.#F),this.#F=e}catch(t){const e=new fA("Failed to run ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#P.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#P.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop ADSB flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e})=>{try{(({polygon:t,isCorridorMode:e})=>{if(!ri({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean")})({polygon:t,isCorridorMode:e});const n=ui({current:this.#R,next:{polygon:t,isCorridorMode:e}}),r={...this.#R};if(n.has(Ca)&&(r.isCorridorMode=e),n.has(Ia)&&(r.polygon=t,r.polygonSize=r.isCorridorMode?Es:$s({polygon:t})),this.#R=r,!this.#k)return;this.#O.run(this.#z.bind(this))}catch(n){const r=new fA("Failed to updateConfig for ADSB flow",{error:n,config:{polygon:t,isCorridorMode:e}});if(!this.#U)throw r;this.#U(r)}}}const La={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},Ta={DATA:"/observations/v5/hexagons/{resolution}/{hexId}"},Ma={[_s]:0,[ms]:1,[vs]:1,[Es]:1},Oa={[_s]:2,[ms]:1,[vs]:2.5,[Es]:1},Pa="polygon",Ra="isCorridorMode",ka="aircraftCategory",Ba={getNowcastingDataSlice:({data:t,filters:e})=>{if(!t)return{};if(!e)return t;const{forecast:n=ca.FORECAST,severity:r=ca.SEVERITY,altitude:A=ca.ALTITUDE}=e,i=Object.entries(t).map((([t,e])=>[t,e.filter((({forecast:t})=>t===n)).filter((({alt:t})=>t===A)).filter((({sev:t})=>t>=r))])).filter((([,t])=>t.length>0));return Object.fromEntries(i)},prepareNowcastingDataForMapHexagons:({data:t,resolution:e=5})=>{if(!t)return[];return Object.entries(t).flatMap((([t,n])=>n.flatMap((({hexIds:n,...r})=>n.map((n=>{let A;try{A=JA(n,t,e)}catch(r){return console.warn(`[SkyPath SDK]: Hexagon skipped; ${r?.message||"Error while converting hexId to cellHexId"}`,{hexId:n,cell:t,resolution:e}),null}return{hexId:A,...r}})))).filter(Boolean)))}},Fa={availableConfigInputs:{aircraftCategory:La,hours:{halfAnHour:"0.5",oneHour:"1",twoHours:"2",threeHours:"3",fourHours:"4"},severity:{smooth:0,light:1,lightModerate:2,moderate:3,moderateSevere:4},maxAltitude:52,minAltitude:5,largePolygonHandlingBehavior:{IGNORE:"ignore",USE_MIDDLE_AREA:"loadMiddleArea",EXCLUDE_SMOOTH_SEVERITY:"excludeSmoothSeverity"}}},Ga={C10:"C10",C20:"C20",C30:"C30",C40:"C40",C50:"C50",C60:"C60",C70:"C70",C80:"C80",C90:"C90",C100:"C100",C110:"C110"},Ua={halfAnHour:"0.5",oneHour:"1",twoHours:"2",fourHours:"4"},Qa={DATA:"/one-layer/v5/{res}/{hexId}"},za={[_s]:0,[ms]:1,[vs]:1,[Es]:1},Va={[_s]:2,[ms]:1,[vs]:2.5,[Es]:1},qa="polygon",Ya="isCorridorMode",ja="aircraftCategory",Ha="hoursAgo",Xa=({polygon:t,polygonSize:e})=>{let n=t;const r=Is[e],A=Va[e];let i,o;switch(e){case vs:n=Js({polygon:n,resolution:r,extensionFactor:A});break;case Es:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Ys({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}},$a=({forecastTs:t})=>{let e;return e=!t||yA.unix(t).isBefore(yA())||yA.unix(t).isBefore(yA().add(3,"minute"))?yA().unix():t,e},Wa=({oneLayer:t,nowcasting:e,forecastTs:n,nowcastingAlt:r})=>{const A=new Map;t.forEach((t=>A.set(`${t.hexId}-${t.alt}`,t)));const i=(({nowcasting:t,forecastTs:e,nowcastingAlt:n})=>{const r=$a({forecastTs:e}),A=Math.floor((r-yA().unix())/3600);return t?.filter((t=>t.alt===n&&t.forecast===A))})({nowcasting:e,forecastTs:n,nowcastingAlt:r});return i?.forEach((t=>{t.hexIds.forEach((e=>{const n=`${e}-${t.alt}`;if(A.has(n)){const t=A.get(n);t.severities[0].sources.push(0),A.set(n,t)}else A.set(n,(({hexId:t,nowcastItem:e})=>({hexId:t,alt:e.alt,severities:[{edr:null,sev:2===e.sev?1:e.sev,sources:[0],observationTime:yA().add(e.forecast+1,"hour").startOf("hour").unix(),usedSource:0,usedSourceTs:yA().add(e.forecast,"hour").startOf("hour").unix()}]}))({hexId:e,nowcastItem:t}))}))})),[...A.values()]},Ka=({oneLayerStore:t,nowcastingData:e,selector:n,options:r})=>{const{childCells:A,forecastTs:i,nowcastingAlt:o,hoursAgo:s}=r,a=[...t.entries()].filter((([t])=>{const[,...e]=t.split(",");return e.join(",")===n.join(",")})).map((([t,n])=>{const[r]=t.split(","),{reports:a}=n,u=(({reports:t,forecastTs:e,hoursAgo:n})=>{const r=$a({forecastTs:e});return t.map((t=>({...t,severities:[t.severities?.find(((t,e,A)=>{const i=A[e+1],o=t.observationTime,s=i?i.observationTime:yA.unix(t.observationTime).add(Number(n),"hour").unix();return r>=o&&r<s}))].filter(Boolean)}))).filter((t=>t.severities.length))})({reports:a,forecastTs:i,hoursAgo:s}),c=e&&e[r]?Wa({oneLayer:u,nowcasting:e[r],forecastTs:i,nowcastingAlt:o}):a;if(!A?.length)return[r,c];const l=c.filter((t=>{const{hexId:e}=t,n=JA(e,r,5);return A.includes(n)}));return[r,l]}));return Object.fromEntries(a)},Za=({responseData:t})=>t?t.hexId.map(((e,n)=>({hexId:e,alt:t.alt[n],severities:t.severities.sev[n].map(((e,r)=>({edr:t.severities.edr[n][r],sev:t.severities.sev[n][r],sources:t.severities.sources[n][r],observationTime:t.severities.ts[n][r],usedSource:t.severities.usedSource[n][r],usedSourceTs:t.severities.usedSourceTs[n][r]})))}))):[],Ja=t=>({toRawObject:()=>t||null,toHexagonsArray:()=>t?Vs({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=Vs({data:t}),n=ks({hexagons:e});return Rs({hexagons:Object.values(n)})}});class tu{constructor({fetcher:t}){this.#t=t,this.#L=new Map,this.#i=new ha({fetcher:t}),this.#A=new _a({fetcher:t}),this.#Y={}}#L;#t;#i;#A;#Y;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A,hoursAgo:i}=t;if(!n||!r)return null;r===Es&&Hs({polygon:n});const o=za[r],{hexIds:s}=Xa({polygon:n,polygonSize:r});r===vs&&[...this.#L.keys()].forEach((t=>!s.includes(t.split(",")[0])&&this.#L.delete(t)));const a=s.filter((t=>{const e=String([t,r,o,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:s,updatedAt:a}=n,u=yA().unix()-s,c=yA().unix()-a;return!(u<60)&&!(c<60)}));if(!a.length)return;await new Promise((t=>{const e=new fa({cacheTokenService:this.#A,nowcastingService:this.#i});e.onData((n=>{this.#Y={...this.#Y,...n},e.terminate(),t(n)})),e.start(),e.updateConfig({hexIds:a})}));const u=a.map((t=>{const n=Qa.DATA.replace("{hexId}",t).replace("{res}",String(Is[r])),s=String([t,r,o,i,A]),a=this.#L.get(s)?.updatedAt;return this.#t({path:n,method:Fr,params:{acCat:A,hoursAgo:i,minAlt:bs.ALT_FROM,maxAlt:bs.ALT_TO,since:a},signal:e})}));(await Promise.allSettled(u)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:Za({responseData:t?.value?.data}),updatedAt:t.value.data?.updatedAt},s=a[e],u=String([s,r,o,i,A]),c=this.#L.get(u);if(!!c?.updatedAt&&!!c?.reports?.length&&c?.updatedAt!==n.updatedAt){const t=(({oldReports:t,newReports:e})=>{const n=new Map,r=({item:t})=>`${t.hexId}-${t.alt}`;return t.forEach((t=>n.set(r({item:t}),t))),e.forEach((t=>n.set(r({item:t}),t))),Array.from(n.values())})({oldReports:c.reports,newReports:n.reports}),e={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:t};this.#L.set(u,e)}else this.#L.set(u,n)}));for(const[t,{reports:e,...n}]of this.#L.entries()){const r=e.map((t=>({...t,severities:t?.severities?.filter((t=>t.sev>=o))}))).filter((t=>t.severities.length));r.length?this.#L.set(t,{...n,reports:r}):this.#L.delete(t)}[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t)))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A,hoursAgo:i}=t,{maxAltitude:o,minAltitude:s,minSeverity:a,forecastTs:u,nowcastingAlt:c}=e;if(!n||!r)return Ja();const l=za[r],{childCells:f}=Xa({polygon:n,polygonSize:r}),h=Ka({oneLayerStore:this.#L,nowcastingData:this.#Y,selector:[r,l,i,A],options:{childCells:f,forecastTs:u,nowcastingAlt:c,hoursAgo:i}}),p=Qs({data:h,filters:{altitudeFrom:s,altitudeTo:o,severity:a}});return Ja(p)};expire=({hoursAgo:t})=>{this.#L=(({store:t,hoursAgo:e})=>{const n=new Map(t);return[...n.entries()].forEach((t=>{const[r,A]=t,{reports:i,...o}=A,s=[];i.forEach((t=>{const n=t?.severities?.filter((t=>yA.unix(t.observationTime).add(e,"hour").unix()>yA().unix()));n.length&&s.push({...t,severities:n})})),s.length?n.set(r,{...o,reports:s}):n.delete(r)})),n})({store:this.#L,hoursAgo:t})};dispose=()=>this.#L.clear()}class eu{constructor({fetcher:t}){this.#T=new tu({fetcher:t}),this.#M=new AbortController,this.#O=oi({time:500}),this.#P=oi({time:6e4}),this.#R={polygon:null,polygonSize:null,isCorridorMode:!1,hoursAgo:Number(Ua.oneHour),aircraftCategory:Ga.C60},this.#j={forecastTs:null,nowcastingAlt:35,maxAltitude:bs.ALT_TO,minAltitude:bs.ALT_FROM,minSeverity:bs.SEVERITY}}#R;#j;#T;#M;#H;#k;#B;#F=Ja();#O;#P;#G;#U;#Q;#z=async()=>{if(this.#k)try{if(this.#T.expire({hoursAgo:this.#R.hoursAgo}),this.#H){this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch({config:this.#R,signal:this.#M.signal});this.#V(t),await t}const t=this.#T.getData({config:this.#R,filters:this.#j});this.#G?.(t,this.#F),this.#F=t,this.#H=!1}catch(t){const e=new fA("Failed to run OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#P.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#P.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop OneLayer flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,maxAltitude:A,minAltitude:i,minSeverity:o,forecastTs:s,nowcastingAlt:a})=>{if(!ri({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ri({value:n})){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(Ga).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ri({value:r})){if("string"!=typeof r)throw new Error("hoursAgo must be a string");if(!Object.values(Ua).includes(r))throw new Error("hoursAgo must be one of the allowed values, '0.5', '1', '2' ,'4'")}if(!ri({value:A})){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!ri({value:i})){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!ri({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}if(!ri({value:s})){if("number"!=typeof s)throw new Error("forecastTs must be a number");if(!yA.unix(s).isValid())throw new Error("forecastTs must be a valid Unix timestamp")}if(!ri({value:a})){if("number"!=typeof a)throw new Error("nowcastingAlt must be a number");if(a<5||a>52)throw new Error("nowcastingAlt must be a number between 5 and 52")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:r,forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a});const u={...this.#R},c=ui({current:this.#R,next:{polygon:t,isCorridorMode:e,aircraftCategory:n,hoursAgo:Number(r)}});c.has(Ya)&&(u.isCorridorMode=e),c.has(qa)&&(u.polygon=t,u.polygonSize=u.isCorridorMode?Es:$s({polygon:t})),c.has(ja)&&(u.aircraftCategory=n),c.has(Ha)&&(u.hoursAgo=Number(r)),this.#R=u,this.#j=ai({current:this.#j,next:{forecastTs:A,nowcastingAlt:i,maxAltitude:o,minAltitude:s,minSeverity:a}}),this.#H=c.size>0,this.#O.run(this.#z.bind(this))}catch(r){const A=new fA("Failed to update config for OneLayerFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}const nu=({polygon:t,polygonSize:e})=>{let n=t;const r=Is[e],A=Oa[e];let i,o;switch(e){case vs:n=Js({polygon:n,resolution:r,extensionFactor:A});break;case Es:{o=ti(n,5,!0);const t=t=>ZA(t,1),e=new Set(o.map(t));i=Array.from(e);break}default:n=Ys({polygon:n,resolution:r,extensionFactor:A})}return i??=ti(n,r,!0),{hexIds:i,childCells:o}},ru=t=>{const e=t.value.data;if(!e)return[];return e.hexId.map(((t,n)=>({hexId:t,alt:e.alt[n],sev:e.sev[n],edr:e.edr[n],observationTime:e.observationTime[n]})))},Au=t=>({toRawObject:()=>t,toHexagonsArray:()=>t?zs({data:t}):null,toFeatureCollection:()=>{if(!t)return null;const e=zs({data:t}),n=ks({hexagons:e});return Rs({hexagons:Object.values(n)})}});class iu{constructor({fetcher:t}){this.#t=t,this.#L=new Map}#L;#t;fetch=async({config:t,signal:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return;r===Es&&Hs({polygon:n});const i=Ma[r],{hexIds:o}=nu({polygon:n,polygonSize:r});r===vs&&[...this.#L.keys()].forEach((t=>!o.includes(t.split(",")[0])&&this.#L.delete(t)));const s=o.filter((t=>{const e=String([t,r,i,A]);if(!this.#L.has(e))return!0;const n=this.#L.get(e),{fetchedAt:o,updatedAt:s}=n,a=yA().unix()-o,u=yA().unix()-s;return!(a<60)&&!(u<60)}));if(!s.length)return;const a=s.map((t=>{const n=Ta.DATA.replace("{hexId}",t).replace("{resolution}",String(Is[r])),o=String([t,r,i,A]),s=this.#L.get(o)?.updatedAt;return this.#t({path:n,method:Fr,params:{minSev:i,hoursAgo:4,maxAlt:bs.ALT_TO,minAlt:bs.ALT_FROM,acCat:A,since:s},signal:e})}));(await Promise.allSettled(a)).forEach(((t,e)=>{if("fulfilled"!==t.status)return;if(t.value.aborted)return;const n={fetchedAt:yA().unix(),reports:ru(t),updatedAt:t.value.data?.updatedAt},o=s[e],a=String([o,r,i,A]),u=this.#L.get(a);if(!!u?.updatedAt&&!!u?.reports?.length&&u?.updatedAt!==n.updatedAt){const t=new Map,e=t=>`${t.hexId}-${t.alt}`,r=u.reports,A=n.reports;r.forEach((n=>t.set(e(n),n))),A.forEach((n=>t.set(e(n),n)));const i=Array.from(t.values()),o={fetchedAt:n.fetchedAt,updatedAt:n.updatedAt,reports:i};this.#L.set(a,o)}else this.#L.set(a,n)})),[...this.#L.keys()].forEach((t=>!t.includes(r)&&this.#L.delete(t)))};getData=({config:t,filters:e})=>{const{polygon:n,polygonSize:r,aircraftCategory:A}=t;if(!n||!r)return Au();const i=Ma[r],{childCells:o}=nu({polygon:n,polygonSize:r}),s=((t,e,n={})=>{const{childCells:r}=n,A=[...t.entries()].filter((([t])=>{const[,...n]=t.split(",");return n.join(",")===e.join(",")})).map((([t,e])=>{const[n]=t.split(","),{reports:A}=e;if(!r?.length)return[n,A];const i=A.filter((t=>{const{hexId:e}=t,A=JA(e,n,5);return r.includes(A)}));return[n,i]}));return Object.fromEntries(A)})(this.#L,[r,i,A],{childCells:o}),{historyHours:a,maxAltitude:u,minAltitude:c,minSeverity:l}=e,f=Us({data:s,filters:{hoursAgo:a,altitudeFrom:c,altitudeTo:u,severity:l}});return Au(f)};expire=()=>{const t=[...this.#L.entries()],e=yA().unix();t.forEach((t=>{const[n,r]=t,{reports:A,...i}=r,o=A.filter((t=>e-t.observationTime<14400));this.#L.set(n,{...i,reports:o})}))};dispose=()=>this.#L.clear()}class ou{constructor({fetcher:t}){this.#T=new iu({fetcher:t}),this.#M=new AbortController,this.#O=oi({time:500}),this.#P=oi({time:6e4}),this.#R={polygon:null,polygonSize:null,isCorridorMode:!1,aircraftCategory:La.C60},this.#j={historyHours:2,maxAltitude:52,minAltitude:5,minSeverity:0}}#R;#j;#T;#M;#H;#k;#B;#O;#P;#F=Au();#G;#U;#Q;#z=async()=>{if(this.#k)try{if(this.#T.expire(),this.#H){this.#B&&(this.#M.abort(Hr),this.#M=new AbortController,this.#V(null));const t=this.#T.fetch({config:this.#R,signal:this.#M.signal});this.#V(t),await t}const t=this.#T.getData({config:this.#R,filters:this.#j});this.#G?.(t,this.#F),this.#F=t,this.#H=!1}catch(t){const e=new fA("Failed to run Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}finally{this.#V(null),this.#k&&this.#P.run(this.#z.bind(this))}};#q=()=>{try{this.#O.cancel(),this.#P.cancel(),this.#k=!1,this.#M.abort(Hr),this.#M=new AbortController,this.#V(null)}catch(t){const e=new fA("Failed to stop Observations flow correctly",{error:t});if(!this.#U)throw e;this.#U(e)}};#V=t=>{this.#B=t,this.#Q?.(!!t)};onData=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#G=t};onError=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#U=t};onIsProcessingChange=t=>{if(!Ai({fn:t}))throw new aA(nA);this.#Q=t};start=()=>{this.#k=!0,this.#z()};stop=()=>this.#q();terminate=()=>{this.#q(),this.#T.dispose()};get isRunning(){return this.#k}updateConfig=({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{try{(({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o})=>{if(!ri({value:t})){if(!Array.isArray(t))throw new Error("Polygon must be an array of points");if(t.length<4)throw new Error("Polygon must have at least 4 points");if(t.some((t=>2!==t.length||t.some((t=>isNaN(Number(t)))))))throw new Error("Each point in the polygon must be an array of two numbers [latitude, longitude]")}if(!ri({value:e})&&"boolean"!=typeof e)throw new Error("isCorridorMode must be a boolean");if(!ri({value:n})){if("string"!=typeof n)throw new Error("aircraftCategory must be a string");if(!Object.values(La).includes(n))throw new Error("aircraftCategory must be one of the allowed values, 'C10' - 'C110'")}if(!ri({value:r})){if("number"!=typeof r)throw new Error("historyHours must be a number");if(![.5,1,2,3,4].includes(r))throw new Error("historyHours must be one of the allowed values, 0.5, 1, 2, 4")}if(!ri({value:A})){if("number"!=typeof A)throw new Error("maxAltitude must be a number");if(A<0||A>52)throw new Error("maxAltitude must be a number between 0 and 52")}if(!ri({value:i})){if("number"!=typeof i)throw new Error("minAltitude must be a number");if(i<0||i>52)throw new Error("minAltitude must be a number between 0 and 52")}if(!ri({value:o})){if("number"!=typeof o)throw new Error("minSeverity must be a number");if(![0,1,2,3,4].includes(o))throw new Error("minSeverity must be a number between 0 and 4")}})({polygon:t,isCorridorMode:e,aircraftCategory:n,historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o});const s={...this.#R},a=ui({current:this.#R,next:{polygon:t,isCorridorMode:e,aircraftCategory:n}});a.has(Ra)&&(s.isCorridorMode=e),a.has(Pa)&&(s.polygon=t,s.polygonSize=s.isCorridorMode?Es:$s({polygon:t})),a.has(ka)&&(s.aircraftCategory=n),this.#R=s,this.#j=ai({current:this.#j,next:{historyHours:r,maxAltitude:A,minAltitude:i,minSeverity:o}}),this.#H=a.size>0,this.#O.run(this.#z.bind(this))}catch(r){const A=new fA("Failed to update config for ObservationsFlow",{error:r,config:{polygon:t,isCorridorMode:e,aircraftCategory:n}});if(!this.#U)throw A;this.#U(A)}}}return t.CoreUtils=ci,t.GeoUtils=ta,t.Nowcasting=Ba,t.Observations=Fa,t.default=async({apiKey:t,userId:e,companyName:n,authCallback:r,environment:A=Wr,proxyUrl:i,applicationId:o,isMonitoringEnabled:s=!0,shouldCollectConsoleLogs:a=!1,shouldCollectErrors:u=!1})=>{try{const c=new va({environment:A,proxyUrl:i}),{fetcher:l,me:f}=await c.authenticate({apiKey:t,userId:e,companyName:n,authCallback:r});(({isEnabled:t,collectConsole:e,collectErrors:n,applicationId:r,environment:A,companyId:i,userId:o})=>{t&&A?.toLowerCase()!==Xr&&(Br.init({clientToken:"pub0b945dd1505a74367a4f900219c56210",service:"skypath-web-sdk",site:"datadoghq.com",env:A,version:Jr,forwardErrorsToLogs:n,forwardConsoleLogs:e?"all":[],sessionSampleRate:100,beforeSend:t=>{switch(t.origin){case"logger":{const e=t.logger?.name||"unknown-logger",n={[tA]:eA.SDK}[e]||`[${e}]`;return t.message=`${n} ${t.message}`,!0}case"network":{const e=t?.http?.status_code;return 0!==e||(t.message=[eA.NETWORK,t.message].join(" ")),!0}default:return!1}}}),Br.setGlobalContext({applicationId:r,companyId:i,userId:o}),Br.createLogger(tA,{level:"info",handler:"http",context:{applicationId:r}}))})({isEnabled:s,collectConsole:a,collectErrors:u,applicationId:o,environment:A,companyId:f?.companyId,userId:f?.userId});const h=new da({fetcher:l}),p=await h.getMapping(),d=new pA({fetcher:l}),g=new ha({fetcher:l}),y=new _a({fetcher:l});return{createNowcastingFlow:()=>new fa({cacheTokenService:y,nowcastingService:g}),createGtgFlow:()=>new fa({cacheTokenService:y,nowcastingService:d}),createObservationsFlow:()=>new ou({fetcher:l}),createOneLayerFlow:()=>new eu({fetcher:l}),createAdsbFlow:()=>new Da({fetcher:l}),mapAircraftIcaoToAircraftType:({icao:t})=>ni({icao:t,mapping:p})}}catch(t){throw new cA(t.message,{error:t})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|