@mappedin/mappedin-js 5.29.3 → 5.29.4
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/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/renderer/GLTFExporter-WBR76LPH.js +1 -0
- package/lib/esm/renderer/{PerformanceController-GBMI5FEK.js → PerformanceController-LO3FX7PQ.js} +1 -1
- package/lib/esm/renderer/{browser-FAMZHU6S.js → browser-JMP5BYCM.js} +1 -1
- package/lib/esm/renderer/chunk-2URYF3VL.js +1 -0
- package/lib/esm/renderer/{chunk-6I3JZBVK.js → chunk-4X2NC5DX.js} +1 -1
- package/lib/esm/renderer/chunk-7N37G36W.js +1 -0
- package/lib/esm/renderer/index.d.ts +12 -2
- package/lib/esm/renderer/index.js +1 -1
- package/lib/esm/renderer/{outdoor-context-LCBNZGDA.js → outdoor-context-X4AP3O4S.js} +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +2 -2
- package/lib/esm/renderer/GLTFExporter-FMMECZUJ.js +0 -1
- package/lib/esm/renderer/chunk-EPUV4SBJ.js +0 -1
- package/lib/esm/renderer/chunk-I5VIUPV4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var C,yA=Object.create,Fc=Object.defineProperty,vA=Object.getOwnPropertyDescriptor,_A=Object.getOwnPropertyNames,bA=Object.getPrototypeOf,xA=Object.prototype.hasOwnProperty,wA=(t,e,n)=>e in t?Fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,l=(t,e)=>Fc(t,"name",{value:e,configurable:!0}),AE=(t,e)=>()=>(t&&(e=t(t=0)),e),fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),EA=(t,e)=>{for(var n in e)Fc(t,n,{get:e[n],enumerable:!0})},MA=(t,e,n,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of _A(e))!xA.call(t,i)&&i!==n&&Fc(t,i,{get:()=>e[i],enumerable:!(r=vA(e,i))||r.enumerable});return t},er=(t,e,n)=>(n=null!=t?yA(bA(t)):{},MA(!e&&t&&t.__esModule?n:Fc(n,"default",{value:t,enumerable:!0}),t)),D=(t,e,n)=>(wA(t,"symbol"!=typeof e?e+"":e,n),n),My=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},B=(t,e,n)=>(My(t,e,"read from private field"),n?n.call(t):e.get(t)),oe=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},le=(t,e,n,r)=>(My(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Iy=(t,e,n,r)=>({set _(r){le(t,e,r,n)},get _(){return B(t,e,r)}}),wr=(t,e,n)=>(My(t,e,"access private method"),n),y=AE((()=>{C={env:{NODE_ENV:"production",npm_package_version:"5.29.3"}}})),LE=fe(((t,e)=>{y(),function(n){var r="object"==typeof t&&t,i="object"==typeof e&&e&&e.exports==r&&e,o="object"==typeof global&&global;(o.global===o||o.window===o)&&(n=o);var s=l((function(t){this.message=t}),"InvalidCharacterError");s.prototype=new Error,s.prototype.name="InvalidCharacterError";var a=l((function(t){throw new s(t)}),"error"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,h=l((function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,o="",s=-1;++s<e;)r=u.indexOf(t.charAt(s)),n=i%4?64*n+r:r,i++%4&&(o+=String.fromCharCode(255&n>>(-2*i&6)));return o}),"decode"),p={encode:l((function(t){t=String(t),/[^\0-\xFF]/.test(t)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,o=t.length%3,s="",l=-1,c=t.length-o;++l<c;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,r=t.charCodeAt(++l),s+=u.charAt((i=e+n+r)>>18&63)+u.charAt(i>>12&63)+u.charAt(i>>6&63)+u.charAt(63&i);return 2==o?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),s+=u.charAt((i=e+n)>>10)+u.charAt(i>>4&63)+u.charAt(i<<2&63)+"="):1==o&&(i=t.charCodeAt(l),s+=u.charAt(i>>2)+u.charAt(i<<4&63)+"=="),s}),"encode"),decode:h,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return p}));else if(r&&!r.nodeType)if(i)i.exports=p;else for(var f in p)p.hasOwnProperty(f)&&(r[f]=p[f]);else n.base64=p}(t)})),Vn=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),jc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t,e){return e.reduce((function(e,n){if(typeof t>"u"||null===t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&typeof n<"u"&&typeof e>"u"?(e=n,n):e}),void 0)}),"getCoordinateKey");t.default=e})),zc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)}),"isDecimal");t.default=e})),qc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){return e.sexagesimalPattern.test(t.toString().trim())}),"isSexagesimal");t.default=n})),Gc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(typeof n>"u"||null===n)throw new Error("Given value is not in sexagesimal format");var r=Number(n[2])/60||0,i=Number(n[4])/3600||0,o=parseFloat(n[1])+r+i;return["S","W"].includes(n[7])?-o:o}),"sexagesimalToDecimal");t.default=n})),jh=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=r(jc());function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}l(r,"_interopRequireDefault"),l(i,"ownKeys"),l(o,"_objectSpread"),l(s,"_defineProperty");var a=l((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:e.longitudeKeys,latitude:e.latitudeKeys,altitude:e.altitudeKeys},i=(0,n.default)(t,r.longitude),s=(0,n.default)(t,r.latitude),a=(0,n.default)(t,r.altitude);return o({latitude:s,longitude:i},a?{altitude:a}:{})}),"getCoordinateKeys");t.default=a})),ky=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(zc()),n=o(qc()),r=o(Gc()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function t(o){return(0,e.default)(o)?!(parseFloat(o)>i.MAXLAT||o<i.MINLAT):!!(0,n.default)(o)&&t((0,r.default)(o))}),"isValidLatitude");t.default=s})),Ny=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(zc()),n=o(qc()),r=o(Gc()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function t(o){return(0,e.default)(o)?!(parseFloat(o)>i.MAXLON||o<i.MINLON):!!(0,n.default)(o)&&t((0,r.default)(o))}),"isValidLongitude");t.default=s})),Ay=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(jh()),n=i(ky()),r=i(Ny());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t){var i=(0,e.default)(t),o=i.latitude,s=i.longitude;if(Array.isArray(t)&&t.length>=2)return(0,r.default)(t[0])&&(0,n.default)(t[1]);if(typeof o>"u"||typeof s>"u")return!1;var a=t[s],l=t[o];return!(typeof l>"u"||typeof a>"u"||!1===(0,n.default)(l)||!1===(0,r.default)(a))}),"isValidCoordinate");t.default=o})),Vh=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(zc()),n=s(qc()),r=s(Gc()),i=s(Ay()),o=s(jh());function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}l(s,"_interopRequireDefault"),l(a,"ownKeys"),l(u,"_objectSpread"),l(c,"_defineProperty");var h=l((function t(s){if((0,e.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var a=(0,o.default)(s);return Array.isArray(s)?s.map((function(e,n){return[0,1].includes(n)?t(e):e})):u(u(u({},s),a.latitude&&c({},a.latitude,t(s[a.latitude]))),a.longitude&&c({},a.longitude,t(s[a.longitude])))}return Array.isArray(s)?s.map((function(e){return(0,i.default)(e)?t(e):e})):s}),"toDecimal");t.default=h})),oo=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=i(jc()),r=i(Vh());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t,i){var o=(0,n.default)(t,e.latitudeKeys);if(!(typeof o>"u"||null===o)){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLatitude");t.default=o})),ao=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=i(jc()),r=i(Vh());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t,i){var o=(0,n.default)(t,e.longitudeKeys);if(!(typeof o>"u"||null===o)){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLongitude");t.default=o})),Zo=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t*Math.PI/180}),"toRad");t.default=e})),Js=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return 180*t/Math.PI}),"toDeg");t.default=e})),XE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(Js()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s,a){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),c=(0,n.default)(t),h=s/l,p=(0,r.default)(a),f=(0,r.default)(u),d=(0,r.default)(c),g=Math.asin(Math.sin(f)*Math.cos(h)+Math.cos(f)*Math.sin(h)*Math.cos(p)),y=d+Math.atan2(Math.sin(p)*Math.sin(h)*Math.cos(f),Math.cos(h)-Math.sin(f)*Math.sin(g)),v=(0,i.default)(y);return(v<o.MINLON||v>o.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:v}}),"computeDestinationPoint");t.default=a})),YE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.areaConversion[n];if(r)return t*r;throw new Error("Invalid unit used for area conversion.")}),"convertArea");t.default=n})),WE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.distanceConversion[n];if(r)return t*r;throw new Error("Invalid unit used for distance conversion.")}),"convertDistance");t.default=n})),HE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}}),"convertSpeed");t.default=n})),JE=fe((t=>{"use strict";function e(t,e){return s(t)||o(t,e)||r(t,e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&null!=a.return&&a.return()}finally{if(i)throw o}}return n}}function s(t){if(Array.isArray(t))return t}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l(e,"_slicedToArray"),l(n,"_nonIterableRest"),l(r,"_unsupportedIterableToArray"),l(i,"_arrayLikeToArray"),l(o,"_iterableToArrayLimit"),l(s,"_arrayWithHoles");var a=l((function(t){var e=Math.pow(10,12);return Math.round(t*e)/e}),"imprecise"),u=l((function(t){var n=e(t.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*+("0."+(i||0))),l=Math.floor(s),u=a(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'}),"decimal2sexagesimal");t.default=u})),By=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t>1?1:t<-1?-1:t}),"robustAcos");t.default=e})),gs=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(By()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;a=typeof a<"u"&&!isNaN(a)?a:1;var l=(0,e.default)(t),u=(0,n.default)(t),c=(0,e.default)(s),h=(0,n.default)(s),p=Math.acos((0,i.default)(Math.sin((0,r.default)(c))*Math.sin((0,r.default)(l))+Math.cos((0,r.default)(c))*Math.cos((0,r.default)(l))*Math.cos((0,r.default)(u)-(0,r.default)(h))))*o.earthRadius;return Math.round(p/a)*a}),"getDistance");t.default=a})),jy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default;return r="function"==typeof r?r:e.default,n.slice().sort((function(e,n){return r(t,e)-r(t,n)}))}),"orderByDistance");t.default=r})),tM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(jy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){return(0,e.default)(t,n)[0]}),"findNearest");t.default=r})),iM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zo()),n=o(oo()),r=o(ao()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t){var o=0;if(t.length>2){for(var s,a,l,u=0;u<t.length;u++){u===t.length-2?(s=t.length-2,a=t.length-1,l=0):u===t.length-1?(s=t.length-1,a=0,l=1):(s=u,a=u+1,l=u+2);var c=(0,r.default)(t[s]),h=(0,n.default)(t[a]),p=(0,r.default)(t[l]);o+=((0,e.default)(p)-(0,e.default)(c))*Math.sin((0,e.default)(h))}o=o*i.earthRadius*i.earthRadius/2}return Math.abs(o)}),"getAreaOfPolygon");t.default=s})),Gy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(oo()),n=r(ao());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,r){var i=(0,e.default)(r),o=(0,n.default)(r);return{maxLat:Math.max(i,t.maxLat),minLat:Math.min(i,t.minLat),maxLng:Math.max(o,t.maxLng),minLng:Math.min(o,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}),"getBounds");t.default=i})),aM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(Js()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s){var a,l,u=(0,e.default)(t),c=(0,n.default)(t),h=(0,r.default)(u),p=(0,r.default)(c),f=s/o.earthRadius,d=h-f,g=h+f,y=(0,r.default)(o.MAXLAT),v=(0,r.default)(o.MINLAT),m=(0,r.default)(o.MAXLON),_=(0,r.default)(o.MINLON);if(d>v&&g<y){var b=Math.asin(Math.sin(f)/Math.cos(h));(a=p-b)<_&&(a+=2*Math.PI),(l=p+b)>m&&(l-=2*Math.PI)}else d=Math.max(d,v),g=Math.min(g,y),a=_,l=m;return[{latitude:(0,i.default)(d),longitude:(0,i.default)(a)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]}),"getBoundsOfDistance");t.default=a})),lM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var o=t.length,s=t.reduce((function(t,i){var o=(0,r.default)((0,e.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:t.X+Math.cos(o)*Math.cos(s),Y:t.Y+Math.cos(o)*Math.sin(s),Z:t.Z+Math.sin(o)}}),{X:0,Y:0,Z:0}),a=s.X/o,l=s.Y/o,u=s.Z/o;return{longitude:(0,i.default)(Math.atan2(l,a)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(a*a+l*l)))}}),"getCenter");t.default=s})),cM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Gy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t){var n=(0,e.default)(t),r=n.minLat+(n.maxLat-n.minLat)/2,i=n.minLng+(n.maxLng-n.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}}),"getCenterOfBounds");t.default=r})),Uy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=(0,r.default)((0,n.default)(o))-(0,r.default)((0,n.default)(t)),a=Math.log(Math.tan((0,r.default)((0,e.default)(o))/2+Math.PI/4)/Math.tan((0,r.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,a))+360)%360}),"getRhumbLineBearing");t.default=s})),dM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Uy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,i="function"==typeof r?r(t,n):(0,e.default)(t,n);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}),"getCompassDirection");t.default=r})),Xy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(gs()),n=r(By());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t,r,i){var o=(0,e.default)(r,t),s=(0,e.default)(t,i),a=(0,e.default)(r,i),l=Math.acos((0,n.default)((o*o+a*a-s*s)/(2*o*a))),u=Math.acos((0,n.default)((s*s+a*a-o*o)/(2*s*a)));return l>Math.PI/2?o:u>Math.PI/2?s:Math.sin(l)*o}),"getDistanceFromLine");t.default=i})),_M=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=(0,e.default)(o),a=(0,n.default)(o),l=(0,e.default)(t),u=(0,n.default)(t);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(a)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(a)-(0,r.default)(u))))+360)%360}),"getGreatCircleBearing");t.default=s})),bM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?l((function(t){return typeof t}),"_typeof"):l((function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}),"_typeof"))(t)}l(n,"_interopRequireDefault"),l(r,"_typeof");var i=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default;return t.reduce((function(t,e){return"object"===r(t)&&null!==t.last&&(t.distance+=n(e,t.last)),t.last=e,t}),{last:null,distance:0}).distance}),"getPathLength");t.default=i})),MM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=typeof s<"u"&&!isNaN(s)?s:1;var a,l,u,c,h,p,f,d=(0,e.default)(t),g=(0,n.default)(t),y=(0,e.default)(o),v=(0,n.default)(o),m=6356752.314245,_=1/298.257223563,b=(0,r.default)(v-g),w=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(d)))),x=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),E=Math.sin(w),I=Math.cos(w),S=Math.sin(x),N=Math.cos(x),M=b,C=100;do{var O=Math.sin(M),P=Math.cos(M);if(0===(p=Math.sqrt(N*O*(N*O)+(I*S-E*N*P)*(I*S-E*N*P))))return 0;a=E*S+I*N*P,l=Math.atan2(p,a),h=a-2*E*S/(c=1-(u=I*N*O/p)*u),isNaN(h)&&(h=0);var A=_/16*c*(4+_*(4-3*c));f=M,M=b+(1-A)*_*u*(l+A*p*(h+A*a*(2*h*h-1)))}while(Math.abs(M-f)>1e-12&&--C>0);if(0===C)return NaN;var D=c*(i.earthRadius*i.earthRadius-m*m)/(m*m),T=1+D/16384*(4096+D*(D*(320-175*D)-768)),L=D/1024*(256+D*(D*(74-47*D)-128)),R=L*p*(h+L/4*(a*(2*h*h-1)-L/6*h*(4*p*p-3)*(4*h*h-3))),F=m*T*(l-R);return Math.round(F/s)*s}),"getDistance");t.default=s})),IM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0}),"getRoughCompassDirection");t.default=e})),PM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,i=r(t,n),o=Number(n.time)-Number(t.time),s=i/o*1e3;return s}),"getSpeed");t.default=r})),SM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r){return(0,e.default)(n,t)+(0,e.default)(t,r)===(0,e.default)(n,r)}),"isPointInLine");t.default=r})),kM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(oo()),n=r(ao());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t,r){for(var i=!1,o=r.length,s=-1,a=o-1;++s<o;a=s)((0,n.default)(r[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[a])||(0,n.default)(r[a])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[s]))&&(0,e.default)(t)<((0,e.default)(r[a])-(0,e.default)(r[s]))*((0,n.default)(t)-(0,n.default)(r[s]))/((0,n.default)(r[a])-(0,n.default)(r[s]))+(0,e.default)(r[s])&&(i=!i);return i}),"isPointInPolygon");t.default=i})),OM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Xy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r,i){return(0,e.default)(t,n,r)<i}),"isPointNearLine");t.default=r})),NM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r){return(0,e.default)(t,n)<r}),"isPointWithinRadius");t.default=r})),AM=fe((t=>{"use strict";function e(t,e){return s(t)||o(t,e)||r(t,e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&null!=a.return&&a.return()}finally{if(i)throw o}}return n}}function s(t){if(Array.isArray(t))return t}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l(e,"_slicedToArray"),l(n,"_nonIterableRest"),l(r,"_unsupportedIterableToArray"),l(i,"_arrayLikeToArray"),l(o,"_iterableToArrayLimit"),l(s,"_arrayWithHoles");var a=l((function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))}),"wktToPolygon");t.default=a})),RM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:l((function(){return n.default}),"get")}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:l((function(){return r.default}),"get")}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:l((function(){return i.default}),"get")}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:l((function(){return o.default}),"get")}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:l((function(){return s.default}),"get")}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:l((function(){return a.default}),"get")}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:l((function(){return u.default}),"get")}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:l((function(){return c.default}),"get")}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:l((function(){return h.default}),"get")}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:l((function(){return p.default}),"get")}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:l((function(){return f.default}),"get")}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:l((function(){return d.default}),"get")}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:l((function(){return g.default}),"get")}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:l((function(){return v.default}),"get")}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:l((function(){return m.default}),"get")}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:l((function(){return _.default}),"get")}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:l((function(){return b.default}),"get")}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:l((function(){return w.default}),"get")}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:l((function(){return x.default}),"get")}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:l((function(){return E.default}),"get")}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:l((function(){return I.default}),"get")}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:l((function(){return S.default}),"get")}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:l((function(){return N.default}),"get")}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:l((function(){return M.default}),"get")}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:l((function(){return C.default}),"get")}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:l((function(){return O.default}),"get")}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:l((function(){return P.default}),"get")}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:l((function(){return A.default}),"get")}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:l((function(){return D.default}),"get")}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:l((function(){return T.default}),"get")}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:l((function(){return L.default}),"get")}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:l((function(){return R.default}),"get")}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:l((function(){return F.default}),"get")}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:l((function(){return k.default}),"get")}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:l((function(){return B.default}),"get")}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:l((function(){return j.default}),"get")}),Object.defineProperty(t,"toRad",{enumerable:!0,get:l((function(){return G.default}),"get")}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:l((function(){return z.default}),"get")}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:l((function(){return U.default}),"get")});var n=V(XE()),r=V(YE()),i=V(WE()),o=V(HE()),s=V(JE()),a=V(tM()),u=V(iM()),c=V(Gy()),h=V(aM()),p=V(lM()),f=V(cM()),d=V(dM()),g=V(jc()),v=V(jh()),m=V(gs()),_=V(Xy()),b=V(_M()),w=V(oo()),x=V(ao()),E=V(bM()),I=V(MM()),S=V(Uy()),N=V(IM()),M=V(PM()),C=V(zc()),O=V(SM()),P=V(kM()),A=V(OM()),D=V(NM()),T=V(qc()),L=V(Ay()),R=V(ky()),F=V(Ny()),k=V(jy()),B=V(Gc()),j=V(Vh()),G=V(Zo()),z=V(Js()),U=V(AM()),q=Vn();function V(t){return t&&t.__esModule?t:{default:t}}Object.keys(q).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:l((function(){return q[n]}),"get")})})),l(V,"_interopRequireDefault")})),Ov=fe(((t,e)=>{y(),function(n,r){"use strict";var i="function",o="undefined",s="object",a="string",u="model",c="name",h="type",p="vendor",f="version",d="architecture",g="console",y="mobile",v="tablet",m="smarttv",_="wearable",b="embedded",w="Amazon",x="Apple",E="ASUS",I="BlackBerry",S="Browser",N="Chrome",M="Firefox",C="Google",O="Huawei",P="LG",A="Microsoft",D="Motorola",T="Opera",L="Samsung",R="Sony",F="Xiaomi",k="Zebra",B="Facebook",j=l((function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}),"extend"),G=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),z=l((function(t,e){return typeof t===a&&-1!==U(e).indexOf(U(t))}),"has"),U=l((function(t){return t.toLowerCase()}),"lowerize"),q=l((function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:r}),"majorize"),V=l((function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===o?t:t.substring(0,275)}),"trim"),Y=l((function(t,e){for(var n,o,a,l,u,c,h=0;h<e.length&&!u;){var p=e[h],f=e[h+1];for(n=o=0;n<p.length&&!u;)if(u=p[n++].exec(t))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;h+=2}}),"rgxMapper"),X=l((function(t,e){for(var n in e)if(typeof e[n]===s&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(z(e[n][i],t))return"?"===n?r:n}else if(z(e[n],t))return"?"===n?r:n;return t}),"strMapper"),W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+S]],[/\bqbcore\/([\w\.]+)/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[c,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[c,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,B],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,N+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,N+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,U]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",U]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,U]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,L],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,L],[h,y]],[/((ipod|iphone)\d+,\d+)/i],[u,[p,x],[h,y]],[/(ipad\d+,\d+)/i],[u,[p,x],[h,v]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[p,x],[h,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,x],[h,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,O],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,O],[h,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,F],[h,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,F],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[h,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[h,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[h,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,D],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,D],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,P],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,P],[h,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[h,y]],[/(pixel c)\b/i],[u,[p,C],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,C],[h,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,R],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,R],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,w],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,w],[h,y]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[h,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[h,y]],[/(nexus 9)/i],[u,[p,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[h,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[h,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,"Sharp"],[h,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[h,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[h,v]],[/(surface duo)/i],[u,[p,A],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[h,y]],[/(u304aa)/i],[u,[p,"AT&T"],[h,y]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[h,y]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[h,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[h,y]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[h,y]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[h,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[h,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[h,y]],[/\b(ph-1) /i],[u,[p,"Essential"],[h,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[p,u,[h,y]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,A],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,k],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,k],[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[h,g]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[p,R],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,A],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,L],[h,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,P],[h,m]],[/(apple) ?tv/i],[p,[u,x+" TV"],[h,m]],[/crkey/i],[[u,N+"cast"],[p,C],[h,m]],[/droid.+aft(\w)( bui|\))/i],[u,[p,w],[h,m]],[/\(dtv[\);].+(aquos)/i],[u,[p,"Sharp"],[h,m]],[/(bravia[\w- ]+) bui/i],[u,[p,R],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,V],[u,V],[h,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,m]],[/((pebble))app/i],[p,u,[h,_]],[/droid.+; (glass) \d/i],[u,[p,C],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,k],[h,_]],[/(quest( 2)?)/i],[u,[p,B],[h,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[h,y]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,X,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,X,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,N+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},H=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof H))return new H(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?j(J,e):J;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.browser),t.major=q(t.version),t},this.getCPU=function(){var t={};return t[d]=r,Y.call(t,i,l.cpu),t},this.getDevice=function(){var t={};return t[p]=r,t[u]=r,t[h]=r,Y.call(t,i,l.device),t},this.getEngine=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.engine),t},this.getOS=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=typeof t===a&&t.length>275?V(t,275):t,this},this.setUA(i),this}),"UAParser");H.VERSION="0.7.31",H.BROWSER=G([c,f,"major"]),H.CPU=G([d]),H.DEVICE=G([u,p,h,g,y,m,v,_,b]),H.ENGINE=H.OS=G([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=H),t.UAParser=H):typeof define===i&&define.amd?define((function(){return H})):typeof n!==o&&(n.UAParser=H);var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var K=new H;Z.ua=K.getResult(),Z.ua.get=function(){return K.getUA()},Z.ua.set=function(t){K.setUA(t);var e=K.getResult();for(var n in e)Z.ua[n]=e[n]}}}("object"==typeof window?window:t)})),hP=fe(((t,e)=>{y();var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",c="[object Function]",h="[object Map]",p="[object Number]",f="[object Object]",d="[object Promise]",g="[object RegExp]",v="[object Set]",m="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",x=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[i]=I[o]=I[b]=I[s]=I[w]=I[a]=I[u]=I[c]=I[h]=I[p]=I[f]=I[g]=I[v]=I[m]=I[_]=!1;var S="object"==typeof global&&global&&global.Object===Object&&global,N="object"==typeof self&&self&&self.Object===Object&&self,M=S||N||Function("return this")(),C="object"==typeof t&&t&&!t.nodeType&&t,O=C&&"object"==typeof e&&e&&!e.nodeType&&e,P=O&&O.exports===C,A=P&&S.process,D=function(){try{return A&&A.binding&&A.binding("util")}catch{}}(),T=D&&D.isTypedArray;function L(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function R(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function F(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function k(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function B(t){return function(e){return t(e)}}function j(t,e){return t.has(e)}function G(t,e){return null==t?void 0:t[e]}function z(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function U(t,e){return function(n){return t(e(n))}}function q(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}l(L,"arrayFilter"),l(R,"arrayPush"),l(F,"arraySome"),l(k,"baseTimes"),l(B,"baseUnary"),l(j,"cacheHas"),l(G,"getValue"),l(z,"mapToArray"),l(U,"overArg"),l(q,"setToArray");var V,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=M["__core-js_shared__"],H=X.toString,Z=W.hasOwnProperty,K=(V=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",$=W.toString,Q=RegExp("^"+H.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=P?M.Buffer:void 0,et=M.Symbol,nt=M.Uint8Array,rt=W.propertyIsEnumerable,it=Y.splice,ot=et?et.toStringTag:void 0,st=Object.getOwnPropertySymbols,at=tt?tt.isBuffer:void 0,lt=U(Object.keys,Object),ut=ce(M,"DataView"),ct=ce(M,"Map"),ht=ce(M,"Promise"),pt=ce(M,"Set"),ft=ce(M,"WeakMap"),dt=ce(Object,"create"),gt=_e(ut),yt=_e(ct),vt=_e(ht),mt=_e(pt),_t=_e(ft),bt=et?et.prototype:void 0,wt=bt?bt.valueOf:void 0;function xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Et(){this.__data__=dt?dt(null):{},this.size=0}function It(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function St(t){var e=this.__data__;if(dt){var r=e[t];return r===n?void 0:r}return Z.call(e,t)?e[t]:void 0}function Nt(t){var e=this.__data__;return dt?void 0!==e[t]:Z.call(e,t)}function Mt(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dt&&void 0===e?n:e,this}function Ct(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(){this.__data__=[],this.size=0}function Pt(t){var e=this.__data__,n=Zt(e,t);return!(n<0)&&(n==e.length-1?e.pop():it.call(e,n,1),--this.size,!0)}function At(t){var e=this.__data__,n=Zt(e,t);return n<0?void 0:e[n][1]}function Dt(t){return Zt(this.__data__,t)>-1}function Tt(t,e){var n=this.__data__,r=Zt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Rt(){this.size=0,this.__data__={hash:new xt,map:new(ct||Ct),string:new xt}}function Ft(t){var e=ue(this,t).delete(t);return this.size-=e?1:0,e}function kt(t){return ue(this,t).get(t)}function Bt(t){return ue(this,t).has(t)}function jt(t,e){var n=ue(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Gt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Lt;++e<n;)this.add(t[e])}function zt(t){return this.__data__.set(t,n),this}function Ut(t){return this.__data__.has(t)}function qt(t){var e=this.__data__=new Ct(t);this.size=e.size}function Vt(){this.__data__=new Ct,this.size=0}function Yt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Xt(t){return this.__data__.get(t)}function Wt(t){return this.__data__.has(t)}function Jt(t,e){var n=this.__data__;if(n instanceof Ct){var r=n.__data__;if(!ct||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Lt(r)}return n.set(t,e),this.size=n.size,this}function Ht(t,e){var n=xe(t),r=!n&&we(t),i=!n&&!r&&Ie(t),o=!n&&!r&&!i&&Pe(t),s=n||r||i||o,a=s?k(t.length,String):[],l=a.length;for(var u in t)(e||Z.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||de(u,l)))&&a.push(u);return a}function Zt(t,e){for(var n=t.length;n--;)if(be(t[n][0],e))return n;return-1}function Kt(t,e,n){var r=e(t);return xe(t)?r:R(r,n(t))}function $t(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ot&&ot in Object(t)?he(t):me(t)}function Qt(t){return Oe(t)&&$t(t)==i}function te(t,e,n,r,i){return t===e||(null==t||null==e||!Oe(t)&&!Oe(e)?t!=t&&e!=e:ee(t,e,n,r,te,i))}function ee(t,e,n,r,s,a){var l=xe(t),u=xe(e),c=l?o:fe(t),h=u?o:fe(e),p=(c=c==i?f:c)==f,d=(h=h==i?f:h)==f,g=c==h;if(g&&Ie(t)){if(!Ie(e))return!1;l=!0,p=!1}if(g&&!p)return a||(a=new qt),l||Pe(t)?oe(t,e,n,r,s,a):se(t,e,c,n,r,s,a);if(!(1&n)){var y=p&&Z.call(t,"__wrapped__"),v=d&&Z.call(e,"__wrapped__");if(y||v){var m=y?t.value():t,_=v?e.value():e;return a||(a=new qt),s(m,_,n,r,a)}}return!!g&&(a||(a=new qt),ae(t,e,n,r,s,a))}function ne(t){return!(!Ce(t)||ye(t))&&(Ne(t)?Q:x).test(_e(t))}function re(t){return Oe(t)&&Me(t.length)&&!!I[$t(t)]}function ie(t){if(!ve(t))return lt(t);var e=[];for(var n in Object(t))Z.call(t,n)&&"constructor"!=n&&e.push(n);return e}function oe(t,e,n,r,i,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var c=-1,h=!0,p=2&n?new Gt:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var f=t[c],d=e[c];if(r)var g=s?r(d,f,c,e,t,o):r(f,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!F(e,(function(t,e){if(!j(p,e)&&(f===t||i(f,t,n,r,o)))return p.push(e)}))){h=!1;break}}else if(f!==d&&!i(f,d,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function se(t,e,n,r,i,o,l){switch(n){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case s:case a:case p:return be(+t,+e);case u:return t.name==e.name&&t.message==e.message;case g:case m:return t==e+"";case h:var c=z;case v:var f=1&r;if(c||(c=q),t.size!=e.size&&!f)return!1;var d=l.get(t);if(d)return d==e;r|=2,l.set(t,e);var y=oe(c(t),c(e),r,i,o,l);return l.delete(t),y;case"[object Symbol]":if(wt)return wt.call(t)==wt.call(e)}return!1}function ae(t,e,n,r,i,o){var s=1&n,a=le(t),l=a.length;if(l!=le(e).length&&!s)return!1;for(var u=l;u--;){var c=a[u];if(!(s?c in e:Z.call(e,c)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var p=!0;o.set(t,e),o.set(e,t);for(var f=s;++u<l;){var d=t[c=a[u]],g=e[c];if(r)var y=s?r(g,d,c,e,t,o):r(d,g,c,t,e,o);if(!(void 0===y?d===g||i(d,g,n,r,o):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var v=t.constructor,m=e.constructor;v!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof v&&v instanceof v&&"function"==typeof m&&m instanceof m)&&(p=!1)}return o.delete(t),o.delete(e),p}function le(t){return Kt(t,Ae,pe)}function ue(t,e){var n=t.__data__;return ge(e)?n["string"==typeof e?"string":"hash"]:n.map}function ce(t,e){var n=G(t,e);return ne(n)?n:void 0}function he(t){var e=Z.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch{}var i=$.call(t);return r&&(e?t[ot]=n:delete t[ot]),i}l(xt,"Hash"),l(Et,"hashClear"),l(It,"hashDelete"),l(St,"hashGet"),l(Nt,"hashHas"),l(Mt,"hashSet"),xt.prototype.clear=Et,xt.prototype.delete=It,xt.prototype.get=St,xt.prototype.has=Nt,xt.prototype.set=Mt,l(Ct,"ListCache"),l(Ot,"listCacheClear"),l(Pt,"listCacheDelete"),l(At,"listCacheGet"),l(Dt,"listCacheHas"),l(Tt,"listCacheSet"),Ct.prototype.clear=Ot,Ct.prototype.delete=Pt,Ct.prototype.get=At,Ct.prototype.has=Dt,Ct.prototype.set=Tt,l(Lt,"MapCache"),l(Rt,"mapCacheClear"),l(Ft,"mapCacheDelete"),l(kt,"mapCacheGet"),l(Bt,"mapCacheHas"),l(jt,"mapCacheSet"),Lt.prototype.clear=Rt,Lt.prototype.delete=Ft,Lt.prototype.get=kt,Lt.prototype.has=Bt,Lt.prototype.set=jt,l(Gt,"SetCache"),l(zt,"setCacheAdd"),l(Ut,"setCacheHas"),Gt.prototype.add=Gt.prototype.push=zt,Gt.prototype.has=Ut,l(qt,"Stack"),l(Vt,"stackClear"),l(Yt,"stackDelete"),l(Xt,"stackGet"),l(Wt,"stackHas"),l(Jt,"stackSet"),qt.prototype.clear=Vt,qt.prototype.delete=Yt,qt.prototype.get=Xt,qt.prototype.has=Wt,qt.prototype.set=Jt,l(Ht,"arrayLikeKeys"),l(Zt,"assocIndexOf"),l(Kt,"baseGetAllKeys"),l($t,"baseGetTag"),l(Qt,"baseIsArguments"),l(te,"baseIsEqual"),l(ee,"baseIsEqualDeep"),l(ne,"baseIsNative"),l(re,"baseIsTypedArray"),l(ie,"baseKeys"),l(oe,"equalArrays"),l(se,"equalByTag"),l(ae,"equalObjects"),l(le,"getAllKeys"),l(ue,"getMapData"),l(ce,"getNative"),l(he,"getRawTag");var pe=st?function(t){return null==t?[]:(t=Object(t),L(st(t),(function(e){return rt.call(t,e)})))}:De,fe=$t;function de(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&t<e}function ge(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function ye(t){return!!K&&K in t}function ve(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function me(t){return $.call(t)}function _e(t){if(null!=t){try{return H.call(t)}catch{}try{return t+""}catch{}}return""}function be(t,e){return t===e||t!=t&&e!=e}(ut&&fe(new ut(new ArrayBuffer(1)))!=w||ct&&fe(new ct)!=h||ht&&fe(ht.resolve())!=d||pt&&fe(new pt)!=v||ft&&fe(new ft)!=_)&&(fe=l((function(t){var e=$t(t),n=e==f?t.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case gt:return w;case yt:return h;case vt:return d;case mt:return v;case _t:return _}return e}),"getTag")),l(de,"isIndex"),l(ge,"isKeyable"),l(ye,"isMasked"),l(ve,"isPrototype"),l(me,"objectToString"),l(_e,"toSource"),l(be,"eq");var we=Qt(function(){return arguments}())?Qt:function(t){return Oe(t)&&Z.call(t,"callee")&&!rt.call(t,"callee")},xe=Array.isArray;function Ee(t){return null!=t&&Me(t.length)&&!Ne(t)}l(Ee,"isArrayLike");var Ie=at||Te;function Se(t,e){return te(t,e)}function Ne(t){if(!Ce(t))return!1;var e=$t(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Me(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Ce(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Oe(t){return null!=t&&"object"==typeof t}l(Se,"isEqual"),l(Ne,"isFunction"),l(Me,"isLength"),l(Ce,"isObject"),l(Oe,"isObjectLike");var Pe=T?B(T):re;function Ae(t){return Ee(t)?Ht(t):ie(t)}function De(){return[]}function Te(){return!1}l(Ae,"keys"),l(De,"stubArray"),l(Te,"stubFalse"),e.exports=Se})),GP=fe(((t,e)=>{y();var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c[i]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c[o]=c["[object Map]"]=c["[object Number]"]=c[s]=c["[object RegExp]"]=c["[object Set]"]=c["[object String]"]=c["[object WeakMap]"]=!1;var h="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,f=h||p||Function("return this")(),d="object"==typeof t&&t&&!t.nodeType&&t,g=d&&"object"==typeof e&&e&&!e.nodeType&&e,v=g&&g.exports===d,m=v&&h.process,_=function(){try{return g&&g.require&&g.require("util").types||m&&m.binding&&m.binding("util")}catch{}}(),b=_&&_.isTypedArray;function w(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function x(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function E(t){return function(e){return t(e)}}function I(t,e){return null==t?void 0:t[e]}function S(t,e){return function(n){return t(e(n))}}l(w,"apply"),l(x,"baseTimes"),l(E,"baseUnary"),l(I,"getValue"),l(S,"overArg");var N,M=Array.prototype,C=Function.prototype,O=Object.prototype,P=f["__core-js_shared__"],A=C.toString,D=O.hasOwnProperty,T=(N=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",L=O.toString,R=A.call(Object),F=RegExp("^"+A.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=v?f.Buffer:void 0,B=f.Symbol,j=f.Uint8Array,G=k?k.allocUnsafe:void 0,z=S(Object.getPrototypeOf,Object),U=Object.create,q=O.propertyIsEnumerable,V=M.splice,Y=B?B.toStringTag:void 0,X=function(){try{var t=Xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),W=k?k.isBuffer:void 0,J=Math.max,H=Date.now,Z=Xt(f,"Map"),K=Xt(Object,"create"),$=function(){function t(){}return l(t,"object"),function(e){if(!ge(e))return{};if(U)return U(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function tt(){this.__data__=K?K(null):{},this.size=0}function et(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function nt(t){var e=this.__data__;if(K){var r=e[t];return r===n?void 0:r}return D.call(e,t)?e[t]:void 0}function rt(t){var e=this.__data__;return K?void 0!==e[t]:D.call(e,t)}function it(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=K&&void 0===e?n:e,this}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function st(){this.__data__=[],this.size=0}function at(t){var e=this.__data__,n=Nt(e,t);return!(n<0)&&(n==e.length-1?e.pop():V.call(e,n,1),--this.size,!0)}function lt(t){var e=this.__data__,n=Nt(e,t);return n<0?void 0:e[n][1]}function ut(t){return Nt(this.__data__,t)>-1}function ct(t,e){var n=this.__data__,r=Nt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ht(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function pt(){this.size=0,this.__data__={hash:new Q,map:new(Z||ot),string:new Q}}function ft(t){var e=Yt(this,t).delete(t);return this.size-=e?1:0,e}function dt(t){return Yt(this,t).get(t)}function gt(t){return Yt(this,t).has(t)}function yt(t,e){var n=Yt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function vt(t){var e=this.__data__=new ot(t);this.size=e.size}function mt(){this.__data__=new ot,this.size=0}function _t(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function bt(t){return this.__data__.get(t)}function wt(t){return this.__data__.has(t)}function xt(t,e){var n=this.__data__;if(n instanceof ot){var r=n.__data__;if(!Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ht(r)}return n.set(t,e),this.size=n.size,this}function Et(t,e){var n=ue(t),r=!n&&le(t),i=!n&&!r&&pe(t),o=!n&&!r&&!i&&me(t),s=n||r||i||o,a=s?x(t.length,String):[],l=a.length;for(var u in t)(e||D.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ht(u,l)))&&a.push(u);return a}function It(t,e,n){(void 0!==n&&!ae(t[e],n)||void 0===n&&!(e in t))&&Mt(t,e,n)}function St(t,e,n){var r=t[e];(!D.call(t,e)||!ae(r,n)||void 0===n&&!(e in t))&&Mt(t,e,n)}function Nt(t,e){for(var n=t.length;n--;)if(ae(t[n][0],e))return n;return-1}function Mt(t,e,n){"__proto__"==e&&X?X(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}l(Q,"Hash"),l(tt,"hashClear"),l(et,"hashDelete"),l(nt,"hashGet"),l(rt,"hashHas"),l(it,"hashSet"),Q.prototype.clear=tt,Q.prototype.delete=et,Q.prototype.get=nt,Q.prototype.has=rt,Q.prototype.set=it,l(ot,"ListCache"),l(st,"listCacheClear"),l(at,"listCacheDelete"),l(lt,"listCacheGet"),l(ut,"listCacheHas"),l(ct,"listCacheSet"),ot.prototype.clear=st,ot.prototype.delete=at,ot.prototype.get=lt,ot.prototype.has=ut,ot.prototype.set=ct,l(ht,"MapCache"),l(pt,"mapCacheClear"),l(ft,"mapCacheDelete"),l(dt,"mapCacheGet"),l(gt,"mapCacheHas"),l(yt,"mapCacheSet"),ht.prototype.clear=pt,ht.prototype.delete=ft,ht.prototype.get=dt,ht.prototype.has=gt,ht.prototype.set=yt,l(vt,"Stack"),l(mt,"stackClear"),l(_t,"stackDelete"),l(bt,"stackGet"),l(wt,"stackHas"),l(xt,"stackSet"),vt.prototype.clear=mt,vt.prototype.delete=_t,vt.prototype.get=bt,vt.prototype.has=wt,vt.prototype.set=xt,l(Et,"arrayLikeKeys"),l(It,"assignMergeValue"),l(St,"assignValue"),l(Nt,"assocIndexOf"),l(Mt,"baseAssignValue");var Ct=Vt();function Ot(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Y&&Y in Object(t)?Wt(t):ee(t)}function Pt(t){return ye(t)&&Ot(t)==i}function At(t){return!(!ge(t)||$t(t))&&(fe(t)?F:a).test(se(t))}function Dt(t){return ye(t)&&de(t.length)&&!!c[Ot(t)]}function Tt(t){if(!ge(t))return te(t);var e=Qt(t),n=[];for(var r in t)"constructor"==r&&(e||!D.call(t,r))||n.push(r);return n}function Lt(t,e,n,r,i){t!==e&&Ct(e,(function(o,s){if(i||(i=new vt),ge(o))Rt(t,e,s,n,Lt,r,i);else{var a=r?r(re(t,s),o,s+"",t,e,i):void 0;void 0===a&&(a=o),It(t,s,a)}}),be)}function Rt(t,e,n,r,i,o,s){var a=re(t,n),l=re(e,n),u=s.get(l);if(u)It(t,n,u);else{var c=o?o(a,l,n+"",t,e,s):void 0,h=void 0===c;if(h){var p=ue(l),f=!p&&pe(l),d=!p&&!f&&me(l);c=l,p||f||d?ue(a)?c=a:he(a)?c=zt(a):f?(h=!1,c=Bt(l,!0)):d?(h=!1,c=Gt(l,!0)):c=[]:ve(l)||le(l)?(c=a,le(a)?c=_e(a):(!ge(a)||fe(a))&&(c=Jt(l))):h=!1}h&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),It(t,n,c)}}function Ft(t,e){return ie(ne(t,e,Ee),t+"")}l(Ot,"baseGetTag"),l(Pt,"baseIsArguments"),l(At,"baseIsNative"),l(Dt,"baseIsTypedArray"),l(Tt,"baseKeysIn"),l(Lt,"baseMerge"),l(Rt,"baseMergeDeep"),l(Ft,"baseRest");var kt=X?function(t,e){return X(t,"toString",{configurable:!0,enumerable:!1,value:xe(e),writable:!0})}:Ee;function Bt(t,e){if(e)return t.slice();var n=t.length,r=G?G(n):new t.constructor(n);return t.copy(r),r}function jt(t){var e=new t.constructor(t.byteLength);return new j(e).set(new j(t)),e}function Gt(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function zt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ut(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=r?r(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?Mt(n,a,l):St(n,a,l)}return n}function qt(t){return Ft((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&Zt(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e}))}function Vt(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function Yt(t,e){var n=t.__data__;return Kt(e)?n["string"==typeof e?"string":"hash"]:n.map}function Xt(t,e){var n=I(t,e);return At(n)?n:void 0}function Wt(t){var e=D.call(t,Y),n=t[Y];try{t[Y]=void 0;var r=!0}catch{}var i=L.call(t);return r&&(e?t[Y]=n:delete t[Y]),i}function Jt(t){return"function"!=typeof t.constructor||Qt(t)?{}:$(z(t))}function Ht(t,e){var n=typeof t;return!!(e=null==e?r:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function Zt(t,e,n){if(!ge(n))return!1;var r=typeof e;return!!("number"==r?ce(n)&&Ht(e,n.length):"string"==r&&e in n)&&ae(n[e],t)}function Kt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function $t(t){return!!T&&T in t}function Qt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||O)}function te(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}function ee(t){return L.call(t)}function ne(t,e,n){return e=J(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=J(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),w(t,this,a)}}function re(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}l(Bt,"cloneBuffer"),l(jt,"cloneArrayBuffer"),l(Gt,"cloneTypedArray"),l(zt,"copyArray"),l(Ut,"copyObject"),l(qt,"createAssigner"),l(Vt,"createBaseFor"),l(Yt,"getMapData"),l(Xt,"getNative"),l(Wt,"getRawTag"),l(Jt,"initCloneObject"),l(Ht,"isIndex"),l(Zt,"isIterateeCall"),l(Kt,"isKeyable"),l($t,"isMasked"),l(Qt,"isPrototype"),l(te,"nativeKeysIn"),l(ee,"objectToString"),l(ne,"overRest"),l(re,"safeGet");var ie=oe(kt);function oe(t){var e=0,n=0;return function(){var r=H(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function se(t){if(null!=t){try{return A.call(t)}catch{}try{return t+""}catch{}}return""}function ae(t,e){return t===e||t!=t&&e!=e}l(oe,"shortOut"),l(se,"toSource"),l(ae,"eq");var le=Pt(function(){return arguments}())?Pt:function(t){return ye(t)&&D.call(t,"callee")&&!q.call(t,"callee")},ue=Array.isArray;function ce(t){return null!=t&&de(t.length)&&!fe(t)}function he(t){return ye(t)&&ce(t)}l(ce,"isArrayLike"),l(he,"isArrayLikeObject");var pe=W||Ie;function fe(t){if(!ge(t))return!1;var e=Ot(t);return e==o||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function de(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function ge(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ye(t){return null!=t&&"object"==typeof t}function ve(t){if(!ye(t)||Ot(t)!=s)return!1;var e=z(t);if(null===e)return!0;var n=D.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&A.call(n)==R}l(fe,"isFunction"),l(de,"isLength"),l(ge,"isObject"),l(ye,"isObjectLike"),l(ve,"isPlainObject");var me=b?E(b):Dt;function _e(t){return Ut(t,be(t))}function be(t){return ce(t)?Et(t,!0):Tt(t)}l(_e,"toPlainObject"),l(be,"keysIn");var we=qt((function(t,e,n){Lt(t,e,n)}));function xe(t){return function(){return t}}function Ee(t){return t}function Ie(){return!1}l(xe,"constant"),l(Ee,"identity"),l(Ie,"stubFalse"),e.exports=we})),UP=fe(((t,e)=>{y(),function(n,r){"use strict";var i="function",o="undefined",s="object",a="string",u="model",c="name",h="type",p="vendor",f="version",d="architecture",g="console",y="mobile",v="tablet",m="smarttv",_="wearable",b="embedded",w="Amazon",x="Apple",E="ASUS",I="BlackBerry",S="Browser",N="Chrome",M="Firefox",C="Google",O="Huawei",P="LG",A="Microsoft",D="Motorola",T="Opera",L="Samsung",R="Sharp",F="Sony",k="Xiaomi",B="Zebra",j="Facebook",G=l((function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}),"extend"),z=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),U=l((function(t,e){return typeof t===a&&-1!==q(e).indexOf(q(t))}),"has"),q=l((function(t){return t.toLowerCase()}),"lowerize"),V=l((function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:r}),"majorize"),Y=l((function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,""),typeof e===o?t:t.substring(0,350)}),"trim"),X=l((function(t,e){for(var n,o,a,l,u,c,h=0;h<e.length&&!u;){var p=e[h],f=e[h+1];for(n=o=0;n<p.length&&!u;)if(u=p[n++].exec(t))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;h+=2}}),"rgxMapper"),W=l((function(t,e){for(var n in e)if(typeof e[n]===s&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(U(e[n][i],t))return"?"===n?r:n}else if(U(e[n],t))return"?"===n?r:n;return t}),"strMapper"),J={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[c,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[c,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,j],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,N+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,N+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,q]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,L],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,L],[h,y]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[p,x],[h,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,x],[h,v]],[/(macintosh);/i],[u,[p,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,O],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,O],[h,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,k],[h,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,k],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[h,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[h,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[h,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,D],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,D],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,P],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,P],[h,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[h,y]],[/(pixel c)\b/i],[u,[p,C],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,C],[h,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,F],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,F],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,w],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,w],[h,y]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[h,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[h,y]],[/(nexus 9)/i],[u,[p,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[h,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[h,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,R],[h,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[h,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[h,v]],[/(surface duo)/i],[u,[p,A],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[h,y]],[/(u304aa)/i],[u,[p,"AT&T"],[h,y]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[h,y]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[h,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[h,y]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[h,y]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[h,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[h,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[h,y]],[/\b(ph-1) /i],[u,[p,"Essential"],[h,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[p,u,[h,y]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,A],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[h,g]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[p,F],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,A],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,L],[h,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,P],[h,m]],[/(apple) ?tv/i],[p,[u,x+" TV"],[h,m]],[/crkey/i],[[u,N+"cast"],[p,C],[h,m]],[/droid.+aft(\w)( bui|\))/i],[u,[p,w],[h,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,R],[h,m]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,F],[h,m]],[/(mitv-\w{5}) bui/i],[u,[p,k],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,Y],[u,Y],[h,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,m]],[/((pebble))app/i],[p,u,[h,_]],[/droid.+; (glass) \d/i],[u,[p,C],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[h,_]],[/(quest( 2)?)/i],[u,[p,j],[h,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,y]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,W,J]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,W,J]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,N+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},Z=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof Z))return new Z(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?G(H,e):H;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.browser),t.major=V(t.version),t},this.getCPU=function(){var t={};return t[d]=r,X.call(t,i,l.cpu),t},this.getDevice=function(){var t={};return t[p]=r,t[u]=r,t[h]=r,X.call(t,i,l.device),t},this.getEngine=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.engine),t},this.getOS=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=typeof t===a&&t.length>350?Y(t,350):t,this},this.setUA(i),this}),"UAParser");Z.VERSION="0.7.33",Z.BROWSER=z([c,f,"major"]),Z.CPU=z([d]),Z.DEVICE=z([u,p,h,g,y,m,v,_,b]),Z.ENGINE=Z.OS=z([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=Z),t.UAParser=Z):typeof define===i&&define.amd?define((function(){return Z})):typeof n!==o&&(n.UAParser=Z);var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var $=new Z;K.ua=$.getResult(),K.ua.get=function(){return $.getUA()},K.ua.set=function(t){$.setUA(t);var e=$.getResult();for(var n in e)K.ua[n]=e[n]}}}("object"==typeof window?window:t)})),Sg=fe(((t,e)=>{"use strict";y();var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch{return!1}}l(o,"toObject"),l(s,"shouldUseNative"),e.exports=s()?Object.assign:function(t,e){for(var s,a,l=o(t),u=1;u<arguments.length;u++){for(var c in s=Object(arguments[u]))r.call(s,c)&&(l[c]=s[c]);if(n){a=n(s);for(var h=0;h<a.length;h++)i.call(s,a[h])&&(l[a[h]]=s[a[h]])}}return l}})),vS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,r,i,o,s){l((function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=n[r],f=i,d=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}),"t")(t,r,i||0,o||t.length-1,s||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}l(t,"t"),l(e,"i"),l(n,"n");var r=l((function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}),"r");function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return l(i,"e"),l(o,"a"),l(s,"h"),l(a,"o"),l(u,"s"),l(c,"l"),l(h,"f"),l(p,"u"),l(f,"m"),l(d,"c"),l(g,"p"),l(y,"d"),r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!d(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;d(t,a)&&(e.leaf?n.push(s):f(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(d(t,o)){if(e.leaf||f(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=u.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!f(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));y(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);y(t,c,h,l,this.compareMinY);for(var p=c;p<=h;p+=l){var f=Math.min(p+l-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,i=u<i?u:i,s=l):c===o&&u<i&&(i=u,s=l)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),y=s(t,d,n,this.toBBox),v=(i=g,o=y,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),m=h(g)+h(y);v<p?(p=v,r=d,f=m<f?m:f):v===p&&m<f&&(f=m,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),l=s(t,n-e,n,i),u=p(o)+p(l),c=e;c<n-e;c++){var h=t.children[c];a(o,t.leaf?i(h):h),u+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?i(d):d),u+=p(l)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),_S=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";var t=l((function(t,n){if(void 0===t&&(t=[]),void 0===n&&(n=e),this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}),"TinyQueue");function e(t,e){return t<e?-1:t>e?1:0}return t.prototype.push=l((function(t){this.data.push(t),this.length++,this._up(this.length-1)}),"push"),t.prototype.pop=l((function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}),"pop"),t.prototype.peek=l((function(){return this.data[0]}),"peek"),t.prototype._up=l((function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}),"_up"),t.prototype._down=l((function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}),"_down"),l(e,"defaultCompare"),t},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).TinyQueue=r()})),xS=fe(((t,e)=>{y(),e.exports=l((function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var c=e[n+2*l+0],h=e[n+2*l+1],p=e[n+2*u+0],f=e[n+2*u+1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(s=!s)}return s}),"pointInPolygonFlat")})),ES=fe(((t,e)=>{y(),e.exports=l((function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var c=e[l+n][0],h=e[l+n][1],p=e[u+n][0],f=e[u+n][1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(s=!s)}return s}),"pointInPolygonNested")})),PS=fe(((t,e)=>{y();var n=xS(),r=ES();e.exports=l((function(t,e,i,o){return e.length>0&&Array.isArray(e[0])?r(t,e,i,o):n(t,e,i,o)}),"pointInPolygon"),e.exports.nested=r,e.exports.flat=n})),CS=fe(((t,e)=>{var n,r;y(),n=t,r=function(t){"use strict";function e(t,e,n,r,i){let o,s,a,l,u=e[0],c=r[0],h=0,p=0;c>u==c>-u?(o=u,u=e[++h]):(o=c,c=r[++p]);let f=0;if(h<t&&p<n)for(c>u==c>-u?(a=o-((s=u+o)-u),u=e[++h]):(a=o-((s=c+o)-c),c=r[++p]),o=s,0!==a&&(i[f++]=a);h<t&&p<n;)c>u==c>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++h]):(a=o-((s=o+c)-(l=s-o))+(c-l),c=r[++p]),o=s,0!==a&&(i[f++]=a);for(;h<t;)a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++h],o=s,0!==a&&(i[f++]=a);for(;p<n;)a=o-((s=o+c)-(l=s-o))+(c-l),c=r[++p],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function n(t){return new Float64Array(t)}l(e,"r"),l(n,"o");let r=n(4),i=n(8),o=n(12),s=n(16),a=n(4);t.orient2d=function(t,n,l,u,c,h){let p=(n-h)*(l-c),f=(t-c)*(u-h),d=p-f;if(0===p||0===f||p>0!=f>0)return d;let g=Math.abs(p+f);return Math.abs(d)>=33306690738754716e-32*g?d:-function(t,n,l,u,c,h,p){let f,d,g,y,v,m,_,b,w,x,E,I,S,N,M,C,O,P,A=t-c,D=l-c,T=n-h,L=u-h;v=(M=(b=A-(_=(m=134217729*A)-(m-A)))*(x=L-(w=(m=134217729*L)-(m-L)))-((N=A*L)-_*w-b*w-_*x))-(E=M-(O=(b=T-(_=(m=134217729*T)-(m-T)))*(x=D-(w=(m=134217729*D)-(m-D)))-((C=T*D)-_*w-b*w-_*x))),r[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),r[1]=S-(E+v)+(v-C),v=(P=I+E)-I,r[2]=I-(P-v)+(E-v),r[3]=P;let R=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,r),F=22204460492503146e-32*p;if(R>=F||-R>=F||(f=t-(A+(v=t-A))+(v-c),g=l-(D+(v=l-D))+(v-c),d=n-(T+(v=n-T))+(v-h),y=u-(L+(v=u-L))+(v-h),0===f&&0===d&&0===g&&0===y)||(F=11093356479670487e-47*p+33306690738754706e-32*Math.abs(R),(R+=A*y+L*f-(T*g+D*d))>=F||-R>=F))return R;v=(M=(b=f-(_=(m=134217729*f)-(m-f)))*(x=L-(w=(m=134217729*L)-(m-L)))-((N=f*L)-_*w-b*w-_*x))-(E=M-(O=(b=d-(_=(m=134217729*d)-(m-d)))*(x=D-(w=(m=134217729*D)-(m-D)))-((C=d*D)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let k=e(4,r,4,a,i);v=(M=(b=A-(_=(m=134217729*A)-(m-A)))*(x=y-(w=(m=134217729*y)-(m-y)))-((N=A*y)-_*w-b*w-_*x))-(E=M-(O=(b=T-(_=(m=134217729*T)-(m-T)))*(x=g-(w=(m=134217729*g)-(m-g)))-((C=T*g)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let B=e(k,i,4,a,o);v=(M=(b=f-(_=(m=134217729*f)-(m-f)))*(x=y-(w=(m=134217729*y)-(m-y)))-((N=f*y)-_*w-b*w-_*x))-(E=M-(O=(b=d-(_=(m=134217729*d)-(m-d)))*(x=g-(w=(m=134217729*g)-(m-g)))-((C=d*g)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let j=e(B,o,4,a,s);return s[j-1]}(t,n,l,u,c,h,g)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).predicates={})})),LS=fe(((t,e)=>{"use strict";y();var n=vS(),r=_S(),i=PS(),o=CS().orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=v(t),o=new n(16);o.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},o.compareMinX=function(t,e){return t[0]-e[0]},o.compareMinY=function(t,e){return t[1]-e[1]},o.load(t);for(var s,l=[],u=0;u<i.length;u++){var c=i[u];o.remove(c),s=m(c,s),l.push(s)}var h=new n(16);for(u=0;u<l.length;u++)h.insert(g(l[u]));for(var p=e*e,f=r*r;l.length;){var d=l.shift(),y=d.p,b=d.next.p,w=_(y,b);if(!(w<f)){var x=w/p;(c=a(o,d.prev.p,y,b,d.next.next.p,x,h))&&Math.min(_(c,y),_(c,b))<=x&&(l.push(d),l.push(m(c,d)),o.remove(c),h.remove(d),h.insert(g(d)),h.insert(g(d.next)))}}d=s;var E=[];do{E.push(d.p),d=d.next}while(d!==s);return E.push(d.p),E}function a(t,e,n,i,o,s,a){for(var l=new r([],u),h=t.data;h;){for(var f=0;f<h.children.length;f++){var d=h.children[f],g=h.leaf?b(d,n,i):c(n,i,d);g>s||l.push({node:d,dist:g})}for(;l.length&&!l.peek().node.children;){var y=l.pop(),v=y.node,m=b(v,e,n),_=b(v,i,o);if(y.dist<m&&y.dist<_&&p(n,v,a)&&p(i,v,a))return v}(h=l.pop())&&(h=h.node)}return null}function u(t,e){return t.dist-e.dist}function c(t,e,n){if(h(t,n)||h(e,n))return 0;var r=w(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=w(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=w(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=w(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function h(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),l=0;l<a.length;l++)if(d(a[l].p,a[l].next.p,t,e))return!1;return!0}function f(t,e,n){return o(t[0],t[1],e[0],e[1],n[0],n[1])}function d(t,e,n,r){return t!==r&&e!==n&&f(t,e,n)>0!=f(t,e,r)>0&&f(n,r,t)>0!=f(n,r,e)>0}function g(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function v(t){for(var e=t[0],n=t[0],r=t[0],o=t[0],s=0;s<t.length;s++){var a=t[s];a[0]<e[0]&&(e=a),a[0]>r[0]&&(r=a),a[1]<n[1]&&(n=a),a[1]>o[1]&&(o=a)}var l=[e,n,r,o],u=l.slice();for(s=0;s<t.length;s++)i(t[s],l)||u.push(t[s]);return E(u)}function m(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function _(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function b(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function w(t,e,n,r,i,o,s,a){var l,u,c,h,p=n-t,f=r-e,d=s-i,g=a-o,y=t-i,v=e-o,m=p*p+f*f,_=p*d+f*g,b=d*d+g*g,w=p*y+f*v,x=d*y+g*v,E=m*b-_*_,I=E,S=E;0===E?(u=0,I=1,h=x,S=b):(h=m*x-_*w,(u=_*x-b*w)<0?(u=0,h=x,S=b):u>I&&(u=I,h=x+_,S=b)),h<0?(h=0,-w<0?u=0:-w>m?u=I:(u=-w,I=m)):h>S&&(h=S,-w+_<0?u=0:-w+_>m?u=I:(u=-w+_,I=m));var N=(1-(c=0===h?0:h/S))*i+c*s-((1-(l=0===u?0:u/I))*t+l*n),M=(1-c)*o+c*a-((1-l)*e+l*r);return N*N+M*M}function x(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}function E(t){t.sort(x);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&f(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&f(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}r.default&&(r=r.default),e.exports=s,e.exports.default=s,l(s,"concaveman"),l(a,"findCandidate"),l(u,"compareDist"),l(c,"sqSegBoxDist"),l(h,"inside"),l(p,"noIntersections"),l(f,"cross"),l(d,"intersects"),l(g,"updateBBox"),l(v,"fastConvexHull"),l(m,"insertNode"),l(_,"getSqDist"),l(b,"sqSegDist"),l(w,"sqSegSegDist"),l(x,"compareByX"),l(E,"convexHull")})),jS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}function e(t,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=t[r],f=i,d=o;for(n(t,i,r),s(t[o],p)>0&&n(t,i,o);f<d;){for(n(t,f,d),f++,d--;s(t[f],p)<0;)f++;for(;s(t[d],p)>0;)d--}0===s(t[i],p)?n(t,i,d):n(t,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}return l(t,"quickselect"),l(e,"quickselectStep"),l(n,"swap"),l(r,"defaultCompare"),t},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):n.quickselect=r()})),kb=fe(((t,e)=>{"use strict";y(),e.exports=r,e.exports.default=r;var n=jS();function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],a(i,t.leaf?r(o):o);return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(t,e,r,i,o){for(var s,a=[e,r];a.length;)!((r=a.pop())-(e=a.pop())<=i)&&(s=e+Math.ceil((r-e)/i/2)*i,n(t,s,e,r,o),a.push(e,s,s,r))}l(r,"rbush"),r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!v(t,e))return n;for(var i,o,s,a,l=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],v(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):g(t,a)?this._all(s,n):l.push(s));e=l.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!v(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],v(t,s=e.leaf?n(o):o)){if(e.leaf||g(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var n,r,o,s,a=this.data,l=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(o=i(t,a.children,e)))return a.children.splice(o,1),u.push(a),this._condense(u),this;s||a.leaf||!g(a,l)?r?(n++,a=r.children[n],s=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:u,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=m([])).leaf=!1,i.height=r;var l,u,c,h,p=Math.ceil(s/a),f=p*Math.ceil(Math.sqrt(a));for(_(t,e,n,f,this.compareMinX),l=e;l<=n;l+=f)for(_(t,l,c=Math.min(l+f-1,n),p,this.compareMinY),u=l;u<=c;u+=p)h=Math.min(u+p-1,c),i.children.push(this._build(t,u,h,r-1));return o(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,l,u,c,p;r.push(e),!e.leaf&&r.length-1!==n;){for(c=p=1/0,i=0,o=e.children.length;i<o;i++)l=h(s=e.children[i]),(u=f(t,s)-l)<p?(p=u,c=l<c?l:c,a=s):u===p&&l<c&&(c=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),a(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=m(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,a,l,u,c,p;for(u=c=1/0,r=e;r<=n-e;r++)a=d(i=s(t,0,r,this.toBBox),o=s(t,r,n,this.toBBox)),l=h(i)+h(o),a<u?(u=a,p=r,c=l<c?l:c):a===u&&l<c&&(c=l,p=r);return p},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,l=this.toBBox,u=s(t,0,e,l),c=s(t,n-e,n,l),h=p(u)+p(c);for(i=e;i<n-e;i++)o=t.children[i],a(u,t.leaf?l(o):o),h+=p(u);for(i=n-e-1;i>=e;i--)o=t.children[i],a(c,t.leaf?l(o):o),h+=p(c);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},l(i,"findItem"),l(o,"calcBBox"),l(s,"distBBox"),l(a,"extend"),l(u,"compareNodeMinX"),l(c,"compareNodeMinY"),l(h,"bboxArea"),l(p,"bboxMargin"),l(f,"enlargedArea"),l(d,"intersectionArea"),l(g,"contains"),l(v,"intersects"),l(m,"createNode"),l(_,"multiSelect")})),WS=fe(((t,e)=>{"use strict";function n(t,e,n){n=n||2;var i,s,a,l,u,c,p,f=e&&e.length,d=f?e[0]*n:t.length,g=r(t,0,d,n,!0),y=[];if(!g||g.next===g.prev)return y;if(f&&(g=h(t,e,g,n)),t.length>80*n){i=a=t[0],s=l=t[1];for(var v=n;v<d;v+=n)(u=t[v])<i&&(i=u),(c=t[v+1])<s&&(s=c),u>a&&(a=u),c>l&&(l=c);p=0!==(p=Math.max(a-i,l-s))?32767/p:0}return o(g,y,n,i,s,p,0),y}function r(t,e,n,r,i){var o,s;if(i===R(t,e,n,r)>0)for(o=e;o<n;o+=r)s=D(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=D(o,t[o],t[o+1],s);return s&&I(s,s.next)&&(T(s),s=s.next),s}function i(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!I(r,r.next)&&0!==E(r.prev,r,r.next))r=r.next;else{if(T(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function o(t,e,n,r,l,h,p){if(t){!p&&h&&v(t,r,l,h);for(var f,d,g=t;t.prev!==t.next;)if(f=t.prev,d=t.next,h?a(t,r,l,h):s(t))e.push(f.i/n|0),e.push(t.i/n|0),e.push(d.i/n|0),T(t),t=d.next,g=d.next;else if((t=d)===g){p?1===p?o(t=u(i(t),e,n),e,n,r,l,h,2):2===p&&c(t,e,n,r,l,h):o(i(t),e,n,r,l,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(E(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,c=i<o?i<s?i:s:o<s?o:s,h=a<l?a<u?a:u:l<u?l:u,p=i>o?i>s?i:s:o>s?o:s,f=a>l?a>u?a:u:l>u?l:u,d=r.next;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&w(i,a,o,l,s,u,d.x,d.y)&&E(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function a(t,e,n,r){var i=t.prev,o=t,s=t.next;if(E(i,o,s)>=0)return!1;for(var a=i.x,l=o.x,u=s.x,c=i.y,h=o.y,p=s.y,f=a<l?a<u?a:u:l<u?l:u,d=c<h?c<p?c:p:h<p?h:p,g=a>l?a>u?a:u:l>u?l:u,y=c>h?c>p?c:p:h>p?h:p,v=_(f,d,e,n,r),m=_(g,y,e,n,r),b=t.prevZ,x=t.nextZ;b&&b.z>=v&&x&&x.z<=m;){if(b.x>=f&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==s&&w(a,c,l,h,u,p,b.x,b.y)&&E(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=f&&x.x<=g&&x.y>=d&&x.y<=y&&x!==i&&x!==s&&w(a,c,l,h,u,p,x.x,x.y)&&E(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=v;){if(b.x>=f&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==s&&w(a,c,l,h,u,p,b.x,b.y)&&E(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=m;){if(x.x>=f&&x.x<=g&&x.y>=d&&x.y<=y&&x!==i&&x!==s&&w(a,c,l,h,u,p,x.x,x.y)&&E(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function u(t,e,n){var r=t;do{var o=r.prev,s=r.next.next;!I(o,s)&&S(o,r,r.next,s)&&O(o,s)&&O(s,o)&&(e.push(o.i/n|0),e.push(r.i/n|0),e.push(s.i/n|0),T(r),T(r.next),r=t=s),r=r.next}while(r!==t);return i(r)}function c(t,e,n,r,s,a){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=A(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,n,r,s,a,0),void o(c,e,n,r,s,a,0)}u=u.next}l=l.next}while(l!==t)}function h(t,e,n,i){var o,s,a,l=[];for(o=0,s=e.length;o<s;o++)(a=r(t,e[o]*i,o<s-1?e[o+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),l.push(b(a));for(l.sort(p),o=0;o<l.length;o++)n=f(l[o],n);return n}function p(t,e){return t.x-e.x}function f(t,e){var n=d(t,e);if(!n)return e;var r=A(n,t);return i(r,r.next),i(n,n.next)}function d(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var l,u=n,c=n.x,h=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&w(o<h?i:s,o,c,h,o<h?s:i,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(i-r.x),O(r,t)&&(l<p||l===p&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,p=l)),r=r.next}while(r!==u);return n}function g(t,e){return E(t.prev,t,e.prev)<0&&E(e.next,t,t.next)<0}function v(t,e,n,r){var i=t;do{0===i.z&&(i.z=_(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,m(i)}function m(t){var e,n,r,i,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(l=u;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(s>1);return t}function _(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function b(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function w(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!C(t,e)&&(O(t,e)&&O(e,t)&&P(t,e)&&(E(t.prev,t,e.prev)||E(t,e.prev,e))||I(t,e)&&E(t.prev,t,t.next)>0&&E(e.prev,e,e.next)>0)}function E(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,n,r){var i=M(E(t,e,n)),o=M(E(t,e,r)),s=M(E(n,r,t)),a=M(E(n,r,e));return!!(i!==o&&s!==a||0===i&&N(t,n,e)||0===o&&N(t,r,e)||0===s&&N(n,t,r)||0===a&&N(n,e,r))}function N(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function M(t){return t>0?1:t<0?-1:0}function C(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&S(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function O(t,e){return E(t.prev,t,t.next)<0?E(t,e,t.next)>=0&&E(t,t.prev,e)>=0:E(t,e,t.prev)<0||E(t,t.next,e)<0}function P(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function A(t,e){var n=new L(t.i,t.x,t.y),r=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function D(t,e,n,r){var i=new L(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function L(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}y(),e.exports=n,e.exports.default=n,l(n,"earcut"),l(r,"linkedList"),l(i,"filterPoints"),l(o,"earcutLinked"),l(s,"isEar"),l(a,"isEarHashed"),l(u,"cureLocalIntersections"),l(c,"splitEarcut"),l(h,"eliminateHoles"),l(p,"compareX"),l(f,"eliminateHole"),l(d,"findHoleBridge"),l(g,"sectorContainsSector"),l(v,"indexCurve"),l(m,"sortLinked"),l(_,"zOrder"),l(b,"getLeftmost"),l(w,"pointInTriangle"),l(x,"isValidDiagonal"),l(E,"area"),l(I,"equals"),l(S,"intersects"),l(N,"onSegment"),l(M,"sign"),l(C,"intersectsPolygon"),l(O,"locallyInside"),l(P,"middleInside"),l(A,"splitPolygon"),l(D,"insertNode"),l(T,"removeNode"),l(L,"Node"),n.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(R(t,0,o,n));if(i)for(var a=0,l=e.length;a<l;a++){var u=e[a]*n,c=a<l-1?e[a+1]*n:t.length;s-=Math.abs(R(t,u,c,n))}var h=0;for(a=0;a<r.length;a+=3){var p=r[a]*n,f=r[a+1]*n,d=r[a+2]*n;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},l(R,"signedArea"),n.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}})),HS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,r,i,o,s){l((function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=n[r],f=i,d=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}),"t")(t,r,i||0,o||t.length-1,s||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}l(t,"t"),l(e,"i"),l(n,"n");var r=l((function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}),"r");function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return l(i,"e"),l(o,"a"),l(s,"h"),l(a,"o"),l(u,"s"),l(c,"l"),l(h,"f"),l(p,"u"),l(f,"m"),l(d,"c"),l(g,"p"),l(y,"d"),r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!d(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;d(t,a)&&(e.leaf?n.push(s):f(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(d(t,o)){if(e.leaf||f(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=u.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!f(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));y(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);y(t,c,h,l,this.compareMinY);for(var p=c;p<=h;p+=l){var f=Math.min(p+l-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,i=u<i?u:i,s=l):c===o&&u<i&&(i=u,s=l)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),y=s(t,d,n,this.toBBox),v=(i=g,o=y,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),m=h(g)+h(y);v<p?(p=v,r=d,f=m<f?m:f):v===p&&m<f&&(f=m,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),l=s(t,n-e,n,i),u=p(o)+p(l),c=e;c<n-e;c++){var h=t.children[c];a(o,t.leaf?i(h):h),u+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?i(d):d),u+=p(l)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),qb=fe((t=>{"use strict";function e(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 n(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return p(e).geometry;case"MultiLineString":return h(e).geometry;case"MultiPolygon":return f(e).geometry;default:throw new Error(t+" is invalid")}}function r(t,n,r){if(void 0===r&&(r={}),!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(!S(t[0])||!S(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return e({type:"Polygon",coordinates:t},n,r)}function s(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return o(t,e)})),n)}function a(t,n,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return e({type:"LineString",coordinates:t},n,r)}function u(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return a(t,e)})),n)}function c(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 h(t,n,r){return void 0===r&&(r={}),e({type:"MultiLineString",coordinates:t},n,r)}function p(t,n,r){return void 0===r&&(r={}),e({type:"MultiPoint",coordinates:t},n,r)}function f(t,n,r){return void 0===r&&(r={}),e({type:"MultiPolygon",coordinates:t},n,r)}function d(t,n,r){return void 0===r&&(r={}),e({type:"GeometryCollection",geometries:t},n,r)}function g(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function v(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e*r}function m(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e/r}function _(t,e){return w(m(t,e))}function b(t){var e=t%360;return e<0&&(e+=360),e}function w(t){return 180*(t%(2*Math.PI))/Math.PI}function x(t){return t%360*Math.PI/180}function E(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 v(m(t,e),n)}function I(e,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[n];if(!i)throw new Error("invalid original units");var o=t.areaFactors[r];if(!o)throw new Error("invalid final units");return e/i*o}function S(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function N(t){return!!t&&t.constructor===Object}function M(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!S(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=6371008.8,t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:1.0936*t.earthRadius},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},l(e,"feature"),t.feature=e,l(n,"geometry"),t.geometry=n,l(r,"point"),t.point=r,l(i,"points"),t.points=i,l(o,"polygon"),t.polygon=o,l(s,"polygons"),t.polygons=s,l(a,"lineString"),t.lineString=a,l(u,"lineStrings"),t.lineStrings=u,l(c,"featureCollection"),t.featureCollection=c,l(h,"multiLineString"),t.multiLineString=h,l(p,"multiPoint"),t.multiPoint=p,l(f,"multiPolygon"),t.multiPolygon=f,l(d,"geometryCollection"),t.geometryCollection=d,l(g,"round"),t.round=g,l(v,"radiansToLength"),t.radiansToLength=v,l(m,"lengthToRadians"),t.lengthToRadians=m,l(_,"lengthToDegrees"),t.lengthToDegrees=_,l(b,"bearingToAzimuth"),t.bearingToAzimuth=b,l(w,"radiansToDegrees"),t.radiansToDegrees=w,l(x,"degreesToRadians"),t.degreesToRadians=x,l(E,"convertLength"),t.convertLength=E,l(I,"convertArea"),t.convertArea=I,l(S,"isNumber"),t.isNumber=S,l(N,"isObject"),t.isObject=N,l(M,"validateBBox"),t.validateBBox=M,l(C,"validateId"),t.validateId=C})),Ub=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e=qb();function n(t,e,r){if(null!==t)for(var i,o,s,a,l,u,c,h,p=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,v=g?t.features.length:1,m=0;m<v;m++){l=(h=!!(c=g?t.features[m].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var b=0,w=0;if(null!==(a=h?c.geometries[_]:c)){u=a.coordinates;var x=a.type;switch(p=!r||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(u,f,m,b,w))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===e(u[i],f,m,b,w))return!1;f++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(o=0;o<u[i].length-p;o++){if(!1===e(u[i][o],f,m,b,w))return!1;f++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(w=0,o=0;o<u[i].length;o++){for(s=0;s<u[i][o].length-p;s++){if(!1===e(u[i][o][s],f,m,b,w))return!1;f++}w++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(!1===n(a.geometries[i],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function r(t,e,r,i){var o=r;return n(t,(function(t,n,i,s,a){o=0===n&&void 0===r?t:e(o,t,n,i,s,a)}),i),o}function i(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function o(t,e,n){var r=n;return i(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function s(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 a(t,e,n){var r=n;return s(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function u(t){var e=[];return n(t,(function(t){e.push(t)})),e}function c(t,e){var n,r,i,o,s,a,l,u,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,u=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,h))return!1;p++}}function h(t,e,n){var r=n;return c(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function p(t,n){c(t,(function(t,r,i,o,s){var a,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==n(e.feature(t,i,{bbox:o,id:s}),r,0)&&void 0}switch(l){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:a,coordinates:t.coordinates[u]};if(!1===n(e.feature(c,i),r,u))return!1}}))}function f(t,e,n){var r=n;return p(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function d(t,r){p(t,(function(t,i,o){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var l,u=0,c=0,h=0;if(!1===n(t,(function(n,a,p,f,d){if(void 0===l||i>u||f>c||d>h)return l=n,u=i,c=f,h=d,void(s=0);var g=e.lineString([l,n],t.properties);if(!1===r(g,i,o,d,s))return!1;s++,l=n})))return!1}}}))}function g(t,e,n){var r=n,i=!1;return d(t,(function(t,o,s,a,l){r=!1===i&&void 0===n?t:e(r,t,o,s,a,l),i=!0})),r}function v(t,n){if(!t)throw new Error("geojson is required");p(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===n(t,r,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===n(e.lineString(s[a],t.properties),r,i,a))return!1}}}))}function m(t,e,n){var r=n;return v(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function _(t,n){if(n=n||{},!e.isObject(n))throw new Error("options is invalid");var r,i=n.featureIndex||0,o=n.multiFeatureIndex||0,s=n.geometryIndex||0,a=n.segmentIndex||0,l=n.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=u.length+a-1),e.lineString([u[a],u[a+1]],l,n);case"Polygon":return s<0&&(s=u.length+s),a<0&&(a=u[s].length+a-1),e.lineString([u[s][a],u[s][a+1]],l,n);case"MultiLineString":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a-1),e.lineString([u[o][a],u[o][a+1]],l,n);case"MultiPolygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),a<0&&(a=u[o][s].length-a-1),e.lineString([u[o][s][a],u[o][s][a+1]],l,n)}throw new Error("geojson is invalid")}function b(t,n){if(n=n||{},!e.isObject(n))throw new Error("options is invalid");var r,i=n.featureIndex||0,o=n.multiFeatureIndex||0,s=n.geometryIndex||0,a=n.coordIndex||0,l=n.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":return e.point(u,l,n);case"MultiPoint":return o<0&&(o=u.length+o),e.point(u[o],l,n);case"LineString":return a<0&&(a=u.length+a),e.point(u[a],l,n);case"Polygon":return s<0&&(s=u.length+s),a<0&&(a=u[s].length+a),e.point(u[s][a],l,n);case"MultiLineString":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a),e.point(u[o][a],l,n);case"MultiPolygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),a<0&&(a=u[o][s].length-a),e.point(u[o][s][a],l,n)}throw new Error("geojson is invalid")}l(n,"coordEach"),l(r,"coordReduce"),l(i,"propEach"),l(o,"propReduce"),l(s,"featureEach"),l(a,"featureReduce"),l(u,"coordAll"),l(c,"geomEach"),l(h,"geomReduce"),l(p,"flattenEach"),l(f,"flattenReduce"),l(d,"segmentEach"),l(g,"segmentReduce"),l(v,"lineEach"),l(m,"lineReduce"),l(_,"findSegment"),l(b,"findPoint"),t.coordAll=u,t.coordEach=n,t.coordReduce=r,t.featureEach=s,t.featureReduce=a,t.findPoint=b,t.findSegment=_,t.flattenEach=p,t.flattenReduce=f,t.geomEach=c,t.geomReduce=h,t.lineEach=v,t.lineReduce=m,t.propEach=i,t.propReduce=o,t.segmentEach=d,t.segmentReduce=g})),iC=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e=Ub();function n(t){var n=[1/0,1/0,-1/0,-1/0];return e.coordEach(t,(function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])})),n}l(n,"bbox"),n.default=n,t.default=n})),Ug=fe(((t,e)=>{y();var n=HS(),r=qb(),i=Ub(),o=iC().default,s=i.featureEach,a=(i.coordEach,r.polygon,r.featureCollection);function u(t){var e=new n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:o(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:o(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:o(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:o(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return a(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return a(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=o(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=o(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}l(u,"geojsonRbush"),e.exports=u,e.exports.default=u})),Jb=fe(((t,e)=>{"use strict";y();var n=Object.prototype.toString;e.exports=l((function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}),"isArguments")})),SC=fe(((t,e)=>{"use strict";var n,r,i,o,s,a,u,c,h,p,f,d;y(),Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Jb(),s=Object.prototype.propertyIsEnumerable,a=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=l((function(t){var e=t.constructor;return e&&e.prototype===t}),"equalsConstructorPrototype"),p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!p["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch{return!0}}catch{return!0}return!1}(),d=l((function(t){if(typeof window>"u"||!f)return h(t);try{return h(t)}catch{return!1}}),"equalsConstructorPrototypeIfNotBuggy"),n=l((function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),s=o(t),l=e&&"[object String]"===i.call(t),h=[];if(!e&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var p=u&&n;if(l&&t.length>0&&!r.call(t,0))for(var f=0;f<t.length;++f)h.push(String(f));if(s&&t.length>0)for(var g=0;g<t.length;++g)h.push(String(g));else for(var y in t)(!p||"prototype"!==y)&&r.call(t,y)&&h.push(String(y));if(a)for(var v=d(t),m=0;m<c.length;++m)(!v||"constructor"!==c[m])&&r.call(t,c[m])&&h.push(c[m]);return h}),"keys")),e.exports=n})),Hg=fe(((t,e)=>{"use strict";y();var n=Array.prototype.slice,r=Jb(),i=Object.keys,o=i?l((function(t){return i(t)}),"keys"):SC(),s=Object.keys;o.shim=l((function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=l((function(t){return r(t)?s(n.call(t)):s(t)}),"keys"))}else Object.keys=o;return Object.keys||o}),"shimObjectKeys"),e.exports=o})),TC=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),ex=fe(((t,e)=>{"use strict";y();var n=TC();e.exports=l((function(){return n()&&!!Symbol.toStringTag}),"hasToStringTagShams")})),RC=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),BC=fe(((t,e)=>{"use strict";y();var n=typeof Symbol<"u"&&Symbol,r=RC();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),zC=fe(((t,e)=>{"use strict";y();var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,i=Object.prototype.toString,o="[object Function]";e.exports=l((function(t){var e=this;if("function"!=typeof e||i.call(e)!==o)throw new TypeError(n+e);for(var s,a=r.call(arguments,1),u=l((function(){if(this instanceof s){var n=e.apply(this,a.concat(r.call(arguments)));return Object(n)===n?n:this}return e.apply(t,a.concat(r.call(arguments)))}),"binder"),c=Math.max(0,e.length-a.length),h=[],p=0;p<c;p++)h.push("$"+p);if(s=Function("binder","return function ("+h.join(",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var f=l((function(){}),"Empty");f.prototype=e.prototype,s.prototype=new f,f.prototype=null}return s}),"bind")})),Rp=fe(((t,e)=>{"use strict";y();var n=zC();e.exports=Function.prototype.bind||n})),rx=fe(((t,e)=>{"use strict";y();var n=Rp();e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),ox=fe(((t,e)=>{"use strict";y();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch{}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch{try{return a(arguments,"callee").get}catch{return u}}}():u,h=BC()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d=typeof Uint8Array>"u"?n:p(Uint8Array),g={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h?n:p((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h?n:p((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet},v=l((function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=p(i.prototype))}return g[e]=n,n}),"doEval"),m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=Rp(),b=rx(),w=_.call(Function.call,Array.prototype.concat),x=_.call(Function.apply,Array.prototype.splice),E=_.call(Function.call,String.prototype.replace),I=_.call(Function.call,String.prototype.slice),S=_.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,C=l((function(t){var e=I(t,0,1),n=I(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var i=[];return E(t,N,(function(t,e,n,r){i[i.length]=n?E(r,M,"$1"):e||t})),i}),"stringToPath"),O=l((function(t,e){var n,i=t;if(b(m,i)&&(i="%"+(n=m[i])[0]+"%"),b(g,i)){var s=g[i];if(s===f&&(s=v(i)),typeof s>"u"&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new r("intrinsic "+t+" does not exist!")}),"getBaseIntrinsic");e.exports=l((function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/g,t))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(t),i=n.length>0?n[0]:"",s=O("%"+i+"%",e),l=s.name,u=s.value,c=!1,h=s.alias;h&&(i=h[0],x(n,w([0,1],h)));for(var p=1,f=!0;p<n.length;p+=1){var d=n[p],y=I(d,0,1),v=I(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new r("property names with quotes must have matching quotes");if(("constructor"===d||!f)&&(c=!0),b(g,l="%"+(i+="."+d)+"%"))u=g[l];else if(null!=u){if(!(d in u)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(a&&p+1>=n.length){var m=a(u,d);u=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[d]}else f=b(u,d),u=u[d];f&&!c&&(g[l]=u)}}return u}),"GetIntrinsic")})),Zg=fe(((t,e)=>{"use strict";y();var n=Rp(),r=ox(),i=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(o,i),a=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}e.exports=l((function(t){var e=s(n,o,arguments);if(a&&u){var r=a(e,"length");r.configurable&&u(e,"length",{value:1+c(0,t.length-(arguments.length-1))})}return e}),"callBind");var h=l((function(){return s(n,i,arguments)}),"applyBind");u?u(e.exports,"apply",{value:h}):e.exports.apply=h})),sx=fe(((t,e)=>{"use strict";y();var n=ox(),r=Zg(),i=r(n("String.prototype.indexOf"));e.exports=l((function(t,e){var o=n(t,!!e);return"function"==typeof o&&i(t,".prototype.")>-1?r(o):o}),"callBoundIntrinsic")})),nk=fe(((t,e)=>{"use strict";y();var n=ex()(),r=sx()("Object.prototype.toString"),i=l((function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===r(t)}),"isArguments"),o=l((function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)}),"isArguments"),s=function(){return i(arguments)}();i.isLegacyArguments=o,e.exports=s?i:o})),cx=fe(((t,e)=>{"use strict";y();var n=Hg(),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,a=l((function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}),"isFunction"),u=l((function(){var t={};try{for(var e in s(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}),"arePropertyDescriptorsSupported"),c=s&&u(),h=l((function(t,e,n,r){e in t&&(!a(r)||!r())||(c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)}),"defineProperty"),p=l((function(t,e){var i=arguments.length>2?arguments[2]:{},s=n(e);r&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)h(t,s[a],e[s[a]],i[s[a]])}),"defineProperties");p.supportsDescriptors=!!c,e.exports=p})),fx=fe(((t,e)=>{"use strict";y();var n=l((function(t){return t!=t}),"numberIsNaN");e.exports=l((function(t,e){return 0===t&&0===e?1/t==1/e:!!(t===e||n(t)&&n(e))}),"is")})),px=fe(((t,e)=>{"use strict";y();var n=fx();e.exports=l((function(){return"function"==typeof Object.is?Object.is:n}),"getPolyfill")})),fk=fe(((t,e)=>{"use strict";y();var n=px(),r=cx();e.exports=l((function(){var t=n();return r(Object,{is:t},{is:l((function(){return Object.is!==t}),"testObjectIs")}),t}),"shimObjectIs")})),gk=fe(((t,e)=>{"use strict";y();var n=cx(),r=Zg(),i=fx(),o=px(),s=fk(),a=r(o(),Object);n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),bk=fe(((t,e)=>{"use strict";y();var n,r,i,o,s=sx(),a=ex()();a&&(n=s("Object.prototype.hasOwnProperty"),r=s("RegExp.prototype.exec"),i={},u=l((function(){throw i}),"throwRegexMarker"),o={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(o[Symbol.toPrimitive]=u));var u,c=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;e.exports=l(a?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{r(t,o)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)},"isRegex")})),wk=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),Ik=fe(((t,e)=>{"use strict";y();var n=typeof Symbol<"u"&&Symbol,r=wk();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),Ok=fe(((t,e)=>{"use strict";y();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch{}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch{try{return a(arguments,"callee").get}catch{return u}}}():u,h=Ik()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d=typeof Uint8Array>"u"?n:p(Uint8Array),g={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h?n:p((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h?n:p((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet},v=l((function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=p(i.prototype))}return g[e]=n,n}),"doEval"),m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=Rp(),b=rx(),w=_.call(Function.call,Array.prototype.concat),x=_.call(Function.apply,Array.prototype.splice),E=_.call(Function.call,String.prototype.replace),I=_.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,M=l((function(t){var e=I(t,0,1),n=I(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var i=[];return E(t,S,(function(t,e,n,r){i[i.length]=n?E(r,N,"$1"):e||t})),i}),"stringToPath"),C=l((function(t,e){var n,i=t;if(b(m,i)&&(i="%"+(n=m[i])[0]+"%"),b(g,i)){var s=g[i];if(s===f&&(s=v(i)),typeof s>"u"&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new r("intrinsic "+t+" does not exist!")}),"getBaseIntrinsic");e.exports=l((function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');var n=M(t),i=n.length>0?n[0]:"",s=C("%"+i+"%",e),l=s.name,u=s.value,c=!1,h=s.alias;h&&(i=h[0],x(n,w([0,1],h)));for(var p=1,f=!0;p<n.length;p+=1){var d=n[p],y=I(d,0,1),v=I(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new r("property names with quotes must have matching quotes");if(("constructor"===d||!f)&&(c=!0),b(g,l="%"+(i+="."+d)+"%"))u=g[l];else if(null!=u){if(!(d in u)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(a&&p+1>=n.length){var m=a(u,d);u=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[d]}else f=b(u,d),u=u[d];f&&!c&&(g[l]=u)}}return u}),"GetIntrinsic")})),Tk=fe(((t,e)=>{"use strict";y();var n=Ok()("%Object.defineProperty%",!0),r=l((function(){if(n)try{return n({},"a",{value:1}),!0}catch{return!1}return!1}),"hasPropertyDescriptors");r.hasArrayLengthDefineBug=l((function(){if(!r())return null;try{return 1!==n([],"length",{value:1}).length}catch{return!0}}),"hasArrayLengthDefineBug"),e.exports=r})),im=fe(((t,e)=>{"use strict";y();var n=Hg(),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,a=l((function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}),"isFunction"),u=Tk()(),c=s&&u,h=l((function(t,e,n,r){if(e in t)if(!0===r){if(t[e]===n)return}else if(!a(r)||!r())return;c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n}),"defineProperty"),p=l((function(t,e){var i=arguments.length>2?arguments[2]:{},s=n(e);r&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)h(t,s[a],e[s[a]],i[s[a]])}),"defineProperties");p.supportsDescriptors=!!c,e.exports=p})),Bk=fe(((t,e)=>{"use strict";y();var n=l((function(){return"string"==typeof l((function(){}),"f").name}),"functionsHaveNames"),r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch{r=null}n.functionsHaveConfigurableNames=l((function(){if(!n()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable}),"functionsHaveConfigurableNames");var i=Function.prototype.bind;n.boundFunctionsHaveNames=l((function(){return n()&&"function"==typeof i&&""!==l((function(){}),"f").bind().name}),"boundFunctionsHaveNames"),e.exports=n})),xx=fe(((t,e)=>{"use strict";y();var n=Bk().functionsHaveConfigurableNames(),r=Object,i=TypeError;e.exports=l((function(){if(null!=this&&this!==r(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"flags"),n&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})})),wx=fe(((t,e)=>{"use strict";y();var n=xx(),r=im().supportsDescriptors,i=Object.getOwnPropertyDescriptor;e.exports=l((function(){if(r&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}),"getPolyfill")})),Gk=fe(((t,e)=>{"use strict";y();var n=im().supportsDescriptors,r=wx(),i=Object.getOwnPropertyDescriptor,o=Object.defineProperty,s=TypeError,a=Object.getPrototypeOf,u=/a/;e.exports=l((function(){if(!n||!a)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r(),e=a(u),l=i(e,"flags");return(!l||l.get!==t)&&o(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}),"shimFlags")})),Yk=fe(((t,e)=>{"use strict";y();var n=im(),r=Zg(),i=xx(),o=wx(),s=Gk(),a=r(o());n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),Hk=fe(((t,e)=>{"use strict";y();var n=Date.prototype.getDay,r=l((function(t){try{return n.call(t),!0}catch{return!1}}),"tryDateGetDayCall"),i=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=l((function(t){return"object"==typeof t&&null!==t&&(o?r(t):"[object Date]"===i.call(t))}),"isDateObject")})),Ex=fe(((t,e)=>{y();var n=Hg(),r=nk(),i=gk(),o=bk(),s=Yk(),a=Hk(),u=Date.prototype.getTime;function c(t,e,n){var r=n||{};return!!(r.strict?i(t,e):t===e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?i(t,e):t==e:f(t,e,r))}function h(t){return null==t}function p(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}function f(t,e,i){var l,f;if(typeof t!=typeof e||h(t)||h(e)||t.prototype!==e.prototype||r(t)!==r(e))return!1;var d=o(t),g=o(e);if(d!==g)return!1;if(d||g)return t.source===e.source&&s(t)===s(e);if(a(t)&&a(e))return u.call(t)===u.call(e);var y=p(t),v=p(e);if(y!==v)return!1;if(y||v){if(t.length!==e.length)return!1;for(l=0;l<t.length;l++)if(t[l]!==e[l])return!1;return!0}if(typeof t!=typeof e)return!1;try{var m=n(t),_=n(e)}catch{return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),l=m.length-1;l>=0;l--)if(m[l]!=_[l])return!1;for(l=m.length-1;l>=0;l--)if(!c(t[f=m[l]],e[f],i))return!1;return!0}l(c,"deepEqual"),l(h,"isUndefinedOrNull"),l(p,"isBuffer"),l(f,"objEquiv"),e.exports=c})),Rx=fe(((t,e)=>{y();var n=Ex(),r=l((function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:s}),"Equality");function i(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function o(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function s(t,e){return n(t,e,{strict:!0})}r.prototype.compare=function(t,e){if(t.type!==e.type||!o(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=i(t),s=i(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),s)}}return!1},l(i,"explode"),l(o,"sameLength"),r.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},r.prototype.compareLine=function(t,e,n,r){if(!o(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],s[0])||(s=this.fixStartIndex(s,i))){var a=this.compareCoord(i[n],s[n]);return this.direction||a?this.comparePath(i,s):!!this.compareCoord(i[n],s[s.length-(1+n)])&&this.comparePath(i.slice().reverse(),s)}},r.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},r.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},r.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},r.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},r.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},r.prototype.removePseudo=function(t){return t},l(s,"objectComparator"),e.exports=r})),hO=fe(((t,e)=>{function n(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}y(),l(n,"DBSCAN"),n.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(i,s),this._expandCluster(s,o)}}return this.clusters},n.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},n.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},n.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},n.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++){this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n)}return e},n.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},n.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=n)})),dO=fe(((t,e)=>{function n(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}y(),l(n,"KMEANS"),n.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],typeof t<"u"&&(this.dataset=t),typeof e<"u"&&(this.k=e),typeof n<"u"&&(this.distance=n)},n.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(c),a=0,l=0;l<c;l++)s[l]=0;for(var u=0;u<n;u++){var c=this.dataset[u].length;if(o===this.assignments[u]){for(l=0;l<c;l++)s[l]+=this.dataset[u][l];a++}}if(a>0){for(l=0;l<c;l++)s[l]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},n.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},n.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},n.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)typeof e[t=this.assignments[n]]>"u"&&(e[t]=[]),e[t].push(n);return e},n.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(r=n(t,e[a]))<i&&(i=r,o=a);return o},n.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=n)})),Dx=fe(((t,e)=>{function n(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}y(),l(n,"PriorityQueue"),n.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},n.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},n.prototype.forEach=function(t){this._queue.forEach(t)},n.prototype.getElements=function(){return this._queue},n.prototype.getElementPriority=function(t){return this._priorities[t]},n.prototype.getPriorities=function(){return this._priorities},n.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},n.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},n.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},typeof e<"u"&&e.exports&&(e.exports=n)})),mO=fe(((t,e)=>{var n;function r(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}y(),typeof e<"u"&&e.exports&&(n=Dx()),l(r,"OPTICS"),r.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var l=new n(null,null,"asc"),u=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,u,l),this._expandCluster(a,l))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},r.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},r.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},r.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++){if(this._regionQuery(t,n).length>=this.minPts)return n}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},r.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=r)})),yO=fe(((t,e)=>{y(),typeof e<"u"&&e.exports&&(e.exports={DBSCAN:hO(),KMEANS:dO(),OPTICS:mO(),PriorityQueue:Dx()})})),Fx=fe(((t,e)=>{"use strict";y(),e.exports={eudist:l((function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i}),"eudist"),mandist:l((function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i}),"mandist"),dist:l((function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}),"dist")}})),wO=fe(((t,e)=>{"use strict";y();var n=Fx(),r=n.eudist,i=n.dist;e.exports={kmrand:l((function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],l=s?a.join("_"):""+a;n[l]||(n[l]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r}),"kmrand"),kmpp:l((function(t,e){var n=t[0].length?r:i,o=[],s=t.length,a=t[0].length>0,l=t[Math.floor(Math.random()*s)];a&&l.join("_");for(o.push(l);o.length<e;){for(var u=[],c=o.length,h=0,p=[],f=0;f<s;f++){for(var d=1/0,g=0;g<c;g++){var y=n(t[f],o[g]);y<=d&&(d=y)}u[f]=d}for(var v=0;v<s;v++)h+=u[v];for(var m=0;m<s;m++)p[m]={i:m,v:t[m],pr:u[m]/h,cs:0};p.sort((function(t,e){return t.pr-e.pr})),p[0].cs=p[0].pr;for(var _=1;_<s;_++)p[_].cs=p[_-1].cs+p[_].pr;for(var b=Math.random(),w=0;w<s-1&&p[w++].cs<b;);o.push(p[w-1].v)}return o}),"kmpp")}})),SO=fe(((t,e)=>{"use strict";y();var n=Fx(),r=wO(),i=n.eudist,o=(n.mandist,n.dist,r.kmrand),s=r.kmpp;function a(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}function u(t,e,n,r){var l=[],u=[],c=[],h=[],p=!1,f=r||1e4,d=t.length,g=t[0].length,y=g>0,v=[];if(n)l="kmrand"==n?o(t,e):"kmpp"==n?s(t,e):n;else for(var m={};l.length<e;){var _=Math.floor(Math.random()*d);m[_]||(m[_]=!0,l.push(t[_]))}do{a(e,0,v);for(var b=0;b<d;b++){for(var w=1/0,x=0,E=0;E<e;E++){(h=y?i(t[b],l[E]):Math.abs(t[b]-l[E]))<=w&&(w=h,x=E)}c[b]=x,v[x]++}for(var I=[],S=(u=[],0);S<e;S++)I[S]=y?a(g,0,I[S]):0,u[S]=l[S];if(y){for(var N=0;N<e;N++)l[N]=[];for(var M=0;M<d;M++)for(var C=I[c[M]],O=t[M],P=0;P<g;P++)C[P]+=O[P];p=!0;for(var A=0;A<e;A++){for(var D=l[A],T=I[A],L=u[A],R=v[A],F=0;F<g;F++)D[F]=T[F]/R||0;if(p)for(var k=0;k<g;k++)if(L[k]!=D[k]){p=!1;break}}}else{for(var B=0;B<d;B++){I[c[B]]+=t[B]}for(var j=0;j<e;j++)l[j]=I[j]/v[j]||0;p=!0;for(var G=0;G<e;G++)if(u[G]!=l[G]){p=!1;break}}p=p||--f<=0}while(!p);return{it:1e4-f,k:e,idxs:c,centroids:l}}l(a,"init"),l(u,"skmeans"),e.exports=u})),jl=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}l(t,"_classCallCheck"),l(e,"_defineProperties"),l(n,"_createClass");var r=function(){function t(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return l(t,"Node"),t}();function i(t,e){return t>e?1:t<e?-1:0}function o(t,e,n){for(var i=new r(null,null),o=i,s=i;;){var a=n(t,e.key);if(a<0){if(null===e.left)break;if(n(t,e.left.key)<0){var l=e.left;if(e.left=l.right,l.right=e,null===(e=l).left)break}s.left=e,s=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(l=e.right,e.right=l.left,l.left=e,null===(e=l).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,s.left=e.right,e.left=i.right,e.right=i.left,e}function s(t,e,n,i){var s=new r(t,e);if(null===n)return s.left=s.right=null,s;var a=i(t,(n=o(t,n,i)).key);return a<0?(s.left=n.left,s.right=n,n.left=null):a>=0&&(s.right=n.right,s.left=n,n.right=null),s}function a(t,e,n){var r=null,i=null;if(e){var s=n((e=o(t,e,n)).key,t);0===s?(r=e.left,i=e.right):s<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function u(t,e,n){return null===e?t:(null===t||((e=o(t.key,e,n)).left=t),e)}function c(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&c(t.left,o,!1,r,i),t.right&&c(t.right,o,!0,r,i)}}l(i,"DEFAULT_COMPARE"),l(o,"splay"),l(s,"insert"),l(a,"split"),l(u,"merge"),l(c,"printRow");var h=function(){function t(t){void 0===t&&(t=i),this._root=null,this._size=0,this._comparator=t}return l(t,"Tree"),t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new r(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=o(t,this._root,i),a=i(t,s.key);return 0===a?this._root=s:(a<0?(n.left=s.left,n.right=s,s.left=null):a>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=o(t,e,n)).key)?(null===e.left?r=e.right:(r=o(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=o(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=o(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return d(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&v(t,e,0,r-1,i),null===this._root)this._root=p(t,e,0,r),this._size=r;else{var o=y(this.toList(),f(t,e),i);r=this._size+r,this._root=g({head:o},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:l((function(){return this._size}),"get"),enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:l((function(){return this._root}),"get"),enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=l((function(t){return String(t.key)}),"printNode"));var e=[];return c(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=a(t,this._root,r),o=i.left,l=i.right;r(t,e)<0?l=s(e,n,l,r):o=s(e,n,o,r),this._root=u(o,l,r)},t.prototype.split=function(t){return a(t,this._root,this._comparator)},t}();function p(t,e,n,i){var o=i-n;if(o>0){var s=n+Math.floor(o/2),a=t[s],l=e[s],u=new r(a,l);return u.left=p(t,e,n,s),u.right=p(t,e,s+1,i),u}return null}function f(t,e){for(var n=new r(null,null),i=n,o=0;o<t.length;o++)i=i.next=new r(t[o],e[o]);return i.next=null,n.next}function d(t){for(var e=t,n=[],i=!1,o=new r(null,null),s=o;!i;)e?(n.push(e),e=e.left):n.length>0?e=(e=s=s.next=n.pop()).right:i=!0;return s.next=null,o.next}function g(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=g(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=g(t,i+1,n),s}return null}function y(t,e,n){for(var i=new r(null,null),o=i,s=t,a=e;null!==s&&null!==a;)n(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}function v(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}v(t,e,n,a,i),v(t,e,a+1,r,i)}}l(p,"loadRecursive"),l(f,"createList"),l(d,"toList"),l(g,"sortedListToBST"),l(y,"mergeLists"),l(v,"sort");var m=l((function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y}),"isInBbox"),_=l((function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}}),"getBboxOverlap"),b=Number.EPSILON;void 0===b&&(b=Math.pow(2,-52));var w=b*b,x=l((function(t,e){if(-b<t&&t<b&&-b<e&&e<b)return 0;var n=t-e;return n*n<w*t*e?0:t<e?-1:1}),"cmp"),E=function(){function e(){t(this,e),this.reset()}return l(e,"PtRounder"),n(e,[{key:"reset",value:l((function(){this.xRounder=new I,this.yRounder=new I}),"reset")},{key:"round",value:l((function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}),"round")}]),e}(),I=function(){function e(){t(this,e),this.tree=new h,this.round(0)}return l(e,"CoordRounder"),n(e,[{key:"round",value:l((function(t){var e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===x(e.key,n.key))return this.tree.remove(t),n.key;var r=this.tree.next(e);return null!==r&&0===x(e.key,r.key)?(this.tree.remove(t),r.key):t}),"round")}]),e}(),S=new E,N=l((function(t,e){return t.x*e.y-t.y*e.x}),"crossProduct"),M=l((function(t,e){return t.x*e.x+t.y*e.y}),"dotProduct"),O=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y},o=N(r,i);return x(o,0)}),"compareVectorAngles"),P=l((function(t){return Math.sqrt(M(t,t))}),"length"),A=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return N(i,r)/P(i)/P(r)}),"sineOfAngle"),D=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return M(i,r)/P(i)/P(r)}),"cosineOfAngle"),T=l((function(t,e,n){return 0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n}}),"horizontalIntersection"),L=l((function(t,e,n){return 0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}}),"verticalIntersection"),R=l((function(t,e,n,r){if(0===e.x)return L(n,r,t.x);if(0===r.x)return L(t,e,n.x);if(0===e.y)return T(n,r,t.y);if(0===r.y)return T(t,e,n.y);var i=N(e,r);if(0==i)return null;var o={x:n.x-t.x,y:n.y-t.y},s=N(o,e)/i,a=N(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}}),"intersection"),F=function(){function e(n,r){t(this,e),void 0===n.events?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=r}return n(e,null,[{key:"compare",value:l((function(t,n){var r=e.comparePoints(t.point,n.point);return 0!==r?r:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:B.compare(t.segment,n.segment))}),"compare")},{key:"comparePoints",value:l((function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}),"comparePoints")}]),l(e,"SweepEvent"),n(e,[{key:"link",value:l((function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}),"link")},{key:"checkForConsuming",value:l((function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment)}}}),"checkForConsuming")},{key:"getAvailableLinkedEvents",value:l((function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}),"getAvailableLinkedEvents")},{key:"getLeftmostComparator",value:l((function(t){var e=this,n=new Map,r=l((function(r){var i=r.otherSE;n.set(r,{sine:A(e.point,t.point,i.point),cosine:D(e.point,t.point,i.point)})}),"fillCache");return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,s=i.cosine,a=n.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}),"getLeftmostComparator")}]),e}(),k=0,B=function(){function e(n,r,i,o){t(this,e),this.id=++k,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:l((function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(n<r){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){var d=e.comparePoint(t.rightSE.point);if(0!==d)return d}if(i>o){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=l-s,v=i-n,m=u-a,_=o-r;if(y>v&&m<_)return 1;if(y<v&&m>_)return-1}return i>o?1:i<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}),"compare")}]),l(e,"Segment"),n(e,[{key:"replaceRightSE",value:l((function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}),"replaceRightSE")},{key:"bbox",value:l((function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}),"bbox")},{key:"vector",value:l((function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}),"vector")},{key:"isAnEndpoint",value:l((function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}),"isAnEndpoint")},{key:"comparePoint",value:l((function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;var i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;var s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}),"comparePoint")},{key:"getIntersection",value:l((function(t){var e=this.bbox(),n=t.bbox(),r=_(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=m(e,s)&&0===this.comparePoint(s),u=m(n,i)&&0===t.comparePoint(i),c=m(e,a)&&0===this.comparePoint(a),h=m(n,o)&&0===t.comparePoint(o);if(u&&l)return h&&!c?o:!h&&c?a:null;if(u)return c&&i.x===a.x&&i.y===a.y?null:i;if(l)return h&&o.x===s.x&&o.y===s.y?null:s;if(h&&c)return null;if(h)return o;if(c)return a;var p=R(i,this.vector(),s,t.vector());return null!==p&&m(r,p)?S.round(p.x,p.y):null}),"getIntersection")},{key:"split",value:l((function(t){var n=[],r=void 0!==t.events,i=new F(t,!0),o=new F(t,!1),s=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var a=new e(i,s,this.rings.slice(),this.windings.slice());return F.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),F.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}),"split")},{key:"swapEvents",value:l((function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}),"swapEvents")},{key:"consume",value:l((function(t){for(var n=this,r=t;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=e.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,l=r.rings.length;a<l;a++){var u=r.rings[a],c=r.windings[a],h=n.rings.indexOf(u);-1===h?(n.rings.push(u),n.windings.push(c)):n.windings[h]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}),"consume")},{key:"prevInResult",value:l((function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}),"prevInResult")},{key:"beforeState",value:l((function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}),"beforeState")},{key:"afterState",value:l((function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var s=this.rings[i],a=this.windings[i],l=e.indexOf(s);-1===l?(e.push(s),n.push(a)):n[l]+=a}for(var u=[],c=[],h=0,p=e.length;h<p;h++)if(0!==n[h]){var f=e[h],d=f.poly;if(-1===c.indexOf(d))if(f.isExterior)u.push(d);else{-1===c.indexOf(d)&&c.push(d);var g=u.indexOf(f.poly);-1!==g&&u.splice(g,1)}}for(var y=0,v=u.length;y<v;y++){var m=u[y].multiPoly;-1===r.indexOf(m)&&r.push(m)}return this._afterState}),"afterState")},{key:"isInResult",value:l((function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(J.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===J.numMultiPolys&&i<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=l((function(t){return 1===t.length&&t[0].isSubject}),"isJustSubject");this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(J.type))}return this._isInResult}),"isInResult")}],[{key:"fromRing",value:l((function(t,n,r){var i,o,s,a=F.comparePoints(t,n);if(a<0)i=t,o=n,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=n,o=t,s=-1}return new e(new F(i,!0),new F(o,!1),[r],[s])}),"fromRing")}]),e}(),j=function(){function e(n,r,i){if(t(this,e),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=S.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=n.length;a<l;a++){if("number"!=typeof n[a][0]||"number"!=typeof n[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=S.round(n[a][0],n[a][1]);u.x===s.x&&u.y===s.y||(this.segments.push(B.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(B.fromRing(s,o,this))}return l(e,"RingIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}),"getSweepEvents")}]),e}(),G=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new j(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,o=n.length;i<o;i++){var s=new j(n[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=r}return l(e,"PolyIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}),"getSweepEvents")}]),e}(),z=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof n[0][0][0]&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,o=n.length;i<o;i++){var s=new G(n[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=r}return l(e,"MultiPolyIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}),"getSweepEvents")}]),e}(),U=function(){function e(n){t(this,e),this.events=n;for(var r=0,i=n.length;r<i;r++)n[r].segment.ringOut=this;this.poly=null}return n(e,null,[{key:"factory",value:l((function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],c=a.point,h=[];s=a,a=l,u.push(a),a.point!==c;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var f=u[0].point,d=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(f.x,",")+" ".concat(f.y,"]. Last matching segment found ends at")+" [".concat(d.x,", ").concat(d.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var g=null,y=0,v=h.length;y<v;y++)if(h[y].point===a.point){g=y;break}if(null===g){h.push({index:u.length,point:a.point});var m=a.getLeftmostComparator(s);l=p.sort(m)[0].otherSE;break}var _=h.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),n.push(new e(b.reverse()))}n.push(new e(u))}}return n}),"factory")}]),l(e,"RingOut"),n(e,[{key:"getGeom",value:l((function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==O(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var s=e[0],a=e[1];0===O(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,h=[],p=u;p!=c;p+=l)h.push([e[p].x,e[p].y]);return h}),"getGeom")},{key:"isExteriorRing",value:l((function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}),"isExteriorRing")},{key:"enclosingRing",value:l((function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}),"enclosingRing")},{key:"_calcEnclosingRing",value:l((function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];F.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}),"_calcEnclosingRing")}]),e}(),q=function(){function e(n){t(this,e),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return l(e,"PolyOut"),n(e,[{key:"addInterior",value:l((function(t){this.interiorRings.push(t),t.poly=this}),"addInterior")},{key:"getGeom",value:l((function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e<n;e++){var r=this.interiorRings[e].getGeom();null!==r&&t.push(r)}return t}),"getGeom")}]),e}(),V=function(){function e(n){t(this,e),this.rings=n,this.polys=this._composePolys(n)}return l(e,"MultiPolyOut"),n(e,[{key:"getGeom",value:l((function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}),"getGeom")},{key:"_composePolys",value:l((function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new q(i));else{var o=i.enclosingRing();o.poly||e.push(new q(o)),o.poly.addInterior(i)}}return e}),"_composePolys")}]),e}(),Y=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B.compare;t(this,e),this.queue=n,this.tree=new h(r),this.segments=[]}return l(e,"SweepLine"),n(e,[{key:"process",value:l((function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,s=void 0,a=void 0;void 0===s;)null===(i=this.tree.prev(i))?s=null:void 0===i.key.consumedBy&&(s=i.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var c=this._splitSafely(s,u),h=0,p=c.length;h<p;h++)n.push(c[h])}var f=null;if(a){var d=a.getIntersection(e);if(null!==d&&(e.isAnEndpoint(d)||(f=d),!a.isAnEndpoint(d)))for(var g=this._splitSafely(a,d),y=0,v=g.length;y<v;y++)n.push(g[y])}if(null!==l||null!==f){var m=null;m=null===l?f:null===f||F.comparePoints(l,f)<=0?l:f,this.queue.remove(e.rightSE),n.push(e.rightSE);for(var _=e.split(m),b=0,w=_.length;b<w;b++)n.push(_[b])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var x=s.getIntersection(a);if(null!==x){if(!s.isAnEndpoint(x))for(var E=this._splitSafely(s,x),I=0,S=E.length;I<S;I++)n.push(E[I]);if(!a.isAnEndpoint(x))for(var N=this._splitSafely(a,x),M=0,C=N.length;M<C;M++)n.push(N[M])}}this.tree.remove(e)}return n}),"process")},{key:"_splitSafely",value:l((function(t,e){this.tree.remove(t);var n=t.rightSE;this.queue.remove(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.insert(t),r}),"_splitSafely")}]),e}(),X=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,W=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,J=new(function(){function e(){t(this,e)}return l(e,"Operation"),n(e,[{key:"run",value:l((function(t,e,n){J.type=t,S.reset();for(var r=[new z(e,!0)],i=0,o=n.length;i<o;i++)r.push(new z(n[i],!1));if(J.numMultiPolys=r.length,"difference"===J.type)for(var s=r[0],a=1;a<r.length;)null!==_(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===J.type)for(var l=0,u=r.length;l<u;l++)for(var c=r[l],p=l+1,f=r.length;p<f;p++)if(null===_(c.bbox,r[p].bbox))return[];for(var d=new h(F.compare),g=0,y=r.length;g<y;g++)for(var v=r[g].getSweepEvents(),m=0,b=v.length;m<b;m++)if(d.insert(v[m]),d.size>X)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new Y(d),x=d.size,E=d.pop();E;){var I=E.key;if(d.size===x){var N=I.segment;throw new Error("Unable to pop() ".concat(I.isLeft?"left":"right"," SweepEvent ")+"[".concat(I.point.x,", ").concat(I.point.y,"] from segment #").concat(N.id," ")+"[".concat(N.leftSE.point.x,", ").concat(N.leftSE.point.y,"] -> ")+"[".concat(N.rightSE.point.x,", ").concat(N.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>X)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>W)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var M=w.process(I),C=0,O=M.length;C<O;C++){var P=M[C];void 0===P.consumedBy&&d.insert(P)}x=d.size,E=d.pop()}S.reset();var A=U.factory(w.segments);return new V(A).getGeom()}),"run")}]),e}()),H=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("union",t,n)}),"union"),Z=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("intersection",t,n)}),"intersection"),K=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("xor",t,n)}),"xor"),$=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("difference",t,n)}),"difference");return{union:H,intersection:Z,xor:K,difference:$}},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=typeof globalThis<"u"?globalThis:n||self).polygonClipping=r()})),YO=fe(((t,e)=>{var n,r;y(),n=t,r=function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Rt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function h(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function f(){}function d(){this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}function g(){}function y(t){this.message=t||""}function v(){this.array_=[]}l(e,"e"),l(n,"n"),l(r,"i"),l(i,"r"),l(o,"o"),l(s,"s"),l(a,"a"),l(u,"u"),l(c,"l"),l(h,"c"),l(p,"p"),l(f,"h"),l(d,"f"),l(g,"g"),l(y,"d"),l(v,"y"),"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 i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)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 m=l((function(){}),"_");m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.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 l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),b=l((function(){}),"v"),w={MAX_VALUE:{configurable:!0}};b.isNaN=function(t){return Number.isNaN(t)},b.doubleToLongBits=function(t){return t},b.longBitsToDouble=function(t){return t},b.isInfinite=function(t){return!Number.isFinite(t)},w.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(b,w);var x=l((function(){}),"E"),E=l((function(){}),"x"),I=l((function(){}),"N"),S=l((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])}),"t"),N={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};S.prototype.setOrdinate=function(t,e){switch(t){case S.X:this.x=e;break;case S.Y:this.y=e;break;case S.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},S.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!!m.equalsWithTolerance(this.x,e.x,n)&&!!m.equalsWithTolerance(this.y,e.y,n)}},S.prototype.getOrdinate=function(t){switch(t){case S.X:return this.x;case S.Y:return this.y;case S.Z:return this.z}throw new _("Invalid ordinate index: "+t)},S.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||b.isNaN(this.z))&&b.isNaN(t.z)},S.prototype.equals=function(t){return t instanceof S&&this.equals2D(t)},S.prototype.equalInZ=function(t,e){return m.equalsWithTolerance(this.z,t.z,e)},S.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},S.prototype.clone=function(){},S.prototype.copy=function(){return new S(this)},S.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},S.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)},S.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},S.prototype.hashCode=function(){var t=17;return 37*(t=37*t+S.hashCode(this.x))+S.hashCode(this.y)},S.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},S.prototype.interfaces_=function(){return[x,E,e]},S.prototype.getClass=function(){return S},S.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=b.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},N.DimensionalComparator.get=function(){return M},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return b.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(S,N);var M=l((function(t){if(this._dimensionsToTest=2,0!==arguments.length&&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}}),"L");M.prototype.compare=function(t,e){var n=t,r=e,i=M.compare(n.x,r.x);if(0!==i)return i;var o=M.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:M.compare(n.z,r.z)},M.prototype.interfaces_=function(){return[I]},M.prototype.getClass=function(){return M},M.compare=function(t,e){return t<e?-1:t>e?1:b.isNaN(t)?b.isNaN(e)?0:-1:b.isNaN(e)?1:0};var C=l((function(){}),"b");C.prototype.create=function(){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C};var O=l((function(){}),"w"),P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new _("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(O,P);var A=l((function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),"T"),D=l((function(){}),"R"),T={LOG_10:{configurable:!0}};D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.log10=function(t){var e=Math.log(t);return b.isInfinite(e)||b.isNaN(e)?e:e/D.LOG_10},D.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},D.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],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},D.wrap=function(t,e){return t<0?e- -t%e:t%e},D.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],l=i;return o>l&&(l=o),s>l&&(l=s),a>l&&(l=a),l}},D.average=function(t,e){return(t+e)/2},T.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(D,T);var L=l((function(t){this.str=t}),"D");L.prototype.append=function(t){this.str+=t},L.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},L.prototype.toString=function(t){return this.str};var R=l((function(t){this.value=t}),"M");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 F=l((function(){}),"A");F.isWhitespace=function(t){return t<=32&&t>=0||127===t},F.toUpperCase=function(t){return t.toUpperCase()};var k=l((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 if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}),"t"),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),i=k.TEN.pow(r);(n=n.divide(i)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var o=r+1,s=new L,a=k.MAX_PRINT_DIGITS-1,l=0;l<=a;l++){t&&l===o&&s.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,h=0;u>9?(c=!0,h="9"):h="0"+u,s.append(h),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var p=!0,f=k.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-l&&(p=!1),!p)break}return e[0]=r,s.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],i=null,o=null,s=null,a=null,l=null,u=null,c=null,h=null;return l=this._hi/n,h=(i=(u=k.SPLIT*l)-(i=u-l))*(s=(h=k.SPLIT*n)-(s=h-n))-(c=l*n)+i*(a=n-s)+(o=l-i)*s+o*a,h=l+(u=(this._hi-c-h+this._lo-l*r)/n),this._hi=h,this._lo=l-h+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,i=null,o=null,s=null,a=null,l=null;return n=(o=this._hi/t._hi)-(e=(s=k.SPLIT*o)-(e=s-o)),l=e*(r=(l=k.SPLIT*t._hi)-(r=l-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-l+this._lo-o*t._lo)/t._hi,new k(l=o+s,o-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return b.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,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var l=arguments[0],u=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,y=null;f=this._hi+l,h=this._lo+u,d=f-(g=f-this._hi),p=h-(y=h-this._lo);var v=(c=f+(g=(d=l-g+(this._hi-d))+h))+(g=(p=u-y+(this._lo-p))+(g+(f-c))),m=g+(c-v);return this._hi=v,this._lo=m,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],i=null,o=null,s=null,a=null,l=null,u=null;i=(l=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,i=l-i,o=this._hi-i,s=u-n;var c=(l=this._hi*n)+(u=i*(s=u-s)-l+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=u+(i=l-c);return this._hi=c,this._lo=h,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 b.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return b.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,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+k.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},k.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=k.SPLIT*n)-(i=s-n)),o=(a=k.SPLIT*this._hi)-this._hi;var l=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new k(l,n-l+s)},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 i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+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,x,E]},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]){var e=arguments[0];return new k(e)}},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;F.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new k,s=0,a=0,l=0;!(e>=n);){var u=t.charAt(e);if(e++,F.isDigit(u)){var c=u-"0";o.selfMultiply(k.TEN),o.selfAdd(c),s++}else{if("."!==u){if("e"===u||"E"===u){var h=t.substring(e);try{l=R.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-l;if(0===f)p=o;else if(f>0){var d=k.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=k.TEN.pow(-f);p=o.multiply(g)}return r?p.negate():p},k.createNaN=function(){return new k(b.NaN,b.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 L,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(b.NaN,b.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 j=l((function(){}),"q"),G={DP_SAFE_EPSILON:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(t,e,n){var r=j.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=k.valueOf(e.x).selfAdd(-t.x),o=k.valueOf(e.y).selfAdd(-t.y),s=k.valueOf(n.x).selfAdd(-e.x),a=k.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},j.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},j.intersection=function(t,e,n,r){var i=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),o=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),l=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=a.subtract(l).selfDivide(s).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),h=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),p=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),d=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new S(c,d)},j.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return j.signum(s);r=i+o}else{if(!(i<0)||o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,G);var z=l((function(){}),"V"),U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},z.prototype.setOrdinate=function(t,e,n){},z.prototype.size=function(){},z.prototype.getOrdinate=function(t,e){},z.prototype.getCoordinate=function(){},z.prototype.getCoordinateCopy=function(t){},z.prototype.getDimension=function(){},z.prototype.getX=function(t){},z.prototype.clone=function(){},z.prototype.expandEnvelope=function(t){},z.prototype.copy=function(){},z.prototype.getY=function(t){},z.prototype.toCoordinateArray=function(){},z.prototype.interfaces_=function(){return[E]},z.prototype.getClass=function(){return z},Object.defineProperties(z,U);var q=l((function(){}),"z"),V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return l(e,"e"),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}(q),Y=l((function(){}),"Y");Y.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},Y.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=l((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 i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof S&&arguments[1]instanceof S){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2];this.x=l,this.y=u,this.w=c}else if(4===arguments.length){var h=arguments[0],p=arguments[1],f=arguments[2],d=arguments[3],g=h.y-p.y,y=p.x-h.x,v=h.x*p.y-p.x*h.y,m=f.y-d.y,_=d.x-f.x,b=f.x*d.y-d.x*f.y;this.x=y*b-_*v,this.y=m*v-g*b,this.w=g*_-m*y}}),"t");X.prototype.getY=function(){var t=this.y/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},X.prototype.getX=function(){var t=this.x/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},X.prototype.getCoordinate=function(){var t=new S;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,l=r.x-n.x,u=n.x*r.y-r.x*n.y,c=i*l-a*o,h=(o*u-l*s)/c,p=(a*s-i*u)/c;if(b.isNaN(h)||b.isInfinite(h)||b.isNaN(p)||b.isInfinite(p))throw new V;return new S(h,p)};var W=l((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 S){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],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3];this.init(o,s,a,l)}}),"t"),J={serialVersionUID:{configurable:!0}};W.prototype.getArea=function(){return this.getWidth()*this.getHeight()},W.prototype.equals=function(t){if(!(t instanceof W))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()},W.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new W;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,i=this._maxy<t._maxy?this._maxy:t._maxy;return new W(e,r,n,i)},W.prototype.isNull=function(){return this._maxx<this._minx},W.prototype.getMaxX=function(){return this._maxx},W.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof W){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}},W.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof W){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 S){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)}},W.prototype.getMinY=function(){return this._miny},W.prototype.getMinX=function(){return this._minx},W.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof W){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))}},W.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},W.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},W.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},W.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},W.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},W.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},W.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},W.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},W.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()}},W.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof W){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof S){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)}},W.prototype.centre=function(){return this.isNull()?null:new S((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},W.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof W){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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},W.prototype.getMaxY=function(){return this._maxy},W.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)},W.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+S.hashCode(this._minx))+S.hashCode(this._maxx))+S.hashCode(this._miny))+S.hashCode(this._maxy)},W.prototype.interfaces_=function(){return[x,e]},W.prototype.getClass=function(){return W},W.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],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),l=Math.max(o.x,s.x),u=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u>l||c<a||(a=Math.min(o.y,s.y),l=Math.max(o.y,s.y),u=Math.min(r.y,i.y),c=Math.max(r.y,i.y),u>l||c<a))}},J.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,J);var H={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*$/},Z=l((function(t){this.geometryFactory=t||new me}),"K");Z.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],$[n]&&(e=$[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Z.prototype.write=function(t){return this.extractGeometry(t)},Z.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"};var K={coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.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(K.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(K.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("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+K.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("("+K.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(",")}},$={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new S(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=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(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=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(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(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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,i,o=t.trim().split(H.parenComma),s=[],a=0,l=o.length;a<l;++a)e=o[a].replace(H.trimParens,"$1"),n=$.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Q=l((function(t){this.parser=new Z(t)}),"Z");Q.prototype.write=function(t){return this.parser.write(t)},Q.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var tt=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),et=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 l(e,"e"),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}(tt),nt=l((function(){}),"et");nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.shouldNeverReachHere=function(){if(0===arguments.length)nt.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new et("Should never reach here"+(null!==t?": "+t:""))}},nt.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],nt.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new et:new et(e)},nt.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],nt.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new et("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var rt=l((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 S,this._intPt[1]=new S,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}),"nt"),it={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};rt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},rt.prototype.getTopologySummary=function(){var t=new L;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},rt.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)},rt.prototype.getIntersectionNum=function(){return this._result},rt.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)}},rt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},rt.prototype.setPrecisionModel=function(t){this._precisionModel=t},rt.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}},rt.prototype.getIntersection=function(t){return this._intPt[t]},rt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},rt.prototype.hasIntersection=function(){return this._result!==rt.NO_INTERSECTION},rt.prototype.getEdgeDistance=function(t,e){return rt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},rt.prototype.isCollinear=function(){return this._result===rt.COLLINEAR_INTERSECTION},rt.prototype.toString=function(){return Q.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Q.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},rt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},rt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},rt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return nt.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},rt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return nt.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},it.DONT_INTERSECT.get=function(){return 0},it.DO_INTERSECT.get=function(){return 1},it.COLLINEAR.get=function(){return 2},it.NO_INTERSECTION.get=function(){return 0},it.POINT_INTERSECTION.get=function(){return 1},it.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(rt,it);var ot=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new W(this._inputLines[0][0],this._inputLines[0][1]),n=new W(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,W.intersects(n,r,e)&&0===lt.orientationIndex(n,r,e)&&0===lt.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,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof V))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new S(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=j.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);Y.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&Y.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new S(t),o=new S(e),s=new S(n),a=new S(r),l=new S;this.normalizeToEnvCentre(i,o,s,a,l);var u=this.safeHCoordinateIntersection(i,o,s,a);return u.x+=l.x,u.y+=l.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=W.intersects(e,n,r),s=W.intersects(e,n,i),a=W.intersects(r,i,e),l=W.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&l?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&l?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,l=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,h=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>u?o:u)+(a<h?a:h))/2,d=((s>c?s:c)+(l<p?l:p))/2;i.x=f,i.y=d,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!W.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=lt.orientationIndex(e,n,r),s=lt.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=lt.orientationIndex(r,i,e),l=lt.orientationIndex(r,i,n);return a>0&&l>0||a<0&&l<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===l?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===l?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new S(r):0===s?this._intPt[0]=new S(i):0===a?this._intPt[0]=new S(e):0===l&&(this._intPt[0]=new S(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=lt.distancePointLine(t,n,r),s=lt.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=lt.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=lt.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(rt),st=l((function(){}),"ot");st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return st.signOfDet2x2(r,i,o,s)},st.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0&&t<=n))return i}else{if(n>0||!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n||(t-=(s=Math.floor(t/n))*n,(e-=s*r)<0))return i;if(e>r)return-i;if(n>t+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=l((function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}),"st");at.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 i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,l=st.signOfDet2x2(i,o,s,a);if(0===l)return this._isPointOnSegment=!0,null;a<o&&(l=-l),l>0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2==1?O.INTERIOR:O.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof S&&A(arguments[1],z)){for(var t=arguments[0],e=arguments[1],n=new at(t),r=new S,i=new S,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof S&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],l=new at(s),u=1;u<a.length;u++){var c=a[u],h=a[u-1];if(l.countSegment(c,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var lt=l((function(){}),"at"),ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},lt.orientationIndex=function(t,e,n){return j.orientationIndex(t,e,n)},lt.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 i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(A(arguments[0],z)){var s=arguments[0],a=s.size();if(a<3)return 0;var l=new S,u=new S,c=new S;s.getCoordinate(0,u),s.getCoordinate(1,c);var h=u.x;c.x-=h;for(var p=0,f=1;f<a-1;f++)l.y=u.y,u.x=c.x,u.y=c.y,s.getCoordinate(f+1,c),c.x-=h,p+=u.x*(l.y-c.y);return p/2}},lt.distanceLineLine=function(t,e,n,r){if(t.equals(e))return lt.distancePointLine(t,n,r);if(n.equals(r))return lt.distancePointLine(r,t,e);var i=!1;if(W.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,l=s/o;(l<0||l>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?D.min(lt.distancePointLine(t,n,r),lt.distancePointLine(e,n,r),lt.distancePointLine(n,t,e),lt.distancePointLine(r,t,e)):0},lt.isPointInRing=function(t,e){return lt.locatePointInRing(t,e)!==O.EXTERIOR},lt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new S;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,l=r.y,u=a-i,c=l-o;n+=Math.sqrt(u*u+c*c),i=a,o=l}return n},lt.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,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var l=t[s],u=t[a];if(l.equals2D(n)||u.equals2D(n)||l.equals2D(u))return!1;var c=lt.computeOrientation(l,n,u);return 0===c?l.x>u.x:c>0},lt.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},lt.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},lt.computeOrientation=function(t,e,n){return lt.orientationIndex(t,e,n)},lt.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 i=lt.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var l=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),u=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/l;if(u<=0)return o.distance(s);if(u>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/l;return Math.abs(c)*Math.sqrt(l)}},lt.isOnLine=function(t,e){for(var n=new ot,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return lt.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return lt.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return lt.COLLINEAR},Object.defineProperties(lt,ut);var ct=l((function(){}),"lt");ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var ht=l((function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()}),"ct"),pt={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}};ht.prototype.isGeometryCollection=function(){return this.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION},ht.prototype.getFactory=function(){return this._factory},ht.prototype.getGeometryN=function(t){return this},ht.prototype.getArea=function(){return 0},ht.prototype.isRectangle=function(){return!1},ht.prototype.equals=function(){if(arguments[0]instanceof ht){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ht))return!1;var n=e;return this.equalsExact(n)}},ht.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ht.prototype.geometryChanged=function(){this.apply(ht.geometryChangedFilter)},ht.prototype.geometryChangedAction=function(){this._envelope=null},ht.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ht.prototype.getLength=function(){return 0},ht.prototype.getNumGeometries=function(){return 1},ht.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)}},ht.prototype.getUserData=function(){return this._userData},ht.prototype.getSRID=function(){return this._SRID},ht.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ht.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ht.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ht.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ht.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ht.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new W(this._envelope)},ht.prototype.setSRID=function(t){this._SRID=t},ht.prototype.setUserData=function(t){this._userData=t},ht.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},ht.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ht.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ht.SORTINDEX_MULTIPOINT||this.getSortIndex()===ht.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ht.SORTINDEX_MULTIPOLYGON},ht.prototype.interfaces_=function(){return[E,x,e]},ht.prototype.getClass=function(){return ht},ht.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ht.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},pt.serialVersionUID.get=function(){return 0x799ea46522854c00},pt.SORTINDEX_POINT.get=function(){return 0},pt.SORTINDEX_MULTIPOINT.get=function(){return 1},pt.SORTINDEX_LINESTRING.get=function(){return 2},pt.SORTINDEX_LINEARRING.get=function(){return 3},pt.SORTINDEX_MULTILINESTRING.get=function(){return 4},pt.SORTINDEX_POLYGON.get=function(){return 5},pt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},pt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},pt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ht,pt);var ft=l((function(){}),"ht");ft.interfaces_=function(){return[ct]},ft.filter=function(t){t.geometryChangedAction()};var dt=l((function(){}),"ft");dt.prototype.filter=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var gt=l((function(){}),"gt"),yt={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}};gt.prototype.isInBoundary=function(t){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},yt.Mod2BoundaryNodeRule.get=function(){return vt},yt.EndPointBoundaryNodeRule.get=function(){return mt},yt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},yt.MonoValentEndPointBoundaryNodeRule.get=function(){return bt},yt.MOD2_BOUNDARY_RULE.get=function(){return new vt},yt.ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},yt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},yt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bt},yt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,yt);var vt=l((function(){}),"yt");vt.prototype.isInBoundary=function(t){return t%2==1},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt};var mt=l((function(){}),"_t");mt.prototype.isInBoundary=function(t){return t>0},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt};var _t=l((function(){}),"mt");_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t};var bt=l((function(){}),"vt");bt.prototype.isInBoundary=function(t){return 1===t},bt.prototype.interfaces_=function(){return[gt]},bt.prototype.getClass=function(){return bt};var wt=l((function(){}),"It");wt.prototype.add=function(){},wt.prototype.addAll=function(){},wt.prototype.isEmpty=function(){},wt.prototype.iterator=function(){},wt.prototype.size=function(){},wt.prototype.toArray=function(){},wt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var xt=l((function(){}),"Et");xt.prototype.hasNext=function(){},xt.prototype.next=function(){},xt.prototype.remove=function(){};var Et=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),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}(wt);(r.prototype=new Error).name="NoSuchElementException";var It=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}return l(e,"e"),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,wt]},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 St(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}(Et),St=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return l(e,"e"),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}(xt),Nt=function(t){function e(){if(t.call(this),0!==arguments.length)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)}}l(e,"e"),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[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}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 S&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],l=arguments[1];if(arguments[2])for(var u=0;u<a.length;u++)this.add(a[u],l);else for(var c=a.length-1;c>=0;c--)this.add(a[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0&&(h>0&&this.get(h-1).equals2D(p)||h<f&&this.get(h).equals2D(p)))return null}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],m=1;y>v&&(m=-1);for(var _=y;_!==v;_+=m)this.add(d[_],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new S(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(It),Mt=l((function(){}),"Lt"),Ct={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ct.ForwardComparator.get=function(){return Ot},Ct.BidirectionalComparator.get=function(){return Pt},Ct.coordArrayType.get=function(){return new Array(0).fill(null)},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Mt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Mt.indexOf(r,e)<0)return r}return null},Mt.scroll=function(t,e){var n=Mt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);Y.arraycopy(t,n,r,0,t.length-n),Y.arraycopy(t,0,r,t.length-n,n),Y.arraycopy(r,0,t,0,t.length)},Mt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e||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],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i||r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Mt.intersection=function(t,e){for(var n=new Nt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Mt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Mt.removeRepeatedPoints=function(t){return Mt.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Mt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Mt.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 i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Mt.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 S(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],l=0;l<a;l++)o[s+l]=new S(r[i+l])},Mt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Mt.envelope=function(t){for(var e=new W,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Mt.toCoordinateArray=function(t){return t.toArray(Mt.coordArrayType)},Mt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Mt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Mt.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},Mt.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},Mt.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},Mt.extract=function(t,e,n){e=D.clamp(e,0,t.length);var r=(n=D.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Mt,Ct);var Ot=l((function(){}),"wt");Ot.prototype.compare=function(t,e){return Mt.compare(t,e)},Ot.prototype.interfaces_=function(){return[I]},Ot.prototype.getClass=function(){return Ot};var Pt=l((function(){}),"Ot");Pt.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 i=Mt.compare(n,r);return Mt.isEqualReversed(n,r)?0:i},Pt.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 i=Mt.increasingDirection(n),o=Mt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,l=0;l<n.length;l++){var u=n[s].compareTo(r[a]);if(0!==u)return u;s+=i,a+=o}return 0},Pt.prototype.interfaces_=function(){return[I]},Pt.prototype.getClass=function(){return Pt};var At=l((function(){}),"Tt");At.prototype.get=function(){},At.prototype.put=function(){},At.prototype.size=function(){},At.prototype.values=function(){},At.prototype.entrySet=function(){};var Dt=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(At);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new wt).contains=function(){};var Tt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}return l(e,"e"),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 Lt(this)},e}(o),Lt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return l(e,"e"),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 i},e}(xt),Rt=0;(p.prototype=new Dt).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},p.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,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={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=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===c(a(a(t)))){var e=h(a(a(t)));1===s(e)?(u(a(t),Rt),u(e,Rt),u(a(a(t)),1),t=a(a(t))):(t===h(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Rt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=c(a(a(t)));1===s(n)?(u(a(t),Rt),u(n,Rt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Rt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Rt},p.prototype.values=function(){var t=new It,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new Tt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.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}},p.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}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.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},p.prototype.size=function(){return this.size_};var Ft=l((function(){}),"At");Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},f.prototype=new o,(d.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},d.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},d.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},d.prototype.remove=function(t){throw new i},d.prototype.size=function(){return this.array_.length},d.prototype.isEmpty=function(){return 0===this.array_.length},d.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},d.prototype.iterator=function(){return new kt(this)};var kt=l((function(t){this.treeSet_=t,this.position_=0}),"Ft");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 i};var Bt=l((function(){}),"Gt");Bt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=l((function(t,e){return t.compareTo(e)}),"i"),i.sort(r);else if(2===arguments.length)n=arguments[1],r=l((function(t,e){return n.compare(t,e)}),"i"),i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=l((function(t,e){return n.compare(t,e)}),"i"),e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Bt.asList=function(t){for(var e=new It,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var jt=l((function(){}),"qt"),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"},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toDimensionSymbol=function(t){switch(t){case jt.FALSE:return jt.SYM_FALSE;case jt.TRUE:return jt.SYM_TRUE;case jt.DONTCARE:return jt.SYM_DONTCARE;case jt.P:return jt.SYM_P;case jt.L:return jt.SYM_L;case jt.A:return jt.SYM_A}throw new _("Unknown dimension value: "+t)},jt.toDimensionValue=function(t){switch(F.toUpperCase(t)){case jt.SYM_FALSE:return jt.FALSE;case jt.SYM_TRUE:return jt.TRUE;case jt.SYM_DONTCARE:return jt.DONTCARE;case jt.SYM_P:return jt.P;case jt.SYM_L:return jt.L;case jt.SYM_A:return jt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(jt,Gt);var zt=l((function(){}),"Vt");zt.prototype.filter=function(t){},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Ut=l((function(){}),"Ut");Ut.prototype.filter=function(t,e){},Ut.prototype.isDone=function(){},Ut.prototype.isGeometryChanged=function(){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var qt=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")}l(e,"e"),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 W,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(),i=0;i<r.length;i++)t[++e]=r[i];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 i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],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=jt.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=jt.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 d(Bt.asList(this._geometries)),n=new d(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,s=this.getNumGeometries(),a=o.getNumGeometries(),l=0;l<s&&l<a;){var u=this.getGeometryN(l),c=o.getGeometryN(l),h=u.compareToSameClass(c,i);if(0!==h)return h;l++}return l<s?1:l<a?-1:0}},e.prototype.apply=function(){if(A(arguments[0],dt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(A(arguments[0],Ut)){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(A(arguments[0],zt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(A(arguments[0],ct)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),nt.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}(ht),Vt=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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()?jt.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 Yt(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[Ft]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(qt),Yt=l((function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=gt.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}}),"Yt");Yt.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)},Yt.prototype.getBoundary=function(){return this._geom instanceof Zt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Yt.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()])},Yt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Yt.prototype.computeBoundaryCoordinates=function(t){var e=new It;this._endpointMap=new p;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 i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Mt.toCoordinateArray(e)},Yt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new Yt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Yt(e,n).getBoundary()}};var Xt=l((function(){this.count=null}),"kt");Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var Wt=l((function(){}),"jt"),Jt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Wt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Wt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Wt.NEWLINE}catch(t){if(!(t instanceof g))throw t;nt.shouldNeverReachHere()}return o}},Wt.split=function(t,e){for(var n=e.length,r=new It,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),l=0;l<a.length;l++)a[l]=r.get(l);return a},Wt.toString=function(){if(1===arguments.length){var t=arguments[0];return Wt.SIMPLE_ORDINATE_FORMAT.format(t)}},Wt.spaces=function(t){return Wt.chars(" ",t)},Jt.NEWLINE.get=function(){return Y.getProperty("line.separator")},Jt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Wt,Jt);var Ht=l((function(){}),"Wt");Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,z.X)===t.getOrdinate(e-1,z.X)&&t.getOrdinate(0,z.Y)===t.getOrdinate(e-1,z.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||b.isNaN(s)&&b.isNaN(a)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new L;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Wt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,z.X)===e.getOrdinate(n-1,z.X)&&e.getOrdinate(0,z.Y)===e.getOrdinate(n-1,z.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Zt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}l(e,"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 W:this._points.expandEnvelope(new W)},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 i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),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&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.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 lt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.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 i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(A(arguments[0],dt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(A(arguments[0],Ut)){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(A(arguments[0],zt)||A(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Yt(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[Ft]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ht),Kt=l((function(){}),"Jt");Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var $t=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}l(e,"e"),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 W;var t=new W;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 jt.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(A(arguments[0],dt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(A(arguments[0],Ut)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(A(arguments[0],zt)||A(arguments[0],ct))&&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([])),nt.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ht),Qt=l((function(){}),"Zt");Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var te=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}l(e,"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._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 i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(lt.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(lt.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing()||null===this._shell||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 i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var l=t.getX(a),u=t.getY(a);if(l!==o==(u!==s))return!1;o=l,s=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,i=this._shell,o=r._shell;if(!i.equalsExact(o,n)||this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],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);Y.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Mt.minCoordinate(e.getCoordinates());Mt.scroll(r,i),Y.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],lt.isCCW(e.getCoordinates())===n&&Mt.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[0],i=arguments[1],o=r,s=this._shell,a=o._shell,l=s.compareToSameClass(a,i);if(0!==l)return l;for(var u=this.getNumInteriorRing(),c=o.getNumInteriorRing(),h=0;h<u&&h<c;){var p=this.getInteriorRingN(h),f=o.getInteriorRingN(h),d=p.compareToSameClass(f,i);if(0!==d)return d;h++}return h<u?1:h<c?-1:0}},e.prototype.apply=function(t){if(A(t,dt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(A(t,Ut)){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(A(t,zt))t.filter(this);else if(A(t,ct)){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[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ht),ee=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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 jt.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[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(qt),ne=function(t){function e(e,n){e instanceof S&&n instanceof me&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}l(e,"e"),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 ht.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.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}(Zt),re=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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 It,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 i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},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[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(qt),ie=l((function(t){this._factory=t||null,this._isUserDataCopied=!1}),"ie"),oe={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};ie.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},ie.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},ie.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof qt?this.editGeometryCollection(t,e):t instanceof te?this.editPolygon(t,e):t instanceof $t||t instanceof Zt?e.edit(t,this._factory):(nt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},ie.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new It,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===ee?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===re?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},ie.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 i=new It,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.GeometryEditorOperation=function(){},oe.NoOpGeometryOperation.get=function(){return se},oe.CoordinateOperation.get=function(){return ae},oe.CoordinateSequenceOperation.get=function(){return le},Object.defineProperties(ie,oe);var se=l((function(){}),"oe");se.prototype.edit=function(t,e){return t},se.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=l((function(){}),"se");ae.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ne?e.createLinearRing(n):t instanceof Zt?e.createLineString(n):t instanceof $t?n.length>0?e.createPoint(n[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var le=l((function(){}),"ae");le.prototype.edit=function(t,e){return t instanceof ne?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},le.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},le.prototype.getClass=function(){return le};var ue=l((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 S}else if(A(arguments[0],z)){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 i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var l=0;l<s;l++)this._coordinates[l]=new S}}),"ue"),ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case z.X:this._coordinates[t].x=n;break;case z.Y:this._coordinates[t].y=n;break;case z.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case z.X:return this._coordinates[t].x;case z.Y:return this._coordinates[t].y;case z.Z:return this._coordinates[t].z}return b.NaN},ue.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}},ue.prototype.getCoordinateCopy=function(t){return new S(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.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 ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.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 ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new L(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"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[z,e]},ue.prototype.getClass=function(){return ue},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,ce);var he=l((function(){}),"ce"),pe={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};he.prototype.readResolve=function(){return he.instance()},he.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ue(t)}if(A(arguments[0],z)){var e=arguments[0];return new ue(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new ue(n):new ue(n,r)}},he.prototype.interfaces_=function(){return[C,e]},he.prototype.getClass=function(){return he},he.instance=function(){return he.instanceObject},pe.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pe.instanceObject.get=function(){return new he},Object.defineProperties(he,pe);var fe=function(t){function e(){t.call(this),this.map_=new Map}return l(e,"e"),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 It,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 Tt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(At),de=l((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 ye){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}}),"t"),ge={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};de.prototype.equals=function(t){if(!(t instanceof de))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},de.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new R(n).compareTo(new R(r))},de.prototype.getScale=function(){return this._scale},de.prototype.isFloating=function(){return this._modelType===de.FLOATING||this._modelType===de.FLOATING_SINGLE},de.prototype.getType=function(){return this._modelType},de.prototype.toString=function(){var t="UNKNOWN";return this._modelType===de.FLOATING?t="Floating":this._modelType===de.FLOATING_SINGLE?t="Floating-Single":this._modelType===de.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},de.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return b.isNaN(t)||this._modelType===de.FLOATING_SINGLE?t:this._modelType===de.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof S){var e=arguments[0];if(this._modelType===de.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},de.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===de.FLOATING?t=16:this._modelType===de.FLOATING_SINGLE?t=6:this._modelType===de.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},de.prototype.setScale=function(t){this._scale=Math.abs(t)},de.prototype.interfaces_=function(){return[e,x]},de.prototype.getClass=function(){return de},de.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ge.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ge.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(de,ge);var ye=l((function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),"t"),ve={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ye.prototype.readResolve=function(){return ye.nameToTypeMap.get(this._name)},ye.prototype.toString=function(){return this._name},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ve.serialVersionUID.get=function(){return-552860263173159e4},ve.nameToTypeMap.get=function(){return new fe},Object.defineProperties(ye,ve),de.Type=ye,de.FIXED=new ye("FIXED"),de.FLOATING=new ye("FLOATING"),de.FLOATING_SINGLE=new ye("FLOATING SINGLE");var me=l((function t(){this._precisionModel=new de,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?A(arguments[0],C)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof de&&(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]))}),"t"),_e={serialVersionUID:{configurable:!0}};me.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new S(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new S(t.getMinX(),t.getMinY()),new S(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new S(t.getMinX(),t.getMinY()),new S(t.getMinX(),t.getMaxY()),new S(t.getMaxX(),t.getMaxY()),new S(t.getMaxX(),t.getMinY()),new S(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Zt(this.getCoordinateSequenceFactory().create(t),this):A(t,z)?new Zt(t,this):void 0:new Zt(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){if(0===arguments.length)return new Vt(null,this);if(1===arguments.length){var t=arguments[0];return new Vt(t,this)}},me.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(me.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof te)return this.createMultiPolygon(me.toPolygonArray(t));if(a instanceof Zt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof $t)return this.createMultiPoint(me.toPointArray(t));nt.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(A(arguments[0],z)){var e=arguments[0];return new $t(e,this)}}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new te(null,null,this);if(1===arguments.length){if(A(arguments[0],z)){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 ne){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new te(r,i,this)}},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){if(0===arguments.length)return new qt(null,this);if(1===arguments.length){var t=arguments[0];return new qt(t,this)}},me.prototype.createGeometry=function(t){return new ie(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.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(A(arguments[0],z)){var e=arguments[0];return new ne(e,this)}}},me.prototype.createMultiPolygon=function(){if(0===arguments.length)return new re(null,this);if(1===arguments.length){var t=arguments[0];return new re(t,this)}},me.prototype.createMultiPoint=function(){if(0===arguments.length)return new ee(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ee(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(A(arguments[0],z)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Ht.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},me.getDefaultCoordinateSequenceFactory=function(){return he.instance()},me.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(me,_e);var be=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],we=l((function(t){this.geometryFactory=t||new me}),"Ie");we.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!xe[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==be.indexOf(n)?xe[n].apply(this,[e.coordinates]):"GeometryCollection"===n?xe[n].apply(this,[e.geometries]):xe[n].apply(this,[e])},we.prototype.write=function(t){var e=t.getGeometryType();if(!Ee[e])throw new Error("Geometry is not supported");return Ee[e].apply(this,[t])};var xe={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!xe[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=xe.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 S(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new S(t[0],t[1]),new S(t[2],t[1]),new S(t[2],t[3]),new S(t[0],t[3]),new S(t[0],t[1])])},Point:function(t){var e=new S(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=xe.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=xe.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=xe.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(xe.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)}},Ee={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:Ee.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(Ee.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=Ee.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=Ee.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(Ee[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ie=l((function(t){this.geometryFactory=t||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new we(this.geometryFactory)}),"Ne");Ie.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===de.FIXED&&this.reducePrecision(e),e},Ie.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 Se=l((function(){this.parser=new we(this.geometryFactory)}),"Ce");Se.prototype.write=function(t){return this.parser.write(t)};var Ne=l((function(){}),"Se"),Me={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.opposite=function(t){return t===Ne.LEFT?Ne.RIGHT:t===Ne.RIGHT?Ne.LEFT:t},Me.ON.get=function(){return 0},Me.LEFT.get=function(){return 1},Me.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Me),(y.prototype=new Error).name="EmptyStackException",(v.prototype=new Et).add=function(t){return this.array_.push(t),!0},v.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},v.prototype.push=function(t){return this.array_.push(t),t},v.prototype.pop=function(t){if(0===this.array_.length)throw new y;return this.array_.pop()},v.prototype.peek=function(){if(0===this.array_.length)throw new y;return this.array_[this.array_.length-1]},v.prototype.empty=function(){return 0===this.array_.length},v.prototype.isEmpty=function(){return this.empty()},v.prototype.search=function(t){return this.array_.indexOf(t)},v.prototype.size=function(){return this.array_.length},v.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ce=l((function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),"be");Ce.prototype.getCoordinate=function(){return this._minCoord},Ce.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},Ce.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();nt.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=lt.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===lt.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===lt.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ce.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length||n[e].y===n[e+1].y)return-1;var r=Ne.LEFT;return n[e].y<n[e+1].y&&(r=Ne.RIGHT),r},Ce.prototype.getEdge=function(){return this._orientedDe},Ce.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])},Ce.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)},Ce.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}nt.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)===Ne.LEFT&&(this._orientedDe=this._minDe.getSym())},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Oe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new S(r):null,this.name="TopologyException"}return l(e,"e"),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}(tt),Pe=l((function(){this.array_=[]}),"Oe");Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length};var Ae=l((function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Ce}),"Te");Ae.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ae.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ae.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 Oe("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ae.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ae.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ae.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ne.RIGHT)>=1&&e.getDepth(Ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ae.prototype.computeDepths=function(t){var e=new Tt,n=new Pe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Ae.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ae.prototype.getEnvelope=function(){if(null===this._env){for(var t=new W,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},Ae.prototype.addReachable=function(t){var e=new v;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Ae.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Ae.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 i=r.getSym().getNode();i.isVisited()||e.push(i)}},Ae.prototype.getNodes=function(){return this._nodes},Ae.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ae.prototype.interfaces_=function(){return[x]},Ae.prototype.getClass=function(){return Ae};var De=l((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[Ne.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Ne.ON]=o,this.location[Ne.LEFT]=s,this.location[Ne.RIGHT]=a}}),"t");De.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},De.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},De.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},De.prototype.isLine=function(){return 1===this.location.length},De.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ne.ON]=this.location[Ne.ON],e[Ne.LEFT]=O.NONE,e[Ne.RIGHT]=O.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===O.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},De.prototype.getLocations=function(){return this.location},De.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ne.LEFT];this.location[Ne.LEFT]=this.location[Ne.RIGHT],this.location[Ne.RIGHT]=t},De.prototype.toString=function(){var t=new L;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.LEFT])),t.append(O.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},De.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},De.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},De.prototype.isArea=function(){return this.location.length>1},De.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},De.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ne.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},De.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},De.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},De.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Te=l((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 De(e),this.elt[1]=new De(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new De(n.elt[0]),this.elt[1]=new De(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new De(O.NONE),this.elt[1]=new De(O.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new De(o,s,a),this.elt[1]=new De(o,s,a)}else if(4===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new De(O.NONE,O.NONE,O.NONE),this.elt[1]=new De(O.NONE,O.NONE,O.NONE),this.elt[l].setLocations(u,c,h)}}),"t");Te.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Te.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Te.prototype.isNull=function(t){return this.elt[t].isNull()},Te.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)}},Te.prototype.isLine=function(t){return this.elt[t].isLine()},Te.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new De(t.elt[e]):this.elt[e].merge(t.elt[e])},Te.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Te.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ne.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Te.prototype.toString=function(){var t=new L;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()},Te.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()}},Te.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Te.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ne.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Te.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Te.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Te.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new De(this.elt[t].location[0]))},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.toLineLabel=function(t){for(var e=new Te(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Le=l((function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new It,this._pts=new It,this._label=new Te(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new It,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}),"De");Le.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=lt.isCCW(this._ring.getCoordinates())},Le.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Le.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Oe("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Oe("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();nt.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)},Le.prototype.getLinearRing=function(){return this._ring},Le.prototype.getCoordinate=function(t){return this._pts.get(t)},Le.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},Le.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Le.prototype.isHole=function(){return this._isHole},Le.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Le.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!lt.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Le.prototype.addHole=function(t){this._holes.add(t)},Le.prototype.isShell=function(){return null===this._shell},Le.prototype.getLabel=function(){return this._label},Le.prototype.getEdges=function(){return this._edges},Le.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Le.prototype.getShell=function(){return this._shell},Le.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[0],n=arguments[1],r=e.getLocation(n,Ne.RIGHT);if(r===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,r),null}},Le.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Le.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)},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le};var Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return l(e,"e"),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}(Le),Fe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new It,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}(Le),ke=l((function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0!==arguments.length&&1===arguments.length){var t=arguments[0];this._label=t}}),"Fe");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){nt.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 Te(0,O.NONE)}return l(e,"e"),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=O.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==O.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 Te(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 Te)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===O.NONE&&this._label.setLocation(r,i)}},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=O.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case O.BOUNDARY:n=O.INTERIOR;break;case O.INTERIOR:default:n=O.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),je=l((function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}),"qe");je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof S){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)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new It,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===O.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Ge=l((function(){}),"Be"),ze={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&&(t-e+4)%4==2},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if((t-e+4)%4==2)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 S&&arguments[1]instanceof S){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}},ze.NE.get=function(){return 0},ze.NW.get=function(){return 1},ze.SW.get=function(){return 2},ze.SE.get=function(){return 3},Object.defineProperties(Ge,ze);var Ue=l((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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}}),"Ue");Ue.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:lt.computeOrientation(t._p0,t._p1,this._p1)},Ue.prototype.getDy=function(){return this._dy},Ue.prototype.getCoordinate=function(){return this._p0},Ue.prototype.setNode=function(t){this._node=t},Ue.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Ue.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ue.prototype.getDirectedCoordinate=function(){return this._p1},Ue.prototype.getDx=function(){return this._dx},Ue.prototype.getLabel=function(){return this._label},Ue.prototype.getEdge=function(){return this._edge},Ue.prototype.getQuadrant=function(){return this._quadrant},Ue.prototype.getNode=function(){return this._node},Ue.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},Ue.prototype.computeLabel=function(t){},Ue.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),nt.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ue.prototype.interfaces_=function(){return[x]},Ue.prototype.getClass=function(){return Ue};var qe=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 l(e,"e"),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 Te(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 Oe("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,Ne.LEFT)===O.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===O.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[Ne.LEFT]+"/"+this._depth[Ne.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,O.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.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===Ne.LEFT&&(r=-1);var i=Ne.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},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===O.EXTERIOR&&e===O.INTERIOR?1:t===O.INTERIOR&&e===O.EXTERIOR?-1:0},e}(Ue),Ve=l((function(){}),"Xe");Ve.prototype.createNode=function(t){return new Be(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var Ye=l((function(){if(this._edges=new It,this._nodes=null,this._edgeEndList=new It,0===arguments.length)this._nodes=new je(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new je(t)}}),"Ye");Ye.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)}},Ye.prototype.find=function(t){return this._nodes.find(t)},Ye.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof S){var e=arguments[0];return this._nodes.addNode(e)}},Ye.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ye.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ye.prototype.debugPrintln=function(t){Y.out.println(t)},Ye.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)===O.BOUNDARY},Ye.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ye.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&<.computeOrientation(t,e,r)===lt.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},Ye.prototype.getEdgeEnds=function(){return this._edgeEndList},Ye.prototype.debugPrint=function(t){Y.out.print(t)},Ye.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ye.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1])||this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ye.prototype.insertEdge=function(t){this._edges.add(t)},Ye.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ye.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new qe(n,!0),i=new qe(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ye.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ye.prototype.getNodes=function(){return this._nodes.values()},Ye.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=l((function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),"ke");Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Oe("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new It,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Fe(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&<.isPointInRing(i,u.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=l)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return nt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.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];Ye.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new It,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var We=l((function(){}),"je");We.prototype.getBounds=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Je=l((function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),"He");Je.prototype.getItem=function(){return this._item},Je.prototype.getBounds=function(){return this._bounds},Je.prototype.interfaces_=function(){return[We,e]},Je.prototype.getClass=function(){return Je};var He=l((function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),"We");He.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},He.prototype.size=function(){return this._size},He.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)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.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)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ze=l((function(){}),"Ke");Ze.prototype.visitItem=function(t){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ke=l((function(){}),"Je");Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var $e=l((function(){if(this._childBoundables=new It,this._bounds=null,this._level=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];this._level=t}}),"Qe"),Qe={serialVersionUID:{configurable:!0}};$e.prototype.getLevel=function(){return this._level},$e.prototype.size=function(){return this._childBoundables.size()},$e.prototype.getChildBoundables=function(){return this._childBoundables},$e.prototype.addChildBoundable=function(t){nt.isTrue(null===this._bounds),this._childBoundables.add(t)},$e.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},$e.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},$e.prototype.interfaces_=function(){return[We,e]},$e.prototype.getClass=function(){return $e},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties($e,Qe);var tn=l((function(){}),"$e");tn.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},tn.min=function(t){return tn.sort(t),t.get(0)},tn.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},tn.singletonList=function(t){var e=new It;return e.add(t),e};var en=l((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");en.prototype.expandToQueue=function(t,e){var n=en.isComposite(this._boundable1),r=en.isComposite(this._boundable2);if(n&&r)return en.area(this._boundable1)>en.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")},en.prototype.isLeaves=function(){return!(en.isComposite(this._boundable1)||en.isComposite(this._boundable2))},en.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},en.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new en(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},en.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},en.prototype.getDistance=function(){return this._distance},en.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},en.prototype.interfaces_=function(){return[x]},en.prototype.getClass=function(){return en},en.area=function(t){return t.getBounds().getArea()},en.isComposite=function(t){return t instanceof $e};var nn=l((function t(){if(this._root=null,this._built=!1,this._itemBoundables=new It,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];nt.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}}),"t"),rn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};nn.prototype.getNodeCapacity=function(){return this._nodeCapacity},nn.prototype.lastNode=function(t){return t.get(t.size()-1)},nn.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 $e?t+=this.size(n):n instanceof Je&&(t+=1)}return t}},nn.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Je&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},nn.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new It:t}if(1===arguments.length){for(var e=arguments[0],n=new It,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof $e){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Je?n.add(i.getItem()):nt.shouldNeverReachHere()}return n.size()<=0?null:n}},nn.prototype.insert=function(t,e){nt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Je(t,e))},nn.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new It;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(nt.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof $e?this.boundablesAtLevel(n,s,i):(nt.isTrue(s instanceof Je),-1===n&&i.add(s))}return null}},nn.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new It;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(A(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),l=0;l<a.size();l++){var u=a.get(l);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof $e?this.query(i,u,s):u instanceof Je?s.visitItem(u.getItem()):nt.shouldNeverReachHere())}else if(A(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var c=arguments[0],h=arguments[1],p=arguments[2],f=h.getChildBoundables(),d=0;d<f.size();d++){var g=f.get(d);this.getIntersectsOp().intersects(g.getBounds(),c)&&(g instanceof $e?this.query(c,g,p):g instanceof Je?p.add(g.getItem()):nt.shouldNeverReachHere())}},nn.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},nn.prototype.getRoot=function(){return this.build(),this._root},nn.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],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var l=a.next();if(this.getIntersectsOp().intersects(l.getBounds(),n)&&l instanceof $e&&(o=this.remove(n,l,i))){s=l;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},nn.prototype.createHigherLevels=function(t,e){nt.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},nn.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 $e){var r=this.depth(n);r>t&&(t=r)}}return t+1}},nn.prototype.createParentBoundables=function(t,e){nt.isTrue(!t.isEmpty());var n=new It;n.add(this.createNode(e));var r=new It(t);tn.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},nn.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},nn.prototype.interfaces_=function(){return[e]},nn.prototype.getClass=function(){return nn},nn.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},rn.IntersectsOp.get=function(){return on},rn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},rn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(nn,rn);var on=l((function(){}),"rn"),sn=l((function(){}),"on");sn.prototype.distance=function(t,e){},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn};var an=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}l(n,"n"),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){nt.isTrue(t.length>0);for(var n=new It,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new ln(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),i=t.iterator(),o=0;o<e;o++){r[o]=new It;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}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(A(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(A(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var a=arguments[0],l=arguments[1],u=arguments[2];t.prototype.query.call(this,a,l,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){nt.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new It(t);tn.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(A(arguments[0],sn)){var t=arguments[0],e=new en(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof en){var r=arguments[0];return this.nearestNeighbour(r,b.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&A(arguments[1],sn)){var i=arguments[0],o=arguments[1],s=new en(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof en&&"number"==typeof arguments[1]){var a=arguments[0],l=arguments[1],u=null,c=new He;for(c.add(a);!c.isEmpty()&&l>0;){var h=c.poll(),p=h.getDistance();if(p>=l)break;h.isLeaves()?(l=p,u=h):h.expandToQueue(c,l)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],d=arguments[1],g=arguments[2],y=new Je(f,d),v=new en(this.getRoot(),y,g);return this.nearestNeighbour(v)[0]}},n.prototype.interfaces_=function(){return[Ke,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 ln},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[I]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[I]},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}(nn),ln=function(t){function e(){var e=arguments[0];t.call(this,e)}return l(e,"e"),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 W(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($e),un=l((function(){}),"un");un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return nt.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=l((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 S(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}),"ln");cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[x]},cn.prototype.getClass=function(){return cn};var hn=l((function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t}),"cn");hn.prototype.getSplitCoordinates=function(){var t=new Nt;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()},hn.prototype.addCollapsedNodes=function(){var t=new It;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)}},hn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},hn.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))}},hn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new S(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new S(e.coord))},hn.prototype.iterator=function(){return this._nodeMap.values().iterator()},hn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},hn.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)},hn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new R(e[0])),r=i}},hn.prototype.getEdge=function(){return this._edge},hn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},hn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new S(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new S(e.coord)),new gn(o,this._edge.getData())},hn.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(nt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},hn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new tt("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new tt("bad split edge end point at "+i)},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var pn=l((function(){}),"pn");pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.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 S&&arguments[1]instanceof S){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _("Cannot compute the octant for two identical points "+i);return pn.octant(s,a)}};var fn=l((function(){}),"hn");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 dn=l((function(){}),"fn");dn.prototype.addIntersection=function(t,e){},dn.prototype.interfaces_=function(){return[fn]},dn.prototype.getClass=function(){return dn};var gn=l((function(){this._nodeList=new hn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"gn");gn.prototype.getCoordinates=function(){return this._pts},gn.prototype.size=function(){return this._pts.length},gn.prototype.getCoordinate=function(t){return this._pts[t]},gn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},gn.prototype.setData=function(t){this._data=t},gn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:pn.octant(t,e)},gn.prototype.getData=function(){return this._data},gn.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[0],r=arguments[1],i=arguments[3],o=new S(n.getIntersection(i));this.addIntersection(o,r)}},gn.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},gn.prototype.getNodeList=function(){return this._nodeList},gn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},gn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},gn.prototype.interfaces_=function(){return[dn]},gn.prototype.getClass=function(){return gn},gn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new It;return gn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var yn=l((function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new S,this.p1=new S;else if(1===arguments.length){var t=arguments[0];this.p0=new S(t.p0),this.p1=new S(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],i=arguments[3];this.p0=new S(e,n),this.p1=new S(r,i)}}),"dn"),vn={serialVersionUID:{configurable:!0}};yn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},yn.prototype.orientationIndex=function(){if(arguments[0]instanceof yn){var t=arguments[0],e=lt.orientationIndex(this.p0,this.p1,t.p0),n=lt.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 S){var r=arguments[0];return lt.orientationIndex(this.p0,this.p1,r)}},yn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},yn.prototype.isVertical=function(){return this.p0.x===this.p1.x},yn.prototype.equals=function(t){if(!(t instanceof yn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},yn.prototype.intersection=function(t){var e=new ot;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},yn.prototype.project=function(){if(arguments[0]instanceof S){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new S(t);var e=this.projectionFactor(t),n=new S;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 yn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1||i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new yn(s,a)}},yn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},yn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},yn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},yn.prototype.distancePerpendicular=function(t){return lt.distancePointLinePerpendicular(t,this.p0,this.p1)},yn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},yn.prototype.midPoint=function(){return yn.midPoint(this.p0,this.p1)},yn.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?b.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},yn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=b.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var l=t.closestPoint(this.p1);return(i=l.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=l),n},yn.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},yn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},yn.prototype.getLength=function(){return this.p0.distance(this.p1)},yn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},yn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},yn.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)},yn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},yn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},yn.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),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,l=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,l=e*o/s}return new S(n-l,r+a)},yn.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}},yn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||b.isNaN(e))&&(e=1),e},yn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},yn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},yn.prototype.distance=function(){if(arguments[0]instanceof yn){var t=arguments[0];return lt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof S){var e=arguments[0];return lt.distancePointLine(e,this.p0,this.p1)}},yn.prototype.pointAlong=function(t){var e=new S;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},yn.prototype.hashCode=function(){var t=b.doubleToLongBits(this.p0.x);t^=31*b.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=b.doubleToLongBits(this.p1.x);return n^=31*b.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},yn.prototype.interfaces_=function(){return[x,e]},yn.prototype.getClass=function(){return yn},yn.midPoint=function(t,e){return new S((t.x+e.x)/2,(t.y+e.y)/2)},vn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(yn,vn);var mn=l((function(){this.tempEnv1=new W,this.tempEnv2=new W,this._overlapSeg1=new yn,this._overlapSeg2=new yn}),"_n");mn.prototype.overlap=function(){if(2!==arguments.length&&4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var _n=l((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}),"mn");_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 i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,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 W(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,i,o){var s=this._pts[t],a=this._pts[e],l=n._pts[r],u=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(l,u),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var bn=l((function(){}),"vn");bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},bn.getChainStartIndices=function(t){var e=0,n=new It;n.add(new R(e));do{var r=bn.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return bn.toIntArray(n)},bn.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]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},bn.getChains=function(){if(1===arguments.length){var t=arguments[0];return bn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new It,i=bn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},bn.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 wn=l((function(){}),"In");wn.prototype.computeNodes=function(t){},wn.prototype.getNodedSubstrings=function(){},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var xn=l((function(){if(this._segInt=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}),"En");xn.prototype.setSegmentIntersector=function(t){this._segInt=t},xn.prototype.interfaces_=function(){return[wn]},xn.prototype.getClass=function(){return xn};var En=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new It,this._index=new an,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}l(e,"e"),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 gn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=bn.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 In(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return In},Object.defineProperties(e,n),e}(xn),In=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return l(e,"e"),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[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(mn),Sn=l((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)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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}),"t"),Nn={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}};Sn.prototype.getEndCapStyle=function(){return this._endCapStyle},Sn.prototype.isSingleSided=function(){return this._isSingleSided},Sn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Sn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Sn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Sn.JOIN_ROUND&&(this._quadrantSegments=Sn.DEFAULT_QUADRANT_SEGMENTS)},Sn.prototype.getJoinStyle=function(){return this._joinStyle},Sn.prototype.setJoinStyle=function(t){this._joinStyle=t},Sn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Sn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Sn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Sn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Sn.prototype.getMitreLimit=function(){return this._mitreLimit},Sn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Sn.prototype.setSingleSided=function(t){this._isSingleSided=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Nn.CAP_ROUND.get=function(){return 1},Nn.CAP_FLAT.get=function(){return 2},Nn.CAP_SQUARE.get=function(){return 3},Nn.JOIN_ROUND.get=function(){return 1},Nn.JOIN_MITRE.get=function(){return 2},Nn.JOIN_BEVEL.get=function(){return 3},Nn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Nn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Nn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Sn,Nn);var Mn=l((function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=lt.COUNTERCLOCKWISE,this._inputLine=t||null}),"Ln"),Cn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Mn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Mn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Mn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Mn.prototype.isShallowConcavity=function(t,e,n,r){return lt.computeOrientation(t,e,n)===this._angleOrientation&<.distancePointLine(e,t,n)<r},Mn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Mn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Mn.prototype.isConcave=function(t,e,n){return lt.computeOrientation(t,e,n)===this._angleOrientation},Mn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=lt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Mn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Mn.DELETE;)e++;return e},Mn.prototype.isShallow=function(t,e,n,r){return lt.distancePointLine(e,t,n)<r},Mn.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Mn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.simplify=function(t,e){return new Mn(t).simplify(e)},Cn.INIT.get=function(){return 0},Cn.DELETE.get=function(){return 1},Cn.KEEP.get=function(){return 1},Cn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Mn,Cn);var On=l((function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new It}),"wn"),Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){return this._ptList.toArray(On.COORDINATE_ARRAY_TYPE)},On.prototype.setPrecisionModel=function(t){this._precisionModel=t},On.prototype.addPt=function(t){var e=new S(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},On.prototype.revere=function(){},On.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])},On.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},On.prototype.toString=function(){return(new me).createLineString(this.getCoordinates()).toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new S(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},On.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,Pn);var An=l((function(){}),"Tn"),Dn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.toDegrees=function(t){return 180*t/Math.PI},An.normalize=function(t){for(;t>Math.PI;)t-=An.PI_TIMES_2;for(;t<=-Math.PI;)t+=An.PI_TIMES_2;return t},An.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,i=n.y-e.y;return Math.atan2(i,r)}},An.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},An.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},An.interiorAngle=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n);return Math.abs(i-r)},An.normalizePositive=function(t){if(t<0){for(;t<0;)t+=An.PI_TIMES_2;t>=An.PI_TIMES_2&&(t=0)}else{for(;t>=An.PI_TIMES_2;)t-=An.PI_TIMES_2;t<0&&(t=0)}return t},An.angleBetween=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n);return An.diff(r,i)},An.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},An.toRadians=function(t){return t*Math.PI/180},An.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?An.COUNTERCLOCKWISE:n<0?An.CLOCKWISE:An.NONE},An.angleBetweenOriented=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n)-r;return i<=-Math.PI?i+An.PI_TIMES_2:i>Math.PI?i-An.PI_TIMES_2:i},Dn.PI_TIMES_2.get=function(){return 2*Math.PI},Dn.PI_OVER_2.get=function(){return Math.PI/2},Dn.PI_OVER_4.get=function(){return Math.PI/4},Dn.COUNTERCLOCKWISE.get=function(){return lt.COUNTERCLOCKWISE},Dn.CLOCKWISE.get=function(){return lt.CLOCKWISE},Dn.NONE.get=function(){return lt.COLLINEAR},Object.defineProperties(An,Dn);var Tn=l((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 yn,this._seg1=new yn,this._offset0=new yn,this._offset1=new yn,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 ot,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Sn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}),"t"),Ln={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}};Tn.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=lt.computeOrientation(this._s0,this._s1,this._s2),r=n===lt.CLOCKWISE&&this._side===Ne.LEFT||n===lt.COUNTERCLOCKWISE&&this._side===Ne.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Tn.prototype.addLineEndCap=function(t,e){var n=new yn(t,e),r=new yn;this.computeOffsetSegment(n,Ne.LEFT,this._distance,r);var i=new yn;this.computeOffsetSegment(n,Ne.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,lt.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Sn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Sn.CAP_SQUARE:var l=new S;l.x=Math.abs(this._distance)*Math.cos(a),l.y=Math.abs(this._distance)*Math.sin(a);var u=new S(r.p1.x+l.x,r.p1.y+l.y),c=new S(i.p1.x+l.x,i.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},Tn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Tn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new S(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Tn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),l=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,l);r===lt.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Tn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Tn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Sn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Sn.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))},Tn.prototype.createSquare=function(t){this._segList.addPt(new S(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new S(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Tn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Tn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Tn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Tn.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)},Tn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=An.angle(i,this._seg0.p0),s=An.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=An.normalize(o+s),l=An.normalize(a+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(s)),h=i.x+u*Math.cos(l),p=i.y+u*Math.sin(l),f=new S(h,p),d=new yn(i,f),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Ne.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},Tn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ne.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),l=i*n*o/a,u=i*n*s/a;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+l,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+l},Tn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===lt.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var l=s/a,u=0,c=new S;u<s;){var h=e+o*u;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),u+=l}},Tn.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*Tn.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 S((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 S((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)}},Tn.prototype.createCircle=function(t){var e=new S(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Tn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Tn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Tn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Sn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Sn.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,lt.CLOCKWISE,this._distance))},Tn.prototype.closeRing=function(){this._segList.closeRing()},Tn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Ln.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Ln.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Tn,Ln);var Rn=l((function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}),"Mn");Rn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Mt.reverse(o),o},Rn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Mn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Mn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment(),n.closeRing()},Rn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ne.RIGHT&&(r=-r);var i=Mn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Rn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Mn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ne.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Mn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ne.LEFT);for(var l=a-2;l>=0;l--)e.addNextSegment(s[l],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Rn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:e.createCircle(t);break;case Sn.CAP_SQUARE:e.createSquare(t)}},Rn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||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 i=e<0;this.computeSingleSidedBufferCurve(t,i,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 i=Mn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Mn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment()},Rn.prototype.getSegGen=function(t){return new Tn(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 S(t[n]);return e};var Fn=l((function(){this._subgraphs=null,this._seg=new yn,this._cga=new lt;var t=arguments[0];this._subgraphs=t}),"An"),kn={DepthSegment:{configurable:!0}};Fn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new It,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(A(arguments[2],Et)&&arguments[0]instanceof S&&arguments[1]instanceof qe){for(var o=arguments[0],s=arguments[1],a=arguments[2],l=s.getEdge().getCoordinates(),u=0;u<l.length-1;u++)if(this._seg.p0=l[u],this._seg.p1=l[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||lt.computeOrientation(this._seg.p0,this._seg.p1,o)===lt.RIGHT)){var c=s.getDepth(Ne.LEFT);this._seg.p0.equals(l[u])||(c=s.getDepth(Ne.RIGHT));var h=new Bn(this._seg,c);a.add(h)}}else if(A(arguments[2],Et)&&arguments[0]instanceof S&&A(arguments[1],Et))for(var p=arguments[0],f=arguments[1],d=arguments[2],g=f.iterator();g.hasNext();){var y=g.next();y.isForward()&&this.findStabbedSegments(p,y,d)}},Fn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:tn.min(e)._leftDepth},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Fn,kn);var Bn=l((function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new yn(t),this._leftDepth=e}),"Gn");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[x]},Bn.prototype.getClass=function(){return Bn};var jn=l((function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}),"qn");jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.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)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,l=n.y-o,u=r.y-o,c=s*u-a*l,h=t.x-i,p=t.y-o,f=(u*h-a*p)/c,d=(-l*h+s*p)/c;return e.z+f*(n.z-e.z)+d*(r.z-e.z)},jn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},jn.isAcute=function(t,e,n){return!!An.isAcute(t,e,n)&&!!An.isAcute(e,n,t)&&!!An.isAcute(n,t,e)},jn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,l=e.y-i,u=2*jn.det(o,s,a,l),c=jn.det(s,o*o+s*s,l,a*a+l*l),h=jn.det(o,o*o+s*s,a,a*a+l*l);return new S(r-c/u,i+h/u)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},jn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new S(t.x+i*o,t.y+i*s)},jn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,l=n.z-t.z,u=i*l-o*a,c=o*s-r*l,h=r*a-i*s,p=u*u+c*c+h*h;return Math.sqrt(p)/2},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new S(r,i)},jn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,l=(r*t.y+i*e.y+o*n.y)/s;return new S(a,l)};var Gn=l((function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}),"Bn");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,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ne.LEFT;this._distance<0&&(e=-this._distance,n=Ne.RIGHT);var r=t.getExteriorRing(),i=Mt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance)||this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,O.EXTERIOR,O.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Mt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),O.INTERIOR,O.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return lt.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=Mt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Te(0,O.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,i){if(0===e&&t.length<ne.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ne.MINIMUM_VALID_SIZE&<.isCCW(t)&&(o=i,s=r,n=Ne.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof te?this.addPolygon(t):t instanceof Zt?this.addLineString(t):t instanceof $t?this.addPoint(t):(t instanceof ee||t instanceof Vt||t instanceof re||t instanceof qt)&&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(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},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 zn=l((function(){}),"Vn");zn.prototype.locate=function(t){},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn};var Un=l((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()}),"Un");Un.prototype.next=function(){if(this._atStart)return this._atStart=!1,Un.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 qt?(this._subcollectionIterator=new Un(t),this._subcollectionIterator.next()):t},Un.prototype.remove=function(){throw new Error(this.getClass().getName())},Un.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)},Un.prototype.interfaces_=function(){return[xt]},Un.prototype.getClass=function(){return Un},Un.isAtomic=function(t){return!(t instanceof qt)};var qn=l((function(){this._geom=null;var t=arguments[0];this._geom=t}),"zn");qn.prototype.locate=function(t){return qn.locate(t,this._geom)},qn.prototype.interfaces_=function(){return[zn]},qn.prototype.getClass=function(){return qn},qn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&<.isPointInRing(t,e.getCoordinates())},qn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!qn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(qn.isPointInRing(t,i))return!1}return!0},qn.containsPoint=function(t,e){if(e instanceof te)return qn.containsPointInPolygon(t,e);if(e instanceof qt)for(var n=new Un(e);n.hasNext();){var r=n.next();if(r!==e&&qn.containsPoint(t,r))return!0}return!1},qn.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:qn.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var Vn=l((function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]}),"Xn");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=O.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==O.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===O.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ne.ON)===O.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var l=a.getLocation(t,Ne.LEFT),u=a.getLocation(t,Ne.RIGHT);if(u!==O.NONE){if(u!==i)throw new Oe("side location conflict",s.getCoordinate());l===O.NONE&&nt.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=l}else nt.isTrue(a.getLocation(t,Ne.LEFT)===O.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){Y.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,Ne.LEFT);nt.isTrue(r!==O.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();nt.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ne.LEFT),l=s.getLocation(t,Ne.RIGHT);if(a===l||l!==i)return!1;i=a}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 It(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=qn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new L;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(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===O.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),l=0;l<2;l++)if(a.isAnyNull(l)){var u=O.NONE;if(e[l])u=O.EXTERIOR;else{var c=s.getCoordinate();u=this.getLocation(l,c,t)}a.setAllLocationsIfNull(l,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 Yn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return l(e,"e"),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 i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Oe("no outgoing dirEdge found",this.getCoordinate());nt.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),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(nt.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){Y.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 It;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),i=r.getSym();null===e&&(e=i),null!==t&&i.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(Ne.LEFT),r=t.getDepth(Ne.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Oe("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],l=o;l<s;l++){var u=this._edgeList.get(l);u.setEdgeDepths(Ne.RIGHT,a),a=u.getDepth(Ne.LEFT)}return a}},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,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(nt.isTrue(null!==e,"found null for first outgoing dirEdge"),nt.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,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(r.isInResult()){t=O.EXTERIOR;break}}}if(t===O.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===O.INTERIOR):(s.isInResult()&&(i=O.EXTERIOR),a.isInResult()&&(i=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Te(O.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(i,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Xn=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),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 Yn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Wn=l((function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)}),"t");Wn.prototype.compareTo=function(t){var e=t;return Wn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Wn.prototype.interfaces_=function(){return[x]},Wn.prototype.getClass=function(){return Wn},Wn.orientation=function(t){return 1===Mt.increasingDirection(t)},Wn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,l=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[l].compareTo(n[u]);if(0!==c)return c;var h=(l+=i)===s,p=(u+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Jn=l((function(){this._edges=new It,this._ocaMap=new p}),"Hn");Jn.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(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Jn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Jn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Jn.prototype.iterator=function(){return this._edges.iterator()},Jn.prototype.getEdges=function(){return this._edges},Jn.prototype.get=function(t){return this._edges.get(t)},Jn.prototype.findEqualEdge=function(t){var e=new Wn(t.getCoordinates());return this._ocaMap.get(e)},Jn.prototype.add=function(t){this._edges.add(t);var e=new Wn(t.getCoordinates());this._ocaMap.put(e,t)},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var Hn=l((function(){}),"Wn");Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Zn=l((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}),"Kn");Zn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Zn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Zn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zn.prototype.getLineIntersector=function(){return this._li},Zn.prototype.hasProperIntersection=function(){return this._hasProper},Zn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),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)))},Zn.prototype.hasIntersection=function(){return this._hasIntersection},Zn.prototype.isDone=function(){return!1},Zn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Zn.prototype.interfaces_=function(){return[Hn]},Zn.prototype.getClass=function(){return Zn},Zn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kn=l((function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new S(t),this.segmentIndex=e,this.dist=n}),"Jn");Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[x]},Kn.prototype.getClass=function(){return Kn};var $n=l((function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t}),"Qn");$n.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},$n.prototype.iterator=function(){return this._nodeMap.values().iterator()},$n.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},$n.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)},$n.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new S(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new rr(o,new Te(this.edge._label))},$n.prototype.add=function(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},$n.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Qn=l((function(){}),"Zn");Qn.prototype.getChainStartIndices=function(t){var e=0,n=new It;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 Qn.toIntArray(n)},Qn.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},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},Qn.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 tr=l((function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new W,this.env2=new W;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Qn;this.startIndex=e.getChainStartIndices(this.pts)}),"$n");tr.prototype.getCoordinates=function(){return this.pts},tr.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},tr.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},tr.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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],l=arguments[4],u=arguments[5],c=this.pts[i],h=this.pts[o],p=s.pts[a],f=s.pts[l];if(o-i==1&&l-a==1)return u.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,h),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+l)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,u),g<l&&this.computeIntersectsForChain(i,d,s,g,l,u)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,u),g<l&&this.computeIntersectsForChain(d,o,s,g,l,u))}},tr.prototype.getStartIndexes=function(){return this.startIndex},tr.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)},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var er=l((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}),"t"),nr={NULL_VALUE:{configurable:!0}};er.prototype.getDepth=function(t,e){return this._depth[t][e]},er.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},er.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]!==er.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===er.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===er.NULL_VALUE}},er.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}}},er.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},er.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},er.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},er.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!==O.EXTERIOR&&r!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=er.depthAtLocation(r):this._depth[e][n]+=er.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[i][o]++}},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},er.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:er.NULL_VALUE},nr.NULL_VALUE.get=function(){return-1},Object.defineProperties(er,nr);var rr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new er,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return l(e,"e"),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,Te.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,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)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 tr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new W;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 i=new S(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var l=this.pts[a];i.equals2D(l)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new L;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,Ne.ON),e.getLocation(1,Ne.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ne.LEFT),e.getLocation(1,Ne.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ne.RIGHT),e.getLocation(1,Ne.RIGHT),2))},e}(ke),ir=l((function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Jn,this._bufParams=t||null}),"ii");ir.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ir.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 Te(t.getLabel())).flip(),n.merge(r);var i=ir.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(ir.depthDelta(t.getLabel()))},ir.prototype.buildSubgraphs=function(t,e){for(var n=new It,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Fn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},ir.prototype.createSubgraphs=function(t){for(var e=new It,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Ae;i.create(r),e.add(i)}}return tn.sort(e,tn.reverseOrder()),e},ir.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},ir.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new En,n=new ot;return n.setPrecisionModel(t),e.setSegmentIntersector(new Zn(n)),e},ir.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),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ye(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},ir.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new rr(i.getCoordinates(),new Te(s));this.insertUniqueEdge(a)}}},ir.prototype.setNoder=function(t){this._workingNoder=t},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},ir.convertSegStrings=function(t){for(var e=new me,n=new It;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var or=l((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],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}}),"ri");or.prototype.rescale=function(){if(A(arguments[0],wt))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])&&Y.out.println(n)}},or.prototype.scale=function(){if(A(arguments[0],wt)){for(var t=arguments[0],e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new gn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new S(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Mt.removeRepeatedPoints(o)}},or.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},or.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},or.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},or.prototype.interfaces_=function(){return[wn]},or.prototype.getClass=function(){return or};var sr=l((function(){this._li=new ot,this._segStrings=null;var t=arguments[0];this._segStrings=t}),"oi"),ar={fact:{configurable:!0}};sr.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 i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new tt("found endpt/interior pt intersection at index "+o+" :pt "+n)},sr.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 i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),l=0;l<s.length-1;l++)for(var u=0;u<a.length-1;u++)this.checkInteriorIntersections(i,l,o,u);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var d=c.getCoordinates()[h],g=c.getCoordinates()[h+1],y=p.getCoordinates()[f],v=p.getCoordinates()[f+1];if(this._li.computeIntersection(d,g,y,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,v)))throw new tt("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+v)}},sr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},sr.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])},sr.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},sr.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new tt("found non-noded collapse at "+sr.fact.createLineString([t,e,n]))},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.fact.get=function(){return new me},Object.defineProperties(sr,ar);var lr=l((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 S(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new S,this._p1Scaled=new S),this.initCorners(this._pt)}),"ai"),ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};lr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return nt.isTrue(!(s&&a),"Found bad envelope test"),a},lr.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 S(this._maxx,this._maxy),this._corner[1]=new S(this._minx,this._maxy),this._corner[2]=new S(this._minx,this._miny),this._corner[3]=new S(this._maxx,this._miny)},lr.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))},lr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},lr.prototype.getCoordinate=function(){return this._originalPt},lr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},lr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=lr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new W(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},lr.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()))))},lr.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)))))},lr.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)},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(lr,ur);var cr=l((function(){this.tempEnv1=new W,this.selectedSegment=new yn}),"li");cr.prototype.select=function(){if(1!==arguments.length&&2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var hr=l((function(){this._index=null;var t=arguments[0];this._index=t}),"ci"),pr={HotPixelSnapAction:{configurable:!0}};hr.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],i=e.getSafeEnvelope(),o=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ze]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr},pr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(hr,pr);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 l(e,"e"),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[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),dr=l((function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new It}),"fi");dr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)this._interiorIntersections.add(this._li.getIntersection(l));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},dr.prototype.isDone=function(){return!1},dr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},dr.prototype.interfaces_=function(){return[Hn]},dr.prototype.getClass=function(){return dr};var gr=l((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 ot,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}),"gi");gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new sr(e);try{n.checkValid()}catch(t){if(!(t instanceof q))throw t;t.printStackTrace()}},gr.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},gr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},gr.prototype.findInteriorIntersections=function(t,e){var n=new dr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},gr.prototype.computeVertexSnaps=function(){if(A(arguments[0],wt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof gn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new lr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new En,this._pointSnapper=new hr(this._noder.getIndex()),this.snapRound(t,this._li)},gr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new lr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},gr.prototype.interfaces_=function(){return[wn]},gr.prototype.getClass=function(){return gr};var yr=l((function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Sn,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}}),"di"),vr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};yr.prototype.bufferFixedPrecision=function(t){var e=new or(new gr(new de(1)),t.getScale()),n=new ir(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},yr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=yr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Oe))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=yr.precisionScaleFactor(this._argGeom,this._distance,n),i=new de(r);this.bufferFixedPrecision(i)}},yr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===de.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},yr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},yr.prototype.bufferOriginalPrecision=function(){try{var t=new ir(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof tt))throw t;this._saveException=t}},yr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},yr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new yr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ht&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new yr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof Sn&&arguments[0]instanceof ht&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],l=arguments[2];return new yr(s,l).getResultGeometry(a)}}else if(4===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],p=arguments[3],f=new yr(u);return f.setQuadrantSegments(h),f.setEndCapStyle(p),f.getResultGeometry(c)}},yr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=D.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},vr.CAP_ROUND.get=function(){return Sn.CAP_ROUND},vr.CAP_BUTT.get=function(){return Sn.CAP_FLAT},vr.CAP_FLAT.get=function(){return Sn.CAP_FLAT},vr.CAP_SQUARE.get=function(){return Sn.CAP_SQUARE},vr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(yr,vr);var mr=l((function(){this._pt=[new S,new S],this._distance=b.NaN,this._isNull=!0}),"_i");mr.prototype.getCoordinates=function(){return this._pt},mr.prototype.getCoordinate=function(t){return this._pt[t]},mr.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)}},mr.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],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},mr.prototype.getDistance=function(){return this._distance},mr.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)}},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var _r=l((function(){}),"mi");_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof mr&&arguments[0]instanceof Zt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new yn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof mr&&arguments[0]instanceof te&&arguments[1]instanceof S){var a=arguments[0],l=arguments[1],u=arguments[2];_r.computeDistance(a.getExteriorRing(),l,u);for(var c=0;c<a.getNumInteriorRing();c++)_r.computeDistance(a.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof mr&&arguments[0]instanceof ht&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Zt)_r.computeDistance(h,p,f);else if(h instanceof te)_r.computeDistance(h,p,f);else if(h instanceof qt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);_r.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof mr&&arguments[0]instanceof yn&&arguments[1]instanceof S){var v=arguments[0],m=arguments[1],_=arguments[2],b=v.closestPoint(m);_.setMinimum(b,m)}};var br=l((function(t){this._maxPtDist=new mr,this._inputGeom=t||null}),"vi"),wr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};br.prototype.computeMaxMidpointDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},br.prototype.computeMaxVertexDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},br.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},br.prototype.getDistancePoints=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},wr.MaxPointDistanceFilter.get=function(){return xr},wr.MaxMidpointDistanceFilter.get=function(){return Er},Object.defineProperties(br,wr);var xr=l((function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),"Ei");xr.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[dt]},xr.prototype.getClass=function(){return xr};var Er=l((function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),"xi");Er.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new S((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.isDone=function(){return!1},Er.prototype.isGeometryChanged=function(){return!1},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[Ut]},Er.prototype.getClass=function(){return Er};var Ir=l((function(t){this._comps=t||null}),"Ni");Ir.prototype.filter=function(t){t instanceof te&&this._comps.add(t)},Ir.prototype.interfaces_=function(){return[zt]},Ir.prototype.getClass=function(){return Ir},Ir.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Ir.getPolygons(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof te?n.add(e):e instanceof qt&&e.apply(new Ir(n)),n}};var Sr=l((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}}),"Ci");Sr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ne){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Zt&&this._lines.add(t)},Sr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Sr.prototype.interfaces_=function(){return[ct]},Sr.prototype.getClass=function(){return Sr},Sr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Sr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Sr.getLines(e,n))}},Sr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Sr.getLines(t,!1)}if(2===arguments.length){if(A(arguments[0],wt)&&A(arguments[1],wt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Sr.getLines(i,n)}return n}if(arguments[0]instanceof ht&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new It;return o.apply(new Sr(a,s)),a}if(arguments[0]instanceof ht&&A(arguments[1],wt)){var l=arguments[0],u=arguments[1];return l instanceof Zt?u.add(l):l.apply(new Sr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&A(arguments[0],wt)&&A(arguments[1],wt)){for(var c=arguments[0],h=arguments[1],p=arguments[2],f=c.iterator();f.hasNext();){var d=f.next();Sr.getLines(d,h,p)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ht&&A(arguments[1],wt)){var g=arguments[0],y=arguments[1],v=arguments[2];return g.apply(new Sr(y,v)),y}}};var Nr=l((function(){if(this._boundaryRule=gt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}}),"Si");Nr.prototype.locateInternal=function(){if(arguments[0]instanceof S&&arguments[1]instanceof te){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===O.EXTERIOR)return O.EXTERIOR;if(r===O.BOUNDARY)return O.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof S&&arguments[1]instanceof Zt){var a=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var u=l.getCoordinates();return l.isClosed()||!a.equals(u[0])&&!a.equals(u[u.length-1])?lt.isOnLine(a,u)?O.INTERIOR:O.EXTERIOR:O.BOUNDARY}if(arguments[0]instanceof S&&arguments[1]instanceof $t){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?O.INTERIOR:O.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?lt.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof $t&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof te)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof re)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof qt)for(var l=new Un(e);l.hasNext();){var u=l.next();u!==e&&this.computeLocation(t,u)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof Zt||e instanceof te?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Mr=l((function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}}),"t"),Cr={INSIDE_AREA:{configurable:!0}};Mr.prototype.isInsideArea=function(){return this._segIndex===Mr.INSIDE_AREA},Mr.prototype.getCoordinate=function(){return this._pt},Mr.prototype.getGeometryComponent=function(){return this._component},Mr.prototype.getSegmentIndex=function(){return this._segIndex},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Cr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Mr,Cr);var Or=l((function(t){this._pts=t||null}),"wi");Or.prototype.filter=function(t){t instanceof $t&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[zt]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof $t?tn.singletonList(t):Or.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $t?n.add(e):e instanceof qt&&e.apply(new Or(n)),n}};var Pr=l((function(){this._locations=null;var t=arguments[0];this._locations=t}),"Oi");Pr.prototype.filter=function(t){(t instanceof $t||t instanceof Zt||t instanceof te)&&this._locations.add(new Mr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[zt]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e};var Ar=l((function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=b.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],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}}),"Ti");Ar.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,i=Ir.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,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&&A(arguments[0],Et)&&A(arguments[1],Et)){for(var s=arguments[0],a=arguments[1],l=arguments[2],u=0;u<s.size();u++)for(var c=s.get(u),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),l),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Mr&&arguments[1]instanceof te){var p=arguments[0],f=arguments[1],d=arguments[2],g=p.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,d[0]=p,d[1]=new Mr(f,g),null}},Ar.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Ar.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Sr.getLines(this._geom[0]),n=Sr.getLines(this._geom[1]),r=Or.getPoints(this._geom[0]),i=Or.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,i,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,i,t),void this.updateMinDistance(t,!1))))},Ar.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ar.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])},Ar.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Ar.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation||(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 Zt&&arguments[1]instanceof $t){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(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=lt.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new yn(r[o],r[o+1]).closestPoint(i);n[0]=new Mr(t,o,a),n[1]=new Mr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Zt){var l=arguments[0],u=arguments[1],c=arguments[2];if(l.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var h=l.getCoordinates(),p=u.getCoordinates(),f=0;f<h.length-1;f++)for(var d=0;d<p.length-1;d++){var g=lt.distanceLineLine(h[f],h[f+1],p[d],p[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new yn(h[f],h[f+1]),v=new yn(p[d],p[d+1]),m=y.closestPoints(v);c[0]=new Mr(l,f,m[0]),c[1]=new Mr(u,d,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Ar.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Mr(i,0,i.getCoordinate()),n[1]=new Mr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Ar.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)},Ar.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.distance=function(t,e){return new Ar(t,e).distance()},Ar.isWithinDistance=function(t,e,n){return new Ar(t,e,n).distance()<=n},Ar.nearestPoints=function(t,e){return new Ar(t,e).nearestPoints()};var Dr=l((function(){this._pt=[new S,new S],this._distance=b.NaN,this._isNull=!0}),"Ri");Dr.prototype.getCoordinates=function(){return this._pt},Dr.prototype.getCoordinate=function(t){return this._pt[t]},Dr.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)}},Dr.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],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Dr.prototype.toString=function(){return Q.toLineString(this._pt[0],this._pt[1])},Dr.prototype.getDistance=function(){return this._distance},Dr.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)}},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr};var Tr=l((function(){}),"Pi");Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.computeDistance=function(){if(arguments[2]instanceof Dr&&arguments[0]instanceof Zt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new yn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof te&&arguments[1]instanceof S){var a=arguments[0],l=arguments[1],u=arguments[2];Tr.computeDistance(a.getExteriorRing(),l,u);for(var c=0;c<a.getNumInteriorRing();c++)Tr.computeDistance(a.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof ht&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Zt)Tr.computeDistance(h,p,f);else if(h instanceof te)Tr.computeDistance(h,p,f);else if(h instanceof qt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);Tr.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof yn&&arguments[1]instanceof S){var v=arguments[0],m=arguments[1],_=arguments[2],b=v.closestPoint(m);_.setMinimum(b,m)}};var Lr=l((function(){this._g0=null,this._g1=null,this._ptDist=new Dr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),"Di"),Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Lr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Lr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Lr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Lr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Lr.prototype.computeOrientedDistance=function(t,e,n){var r=new Fr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new kr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Lr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Lr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Lr(n,r);return o.setDensifyFraction(i),o.distance()}},Rr.MaxPointDistanceFilter.get=function(){return Fr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Lr,Rr);var Fr=l((function(){this._maxPtDist=new Dr,this._minPtDist=new Dr,this._euclideanDist=new Tr,this._geom=null;var t=arguments[0];this._geom=t}),"Ai");Fr.prototype.filter=function(t){this._minPtDist.initialize(),Tr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[dt]},Fr.prototype.getClass=function(){return Fr};var kr=l((function(){this._maxPtDist=new Dr,this._minPtDist=new Dr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}),"Fi");kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,l=n.y+s*o,u=new S(a,l);this._minPtDist.initialize(),Tr.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[Ut]},kr.prototype.getClass=function(){return kr};var Br=l((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}),"Gi"),jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Lr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Q.toLineString(i[0],i[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&&Y.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 te||this._input instanceof re||this._input instanceof qt))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 Ar(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Q.toLineString(i[0],i[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 It,n=new Sr(e),r=Ir.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},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,jr);var Gr=l((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}),"Bi"),zr={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 W(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new W(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 te||this._result instanceof re||(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;Y.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()},zr.VERBOSE.get=function(){return!1},zr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,zr);var Ur=l((function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"Ui");Ur.prototype.getCoordinates=function(){return this._pts},Ur.prototype.size=function(){return this._pts.length},Ur.prototype.getCoordinate=function(t){return this._pts[t]},Ur.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ur.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ur.prototype.setData=function(t){this._data=t},Ur.prototype.getData=function(){return this._data},Ur.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},Ur.prototype.interfaces_=function(){return[fn]},Ur.prototype.getClass=function(){return Ur};var qr=l((function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new It,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}),"zi");qr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qr.prototype.getIntersectionSegments=function(){return this._intSegments},qr.prototype.count=function(){return this._intersectionCount},qr.prototype.getIntersections=function(){return this._intersections},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r||this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qr.prototype.interfaces_=function(){return[Hn]},qr.prototype.getClass=function(){return qr},qr.createAllIntersectionsFinder=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e},qr.createAnyIntersectionFinder=function(t){return new qr(t)},qr.createIntersectionCounter=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=l((function(){this._li=new ot,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t}),"Xi");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 qr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new En;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 Oe(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 "+Q.toLineString(t[0],t[1])+" and "+Q.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 Yr=l((function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))}),"t");Yr.prototype.checkValid=function(){this._nv.checkValid()},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ur(r.getCoordinates(),r))}return e},Yr.checkValid=function(t){new Yr(t).checkValid()};var Xr=l((function(t){this._mapOp=t}),"ki");Xr.prototype.map=function(t){for(var e=new It,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(me.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var Wr=l((function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new It,this._resultLineList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}),"ji");Wr.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)}},Wr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Wr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Wr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Mi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Wr.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 i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Wr.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))}},Wr.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)}},Wr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(nt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Mi.isResultOfOp(r,e)&&e===Mi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Jr=l((function(){this._op=null,this._geometryFactory=null,this._resultPointList=new It;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}),"Hi");Jr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Jr.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!==Mi.INTERSECTION)){var r=n.getLabel();Mi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Jr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr};var Hr=l((function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),"Wi");Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ne&&!r.isEmpty()||(n=!1);for(var i=new It,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ne||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new It;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(me.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof $t)return this.transformPoint(t,null);if(t instanceof ee)return this.transformMultiPoint(t,null);if(t instanceof ne)return this.transformLinearRing(t,null);if(t instanceof Zt)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof te)return this.transformPolygon(t,null);if(t instanceof re)return this.transformMultiPolygon(t,null);if(t instanceof qt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Hr.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)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Zr=l((function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new yn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Zt&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}}),"t");Zr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new S(o)),0===r&&this._isClosed&&t.set(t.size()-1,new S(o)))}},Zr.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},Zr.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Zr.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 i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new S(i),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=b.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Kr=l((function(t){this._srcGeom=t||null}),"Ji"),$r={SNAP_PRECISION_FACTOR:{configurable:!0}};Kr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Qr(e,n).transform(this._srcGeom)},Kr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Qr(t,n,!0).transform(this._srcGeom),i=r;return e&&A(i,Qt)&&(i=r.buffer(0)),i},Kr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Kr.prototype.extractTargetCoordinates=function(t){for(var e=new d,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Kr.prototype.computeMinimumSegmentLength=function(t){for(var e=b.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Kr(t);r[0]=i.snapTo(e,n);var o=new Kr(e);return r[1]=o.snapTo(r[0],n),r},Kr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Kr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===de.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kr.computeOverlaySnapTolerance(i),Kr.computeOverlaySnapTolerance(o))}},Kr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kr.SNAP_PRECISION_FACTOR},Kr.snapToSelf=function(t,e,n){return new Kr(t).snapToSelf(e,n)},$r.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,$r);var Qr=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 l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Zr(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}(Hr),ti=l((function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null}),"$i");ti.prototype.getCommon=function(){return b.longBitsToDouble(this._commonBits)},ti.prototype.add=function(t){var e=b.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=ti.signExpBits(this._commonBits),this._isFirst=!1,null):ti.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=ti.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=ti.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},ti.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=b.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+b.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.getBit=function(t,e){return t&1<<e?1:0},ti.signExpBits=function(t){return t>>52},ti.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},ti.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(ti.getBit(t,r)!==ti.getBit(e,r))return n;n++}return 52};var ei=l((function(){this._commonCoord=null,this._ccFilter=new ri}),"tr"),ni={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ei.prototype.addCommonBits=function(t){var e=new ii(this._commonCoord);t.apply(e),t.geometryChanged()},ei.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new S(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ii(e);return t.apply(n),t.geometryChanged(),t},ei.prototype.getCommonCoordinate=function(){return this._commonCoord},ei.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ni.CommonCoordinateFilter.get=function(){return ri},ni.Translater.get=function(){return ii},Object.defineProperties(ei,ni);var ri=l((function(){this._commonBitsX=new ti,this._commonBitsY=new ti}),"nr");ri.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ri.prototype.getCommonCoordinate=function(){return new S(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ri.prototype.interfaces_=function(){return[dt]},ri.prototype.getClass=function(){return ri};var ii=l((function(){this.trans=null;var t=arguments[0];this.trans=t}),"ir");ii.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)},ii.prototype.isDone=function(){return!1},ii.prototype.isGeometryChanged=function(){return!0},ii.prototype.interfaces_=function(){return[Ut]},ii.prototype.getClass=function(){return ii};var oi=l((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()}),"rr");oi.prototype.selfSnap=function(t){return new Kr(t).snapTo(t,this._snapTolerance)},oi.prototype.removeCommonBits=function(t){this._cbr=new ei,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},oi.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},oi.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Mi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},oi.prototype.checkValid=function(t){t.isValid()||Y.out.println("Snapped geometry is invalid")},oi.prototype.computeSnapTolerance=function(){this._snapTolerance=Kr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},oi.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kr.snap(e[0],e[1],this._snapTolerance)},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Mi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Mi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Mi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Mi.DIFFERENCE)};var si=l((function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e}),"or");si.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Mi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof tt))throw t;r=t}if(!n)try{e=oi.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof tt?r:t}return e},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.overlayOp=function(t,e,n){return new si(t,e).getResultGeometry(n)},si.union=function(t,e){return si.overlayOp(t,e,Mi.UNION)},si.intersection=function(t,e){return si.overlayOp(t,e,Mi.INTERSECTION)},si.symDifference=function(t,e){return si.overlayOp(t,e,Mi.SYMDIFFERENCE)},si.difference=function(t,e){return si.overlayOp(t,e,Mi.DIFFERENCE)};var ai=l((function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}),"sr");ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var li=l((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],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}}),"t"),ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};li.prototype.isDelete=function(){return this._eventType===li.DELETE},li.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},li.prototype.getObject=function(){return this._obj},li.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},li.prototype.getInsertEvent=function(){return this._insertEvent},li.prototype.isInsert=function(){return this._eventType===li.INSERT},li.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},li.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},li.prototype.interfaces_=function(){return[x]},li.prototype.getClass=function(){return li},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(li,ui);var ci=l((function(){}),"lr");ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var hi=l((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}),"cr");hi.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hi.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hi.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hi.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},hi.prototype.hasProperIntersection=function(){return this._hasProper},hi.prototype.hasIntersection=function(){return this._hasIntersection},hi.prototype.isDone=function(){return this._isDone},hi.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},hi.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hi.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),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))))},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},hi.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pi=function(t){function e(){t.call(this),this.events=new It,this.nOverlaps=null}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){tn.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 hi&&A(arguments[0],Et)&&A(arguments[1],Et)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&A(arguments[0],Et)&&arguments[1]instanceof hi){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new ai(n,i),s=new li(e,n.getMinX(i),o);this.events.add(s),this.events.add(new li(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,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[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),fi=l((function(){this._min=b.POSITIVE_INFINITY,this._max=b.NEGATIVE_INFINITY}),"hr"),di={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return Q.toLineString(new S(this._min,0),new S(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},di.NodeComparator.get=function(){return gi},Object.defineProperties(fi,di);var gi=l((function(){}),"gr");gi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gi.prototype.interfaces_=function(){return[I]},gi.prototype.getClass=function(){return gi};var yi=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 l(e,"e"),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}(fi),vi=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 l(e,"e"),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}(fi),mi=l((function(){this._leaves=new It,this._root=null,this._level=0}),"_r");mi.prototype.buildTree=function(){tn.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new It;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},mi.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 yi(t,e,n))},mi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){Y.out.println(Q.toLineString(new S(t._min,this._level),new S(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.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 i=new vi(t.get(n),t.get(n+1));e.add(i)}}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var _i=l((function(){this._items=new It}),"mr");_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Ze]},_i.prototype.getClass=function(){return _i};var bi=l((function(){this._index=null;var t=arguments[0];if(!A(t,Qt))throw new _("Argument must be Polygonal");this._index=new Ei(t)}),"vr"),wi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};bi.prototype.locate=function(t){var e=new at(t),n=new xi(e);return this._index.query(t.y,t.y,n),e.getLocation()},bi.prototype.interfaces_=function(){return[zn]},bi.prototype.getClass=function(){return bi},wi.SegmentVisitor.get=function(){return xi},wi.IntervalIndexedGeometry.get=function(){return Ei},Object.defineProperties(bi,wi);var xi=l((function(){this._counter=null;var t=arguments[0];this._counter=t}),"Er");xi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},xi.prototype.interfaces_=function(){return[Ze]},xi.prototype.getClass=function(){return xi};var Ei=l((function(){this._index=new mi;var t=arguments[0];this.init(t)}),"xr");Ei.prototype.init=function(t){for(var e=Sr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},Ei.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new yn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},Ei.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var Ii=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 Nr,2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return l(e,"e"),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(),i=1;O.NONE,r.getLocation(t,Ne.ON)===O.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},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[0],r=arguments[1],i=arguments[2],o=new hi(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ne||this._parentGeom instanceof te||this._parentGeom instanceof re,l=r||!a;return s.computeIntersections(this._edges,o,l),this.addSelfIntersectionNodes(this._argIndex),o}},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 hi(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 $t){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof S){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=Mt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new rr(e,new Te(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),nt.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 i=r.next();e[n++]=i.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===O.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=Mt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;lt.isCCW(r)&&(i=n,o=e);var s=new rr(r,new Te(this._argIndex,O.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Te(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.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 re&&(this._useBoundaryDeterminationRule=!1),e instanceof te)this.addPolygon(e);else if(e instanceof Zt)this.addLineString(e);else if(e instanceof $t)this.addPoint(e);else if(e instanceof ee)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof re)this.addCollection(e);else{if(!(e instanceof qt))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 A(this._parentGeom,Qt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new bi(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)?O.BOUNDARY:O.INTERIOR},e}(Ye),Si=l((function(){if(this._li=new ot,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 Ii(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.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 Ii(0,e,r),this._arg[1]=new Ii(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ii(0,i,s),this._arg[1]=new Ii(1,o,s)}}),"Cr");Si.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Si.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Ni=l((function(){}),"Sr");Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof ht&&A(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new It,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(A(arguments[0],wt)&&A(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new It,l=o.iterator();l.hasNext();){var u=l.next(),c=s.map(u);null!==c&&a.add(c)}return a}},Ni.MapOp=function(){};var Mi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Jn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Ye(new Xn),this._geomFact=e.getFactory()}return l(e,"e"),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 Te(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.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,i){var o=new It;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},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)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new It,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 It;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Yr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Wr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Jr(this,this._geomFact,this._ptLocator);this._resultPointList=i.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(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ne.RIGHT),i.getLocation(1,Ne.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 i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(nt.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),nt.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.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}(Si);Mi.overlayOp=function(t,e,n){return new Mi(t,e).getResultGeometry(n)},Mi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Mi.createEmptyResult(Mi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.INTERSECTION)},Mi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Mi.createEmptyResult(Mi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.SYMDIFFERENCE)},Mi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Mi.INTERSECTION:o=Math.min(r,i);break;case Mi.UNION:o=Math.max(r,i);break;case Mi.DIFFERENCE:o=r;break;case Mi.SYMDIFFERENCE:o=Math.max(r,i)}return o},Mi.createEmptyResult=function(t,e,n,r){var i=null;switch(Mi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Mi.difference=function(t,e){return t.isEmpty()?Mi.createEmptyResult(Mi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.DIFFERENCE))},Mi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Mi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Mi.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Mi.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Mi.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Mi.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Mi.INTERSECTION=1,Mi.UNION=2,Mi.DIFFERENCE=3,Mi.SYMDIFFERENCE=4;var Ci=l((function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new yn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)}),"br");Ci.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},Ci.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Ci.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Oi=l((function(){this._linework=null,this._linework=new It}),"wr");Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof te){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[zt]},Oi.prototype.getClass=function(){return Oi};var Pi=l((function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t}),"Or");Pi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new It,n=Sr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,l=n*o/s,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new S(u-l,c+a);r.add(h)}if(this._doRight){var p=new S(u+l,c-a);r.add(p)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ai=l((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 It;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ci(this._geom[0],this._boundaryDistanceTolerance),new Ci(this._geom[1],this._boundaryDistanceTolerance),new Ci(this._geom[2],this._boundaryDistanceTolerance)]}),"t"),Di={TOLERANCE:{configurable:!0}};Ai.prototype.reportResult=function(t,e,n){Y.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ai.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Ai.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],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ai.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ai.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ai.prototype.isValidResult=function(t,e){var n=Mi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ai.prototype.getInvalidLocation=function(){return this._invalidLocation},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ai.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Ai.isValid=function(t,e,n,r){return new Ai(t,e,r).isValid(n)},Di.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ai,Di);var Ti=l((function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e}),"t");Ti.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)}},Ti.prototype.combine=function(){for(var t=new It,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)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.combine=function(){if(1===arguments.length){var t=arguments[0];return new Ti(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Ti(Ti.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Ti(Ti.createList(r,i,o)).combine()}},Ti.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ti.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new It;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new It;return s.add(r),s.add(i),s.add(o),s}};var Li=l((function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new It)}),"Dr"),Ri={STRTREE_NODE_CAPACITY:{configurable:!0}};Li.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;A(r,Et)?i=this.unionTree(r):r instanceof ht&&(i=r),e.add(i)}return e},Li.prototype.extractByEnvelope=function(t,e,n){for(var r=new It,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Li.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Ti.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Li.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 an(Li.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)},Li.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 i=Li.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Li.getGeometry(e,n),Li.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Li.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},Li.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Li.prototype.unionActual=function(t,e){return Li.restrictToPolygons(t.union(e))},Li.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Li.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new It,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Ti.combine(r)},Li.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)}},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.restrictToPolygons=function(t){if(A(t,Qt))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Li.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Li.union=function(t){return new Li(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Li,Ri);var Fi=l((function(){}),"Ar");Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},Fi.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Mi.createEmptyResult(Mi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=Se,t.OverlayOp=Mi,t.UnionOp=Fi,t.BufferOp=yr,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r(n.jsts={})})),Ow={};function Mw(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function $N(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc],(function(t){return Rs(uh(t.data[0],t.data[1]))}),0,n)}function uh(t,e){return Au(t,e||{},0,0)}function Pw(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec],(function(t){return Rs(ic(t.data[0],_w(t.data[1])))}),1,n)}function ic(t,e){return ah(t,e)}function JG(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc,GN,function(){return[hw]}],(function(t){return Rs(hw(t.data[0],t.data[1]))}),2,n)}function hw(t,e){e||(e={});var n=Ql(),r=t.length;n.p(t);var i=Au(t,e,ww(e),8),o=i.length;return bw(i,e),Zt(i,o-8,n.d()),Zt(i,o-4,r),i}function JN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec,UN,function(){return[Vm]}],(function(t){return Rs(Vm(t.data[0]))}),3,n)}function Vm(t,e){return ah(t.subarray(xw(t),-8),e||new Dt(YN(t)))}function QG(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc,VN,function(){return[gw]}],(function(t){return Rs(gw(t.data[0],t.data[1]))}),4,n)}function gw(t,e){e||(e={});var n=vw();n.p(t);var r=Au(t,e,2,4);return Ew(r,e),Zt(r,r.length-4,n.d()),r}function QN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec,XN,function(){return[Ym]}],(function(t){return Rs(Ym(t.data[0],_w(t.data[1])))}),5,n)}function Ym(t,e){return ah((WN(t),t.subarray(2,-4)),e)}function t5(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),31==t[0]&&139==t[1]&&8==t[2]?JN(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Pw(t,e,n):QN(t,e,n)}function r5(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Vm(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?ic(t,e):Ym(t,e)}function Ls(t,e){if(e){for(var n=new Dt(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(CN)return CN.encode(t);var i=t.length,o=new Dt(t.length+(t.length>>1)),s=0,a=l((function(t){o[s++]=t}),"w");for(r=0;r<i;++r){if(s+5>o.length){var u=new Dt(s+8+(i-r<<1));u.set(o),o=u}var c=t.charCodeAt(r);c<128||e?a(c):c<2048?(a(192|c>>6),a(128|63&c)):c>55295&&c<57344?(a(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++r))>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|63&c)):(a(224|c>>12),a(128|c>>6&63),a(128|63&c))}return go(o,0,s)}function Cw(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(mw)return mw.decode(t);var i=rT(t),o=i[0];return i[1].length&&Ne(8),o}function u5(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Ne(7);var r={};Sw(t,"",r,e);var i=Object.keys(r),o=i.length,s=0,a=0,u=o,c=new Array(o),h=[],p=l((function(){for(var t=0;t<h.length;++t)h[t]()}),"tAll"),f=l((function(t,e){Wm((function(){n(t,e)}))}),"cbd");Wm((function(){f=n}));var d=l((function(){var t=new Dt(a+22),e=s,n=a-s;a=0;for(var r=0;r<u;++r){var i=c[r];try{var o=i.c.length;$l(t,a,i,i.f,i.u,o);var l=30+i.f.length+As(i.extra),h=a+l;t.set(i.c,h),$l(t,s,i,i.f,i.u,o,a,i.m),s+=16+l+(i.m?i.m.length:0),a=h+o}catch(t){return f(t,null)}}kw(t,s,c.length,n,e),f(null,t)}),"cbf");o||d();for(var g=l((function(t){var e=i[t],n=r[e],u=n[0],g=n[1],y=Ql(),v=u.length;y.p(u);var m=Ls(e),_=m.length,b=g.comment,w=b&&Ls(b),x=w&&w.length,E=As(g.extra),I=0==g.level?0:8,S=l((function(n,r){if(n)p(),f(n,null);else{var i=r.length;c[t]=sh(g,{size:v,crc:y.d(),c:r,f:m,m:w,u:_!=e.length||w&&b.length!=x,compression:I}),s+=30+_+E+i,a+=76+2*(_+E)+(x||0)+i,--o||d()}}),"cbl");if(_>65535&&S(Ne(11,0,1),null),I)if(v<16e4)try{S(null,uh(u,g))}catch(t){S(t,null)}else h.push($N(u,g,S));else S(null,u)}),"_loop_1"),y=0;y<u;++y)g(y);return p}function l5(t,e){e||(e={});var n={},r=[];Sw(t,"",n,e);var i=0,o=0;for(var s in n){var a=n[s],l=a[0],u=a[1],c=0==u.level?0:8,h=(E=Ls(s)).length,p=u.comment,f=p&&Ls(p),d=f&&f.length,g=As(u.extra);h>65535&&Ne(11);var y=c?uh(l,u):l,v=y.length,m=Ql();m.p(l),r.push(sh(u,{size:l.length,crc:m.d(),c:y,f:E,m:f,u:h!=s.length||f&&p.length!=d,o:i,compression:c})),i+=30+h+g+v,o+=76+2*(h+g)+(d||0)+v}for(var _=new Dt(o+22),b=i,w=o-i,x=0;x<r.length;++x){var E=r[x];$l(_,E.o,E,E.f,E.u,E.c.length);var I=30+E.f.length+As(E.extra);_.set(E.c,E.o+I),$l(_,i,E,E.f,E.u,E.c.length,E.o,E.m),i+=16+I+(E.m?E.m.length:0)}return kw(_,i,r.length,w,b),_}function h5(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Ne(7);var r=[],i=l((function(){for(var t=0;t<r.length;++t)r[t]()}),"tAll"),o={},s=l((function(t,e){Wm((function(){n(t,e)}))}),"cbd");Wm((function(){s=n}));for(var a=t.length-22;101010256!=Qr(t,a);--a)if(!a||t.length-a>65558)return s(Ne(13,0,1),null),i;var u=Ei(t,a+8);if(u){var c=u,h=Qr(t,a+16),p=4294967295==h;if(p){if(a=Qr(t,a-12),101075792!=Qr(t,a))return s(Ne(13,0,1),null),i;c=u=Qr(t,a+32),h=Qr(t,a+48)}for(var f=e&&e.filter,d=l((function(e){var n=oT(t,h,p),a=n[0],c=n[1],d=n[2],g=n[3],y=n[4],v=n[5],m=iT(t,v);h=y;var _=l((function(t,e){t?(i(),s(t,null)):(e&&(o[g]=e),--u||s(null,o))}),"cbl");if(!f||f({name:g,size:c,originalSize:d,compression:a}))if(a)if(8==a){var b=t.subarray(m,m+c);if(c<32e4)try{_(null,ic(b,new Dt(d)))}catch(t){_(t,null)}else r.push(Pw(b,{size:d},_))}else _(Ne(14,"unknown compression type "+a,1),null);else _(null,go(t,m,m+c));else _(null,null)}),"_loop_3"),g=0;g<c;++g)d(g)}else s(null,{});return i}function d5(t,e){for(var n={},r=t.length-22;101010256!=Qr(t,r);--r)(!r||t.length-r>65558)&&Ne(13);var i=Ei(t,r+8);if(!i)return{};var o=Qr(t,r+16),s=4294967295==o;s&&(r=Qr(t,r-12),101075792!=Qr(t,r)&&Ne(13),i=Qr(t,r+32),o=Qr(t,r+48));for(var a=e&&e.filter,l=0;l<i;++l){var u=oT(t,o,s),c=u[0],h=u[1],p=u[2],f=u[3],d=u[4],g=u[5],y=iT(t,g);o=d,(!a||a({name:f,size:h,originalSize:p,compression:c}))&&(c?8==c?n[f]=ic(t.subarray(y,y+h),new Dt(p)):Ne(14,"unknown compression type "+c):n[f]=go(t,y,y+h))}return n}EA(Ow,{AsyncCompress:()=>KG,AsyncDecompress:()=>e5,AsyncDeflate:()=>HN,AsyncGunzip:()=>KN,AsyncGzip:()=>KG,AsyncInflate:()=>Iw,AsyncUnzipInflate:()=>f5,AsyncUnzlib:()=>ZN,AsyncZipDeflate:()=>a5,AsyncZlib:()=>ZG,Compress:()=>pw,DecodeUTF8:()=>n5,Decompress:()=>eT,Deflate:()=>va,EncodeUTF8:()=>i5,FlateErrorCode:()=>HG,Gunzip:()=>Um,Gzip:()=>pw,Inflate:()=>Ni,Unzip:()=>p5,UnzipInflate:()=>c5,UnzipPassThrough:()=>sT,Unzlib:()=>Xm,Zip:()=>s5,ZipDeflate:()=>o5,ZipPassThrough:()=>ih,Zlib:()=>dw,compress:()=>JG,compressSync:()=>hw,decompress:()=>t5,decompressSync:()=>r5,deflate:()=>$N,deflateSync:()=>uh,gunzip:()=>JN,gunzipSync:()=>Vm,gzip:()=>JG,gzipSync:()=>hw,inflate:()=>Pw,inflateSync:()=>ic,strFromU8:()=>Cw,strToU8:()=>Ls,unzip:()=>h5,unzipSync:()=>d5,unzlib:()=>QN,unzlibSync:()=>Ym,zip:()=>u5,zipSync:()=>l5,zlib:()=>QG,zlibSync:()=>gw});var PN,WG,Dt,ai,Kl,Jl,Zl,rh,kN,ON,yw,zm,NN,TN,lw,nh,Ha,ho,Ka,Hl,Kt,AN,LN,RN,DN,Fm,po,Bm,oh,go,HG,FN,Ne,ah,ya,Yl,jm,qm,cw,Wl,Gm,fw,BN,$a,jN,zN,Ql,vw,Au,sh,SN,Dm,$G,qN,ec,tc,GN,UN,VN,XN,Rs,_w,rc,mo,nc,Ei,Qr,uw,Zt,bw,xw,YN,ww,Ew,WN,va,HN,Ni,Iw,pw,KG,Um,KN,dw,ZG,Xm,ZN,eT,e5,Sw,CN,mw,tT,rT,n5,i5,nT,iT,oT,aT,As,$l,kw,ih,o5,a5,s5,sT,c5,f5,p5,Wm,Nw=AE((()=>{for(y(),PN={},WG=l((function(t,e,n,r,i){var o=new Worker(PN[e]||(PN[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,e)},o.postMessage(n,r),o}),"wk"),Dt=Uint8Array,ai=Uint16Array,Kl=Uint32Array,Jl=new Dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Zl=new Dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rh=new Dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kN=l((function(t,e){for(var n=new ai(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Kl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]}),"freb"),ON=kN(Jl,2),yw=ON[0],zm=ON[1],yw[28]=258,zm[258]=28,NN=kN(Zl,0),TN=NN[0],lw=NN[1],nh=new ai(32768),Kt=0;Kt<32768;++Kt)Ha=(61680&(Ha=(52428&(Ha=(43690&Kt)>>>1|(21845&Kt)<<1))>>>2|(13107&Ha)<<2))>>>4|(3855&Ha)<<4,nh[Kt]=((65280&Ha)>>>8|(255&Ha)<<8)>>>1;for(ho=l((function(t,e,n){for(var r=t.length,i=0,o=new ai(e);i<r;++i)t[i]&&++o[t[i]-1];var s,a=new ai(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new ai(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=a[t[i]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[nh[h]>>>l]=u}else for(s=new ai(r),i=0;i<r;++i)t[i]&&(s[i]=nh[a[t[i]-1]++]>>>15-t[i]);return s}),"hMap"),Ka=new Dt(288),Kt=0;Kt<144;++Kt)Ka[Kt]=8;for(Kt=144;Kt<256;++Kt)Ka[Kt]=9;for(Kt=256;Kt<280;++Kt)Ka[Kt]=7;for(Kt=280;Kt<288;++Kt)Ka[Kt]=8;for(Hl=new Dt(32),Kt=0;Kt<32;++Kt)Hl[Kt]=5;AN=ho(Ka,9,0),LN=ho(Ka,9,1),RN=ho(Hl,5,0),DN=ho(Hl,5,1),Fm=l((function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e}),"max"),po=l((function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n}),"bits"),Bm=l((function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)}),"bits16"),oh=l((function(t){return(t+7)/8|0}),"shft"),go=l((function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var r=new(2==t.BYTES_PER_ELEMENT?ai:4==t.BYTES_PER_ELEMENT?Kl:Dt)(n-e);return r.set(t.subarray(e,n)),r}),"slc"),HG={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},FN=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ne=l((function(t,e,n){var r=new Error(e||FN[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ne),!n)throw r;return r}),"err"),ah=l((function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new Dt(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new Dt(3*r));var s=l((function(t){var n=e.length;if(t>n){var r=new Dt(Math.max(2*n,t));r.set(e),e=r}}),"cbuf"),a=n.f||0,u=n.p||0,c=n.b||0,h=n.l,p=n.d,f=n.m,d=n.n,g=8*r;do{if(!h){a=po(t,u,1);var y=po(t,u+1,3);if(u+=3,!y){var v=t[(C=oh(u)+4)-4]|t[C-3]<<8,m=C+v;if(m>r){o&&Ne(0);break}i&&s(c+v),e.set(t.subarray(C,m),c),n.b=c+=v,n.p=u=8*m,n.f=a;continue}if(1==y)h=LN,p=DN,f=9,d=5;else if(2==y){var _=po(t,u,31)+257,b=po(t,u+10,15)+4,w=_+po(t,u+5,31)+1;u+=14;for(var x=new Dt(w),E=new Dt(19),I=0;I<b;++I)E[rh[I]]=po(t,u+3*I,7);u+=3*b;var S=Fm(E),N=(1<<S)-1,M=ho(E,S,1);for(I=0;I<w;){var C,O=M[po(t,u,N)];if(u+=15&O,(C=O>>>4)<16)x[I++]=C;else{var P=0,A=0;for(16==C?(A=3+po(t,u,3),u+=2,P=x[I-1]):17==C?(A=3+po(t,u,7),u+=3):18==C&&(A=11+po(t,u,127),u+=7);A--;)x[I++]=P}}var D=x.subarray(0,_),T=x.subarray(_);f=Fm(D),d=Fm(T),h=ho(D,f,1),p=ho(T,d,1)}else Ne(1);if(u>g){o&&Ne(0);break}}i&&s(c+131072);for(var L=(1<<f)-1,R=(1<<d)-1,F=u;;F=u){var k=(P=h[Bm(t,u)&L])>>>4;if((u+=15&P)>g){o&&Ne(0);break}if(P||Ne(2),k<256)e[c++]=k;else{if(256==k){F=u,h=null;break}var B=k-254;if(k>264){var j=Jl[I=k-257];B=po(t,u,(1<<j)-1)+yw[I],u+=j}var G=p[Bm(t,u)&R],z=G>>>4;G||Ne(3),u+=15&G;T=TN[z];if(z>3){j=Zl[z];T+=Bm(t,u)&(1<<j)-1,u+=j}if(u>g){o&&Ne(0);break}i&&s(c+131072);for(var U=c+B;c<U;c+=4)e[c]=e[c-T],e[c+1]=e[c+1-T],e[c+2]=e[c+2-T],e[c+3]=e[c+3-T];c=U}}n.l=h,n.p=F,n.b=c,n.f=a,h&&(a=1,n.m=f,n.d=p,n.n=d)}while(!a);return c==e.length?e:go(e,0,c)}),"inflt"),ya=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8}),"wbits"),Yl=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16}),"wbits16"),jm=l((function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[$a,0];if(1==i){var s=new Dt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new ai(p+1),d=qm(n[c-1],f,0);if(d>e){r=0;var g=0,y=d-e,v=1<<y;for(o.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));r<i;++r){var m=o[r].s;if(!(f[m]>e))break;g+=v-(1<<d-f[m]),f[m]=e}for(g>>>=y;g>0;){var _=o[r].s;f[_]<e?g-=1<<e-f[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;f[b]==e&&(--f[b],++g)}d=e}return[new Dt(f),d]}),"hTree"),qm=l((function(t,e,n){return-1==t.s?Math.max(qm(t.l,e,n+1),qm(t.r,e,n+1)):e[t.s]=n}),"ln"),cw=l((function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ai(++e),r=0,i=t[0],o=1,s=l((function(t){n[r++]=t}),"w"),a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]}),"lc"),Wl=l((function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n}),"clen"),Gm=l((function(t,e,n){var r=n.length,i=oh(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)}),"wfblk"),fw=l((function(t,e,n,r,i,o,s,a,l,u,c){ya(e,c++,n),++i[256];for(var h=jm(i,15),p=h[0],f=h[1],d=jm(o,15),g=d[0],y=d[1],v=cw(p),m=v[0],_=v[1],b=cw(g),w=b[0],x=b[1],E=new ai(19),I=0;I<m.length;++I)E[31&m[I]]++;for(I=0;I<w.length;++I)E[31&w[I]]++;for(var S=jm(E,7),N=S[0],M=S[1],C=19;C>4&&!N[rh[C-1]];--C);var O,P,A,D,T=u+5<<3,L=Wl(i,Ka)+Wl(o,Hl)+s,R=Wl(i,p)+Wl(o,g)+s+14+3*C+Wl(E,N)+(2*E[16]+3*E[17]+7*E[18]);if(T<=L&&T<=R)return Gm(e,c,t.subarray(l,l+u));if(ya(e,c,1+(R<L)),c+=2,R<L){O=ho(p,f,0),P=p,A=ho(g,y,0),D=g;var F=ho(N,M,0);ya(e,c,_-257),ya(e,c+5,x-1),ya(e,c+10,C-4),c+=14;for(I=0;I<C;++I)ya(e,c+3*I,N[rh[I]]);c+=3*C;for(var k=[m,w],B=0;B<2;++B){var j=k[B];for(I=0;I<j.length;++I){var G=31&j[I];ya(e,c,F[G]),c+=N[G],G>15&&(ya(e,c,j[I]>>>5&127),c+=j[I]>>>12)}}}else O=AN,P=Ka,A=RN,D=Hl;for(I=0;I<a;++I)if(r[I]>255){G=r[I]>>>18&31;Yl(e,c,O[G+257]),c+=P[G+257],G>7&&(ya(e,c,r[I]>>>23&31),c+=Jl[G]);var z=31&r[I];Yl(e,c,A[z]),c+=D[z],z>3&&(Yl(e,c,r[I]>>>5&8191),c+=Zl[z])}else Yl(e,c,O[r[I]]),c+=P[r[I]];return Yl(e,c,O[256]),c+P[256]}),"wblk"),BN=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$a=new Dt(0),jN=l((function(t,e,n,r,i,o){var s=t.length,a=new Dt(r+s+5*(1+Math.ceil(s/7e3))+i),u=a.subarray(r,a.length-i),c=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var p=h+65535;p>=s&&(u[c>>3]=o),c=Gm(u,c+1,t.subarray(h,p))}else{for(var f=BN[e-1],d=f>>>13,g=8191&f,y=(1<<n)-1,v=new ai(32768),m=new ai(y+1),_=Math.ceil(n/3),b=2*_,w=l((function(e){return(t[e]^t[e+1]<<_^t[e+2]<<b)&y}),"hsh"),x=new Kl(25e3),E=new ai(288),I=new ai(32),S=0,N=0,M=(h=0,0),C=0,O=0;h<s;++h){var P=w(h),A=32767&h,D=m[P];if(v[A]=D,m[P]=A,C<=h){var T=s-h;if((S>7e3||M>24576)&&T>423){c=fw(t,u,0,x,E,I,N,M,O,h-O,c),M=S=N=0,O=h;for(var L=0;L<286;++L)E[L]=0;for(L=0;L<30;++L)I[L]=0}var R=2,F=0,k=g,B=A-D&32767;if(T>2&&P==w(h-B))for(var j=Math.min(d,T)-1,G=Math.min(32767,h),z=Math.min(258,T);B<=G&&--k&&A!=D;){if(t[h+R]==t[h+R-B]){for(var U=0;U<z&&t[h+U]==t[h+U-B];++U);if(U>R){if(R=U,F=B,U>j)break;var q=Math.min(B,U-2),V=0;for(L=0;L<q;++L){var Y=h-B+L+32768&32767,X=Y-v[Y]+32768&32767;X>V&&(V=X,D=Y)}}}B+=(A=D)-(D=v[A])+32768&32767}if(F){x[M++]=268435456|zm[R]<<18|lw[F];var W=31&zm[R],J=31&lw[F];N+=Jl[W]+Zl[J],++E[257+W],++I[J],C=h+R,++S}else x[M++]=t[h],++E[t[h]]}}c=fw(t,u,o,x,E,I,N,M,O,h-O,c),!o&&7&c&&(c=Gm(u,c+1,$a))}return go(a,0,r+oh(c)+i)}),"dflt"),zN=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),Ql=l((function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=zN[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}}),"crc"),vw=l((function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,o=0|n.length,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}}),"adler"),Au=l((function(t,e,n,r,i){return jN(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!i)}),"dopt"),sh=l((function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n}),"mrg"),SN=l((function(t,e,n){for(var r=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var a=r[s],l=o[s];if("function"==typeof a){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var h in e+=u,a.prototype)e+=";"+l+".prototype."+h+"="+a.prototype[h].toString();else e+=u}else n[l]=a}return[e,n]}),"wcln"),Dm=[],$G=l((function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}),"cbfs"),qN=l((function(t,e,n,r){var i;if(!Dm[n]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)o=(i=SN(t[l],o,s))[0],s=i[1];Dm[n]=SN(t[a],o,s)}var u=sh({},Dm[n][1]);return WG(Dm[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,$G(u),r)}),"wrkr"),ec=l((function(){return[Dt,ai,Kl,Jl,Zl,rh,yw,TN,LN,DN,nh,FN,ho,Fm,po,Bm,oh,go,Ne,ah,ic,Rs,_w]}),"bInflt"),tc=l((function(){return[Dt,ai,Kl,Jl,Zl,rh,zm,lw,AN,Ka,RN,Hl,nh,BN,$a,ho,ya,Yl,jm,qm,cw,Wl,Gm,fw,oh,go,jN,Au,uh,Rs]}),"bDflt"),GN=l((function(){return[bw,ww,Zt,Ql,zN]}),"gze"),UN=l((function(){return[xw,YN]}),"guze"),VN=l((function(){return[Ew,Zt,vw]}),"zle"),XN=l((function(){return[WN]}),"zule"),Rs=l((function(t){return postMessage(t,[t.buffer])}),"pbf"),_w=l((function(t){return t&&t.size&&new Dt(t.size)}),"gu8"),rc=l((function(t,e,n,r,i,o){var s=qN(n,r,i,(function(t,e){s.terminate(),o(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}}),"cbify"),mo=l((function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}}),"astrm"),nc=l((function(t,e,n,r,i){var o,s=qN(t,r,i,(function(t,n){t?(s.terminate(),e.ondata.call(e,t)):(n[1]&&s.terminate(),e.ondata.call(e,t,n[0],n[1]))}));s.postMessage(n),e.push=function(t,n){e.ondata||Ne(5),o&&e.ondata(Ne(4,0,1),null,!!n),s.postMessage([t,o=n],[t.buffer])},e.terminate=function(){s.terminate()}}),"astrmify"),Ei=l((function(t,e){return t[e]|t[e+1]<<8}),"b2"),Qr=l((function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}),"b4"),uw=l((function(t,e){return Qr(t,e)+4294967296*Qr(t,e+4)}),"b8"),Zt=l((function(t,e,n){for(;n;++e)t[e]=n,n>>>=8}),"wbytes"),bw=l((function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Zt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}}),"gzh"),xw=l((function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&Ne(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)}),"gzs"),YN=l((function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}),"gzl"),ww=l((function(t){return 10+(t.filename&&t.filename.length+1||0)}),"gzhl"),Ew=l((function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)}),"zlh"),WN=l((function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Ne(6,"invalid zlib data"),32&t[1]&&Ne(6,"invalid zlib data: preset dictionaries not supported")}),"zlv"),l(Mw,"AsyncCmpStrm"),va=function(){function t(t,e){!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{}}return l(t,"Deflate"),t.prototype.p=function(t,e){this.ondata(Au(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||Ne(5),this.d&&Ne(4),this.d=e,this.p(t,e||!1)},t}(),HN=function(){function t(t,e){nc([tc,function(){return[mo,va]}],this,Mw.call(this,t,e),(function(t){var e=new va(t.data);onmessage=mo(e)}),6)}return l(t,"AsyncDeflate"),t}(),l($N,"deflate"),l(uh,"deflateSync"),Ni=function(){function t(t){this.s={},this.p=new Dt(0),this.ondata=t}return l(t,"Inflate"),t.prototype.e=function(t){this.ondata||Ne(5),this.d&&Ne(4);var e=this.p.length,n=new Dt(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=ah(this.p,this.o,this.s);this.ondata(go(n,e,this.s.b),this.d),this.o=go(n,this.s.b-32768),this.s.b=this.o.length,this.p=go(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Iw=function(){function t(t){this.ondata=t,nc([ec,function(){return[mo,Ni]}],this,0,(function(){var t=new Ni;onmessage=mo(t)}),7)}return l(t,"AsyncInflate"),t}(),l(Pw,"inflate"),l(ic,"inflateSync"),pw=function(){function t(t,e){this.c=Ql(),this.l=0,this.v=1,va.call(this,t,e)}return l(t,"Gzip"),t.prototype.push=function(t,e){va.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Au(t,this.o,this.v&&ww(this.o),e&&8,!e);this.v&&(bw(n,this.o),this.v=0),e&&(Zt(n,n.length-8,this.c.d()),Zt(n,n.length-4,this.l)),this.ondata(n,e)},t}(),KG=function(){function t(t,e){nc([tc,GN,function(){return[mo,va,pw]}],this,Mw.call(this,t,e),(function(t){var e=new pw(t.data);onmessage=mo(e)}),8)}return l(t,"AsyncGzip"),t}(),l(JG,"gzip"),l(hw,"gzipSync"),Um=function(){function t(t){this.v=1,Ni.call(this,t)}return l(t,"Gunzip"),t.prototype.push=function(t,e){if(Ni.prototype.e.call(this,t),this.v){var n=this.p.length>3?xw(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&Ne(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Ni.prototype.c.call(this,e)},t}(),KN=function(){function t(t){this.ondata=t,nc([ec,UN,function(){return[mo,Ni,Um]}],this,0,(function(){var t=new Um;onmessage=mo(t)}),9)}return l(t,"AsyncGunzip"),t}(),l(JN,"gunzip"),l(Vm,"gunzipSync"),dw=function(){function t(t,e){this.c=vw(),this.v=1,va.call(this,t,e)}return l(t,"Zlib"),t.prototype.push=function(t,e){va.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Au(t,this.o,this.v&&2,e&&4,!e);this.v&&(Ew(n,this.o),this.v=0),e&&Zt(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),ZG=function(){function t(t,e){nc([tc,VN,function(){return[mo,va,dw]}],this,Mw.call(this,t,e),(function(t){var e=new dw(t.data);onmessage=mo(e)}),10)}return l(t,"AsyncZlib"),t}(),l(QG,"zlib"),l(gw,"zlibSync"),Xm=function(){function t(t){this.v=1,Ni.call(this,t)}return l(t,"Unzlib"),t.prototype.push=function(t,e){if(Ni.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&Ne(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ni.prototype.c.call(this,e)},t}(),ZN=function(){function t(t){this.ondata=t,nc([ec,XN,function(){return[mo,Ni,Xm]}],this,0,(function(){var t=new Xm;onmessage=mo(t)}),11)}return l(t,"AsyncUnzlib"),t}(),l(QN,"unzlib"),l(Ym,"unzlibSync"),eT=function(){function t(t){this.G=Um,this.I=Ni,this.Z=Xm,this.ondata=t}return l(t,"Decompress"),t.prototype.push=function(t,e){if(this.ondata||Ne(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new Dt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,i=l((function(){r.ondata.apply(r,arguments)}),"cb");this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,e),this.p=null}}},t}(),e5=function(){function t(t){this.G=KN,this.I=Iw,this.Z=ZN,this.ondata=t}return l(t,"AsyncDecompress"),t.prototype.push=function(t,e){eT.prototype.push.call(this,t,e)},t}(),l(t5,"decompress"),l(r5,"decompressSync"),Sw=l((function(t,e,n,r){for(var i in t){var o=t[i],s=e+i,a=r;Array.isArray(o)&&(a=sh(r,o[1]),o=o[0]),o instanceof Dt?n[s]=[o,a]:(n[s+="/"]=[new Dt(0),a],Sw(o,s,n,r))}}),"fltn"),CN=typeof TextEncoder<"u"&&new TextEncoder,mw=typeof TextDecoder<"u"&&new TextDecoder,tT=0;try{mw.decode($a,{stream:!0}),tT=1}catch{}rT=l((function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return[e,go(t,n-1)];i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}}),"dutf8"),n5=function(){function t(t){this.ondata=t,tT?this.t=new TextDecoder:this.p=$a}return l(t,"DecodeUTF8"),t.prototype.push=function(t,e){if(this.ondata||Ne(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&Ne(8),this.t=null));this.p||Ne(4);var n=new Dt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=rT(n),i=r[0],o=r[1];e?(o.length&&Ne(8),this.p=null):this.p=o,this.ondata(i,e)},t}(),i5=function(){function t(t){this.ondata=t}return l(t,"EncodeUTF8"),t.prototype.push=function(t,e){this.ondata||Ne(5),this.d&&Ne(4),this.ondata(Ls(t),this.d=e||!1)},t}(),l(Ls,"strToU8"),l(Cw,"strFromU8"),nT=l((function(t){return 1==t?3:t<6?2:9==t?1:0}),"dbf"),iT=l((function(t,e){return e+30+Ei(t,e+26)+Ei(t,e+28)}),"slzh"),oT=l((function(t,e,n){var r=Ei(t,e+28),i=Cw(t.subarray(e+46,e+46+r),!(2048&Ei(t,e+8))),o=e+46+r,s=Qr(t,e+20),a=n&&4294967295==s?aT(t,o):[s,Qr(t,e+24),Qr(t,e+42)],l=a[0],u=a[1],c=a[2];return[Ei(t,e+10),l,u,i,o+Ei(t,e+30)+Ei(t,e+32),c]}),"zh"),aT=l((function(t,e){for(;1!=Ei(t,e);e+=4+Ei(t,e+2));return[uw(t,e+12),uw(t,e+4),uw(t,e+20)]}),"z64e"),As=l((function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&Ne(9),e+=r+4}return e}),"exfl"),$l=l((function(t,e,n,r,i,o,s,a){var l=r.length,u=n.extra,c=a&&a.length,h=As(u);Zt(t,e,null!=s?33639248:67324752),e+=4,null!=s&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==o&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var p=new Date(null==n.mtime?Date.now():n.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&Ne(10),Zt(t,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),e+=4,null!=o&&(Zt(t,e,n.crc),Zt(t,e+4,o),Zt(t,e+8,n.size)),Zt(t,e+12,l),Zt(t,e+14,h),e+=16,null!=s&&(Zt(t,e,c),Zt(t,e+6,n.attrs),Zt(t,e+10,s),e+=14),t.set(r,e),e+=l,h)for(var d in u){var g=u[d],y=g.length;Zt(t,e,+d),Zt(t,e+2,y),t.set(g,e+4),e+=4+y}return c&&(t.set(a,e),e+=c),e}),"wzh"),kw=l((function(t,e,n,r,i){Zt(t,e,101010256),Zt(t,e+8,n),Zt(t,e+10,n),Zt(t,e+12,r),Zt(t,e+16,i)}),"wzf"),ih=function(){function t(t){this.filename=t,this.c=Ql(),this.size=0,this.compression=0}return l(t,"ZipPassThrough"),t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||Ne(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),o5=function(){function t(t,e){var n=this;e||(e={}),ih.call(this,t),this.d=new va(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=nT(e.level)}return l(t,"ZipDeflate"),t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ih.prototype.push.call(this,t,e)},t}(),a5=function(){function t(t,e){var n=this;e||(e={}),ih.call(this,t),this.d=new HN(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=nT(e.level),this.terminate=this.d.terminate}return l(t,"AsyncZipDeflate"),t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ih.prototype.push.call(this,t,e)},t}(),s5=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return l(t,"Zip"),t.prototype.add=function(t){var e=this;if(this.ondata||Ne(5),2&this.d)this.ondata(Ne(4+8*(1&this.d),0,1),null,!1);else{var n=Ls(t.filename),r=n.length,i=t.comment,o=i&&Ls(i),s=r!=t.filename.length||o&&i.length!=o.length,a=r+As(t.extra)+30;r>65535&&this.ondata(Ne(11,0,1),null,!1);var u=new Dt(a);$l(u,0,t,n,s);var c=[u],h=l((function(){for(var t=0,n=c;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}c=[]}),"pAll_1"),p=this.d;this.d=0;var f=this.u.length,d=sh(t,{f:n,u:s,o:o,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),p){var t=e.u[f+1];t?t.r():e.d=1}p=1}}),g=0;t.ondata=function(n,r,i){if(n)e.ondata(n,r,i),e.terminate();else if(g+=r.length,c.push(r),i){var o=new Dt(16);Zt(o,0,134695760),Zt(o,4,t.crc),Zt(o,8,g),Zt(o,12,t.size),c.push(o),d.c=g,d.b=a+g+16,d.crc=t.crc,d.size=t.size,p&&d.r(),p=1}else p&&h()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(Ne(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+As(l.extra)+(l.o?l.o.length:0)}for(var o=new Dt(n+22),s=0,a=this.u;s<a.length;s++){var l=a[s];$l(o,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+As(l.extra)+(l.o?l.o.length:0),e+=l.b}kw(o,t,this.u.length,n,e),this.ondata(null,o,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}(),l(u5,"zip"),l(l5,"zipSync"),sT=function(){function t(){}return l(t,"UnzipPassThrough"),t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),c5=function(){function t(){var t=this;this.i=new Ni((function(e,n){t.ondata(null,e,n)}))}return l(t,"UnzipInflate"),t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),f5=function(){function t(t,e){var n=this;e<32e4?this.i=new Ni((function(t,e){n.ondata(null,t,e)})):(this.i=new Iw((function(t,e,r){n.ondata(t,e,r)})),this.terminate=this.i.terminate)}return l(t,"AsyncUnzipInflate"),t.prototype.push=function(t,e){this.i.terminate&&(t=go(t,0)),this.i.push(t,e)},t.compression=8,t}(),p5=function(){function t(t){this.onfile=t,this.k=[],this.o={0:sT},this.p=$a}return l(t,"Unzip"),t.prototype.push=function(t,e){var n=this;if(this.onfile||Ne(5),this.p||Ne(4),this.c>0){var r=Math.min(this.c,t.length),i=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(t=t.subarray(r)).length)return this.push(t,e)}else{var o=0,s=0,a=void 0,u=void 0;this.p.length?t.length?((u=new Dt(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,h=this.c,p=h&&this.d,f=l((function(){var t,e=Qr(u,s);if(67324752==e){o=1,a=s,d.d=null,d.c=0;var r=Ei(u,s+6),i=Ei(u,s+8),l=2048&r,p=8&r,f=Ei(u,s+26),g=Ei(u,s+28);if(c>s+30+f+g){var y=[];d.k.unshift(y),o=2;var v=Qr(u,s+18),m=Qr(u,s+22),_=Cw(u.subarray(s+30,s+=30+f),!l);4294967295==v?(t=p?[-2]:aT(u,s),v=t[0],m=t[1]):p&&(v=-1),s+=g,d.c=v;var b,w={name:_,compression:i,start:function(){if(w.ondata||Ne(5),v){var t=n.o[i];t||w.ondata(Ne(14,"unknown compression type "+i,1),null,!1),(b=v<0?new t(_):new t(_,v,m)).ondata=function(t,e,n){w.ondata(t,e,n)};for(var e=0,r=y;e<r.length;e++){var o=r[e];b.push(o,!1)}n.k[0]==y&&n.c?n.d=b:b.push($a,!0)}else w.ondata(null,$a,!0)},terminate:function(){b&&b.terminate&&b.terminate()}};v>=0&&(w.size=v,w.originalSize=m),d.onfile(w)}return"break"}if(h){if(134695760==e)return a=s+=12+(-2==h&&8),o=3,d.c=0,"break";if(33639248==e)return a=s-=4,o=3,d.c=0,"break"}}),"_loop_2"),d=this;s<c-4;++s){if("break"===f())break}if(this.p=$a,h<0){var g=o?u.subarray(0,a-12-(-2==h&&8)-(134695760==Qr(u,a-16)&&4)):u.subarray(0,s);p?p.push(g,!!o):this.k[+(2==o)].push(g)}if(2&o)return this.push(u.subarray(s),e);this.p=u.subarray(s)}e&&(this.c&&Ne(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),Wm="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()},l(h5,"unzip"),l(d5,"unzipSync")})),xT=fe(((t,e)=>{"use strict";y(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>"%".concat(t.charCodeAt(0).toString(16).toUpperCase())))})),PT=fe(((t,e)=>{"use strict";y();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function o(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],o(n),o(r))}function s(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(r)||[],n=1;n<e.length;n++)e=(t=o(e,n).join("")).match(r)||[];return t}}function a(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch{var r=s(n[0]);r!==n[0]&&(e[n[0]]=r)}n=i.exec(t)}e["%C2"]="�";for(var o=Object.keys(e),a=0;a<o.length;a++){var l=o[a];t=t.replace(new RegExp(l,"g"),e[l])}return t}l(o,"decodeComponents"),l(s,"decode"),l(a,"customDecodeURIComponent"),e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return a(t)}}})),CT=fe(((t,e)=>{"use strict";y(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),OT=fe(((t,e)=>{"use strict";y(),e.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),o=0;o<r.length;o++){var s=r[o],a=t[s];(i?-1!==e.indexOf(s):e(s,a,t))&&(n[s]=a)}return n}})),BT=fe((t=>{"use strict";y();var e=xT(),n=PT(),r=CT(),i=OT(),o=l((t=>null==t),"isNullOrUndefined"),s=Symbol("encodeFragmentIdentifier");function a(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{let i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[h(e,t),"[",i,"]"].join("")]:[...n,[h(e,t),"[",h(i,t),"]=",h(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[h(e,t),"[]"].join("")]:[...n,[h(e,t),"[]=",h(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[h(n,t),e,h(i,t)].join("")]:[[r,h(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,h(e,t)]:[...n,[h(e,t),"=",h(r,t)].join("")]}}function u(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{let i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&p(n,t).includes(t.arrayFormatSeparator);n=o?p(n,t):n;let s=i||o?n.split(t.arrayFormatSeparator).map((e=>p(e,t))):null===n?n:p(n,t);r[e]=s};case"bracket-separator":return(e,n,r)=>{let i=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!i)return void(r[e]=n&&p(n,t));let o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>p(e,t)));void 0!==r[e]?r[e]=[].concat(r[e],o):r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}function c(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function p(t,e){return e.decode?n(t):t}function f(t){return Array.isArray(t)?t.sort():"object"==typeof t?f(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function d(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function g(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}function v(t){let e=(t=d(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function m(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function _(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=u(e),i=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return i;for(let o of t.split("&")){if(""===o)continue;let[t,s]=r(e.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:p(s,e),n(p(t,e),s,i)}for(let t of Object.keys(i)){let n=i[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=m(n[t],e);else i[t]=m(n,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{let n=i[e];return n&&"object"==typeof n&&!Array.isArray(n)?t[e]=f(n):t[e]=n,t}),Object.create(null))}l(a,"encoderForArrayFormat"),l(u,"parserForArrayFormat"),l(c,"validateArrayFormatSeparator"),l(h,"encode"),l(p,"decode"),l(f,"keysSorter"),l(d,"removeHash"),l(g,"getHash"),l(v,"extract"),l(m,"parseValue"),l(_,"parse"),t.extract=v,t.parse=_,t.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=l((n=>e.skipNull&&o(t[n])||e.skipEmptyString&&""===t[n]),"shouldFilter"),r=a(e),i={};for(let e of Object.keys(t))n(e)||(i[e]=t[e]);let s=Object.keys(i);return!1!==e.sort&&s.sort(e.sort),s.map((n=>{let i=t[n];return void 0===i?"":null===i?h(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?h(n,e)+"[]":i.reduce(r(n),[]).join("&"):h(n,e)+"="+h(i,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,i]=r(t,"#");return Object.assign({url:n.split("?")[0]||"",query:_(v(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:p(i,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);let r=d(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query),l=t.stringify(a,n);l&&(l="?".concat(l));let u=g(e.url);return e.fragmentIdentifier&&(u="#".concat(n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(r).concat(l).concat(u)},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);let{url:o,query:a,fragmentIdentifier:l}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:i(a,n),fragmentIdentifier:l},r)},t.exclude=(e,n,r)=>{let i=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,i,r)}}));y();var oA=er(LE());y(),y(),y();var FM=er(RM());y();var Ky=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:o=0,pathWeight:s=0}){let a,l;if(D(this,"origin"),D(this,"destination"),D(this,"vortex"),D(this,"distance"),D(this,"angle"),D(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=i,this.angle=o,n)this.distance=0,this.angle=0,a=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,l=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*l+a;else{let t=s||e.weight;a=t&&t>=0?t:0,l=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*l+a}if(isNaN(this.angle))throw new Error("nan angle")}};l(Ky,"Edge");var $y=Ky,Zs=$y;y();var DM="mi-debug",nD={logState:0,log(...t){this.logState<=0&&console.log("[MappedInJS]",...t)},warn(...t){this.logState<=1&&console.warn("[MappedInJS]",...t)},error(...t){this.logState<=2&&console.error("[MappedInJS]",...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)}},Ie=nD;function iD(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error("map ".concat(t.name||t.shortName||t.id," does not have a georeference field"));if(t.georeference.length<3)throw new Error("map ".concat(t.name||t.shortName||t.id," has less than 3 georeference points, we require at least 3 for proper map scaling"));let e=t.georeference[0],n=t.georeference[2],r=(0,FM.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),i=e.control.x-n.control.x,o=e.control.y-n.control.y;return Math.sqrt(i*i+o*o)/r}catch(t){return Ie.error(t),1}}function Ad(t,e){let n=t.x-e.x,r=t.y-e.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}l(iD,"getMapScale"),l(Ad,"getAngle");var Qy=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){D(this,"edges"),D(this,"nodesById"),D(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:iD(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let i=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=i.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let o=e.map((t=>({...t,name:r?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));i.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e,weight:n})=>{let r=this.nodesById[e];return new Zs({angle:Ad(t,r),destination:r,distance:this.getDistance(t,r),origin:t,pathWeight:n})}))})),o.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let r=e;for(;r<t.nodes.length;){let e=this.nodesById[t.nodes[r]];if(r++,null==e)continue;let i=this.mapsById[n.map].elevation||0,o=this.mapsById[e.map].elevation||0,s=Math.abs(i-o);this.edges[n.id].push(new Zs({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new Zs({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar({originIds:t,destinationNodeIds:e,accessible:n,includedVortexIds:r,excludedVortexIds:i}){let o=t.map((t=>this.nodesById[t])).filter((t=>t)),s=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===o.length||0===s.length)return[];let a=[],l={},u={};for(o.forEach((t=>{let e=this.getShortestEuclideanDistance(t,s);a.push({origin:t,priority:e}),l[t.id]=null,u[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(s.includes(t.origin)){let e=[],n=l[t.origin.id];for(;null!=n;){e.push(n);let t=l[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let o=e.vortex&&!1===e.vortex.accessible||!1===e.origin.accessible||!1===e.destination.accessible,c=e.vortex&&(r&&!r.has(e.vortex.id)||i&&i.has(e.vortex.id));if(n&&o||c)continue;let h=u[t.origin.id]+e.weight;if(null==u[e.destination.id]||h<u[e.destination.id]){u[e.destination.id]=h;let t=h+this.getShortestEuclideanDistance(e.destination,s);a.push({origin:e.destination,priority:t}),l[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,r=t.x-e.x,i=t.y-e.y,o=r*r+i*i;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(o)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let r=this.getDistance(t,n);return Math.min(e,r)}),Number.MAX_VALUE)}};l(Qy,"NavigationGraph");var Jy=Qy,Zy=Jy;function oD(t){switch(t){case"down":case"up":return"".concat(t," ");default:return""}}y(),y(),l(oD,"vortexDirectionTest");var tv=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){D(this,"node"),D(this,"instruction"),D(this,"action"),D(this,"atLocation"),D(this,"type"),D(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=e&&"Departure"===e.type?this.instruction=null!=r?"Depart from ".concat(r.name):"Depart from current location":null!=e&&"Arrival"===e.type?this.instruction=null!=r?"Arrive at ".concat(r.name):"Arrive at destination":null!=e&&"TakeVortex"===e.type?this.instruction="Take ".concat(r&&r.name," ").concat(oD(e.direction),"to ").concat(e.toMap.name):null!=e&&"ExitVortex"===e.type?this.instruction="Exit ".concat(r&&r.name," at ").concat(e.toMap.name):null!=e&&"bearing"in e&&"Right"===e.bearing?this.instruction="Turn right":null!=e&&"bearing"in e&&"SlightRight"===e.bearing?this.instruction="Turn slightly right":null!=e&&"bearing"in e&&"Straight"===e.bearing?this.instruction="Head straight":null!=e&&"bearing"in e&&"SlightLeft"===e.bearing?this.instruction="Turn slightly left":null!=e&&"bearing"in e&&"Left"===e.bearing&&(this.instruction="Turn left"),null!=e&&"Turn"===e.type&&r&&(this.instruction+=" at ".concat(r.name)))}};l(tv,"Directive");var ev=tv,ms=ev;function rv(t,e,n,r){if(!(t&&e&&n&&r))return null;let i=t.x,o=t.y,s=e.x,a=e.y,l=n.x,u=n.y,c=r.x,h=r.y;if(i===s&&o===a||l===c&&u===h)return null;let p=(h-u)*(s-i)-(c-l)*(a-o);if(0===p)return null;let f=((c-l)*(o-u)-(h-u)*(i-l))/p,d=((s-i)*(o-u)-(a-o)*(i-l))/p;return f<0||f>1||d<0||d>1?null:{x:i+f*(s-i),y:o+f*(a-o)}}function BM(t,e,n){if(t.x===e.x)return[{x:t.x+n,y:t.y},{x:e.x+n,y:e.y}];if(t.y===e.y)return[{x:t.x,y:t.y+n},{x:e.x,y:e.y+n}];let r=-1/((e.y-t.y)/(e.x-t.x)),i=n*Math.sqrt(1/(1+r*r)),o=r*i;return[{x:t.x+i,y:t.y+o},{x:e.x+i,y:e.y+o}]}function jM(t,e,n=[],r=0){let i=!0;return n.forEach((n=>{if(r>0){let o=BM(t,e,-r),s=BM(t,e,r);if(rv(o[0],o[1],n[0],n[1])||rv(s[0],s[1],n[0],n[1]))return void(i=!1)}else if(rv(t,e,n[0],n[1]))return void(i=!1)})),i}y(),l(rv,"getLineIntersection"),l(BM,"getOffsetLine"),l(jM,"hasLineOfSight");var Ld=.1*Math.PI;function Rd(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}l(Rd,"differenceBetweenAngles");var ov=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,polygons:i,showVortexNames:o}){D(this,"graph"),D(this,"locationsByNodeId"),D(this,"geometryEdgesByMapId",new Map),this.graph=new Zy({maps:r,nodes:e,showVortexNames:o,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{}),i&&i.forEach((t=>{this.geometryEdgesByMapId.has(t.map)||this.geometryEdgesByMapId.set(t.map,[]),t.vertexes.forEach(((e,n)=>{t.vertexes[n+1]?this.geometryEdgesByMapId.get(t.map).push([e,t.vertexes[n+1]]):this.geometryEdgesByMapId.get(t.map).push([e,t.vertexes[0]])}))}))}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let r=0,i=0,o=t;for(;Math.abs(r)<e&&i<n;){let t=this.graph.edges[o.destination.id],s=null,a=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-Rd(o.angle,e.angle);Math.abs(t)<Math.abs(a)&&(s=e,a=t)}else s=e,a=-Rd(o.angle,e.angle);if(null==s)return null;{if(Math.abs(a)>=e||(r+=a,i+=s.distance,Math.abs(r)>=e||i>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;o=s}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:r,arriveAt:i,includedVortexIds:o,excludedVortexIds:s,simplify:a}){var l,u,c;let h=this.graph.aStar({originIds:t,destinationNodeIds:e,accessible:n,includedVortexIds:o,excludedVortexIds:s});if(0===h.length)return{distance:0,instructions:[new ms({distance:0,instruction:"No Valid Path Available"})],path:[]};let p=0,f=[],d=[];if(null!=a&&a.enabled){let t=null!=(l=null==a?void 0:a.bufferRadius)?l:1.8,e=[h[0]];for(let n=1;n<h.length;n++){if(h[n].origin.map!==h[n-1].origin.map){let r=null!=(u=this.geometryEdgesByMapId.get(h[n-1].origin.map))?u:[];d.push(...this.simplifySteps(e,r,t)),e=[h[n]]}e.push(h[n])}let n=h[h.length-1],r=null!=(c=this.geometryEdgesByMapId.get(n.origin.map))?c:[];d.push(...this.simplifySteps(e,r,t)),h=d}for(let t=0;t<h.length;t++)f.push(h[t].origin);f.push(h[h.length-1].destination);let g=[],y=null,v=null,m=0,_=0;for(let t=0;t<h.length;t++){let e=h[t],n=e.origin,o=e.destination;if(p+=e.distance,m+=(null==v?void 0:v.distance)||0,0===t&&g.push(new ms({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i="down":e<0&&(i="up")}g.push(new ms({action:{direction:i,fromMap:t,toMap:r,type:"TakeVortex"},atLocation:e.vortex,distance:m,origin:n})),_+=m,m=0}else if(null!=y&&null!=v)if(null!=v.vortex){let t=this.graph.mapsById[y.map],e=this.graph.mapsById[v.destination.map];g.push(new ms({action:{fromMap:t,toMap:e,type:"ExitVortex"},atLocation:v.vortex,distance:m,origin:n})),_+=m,m=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==y&&t.destination!==e.destination));if(t.length>0){let r=-Rd(v.angle,e.angle),i=t.reduce(((t,n)=>{let r=-Rd(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Ld||Math.abs(i)<=Ld){let t;t=r<=-Math.PI/4?"Right":r<=-Ld?"SlightRight":r<=Ld?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(v,.5*Math.PI,10)),null!=e){let r=new ms({action:{bearing:t,referencePosition:"At",type:"Turn"},atLocation:e,distance:m,origin:n});r.type=t,g.push(r)}else g.push(new ms({action:{bearing:t,referencePosition:"At",type:"Turn"},distance:m,origin:n}));_+=m,m=0}}}t===h.length-1&&(g.push(new ms({action:{type:"Arrival"},atLocation:i,distance:p-_<0?0:p-_,origin:e.destination})),_+=m,m=0),y=n,v=e}let b=[],w=null;for(let t=g.length-1;t>=0;t--){let e=g[t],{action:n}=e;n&&"TakeVortex"===n.type?(w=e.node,b.unshift(e)):n&&"Turn"===n.type&&null!=w?this.graph.getDistance(e.node,w)>5&&b.unshift(e):b.unshift(e)}return{distance:p,instructions:b,path:f}}simplifySteps(t,e,n){if(t.length<3)return t;let r=[t[0]],i=1;for(let o=i+2;o<t.length;o++)if(!jM(t[i].origin,t[o].origin,e,n)){let e=o-1;r.push(new Zs({...t[i],destination:t[e].origin,distance:this.graph.getDistance(t[i].origin,t[e].origin),angle:Ad(t[i].origin,t[e].origin)})),i=e}return r.push(new Zs({...t[i],destination:t[t.length-1].origin,distance:this.graph.getDistance(t[i].origin,t[t.length-1].origin),angle:Ad(t[i].origin,t[t.length-1].origin)}),t[t.length-1]),r}};l(ov,"Navigator");var nv=ov,iv=nv;y(),y();var Aa,Yc,av,Dd,qM,sv=class{constructor(t){oe(this,Yc),oe(this,Dd),oe(this,Aa,void 0),le(this,Aa,t)}directionsTo(t,e){let n=B(this,Aa).analytics;return t instanceof uo?0===t.destinations.length?[]:(n.getDirections(this,t.destinations[t.destinations.length-1]),wr(this,Dd,qM).call(this,t,e)):(n.getDirections(this,t),wr(this,Yc,av).call(this,t,e))}distanceTo(t,e){let n=wr(this,Yc,av).call(this,t,e);return(null==n?void 0:n.distance)||0}};Aa=new WeakMap,Yc=new WeakSet,av=l((function(t,e){let n=Xc(this),r=Xc(t),i=B(this,Aa).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1,includedVortexIds:null!=e&&e.includedVortexIds?new Set(e.includedVortexIds):void 0,excludedVortexIds:null!=e&&e.excludedVortexIds?new Set(e.excludedVortexIds):void 0,simplify:null==e?void 0:e.simplify});return new Qs(B(this,Aa),i)}),"#directionsToSingleDestination"),Dd=new WeakSet,qM=l((function(t,e){let n,r=[],i=Xc(this);for(let o=0;o<t.destinations.length;o++){n=Xc(t.destinations[o]);let s=B(this,Aa).navigator.getDirections({originIds:i,destinationNodeIds:n,includedVortexIds:null!=e&&e.includedVortexIds?new Set(e.includedVortexIds):void 0,excludedVortexIds:null!=e&&e.excludedVortexIds?new Set(e.excludedVortexIds):void 0,accessible:(null==e?void 0:e.accessible)||!1,simplify:null==e?void 0:e.simplify}),a=new Qs(B(this,Aa),s);r.push(a),i=0===a.path.length?n:[a.path[a.path.length-1].id]}return r}),"#directionsToDestinationSet"),l(sv,"MappedinNavigatable");var Qo=sv;y(),y(),y(),y(),y();var uv=l((function(t,e){return(uv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)}),"extendStatics");function ys(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uv(t,e),l(n,"__"),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}l(ys,"__extends");var $t=l((function(){return $t=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),$t.apply(this,arguments)}),"__assign");function Er(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function Mr(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function GM(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function UM(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(Er,"__awaiter"),l(Mr,"__generator"),l(GM,"__values"),l(UM,"__read"),y(),y(),y();var vs,An,La,_s,di,ki,Or,Ju,Ir=l((function(){return Ir=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),Ir.apply(this,arguments)}),"__assign");function VM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function zr(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function qr(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function ea(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Lo(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}l(VM,"__rest"),l(zr,"__awaiter"),l(qr,"__generator"),l(ea,"__values"),l(hi,"__read"),l(Lo,"__spreadArray"),y(),y(),y(),function(t){t.US="US",t.EU="EU"}(vs||(vs={})),y(),function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"}(An||(An={})),function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"}(La||(La={})),function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}(_s||(_s={})),y(),function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"}(di||(di={})),y(),function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(ki||(ki={})),y(),function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(Or||(Or={})),y(),function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(Ju||(Ju={})),y(),y();var lv="-",Wc="AMP",XM="".concat(Wc,"_unsent"),cv="https://api2.amplitude.com/2/httpapi",YM="https://api.eu.amplitude.com/2/httpapi",WM="https://api2.amplitude.com/batch",HM="https://api.eu.amplitude.com/batch";y();var sD=1e3,Fd=l((function(t){if(Object.keys(t).length>sD)return!1;for(var e in t){var n=t[e];if(!fv(e,n))return!1}return!0}),"isValidObject"),fv=l((function(t,e){var n,r;if("string"!=typeof t)return!1;if(Array.isArray(e)){var i=!0;try{for(var o=ea(e),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Fd(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==e)return!1;if("object"==typeof e)return Fd(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0}),"isValidProperties"),Ro=function(){function t(){this._propertySet=new Set,this._properties={}}return l(t,"Identify"),t.prototype.getUserProperties=function(){return Ir({},this._properties)},t.prototype.set=function(t,e){return this._safeSet(An.SET,t,e),this},t.prototype.setOnce=function(t,e){return this._safeSet(An.SET_ONCE,t,e),this},t.prototype.append=function(t,e){return this._safeSet(An.APPEND,t,e),this},t.prototype.prepend=function(t,e){return this._safeSet(An.PREPEND,t,e),this},t.prototype.postInsert=function(t,e){return this._safeSet(An.POSTINSERT,t,e),this},t.prototype.preInsert=function(t,e){return this._safeSet(An.PREINSERT,t,e),this},t.prototype.remove=function(t,e){return this._safeSet(An.REMOVE,t,e),this},t.prototype.add=function(t,e){return this._safeSet(An.ADD,t,e),this},t.prototype.unset=function(t){return this._safeSet(An.UNSET,t,lv),this},t.prototype.clearAll=function(){return this._properties={},this._properties[An.CLEAR_ALL]=lv,this},t.prototype._safeSet=function(t,e,n){if(this._validate(t,e,n)){var r=this._properties[t];return void 0===r&&(r={},this._properties[t]=r),r[e]=n,this._propertySet.add(e),!0}return!1},t.prototype._validate=function(t,e,n){return void 0===this._properties[An.CLEAR_ALL]&&!this._propertySet.has(e)&&(t===An.ADD?"number"==typeof n:t===An.UNSET||t===An.REMOVE||fv(e,n))},t}(),$M=l((function(t,e,n){return Ir(Ir(Ir({},"string"==typeof t?{event_type:t}:t),n),e&&{event_properties:e})}),"createTrackEvent"),Hc=l((function(t,e){return Ir(Ir({},e),{event_type:_s.IDENTIFY,user_properties:t.getUserProperties()})}),"createIdentifyEvent"),KM=l((function(t,e,n,r){var i;return Ir(Ir({},r),{event_type:_s.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)})}),"createGroupIdentifyEvent"),JM=l((function(t,e,n){var r,i=new Ro;return i.set(t,e),Ir(Ir({},n),{event_type:_s.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)})}),"createGroupEvent"),ZM=l((function(t,e){return Ir(Ir({},e),{event_type:_s.REVENUE,event_properties:t.getEventProperties()})}),"createRevenueEvent");y(),y();var bs=l((function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=Or.Unknown),{event:t,code:e,message:n}}),"buildResult"),QM=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return l(t,"Timeline"),t.prototype.register=function(t,e){return zr(this,void 0,void 0,(function(){return qr(this,(function(n){switch(n.label){case 0:return[4,t.setup(e)];case 1:return n.sent(),this.plugins.push(t),[2]}}))}))},t.prototype.deregister=function(t){return this.plugins.splice(this.plugins.findIndex((function(e){return e.name===t})),1),Promise.resolve()},t.prototype.reset=function(){this.applying=!1,this.plugins=[]},t.prototype.push=function(t){var e=this;return new Promise((function(n){e.queue.push([t,n]),e.scheduleApply(0)}))},t.prototype.scheduleApply=function(t){var e=this;this.applying||(this.applying=!0,setTimeout((function(){e.apply(e.queue.shift()).then((function(){e.applying=!1,e.queue.length>0&&e.scheduleApply(0)}))}),t))},t.prototype.apply=function(t){return zr(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m;return qr(this,(function(_){switch(_.label){case 0:if(!t)return[2];e=hi(t,1),n=e[0],r=hi(t,2),i=r[1],o=this.plugins.filter((function(t){return t.type===ki.BEFORE})),_.label=1;case 1:_.trys.push([1,6,7,8]),s=ea(o),a=s.next(),_.label=2;case 2:return a.done?[3,5]:[4,a.value.execute(Ir({},n))];case 3:n=_.sent(),_.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return l=_.sent(),g={error:l},[3,8];case 7:try{a&&!a.done&&(y=s.return)&&y.call(s)}finally{if(g)throw g.error}return[7];case 8:u=this.plugins.filter((function(t){return t.type===ki.ENRICHMENT})),_.label=9;case 9:_.trys.push([9,14,15,16]),c=ea(u),h=c.next(),_.label=10;case 10:return h.done?[3,13]:[4,h.value.execute(Ir({},n))];case 11:n=_.sent(),_.label=12;case 12:return h=c.next(),[3,10];case 13:return[3,16];case 14:return p=_.sent(),v={error:p},[3,16];case 15:try{h&&!h.done&&(m=c.return)&&m.call(c)}finally{if(v)throw v.error}return[7];case 16:return f=this.plugins.filter((function(t){return t.type===ki.DESTINATION})),d=f.map((function(t){var e=Ir({},n);return t.execute(e).catch((function(t){return bs(e,0,String(t))}))})),Promise.all(d).then((function(t){var e=hi(t,1)[0];i(e)})),[2]}}))}))},t.prototype.flush=function(){return zr(this,void 0,void 0,(function(){var t,e,n,r=this;return qr(this,(function(i){switch(i.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map((function(t){return r.apply(t)})))];case 1:return i.sent(),e=this.plugins.filter((function(t){return t.type===ki.DESTINATION})),n=e.map((function(t){return t.flush&&t.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},t}();y();var eI="Event tracked successfully",tI="Unexpected error occurred",rI="Event rejected due to exceeded retry count",nI="Event skipped due to optOut config",iI="Event rejected due to missing API key",oI="Invalid API key",aI="Client not initialized",pv=function(){function t(t){void 0===t&&(t="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new QM,this.name=t}return l(t,"AmplitudeCore"),t.prototype._init=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){switch(e.label){case 0:return this.config=t,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return e.sent(),[2]}}))}))},t.prototype.runQueuedFunctions=function(t){return zr(this,void 0,void 0,(function(){var e,n,r,i,o,s;return qr(this,(function(a){switch(a.label){case 0:e=this[t],this[t]=[],a.label=1;case 1:a.trys.push([1,6,7,8]),n=ea(e),r=n.next(),a.label=2;case 2:return r.done?[3,5]:[4,(0,r.value)()];case 3:a.sent(),a.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return i=a.sent(),o={error:i},[3,8];case 7:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},t.prototype.track=function(t,e,n){var r=$M(t,e,n);return this.dispatch(r)},t.prototype.identify=function(t,e){var n=Hc(t,e);return this.dispatch(n)},t.prototype.groupIdentify=function(t,e,n,r){var i=KM(t,e,n,r);return this.dispatch(i)},t.prototype.setGroup=function(t,e,n){var r=JM(t,e,n);return this.dispatch(r)},t.prototype.revenue=function(t,e){var n=ZM(t,e);return this.dispatch(n)},t.prototype.add=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.config?[2,this.timeline.register(t,this.config)]:(this.q.push(this.add.bind(this,t)),[2])}))}))},t.prototype.remove=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.config?[2,this.timeline.deregister(t)]:(this.q.push(this.remove.bind(this,t)),[2])}))}))},t.prototype.dispatchWithCallback=function(t,e){if(!this.config)return e(bs(t,0,aI));this.process(t).then(e)},t.prototype.dispatch=function(t){return zr(this,void 0,void 0,(function(){var e=this;return qr(this,(function(n){return this.config?[2,this.process(t)]:[2,new Promise((function(n){e.dispatchQ.push(e.dispatchWithCallback.bind(e,t,n))}))]}))}))},t.prototype.process=function(t){return zr(this,void 0,void 0,(function(){var e,n,r;return qr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,bs(t,0,nI)]:[4,this.timeline.push(t)];case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return e=i.sent(),n=String(e),this.config.loggerProvider.error(n),[2,r=bs(t,0,n)];case 3:return[2]}}))}))},t.prototype.setOptOut=function(t){this.config?this.config.optOut=!!t:this.q.push(this.setOptOut.bind(this,!!t))},t.prototype.flush=function(){return this.timeline.flush()},t}();y();var Bd=function(){function t(){this.productId="",this.quantity=1,this.price=0}return l(t,"Revenue"),t.prototype.setProductId=function(t){return this.productId=t,this},t.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},t.prototype.setPrice=function(t){return this.price=t,this},t.prototype.setRevenueType=function(t){return this.revenueType=t,this},t.prototype.setRevenue=function(t){return this.revenue=t,this},t.prototype.setEventProperties=function(t){return Fd(t)&&(this.properties=t),this},t.prototype.getEventProperties=function(){var t=this.properties?Ir({},this.properties):{};return t[La.REVENUE_PRODUCT_ID]=this.productId,t[La.REVENUE_QUANTITY]=this.quantity,t[La.REVENUE_PRICE]=this.price,t[La.REVENUE_TYPE]=this.revenueType,t[La.REVENUE]=this.revenue,t},t}();y(),y();var sI=l((function(t,e){var n=Math.max(e,1);return t.reduce((function(t,e,r){var i=Math.floor(r/n);return t[i]||(t[i]=[]),t[i].push(e),t}),[])}),"chunk");y(),y();var jd="Amplitude Logger ",uI=function(){function t(){this.logLevel=di.None}return l(t,"Logger"),t.prototype.disable=function(){this.logLevel=di.None},t.prototype.enable=function(t){void 0===t&&(t=di.Warn),this.logLevel=t},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Verbose||console.log("".concat(jd,"[Log]: ").concat(t.join(" ")))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Warn||console.warn("".concat(jd,"[Warn]: ").concat(t.join(" ")))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Error||console.error("".concat(jd,"[Error]: ").concat(t.join(" ")))},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Debug||console.log("".concat(jd,"[Debug]: ").concat(t.join(" ")))},t}(),zd=l((function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:di.Warn,loggerProvider:new uI,optOut:!1,serverUrl:cv,serverZone:vs.US,useBatch:!1}}),"getDefaultConfig"),hv=function(){function t(t){var e,n,r;this._optOut=!1;var i=zd();this.apiKey=t.apiKey,this.flushIntervalMillis=t.flushIntervalMillis||i.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||i.flushQueueSize,this.loggerProvider=t.loggerProvider||i.loggerProvider,this.logLevel=null!==(e=t.logLevel)&&void 0!==e?e:i.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.optOut=null!==(n=t.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||i.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=null!==(r=t.useBatch)&&void 0!==r?r:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=dv(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return l(t,"Config"),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t},enumerable:!1,configurable:!0}),t}(),uD=l((function(t,e){return t===vs.EU?e?HM:YM:e?WM:cv}),"getServerUrl"),dv=l((function(t,e,n){if(void 0===t&&(t=""),void 0===e&&(e=zd().serverZone),void 0===n&&(n=zd().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=[vs.US,vs.EU].includes(e)?e:zd().serverZone;return{serverZone:r,serverUrl:uD(r,n)}}),"createServerConfig"),gv=function(){function t(){this.name="amplitude",this.type=ki.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return l(t,"Destination"),t.prototype.setup=function(t){var e;return zr(this,void 0,void 0,(function(){var n,r=this;return qr(this,(function(i){switch(i.label){case 0:return this.config=t,this.storageKey="".concat(XM,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(e=this.config.storageProvider)||void 0===e?void 0:e.get(this.storageKey)];case 1:return n=i.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map((function(t){return r.execute(t)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},t.prototype.execute=function(t){var e=this;return new Promise((function(n){var r={event:t,attempts:0,callback:function(t){return n(t)},timeout:0};e.addToQueue(r)}))},t.prototype.addToQueue=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.filter((function(e){return e.attempts<t.config.flushMaxRetries?(e.attempts+=1,!0):(t.fulfillRequest([e],500,rI),!1)}));r.forEach((function(e){t.queue=t.queue.concat(e),0!==e.timeout?setTimeout((function(){e.timeout=0,t.schedule(0)}),e.timeout):t.schedule(t.config.flushIntervalMillis)})),this.saveEvents()},t.prototype.schedule=function(t){var e=this;this.scheduled||(this.scheduled=setTimeout((function(){e.flush(!0).then((function(){e.queue.length>0&&e.schedule(t)}))}),t))},t.prototype.flush=function(t){return void 0===t&&(t=!1),zr(this,void 0,void 0,(function(){var e,n,r,i=this;return qr(this,(function(o){switch(o.label){case 0:return e=[],n=[],this.queue.forEach((function(t){return 0===t.timeout?e.push(t):n.push(t)})),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),r=sI(e,this.config.flushQueueSize),[4,Promise.all(r.map((function(e){return i.send(e,t)})))];case 1:return o.sent(),[2]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e=!0),zr(this,void 0,void 0,(function(){var n,r,i,o,s;return qr(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,iI)];n={api_key:this.config.apiKey,events:t.map((function(t){var e=t.event;e.extra;return VM(e,["extra"])})),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),r=dv(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:if(null===(i=a.sent()))return this.fulfillRequest(t,0,tI),[2];if(!e){if("body"in i){o="";try{o=JSON.stringify(i.body,null,2)}catch{}this.fulfillRequest(t,i.statusCode,"".concat(i.status,": ").concat(o))}else this.fulfillRequest(t,i.statusCode,i.status);return[2]}return this.handleReponse(i,t),[3,4];case 3:return s=a.sent(),this.fulfillRequest(t,0,String(s)),[3,4];case 4:return[2]}}))}))},t.prototype.handleReponse=function(t,e){switch(t.status){case Or.Success:this.handleSuccessResponse(t,e);break;case Or.Invalid:this.handleInvalidResponse(t,e);break;case Or.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,e);break;case Or.RateLimit:this.handleRateLimitResponse(t,e);break;default:this.handleOtherReponse(e)}},t.prototype.handleSuccessResponse=function(t,e){this.fulfillRequest(e,t.statusCode,eI)},t.prototype.handleInvalidResponse=function(t,e){var n=this;if(t.body.missingField||t.body.error.startsWith(oI))this.fulfillRequest(e,t.statusCode,t.body.error);else{var r=Lo(Lo(Lo(Lo([],hi(Object.values(t.body.eventsWithInvalidFields)),!1),hi(Object.values(t.body.eventsWithMissingFields)),!1),hi(Object.values(t.body.eventsWithInvalidIdLengths)),!1),hi(t.body.silencedEvents),!1).flat(),i=new Set(r),o=e.filter((function(e,r){if(!i.has(r))return!0;n.fulfillRequest([e],t.statusCode,t.body.error)}));this.addToQueue.apply(this,Lo([],hi(o),!1))}},t.prototype.handlePayloadTooLargeResponse=function(t,e){1!==e.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,Lo([],hi(e),!1))):this.fulfillRequest(e,t.statusCode,t.body.error)},t.prototype.handleRateLimitResponse=function(t,e){var n=this,r=Object.keys(t.body.exceededDailyQuotaUsers),i=Object.keys(t.body.exceededDailyQuotaDevices),o=t.body.throttledEvents,s=new Set(r),a=new Set(i),l=new Set(o),u=e.filter((function(e,r){if(!(e.event.user_id&&s.has(e.event.user_id)||e.event.device_id&&a.has(e.event.device_id)))return l.has(r)&&(e.timeout=n.throttleTimeout),!0;n.fulfillRequest([e],t.statusCode,t.body.error)}));this.addToQueue.apply(this,Lo([],hi(u),!1))},t.prototype.handleOtherReponse=function(t){var e=this;this.addToQueue.apply(this,Lo([],hi(t.map((function(t){return t.timeout=t.attempts*e.retryTimeout,t}))),!1))},t.prototype.fulfillRequest=function(t,e,n){this.saveEvents(),t.forEach((function(t){return t.callback(bs(t.event,e,n))}))},t.prototype.saveEvents=function(){if(this.config.storageProvider){var t=Array.from(this.queue.map((function(t){return t.event})));this.config.storageProvider.set(this.storageKey,t)}},t}();y();var lo=l((function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,Lo([],hi(e),!1))}}}),"returnWrapper");y();var lD=l((function(t){return void 0===t&&(t=0),((new Error).stack||"").split("\n").slice(2+t).map((function(t){return t.trim()}))}),"getStacktrace"),$r=l((function(t){return function(){var e=Ir({},t.config);return{logger:e.loggerProvider,logLevel:e.logLevel}}}),"getClientLogConfig"),cD=l((function(t,e){var n,r;e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=ea(e.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in t))return;t=t[s]}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t}),"getValueByStringPath"),Kr=l((function(t,e){return function(){var n,r,i={};try{for(var o=ea(e),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=cD(t,a)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}}),"getClientStates"),Jr=l((function(t,e,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<di.Debug||!u||!l)return t.apply(i,o);var c={type:"invoke public method",name:e,args:o,stacktrace:lD(1),time:{start:(new Date).toISOString()},states:{}};r&&c.states&&(c.states.before=r());var h=t.apply(i,o);return h&&h.promise?h.promise.then((function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))})):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}}),"debugWrapper");y();var xs=l((function(t){return t?(t^16*Math.random()>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,xs)}),"UUID");y();var $c=function(){function t(){this.memoryStorage=new Map}return l(t,"MemoryStorage"),t.prototype.isEnabled=function(){return zr(this,void 0,void 0,(function(){return qr(this,(function(t){return[2,!0]}))}))},t.prototype.get=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return[2,this.memoryStorage.get(t)]}))}))},t.prototype.getRaw=function(t){return zr(this,void 0,void 0,(function(){var e;return qr(this,(function(n){switch(n.label){case 0:return[4,this.get(t)];case 1:return[2,(e=n.sent())?JSON.stringify(e):void 0]}}))}))},t.prototype.set=function(t,e){return zr(this,void 0,void 0,(function(){return qr(this,(function(n){return this.memoryStorage.set(t,e),[2]}))}))},t.prototype.remove=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.memoryStorage.delete(t),[2]}))}))},t.prototype.reset=function(){return zr(this,void 0,void 0,(function(){return qr(this,(function(t){return this.memoryStorage.clear(),[2]}))}))},t}();y();var eu=function(){function t(){}return l(t,"BaseTransport"),t.prototype.send=function(t,e){return Promise.resolve(null)},t.prototype.buildResponse=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m,_,b,w,x;if("object"!=typeof t)return null;var E=t.code||0,I=this.buildStatus(E);switch(I){case Or.Success:return{status:I,statusCode:E,body:{eventsIngested:null!==(e=t.events_ingested)&&void 0!==e?e:0,payloadSizeBytes:null!==(n=t.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=t.server_upload_time)&&void 0!==r?r:0}};case Or.Invalid:return{status:I,statusCode:E,body:{error:null!==(i=t.error)&&void 0!==i?i:"",missingField:null!==(o=t.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=t.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=t.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=t.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=t.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=t.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=t.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(p=t.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=t.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(d=t.throttled_events)&&void 0!==d?d:[]}};case Or.PayloadTooLarge:return{status:I,statusCode:E,body:{error:null!==(g=t.error)&&void 0!==g?g:""}};case Or.RateLimit:return{status:I,statusCode:E,body:{error:null!==(y=t.error)&&void 0!==y?y:"",epsThreshold:null!==(v=t.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(m=t.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(_=t.throttled_users)&&void 0!==_?_:{},exceededDailyQuotaDevices:null!==(b=t.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(w=t.exceeded_daily_quota_users)&&void 0!==w?w:{},throttledEvents:null!==(x=t.throttled_events)&&void 0!==x?x:[]}};case Or.Timeout:default:return{status:I,statusCode:E}}},t.prototype.buildStatus=function(t){return t>=200&&t<300?Or.Success:429===t?Or.RateLimit:413===t?Or.PayloadTooLarge:408===t?Or.Timeout:t>=400&&t<500?Or.Invalid:t>=500?Or.Failed:Or.Unknown},t}();y(),y(),y();var mv=l((function(t,e){return(mv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)}),"extendStatics");function lI(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}mv(t,e),l(n,"__"),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}l(lI,"__extends");var Xn=l((function(){return Xn=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),Xn.apply(this,arguments)}),"__assign");function yv(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function mn(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function yn(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function cI(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(yv,"__rest"),l(mn,"__awaiter"),l(yn,"__generator"),l(cI,"__read"),y(),y();var gi=l((function(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:void 0}),"getGlobalScope"),Zu=l((function(){var t,e=gi();return null!==(t=null==e?void 0:e.location)&&void 0!==t&&t.search?e.location.search.substring(1).split("&").filter(Boolean).reduce((function(t,e){var n=e.split("=",2),r=fI(n[0]),i=fI(n[1]);return i&&(t[r]=i),t}),{}):{}}),"getQueryParams"),fI=l((function(t){void 0===t&&(t="");try{return decodeURIComponent(t)}catch{return""}}),"tryDecodeURIComponent");y();var pI="utm_campaign",hI="utm_content",dI="utm_id",gI="utm_medium",mI="utm_source",yI="utm_term",vv="dclid",_v="fbclid",bv="gbraid",xv="gclid",wv="ko_click_id",Ev="msclkid",Mv="ttclid",Iv="twclid",Pv="wbraid",vI="EMPTY",qd={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},_I="MKTG",bI=function(){function t(){}return l(t,"CampaignParser"),t.prototype.parse=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){return[2,Xn(Xn(Xn(Xn({},qd),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},t.prototype.getUtmParam=function(){var t=Zu();return{utm_campaign:t[pI],utm_content:t[hI],utm_id:t[dI],utm_medium:t[gI],utm_source:t[mI],utm_term:t[yI]}},t.prototype.getReferrer=function(){var t,e,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(e=null===(t=n.referrer)||void 0===t?void 0:t.split("/")[2])&&void 0!==e?e:void 0}catch{}return n},t.prototype.getClickIds=function(){var t,e=Zu();return(t={})[vv]=e[vv],t[_v]=e[_v],t[bv]=e[bv],t[xv]=e[xv],t[wv]=e[wv],t[Ev]=e[Ev],t[Mv]=e[Mv],t[Iv]=e[Iv],t[Pv]=e[Pv],t},t}();y(),y();var tu=l((function(t,e,n){return void 0===e&&(e=""),void 0===n&&(n=10),[Wc,e,t.substring(0,n)].filter(Boolean).join("_")}),"getCookieName"),Sv=l((function(t){return"".concat(Wc.toLowerCase(),"_").concat(t.substring(0,6))}),"getOldCookieName"),Cv=function(){function t(t,e){var n,r;this.storage=e.storage,this.storageKey=tu(t,_I),this.parser=new bI,this.track=e.track,this.onNewCampaign=e.onNewCampaign,this.disabled=!!e.disabled,this.trackNewCampaigns=!!e.trackNewCampaigns,this.trackPageViews=!!e.trackPageViews,this.excludeReferrers=null!==(n=e.excludeReferrers)&&void 0!==n?n:[],typeof location<"u"&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(r=e.initialEmptyValue)&&void 0!==r?r:vI}return l(t,"CampaignTracker"),t.prototype.isNewCampaign=function(t,e,n){void 0===n&&(n=!1);t.referrer;var r=t.referring_domain,i=yv(t,["referrer","referring_domain"]),o=e||{},s=(o.referrer,o.referring_domain),a=yv(o,["referrer","referring_domain"]);if(t.referring_domain&&this.excludeReferrers.includes(t.referring_domain))return!1;var l=JSON.stringify(i)!==JSON.stringify(a),u=n?xI(r||"")!==xI(s||""):r!==s;return!e||l||u},t.prototype.saveCampaignToStorage=function(t){return mn(this,void 0,void 0,(function(){return yn(this,(function(e){switch(e.label){case 0:return[4,this.storage.set(this.storageKey,t)];case 1:return e.sent(),[2]}}))}))},t.prototype.getCampaignFromStorage=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,t.sent()]}}))}))},t.prototype.createCampaignEvent=function(t){var e=this,n=Xn(Xn({},qd),t),r=Object.entries(n).reduce((function(t,n){var r=cI(n,2),i=r[0],o=r[1];return t.setOnce("initial_".concat(i),o||e.initialEmptyValue),o?t.set(i,o):t.unset(i)}),new Ro),i={event_type:"Page View",event_properties:{page_title:typeof document<"u"&&document.title||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||""}};return Xn(Xn({},Hc(r)),this.trackPageViews&&i)},t.prototype.send=function(t){return mn(this,void 0,void 0,(function(){var e,n;return yn(this,(function(r){switch(r.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return e=r.sent(),[4,this.getCampaignFromStorage()];case 2:if(n=r.sent(),!t){if(!this.trackNewCampaigns||!this.isNewCampaign(e,n))return[2];this.onNewCampaign(e)}return[4,this.track(this.createCampaignEvent(e))];case 3:return r.sent(),[4,this.saveCampaignToStorage(e)];case 4:return r.sent(),[2]}}))}))},t}(),xI=l((function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")}),"domainWithoutSubdomain");y();var ru=function(){function t(t){this.options=Xn({},t)}return l(t,"CookieStorage"),t.prototype.isEnabled=function(){return mn(this,void 0,void 0,(function(){var e,n,r;return yn(this,(function(i){switch(i.label){case 0:if(!gi())return[2,!1];e=String(Date.now()),n=new t(this.options),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===e];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},t.prototype.get=function(t){return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(t)];case 1:if(!(e=n.sent()))return[2,void 0];try{try{e=decodeURIComponent(atob(e))}catch{}return[2,JSON.parse(e)]}catch{return[2,void 0]}return[2]}}))}))},t.prototype.getRaw=function(t){var e;return mn(this,void 0,void 0,(function(){var n,r,i;return yn(this,(function(o){return n=gi(),r=null!==(e=null==n?void 0:n.document.cookie.split("; "))&&void 0!==e?e:[],(i=r.find((function(e){return 0===e.indexOf(t+"=")})))?[2,i.substring(t.length+1)]:[2,void 0]}))}))},t.prototype.set=function(t,e){var n;return mn(this,void 0,void 0,(function(){var r,i,o,s,a,l;return yn(this,(function(u){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==e?r:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(e)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(l=gi())&&(l.document.cookie=a)}catch{}return[2]}))}))},t.prototype.remove=function(t){return mn(this,void 0,void 0,(function(){return yn(this,(function(e){switch(e.label){case 0:return[4,this.set(t,null)];case 1:return e.sent(),[2]}}))}))},t.prototype.reset=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){return[2]}))}))},t}();y();var Gd=function(){function t(t,e){this.storage=t,this.storageKey=tu(e),this.cache={optOut:!1}}return l(t,"SessionManager"),t.prototype.load=function(){var t;return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){switch(n.label){case 0:return e=this,[4,this.storage.get(this.storageKey)];case 1:return e.cache=null!==(t=n.sent())&&void 0!==t?t:{optOut:!1},[2,this]}}))}))},t.prototype.setSession=function(t){this.cache=Xn(Xn({},this.cache),t),this.storage.set(this.storageKey,this.cache)},t.prototype.getSessionId=function(){return this.cache.sessionId},t.prototype.setSessionId=function(t){this.setSession({sessionId:t})},t.prototype.getDeviceId=function(){return this.cache.deviceId},t.prototype.setDeviceId=function(t){this.setSession({deviceId:t})},t.prototype.getUserId=function(){return this.cache.userId},t.prototype.setUserId=function(t){this.setSession({userId:t})},t.prototype.getLastEventTime=function(){return this.cache.lastEventTime},t.prototype.setLastEventTime=function(t){this.setSession({lastEventTime:t})},t.prototype.getOptOut=function(){return this.cache.optOut},t.prototype.setOptOut=function(t){this.setSession({optOut:t})},t.prototype.getLastEventId=function(){return this.cache.lastEventId},t.prototype.setLastEventId=function(t){this.setSession({lastEventId:t})},t}();y();var kv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lI(e,t),l(e,"FetchTransport"),e.prototype.send=function(t,e){return mn(this,void 0,void 0,(function(){var n,r;return yn(this,(function(i){switch(i.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return n={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(e),method:"POST"},[4,fetch(t,n)];case 1:return[4,i.sent().json()];case 2:return r=i.sent(),[2,this.buildResponse(r)]}}))}))},e}(eu);y(),y();var wI=er(Ov()),fD=function(){function t(){this.ua=new wI.UAParser(typeof navigator<"u"?navigator.userAgent:null).getResult()}return l(t,"ApplicationContextProviderImpl"),t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:dD(),platform:"Web",os:pD(this.ua),deviceModel:hD(this.ua)}},t}(),pD=l((function(t){var e,n;return[null===(e=t.browser)||void 0===e?void 0:e.name,null===(n=t.browser)||void 0===n?void 0:n.major].filter((function(t){return null!=t})).join(" ")}),"getOs"),hD=l((function(t){var e;return null===(e=t.os)||void 0===e?void 0:e.name}),"getDeviceModel"),dD=l((function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""}),"getLanguage"),gD=function(){function t(){this.queue=[]}return l(t,"EventBridgeImpl"),t.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},t.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach((function(e){t(e)})),this.queue=[])},t}(),ws=l((function(){return ws=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),ws.apply(this,arguments)}),"__assign"),Vd=l((function(t,e){var n=typeof t;if(n!==typeof e)return!1;for(var r=0,i=["string","number","boolean","undefined"];r<i.length;r++){if(i[r]===n)return t===e}if(null==t&&null==e)return!0;if(null==t||null==e||t.length!==e.length)return!1;var o=Array.isArray(t),s=Array.isArray(e);if(o!==s)return!1;if(!o||!s){var a=Object.keys(t).sort(),l=Object.keys(e).sort();if(!Vd(a,l))return!1;var u=!0;return Object.keys(t).forEach((function(n){Vd(t[n],e[n])||(u=!1)})),u}for(var c=0;c<t.length;c++)if(!Vd(t[c],e[c]))return!1;return!0}),"isEqual"),mD="$set",yD="$unset",vD="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r});var _D=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return l(t,"IdentityStoreImpl"),t.prototype.editIdentity=function(){var t=this,e=ws({},this.identity.userProperties),n=ws(ws({},this.identity),{userProperties:e});return{setUserId:function(t){return n.userId=t,this},setDeviceId:function(t){return n.deviceId=t,this},setUserProperties:function(t){return n.userProperties=t,this},updateUserProperties:function(t){for(var e=n.userProperties||{},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(s){case mD:for(var l=0,u=Object.entries(a);l<u.length;l++){var c=u[l],h=c[0],p=c[1];e[h]=p}break;case yD:for(var f=0,d=Object.keys(a);f<d.length;f++){delete e[h=d[f]]}break;case vD:e={}}}return n.userProperties=e,this},commit:function(){return t.setIdentity(n),this}}},t.prototype.getIdentity=function(){return ws({},this.identity)},t.prototype.setIdentity=function(t){var e=ws({},this.identity);this.identity=ws({},t),Vd(e,this.identity)||this.listeners.forEach((function(e){e(t)}))},t.prototype.addIdentityListener=function(t){this.listeners.add(t)},t.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},t}(),Jc=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,EI=function(){function t(){this.identityStore=new _D,this.eventBridge=new gD,this.applicationContextProvider=new fD}return l(t,"AnalyticsConnector"),t.getInstance=function(e){return Jc.analyticsConnectorInstances||(Jc.analyticsConnectorInstances={}),Jc.analyticsConnectorInstances[e]||(Jc.analyticsConnectorInstances[e]=new t),Jc.analyticsConnectorInstances[e]},t}(),Zc=l((function(){return EI.getInstance("$default_instance")}),"getAnalyticsConnector");y();var Nv=function(){function t(){this.name="identity",this.type=ki.BEFORE,this.identityStore=Zc().identityStore}return l(t,"IdentityEventSender"),t.prototype.execute=function(t){return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){return(e=t.user_properties)&&this.identityStore.editIdentity().updateUserProperties(e).commit(),[2,t]}))}))},t.prototype.setup=function(t){return Promise.resolve(void 0)},t}();y();var Tv=l((function(){var t,e,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(e=null===(t=navigator.languages)||void 0===t?void 0:t[0])&&void 0!==e?e:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""}),"getLanguage");y();var Xd=l((function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.name,o=r.args,s=r.resolve,a=t&&t[i];if("function"==typeof a){var l=a.apply(t,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return t}),"convertProxyObjectToRealObject"),Yd=l((function(t){return t&&void 0!==t._q}),"isInstanceProxy");y();var II=er(Ov());y();var MI="1.6.8",bD="Web",xD="$remote",PI=function(){function t(){var t;this.name="context",this.type=ki.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(MI),typeof navigator<"u"&&(t=navigator.userAgent),this.uaResult=new II.default(t).getResult()}return l(t,"Context"),t.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},t.prototype.execute=function(t){return Er(this,void 0,void 0,(function(){var e,n,r,i,o;return Mr(this,(function(s){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),e=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,i=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,[2,$t($t($t($t($t($t($t($t($t($t($t($t({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:e},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:bD}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:i}),this.config.trackingOptions.language&&{language:Tv()}),this.config.trackingOptions.ipAddress&&{ip:xD}),{insert_id:xs(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:this.eventId++,library:this.library})]}))}))},t.prototype.isSessionValid=function(){var t=this.config.lastEventTime||Date.now();return Date.now()-t<this.config.sessionTimeout},t}();y(),y();var Qc=function(){function t(){}return l(t,"LocalStorage"),t.prototype.isEnabled=function(){return Er(this,void 0,void 0,(function(){var e,n,r;return Mr(this,(function(i){switch(i.label){case 0:if(!gi())return[2,!1];e=String(Date.now()),n=new t,r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===e];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},t.prototype.get=function(t){return Er(this,void 0,void 0,(function(){var e;return Mr(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return(e=n.sent())?[2,JSON.parse(e)]:[2,void 0];case 2:return n.sent(),[2,void 0];case 3:return[2]}}))}))},t.prototype.getRaw=function(t){var e;return Er(this,void 0,void 0,(function(){return Mr(this,(function(n){return[2,(null===(e=gi())||void 0===e?void 0:e.localStorage.getItem(t))||void 0]}))}))},t.prototype.set=function(t,e){var n;return Er(this,void 0,void 0,(function(){return Mr(this,(function(r){try{null===(n=gi())||void 0===n||n.localStorage.setItem(t,JSON.stringify(e))}catch{}return[2]}))}))},t.prototype.remove=function(t){var e;return Er(this,void 0,void 0,(function(){return Mr(this,(function(n){try{null===(e=gi())||void 0===e||e.localStorage.removeItem(t)}catch{}return[2]}))}))},t.prototype.reset=function(){var t;return Er(this,void 0,void 0,(function(){return Mr(this,(function(e){try{null===(t=gi())||void 0===t||t.localStorage.clear()}catch{}return[2]}))}))},t}();y();var SI=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={done:4},e}return ys(e,t),l(e,"XHRTransport"),e.prototype.send=function(t,e){return Er(this,void 0,void 0,(function(){var n=this;return Mr(this,(function(r){return[2,new Promise((function(r,i){typeof XMLHttpRequest>"u"&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",t,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done)try{var t=o.responseText,e=JSON.parse(t),s=n.buildResponse(e);r(s)}catch(t){i(t)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(e))}))]}))}))},e}(eu);y();var CI=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ys(e,t),l(e,"SendBeaconTransport"),e.prototype.send=function(t,e){return Er(this,void 0,void 0,(function(){var n=this;return Mr(this,(function(r){return[2,new Promise((function(r,i){var o=gi();if(null==o||!o.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(e);return r(o.navigator.sendBeacon(t,JSON.stringify(e))?n.buildResponse({code:200,events_ingested:e.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(t){i(t)}}))]}))}))},e}(eu),Wd=l((function(){var t=new $c;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,disableCookies:!1,domain:"",sessionManager:new Gd(t,""),sessionTimeout:18e5,storageProvider:new $c,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new kv}}),"getDefaultConfig"),kI=function(t){function e(e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=this,v=Wd();return(y=t.call(this,$t($t({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:e,storageProvider:null!==(i=null==r?void 0:r.storageProvider)&&void 0!==i?i:v.storageProvider,transportProvider:null!==(o=null==r?void 0:r.transportProvider)&&void 0!==o?o:v.transportProvider}))||this).cookieStorage=null!==(s=null==r?void 0:r.cookieStorage)&&void 0!==s?s:v.cookieStorage,y.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:v.sessionManager,y.sessionTimeout=null!==(l=null==r?void 0:r.sessionTimeout)&&void 0!==l?l:v.sessionTimeout,y.appVersion=null==r?void 0:r.appVersion,y.attribution=null==r?void 0:r.attribution,y.cookieExpiration=null!==(u=null==r?void 0:r.cookieExpiration)&&void 0!==u?u:v.cookieExpiration,y.cookieSameSite=null!==(c=null==r?void 0:r.cookieSameSite)&&void 0!==c?c:v.cookieSameSite,y.cookieSecure=null!==(h=null==r?void 0:r.cookieSecure)&&void 0!==h?h:v.cookieSecure,y.deviceId=null==r?void 0:r.deviceId,y.disableCookies=null!==(p=null==r?void 0:r.disableCookies)&&void 0!==p?p:v.disableCookies,y.domain=null!==(f=null==r?void 0:r.domain)&&void 0!==f?f:v.domain,y.lastEventTime=null!==(d=y.lastEventTime)&&void 0!==d?d:null==r?void 0:r.lastEventTime,y.optOut=!(null==r||!r.optOut),y.partnerId=null==r?void 0:r.partnerId,y.sessionId=null==r?void 0:r.sessionId,y.trackingOptions=null!==(g=null==r?void 0:r.trackingOptions)&&void 0!==g?g:v.trackingOptions,y.userId=n,y}return ys(e,t),l(e,"BrowserConfig"),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(t){this.sessionManager.setDeviceId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(t){this.sessionManager.setUserId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(t){this.sessionManager.setSessionId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(t){var e;null===(e=this.sessionManager)||void 0===e||e.setOptOut(!!t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(t){this.sessionManager.setLastEventTime(t)},enumerable:!1,configurable:!0}),e}(hv),OI=l((function(t,e,n){return Er(void 0,void 0,void 0,(function(){var r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m,_;return Mr(this,(function(b){switch(b.label){case 0:return r=Wd(),null!==(g=null==n?void 0:n.domain)&&void 0!==g?(o=g,[3,3]):[3,1];case 1:return[4,ID()];case 2:o=b.sent(),b.label=3;case 3:return i=o,[4,wD($t($t({},n),{domain:i}))];case 4:return s=b.sent(),a=tu(t),[4,s.get(a)];case 5:return l=b.sent(),u=Zu(),[4,new Gd(s,t).load()];case 6:return c=b.sent(),h=kI.bind,p=[void 0,t,null!=e?e:null==l?void 0:l.userId],f=[$t({},n)],d={cookieStorage:s,sessionManager:c,deviceId:MD(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,u.deviceId),domain:i,optOut:null!==(y=null==n?void 0:n.optOut)&&void 0!==y?y:!(null==l||!l.optOut)},[4,s.get(a)];case 7:return d.sessionId=null!==(m=null===(v=b.sent())||void 0===v?void 0:v.sessionId)&&void 0!==m?m:null==n?void 0:n.sessionId,[4,ED(n)];case 8:return[2,new(h.apply(kI,p.concat([$t.apply(void 0,f.concat([(d.storageProvider=b.sent(),d.trackingOptions=$t($t({},r.trackingOptions),null==n?void 0:n.trackingOptions),d.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Lv(null==n?void 0:n.transport),d)]))])))]}}))}))}),"useBrowserConfig"),wD=l((function(t,e){return void 0===e&&(e=Wd()),Er(void 0,void 0,void 0,(function(){var n,r,i;return Mr(this,(function(o){switch(o.label){case 0:return n=$t($t({},e),t),r=null==t?void 0:t.cookieStorage,(i=!r)?[3,2]:[4,r.isEnabled()];case 1:i=!o.sent(),o.label=2;case 2:return i?[2,Av(n)]:[2,r]}}))}))}),"createCookieStorage"),Av=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n;return Mr(this,(function(r){switch(r.label){case 0:return e=new ru({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),(n=t.disableCookies)?[3,2]:[4,e.isEnabled()];case 1:n=!r.sent(),r.label=2;case 2:return n?[4,(e=new Qc).isEnabled()]:[3,4];case 3:r.sent()||(e=new $c),r.label=4;case 4:return[2,e]}}))}))}),"createFlexibleStorage"),ED=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return Mr(this,(function(l){switch(l.label){case 0:if(t&&Object.prototype.hasOwnProperty.call(t,"storageProvider")&&!t.storageProvider)return[3,9];l.label=1;case 1:l.trys.push([1,7,8,9]),e=GM([null==t?void 0:t.storageProvider,new Qc]),n=e.next(),l.label=2;case 2:return n.done?[3,6]:(r=n.value,(i=r)?[4,r.isEnabled()]:[3,4]);case 3:i=l.sent(),l.label=4;case 4:if(i)return[2,r];l.label=5;case 5:return n=e.next(),[3,2];case 6:return[3,9];case 7:return o=l.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=e.return)&&a.call(e)}finally{if(s)throw s.error}return[7];case 9:return[2,void 0]}}))}))}),"createEventsStorage"),MD=l((function(t,e,n){return e||n||t||xs()}),"createDeviceId"),Lv=l((function(t){return t===Ju.XHR?new SI:t===Ju.SendBeacon?new CI:Wd().transportProvider}),"createTransport"),ID=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return Mr(this,(function(l){switch(l.label){case 0:return[4,(new ru).isEnabled()];case 1:if(!l.sent()||!t&&typeof location>"u")return[2,""];for(e=null!=t?t:location.hostname,n=e.split("."),r=[],i="AMP_TLDTEST",o=n.length-2;o>=0;--o)r.push(n.slice(o).join("."));o=0,l.label=2;case 2:return o<r.length?(s=r[o],[4,(a=new ru({domain:"."+s})).set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return l.sent()?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))}),"getTopLevelDomain");y();var TI=l((function(t,e){return Er(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,l,u,c;return Mr(this,(function(h){switch(h.label){case 0:return[4,(n=new ru).isEnabled()];case 1:return(!h.sent()||null!=e&&e.disableCookies)&&(n=new Qc),[4,n.isEnabled()];case 2:return h.sent()?(r=Sv(t),[4,n.getRaw(r)]):[2,{optOut:!1}];case 3:return(i=h.sent())?[4,n.remove(r)]:[2,{optOut:!1}];case 4:return h.sent(),o=UM(i.split("."),5),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],[2,{deviceId:s,userId:PD(a),sessionId:NI(u),lastEventTime:NI(c),optOut:!!l}]}}))}))}),"parseOldCookies"),NI=l((function(t){var e=parseInt(t,32);if(!isNaN(e))return e}),"parseTime"),PD=l((function(t){if(atob&&escape&&t)try{return decodeURIComponent(escape(atob(t)))}catch{return}}),"decode"),SD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ys(e,t),l(e,"AmplitudeBrowser"),e.prototype.init=function(e,n,r){var i,o,s;return void 0===e&&(e=""),Er(this,void 0,void 0,(function(){var a,l,u,c,h=this;return Mr(this,(function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,TI(e,r)]);case 1:return a=p.sent(),[4,OI(e,n||a.userId,$t($t({},r),{deviceId:null!==(i=a.deviceId)&&void 0!==i?i:null==r?void 0:r.deviceId,sessionId:null!==(o=a.sessionId)&&void 0!==o?o:null==r?void 0:r.sessionId,optOut:null!==(s=null==r?void 0:r.optOut)&&void 0!==s?s:a.optOut,lastEventTime:a.lastEventTime}))];case 2:return l=p.sent(),[4,t.prototype._init.call(this,l)];case 3:return p.sent(),u=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),u=!0),(c=Zc()).eventBridge.setEventReceiver((function(t){h.track(t.eventType,t.eventProperties)})),c.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new PI)];case 4:return p.sent(),[4,this.add(new Nv)];case 5:return p.sent(),[4,this.add(new gv)];case 6:return p.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,u)];case 7:return p.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return p.sent(),[2]}}))}))},e.prototype.runAttributionStrategy=function(t,e){return void 0===e&&(e=!1),Er(this,void 0,void 0,(function(){var n,r,i;return Mr(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Av(this.config)];case 1:return i=o.sent(),[4,new Cv(this.config.apiKey,$t($t({},t),{storage:i,track:n,onNewCampaign:r})).send(e)];case 2:return o.sent(),[2]}}))}))},e.prototype.getUserId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.userId},e.prototype.setUserId=function(t){this.config?this.config.userId=t:this.q.push(this.setUserId.bind(this,t))},e.prototype.getDeviceId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.deviceId},e.prototype.setDeviceId=function(t){this.config?this.config.deviceId=t:this.q.push(this.setDeviceId.bind(this,t))},e.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(xs())},e.prototype.getSessionId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.sessionId},e.prototype.setSessionId=function(t){this.config?(this.config.sessionId=t,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,t))},e.prototype.setTransport=function(t){this.config?this.config.transportProvider=Lv(t):this.q.push(this.setTransport.bind(this,t))},e.prototype.identify=function(e,n){if(Yd(e)){var r=e._q;e._q=[],e=Xd(new Ro,r)}return null!=n&&n.user_id&&this.setUserId(n.user_id),null!=n&&n.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,e,n)},e.prototype.groupIdentify=function(e,n,r,i){if(Yd(r)){var o=r._q;r._q=[],r=Xd(new Ro,o)}return t.prototype.groupIdentify.call(this,e,n,r,i)},e.prototype.revenue=function(e,n){if(Yd(e)){var r=e._q;e._q=[],e=Xd(new Bd,r)}return t.prototype.revenue.call(this,e,n)},e}(pv),Hd=l((function(){var t=new SD;return{init:Jr(lo(t.init.bind(t)),"init",$r(t),Kr(t,["config"])),add:Jr(lo(t.add.bind(t)),"add",$r(t),Kr(t,["config.apiKey","timeline.plugins"])),remove:Jr(lo(t.remove.bind(t)),"remove",$r(t),Kr(t,["config.apiKey","timeline.plugins"])),track:Jr(lo(t.track.bind(t)),"track",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),logEvent:Jr(lo(t.logEvent.bind(t)),"logEvent",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),identify:Jr(lo(t.identify.bind(t)),"identify",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Jr(lo(t.groupIdentify.bind(t)),"groupIdentify",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),setGroup:Jr(lo(t.setGroup.bind(t)),"setGroup",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),revenue:Jr(lo(t.revenue.bind(t)),"revenue",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),flush:Jr(lo(t.flush.bind(t)),"flush",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),getUserId:Jr(t.getUserId.bind(t),"getUserId",$r(t),Kr(t,["config","config.userId"])),setUserId:Jr(t.setUserId.bind(t),"setUserId",$r(t),Kr(t,["config","config.userId"])),getDeviceId:Jr(t.getDeviceId.bind(t),"getDeviceId",$r(t),Kr(t,["config","config.deviceId"])),setDeviceId:Jr(t.setDeviceId.bind(t),"setDeviceId",$r(t),Kr(t,["config","config.deviceId"])),reset:Jr(t.reset.bind(t),"reset",$r(t),Kr(t,["config","config.userId","config.deviceId"])),getSessionId:Jr(t.getSessionId.bind(t),"getSessionId",$r(t),Kr(t,["config"])),setSessionId:Jr(t.setSessionId.bind(t),"setSessionId",$r(t),Kr(t,["config"])),setOptOut:Jr(t.setOptOut.bind(t),"setOptOut",$r(t),Kr(t,["config"])),setTransport:Jr(t.setTransport.bind(t),"setTransport",$r(t),Kr(t,["config"]))}}),"createInstance"),sn=Hd(),xH=sn.add,wH=sn.flush,EH=sn.getDeviceId,MH=sn.getSessionId,IH=sn.getUserId,PH=sn.groupIdentify,SH=sn.identify,CH=sn.init,kH=sn.logEvent,OH=sn.remove,NH=sn.reset,TH=sn.revenue,AH=sn.setDeviceId,LH=sn.setGroup,RH=sn.setOptOut,DH=sn.setSessionId,FH=sn.setTransport,BH=sn.setUserId,jH=sn.track,Y0={production:"40ead723d18886045e302513245edb27",development:""},Qu={plan:{version:"22",branch:"main",source:"websdk",versionId:"197467d1-8926-452d-a088-b3817cbac89f"},ingestionMetadata:{sourceName:"browser-typescript-ampli",sourceVersion:"2.0.0"}},W0=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:categorySelected-call"),this.event_properties=t}};l(W0,"AnalyticsCategorySelectedCall");var ef=W0,H0=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:locationSelected-call"),this.event_properties=t}};l(H0,"AnalyticsLocationSelectedCall");var tf=H0,$0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:disable-call"),this.event_properties=t}};l($0,"BlueDotDisableCall");var Rv=$0,K0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:enable-call"),this.event_properties=t}};l(K0,"BlueDotEnableCall");var Dv=K0,J0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:off-call"),this.event_properties=t}};l(J0,"BlueDotOffCall");var Fv=J0,Z0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:on-call"),this.event_properties=t}};l(Z0,"BlueDotOnCall");var Bv=Z0,Q0=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:animate-call"),this.event_properties=t}};l(Q0,"CameraAnimateCall");var jv=Q0,e1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:cancelAnimation-call"),this.event_properties=t}};l(e1,"CameraCancelAnimationCall");var zv=e1,t1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:focusOn-call"),this.event_properties=t}};l(t1,"CameraFocusOnCall");var qv=t1,r1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:getSafeAreaInsets-call"),this.event_properties=t}};l(r1,"CameraGetSafeAreaInsetsCall");var Gv=r1,n1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.disable-call"),this.event_properties=t}};l(n1,"CameraInteractionDisableCall");var Uv=n1,i1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.enable-call"),this.event_properties=t}};l(i1,"CameraInteractionEnableCall");var Vv=i1,o1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:set-call"),this.event_properties=t}};l(o1,"CameraSetCall");var Xv=o1,a1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:setSafeAreaInsets-call"),this.event_properties=t}};l(a1,"CameraSetSafeAreaInsetsCall");var Yv=a1,s1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:translate-call"),this.event_properties=t}};l(s1,"CameraTranslateCall");var Wv=s1,u1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:add-call"),this.event_properties=t}};l(u1,"FlatLabelsAddCall");var Hv=u1,l1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:labelAllLocations-call"),this.event_properties=t}};l(l1,"FlatLabelsLabelAllLocationsCall");var $v=l1,c1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:remove-call"),this.event_properties=t}};l(c1,"FlatLabelsRemoveCall");var Kv=c1,f1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:removeAll-call"),this.event_properties=t}};l(f1,"FlatLabelsRemoveAllCall");var Jv=f1,p1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:setAppearance-call"),this.event_properties=t}};l(p1,"FlatLabelsSetAppearanceCall");var Zv=p1,h1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:add-call"),this.event_properties=t}};l(h1,"FloatingLabelsAddCall");var Qv=h1,d1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:labelAllLocations-call"),this.event_properties=t}};l(d1,"FloatingLabelsLabelAllLocationsCall");var e0=d1,g1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:remove-call"),this.event_properties=t}};l(g1,"FloatingLabelsRemoveCall");var t0=g1,m1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:removeAll-call"),this.event_properties=t}};l(m1,"FloatingLabelsRemoveAllCall");var r0=m1,y1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:resetPriority-call"),this.event_properties=t}};l(y1,"FloatingLabelsResetPriorityCall");var n0=y1,v1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setAppearance-call"),this.event_properties=t}};l(v1,"FloatingLabelsSetAppearanceCall");var i0=v1,_1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setPriority-call"),this.event_properties=t}};l(_1,"FloatingLabelsSetPriorityCall");var o0=_1,b1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenue-call"),this.event_properties=t}};l(b1,"GlobalGetVenueCall");var rf=b1,x1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenueMVF-call"),this.event_properties=t}};l(x1,"GlobalGetVenueMvfCall");var nf=x1,w1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:showVenue-call"),this.event_properties=t}};l(w1,"GlobalShowVenueCall");var a0=w1,E1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:clear-call"),this.event_properties=t}};l(E1,"JourneyClearCall");var s0=E1,M1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:draw-call"),this.event_properties=t}};l(M1,"JourneyDrawCall");var u0=M1,I1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:setStep-call"),this.event_properties=t}};l(I1,"JourneySetStepCall");var l0=I1,P1=class{constructor(t){this.event_properties=t,D(this,"event_type","Mappedin:getCollectionItemById-call"),this.event_properties=t}};l(P1,"MappedinGetCollectionItemByIdCall");var c0=P1,S1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:absoluteDistanceTo-call"),this.event_properties=t}};l(S1,"MappedinCoordinateAbsoluteDistanceToCall");var f0=S1,C1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:nearestNode-call"),this.event_properties=t}};l(C1,"MappedinCoordinateNearestNodeCall");var p0=C1,k1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:clone-call"),this.event_properties=t}};l(k1,"MappedinLocationCloneCall");var of=k1,O1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:directionsTo-call"),this.event_properties=t}};l(O1,"MappedinLocationDirectionsToCall");var af=O1,N1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:distanceTo-call"),this.event_properties=t}};l(N1,"MappedinLocationDistanceToCall");var sf=N1,T1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinate-call"),this.event_properties=t}};l(T1,"MappedinMapCreateCoordinateCall");var h0=T1,A1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinateByXY-call"),this.event_properties=t}};l(A1,"MappedinMapCreateCoordinateByXyCall");var d0=A1,L1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:getNorth-call"),this.event_properties=t}};l(L1,"MappedinMapGetNorthCall");var g0=L1,R1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:directionsTo-call"),this.event_properties=t}};l(R1,"MappedinNodeDirectionsToCall");var uf=R1,D1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:distanceTo-call"),this.event_properties=t}};l(D1,"MappedinNodeDistanceToCall");var lf=D1,F1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:directionsTo-call"),this.event_properties=t}};l(F1,"MappedinPolygonDirectionsToCall");var cf=F1,B1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:distanceTo-call"),this.event_properties=t}};l(B1,"MappedinPolygonDistanceToCall");var ff=B1,j1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinVenue:metadata-read"),this.event_properties=t}};l(j1,"MappedinVenueMetadataRead");var pf=j1,z1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygon-call"),this.event_properties=t}};l(z1,"MapViewAddInteractivePolygonCall");var m0=z1,q1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygonsForAllLocations-call"),this.event_properties=t}};l(q1,"MapViewAddInteractivePolygonsForAllLocationsCall");var y0=q1,G1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:clearPolygonColor-call"),this.event_properties=t}};l(G1,"MapViewClearPolygonColorCall");var v0=G1,U1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createCustomTooltip-call"),this.event_properties=t}};l(U1,"MapViewCreateCustomTooltipCall");var _0=U1,V1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createMarker-call"),this.event_properties=t}};l(V1,"MapViewCreateMarkerCall");var b0=V1,X1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createTooltip-call"),this.event_properties=t}};l(X1,"MapViewCreateTooltipCall");var x0=X1,Y1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:destroy-call"),this.event_properties=t}};l(Y1,"MapViewDestroyCall");var w0=Y1,W1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:disableImageFlippingForAllPolygons-call"),this.event_properties=t}};l(W1,"MapViewDisableImageFlippingForAllPolygonsCall");var E0=W1,H1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:drawPath-call"),this.event_properties=t}};l(H1,"MapViewDrawPathCall");var M0=H1,$1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForAllLocations-call"),this.event_properties=t}};l($1,"MapViewEnableImageFlippingForAllLocationsCall");var I0=$1,K1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForPolygon-call"),this.event_properties=t}};l(K1,"MapViewEnableImageFlippingForPolygonCall");var P0=K1,J1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getNearestNodeByScreenCoordinates-call"),this.event_properties=t}};l(J1,"MapViewGetNearestNodeByScreenCoordinatesCall");var S0=J1,Z1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPolygonAtCoordinate-call"),this.event_properties=t}};l(Z1,"MapViewGetPolygonAtCoordinateCall");var C0=Z1,Q1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPrimaryLocationForPolygon-call"),this.event_properties=t}};l(Q1,"MapViewGetPrimaryLocationForPolygonCall");var k0=Q1,e_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:labelAllLocations-call"),this.event_properties=t}};l(e_,"MapViewLabelAllLocationsCall");var O0=e_,t_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllInteractivePolygons-call"),this.event_properties=t}};l(t_,"MapViewRemoveAllInteractivePolygonsCall");var N0=t_,r_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllMarkers-call"),this.event_properties=t}};l(r_,"MapViewRemoveAllMarkersCall");var T0=r_,n_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllPaths-call"),this.event_properties=t}};l(n_,"MapViewRemoveAllPathsCall");var A0=n_,i_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllTooltips-call"),this.event_properties=t}};l(i_,"MapViewRemoveAllTooltipsCall");var L0=i_,o_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeInteractivePolygon-call"),this.event_properties=t}};l(o_,"MapViewRemoveInteractivePolygonCall");var R0=o_,a_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeMarker-call"),this.event_properties=t}};l(a_,"MapViewRemoveMarkerCall");var D0=a_,s_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removePath-call"),this.event_properties=t}};l(s_,"MapViewRemovePathCall");var F0=s_,u_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeTooltip-call"),this.event_properties=t}};l(u_,"MapViewRemoveTooltipCall");var B0=u_,l_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setBackgroundColor-call"),this.event_properties=t}};l(l_,"MapViewSetBackgroundColorCall");var j0=l_,c_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setHoverColor-call"),this.event_properties=t}};l(c_,"MapViewSetHoverColorCall");var z0=c_,f_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setMap-call"),this.event_properties=t}};l(f_,"MapViewSetMapCall");var q0=f_,p_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setPolygonColor-call"),this.event_properties=t}};l(p_,"MapViewSetPolygonColorCall");var G0=p_,h_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setState-call"),this.event_properties=t}};l(h_,"MapViewSetStateCall");var U0=h_,d_=class{constructor(t){this.event_properties=t,D(this,"event_type","metrics:mapLoad-event"),this.event_properties=t}};l(d_,"MetricsMapLoadEvent");var V0=d_,g_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:addQuery-call"),this.event_properties=t}};l(g_,"OfflineSearchAddQueryCall");var hf=g_,m_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:constructor-call"),this.event_properties=t}};l(m_,"OfflineSearchConstructorCall");var df=m_,y_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:search-call"),this.event_properties=t}};l(y_,"OfflineSearchSearchCall");var gf=y_,v_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:suggest-call"),this.event_properties=t}};l(v_,"OfflineSearchSuggestCall");var mf=v_,$d=l((()=>({promise:Promise.resolve()})),"getVoidPromiseResult"),__=class{constructor(){D(this,"disabled",!1),D(this,"amplitude")}get client(){return this.isInitializedAndEnabled(),this.amplitude}get isLoaded(){return null!=this.amplitude}isInitializedAndEnabled(){return this.amplitude?!this.disabled:(console.error("ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?"),!1)}load(t){var e,n;if(this.disabled=null!=(e=t.disabled)&&e,this.amplitude)return console.warn("WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup."),$d();let r=null;if(t.client&&"apiKey"in t.client?r=t.client.apiKey:"environment"in t&&(r=Y0[t.environment]),t.client&&"instance"in t.client)this.amplitude=t.client.instance;else{if(r)return this.amplitude=Hd(),this.amplitude.init(r,void 0,{...Qu,...null!=(null==t?void 0:t.client)&&"configuration"in t.client?null==(n=t.client)?void 0:n.configuration:{}});console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'")}return $d()}identify(t,e,n){if(!this.isInitializedAndEnabled())return $d();t&&(n={...n,user_id:t});let r=new Ro,i=e;if(null!=i)for(let[t,e]of Object.entries(i))r.set(t,e);return this.amplitude.identify(r,n)}track(t,e){return this.isInitializedAndEnabled()?this.amplitude.track(t,void 0,e):$d()}analyticsCategorySelectedCall(t,e){return this.track(new ef(t),e)}analyticsLocationSelectedCall(t,e){return this.track(new tf(t),e)}blueDotDisableCall(t,e){return this.track(new Rv(t),e)}blueDotEnableCall(t,e){return this.track(new Dv(t),e)}blueDotOffCall(t,e){return this.track(new Fv(t),e)}blueDotOnCall(t,e){return this.track(new Bv(t),e)}cameraAnimateCall(t,e){return this.track(new jv(t),e)}cameraCancelAnimationCall(t,e){return this.track(new zv(t),e)}cameraFocusOnCall(t,e){return this.track(new qv(t),e)}cameraGetSafeAreaInsetsCall(t,e){return this.track(new Gv(t),e)}cameraInteractionDisableCall(t,e){return this.track(new Uv(t),e)}cameraInteractionEnableCall(t,e){return this.track(new Vv(t),e)}cameraSetCall(t,e){return this.track(new Xv(t),e)}cameraSetSafeAreaInsetsCall(t,e){return this.track(new Yv(t),e)}cameraTranslateCall(t,e){return this.track(new Wv(t),e)}flatLabelsAddCall(t,e){return this.track(new Hv(t),e)}flatLabelsLabelAllLocationsCall(t,e){return this.track(new $v(t),e)}flatLabelsRemoveCall(t,e){return this.track(new Kv(t),e)}flatLabelsRemoveAllCall(t,e){return this.track(new Jv(t),e)}flatLabelsSetAppearanceCall(t,e){return this.track(new Zv(t),e)}floatingLabelsAddCall(t,e){return this.track(new Qv(t),e)}floatingLabelsLabelAllLocationsCall(t,e){return this.track(new e0(t),e)}floatingLabelsRemoveCall(t,e){return this.track(new t0(t),e)}floatingLabelsRemoveAllCall(t,e){return this.track(new r0(t),e)}floatingLabelsResetPriorityCall(t,e){return this.track(new n0(t),e)}floatingLabelsSetAppearanceCall(t,e){return this.track(new i0(t),e)}floatingLabelsSetPriorityCall(t,e){return this.track(new o0(t),e)}globalGetVenueCall(t,e){return this.track(new rf(t),e)}globalGetVenueMvfCall(t,e){return this.track(new nf(t),e)}globalShowVenueCall(t,e){return this.track(new a0(t),e)}journeyClearCall(t,e){return this.track(new s0(t),e)}journeyDrawCall(t,e){return this.track(new u0(t),e)}journeySetStepCall(t,e){return this.track(new l0(t),e)}mappedinGetCollectionItemByIdCall(t,e){return this.track(new c0(t),e)}mappedinCoordinateAbsoluteDistanceToCall(t,e){return this.track(new f0(t),e)}mappedinCoordinateNearestNodeCall(t,e){return this.track(new p0(t),e)}mappedinLocationCloneCall(t,e){return this.track(new of(t),e)}mappedinLocationDirectionsToCall(t,e){return this.track(new af(t),e)}mappedinLocationDistanceToCall(t,e){return this.track(new sf(t),e)}mappedinMapCreateCoordinateCall(t,e){return this.track(new h0(t),e)}mappedinMapCreateCoordinateByXyCall(t,e){return this.track(new d0(t),e)}mappedinMapGetNorthCall(t,e){return this.track(new g0(t),e)}mappedinNodeDirectionsToCall(t,e){return this.track(new uf(t),e)}mappedinNodeDistanceToCall(t,e){return this.track(new lf(t),e)}mappedinPolygonDirectionsToCall(t,e){return this.track(new cf(t),e)}mappedinPolygonDistanceToCall(t,e){return this.track(new ff(t),e)}mappedinVenueMetadataRead(t,e){return this.track(new pf(t),e)}mapViewAddInteractivePolygonCall(t,e){return this.track(new m0(t),e)}mapViewAddInteractivePolygonsForAllLocationsCall(t,e){return this.track(new y0(t),e)}mapViewClearPolygonColorCall(t,e){return this.track(new v0(t),e)}mapViewCreateCustomTooltipCall(t,e){return this.track(new _0(t),e)}mapViewCreateMarkerCall(t,e){return this.track(new b0(t),e)}mapViewCreateTooltipCall(t,e){return this.track(new x0(t),e)}mapViewDestroyCall(t,e){return this.track(new w0(t),e)}mapViewDisableImageFlippingForAllPolygonsCall(t,e){return this.track(new E0(t),e)}mapViewDrawPathCall(t,e){return this.track(new M0(t),e)}mapViewEnableImageFlippingForAllLocationsCall(t,e){return this.track(new I0(t),e)}mapViewEnableImageFlippingForPolygonCall(t,e){return this.track(new P0(t),e)}mapViewGetNearestNodeByScreenCoordinatesCall(t,e){return this.track(new S0(t),e)}mapViewGetPolygonAtCoordinateCall(t,e){return this.track(new C0(t),e)}mapViewGetPrimaryLocationForPolygonCall(t,e){return this.track(new k0(t),e)}mapViewLabelAllLocationsCall(t,e){return this.track(new O0(t),e)}mapViewRemoveAllInteractivePolygonsCall(t,e){return this.track(new N0(t),e)}mapViewRemoveAllMarkersCall(t,e){return this.track(new T0(t),e)}mapViewRemoveAllPathsCall(t,e){return this.track(new A0(t),e)}mapViewRemoveAllTooltipsCall(t,e){return this.track(new L0(t),e)}mapViewRemoveInteractivePolygonCall(t,e){return this.track(new R0(t),e)}mapViewRemoveMarkerCall(t,e){return this.track(new D0(t),e)}mapViewRemovePathCall(t,e){return this.track(new F0(t),e)}mapViewRemoveTooltipCall(t,e){return this.track(new B0(t),e)}mapViewSetBackgroundColorCall(t,e){return this.track(new j0(t),e)}mapViewSetHoverColorCall(t,e){return this.track(new z0(t),e)}mapViewSetMapCall(t,e){return this.track(new q0(t),e)}mapViewSetPolygonColorCall(t,e){return this.track(new G0(t),e)}mapViewSetStateCall(t,e){return this.track(new U0(t),e)}metricsMapLoadEvent(t,e){return this.track(new V0(t),e)}offlineSearchAddQueryCall(t,e){return this.track(new hf(t),e)}offlineSearchConstructorCall(t,e){return this.track(new df(t),e)}offlineSearchSearchCall(t,e){return this.track(new gf(t),e)}offlineSearchSuggestCall(t,e){return this.track(new mf(t),e)}};l(__,"Ampli");var X0=__,yf=new X0;y();var ja,cu,Do,al,ra,mg,HP,yg,$P,kf,U_,Of,V_,Fo,XP=er(hP()),YP=er(GP()),WP=er(UP()),VP="5.29.3",ZB="https://api2.amplitude.com/2/httpapi",QB="https://api2.amplitude.com/batch",ej="__unspecified__",q_={branch:"main",version:"0",source:"websdk"},mi=class t{constructor(){oe(this,mg),oe(this,yg),oe(this,kf),oe(this,Of),oe(this,Do,{}),oe(this,al,!1),oe(this,ra,void 0),oe(this,Fo,l((async t=>{rj(t.type)&&(window.removeEventListener("visibilitychange",B(this,Fo)),window.removeEventListener("pagehide",B(this,Fo)),window.removeEventListener("beforeunload",B(this,Fo)),window.removeEventListener("unload",B(this,Fo)),await this.sendAllPendingEvents())}),"#handlePageUnload")),null==B(t,cu)&&le(t,cu,VP),typeof navigator<"u"&&null!=navigator.userAgent&&le(this,ra,new WP.UAParser(navigator.userAgent).getResult())}static setContext(e){le(t,ja,e)}static setVersion(e){le(t,cu,e)}addPendingEvent(e){var n;if(null==B(t,ja))return;let r=e.event_type;if(!wr(this,yg,$P).call(this,e))return;null==e.event_properties&&(e.event_properties={});let i=B(this,Do)[r];(0,YP.default)(e.event_properties,null!=(n=null==i?void 0:i.event_properties)?n:{}),B(this,Do)[r]=e}async sendAllPendingEvents(){if(null==B(t,ja)||Object.keys(B(this,Do)).length<1)return;if(B(this,al))return void Ie.warn("The current batch of analytics is already sending. Wait until this finishes before trying to send again.");let e=[];for(let t in B(this,Do)){let n=B(this,Do)[t],r=wr(this,kf,U_).call(this,n);null!=r&&e.push(r)}if(!(e.length<1))try{le(this,al,!0),200===(await wr(this,Of,V_).call(this,QB,e)).status&&le(this,Do,{})}catch(t){Ie.warn("Error sending batch product analytics!",t)}finally{le(this,al,!1)}}async load(){if(!yf.isLoaded){let{promise:t}=yf.load({environment:"production",client:{configuration:{trackingOptions:{osName:!0}}}});t.then((()=>{window.addEventListener("pagehide",B(this,Fo)),window.addEventListener("beforeunload",B(this,Fo)),window.addEventListener("unload",B(this,Fo)),window.addEventListener("visibilitychange",B(this,Fo))}))}}async sendEventNow(e){if(null==B(t,ja))return;let n=wr(this,kf,U_).call(this,e);if(null!=n)try{await wr(this,Of,V_).call(this,ZB,[n])}catch(t){Ie.warn("Error sending single product analytics event!",t)}}};ja=new WeakMap,cu=new WeakMap,Do=new WeakMap,al=new WeakMap,ra=new WeakMap,mg=new WeakSet,HP=l((function(t){let e=t.event_type;return null!=B(this,Do)[e]}),"#isEventTypePending"),yg=new WeakSet,$P=l((function(t){if(!wr(this,mg,HP).call(this,t))return!0;let e=t.event_type,n=B(this,Do)[e];return!(0,XP.default)(n.event_properties,t.event_properties)}),"#didEventPropertiesChange"),kf=new WeakSet,U_=l((function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v;if(null!=B(mi,ja))return null==(null==(e=t.event_properties)?void 0:e.venue)&&Ie.warn("Error processing product analytics event! Unspecified venue slug",t),null==Qu.plan&&Ie.warn("Error processing product analytics event! Unknown coinfiguration plan",t),{event_type:t.event_type,session_id:null!=(n=yf.client.getSessionId())?n:_g(),device_id:null!=(r=yf.client.getDeviceId())?r:vg(),plan:{branch:null!=(o=null==(i=Qu.plan)?void 0:i.branch)?o:q_.branch,version:null!=(a=null==(s=Qu.plan)?void 0:s.version)?a:q_.version,source:null!=(u=null==(l=Qu.plan)?void 0:l.source)?u:q_.source},os_name:null==(c=B(this,ra))?void 0:c.browser.name,os_version:null==(h=B(this,ra))?void 0:h.browser.version,device_manufacturer:null==(p=B(this,ra))?void 0:p.device.vendor,device_model:null==(f=B(this,ra))?void 0:f.device.model,event_properties:{...t.event_properties,context:B(mi,ja),sdk_version:B(mi,cu),browser_name:null==(d=B(this,ra))?void 0:d.browser.name,browser_version:null==(g=B(this,ra))?void 0:g.browser.version,venue:null!=(v=null==(y=t.event_properties)?void 0:y.venue)?v:ej},time:t.time}}),"#makeBatchFormattedEvent"),Of=new WeakSet,V_=l((async function(t,e){return await Oi()(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({api_key:Y0.production,events:e})})}),"#batchSend"),Fo=new WeakMap,l(mi,"ProductAnalytics"),oe(mi,ja,void 0),oe(mi,cu,void 0);var G_=mi,tj=new G_,Nr=tj;function rj(t){return"beforeunload"===t||"pagehide"===t||"unload"===t||"hidden"===document.visibilityState}l(rj,"areWeLeavingThePage");var co,sl,Yn,Af,Nf=class t extends Qo{constructor(t,e){super(t),oe(this,co,void 0),oe(this,sl,void 0),oe(this,Yn,{}),D(this,"id",""),D(this,"x",0),D(this,"y",0),D(this,"operationHours"),D(this,"externalId"),oe(this,Af,void 0),le(this,co,t),le(this,sl,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=B(this,Yn).map;if(typeof t<"u")return t;let e=B(this,co).getCollectionItemById("maps",B(this,sl).map);return B(this,Yn).map=e,e}get lat(){var t;let e=B(this,Yn).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=B(this,co)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return B(this,Yn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),B(this,Yn).cachedLatLon.lat}get lon(){var t;let e=B(this,Yn).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=B(this,co)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return B(this,Yn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),B(this,Yn).cachedLatLon.lon}get paths(){let t=B(this,Yn).paths;if(typeof t<"u")return t;let e=[],n=B(this,co)._nodesById,r=B(this,Af);if(Array.isArray(r))for(let t=0,i=r.length;t<i;++t){let i=n[r[t].node];null!=i&&e.push(i)}return B(this,Yn).paths=e,e}set paths(t){le(this,Af,t)}get locations(){var t,e,n;let r=B(this,Yn).locations;if(typeof r<"u")return r;let i=[],o=null!=(n=null==(e=null==(t=ri.instances.get(B(this,co)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=o.length;t<e;++t){let e=o[t],n=e.nodes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===s){i.push(e);break}}return B(this,Yn).locations=i,i}get polygon(){var t,e,n;let r=B(this,Yn).polygon;if(typeof r<"u")return r;let i,o=null!=(n=null==(e=null==(t=ri.instances.get(B(this,co)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=o.length;t<e;++t){let e=o[t];e.entrances.map((t=>t.id)).includes(s)&&(i=e)}return B(this,Yn).polygon=i,i}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.nodes.slice();e.options.things.maps&&Gr(n,"map"),["weight","multiplier","accessible"].forEach((function(t){Gr(n,t)}));let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"node",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Nodes:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,co).venue.slug,i=new uf({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,co).venue.slug;return Nr.addPendingEvent(new lf({venue:n})),super.distanceTo(t,e)}toJSON(){return B(this,sl)}};co=new WeakMap,sl=new WeakMap,Yn=new WeakMap,Af=new WeakMap,l(Nf,"MappedinNode");var Tf=Nf;y();var na,ul,fo,Df,Rf=class t extends Qo{constructor(t,e){super(t),oe(this,na,void 0),oe(this,ul,void 0),oe(this,fo,{}),D(this,"geometry"),D(this,"perspectives"),D(this,"image"),D(this,"holes"),D(this,"textures"),D(this,"material"),D(this,"label"),D(this,"id",""),D(this,"layer"),D(this,"layerId"),D(this,"name"),D(this,"externalId"),D(this,"vertexes"),D(this,"center"),D(this,"canvasBounds"),D(this,"categoryRank"),oe(this,Df,void 0),le(this,na,t),le(this,ul,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=B(this,fo).map;if(typeof t<"u")return t;let e=B(this,na).getCollectionItemById("maps",B(this,ul).map);return B(this,fo).map=e,e}get locations(){var t,e;let n=B(this,fo).locations;if(typeof n<"u")return n;let r=[],i=null!=(e=null==(t=ri.instances.get(B(this,na)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:o}=this;for(let t=0,e=i.length;t<e;++t){let e=i[t],n=e.polygons;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===o){r.push(e);break}}return B(this,fo).locations=r,r}get entrances(){let t=B(this,fo).entrances;if(typeof t<"u")return t;let e=[],n=B(this,Df),r=B(this,na)._nodesById;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return B(this,fo).entrances=e,e}return[]}set entrances(t){le(this,Df,t)}get rank(){let t=B(this,fo).rank;if(typeof t<"u")return t;let{rankings:e}=B(this,na);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(B(this,fo).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(B(this,fo).rank=null,null)}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.polygons.slice();e.options.things.maps&&Gr(n,"map"),e.options.things.nodes&&Gr(n,"entrances");let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"polygon",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Polygons:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,na).venue.slug,i=new cf({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,na).venue.slug;return Nr.addPendingEvent(new ff({venue:n})),super.distanceTo(t,e)}toJSON(){return B(this,ul)}};na=new WeakMap,ul=new WeakMap,fo=new WeakMap,Df=new WeakMap,l(Rf,"MappedinPolygon");var fu=Rf;y();var nj=0,ij="9999-12-31T00:00:00.000Z";function oj(t,e,n=new Date){if(!t.states)return;let r=n||new Date,i=t.states.find((t=>{let e=new Date(t.start||nj),n=new Date(t.end||ij);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}l(oj,"getCurrentLocationState");var Gi,Is,Ui,Ff,Bf,jf,ll=class t extends Qo{constructor(t,e){super(t),oe(this,Gi,void 0),oe(this,Is,void 0),oe(this,Ui,{}),D(this,"states"),D(this,"id",""),D(this,"name",""),D(this,"type",""),D(this,"description"),D(this,"sortOrder"),D(this,"logo"),D(this,"phone"),D(this,"social"),D(this,"color"),D(this,"shortName"),D(this,"detailsUrl"),D(this,"tags"),D(this,"toMap"),D(this,"externalId"),D(this,"showLabelWhenImagePresent"),D(this,"showSmartLabelWhenImagePresent"),D(this,"picture"),D(this,"operationHours"),D(this,"siblingGroups"),D(this,"gallery"),D(this,"amenity"),oe(this,Ff,void 0),oe(this,Bf,[]),oe(this,jf,void 0),le(this,Gi,t),le(this,Is,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=B(this,Ui).polygons;if(typeof t<"u")return t;let e=[],n=B(this,Ff),r=B(this,Gi)._polygonsById;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return B(this,Ui).polygons=e,e}set polygons(t){le(this,Ff,t)}get nodes(){let t=B(this,Ui).nodes;if(typeof t<"u")return t;let e=[],n=B(this,Bf),r=B(this,Gi)._nodesById;if(n&&n.length)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return B(this,Ui).nodes=e,e}set nodes(t){le(this,Bf,t)}get parent(){let t=B(this,Ui).parent;if(typeof t<"u")return t;let e,n=B(this,Gi)._locationsById,r=B(this,jf);return void 0!==r&&(e=n[r]),B(this,Ui).parent=e,e}set parent(t){le(this,jf,t)}get categories(){let t=B(this,Ui).categories;if(typeof t<"u")return t;let e=[];return B(this,Is).categories.forEach((t=>{let n=B(this,Gi).getCollectionItemById("categories",t);n&&e.push(n)})),B(this,Ui).categories=e,e}get state(){return oj(this,B(this,Gi).locationStates)}clone(){let e=B(this,Gi).venue.slug;return Nr.addPendingEvent(new of({venue:e})),new t(B(this,Gi),B(this,Is))}get nodeOperationHours(){let t=B(this,Ui).nodeOperationHours;if(typeof t<"u")return t;if(null==this.nodes)return{};let e=B(this,Is).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return B(this,Ui).nodeOperationHours=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.locations.slice();e.options.things.categories&&Gr(n,"categories"),e.options.things.nodes&&Gr(n,"nodes"),e.options.things.polygons&&Gr(n,"polygons"),e.options.things.locationStates&&Gr(n,"states");let r={fields:n,venue:e.options.venue};try{let n=await Ur(e.options,"location",r);return e.options.includeHidden||(n=n.filter((t=>!t.hidden))),n.map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Locations:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,Gi).venue.slug,i=new af({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,Gi).venue.slug;return Nr.addPendingEvent(new sf({venue:n})),super.distanceTo(t,e)}toJSON(){let t=B(this,Is);return delete t.color,t}};Gi=new WeakMap,Is=new WeakMap,Ui=new WeakMap,Ff=new WeakMap,Bf=new WeakMap,jf=new WeakMap,l(ll,"MappedinLocation");var za=ll;y();var cl,pu,qf,zf=class t{constructor(t,e){oe(this,cl,void 0),oe(this,pu,{}),oe(this,qf,void 0),D(this,"name"),D(this,"externalId"),D(this,"parents"),D(this,"id"),D(this,"icon"),D(this,"iconFromDefaultList"),D(this,"sortOrder"),this.id=e.id,le(this,qf,e),le(this,cl,t),Object.assign(this,e)}get locations(){var t;let e=B(this,pu).locations;if(typeof e<"u")return e;let n=[],{locations:r}=B(this,cl),{id:i}=this;for(let e=0,o=r.length;e<o;++e){let o=r[e],s=o.categories;if(Array.isArray(s))for(let e=0,r=s.length;e<r;++e)if((null==(t=s[e])?void 0:t.id)===i){n.push(o);break}}return B(this,pu).locations=n,n}get children(){var t;let e=B(this,pu).children;if(typeof e<"u")return e;let{categories:n}=B(this,cl),{id:r}=this,i=[];for(let e=0;e<n.length;e++)r&&null!=(t=n[e].parents)&&t.includes(r)&&i.push(n[e]);return B(this,pu).children=i,i}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n={fields:e.options.things.categories,venue:e.options.venue};try{return(await Ur(e.options,"category",n)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Categories:",t),[]}}toJSON(){return B(this,qf)}};cl=new WeakMap,pu=new WeakMap,qf=new WeakMap,l(zf,"MappedinCategory");var hu=zf;y();var Gf,qa,X_=class{constructor(t,e){oe(this,Gf,void 0),oe(this,qa,void 0),D(this,"distance",0),D(this,"path",[]),D(this,"instructions",[]),le(this,qa,t),le(this,Gf,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,r,i,o,s,a,l,u,c,h,p;let f={...t,action:{...t.action},atLocation:null!=(e=t.atLocation)&&e.id?null==(r=null==(n=B(this,qa))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:null!=(i=t.node)&&i.id?null==(s=null==(o=B(this,qa))?void 0:o._nodesById)?void 0:s[t.node.id]:void 0};if("TakeVortex"===(null==(a=f.action)?void 0:a.type)||"ExitVortex"===(null==(l=f.action)?void 0:l.type)){let t=null==(c=B(this,qa)._mapsById)?void 0:c[null==(u=f.action)?void 0:u.fromMap.id],e=null==(p=B(this,qa)._mapsById)?void 0:p[null==(h=f.action)?void 0:h.toMap.id];t&&e&&(f.action.fromMap=t,f.action.toMap=e)}return f})),this.path=e.path.reduce(((t,{id:e})=>{var n,r;let i=null==(r=null==(n=B(this,qa))?void 0:n._nodesById)?void 0:r[e];return i&&t.push(i),t}),[])}toJSON(){return B(this,Gf)}};Gf=new WeakMap,qa=new WeakMap,l(X_,"MappedinDirections");var Qs=X_;y();var Y_=class{constructor(t){D(this,"destinations",[]),this.destinations=t}};l(Y_,"MappedinDestinationSet");var uo=Y_;y();var Xf,Uf=class t{constructor(t){D(this,"id",""),oe(this,Xf,void 0),D(this,"accessible"),D(this,"name"),D(this,"type"),D(this,"weight"),D(this,"multiplier"),D(this,"nodes"),le(this,Xf,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){Gr(n,t)}));let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"vortex",r)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Vortexes:",t),[]}}toJSON(){return B(this,Xf)}};Xf=new WeakMap,l(Uf,"MappedinVortex");var Vf=Uf;y();var Wf,Hf,$f,fl,Yf=class t{constructor(t,e){oe(this,Wf,void 0),oe(this,Hf,void 0),oe(this,$f,void 0),oe(this,fl,{}),D(this,"defaultMap",""),D(this,"address",""),D(this,"city",""),D(this,"countrycode",""),D(this,"externalId",""),D(this,"id",""),D(this,"latitude"),D(this,"logo"),D(this,"longitude"),D(this,"name",""),D(this,"operationHours"),D(this,"postal",""),D(this,"slug",""),D(this,"state",""),D(this,"telephone",""),D(this,"tzid",""),D(this,"tzidOverride",""),D(this,"utcOffset",""),D(this,"website",""),D(this,"secureContentStorage",!1),D(this,"defaultLanguage"),D(this,"languages",[]),D(this,"topLocations",[]),le(this,Hf,t),le(this,Wf,e),Object.assign(this,e)}get metadata(){return Nr.addPendingEvent(new pf({venue:this.slug})),B(this,$f)}set metadata(t){le(this,$f,t)}static hydrate(e,n){return new t(n,e)}static async fetch(e){let n={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let r=await Ur(e.options,"venue",n);return new t(e,Array.isArray(r)?r[0]:r)}catch(t){return Ie.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==B(this,fl).isMultiBuilding){let t=B(this,Hf).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;B(this,fl).isMultiBuilding=n}return B(this,fl).isMultiBuilding}toJSON(){return B(this,Wf)}};Wf=new WeakMap,Hf=new WeakMap,$f=new WeakMap,fl=new WeakMap,l(Yf,"MappedinVenue");var du=Yf;y();var Jf,Kf=class t{constructor(t){D(this,"id",""),oe(this,Jf,void 0),le(this,Jf,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Ur(e.options,"apollo-theme",n)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Theme:",t),[]}}toJSON(){return B(this,Jf)}};Jf=new WeakMap,l(Kf,"MappedinTheme");var bg=Kf;y();var ep,Zf=class t{constructor(t){oe(this,ep,void 0),D(this,"polygons",[]),le(this,ep,t),Object.assign(this,t)}static hydrate(e){return new t(e)}static async fetch(e){try{let n=await pl({...e.options,secure:!1},"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new t(n)}catch(t){return Ie.error("Fetch Rankings:",t),null}}toJSON(){return B(this,ep)}};ep=new WeakMap,l(Zf,"MappedinRankings");var Qf=Zf;y(),y();var np,hl,ip,tp=class t{constructor(t,e){oe(this,np,void 0),oe(this,hl,void 0),oe(this,ip,{}),D(this,"id",""),D(this,"type",""),D(this,"name",""),D(this,"description"),D(this,"image"),D(this,"startDate"),D(this,"endDate"),D(this,"showDate"),le(this,hl,e),le(this,np,t),Object.assign(this,e)}location(){let t=B(this,ip).location;if(typeof t<"u")return t;let e,n=B(this,np)._locationsById,r=B(this,hl).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return B(this,ip).location=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.events.slice();e.options.things.locations&&Gr(n,"location");let r={fields:n,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Ur(e.options,"event",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Events:",t),[]}}toJSON(){return B(this,hl)}};np=new WeakMap,hl=new WeakMap,ip=new WeakMap,l(tp,"MappedinEvent");var rp=tp;y();var sp,op=class t{constructor(t){oe(this,sp,void 0),D(this,"id",""),D(this,"name",""),D(this,"value",""),le(this,sp,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Ur(e.options,"location-state",n)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Location States:",t),[]}}toJSON(){return B(this,sp)}};sp=new WeakMap,l(op,"MappedinLocationState");var ap=op;y(),y(),y();var KP=" ",yi=class t{static get separator(){return KP}static set separator(t){KP=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(e,n="d",r){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===r)switch(n){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:n="d",r=4}e=Math.abs(e);let i=null,o=null,s=null,a=null;switch(n){default:case"d":case"deg":o=e.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),i=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),s=(60*e%60).toFixed(r),60==s&&(s=(0).toFixed(r),o++),o=("000"+o).slice(-3),s<10&&(s="0"+s),i=o+"°"+t.separator+s+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),s=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(r),60==a&&(a=(0).toFixed(r),s++),60==s&&(s=0,o++),o=("000"+o).slice(-3),s=("00"+s).slice(-2),a<10&&(a="0"+a),i=o+"°"+t.separator+s+"′"+t.separator+a+"″"}return i}static toLat(e,n,r){let i=t.toDms(t.wrap90(e),n,r);return null===i?"–":i.slice(1)+t.separator+(e<0?"S":"N")}static toLon(e,n,r){let i=t.toDms(t.wrap180(e),n,r);return null===i?"–":i+t.separator+(e<0?"W":"E")}static toBrng(e,n,r){let i=t.toDms(t.wrap360(e),n,r);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,n=3){if(![1,2,3].includes(Number(n)))throw new RangeError("invalid precision ‘".concat(n,"’"));e=t.wrap360(e);let r=4*2**(n-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};l(yi,"Dms");var W_=yi;Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var Pt=W_,Tr=Math.PI,Ue=class t{constructor(t,e){if(isNaN(t))throw new TypeError("invalid lat ‘".concat(t,"’"));if(isNaN(e))throw new TypeError("invalid lon ‘".concat(e,"’"));this._lat=Pt.wrap90(Number(t)),this._lon=Pt.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?Pt.wrap90(Pt.parse(t)):Pt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError("invalid lat ‘".concat(t,"’"))}set latitude(t){if(this._lat=isNaN(t)?Pt.wrap90(Pt.parse(t)):Pt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError("invalid latitude ‘".concat(t,"’"))}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid lon ‘".concat(t,"’"))}set lng(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid lng ‘".concat(t,"’"))}set longitude(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid longitude ‘".concat(t,"’"))}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let n,r;if(2==e.length&&([n,r]=e,n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r)),isNaN(n)||isNaN(r)))throw new TypeError("invalid point ‘".concat(e.toString(),"’"));if(1==e.length&&"string"==typeof e[0]&&([n,r]=e[0].split(","),n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r)),isNaN(n)||isNaN(r)))throw new TypeError("invalid point ‘".concat(e[0],"’"));if(1==e.length&&"object"==typeof e[0]){let t=e[0];if("Point"==t.type&&Array.isArray(t.coordinates)?[r,n]=t.coordinates:(null!=t.latitude&&(n=t.latitude),null!=t.lat&&(n=t.lat),null!=t.longitude&&(r=t.longitude),null!=t.lng&&(r=t.lng),null!=t.lon&&(r=t.lon),n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r))),isNaN(n)||isNaN(r))throw new TypeError("invalid point ‘".concat(JSON.stringify(e[0]),"’"))}if(isNaN(n)||isNaN(r))throw new TypeError("invalid point ‘".concat(e.toString(),"’"));return new t(n,r)}distanceTo(e,n=6371e3){if(e instanceof t||(e=t.parse(e)),isNaN(n))throw new TypeError("invalid radius ‘".concat(n,"’"));let r=n,i=this.lat.toRadians(),o=this.lon.toRadians(),s=e.lat.toRadians(),a=s-i,l=e.lon.toRadians()-o,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2);return r*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}initialBearingTo(e){if(e instanceof t||(e=t.parse(e)),this.equals(e))return NaN;let n=this.lat.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),o=Math.cos(n)*Math.sin(r)-Math.sin(n)*Math.cos(r)*Math.cos(i),s=Math.sin(i)*Math.cos(r),a=Math.atan2(s,o).toDegrees();return Pt.wrap360(a)}finalBearingTo(e){e instanceof t||(e=t.parse(e));let n=e.initialBearingTo(this)+180;return Pt.wrap360(n)}midpointTo(e){e instanceof t||(e=t.parse(e));let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),o=(e.lon-this.lon).toRadians(),s=Math.cos(n),a=0,l=Math.sin(n),u={x:s+Math.cos(i)*Math.cos(o),y:a+Math.cos(i)*Math.sin(o),z:l+Math.sin(i)},c=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),h=r+Math.atan2(u.y,u.x),p=c.toDegrees(),f=h.toDegrees();return new t(p,f)}intermediatePointTo(e,n){if(e instanceof t||(e=t.parse(e)),this.equals(e))return new t(this.lat,this.lon);let r=this.lat.toRadians(),i=this.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians(),a=o-r,l=s-i,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),c=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),h=Math.sin((1-n)*c)/Math.sin(c),p=Math.sin(n*c)/Math.sin(c),f=h*Math.cos(r)*Math.cos(i)+p*Math.cos(o)*Math.cos(s),d=h*Math.cos(r)*Math.sin(i)+p*Math.cos(o)*Math.sin(s),g=h*Math.sin(r)+p*Math.sin(o),y=Math.atan2(g,Math.sqrt(f*f+d*d)),v=Math.atan2(d,f),m=y.toDegrees(),_=v.toDegrees();return new t(m,_)}destinationPoint(e,n,r=6371e3){let i=e/r,o=Number(n).toRadians(),s=this.lat.toRadians(),a=this.lon.toRadians(),l=Math.sin(s)*Math.cos(i)+Math.cos(s)*Math.sin(i)*Math.cos(o),u=Math.asin(l),c=Math.sin(o)*Math.sin(i)*Math.cos(s),h=Math.cos(i)-Math.sin(s)*l,p=a+Math.atan2(c,h),f=u.toDegrees(),d=p.toDegrees();return new t(f,d)}static intersection(e,n,r,i){if(e instanceof t||(e=t.parse(e)),r instanceof t||(r=t.parse(r)),isNaN(n))throw new TypeError("invalid brng1 ‘".concat(n,"’"));if(isNaN(i))throw new TypeError("invalid brng2 ‘".concat(i,"’"));let o=e.lat.toRadians(),s=e.lon.toRadians(),a=r.lat.toRadians(),l=r.lon.toRadians(),u=Number(n).toRadians(),c=Number(i).toRadians(),h=a-o,p=l-s,f=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(a)*Math.sin(p/2)*Math.sin(p/2)));if(Math.abs(f)<Number.EPSILON)return new t(e.lat,e.lon);let d=(Math.sin(a)-Math.sin(o)*Math.cos(f))/(Math.sin(f)*Math.cos(o)),g=(Math.sin(o)-Math.sin(a)*Math.cos(f))/(Math.sin(f)*Math.cos(a)),y=Math.acos(Math.min(Math.max(d,-1),1)),v=Math.acos(Math.min(Math.max(g,-1),1)),m=u-(Math.sin(l-s)>0?y:2*Tr-y),_=(Math.sin(l-s)>0?2*Tr-v:v)-c;if(0==Math.sin(m)&&0==Math.sin(_)||Math.sin(m)*Math.sin(_)<0)return null;let b=-Math.cos(m)*Math.cos(_)+Math.sin(m)*Math.sin(_)*Math.cos(f),w=Math.atan2(Math.sin(f)*Math.sin(m)*Math.sin(_),Math.cos(_)+Math.cos(m)*b),x=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(w)+Math.cos(o)*Math.sin(w)*Math.cos(u),-1),1)),E=s+Math.atan2(Math.sin(u)*Math.sin(w)*Math.cos(o),Math.cos(w)-Math.sin(o)*Math.sin(x)),I=x.toDegrees(),S=E.toDegrees();return new t(I,S)}crossTrackDistanceTo(e,n,r=6371e3){e instanceof t||(e=t.parse(e)),n instanceof t||(n=t.parse(n));let i=r;if(this.equals(e))return 0;let o=e.distanceTo(this,i)/i,s=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(n).toRadians();return Math.asin(Math.sin(o)*Math.sin(s-a))*i}alongTrackDistanceTo(e,n,r=6371e3){e instanceof t||(e=t.parse(e)),n instanceof t||(n=t.parse(n));let i=r;if(this.equals(e))return 0;let o=e.distanceTo(this,i)/i,s=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(n).toRadians(),l=Math.asin(Math.sin(o)*Math.sin(s-a));return Math.acos(Math.cos(o)/Math.abs(Math.cos(l)))*Math.sign(Math.cos(a-s))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let r=Number(n).toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),s=e.lat.toRadians(),a=e.lon.toRadians()-o,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(a),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(a)-Math.cos(i)*Math.sin(s)*Math.cos(r),c=Math.cos(i)*Math.cos(s)*Math.sin(r)*Math.sin(a);if(c*c>l*l+u*u)return null;let h=Math.atan2(-u,l),p=Math.acos(c/Math.sqrt(l*l+u*u)),f=o+h+p,d=(o+h-p).toDegrees(),g=f.toDegrees();return{lon1:Pt.wrap180(d),lon2:Pt.wrap180(g)}}rhumbDistanceTo(e,n=6371e3){e instanceof t||(e=t.parse(e));let r=n,i=this.lat.toRadians(),o=e.lat.toRadians(),s=o-i,a=Math.abs(e.lon-this.lon).toRadians();Math.abs(a)>Tr&&(a=a>0?-(2*Tr-a):2*Tr+a);let l=Math.log(Math.tan(o/2+Tr/4)/Math.tan(i/2+Tr/4)),u=Math.abs(l)>1e-11?s/l:Math.cos(i);return Math.sqrt(s*s+u*u*a*a)*r}rhumbBearingTo(e){if(e instanceof t||(e=t.parse(e)),this.equals(e))return NaN;let n=this.lat.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians();Math.abs(i)>Tr&&(i=i>0?-(2*Tr-i):2*Tr+i);let o=Math.log(Math.tan(r/2+Tr/4)/Math.tan(n/2+Tr/4)),s=Math.atan2(i,o).toDegrees();return Pt.wrap360(s)}rhumbDestinationPoint(e,n,r=6371e3){let i=this.lat.toRadians(),o=this.lon.toRadians(),s=Number(n).toRadians(),a=e/r,l=a*Math.cos(s),u=i+l;Math.abs(u)>Tr/2&&(u=u>0?Tr-u:-Tr-u);let c=Math.log(Math.tan(u/2+Tr/4)/Math.tan(i/2+Tr/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(i),p=o+a*Math.sin(s)/h,f=u.toDegrees(),d=p.toDegrees();return new t(f,d)}rhumbMidpointTo(e){e instanceof t||(e=t.parse(e));let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians();Math.abs(o-r)>Tr&&(r+=2*Tr);let s=(n+i)/2,a=Math.tan(Tr/4+n/2),l=Math.tan(Tr/4+i/2),u=Math.tan(Tr/4+s/2),c=((o-r)*Math.log(u)+r*Math.log(l)-o*Math.log(a))/Math.log(l/a);isFinite(c)||(c=(r+o)/2);let h=s.toDegrees(),p=c.toDegrees();return new t(h,p)}static areaOf(t,e=6371e3){let n=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);let i=t.length-1,o=0;for(let e=0;e<i;e++){let n=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),i=(t[e+1].lon-t[e].lon).toRadians();o+=2*Math.atan2(Math.tan(i/2)*(Math.tan(n/2)+Math.tan(r/2)),1+Math.tan(n/2)*Math.tan(r/2))}a(t)&&(o=Math.abs(o)-2*Tr);let s=Math.abs(o*n*n);return r||t.pop(),s;function a(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){let i=t[r].initialBearingTo(t[r+1]),o=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(o-i+540)%360-180,n=o}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90}}equals(e){return e instanceof t||(e=t.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError("invalid format ‘".concat(t,"’"));if("n"==t)return null==e&&(e=4),"".concat(this.lat.toFixed(e),",").concat(this.lon.toFixed(e));let n=Pt.toLat(this.lat,t,e),r=Pt.toLon(this.lon,t,e);return"".concat(n,", ").concat(r)}};l(Ue,"LatLonSpherical");var ia,Ps,cp,Zr=Ue,up=class t{constructor(t,e){oe(this,ia,void 0),oe(this,Ps,{}),oe(this,cp,void 0),D(this,"id",""),D(this,"group",""),D(this,"name",""),D(this,"shortName",""),D(this,"elevation",0),D(this,"subtitle"),D(this,"scale",0),D(this,"layers"),D(this,"x_scale"),D(this,"perspectiveId"),D(this,"scene"),D(this,"width",0),D(this,"height",0),D(this,"georeference",[]),D(this,"_scale",0),le(this,ia,t),le(this,cp,e),Object.assign(this,e),this._scale=JP(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=B(this,Ps).mapGroup;if(typeof t<"u")return t;let e=this.group,n=e&&B(this,ia)._mapGroupsById[e]||null;return B(this,Ps).mapGroup=n,n}createCoordinateByXY(t,e){return new gu({x:t,y:e,map:this,mappedin:B(this,ia)})}createCoordinate(t,e){return new gu({lat:t,lon:e,map:this,mappedin:B(this,ia)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new Zr(e.target.x,e.target.y),i=new Zr(n.target.x,n.target.y);t=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,Ie.warn(e),Ie.warn("Couldn't georeference ".concat(this.name||this.shortName||this.id,". Probably not enough geocoordinates."))}return t}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){var n;let r=e.options.things.maps.slice();e.options.perspective&&Gr(r,"perspectives"),e.options.things.mapGroups&&Gr(r,"group"),Gr(r,"elevation"),Gr(r,"x_scale"),Gr(r,"scale"),Gr(r,"georeference");let i={fields:r,perspective:e.options.perspective,venue:e.options.venue};try{let s=await Ur(e.options,"map",i),a=l((t=>{let e=o.layers.find((e=>e.id===t));e?e.visible=!0:o.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let i=0,l=s.length;i<l;++i){var o=s[i];if(o){let t=o.perspective;null!=t&&(o.perspectiveId=t.id,r.indexOf("scene")>-1&&(o.scene=t.scene),t.layers?(o.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):o.layers.forEach((t=>{t.visible=!0}))),delete o.perspective}if(e.options.preloadMapGeometry&&null!=(n=o.scene)&&n.polygons&&"string"==typeof o.scene.polygons){let t=await Oi()(o.scene.polygons);o.scene.polygons=await t.json()}s[i]=new t(e,o)}return s}catch(t){return Ie.error("Fetch Maps:",t),[]}}get center(){if(B(this,Ps).center)return B(this,Ps).center;let[t,e]=[this.georeference[0].control.x,this.georeference[0].control.y],[n,r]=[this.georeference[2].control.x,this.georeference[2].control.y],{lat:i,lon:o}=this.createCoordinateByXY(t,e),{lat:s,lon:a}=this.createCoordinateByXY(n,r),l=new Zr(i,o),u=new Zr(s,a),c=l.midPointTo(u);return B(this,Ps).center=c,c}toJSON(){return B(this,cp)}};ia=new WeakMap,Ps=new WeakMap,cp=new WeakMap,l(up,"MappedinMap");var lp=up;y();var fp,H_,pp,$_,hp,dp,xg,ZP,wg,QP,oa,aa,sa,ua,K_=class{constructor(t){oe(this,fp),oe(this,pp),oe(this,xg),oe(this,wg),D(this,"map"),oe(this,hp,{}),oe(this,dp,void 0),oe(this,oa,void 0),oe(this,aa,void 0),oe(this,sa,void 0),oe(this,ua,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(le(this,oa,t.lat),le(this,aa,t.lon)),null!=t.x&&null!=t.y&&(le(this,sa,t.x),le(this,ua,t.y)),this.map=e,le(this,dp,n)}get x(){return wr(this,pp,$_).call(this,"x")}get y(){return wr(this,pp,$_).call(this,"y")}get lat(){return wr(this,fp,H_).call(this,"lat")}get lon(){return wr(this,fp,H_).call(this,"lon")}absoluteDistanceTo(t){return eS([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=B(this,hp).nearestNode;if(typeof t<"u")return t;let e=ri.instances.get(B(this,dp)).findNearestNodeOnMap(this.map.id,this);return B(this,hp).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};fp=new WeakSet,H_=l((function(t){if(typeof B(this,oa)<"u"&&typeof B(this,aa)<"u")return B(this,"lat"===t?oa:aa);if(typeof B(this,sa)<"u"&&typeof B(this,ua)<"u"){let[e,n]=wr(this,wg,QP).call(this,B(this,sa),B(this,ua));return le(this,oa,e),le(this,aa,n),B(this,"lat"===t?oa:aa)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),pp=new WeakSet,$_=l((function(t){if(B(this,sa)&&B(this,ua))return B(this,"x"===t?sa:ua);if(null!=B(this,oa)&&null!=B(this,aa)){let[e,n]=wr(this,xg,ZP).call(this,B(this,oa),B(this,aa));return le(this,sa,e),le(this,ua,n),B(this,"x"===t?sa:ua)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),hp=new WeakMap,dp=new WeakMap,xg=new WeakSet,ZP=l((function(t,e){let n=this.map.georeference[0],r=new Zr(n.target.x,n.target.y),i=new Zr(t,e),o=r.distanceTo(i),s=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,a=o*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*a,c=Math.cos(l)*a;return[n.control.x+u,n.control.y-c]}),"#latLonToXY"),wg=new WeakSet,QP=l((function(t,e){let n,r=this.map.georeference[0],i=new Zr(r.target.x,r.target.y),o=t-r.control.x,s=r.control.y-e,a=Math.atan2(o,s);n=0===o&&0===s?0:0===o?s:o/Math.sin(a);let l=a-this.map.getNorth(),u=n/this.map._scale,c=i.destinationPoint(u,180*l/Math.PI);return[c.lat,c.lon]}),"#xyToLatLon"),oa=new WeakMap,aa=new WeakMap,sa=new WeakMap,ua=new WeakMap,l(K_,"MappedinCoordinate");var gu=K_;y();var yp,dl,vp,gp=class t{constructor(t,e){oe(this,yp,void 0),oe(this,dl,void 0),oe(this,vp,{}),D(this,"id",""),D(this,"name",""),le(this,dl,e),le(this,yp,t),Object.assign(this,e)}get maps(){let t=B(this,vp).maps;if(typeof t<"u")return t;let e=[],{maps:n}=B(this,yp),{id:r}=B(this,dl);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return B(this,vp).maps=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Ur(e.options,"map-group",n)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Map Groups:",t),[]}}toJSON(){return B(this,dl)}};yp=new WeakMap,dl=new WeakMap,vp=new WeakMap,l(gp,"MappedinMapGroup");var mp=gp;y(),y(),y();var mu,Bo,jo,J_=[0,4,6,8,10],Ga=l((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&!(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],J_.map(((t,e)=>n.slice(t,e===J_.length-1?void 0:J_[e+1]).join(""))).join("-")}),"randomId"),tS="mi-session-data",rS="mi-local-data",_p=class t{constructor(){oe(this,Bo,void 0),oe(this,jo,void 0);try{let t=sessionStorage.getItem(tS);le(this,Bo,t?JSON.parse(t):{id:Ga()})}catch{le(this,Bo,{id:Ga()})}try{let t=localStorage.getItem(rS);le(this,jo,t?JSON.parse(t):{deviceId:Ga()})}catch{le(this,jo,{deviceId:Ga()})}B(this,Bo).id||(B(this,Bo).id=Ga()),B(this,jo).deviceId||(B(this,jo).deviceId=Ga())}static getInstance(){return B(this,mu)||le(this,mu,new t),B(this,mu)}static ___clearInstance(){le(this,mu,void 0)}saveSessionData(t,e){B(this,Bo)[t]=e;try{return sessionStorage.setItem(tS,JSON.stringify(B(this,Bo))),!0}catch{return!1}}loadSessionData(t){let e=B(this,Bo)[t];if(null!=e)return e}saveLocalData(t,e){B(this,jo)[t]=e;try{return localStorage.setItem(rS,JSON.stringify(B(this,jo))),!0}catch{return!1}}loadLocalData(t){let e=B(this,jo)[t];if(null!=e)return e}};mu=new WeakMap,Bo=new WeakMap,jo=new WeakMap,l(_p,"SafeStorage"),oe(_p,mu,void 0);var bp=_p;function Eg(t){return/^[\da-f]{24}$/i.test(t)}function nS(t,e=!1){let n="";if(null!=t){let r="?",i=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,o=i.length;e<o;++e){let o=i[e],s=t[o];null!=s&&(n+="".concat(r+encodeURIComponent(o),"=").concat(encodeURIComponent(s)),r="&")}}return n}function aj(t,e,n,r=!1){var i,o;return r?"".concat(t.supplementaryUrl).concat(e,"?venue=").concat(n.venue||n.slug):null!=(i=t.baseUrl)&&i.includes("gateway")?"".concat(t.baseUrl).concat(e,"/").concat(n.venue||n.slug).concat(nS(n,null==(o=t.baseUrl)?void 0:o.includes("gateway"))):t.baseUrl+e+nS(n)}async function Ur(t,e,n,r=!1){return pl(t,e,n,r,!0)}async function pl(t,e,n,r=!1,i=!1){let o=aj(t,e,n,r),s=await Mg(t,o,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}function sj(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+="&lang=".concat(encodeURIComponent(r.language)));let{headers:i}=t;i["Content-Type"]=i["Content-Type"]||"text/json",t.accessToken?i.Authorization="Bearer ".concat(t.accessToken):t.noAuth||t.clientId&&t.clientSecret&&(i["x-mappedin-key"]=btoa(t.clientId),i["x-mappedin-secret"]=btoa(t.clientSecret)),r.language&&(i["Accept-Language"]=r.language);let o={method:"GET",headers:i};return t.secure&&(e+="&withcdntoken"),{req:o,url:e}}async function Mg(t,e,n=!1){let r=sj(t,e,n),i=await Oi()(r.url,r.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}function Gr(t,e){t.indexOf(e)<0&&t.push(e)}function eS([t,e],[n,r]){let i=new Zr(t,e),o=new Zr(n,r);return i.distanceTo(o)}function JP(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],r=t.georeference[2],i=new Zr(n.target.x,n.target.y),o=new Zr(r.target.x,r.target.y),s=i.distanceTo(o),a=n.control.x-r.control.x,l=n.control.y-r.control.y;e=Math.sqrt(a*a+l*l)/s}catch(n){e=1,Ie.warn(n),Ie.warn("Couldn't georeference ".concat(t.name||t.shortName||t.id,". Probably not enough geocoordinates."))}return e}function Xc(t){var e;return t instanceof fu?t.entrances.map((t=>t.id)):t instanceof za?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function iS(t){let e={},{maps:n,images:r,scenes:i,polygons:o}=t;if(null!=r)try{let t=Object.keys(r).map((t=>fetch("data:image/png;base64,".concat(r[t])).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{Ie.error(t)}))));await Promise.all(t)}catch(t){Ie.error(t)}return n.forEach((t=>{var n;(null!=(n=t.scene)&&n.polygons||i[t.id])&&(null!=i&&i[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>i[t.id]})),null!=r&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,r;if(null!=(n=null==t?void 0:t.image)&&n.url&&null!=(r=null==t?void 0:t.image)&&r.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}}))))})),null!=r&&o.forEach((t=>{var n;if(null!=(n=null==t?void 0:t.image)&&n.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function gl(t,e,n){let r;return function(...i){let o=this,s=l((function(){r=null,n||t.apply(o,i)}),"later"),a=n&&!r;clearTimeout(r),r=setTimeout(s,e),a&&t.apply(o,i)}}function oS(t,e,n,r=0){if(!t||t<=0)return 0;let i=0;r>=0&&r<=1&&(i=r/10);let o=1e-5,s=1+(n-t)/(n-e)+i;return Math.max(1+o,Math.min(2-o,s))}function vg(){return bp.getInstance().loadLocalData("deviceId")}function _g(){return bp.getInstance().loadSessionData("id")}l(Eg,"isGatewayKey"),l(nS,"stringifyQuery"),l(aj,"buildUrl"),l(Ur,"getArray"),l(pl,"getObject"),l(sj,"constructParamsForRequest"),l(Mg,"generateAPIRequest"),l(Gr,"addToSet"),l(eS,"getDistanceBetweenLatLon"),l(JP,"getMapScale"),l(Xc,"getNodesForNavigatable"),l(iS,"populateBundledImagesAsBlobs"),l(gl,"debounce"),l(oS,"normalizeCategoryRank"),l(vg,"getDeviceID"),l(_g,"getSessionID");var aS=l(((t,e)=>{if("string"==typeof t){if(void 0===e||!Array.isArray(e.polygons))return null;t=e.polygons.find((function(e){return e.id===t}))}let n=null;if(null!=t&&void 0!==t.locations&&t.locations.length>0){n=t.locations[0];for(let e=0,r=t.locations.length;e<r;e++){let r=t.locations[e];for(;void 0!==r.parent;)r=r.parent,r.polygons.includes(t)&&(n=r);if(void 0===r.parent&&r.polygons.includes(t))return r}}return n}),"getPrimaryLocationForPolygon");function Z_(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return sS(this.cover(e,n),e,n,t)}function sS(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,s,a,l,u,c,h,p,f=t._root,d={data:r},g=t._x0,y=t._y0,v=t._x1,m=t._y1;if(!f)return t._root=d,t;for(;f.length;)if((u=e>=(o=(g+v)/2))?g=o:v=o,(c=n>=(s=(y+m)/2))?y=s:m=s,i=f,!(f=f[h=c<<1|u]))return i[h]=d,t;if(a=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===a&&n===l)return d.next=f,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(o=(g+v)/2))?g=o:v=o,(c=n>=(s=(y+m)/2))?y=s:m=s}while((h=c<<1|u)==(p=(l>=s)<<1|a>=o));return i[p]=f,i[h]=d,t}function uS(t){var e,n,r,i,o=t.length,s=new Array(o),a=new Array(o),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(s[n]=r,a[n]=i,r<l&&(l=r),r>c&&(c=r),i<u&&(u=i),i>h&&(h=i));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<o;++n)sS(this,s[n],a[n],t[n]);return this}function Q_(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var s,a,l=i-n||1,u=this._root;n>t||t>=i||r>e||e>=o;)switch(a=(e<r)<<1|t<n,s=new Array(4),s[a]=u,u=s,l*=2,a){case 0:i=n+l,o=r+l;break;case 1:n=i-l,o=r+l;break;case 2:i=n+l,r=o-l;break;case 3:n=i-l,r=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function eb(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function tb(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function vn(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function rb(t,e,n){var r,i,o,s,a,l,u,c=this._x0,h=this._y0,p=this._x1,f=this._y1,d=[],g=this._root;for(g&&d.push(new vn(g,c,h,p,f)),null==n?n=1/0:(c=t-n,h=e-n,p=t+n,f=e+n,n*=n);l=d.pop();)if(!(!(g=l.node)||(i=l.x0)>p||(o=l.y0)>f||(s=l.x1)<c||(a=l.y1)<h))if(g.length){var y=(i+s)/2,v=(o+a)/2;d.push(new vn(g[3],y,v,s,a),new vn(g[2],i,v,y,a),new vn(g[1],y,o,s,v),new vn(g[0],i,o,y,v)),(u=(e>=v)<<1|t>=y)&&(l=d[d.length-1],d[d.length-1]=d[d.length-1-u],d[d.length-1-u]=l)}else{var m=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=m*m+_*_;if(b<n){var w=Math.sqrt(n=b);c=t-w,h=e-w,p=t+w,f=e+w,r=g.data}}return r}function nb(t){if(isNaN(o=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,r,i,o,s,a,l,u,c,h,p,f=this._root,d=this._x0,g=this._y0,y=this._x1,v=this._y1;if(!f)return this;if(f.length)for(;;){if((u=o>=(a=(d+y)/2))?d=a:y=a,(c=s>=(l=(g+v)/2))?g=l:v=l,e=f,!(f=f[h=c<<1|u]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,p=h)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[p]=f:this._root=f),this):(this._root=i,this)}function lS(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ib(){return this._root}function ob(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function ab(t){var e,n,r,i,o,s,a=[],l=this._root;for(l&&a.push(new vn(l,this._x0,this._y0,this._x1,this._y1));e=a.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,o=e.x1,s=e.y1)&&l.length){var u=(r+o)/2,c=(i+s)/2;(n=l[3])&&a.push(new vn(n,u,c,o,s)),(n=l[2])&&a.push(new vn(n,r,c,u,s)),(n=l[1])&&a.push(new vn(n,u,i,o,c)),(n=l[0])&&a.push(new vn(n,r,i,u,c))}return this}function sb(t){var e,n=[],r=[];for(this._root&&n.push(new vn(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,s=e.x0,a=e.y0,l=e.x1,u=e.y1,c=(s+l)/2,h=(a+u)/2;(o=i[0])&&n.push(new vn(o,s,a,c,h)),(o=i[1])&&n.push(new vn(o,c,a,l,h)),(o=i[2])&&n.push(new vn(o,s,h,c,u)),(o=i[3])&&n.push(new vn(o,c,h,l,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function cS(t){return t[0]}function ub(t){return arguments.length?(this._x=t,this):this._x}function fS(t){return t[1]}function lb(t){return arguments.length?(this._y=t,this):this._y}function xp(t,e,n){var r=new cb(null==e?cS:e,null==n?fS:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function cb(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function pS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}y(),y(),y(),y(),l(Z_,"default"),l(sS,"add"),l(uS,"addAll"),y(),l(Q_,"default"),y(),l(eb,"default"),y(),l(tb,"default"),y(),y(),l(vn,"default"),l(rb,"default"),y(),l(nb,"default"),l(lS,"removeAll"),y(),l(ib,"default"),y(),l(ob,"default"),y(),l(ab,"default"),y(),l(sb,"default"),y(),l(cS,"defaultX"),l(ub,"default"),y(),l(fS,"defaultY"),l(lb,"default"),l(xp,"quadtree"),l(cb,"Quadtree"),l(pS,"leaf_copy");var vi=xp.prototype=cb.prototype;vi.copy=function(){var t,e,n=new cb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=pS(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=pS(e));return n},vi.add=Z_,vi.addAll=uS,vi.cover=Q_,vi.data=eb,vi.extent=tb,vi.find=rb,vi.remove=nb,vi.removeAll=lS,vi.root=ib,vi.size=ob,vi.visit=ab,vi.visitAfter=sb,vi.x=ub,vi.y=lb;var la,un,zo=class t{constructor(t){oe(this,la,void 0),D(this,"categories"),D(this,"locations"),D(this,"vortexes"),D(this,"maps"),D(this,"nodes"),D(this,"polygons"),D(this,"events"),D(this,"mapGroups"),D(this,"locationStates"),D(this,"rankings"),D(this,"languages",{}),oe(this,un,{}),le(this,la,t)}get polygonsByMapId(){if(B(this,un).polygonsByMapId)return B(this,un).polygonsByMapId;let t,e={};for(let n=0,r=B(this,la).polygons.length;n<r;++n)t=B(this,la).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).polygonsByMapId=n,B(this,un).polygonsByMapId}get nodesByMapId(){if(B(this,un).nodesByMapId)return B(this,un).nodesByMapId;let t,e={};for(let n=0,r=B(this,la).nodes.length;n<r;++n)t=B(this,la).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).nodesByMapId=n,B(this,un).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(B(this,un).nodeTreesByMap||(B(this,un).nodeTreesByMap=new Map),!B(this,un).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=xp();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),B(this,un).nodeTreesByMap.set(t,r)}return B(this,un).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(B(this,un).locationsByMapId)return B(this,un).locationsByMapId;let t,e={};for(let n=0,r=B(this,la).locations.length;n<r;++n){t=B(this,la).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),-1===e[t.polygons[n].map.id].indexOf(t)&&e[t.polygons[n].map.id].push(t);for(let n=0,r=t.nodes.length;n<r;++n){let r=t.nodes[n];e[r.map.id]||(e[r.map.id]=[]),-1===e[r.map.id].indexOf(t)&&e[r.map.id].push(t)}}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).locationsByMapId=n,B(this,un).locationsByMapId}static create(e){return t.instances.has(e)||t.instances.set(e,new t(e)),t.instances.get(e)}static clear(){t.instances.clear()}static clearInstance(e){t.instances.has(e)&&t.instances.delete(e)}};la=new WeakMap,un=new WeakMap,l(zo,"MappedinCache"),D(zo,"instances",new Map);var fb=zo,ri=fb,Lf=(t=>(t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes",t))(Lf||{}),yu={categories:hu,locations:za,vortexes:Vf,maps:lp,nodes:Tf,polygons:fu,venue:du,events:rp,mapGroups:mp,themes:bg,locationStates:ap,rankings:Qf},Ig=(t=>(t[t.LANGUAGE_CHANGED=0]="LANGUAGE_CHANGED",t))(Ig||{});y(),y(),y(),y();var _n=6371008.8,hS={centimeters:100*_n,centimetres:100*_n,degrees:_n/111325,feet:3.28084*_n,inches:39.37*_n,kilometers:_n/1e3,kilometres:_n/1e3,meters:_n,metres:_n,miles:_n/1609.344,millimeters:1e3*_n,millimetres:1e3*_n,nauticalmiles:_n/1852,radians:1,yards:1.0936*_n},sQ={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/_n,yards:1.0936133};function bn(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 jt(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(!ca(t[0])||!ca(t[1]))throw new Error("coordinates must contain numbers");return bn({type:"Point",coordinates:t},e,n)}function cr(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return bn({type:"Polygon",coordinates:t},e,n)}function Ar(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return bn({type:"LineString",coordinates:t},e,n)}function Ve(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 vu(t,e,n){return void 0===n&&(n={}),bn({type:"MultiLineString",coordinates:t},e,n)}function pb(t,e,n){return void 0===n&&(n={}),bn({type:"MultiPoint",coordinates:t},e,n)}function wp(t,e){void 0===e&&(e="kilometers");var n=hS[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Ep(t,e){void 0===e&&(e="kilometers");var n=hS[e];if(!n)throw new Error(e+" units is invalid");return t/n}function _u(t){return 180*(t%(2*Math.PI))/Math.PI}function Ln(t){return t%360*Math.PI/180}function ca(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ln(t,e,n){if(null!==t)for(var r,i,o,s,a,l,u,c,h=0,p=0,f=t.type,d="FeatureCollection"===f,g="Feature"===f,y=d?t.features.length:1,v=0;v<y;v++){a=(c=!!(u=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var m=0;m<a;m++){var _=0,b=0;if(null!==(s=c?u.geometries[m]:u)){l=s.coordinates;var w=s.type;switch(h=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,p,v,_,b))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],p,v,_,b))return!1;p++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===e(l[r][i],p,v,_,b))return!1;p++}"MultiLineString"===w&&_++,"Polygon"===w&&b++}"Polygon"===w&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===e(l[r][i][o],p,v,_,b))return!1;p++}b++}_++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===ln(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function dS(t,e,n,r){var i=n;return ln(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function rr(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 fa(t,e){var n,r,i,o,s,a,l,u,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,u=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,h))return!1;p++}}function ni(t,e){fa(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(bn(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var u=t.coordinates[l];if(!1===e(bn({type:s,coordinates:u},r),n,l))return!1}}))}function Pg(t,e){ni(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,u=0;if(!1===ln(t,(function(o,c,h,p,f){if(void 0===s||n>a||p>l||f>u)return s=o,a=n,l=p,u=f,void(i=0);var d=Ar([s,o],t.properties);if(!1===e(d,n,r,f,i))return!1;i++,s=o})))return!1}}}))}function gS(t,e,n){var r=n,i=!1;return Pg(t,(function(t,o,s,a,l){r=!1===i&&void 0===n?t:e(r,t,o,s,a,l),i=!0})),r}function hb(t){var e=[1/0,1/0,-1/0,-1/0];return ln(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}l(bn,"feature"),l(jt,"point"),l(cr,"polygon"),l(Ar,"lineString"),l(Ve,"featureCollection"),l(vu,"multiLineString"),l(pb,"multiPoint"),l(wp,"radiansToLength"),l(Ep,"lengthToRadians"),l(_u,"radiansToDegrees"),l(Ln,"degreesToRadians"),l(ca,"isNumber"),l(ln,"coordEach"),l(dS,"coordReduce"),l(rr,"featureEach"),l(fa,"geomEach"),l(ni,"flattenEach"),l(Pg,"segmentEach"),l(gS,"segmentReduce"),l(hb,"bbox"),hb.default=hb;var Rn=hb;function Rr(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 nr(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")}function db(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function Wn(t){return"Feature"===t.type?t.geometry:t}function Xi(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}y(),y(),y(),y(),l(Rr,"getCoord"),l(nr,"getCoords"),l(db,"featureOf"),l(Wn,"getGeom"),l(Xi,"getType");var gj=er(Sg(),1);y();var Ij=er(LS(),1);function Dn(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Rr(t),i=Wn(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===Pj(r,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(RS(r,a[u][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[u].length&&!c;)RS(r,a[u][h],!n.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function RS(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],l=e[o][0],u=e[o][1];if(t[1]*(s-l)+a*(l-t[0])+u*(t[0]-s)==0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(u-t[1])<=0)return!n;a>t[1]!=u>t[1]&&t[0]<(l-s)*(t[1]-a)/(u-a)+s&&(r=!r)}return r}function Pj(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function Sj(t,e,n){void 0===n&&(n={});var r=Rr(t),i=Rr(e),o=Ln(i[1]-r[1]),s=Ln(i[0]-r[0]),a=Ln(r[1]),l=Ln(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return wp(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}y(),y(),l(Dn,"booleanPointInPolygon"),l(RS,"inRing"),l(Pj,"inBBox"),y(),y(),l(Sj,"distance");var Pr=Sj;y();var gee=function(){function t(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,l=n.y-t.y,u=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+l*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(l*u-s*c)/h,this.y=(o*c-a*u)/h,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}return l(t,"Triangle"),t}();y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y();var FS=new ArrayBuffer(16),nre=new Float64Array(FS),ire=new Uint32Array(FS);y(),y(),y(),y(),y(),y();var Gj=er(kb(),1);y(),y(),y(),y(),y();var hie=function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(e=0;e<this.centers.length-1;e++){var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return l(t,"Spline"),t.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return Uj((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},t}();function Uj(t,e,n,r,i){var o=Vj(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}function Vj(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function Sp(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return cr([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}function Xj(t){return Sp(Rn(t))}l(Uj,"bezier"),l(Vj,"B"),y(),y(),y(),y(),l(Sp,"bboxPolygon"),l(Xj,"envelope");var Ob=Xj;function pa(t,e,n,r){void 0===r&&(r={});var i=Rr(t),o=Ln(i[0]),s=Ln(i[1]),a=Ln(n),l=Ep(e,r.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return jt([_u(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),_u(u)],r.properties)}function Ua(t,e,n){if(void 0===n&&(n={}),!0===n.final)return Yj(t,e);var r=Rr(t),i=Rr(e),o=Ln(r[0]),s=Ln(i[0]),a=Ln(r[1]),l=Ln(i[1]),u=Math.sin(s-o)*Math.cos(l),c=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return _u(Math.atan2(u,c))}function Yj(t,e){var n=Ua(e,t);return n=(n+180)%360}function Wj(t,e){void 0===e&&(e={});var n=Rn(t);return jt([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}y(),y(),y(),l(pa,"destination"),y(),y(),l(Ua,"bearing"),l(Yj,"calculateFinalBearing"),y(),l(Wj,"center");var bu=Wj;y(),y(),y(),y(),y();var cz=er(WS(),1);function fz(t){if(!t)throw new Error("geojson is required");var e=[];return ni(t,(function(t){pz(t,e)})),Ve(e)}function pz(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=nr(r);break;case"LineString":n=[nr(r)]}n.forEach((function(n){hz(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}function hz(t,e){var n=[];return t.reduce((function(t,r){var i=Ar([t,r],e);return i.bbox=dz(t,r),n.push(i),r})),n}function dz(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?n:i,r>o?r:o]}y(),y(),y(),y(),l(fz,"lineSegment"),l(pz,"lineSegmentFeature"),l(hz,"createSegments"),l(dz,"bbox");var wu=fz,cC=er(Ug(),1);function qz(t,e){var n={},r=[];if("LineString"===t.type&&(t=bn(t)),"LineString"===e.type&&(e=bn(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=lC(t,e);return i&&r.push(i),Ve(r)}var o=(0,cC.default)();return o.load(wu(e)),rr(wu(t),(function(t){rr(o.search(t),(function(e){var i=lC(t,e);if(i){var o=nr(i).join(",");n[o]||(n[o]=!0,r.push(i))}}))})),Ve(r)}function lC(t,e){var n=nr(t),r=nr(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],p=(h-u)*(s-i)-(c-l)*(a-o);if(0===p)return null;var f=((c-l)*(o-u)-(h-u)*(i-l))/p,d=((s-i)*(o-u)-(a-o)*(i-l))/p;return f>=0&&f<=1&&d>=0&&d<=1?jt([i+f*(s-i),o+f*(a-o)]):null}l(qz,"lineIntersect"),l(lC,"intersects");var Eu=qz;function Gz(t,e,n){void 0===n&&(n={});var r=jt([1/0,1/0],{dist:1/0}),i=0;return ni(t,(function(t){for(var o=nr(t),s=0;s<o.length-1;s++){var a=jt(o[s]);a.properties.dist=Pr(e,a,n);var l=jt(o[s+1]);l.properties.dist=Pr(e,l,n);var u=Pr(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),h=Ua(a,l),p=pa(e,c,h+90,n),f=pa(e,c,h-90,n),d=Eu(Ar([p.geometry.coordinates,f.geometry.coordinates]),Ar([a.geometry.coordinates,l.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=Pr(e,g,n),g.properties.location=i+Pr(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=s+1,r.properties.location=i+u),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=u}})),r}l(Gz,"nearestPointOnLine");var Va=Gz;y(),y(),y();var Vz=er(Sg(),1);function Mu(t,e){return void 0===e&&(e={}),gS(t,(function(t,n){var r=n.geometry.coordinates;return t+Pr(r[0],r[1],e)}),0)}function Xz(t,e,n){var r=nr(n);if("LineString"!==Xi(n))throw new Error("line must be a LineString");for(var i,o=Va(n,t),s=Va(n,e),a=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],l=i[0].properties.index+1;l<i[1].properties.index+1;l++)a.push(r[l]);return a.push(i[1].geometry.coordinates),Ar(a,n.properties)}y(),y(),y(),y(),y(),y(),l(Mu,"length"),y(),l(Xz,"lineSlice");var Xg=Xz;function Yz(t,e,n){void 0===n&&(n={});for(var r=Rr(t),i=nr(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),Wz(i[o],i[o+1],r,s,typeof n.epsilon>"u"?null:n.epsilon))return!0}return!1}function Wz(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],l=t[1],u=e[0],c=e[1],h=u-a,p=c-l,f=(n[0]-a)*p-(n[1]-l)*h;if(null!==i){if(Math.abs(f)>i)return!1}else if(0!==f)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<=u:u<=o&&o<a:p>0?l<s&&s<=c:c<=s&&s<l:"end"===r?Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<u:u<o&&o<=a:p>0?l<=s&&s<c:c<s&&s<=l:"both"===r&&(Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<u:u<o&&o<a:p>0?l<s&&s<c:c<s&&s<l):Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<=u:u<=o&&o<=a:p>0?l<=s&&s<=c:c<=s&&s<=l}y(),y(),y(),y(),l(Yz,"booleanPointOnLine"),l(Wz,"isPointOnLineSegment");var wl=Yz;y(),y(),y(),y();var Kz=er(kb(),1);y();var pC=Math.PI/180,hC=180/Math.PI,Tp=l((function(t,e){this.lon=t,this.lat=e,this.x=pC*t,this.y=pC*e}),"Coord");Tp.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Tp.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new Tp(e,t)};var dC=l((function(){this.coords=[],this.length=0}),"LineString");dC.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Kb=l((function(t){this.properties=t||{},this.geometries=[]}),"Arc");Kb.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Kb.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=l((function(t){e+=t[0]+" "+t[1]+","}),"collect"),r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var gC=l((function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Tp(t.x,t.y),this.end=new Tp(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)}),"GreatCircle");gC.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=hC*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[hC*Math.atan2(i,r),s]},gC.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,l=0,u=e&&e.offset?e.offset:10,c=180-u,h=-180+u,p=360-u,f=1;f<n.length;++f){var d=n[f-1][0],g=n[f][0],y=Math.abs(g-d);y>p&&(g>c&&d<h||d>c&&g<h)?a=!0:y>l&&(l=y)}var v=[];if(a&&l<u){var m=[];v.push(m);for(var _=0;_<n.length;++_){var b=parseFloat(n[_][0]);if(_>0&&Math.abs(b-n[_-1][0])>p){var w=parseFloat(n[_-1][0]),x=parseFloat(n[_-1][1]),E=parseFloat(n[_][0]),I=parseFloat(n[_][1]);if(w>-180&&w<h&&180===E&&_+1<n.length&&n[_-1][0]>-180&&n[_-1][0]<h){m.push([-180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(w>c&&w<180&&-180===E&&_+1<n.length&&n[_-1][0]>c&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(w<h&&E>c){var S=w;w=E,E=S;var N=x;x=I,I=N}if(w>c&&E<h&&(E+=360),w<=180&&E>=180&&w<E){var M=(180-w)/(E-w),C=M*I+(1-M)*x;m.push([n[_-1][0]>c?180:-180,C]),(m=[]).push([n[_-1][0]>c?-180:180,C]),v.push(m)}else m=[],v.push(m);m.push([b,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var O=[];v.push(O);for(var P=0;P<n.length;++P)O.push([n[P][0],n[P][1]])}for(var A=new Kb(this.properties),D=0;D<v.length;++D){var T=new dC;A.geometries.push(T);for(var L=v[D],R=0;R<L.length;++R)T.move_to(L[R])}return A},y();var Qz=er(Ug(),1);y(),y(),y(),y(),y(),y();var C6=er(Ug(),1),k6=er(Ex(),1);y(),y(),y(),y(),y(),y(),y();var T6=er(Sg(),1),Je=[],Ze=[],Qe=[],et=[],tt=[],rt=[],nt=[],it=[],ot=[],at=[],st=[],ut=[],lt=[],ct=[],ft=[],pt=[],ht=[],dt=[],gt=[],mt=[],yt=[],vt=[],_t=[],bt=[];nt[85]=at[85]=-1,it[85]=st[85]=0,ot[85]=ut[85]=1,gt[85]=vt[85]=1,mt[85]=_t[85]=0,yt[85]=bt[85]=1,Je[85]=et[85]=0,Ze[85]=tt[85]=-1,Qe[85]=ft[85]=0,pt[85]=lt[85]=0,ht[85]=ct[85]=1,rt[85]=dt[85]=1,vt[1]=vt[169]=0,_t[1]=_t[169]=-1,bt[1]=bt[169]=0,lt[1]=lt[169]=-1,ct[1]=ct[169]=0,ft[1]=ft[169]=0,at[4]=at[166]=0,st[4]=st[166]=-1,ut[4]=ut[166]=1,pt[4]=pt[166]=1,ht[4]=ht[166]=0,dt[4]=dt[166]=0,nt[16]=nt[154]=0,it[16]=it[154]=1,ot[16]=ot[154]=1,et[16]=et[154]=1,tt[16]=tt[154]=0,rt[16]=rt[154]=1,gt[64]=gt[106]=0,mt[64]=mt[106]=1,yt[64]=yt[106]=0,Je[64]=Je[106]=-1,Ze[64]=Ze[106]=0,Qe[64]=Qe[106]=1,gt[2]=gt[168]=0,mt[2]=mt[168]=-1,yt[2]=yt[168]=1,vt[2]=vt[168]=0,_t[2]=_t[168]=-1,bt[2]=bt[168]=0,lt[2]=lt[168]=-1,ct[2]=ct[168]=0,ft[2]=ft[168]=0,pt[2]=pt[168]=-1,ht[2]=ht[168]=0,dt[2]=dt[168]=1,nt[8]=nt[162]=0,it[8]=it[162]=-1,ot[8]=ot[162]=0,at[8]=at[162]=0,st[8]=st[162]=-1,ut[8]=ut[162]=1,lt[8]=lt[162]=1,ct[8]=ct[162]=0,ft[8]=ft[162]=1,pt[8]=pt[162]=1,ht[8]=ht[162]=0,dt[8]=dt[162]=0,nt[32]=nt[138]=0,it[32]=it[138]=1,ot[32]=ot[138]=1,at[32]=at[138]=0,st[32]=st[138]=1,ut[32]=ut[138]=0,Je[32]=Je[138]=1,Ze[32]=Ze[138]=0,Qe[32]=Qe[138]=0,et[32]=et[138]=1,tt[32]=tt[138]=0,rt[32]=rt[138]=1,vt[128]=vt[42]=0,_t[128]=_t[42]=1,bt[128]=bt[42]=1,gt[128]=gt[42]=0,mt[128]=mt[42]=1,yt[128]=yt[42]=0,Je[128]=Je[42]=-1,Ze[128]=Ze[42]=0,Qe[128]=Qe[42]=1,et[128]=et[42]=-1,tt[128]=tt[42]=0,rt[128]=rt[42]=0,at[5]=at[165]=-1,st[5]=st[165]=0,ut[5]=ut[165]=0,vt[5]=vt[165]=1,_t[5]=_t[165]=0,bt[5]=bt[165]=0,pt[20]=pt[150]=0,ht[20]=ht[150]=1,dt[20]=dt[150]=1,et[20]=et[150]=0,tt[20]=tt[150]=-1,rt[20]=rt[150]=1,nt[80]=nt[90]=-1,it[80]=it[90]=0,ot[80]=ot[90]=1,gt[80]=gt[90]=1,mt[80]=mt[90]=0,yt[80]=yt[90]=1,lt[65]=lt[105]=0,ct[65]=ct[105]=1,ft[65]=ft[105]=0,Je[65]=Je[105]=0,Ze[65]=Ze[105]=-1,Qe[65]=Qe[105]=0,nt[160]=nt[10]=-1,it[160]=it[10]=0,ot[160]=ot[10]=1,at[160]=at[10]=-1,st[160]=st[10]=0,ut[160]=ut[10]=0,vt[160]=vt[10]=1,_t[160]=_t[10]=0,bt[160]=bt[10]=0,gt[160]=gt[10]=1,mt[160]=mt[10]=0,yt[160]=yt[10]=1,pt[130]=pt[40]=0,ht[130]=ht[40]=1,dt[130]=dt[40]=1,lt[130]=lt[40]=0,ct[130]=ct[40]=1,ft[130]=ft[40]=0,Je[130]=Je[40]=0,Ze[130]=Ze[40]=-1,Qe[130]=Qe[40]=0,et[130]=et[40]=0,tt[130]=tt[40]=-1,rt[130]=rt[40]=1,at[37]=at[133]=0,st[37]=st[133]=1,ut[37]=ut[133]=1,vt[37]=vt[133]=0,_t[37]=_t[133]=1,bt[37]=bt[133]=0,Je[37]=Je[133]=-1,Ze[37]=Ze[133]=0,Qe[37]=Qe[133]=0,et[37]=et[133]=1,tt[37]=tt[133]=0,rt[37]=rt[133]=0,pt[148]=pt[22]=-1,ht[148]=ht[22]=0,dt[148]=dt[22]=0,vt[148]=vt[22]=0,_t[148]=_t[22]=-1,bt[148]=bt[22]=1,gt[148]=gt[22]=0,mt[148]=mt[22]=1,yt[148]=yt[22]=1,et[148]=et[22]=-1,tt[148]=tt[22]=0,rt[148]=rt[22]=1,nt[82]=nt[88]=0,it[82]=it[88]=-1,ot[82]=ot[88]=1,pt[82]=pt[88]=1,ht[82]=ht[88]=0,dt[82]=dt[88]=1,lt[82]=lt[88]=-1,ct[82]=ct[88]=0,ft[82]=ft[88]=1,gt[82]=gt[88]=0,mt[82]=mt[88]=-1,yt[82]=yt[88]=0,nt[73]=nt[97]=0,it[73]=it[97]=1,ot[73]=ot[97]=0,at[73]=at[97]=0,st[73]=st[97]=-1,ut[73]=ut[97]=0,lt[73]=lt[97]=1,ct[73]=ct[97]=0,ft[73]=ft[97]=0,Je[73]=Je[97]=1,Ze[73]=Ze[97]=0,Qe[73]=Qe[97]=1,nt[145]=nt[25]=0,it[145]=it[25]=-1,ot[145]=ot[25]=0,lt[145]=lt[25]=1,ct[145]=ct[25]=0,ft[145]=ft[25]=1,vt[145]=vt[25]=0,_t[145]=_t[25]=1,bt[145]=bt[25]=1,et[145]=et[25]=-1,tt[145]=tt[25]=0,rt[145]=rt[25]=0,at[70]=at[100]=0,st[70]=st[100]=1,ut[70]=ut[100]=0,pt[70]=pt[100]=-1,ht[70]=ht[100]=0,dt[70]=dt[100]=1,gt[70]=gt[100]=0,mt[70]=mt[100]=-1,yt[70]=yt[100]=1,Je[70]=Je[100]=1,Ze[70]=Ze[100]=0,Qe[70]=Qe[100]=0,at[101]=at[69]=0,st[101]=st[69]=1,ut[101]=ut[69]=0,Je[101]=Je[69]=1,Ze[101]=Ze[69]=0,Qe[101]=Qe[69]=0,vt[149]=vt[21]=0,_t[149]=_t[21]=1,bt[149]=bt[21]=1,et[149]=et[21]=-1,tt[149]=tt[21]=0,rt[149]=rt[21]=0,pt[86]=pt[84]=-1,ht[86]=ht[84]=0,dt[86]=dt[84]=1,gt[86]=gt[84]=0,mt[86]=mt[84]=-1,yt[86]=yt[84]=1,nt[89]=nt[81]=0,it[89]=it[81]=-1,ot[89]=ot[81]=0,lt[89]=lt[81]=1,ct[89]=ct[81]=0,ft[89]=ft[81]=1,nt[96]=nt[74]=0,it[96]=it[74]=1,ot[96]=ot[74]=0,at[96]=at[74]=-1,st[96]=st[74]=0,ut[96]=ut[74]=1,gt[96]=gt[74]=1,mt[96]=mt[74]=0,yt[96]=yt[74]=0,Je[96]=Je[74]=1,Ze[96]=Ze[74]=0,Qe[96]=Qe[74]=1,nt[24]=nt[146]=0,it[24]=it[146]=-1,ot[24]=ot[146]=1,pt[24]=pt[146]=1,ht[24]=ht[146]=0,dt[24]=dt[146]=1,lt[24]=lt[146]=0,ct[24]=ct[146]=1,ft[24]=ft[146]=1,et[24]=et[146]=0,tt[24]=tt[146]=-1,rt[24]=rt[146]=0,at[6]=at[164]=-1,st[6]=st[164]=0,ut[6]=ut[164]=1,pt[6]=pt[164]=-1,ht[6]=ht[164]=0,dt[6]=dt[164]=0,vt[6]=vt[164]=0,_t[6]=_t[164]=-1,bt[6]=bt[164]=1,gt[6]=gt[164]=1,mt[6]=mt[164]=0,yt[6]=yt[164]=0,lt[129]=lt[41]=0,ct[129]=ct[41]=1,ft[129]=ft[41]=1,vt[129]=vt[41]=0,_t[129]=_t[41]=1,bt[129]=bt[41]=0,Je[129]=Je[41]=-1,Ze[129]=Ze[41]=0,Qe[129]=Qe[41]=0,et[129]=et[41]=0,tt[129]=tt[41]=-1,rt[129]=rt[41]=0,pt[66]=pt[104]=0,ht[66]=ht[104]=1,dt[66]=dt[104]=0,lt[66]=lt[104]=-1,ct[66]=ct[104]=0,ft[66]=ft[104]=1,gt[66]=gt[104]=0,mt[66]=mt[104]=-1,yt[66]=yt[104]=0,Je[66]=Je[104]=0,Ze[66]=Ze[104]=-1,Qe[66]=Qe[104]=1,nt[144]=nt[26]=-1,it[144]=it[26]=0,ot[144]=ot[26]=0,vt[144]=vt[26]=1,_t[144]=_t[26]=0,bt[144]=bt[26]=1,gt[144]=gt[26]=0,mt[144]=mt[26]=1,yt[144]=yt[26]=1,et[144]=et[26]=-1,tt[144]=tt[26]=0,rt[144]=rt[26]=1,at[36]=at[134]=0,st[36]=st[134]=1,ut[36]=ut[134]=1,pt[36]=pt[134]=0,ht[36]=ht[134]=1,dt[36]=dt[134]=0,Je[36]=Je[134]=0,Ze[36]=Ze[134]=-1,Qe[36]=Qe[134]=1,et[36]=et[134]=1,tt[36]=tt[134]=0,rt[36]=rt[134]=0,nt[9]=nt[161]=-1,it[9]=it[161]=0,ot[9]=ot[161]=0,at[9]=at[161]=0,st[9]=st[161]=-1,ut[9]=ut[161]=0,lt[9]=lt[161]=1,ct[9]=ct[161]=0,ft[9]=ft[161]=0,vt[9]=vt[161]=1,_t[9]=_t[161]=0,bt[9]=bt[161]=1,nt[136]=0,it[136]=1,ot[136]=1,at[136]=0,st[136]=1,ut[136]=0,pt[136]=-1,ht[136]=0,dt[136]=1,lt[136]=-1,ct[136]=0,ft[136]=0,vt[136]=0,_t[136]=-1,bt[136]=0,gt[136]=0,mt[136]=-1,yt[136]=1,Je[136]=1,Ze[136]=0,Qe[136]=0,et[136]=1,tt[136]=0,rt[136]=1,nt[34]=0,it[34]=-1,ot[34]=0,at[34]=0,st[34]=-1,ut[34]=1,pt[34]=1,ht[34]=0,dt[34]=0,lt[34]=1,ct[34]=0,ft[34]=1,vt[34]=0,_t[34]=1,bt[34]=1,gt[34]=0,mt[34]=1,yt[34]=0,Je[34]=-1,Ze[34]=0,Qe[34]=1,et[34]=-1,tt[34]=0,rt[34]=0,nt[35]=0,it[35]=1,ot[35]=1,at[35]=0,st[35]=-1,ut[35]=1,pt[35]=1,ht[35]=0,dt[35]=0,lt[35]=-1,ct[35]=0,ft[35]=0,vt[35]=0,_t[35]=-1,bt[35]=0,gt[35]=0,mt[35]=1,yt[35]=0,Je[35]=-1,Ze[35]=0,Qe[35]=1,et[35]=1,tt[35]=0,rt[35]=1,nt[153]=0,it[153]=1,ot[153]=1,lt[153]=-1,ct[153]=0,ft[153]=0,vt[153]=0,_t[153]=-1,bt[153]=0,et[153]=1,tt[153]=0,rt[153]=1,at[102]=0,st[102]=-1,ut[102]=1,pt[102]=1,ht[102]=0,dt[102]=0,gt[102]=0,mt[102]=1,yt[102]=0,Je[102]=-1,Ze[102]=0,Qe[102]=1,nt[155]=0,it[155]=-1,ot[155]=0,lt[155]=1,ct[155]=0,ft[155]=1,vt[155]=0,_t[155]=1,bt[155]=1,et[155]=-1,tt[155]=0,rt[155]=0,at[103]=0,st[103]=1,ut[103]=0,pt[103]=-1,ht[103]=0,dt[103]=1,gt[103]=0,mt[103]=-1,yt[103]=1,Je[103]=1,Ze[103]=0,Qe[103]=0,nt[152]=0,it[152]=1,ot[152]=1,pt[152]=-1,ht[152]=0,dt[152]=1,lt[152]=-1,ct[152]=0,ft[152]=0,vt[152]=0,_t[152]=-1,bt[152]=0,gt[152]=0,mt[152]=-1,yt[152]=1,et[152]=1,tt[152]=0,rt[152]=1,nt[156]=0,it[156]=-1,ot[156]=1,pt[156]=1,ht[156]=0,dt[156]=1,lt[156]=-1,ct[156]=0,ft[156]=0,vt[156]=0,_t[156]=-1,bt[156]=0,gt[156]=0,mt[156]=1,yt[156]=1,et[156]=-1,tt[156]=0,rt[156]=1,nt[137]=0,it[137]=1,ot[137]=1,at[137]=0,st[137]=1,ut[137]=0,lt[137]=-1,ct[137]=0,ft[137]=0,vt[137]=0,_t[137]=-1,bt[137]=0,Je[137]=1,Ze[137]=0,Qe[137]=0,et[137]=1,tt[137]=0,rt[137]=1,nt[139]=0,it[139]=1,ot[139]=1,at[139]=0,st[139]=-1,ut[139]=0,lt[139]=1,ct[139]=0,ft[139]=0,vt[139]=0,_t[139]=1,bt[139]=0,Je[139]=-1,Ze[139]=0,Qe[139]=0,et[139]=1,tt[139]=0,rt[139]=1,nt[98]=0,it[98]=-1,ot[98]=0,at[98]=0,st[98]=-1,ut[98]=1,pt[98]=1,ht[98]=0,dt[98]=0,lt[98]=1,ct[98]=0,ft[98]=1,gt[98]=0,mt[98]=1,yt[98]=0,Je[98]=-1,Ze[98]=0,Qe[98]=1,nt[99]=0,it[99]=1,ot[99]=0,at[99]=0,st[99]=-1,ut[99]=1,pt[99]=1,ht[99]=0,dt[99]=0,lt[99]=-1,ct[99]=0,ft[99]=1,gt[99]=0,mt[99]=-1,yt[99]=0,Je[99]=1,Ze[99]=0,Qe[99]=1,at[38]=0,st[38]=-1,ut[38]=1,pt[38]=1,ht[38]=0,dt[38]=0,vt[38]=0,_t[38]=1,bt[38]=1,gt[38]=0,mt[38]=1,yt[38]=0,Je[38]=-1,Ze[38]=0,Qe[38]=1,et[38]=-1,tt[38]=0,rt[38]=0,at[39]=0,st[39]=1,ut[39]=1,pt[39]=-1,ht[39]=0,dt[39]=0,vt[39]=0,_t[39]=-1,bt[39]=1,gt[39]=0,mt[39]=1,yt[39]=0,Je[39]=-1,Ze[39]=0,Qe[39]=1,et[39]=1,tt[39]=0,rt[39]=0;var Mx=l((function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p00"),Ix=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]}),"p01"),Px=l((function(t){return[[t.topright,1],[1,1],[1,t.righttop]]}),"p02"),Sx=l((function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]}),"p03"),Cx=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]}),"p04"),kx=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]}),"p05"),Ox=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]}),"p06"),Nx=l((function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p07"),A6=l((function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]}),"p08"),L6=l((function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]}),"p09"),R6=l((function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]}),"p10"),D6=l((function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p11"),F6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]}),"p12"),B6=l((function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]}),"p13"),j6=l((function(){return[[0,0],[0,1],[1,1],[1,0]]}),"p14"),z6=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]}),"p15"),q6=l((function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]}),"p16"),G6=l((function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]}),"p17"),U6=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]}),"p18"),V6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p19"),X6=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]}),"p20"),Y6=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]}),"p21"),W6=l((function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]}),"p22"),H6=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p23"),$6=l((function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p24"),K6=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]}),"p25"),J6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p26"),Z6=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p27"),Q6=l((function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p28"),e4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]}),"p29"),t4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p30"),r4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p31"),n4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p32"),i4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p33"),o4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p34"),a4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p35"),s4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p36"),u4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p37"),l4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p38"),c4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p39"),St=[],Ct=[],kt=[],Ot=[],Nt=[],Tt=[],At=[],Lt=[];Ot[1]=Nt[1]=18,Ot[169]=Nt[169]=18,kt[4]=Ct[4]=12,kt[166]=Ct[166]=12,St[16]=Lt[16]=4,St[154]=Lt[154]=4,Tt[64]=At[64]=22,Tt[106]=At[106]=22,kt[2]=Tt[2]=17,Ot[2]=Nt[2]=18,kt[168]=Tt[168]=17,Ot[168]=Nt[168]=18,St[8]=Ot[8]=9,Ct[8]=kt[8]=12,St[162]=Ot[162]=9,Ct[162]=kt[162]=12,St[32]=Lt[32]=4,Ct[32]=At[32]=1,St[138]=Lt[138]=4,Ct[138]=At[138]=1,Nt[128]=Lt[128]=21,Tt[128]=At[128]=22,Nt[42]=Lt[42]=21,Tt[42]=At[42]=22,Ct[5]=Nt[5]=14,Ct[165]=Nt[165]=14,kt[20]=Lt[20]=6,kt[150]=Lt[150]=6,St[80]=Tt[80]=11,St[90]=Tt[90]=11,Ot[65]=At[65]=3,Ot[105]=At[105]=3,St[160]=Tt[160]=11,Ct[160]=Nt[160]=14,St[10]=Tt[10]=11,Ct[10]=Nt[10]=14,kt[130]=Lt[130]=6,Ot[130]=At[130]=3,kt[40]=Lt[40]=6,Ot[40]=At[40]=3,Ct[101]=At[101]=1,Ct[69]=At[69]=1,Nt[149]=Lt[149]=21,Nt[21]=Lt[21]=21,kt[86]=Tt[86]=17,kt[84]=Tt[84]=17,St[89]=Ot[89]=9,St[81]=Ot[81]=9,St[96]=At[96]=0,Ct[96]=Tt[96]=15,St[74]=At[74]=0,Ct[74]=Tt[74]=15,St[24]=kt[24]=8,Ot[24]=Lt[24]=7,St[146]=kt[146]=8,Ot[146]=Lt[146]=7,Ct[6]=Tt[6]=15,kt[6]=Nt[6]=16,Ct[164]=Tt[164]=15,kt[164]=Nt[164]=16,Ot[129]=Lt[129]=7,Nt[129]=At[129]=20,Ot[41]=Lt[41]=7,Nt[41]=At[41]=20,kt[66]=At[66]=2,Ot[66]=Tt[66]=19,kt[104]=At[104]=2,Ot[104]=Tt[104]=19,St[144]=Nt[144]=10,Tt[144]=Lt[144]=23,St[26]=Nt[26]=10,Tt[26]=Lt[26]=23,Ct[36]=Lt[36]=5,kt[36]=At[36]=2,Ct[134]=Lt[134]=5,kt[134]=At[134]=2,St[9]=Nt[9]=10,Ct[9]=Ot[9]=13,St[161]=Nt[161]=10,Ct[161]=Ot[161]=13,Ct[37]=Lt[37]=5,Nt[37]=At[37]=20,Ct[133]=Lt[133]=5,Nt[133]=At[133]=20,kt[148]=Nt[148]=16,Tt[148]=Lt[148]=23,kt[22]=Nt[22]=16,Tt[22]=Lt[22]=23,St[82]=kt[82]=8,Ot[82]=Tt[82]=19,St[88]=kt[88]=8,Ot[88]=Tt[88]=19,St[73]=At[73]=0,Ct[73]=Ot[73]=13,St[97]=At[97]=0,Ct[97]=Ot[97]=13,St[145]=Ot[145]=9,Nt[145]=Lt[145]=21,St[25]=Ot[25]=9,Nt[25]=Lt[25]=21,Ct[70]=At[70]=1,kt[70]=Tt[70]=17,Ct[100]=At[100]=1,kt[100]=Tt[100]=17,St[34]=Ot[34]=9,Ct[34]=kt[34]=12,Nt[34]=Lt[34]=21,Tt[34]=At[34]=22,St[136]=Lt[136]=4,Ct[136]=At[136]=1,kt[136]=Tt[136]=17,Ot[136]=Nt[136]=18,St[35]=Lt[35]=4,Ct[35]=kt[35]=12,Ot[35]=Nt[35]=18,Tt[35]=At[35]=22,St[153]=Lt[153]=4,Ot[153]=Nt[153]=18,Ct[102]=kt[102]=12,Tt[102]=At[102]=22,St[155]=Ot[155]=9,Nt[155]=Lt[155]=23,Ct[103]=At[103]=1,kt[103]=Tt[103]=17,St[152]=Lt[152]=4,kt[152]=Tt[152]=17,Ot[152]=Nt[152]=18,St[156]=kt[156]=8,Ot[156]=Nt[156]=18,Tt[156]=Lt[156]=23,St[137]=Lt[137]=4,Ct[137]=At[137]=1,Ot[137]=Nt[137]=18,St[139]=Lt[139]=4,Ct[139]=Ot[139]=13,Nt[139]=At[139]=20,St[98]=Ot[98]=9,Ct[98]=kt[98]=12,Tt[98]=At[98]=22,St[99]=At[99]=0,Ct[99]=kt[99]=12,Ot[99]=Tt[99]=19,Ct[38]=kt[38]=12,Nt[38]=Lt[38]=21,Tt[38]=At[38]=22,Ct[39]=Lt[39]=5,kt[39]=Nt[39]=16,Tt[39]=At[39]=22;var we=[];function p4(t){return(t>0)-(t<0)||+t}function Al(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return p4(r*(n[1]-e[1])-o*i)}function aO(t,e){var n=t.geometry.coordinates[0].map((function(t){return t[0]})),r=t.geometry.coordinates[0].map((function(t){return t[1]})),i=e.geometry.coordinates[0].map((function(t){return t[0]})),o=e.geometry.coordinates[0].map((function(t){return t[1]}));return Math.max.apply(null,n)===Math.max.apply(null,i)&&Math.max.apply(null,r)===Math.max.apply(null,o)&&Math.min.apply(null,n)===Math.min.apply(null,i)&&Math.min.apply(null,r)===Math.min.apply(null,o)}function Tx(t,e){return e.geometry.coordinates[0].every((function(e){return Dn(jt(e),t)}))}function sO(t,e){return t[0]===e[0]&&t[1]===e[1]}we[1]=we[169]=Mx,we[4]=we[166]=Ix,we[16]=we[154]=Px,we[64]=we[106]=Sx,we[168]=we[2]=Cx,we[162]=we[8]=kx,we[138]=we[32]=Ox,we[42]=we[128]=Nx,we[5]=we[165]=A6,we[20]=we[150]=L6,we[80]=we[90]=R6,we[65]=we[105]=D6,we[160]=we[10]=F6,we[130]=we[40]=B6,we[85]=j6,we[101]=we[69]=z6,we[149]=we[21]=q6,we[86]=we[84]=G6,we[89]=we[81]=U6,we[96]=we[74]=V6,we[24]=we[146]=X6,we[6]=we[164]=Y6,we[129]=we[41]=W6,we[66]=we[104]=H6,we[144]=we[26]=$6,we[36]=we[134]=K6,we[9]=we[161]=J6,we[37]=we[133]=Z6,we[148]=we[22]=Q6,we[82]=we[88]=e4,we[73]=we[97]=t4,we[145]=we[25]=r4,we[70]=we[100]=n4,we[34]=function(t){return[Nx(t),kx(t)]},we[35]=i4,we[136]=function(t){return[Ox(t),Cx(t)]},we[153]=function(t){return[Px(t),Mx(t)]},we[102]=function(t){return[Ix(t),Sx(t)]},we[155]=o4,we[103]=a4,we[152]=function(t){return[Px(t),Cx(t)]},we[156]=s4,we[137]=function(t){return[Ox(t),Mx(t)]},we[139]=u4,we[98]=function(t){return[kx(t),Sx(t)]},we[99]=l4,we[38]=function(t){return[Ix(t),Nx(t)]},we[39]=c4,y(),y(),y(),y(),y(),y(),y(),y(),l(p4,"mathSign"),l(Al,"orientationIndex"),l(aO,"envelopeIsEqual"),l(Tx,"envelopeContains"),l(sO,"coordinatesEqual");var h4=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return l(t,"Node"),t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Al(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),Ax=h4;y();var d4=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return l(t,"Edge"),t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Ar([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return Al(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),uO=d4;y();var g4=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return l(t,"EdgeRing"),t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Al(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return pb(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=cr([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Ob(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o=e.getEnvelope();if(r&&(n=r.getEnvelope()),!aO(o,i)&&Tx(o,i)){for(var s=t.map((function(t){return t.from.coordinates})),a=void 0,u=l((function(t){e.some((function(e){return sO(t,e.from.coordinates)}))||(a=t)}),"_loop_1"),c=0,h=s;c<h.length;c++){u(h[c])}a&&e.inside(jt(a))&&(!r||Tx(n,o))&&(r=e)}})),r},t.prototype.inside=function(t){return Dn(t,this.toPolygon())},t}(),Lx=g4;function m4(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}l(m4,"validateGeoJson");var She=function(){function t(){this.edges=[],this.nodes={}}return l(t,"Graph"),t.fromGeoJson=function(e){m4(e);var n=new t;return ni(e,(function(t){db(t,"LineString","Graph::fromGeoJson"),dS(t,(function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e}))})),n},t.prototype.getNode=function(t){var e=Ax.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ax(t)),n},t.prototype.addEdge=function(t,e){var n=new uO(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},t.prototype._computeNextCWEdges=function(t){var e=this;typeof t>"u"?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,l=void 0,u=void 0;s.label===e&&(l=s),a.label===e&&(u=a),l&&u&&(u&&(r=u),l&&(r&&(r.next=l,r=void 0),n||(n=l)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=l((function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next}),"_loop_1");do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new Lx;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()},t}();y(),y(),y(),y();var b4=er(Rx(),1);y();var x4=er(Rx(),1);y(),y();var E4=er(yO(),1);y();var O4=er(SO(),1);function kO(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function T4(){return new OO((function(t){return t.f}))}y(),y(),l(kO,"pathTo"),l(T4,"getHeap");var jx={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||jx.heuristics.manhattan,o=r.closest||!1,s=T4(),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var l=s.pop();if(l===n)return kO(l);l.closed=!0;for(var u=t.neighbors(l),c=0,h=u.length;c<h;++c){var p=u[c];if(!p.closed&&!p.isWall()){var f=l.g+p.getCost(l),d=p.visited;(!d||f<p.g)&&(p.visited=!0,p.parent=l,p.h=p.h||i(p,n),p.g=f,p.f=p.g+p.h,t.markDirty(p),o&&(p.h<a.h||p.h===a.h&&p.g<a.g)&&(a=p),d?s.rescoreElement(p):s.push(p))}}}return o?kO(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function zp(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new fm(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function fm(t,e,n){this.x=t,this.y=e,this.weight=n}function OO(t){this.content=[],this.scoreFunction=t}function zx(){this._=null}function Rl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function qp(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Gp(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function NO(t){for(;t.L;)t=t.L;return t}l(zp,"Graph"),zp.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)jx.cleanNode(this.nodes[t])},zp.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)jx.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},zp.prototype.markDirty=function(t){this.dirtyNodes.push(t)},zp.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},zp.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},l(fm,"GridNode"),fm.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},fm.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},fm.prototype.isWall=function(){return 0===this.weight},l(OO,"BinaryHeap"),OO.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var l=this.content[s];(i=this.scoreFunction(l))<r&&(a=s)}if(o<e){var u=this.content[o];this.scoreFunction(u)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},y(),y(),y(),y(),y(),y(),y(),y(),l(zx,"RedBlackTree"),l(Rl,"RedBlackNode"),zx.prototype={constructor:zx,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=NO(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(qp(this,n),n=(t=n).U),n.C=!1,r.C=!0,Gp(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Gp(this,n),n=(t=n).U),n.C=!1,r.C=!0,qp(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?NO(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,qp(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Gp(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,qp(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Gp(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,qp(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Gp(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},l(qp,"RedBlackRotateLeft"),l(Gp,"RedBlackRotateRight"),l(NO,"RedBlackFirst");var qx=zx;function Dl(t,e,n,r){var i=[null,null],o=Fn.push(i)-1;return i.left=t,i.right=e,n&&Up(i,t,e,n),r&&Up(i,e,t,r),_i[t.index].halfedges.push(o),_i[e.index].halfedges.push(o),i}function Fl(t,e,n){var r=[e,n];return r.left=t,r}function Up(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function A4(t,e,n,r,i){var o,s=t[0],a=t[1],l=s[0],u=s[1],c=0,h=1,p=a[0]-l,f=a[1]-u;if(o=e-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=r-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}if(o=n-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=i-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}return!(c>0)&&!(h<1)||(c>0&&(t[0]=[l+c*p,u+c*f]),h<1&&(t[1]=[l+h*p,u+h*f])),!0}}}}}function L4(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,l=t[0],u=t.left,c=t.right,h=u[0],p=u[1],f=c[0],d=c[1],g=(h+f)/2,y=(p+d)/2;if(d===p){if(g<e||g>=r)return;if(h>f){if(l){if(l[1]>=i)return}else l=[g,n];o=[g,i]}else{if(l){if(l[1]<n)return}else l=[g,i];o=[g,n]}}else if(a=y-(s=(h-f)/(d-p))*g,s<-1||s>1)if(h>f){if(l){if(l[1]>=i)return}else l=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(l){if(l[1]<n)return}else l=[(i-a)/s,i];o=[(n-a)/s,n]}else if(p<d){if(l){if(l[0]>=r)return}else l=[e,s*e+a];o=[r,s*r+a]}else{if(l){if(l[0]<e)return}else l=[r,s*r+a];o=[e,s*e+a]}return t[0]=l,t[1]=o,!0}function TO(t,e,n,r){for(var i,o=Fn.length;o--;)L4(i=Fn[o],t,e,n,r)&&A4(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>ir||Math.abs(i[0][1]-i[1][1])>ir)||delete Fn[o]}function AO(t){return _i[t.index]={site:t,halfedges:[]}}function R4(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Gx(t,e){return e[+(e.left!==t.site)]}function D4(t,e){return e[+(e.left===t.site)]}function LO(){for(var t,e,n,r,i=0,o=_i.length;i<o;++i)if((t=_i[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=R4(t,Fn[e[n]]);for(s.sort((function(t,e){return a[e]-a[t]})),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}function RO(t,e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=_i.length,v=!0;for(i=0;i<y;++i)if(o=_i[i]){for(s=o.site,a=(l=o.halfedges).length;a--;)Fn[l[a]]||l.splice(a,1);for(a=0,u=l.length;a<u;)d=(f=D4(o,Fn[l[a]]))[0],g=f[1],h=(c=Gx(o,Fn[l[++a%u]]))[0],p=c[1],(Math.abs(d-h)>ir||Math.abs(g-p)>ir)&&(l.splice(a,0,Fn.push(Fl(s,f,Math.abs(d-t)<ir&&r-g>ir?[t,Math.abs(h-t)<ir?p:r]:Math.abs(g-r)<ir&&n-d>ir?[Math.abs(p-r)<ir?h:n,r]:Math.abs(d-n)<ir&&g-e>ir?[n,Math.abs(h-n)<ir?p:e]:Math.abs(g-e)<ir&&d-t>ir?[Math.abs(p-e)<ir?h:t,e]:null))-1),++u);u&&(v=!1)}if(v){var m,_,b,w=1/0;for(i=0,v=null;i<y;++i)(o=_i[i])&&((b=(m=(s=o.site)[0]-t)*m+(_=s[1]-e)*_)<w&&(w=b,v=o));if(v){var x=[t,e],E=[t,r],I=[n,r],S=[n,e];v.halfedges.push(Fn.push(Fl(s=v.site,x,E))-1,Fn.push(Fl(s,E,I))-1,Fn.push(Fl(s,I,S))-1,Fn.push(Fl(s,S,x))-1)}}for(i=0;i<y;++i)(o=_i[i])&&(o.halfedges.length||delete _i[i])}y(),y(),l(Dl,"createEdge"),l(Fl,"createBorderEdge"),l(Up,"setEdgeEnd"),l(A4,"clipEdge"),l(L4,"connectEdge"),l(TO,"clipEdges"),l(AO,"createCell"),l(R4,"cellHalfedgeAngle"),l(Gx,"cellHalfedgeStart"),l(D4,"cellHalfedgeEnd"),l(LO,"sortCellHalfedges"),l(RO,"clipCells"),y();var pm,DO=[];function F4(){Rl(this),this.x=this.y=this.arc=this.site=this.cy=null}function Cu(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],l=r[0]-s,u=r[1]-a,c=o[0]-s,h=o[1]-a,p=2*(l*h-u*c);if(!(p>=-FO)){var f=l*l+u*u,d=c*c+h*h,g=(h*f-u*d)/p,y=(l*d-c*f)/p,v=DO.pop()||new F4;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var m=null,_=Bl._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Bl.insert(m,v),m||(pm=v)}}}}function ku(t){var e=t.circle;e&&(e.P||(pm=e.N),Bl.remove(e),DO.push(e),Rl(e),t.circle=null)}l(F4,"Circle"),l(Cu,"attachCircle"),l(ku,"detachCircle");var jO=[];function B4(){Rl(this),this.edge=this.site=this.circle=null}function BO(t){var e=jO.pop()||new B4;return e.site=t,e}function Ux(t){ku(t),Ou.remove(t),jO.push(t),Rl(t)}function zO(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Ux(t);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<ir&&Math.abs(r-l.circle.cy)<ir;)o=l.P,a.unshift(l),Ux(l),l=o;a.unshift(l),ku(l);for(var u=s;u.circle&&Math.abs(n-u.circle.x)<ir&&Math.abs(r-u.circle.cy)<ir;)s=u.N,a.push(u),Ux(u),u=s;a.push(u),ku(u);var c,h=a.length;for(c=1;c<h;++c)u=a[c],l=a[c-1],Up(u.edge,l.site,u.site,i);l=a[0],(u=a[h-1]).edge=Dl(l.site,u.site,null,i),Cu(l),Cu(u)}function qO(t){for(var e,n,r,i,o=t[0],s=t[1],a=Ou._;a;)if((r=GO(a,s)-o)>ir)a=a.L;else{if(!((i=o-j4(a,s))>ir)){r>-ir?(e=a.P,n=a):i>-ir?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}AO(t);var l=BO(t);if(Ou.insert(e,l),e||n){if(e===n)return ku(e),n=BO(e.site),Ou.insert(l,n),l.edge=n.edge=Dl(e.site,l.site),Cu(e),void Cu(n);if(!n)return void(l.edge=Dl(e.site,l.site));ku(e),ku(n);var u=e.site,c=u[0],h=u[1],p=t[0]-c,f=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(p*y-f*g),m=p*p+f*f,_=g*g+y*y,b=[(y*m-f*_)/v+c,(p*_-g*m)/v+h];Up(n.edge,u,d,b),l.edge=Dl(u,t,null,b),n.edge=Dl(t,d,null,b),Cu(e),Cu(n)}}function GO(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],l=n[1],u=l-e;if(!u)return a;var c=a-r,h=1/o-1/u,p=c/u;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*u)-l+u/2+i-o/2)))/h+r:(r+a)/2}function j4(t,e){var n=t.N;if(n)return GO(n,e);var r=t.site;return r[1]===e?r[0]:1/0}l(B4,"Beach"),l(BO,"createBeach"),l(Ux,"detachBeach"),l(zO,"removeBeach"),l(qO,"addBeach"),l(GO,"leftBreakPoint"),l(j4,"rightBreakPoint");var Ou,_i,Bl,Fn,ir=1e-6,FO=1e-12;function z4(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function q4(t,e){return e[1]-t[1]||e[0]-t[0]}function hm(t,e){var n,r,i,o=t.sort(q4).pop();for(Fn=[],_i=new Array(t.length),Ou=new qx,Bl=new qx;;)if(i=pm,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))(o[0]!==n||o[1]!==r)&&(qO(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;zO(i.arc)}if(LO(),e){var s=+e[0][0],a=+e[0][1],l=+e[1][0],u=+e[1][1];TO(s,a,l,u),RO(s,a,l,u)}this.edges=Fn,this.cells=_i,Ou=Bl=Fn=_i=null}l(z4,"triangleArea"),l(q4,"lexicographic"),l(hm,"Diagram"),hm.prototype={constructor:hm,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Gx(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,l=-1,u=e[i[o-1]],c=u.left===a?u.right:u.left;++l<o;)s=c,c=(u=e[i[l]]).left===a?u.right:u.left,s&&c&&r<s.index&&r<c.index&&z4(a,s,c)<0&&t.push([a.data,s.data,c.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var l=t-i.site[0],u=e-i.site[1],c=l*l+u*u;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var l=t-a[0],u=e-a[1],h=l*l+u*u;h<c&&(c=h,s=a.index)}}))}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}},y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y();var $4=er(jl(),1);y();var Xl=er(YO(),1);function bi(){return new mm}function mm(){this.reset()}y(),y(),y(),l(bi,"default"),l(mm,"Adder"),mm.prototype={constructor:mm,reset:function(){this.s=this.t=0},add:function(t){WO(gm,t,this.t),WO(this,gm.s,this.s),this.s?this.t+=gm.t:this.s=gm.t},valueOf:function(){return this.s}};var gm=new mm;function WO(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}l(WO,"add"),y();var je=1e-6,xt=Math.PI,wn=xt/2,ym=xt/4,Hn=2*xt,xi=180/xt,Fr=xt/180,Yt=Math.abs,qo=Math.atan,Bn=Math.atan2,De=Math.cos,vm=Math.exp,Vp=Math.log,Fe=Math.sin,cn=Math.sqrt,Xp=Math.tan;function _m(t){return t>1?0:t<-1?xt:Math.acos(t)}function En(t){return t>1?wn:t<-1?-wn:Math.asin(t)}function wi(){}function bm(t,e){t&&$O.hasOwnProperty(t.type)&&$O[t.type](t,e)}l(_m,"acos"),l(En,"asin"),y(),l(wi,"noop"),y(),l(bm,"streamGeometry");var HO={Feature:function(t,e){bm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)bm(n[r].geometry,e)}},$O={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,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Yx(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yx(n[r],e,0)},Polygon:function(t,e){KO(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)KO(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)bm(n[r],e)}};function Yx(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function KO(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yx(t[n],e,1);e.polygonEnd()}function Ya(t,e){t&&HO.hasOwnProperty(t.type)?HO[t.type](t,e):bm(t,e)}l(Yx,"streamLine"),l(KO,"streamPolygon"),l(Ya,"default");var K4=bi(),fve=bi();function zl(t){return[Bn(t[1],t[0]),En(t[2])]}function Go(t){var e=t[0],n=t[1],r=De(n);return[r*De(e),r*Fe(e),Fe(n)]}function Yp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Nu(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 xm(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Wp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ql(t){var e=cn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}y(),y(),l(zl,"spherical"),l(Go,"cartesian"),l(Yp,"cartesianDot"),l(Nu,"cartesianCross"),l(xm,"cartesianAddInPlace"),l(Wp,"cartesianScale"),l(ql,"cartesianNormalizeInPlace");var Ive=bi();function Hp(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return l(n,"compose"),t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Wx(t,e){return[t>xt?t-Hn:t<-xt?t+Hn:t,e]}function Hx(t,e,n){return(t%=Hn)?e||n?Hp(ZO(t),QO(e,n)):ZO(t):e||n?QO(e,n):Wx}function JO(t){return function(e,n){return[(e+=t)>xt?e-Hn:e<-xt?e+Hn:e,n]}}function ZO(t){var e=JO(t);return e.invert=JO(-t),e}function QO(t,e){var n=De(t),r=Fe(t),i=De(e),o=Fe(e);function s(t,e){var s=De(e),a=De(t)*s,l=Fe(t)*s,u=Fe(e),c=u*n+a*r;return[Bn(l*i-c*o,a*n-u*r),En(c*i+l*o)]}return l(s,"rotation"),s.invert=function(t,e){var s=De(e),a=De(t)*s,l=Fe(t)*s,u=Fe(e),c=u*i-l*o;return[Bn(l*i+u*o,a*n+c*r),En(c*n-a*r)]},s}function tN(t,e,n,r,i,o){if(n){var s=De(e),a=Fe(e),l=r*n;null==i?(i=e+r*Hn,o=e-l/2):(i=eN(s,i),o=eN(s,o),(r>0?i<o:i>o)&&(i+=r*Hn));for(var u,c=i;r>0?c>o:c<o;c-=l)u=zl([s,-a*De(c),-a*Fe(c)]),t.point(u[0],u[1])}}function eN(t,e){(e=Go(e))[0]-=t,ql(e);var n=_m(-e[1]);return((-e[2]<0?-n:n)+Hn-je)%Hn}function $p(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function $x(t,e,n,r,i,o){var s,a=t[0],l=t[1],u=0,c=1,h=e[0]-a,p=e[1]-l;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<u)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>u&&(u=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>u&&(u=s)}else if(h>0){if(s<u)return;s<c&&(c=s)}if(s=r-l,p||!(s>0)){if(s/=p,p<0){if(s<u)return;s<c&&(c=s)}else if(p>0){if(s>c)return;s>u&&(u=s)}if(s=o-l,p||!(s<0)){if(s/=p,p<0){if(s>c)return;s>u&&(u=s)}else if(p>0){if(s<u)return;s<c&&(c=s)}return u>0&&(t[0]=a+u*h,t[1]=l+u*p),c<1&&(e[0]=a+c*h,e[1]=l+c*p),!0}}}}}function Tu(t,e){return Yt(t[0]-e[0])<je&&Yt(t[1]-e[1])<je}function wm(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 Kp(t,e,n,r,i){var o,s,a=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(Tu(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a.push(n=new wm(r,t,null,!0)),l.push(n.o=new wm(r,null,n,!1)),a.push(n=new wm(s,t,null,!1)),l.push(n.o=new wm(s,null,n,!0))}})),a.length){for(l.sort(e),rN(a),rN(l),o=0,s=l.length;o<s;++o)l[o].e=n=!n;for(var u,c,h=a[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=u.length;o<s;++o)i.point((c=u[o])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(u=p.p.z,o=u.length-1;o>=0;--o)i.point((c=u[o])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}}function rN(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Wa(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Em(t){return 1===t.length&&(t=J4(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function J4(t){return function(e,n){return Wa(t(e),n)}}y(),y(),y(),y(),y(),l(Hp,"default"),l(Wx,"rotationIdentity"),Wx.invert=Wx,l(Hx,"rotateRadians"),l(JO,"forwardRotationLambda"),l(ZO,"rotationLambda"),l(QO,"rotationPhiGamma"),l(tN,"circleStream"),l(eN,"circleRadius"),y(),y(),l($p,"default"),y(),l($x,"default"),y(),y(),l(Tu,"default"),l(wm,"Intersection"),l(Kp,"default"),l(rN,"link"),y(),y(),y(),l(Wa,"default"),y(),l(Em,"default"),l(J4,"ascendingComparator");var nN=Em(Wa),Z4=nN.right,Q4=nN.left;y(),y(),y(),y(),y(),y(),y(),y(),y();var iN=Array.prototype,tG=iN.slice,rG=iN.map;y(),y(),y(),y();var l1e=Math.sqrt(50),c1e=Math.sqrt(10),f1e=Math.sqrt(2);function Gl(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}y(),y(),y(),y(),y(),y(),y(),y(),l(Gl,"default"),y(),y(),y(),y(),y(),y(),y();var Jp=1e9,Im=-Jp;function Kx(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return Yt(r[0]-t)<je?i>0?0:3:Yt(r[0]-n)<je?i>0?2:1:Yt(r[1]-e)<je?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(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 l(i,"visible"),l(o,"interpolate"),l(s,"corner"),l(a,"compareIntersection"),l(u,"comparePoint"),function(s){var u,c,h,p,f,d,g,y,v,m,_,b=s,w=$p(),x={point:E,lineStart:M,lineEnd:C,polygonStart:S,polygonEnd:N};function E(t,e){i(t,e)&&b.point(t,e)}function I(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,s,a=c[n],l=1,u=a.length,h=a[0],p=h[0],f=h[1];l<u;++l)o=p,s=f,p=(h=a[l])[0],f=h[1],s<=r?f>r&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function S(){b=w,u=[],c=[],_=!0}function N(){var t=I(),e=_&&t,n=(u=Gl(u)).length;(e||n)&&(s.polygonStart(),e&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),n&&Kp(u,a,t,o,s),s.polygonEnd()),b=s,u=c=h=null}function M(){x.point=O,c&&c.push(h=[]),m=!0,v=!1,g=y=NaN}function C(){u&&(O(p,f),d&&v&&w.rejoin(),u.push(w.result())),x.point=E,v&&b.lineEnd()}function O(o,s){var a=i(o,s);if(c&&h.push([o,s]),m)p=o,f=s,d=a,m=!1,a&&(b.lineStart(),b.point(o,s));else if(a&&v)b.point(o,s);else{var l=[g=Math.max(Im,Math.min(Jp,g)),y=Math.max(Im,Math.min(Jp,y))],u=[o=Math.max(Im,Math.min(Jp,o)),s=Math.max(Im,Math.min(Jp,s))];$x(l,u,t,e,n,r)?(v||(b.lineStart(),b.point(l[0],l[1])),b.point(u[0],u[1]),a||b.lineEnd(),_=!1):a&&(b.lineStart(),b.point(o,s),_=!1)}g=o,y=s,v=a}return l(E,"point"),l(I,"polygonInside"),l(S,"polygonStart"),l(N,"polygonEnd"),l(M,"lineStart"),l(C,"lineEnd"),l(O,"linePoint"),x}}l(Kx,"clipExtent"),y(),y();var Jx=bi();function Pm(t,e){var n=e[0],r=e[1],i=[Fe(n),-De(n),0],o=0,s=0;Jx.reset();for(var a=0,l=t.length;a<l;++a)if(c=(u=t[a]).length)for(var u,c,h=u[c-1],p=h[0],f=h[1]/2+ym,d=Fe(f),g=De(f),y=0;y<c;++y,p=m,d=b,g=w,h=v){var v=u[y],m=v[0],_=v[1]/2+ym,b=Fe(_),w=De(_),x=m-p,E=x>=0?1:-1,I=E*x,S=I>xt,N=d*b;if(Jx.add(Bn(N*E*Fe(I),g*w+N*De(I))),o+=S?x+E*Hn:x,S^p>=n^m>=n){var M=Nu(Go(h),Go(v));ql(M);var C=Nu(i,M);ql(C);var O=(S^x>=0?-1:1)*En(C[2]);(r>O||r===O&&(M[0]||M[1]))&&(s+=S^x>=0?1:-1)}}return(o<-je||o<je&&Jx<-je)^1&s}l(Pm,"default"),y(),y();var qbe=bi();function Ul(t){return t}y(),y(),y(),y(),l(Ul,"default"),y();var vxe=bi(),_xe=bi();y();var Vl=1/0,Sm=Vl,Zp=-Vl,Cm=Zp,pG={point:hG,lineStart:wi,lineEnd:wi,polygonStart:wi,polygonEnd:wi,result:function(){var t=[[Vl,Sm],[Zp,Cm]];return Zp=Cm=-(Sm=Vl=1/0),t}};function hG(t,e){t<Vl&&(Vl=t),t>Zp&&(Zp=t),e<Sm&&(Sm=e),e>Cm&&(Cm=e)}l(hG,"boundsPoint");var km=pG;function Zx(t){this._context=t}y(),y(),l(Zx,"PathContext"),Zx.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Hn)}},result:wi},y();var jxe=bi();function Qx(){this._string=[]}function sN(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qp(t,e,n,r){return function(i,o){var s,a,u,c=e(o),h=i.invert(r[0],r[1]),p=$p(),f=e(p),d=!1,g={point:y,lineStart:m,lineEnd:_,polygonStart:function(){g.point=b,g.lineStart=w,g.lineEnd=x,a=[],s=[]},polygonEnd:function(){g.point=y,g.lineStart=m,g.lineEnd=_,a=Gl(a);var t=Pm(s,h);a.length?(d||(o.polygonStart(),d=!0),Kp(a,gG,t,n,o)):t&&(d||(o.polygonStart(),d=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),d&&(o.polygonEnd(),d=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function v(t,e){var n=i(t,e);c.point(n[0],n[1])}function m(){g.point=v,c.lineStart()}function _(){g.point=y,c.lineEnd()}function b(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function w(){f.lineStart(),u=[]}function x(){b(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=p.result(),c=l.length;if(u.pop(),s.push(u),u=null,c){if(1&i){if((e=(n=l[0]).length-1)>0){for(d||(o.polygonStart(),d=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}return}c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(dG))}}return l(y,"point"),l(v,"pointLine"),l(m,"lineStart"),l(_,"lineEnd"),l(b,"pointRing"),l(w,"ringStart"),l(x,"ringEnd"),g}}function dG(t){return t.length>1}function gG(t,e){return((t=t.x)[0]<0?t[1]-wn-je:wn-t[1])-((e=e.x)[0]<0?e[1]-wn-je:wn-e[1])}y(),l(Qx,"PathString"),Qx.prototype={_radius:4.5,_circle:sN(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=sN(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},l(sN,"circle"),y(),y(),y(),y(),y(),y(),l(Qp,"default"),l(dG,"validSegment"),l(gG,"compareIntersection");var ew=Qp((function(){return!0}),mG,vG,[-xt,-wn]);function mG(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?xt:-xt,l=Yt(o-n);Yt(l-xt)<je?(t.point(n,r=(r+s)/2>0?wn:-wn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&l>=xt&&(Yt(n-i)<je&&(n-=i*je),Yt(o-a)<je&&(o-=a*je),r=yG(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}function yG(t,e,n,r){var i,o,s=Fe(t-n);return Yt(s)>je?qo((Fe(e)*(o=De(r))*Fe(n)-Fe(r)*(i=De(e))*Fe(t))/(i*o*s)):(e+r)/2}function vG(t,e,n,r){var i;if(null==t)i=n*wn,r.point(-xt,i),r.point(0,i),r.point(xt,i),r.point(xt,0),r.point(xt,-i),r.point(0,-i),r.point(-xt,-i),r.point(-xt,0),r.point(-xt,i);else if(Yt(t[0]-e[0])>je){var o=t[0]<e[0]?xt:-xt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function tw(t,e){var n=De(t),r=n>0,i=Yt(n)>je;function o(n,r,i,o){tN(o,t,e,i,n,r)}function s(t,e){return De(t)*De(e)>n}function a(t){var e,n,o,a,l;return{lineStart:function(){a=o=!1,l=1},point:function(h,p){var f,d=[h,p],g=s(h,p),y=r?g?0:c(h,p):g?c(h+(h<0?xt:-xt),p):0;if(!e&&(a=o=g)&&t.lineStart(),g!==o&&((!(f=u(e,d))||Tu(e,f)||Tu(d,f))&&(d[0]+=je,d[1]+=je,g=s(d[0],d[1]))),g!==o)l=0,g?(t.lineStart(),f=u(d,e),t.point(f[0],f[1])):(f=u(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&r^g){var v;!(y&n)&&(v=u(d,e,!0))&&(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}g&&(!e||!Tu(e,d))&&t.point(d[0],d[1]),e=d,o=g,n=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return l|(a&&o)<<1}}}function u(t,e,r){var i=[1,0,0],o=Nu(Go(t),Go(e)),s=Yp(o,o),a=o[0],l=s-a*a;if(!l)return!r&&t;var u=n*s/l,c=-n*a/l,h=Nu(i,o),p=Wp(i,u);xm(p,Wp(o,c));var f=h,d=Yp(p,f),g=Yp(f,f),y=d*d-g*(Yp(p,p)-1);if(!(y<0)){var v=cn(y),m=Wp(f,(-d-v)/g);if(xm(m,p),m=zl(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],E=e[1];w<b&&(_=b,b=w,w=_);var I=w-b,S=Yt(I-xt)<je;if(!S&&E<x&&(_=x,x=E,E=_),S||I<je?S?x+E>0^m[1]<(Yt(m[0]-b)<je?x:E):x<=m[1]&&m[1]<=E:I>xt^(b<=m[0]&&m[0]<=w)){var N=Wp(f,(-d+v)/g);return xm(N,p),[m,zl(N)]}}}function c(e,n){var i=r?t:xt-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return l(o,"interpolate"),l(s,"visible"),l(a,"clipLine"),l(u,"intersect"),l(c,"code"),Qp(s,a,o,r?[0,-t]:[-xt,t-xt])}function eh(t){return function(e){var n=new rw;for(var r in t)n[r]=t[r];return n.stream=e,n}}function rw(){}function th(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Ya(n,t.stream(km));var s=km.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),l=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,u=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([l,u])}function Om(t,e,n){return th(t,[[0,0],e],n)}l(mG,"clipAntimeridianLine"),l(yG,"clipAntimeridianIntersect"),l(vG,"clipAntimeridianInterpolate"),y(),l(tw,"default"),y(),l(eh,"transformer"),l(rw,"TransformStream"),rw.prototype={constructor:rw,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()}},y(),l(th,"fitExtent"),l(Om,"fitSize"),y();var uN=16,_G=De(30*Fr);function Nm(t,e){return+e?xG(t,e):bG(t)}function bG(t){return eh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function xG(t,e){function n(r,i,o,s,a,l,u,c,h,p,f,d,g,y){var v=u-r,m=c-i,_=v*v+m*m;if(_>4*e&&g--){var b=s+p,w=a+f,x=l+d,E=cn(b*b+w*w+x*x),I=En(x/=E),S=Yt(Yt(x)-1)<je||Yt(o-h)<je?(o+h)/2:Bn(w,b),N=t(S,I),M=N[0],C=N[1],O=M-r,P=C-i,A=m*O-v*P;(A*A/_>e||Yt((v*O+m*P)/_-.5)>.3||s*p+a*f+l*d<_G)&&(n(r,i,o,s,a,l,M,C,S,b/=E,w/=E,x,g,y),y.point(M,C),n(M,C,S,b,w,x,u,c,h,p,f,d,g,y))}}return l(n,"resampleLineTo"),function(e){var r,i,o,s,a,u,c,h,p,f,d,g,y={point:v,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),y.lineStart=w},polygonEnd:function(){e.polygonEnd(),y.lineStart=m}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){h=NaN,y.point=_,e.lineStart()}function _(r,i){var o=Go([r,i]),s=t(r,i);n(h,p,c,f,d,g,h=s[0],p=s[1],c=r,f=o[0],d=o[1],g=o[2],uN,e),e.point(h,p)}function b(){y.point=v,e.lineEnd()}function w(){m(),y.point=x,y.lineEnd=E}function x(t,e){_(r=t,e),i=h,o=p,s=f,a=d,u=g,y.point=_}function E(){n(h,p,c,f,d,g,i,o,r,s,a,u,uN,e),y.lineEnd=b,b()}return l(v,"point"),l(m,"lineStart"),l(_,"linePoint"),l(b,"lineEnd"),l(w,"ringStart"),l(x,"ringPoint"),l(E,"ringEnd"),y}}l(Nm,"default"),l(bG,"resampleNone"),l(xG,"resample");var wG=eh({point:function(t,e){this.stream.point(t*Fr,e*Fr)}});function Uo(t){return nw((function(){return t}))()}function nw(t){var e,n,r,i,o,s,a,u,c,h,p=150,f=480,d=250,g=0,y=0,v=0,m=0,_=0,b=null,w=ew,x=null,E=Ul,I=.5,S=Nm(C,I);function N(t){return[(t=o(t[0]*Fr,t[1]*Fr))[0]*p+n,r-t[1]*p]}function M(t){return(t=o.invert((t[0]-n)/p,(r-t[1])/p))&&[t[0]*xi,t[1]*xi]}function C(t,i){return[(t=e(t,i))[0]*p+n,r-t[1]*p]}function O(){o=Hp(i=Hx(v,m,_),e);var t=e(g,y);return n=f-t[0]*p,r=d+t[1]*p,P()}function P(){return c=h=null,N}return l(N,"projection"),l(M,"invert"),l(C,"projectTransform"),N.stream=function(t){return c&&h===t?c:c=wG(w(i,S(E(h=t))))},N.clipAngle=function(t){return arguments.length?(w=+t?tw(b=t*Fr,6*Fr):(b=null,ew),P()):b*xi},N.clipExtent=function(t){return arguments.length?(E=null==t?(x=s=a=u=null,Ul):Kx(x=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),P()):null==x?null:[[x,s],[a,u]]},N.scale=function(t){return arguments.length?(p=+t,O()):p},N.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],O()):[f,d]},N.center=function(t){return arguments.length?(g=t[0]%360*Fr,y=t[1]%360*Fr,O()):[g*xi,y*xi]},N.rotate=function(t){return arguments.length?(v=t[0]%360*Fr,m=t[1]%360*Fr,_=t.length>2?t[2]%360*Fr:0,O()):[v*xi,m*xi,_*xi]},N.precision=function(t){return arguments.length?(S=Nm(C,I=t*t),P()):cn(I)},N.fitExtent=function(t,e){return th(N,t,e)},N.fitSize=function(t,e){return Om(N,t,e)},l(O,"recenter"),l(P,"reset"),function(){return e=t.apply(this,arguments),N.invert=e.invert&&M,O()}}function Tm(t){return function(e,n){var r=De(e),i=De(n),o=t(r*i);return[o*i*Fe(e),o*Fe(n)]}}function ma(t){return function(e,n){var r=cn(e*e+n*n),i=t(r),o=Fe(i),s=De(i);return[Bn(e*o,r*s),En(r&&n*o/r)]}}l(Uo,"projection"),l(nw,"projectionMutator"),y(),y(),y(),y(),l(Tm,"azimuthalRaw"),l(ma,"azimuthalInvert");var pN=Tm((function(t){return cn(2/(1+t))}));pN.invert=ma((function(t){return 2*En(t/2)})),y();var iw=Tm((function(t){return(t=_m(t))&&t/Fe(t)}));function Am(){return Uo(iw).scale(79.4188).clipAngle(179.999)}function ow(t,e){return[t,Vp(Xp((wn+e)/2))]}function Lm(t,e){return[t,e]}function hN(t,e){var n=De(e),r=De(t)*n;return[n*Fe(t)/r,Fe(e)/r]}function dN(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function gN(t,e){return[De(e)*Fe(t),Fe(e)]}function mN(t,e){var n=De(e),r=1+De(t)*n;return[n*Fe(t)/r,Fe(e)/r]}function yN(t,e){return[Vp(Xp((wn+e)/2)),-t]}function IG(t,e,n){var r=(n=n||{}).units||"kilometers",i=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 i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return fa(t,(function(t){var n=Rm(t,e,r,i);n&&o.push(n)})),Ve(o);case"FeatureCollection":return rr(t,(function(t){var n=Rm(t,e,r,i);n&&rr(n,(function(t){t&&o.push(t)}))})),Ve(o)}return Rm(t,e,r,i)}function Rm(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return fa(t,(function(t){var i=Rm(t,e,n,r);i&&s.push(i)})),Ve(s)}var a=PG(o),l={type:o.type,coordinates:_N(o.coordinates,a)},u=(new Xl.GeoJSONReader).read(l),c=wp(Ep(e,n),"meters"),h=Xl.BufferOp.bufferOp(u,c,r);if(!vN((h=(new Xl.GeoJSONWriter).write(h)).coordinates))return bn({type:h.type,coordinates:bN(h.coordinates,a)},i)}function vN(t){return Array.isArray(t[0])?vN(t[0]):isNaN(t[0])}function _N(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return _N(t,e)}))}function bN(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return bN(t,e)}))}function PG(t){var e=bu(t).geometry.coordinates,n=[-e[0],-e[1]];return Am().rotate(n).scale(_n)}iw.invert=ma((function(t){return t})),l(Am,"default"),y(),y(),l(ow,"mercatorRaw"),ow.invert=function(t,e){return[t,2*qo(vm(e))-wn]},y(),y(),l(Lm,"equirectangularRaw"),Lm.invert=Lm,y(),l(hN,"gnomonicRaw"),hN.invert=ma(qo),y(),y(),l(dN,"naturalEarth1Raw"),dN.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Yt(n)>je&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},y(),l(gN,"orthographicRaw"),gN.invert=ma(En),y(),l(mN,"stereographicRaw"),mN.invert=ma((function(t){return 2*qo(t)})),y(),l(yN,"transverseMercatorRaw"),yN.invert=function(t,e){return[-e,2*qo(vm(t))-wn]},l(IG,"buffer"),l(Rm,"bufferFeature"),l(vN,"coordsIsNaN"),l(_N,"projectCoords"),l(bN,"unprojectCoords"),l(PG,"defineProjection");var aw=IG;y();var SG=er(jl(),1);y();var CG=er(jl(),1);y();var OG=er(jl(),1);y(),y();var NG=er(jl(),1);y(),y(),y(),y();var zG=1e-7,qG=.22,GG=.2,wN=.005,EN=["connection.json","manifest.geojson","map.geojson","node.geojson","styles.json","mapstack.geojson"];function sw(t,e,n){let r=YG(e),[i,o]=t.features.reduce(((t,e)=>{let[i,o]=t,s=[e],{properties:a}=e,l=(a.entrances||[]).reduce(((t,e)=>(r.has(e)&&t.push(r.get(e)),t)),[]);if(l.length&&(s=UG(e,l)),n&&"LineString"===s[0].geometry.type){let t=n.get(s[0].properties.id).type;i.has(t)||i.set(t,[]),i.get(t).push(...s)}else o.push(...s);return t}),[new Map,[]]),s=1;return i.forEach((t=>{var e;let r={kind:t[0].properties.kind,id:t[0].properties.id,externalId:t[0].properties.externalId},a=((null==(e=null==n?void 0:n.get(t[0].properties.id))?void 0:e.width)||qG)/2,l=s/i.size*a*GG;if(t.length){let e=aw(vu(t.map((({geometry:t})=>t.coordinates))),a+l,{units:"meters",steps:3});e.properties={...r,...e.properties};let n=[];n="MultiPolygon"===e.geometry.type?e.geometry.coordinates.map((t=>({...cr(t),properties:r}))):[e],o=o.concat(n)}s++})),Ve(o)}function UG(t,e){return e.reduce(((t,e)=>{let n={epsilon:zG},r=t.findIndex((t=>wl(bu(e),t,n))),i=t[r];if(i){let[n,o]=XG(i,e);t.splice(r,1,n,o)}return t}),[t])}function VG(t){return null!=t&&(null!=t.polygons||null!=t.lineStrings)}function XG(t,e){let{coordinates:n}=e.geometry,{coordinates:r}=t.geometry,i=n.map((e=>Va(t,jt(e))));return r.reduce(((e,n)=>{let r=Xg(jt(n),i[0],t),o=Xg(jt(n),i[1],t),s=Mu(r)<Mu(o)?r:o;return s.properties={...t.properties,entrances:[]},e.concat([s])}),[])}function MN(t){let e=new Map;for(let n in t){let r=t[n];if(!VG(r))continue;let{altitude:i,color:o,width:s,height:a,opacity:l}=r;(r.polygons||r.lineStrings).forEach((t=>{e.set(t,{altitude:i,color:o,width:s,height:a,opacity:l,type:n})}))}return e}function YG(t){return new Map(t.features.map((t=>{let{properties:e}=t,{id:n}=e;return[n,t]})))}function IN(t){if(0===t.length)return;let e;for(let n of t)if("number"==typeof n.elevation){if(!e){e=n;continue}"number"==typeof e.elevation&&(e=Math.abs(n.elevation)===Math.abs(e.elevation)?n.elevation>e.elevation?n:e:Math.abs(n.elevation)<Math.abs(e.elevation)?n:e)}return e}function g5(t){if(null==t||"object"!=typeof t)return!1;for(let e of EN)if("Uint8Array"!==t[e][Symbol.toStringTag])return!1;return!0}function m5(t){var e;if(null==t||"object"!=typeof t)return!1;let n=["building.geojson","category.geojson","location.geojson","manifest.geojson"];for(let r of n)if("Uint8Array"!==(null==(e=null==t?void 0:t[r])?void 0:e[Symbol.toStringTag]))return!1;return!0}async function cT(t){return new Promise((async(e,n)=>{try{if(null==t||"object"!=typeof t)throw new Error("Error parsing data! Unzipping failed.");if("Uint8Array"!==t[Symbol.toStringTag])throw new Error("Unexpected file type! Unzipping failed.");let n=(await Promise.resolve().then((()=>(Nw(),Ow)))).unzipSync(t);if(!m5(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let r={"building.geojson":n["building.geojson"],"category.geojson":n["category.geojson"],"location.geojson":n["location.geojson"],"manifest.geojson":n["manifest.geojson"],space:{},obstruction:{},node:{},level:{},connection:{}},i=Object.keys(n);for(let t of i){if(0===n[t].length)continue;let e=t.split("/");if(e.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(e.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(1!==e.length){if("image"===e[0]){Ie.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}null==r[e[0]]&&(r[e[0]]={}),r[e[0]][e[1]]=n[t]}}e(r)}catch(t){n(t)}}))}async function Aw(t){return new Promise((async(e,n)=>{try{if(null==t||"object"!=typeof t)throw new Error("Error parsing data! Unzipping failed.");if("Uint8Array"!==t[Symbol.toStringTag])throw new Error("Unexpected file type! Unzipping failed.");let n=(await Promise.resolve().then((()=>(Nw(),Ow)))).unzipSync(t);if(!g5(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let r={"connection.json":n["connection.json"],"manifest.geojson":n["manifest.geojson"],"node.geojson":n["node.geojson"],"map.geojson":n["map.geojson"],"mapstack.geojson":n["mapstack.geojson"],"styles.json":n["styles.json"],space:{},obstruction:{},entrance:{}},i=Object.keys(n);for(let t of i){if(0===n[t].length)continue;let e=t.split("/");if(e.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(e.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(1!==e.length){if("image"===e[0]){Ie.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}null==r[e[0]]&&(r[e[0]]={}),r[e[0]][e[1]]=n[t]}}e(r)}catch(t){n(t)}}))}function fT(t){let[e,n,r,i]=Rn(t);return{minLat:n,minLong:e,maxLat:i,maxLong:r}}function y5(t,e,n){let r=n.createGeoreferences(),i=new Set;e.forEach((t=>{t.layer&&i.add(t.layer)}));let o=t.id||"",s=t.externalId||o||"",a=t.elevation||0,l=[...i].map((t=>({id:t,visible:!0}))),u=1/n.mapScale;return{id:o,georeference:r,name:s,shortName:s,scene:{polygons:e},elevation:a,scale:u,x_scale:u,layers:l,width:n.widthInMapUnits,height:n.heightInMapUnits}}l(sw,"processObstructions"),l(UG,"splitObstructionByAllEntrances"),l(VG,"isPolygonStyle"),l(XG,"splitObstructionByEntrance"),l(MN,"getStylesMap"),l(YG,"getEntranceMap"),y(),y(),l(IN,"findMapWithElevationClosestToZero"),l(g5,"validateStaticMVFFiles"),l(m5,"validateStaticMVFv1Files"),l(cT,"unzipMVFv1"),l(Aw,"unzipMVF"),l(fT,"getMapExtent"),l(y5,"convertMap");var Rw=class{constructor(t){D(this,"mapExtent"),D(this,"stretchRatio"),D(this,"midLat"),D(this,"midLong"),D(this,"mapUnitRatio",1e6),D(this,"latDistance"),D(this,"longDistance"),D(this,"mapScale"),D(this,"widthInMapUnits"),D(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,o=(e+r)/2,s=(n+i)/2,a=new Zr(o,i),l=new Zr(o,n),u=new Zr(e,s),c=new Zr(r,s);this.latDistance=u.distanceTo(c),this.longDistance=a.distanceTo(l);let h=this.latDistance/this.longDistance,p=(r-e)/(i-n);this.stretchRatio=h/p,this.midLat=o,this.midLong=s,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1],n=(t[0]-this.midLong)*this.mapUnitRatio,r=(this.midLat-e)*this.mapUnitRatio*this.stretchRatio;return{x:n+this.widthInMapUnits/2,y:r+this.heightInMapUnits/2}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:r}=this.mapExtent;return[[t,e],[t,r],[n,r],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};l(Rw,"CoordinateConverter");var Hm=Rw;function v5(t,e){let n=new Map,r=[];return t.features.forEach((t=>{let e=t.properties.id;e&&!n.has(e)&&n.set(e,t)})),n.forEach(((t,i)=>{let o=t.properties.map||"",s=e.get(o);if(s){let e=s.convert(t.geometry.coordinates),a=t.properties.externalId||"",l=[];t.properties.neighbors.forEach((t=>{var e;let r=null!=(e=t.weight)?e:0,i=n.get(t.id);i&&i.properties.map===o&&l.push({node:i.properties.id,map:i.properties.map,weight:r})})),r.push({id:i,map:o,externalId:a,paths:l,...e})}})),r}function _5(t,e,n){let r=[];return t.features.forEach((t=>{let i=n.convert(t.geometry.coordinates);r.push({id:t.properties.id,x:i.x,y:i.y,map:e,paths:t.properties.neighbors.map((t=>({node:t,map:e})))})})),r}l(v5,"convertNodes"),l(_5,"convertNodes_MVFv1");var uT=l(((t,e,n,r,i)=>{let o=[];return e.features.forEach(((s,a)=>{var l;if("Point"===s.geometry.type)return;let u="desk-entrance"===(null==(l=s.properties.kind)?void 0:l.toLowerCase()),c=(u?s.properties.externalId:s.properties.id)||"",h=s.properties.externalId||"",p=n.get(c)||[];if("destinationNodes"in s.properties&&s.properties.destinationNodes.forEach((e=>{p.push({map:t,id:e})})),u&&n.set(h,p),"LineString"===s.geometry.type)return;let f=r.get(s.properties.id),d=s.geometry.coordinates[0].map((t=>i.convert(t))),g=s.properties.center?i.convert(s.properties.center):void 0,y=s.geometry.coordinates.slice(1).map((t=>t.map((t=>i.convert(t))))),v=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3,m=s.properties.kind||"",_="void"===m.toLowerCase(),b=1-(a+1)/e.features.length*wN;o.push({entrances:p,map:t,id:c,externalId:h,layer:m,geometry:{visible:!_,position:{x:0,y:0,z:((null==f?void 0:f.altitude)||0)*i.mapScale/v},scale:{x:1,y:1,z:((null==f?void 0:f.height)||1)*i.mapScale/v*b}},material:{color:(null==f?void 0:f.color)||"#000000"},vertexes:d,center:g,holes:y})})),o}),"generateMappedinPolygons"),lT=l(((t,e,n)=>{let r=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let i=e.properties,o=e.geometry.coordinates[0].map((t=>n.convert(t))),s=e.geometry.coordinates.slice(1).map((t=>t.map((t=>n.convert(t))))),a=Math.max(n.widthInMapUnits,n.heightInMapUnits)/1e3,l=[];"entrances"in e.properties&&e.properties.entrances.forEach((t=>l.push({id:"n_"+t.id,map:t.level}))),r.push({entrances:null!=l?l:[],map:t,id:e.properties.id||"",externalId:e.properties.externalId||"",layer:e.properties.layer||"Polygon",geometry:{visible:!0,position:{x:0,y:0,z:((null==i?void 0:i.altitude)||0)*n.mapScale/a},scale:{x:1,y:1,z:((null==i?void 0:i.height)||1)*n.mapScale/a}},material:{color:(null==i?void 0:i.color)||"#000000"},vertexes:o,holes:s})})),r}),"generateMappedinPolygons_MVFv1");function b5(t,e,n,r,i,o){let s=uT(t,n,r,i,o),a=uT(t,e,r,i,o);return s.concat(a)}function x5(t){let e=[];return t.forEach((t=>{var n;e.push({id:t.id||"",name:t.externalId||"",type:t.type||"",weight:1e3,multiplier:1,nodes:t.nodes||[],accessible:null!=(n=t.accessible)&&n})})),e}function w5(t){let e=new Map;return t.features.forEach((t=>{var n,r,i,o,s,a,l;let u="",c=["n_".concat(t.properties.id)];t.properties.destinations.forEach((t=>{let e=t.split("-");u=e[0],c.push("n_".concat(e[1]))}));let h=null!=(r=null==(n=e.get(u))?void 0:n.nodes)?r:[],p=new Set([...h,...c]);e.set(u,{id:u,name:null!=(i=t.properties.name)?i:"",type:null!=(o=t.properties.type)?o:"",weight:null!=(s=t.properties.weight)?s:1e3,multiplier:null!=(a=t.properties.multiplier)?a:1,nodes:Array.from(p),accessible:null!=(l=t.properties.accessible)&&l})})),Array.from(e.values())}function pT(t,e){if(e)for(let n in e)e.hasOwnProperty(n)&&Object.assign(t[n],e[n]);return t}function Lw(t){let e=new TextDecoder,n=e.decode.bind(e);try{let e={"connection.json":JSON.parse(n(t["connection.json"])),"manifest.geojson":JSON.parse(n(t["manifest.geojson"])),"styles.json":JSON.parse(n(t["styles.json"])),"map.geojson":JSON.parse(n(t["map.geojson"])),"mapstack.geojson":JSON.parse(n(t["mapstack.geojson"])),"node.geojson":JSON.parse(n(t["node.geojson"])),obstruction:{},space:{},entrance:{},annotation:{}};if(null!=t.annotation){let r=Object.keys(t.annotation);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.annotation[r]=JSON.parse(n(t.annotation[i]))}}let r=Object.keys(t.space);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.space[r]=JSON.parse(n(t.space[i]))}let i=Object.keys(t.obstruction);for(let r of i){let i=r.replace(/\.json|\.geojson/g,"");e.obstruction[i]=JSON.parse(n(t.obstruction[r]))}let o=Object.keys(t.entrance);for(let r of o){let i=r.replace(/\.json|\.geojson/g,"");e.entrance[i]=JSON.parse(n(t.entrance[r]))}return e}catch(t){throw Ie.error(t),new Error("MVF parsing failed! Probably encountered a bad file.")}}function hT(t){let e=new TextDecoder,n=e.decode.bind(e);try{let e={"manifest.geojson":JSON.parse(n(t["manifest.geojson"])),"building.geojson":JSON.parse(n(t["building.geojson"])),"category.geojson":JSON.parse(n(t["category.geojson"])),"location.geojson":JSON.parse(n(t["location.geojson"])),obstruction:{},space:{},level:{},node:{},connection:{}},r=Object.keys(t.space);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.space[r]=JSON.parse(n(t.space[i]))}let i=Object.keys(t.obstruction);for(let r of i){let i=r.replace(/\.json|\.geojson/g,"");e.obstruction[i]=JSON.parse(n(t.obstruction[r]))}let o=Object.keys(t.node);for(let r of o){let i=r.replace(/\.json|\.geojson/g,"");e.node[i]=JSON.parse(n(t.node[r]))}let s=Object.keys(t.level);for(let r of s){let i=r.replace(/\.json|\.geojson/g,"");e.level[i]=JSON.parse(n(t.level[r]))}let a=Object.keys(t.connection);for(let r of a){let i=r.replace(/\.json|\.geojson/g,"");e.connection[i]=JSON.parse(n(t.connection[r]))}return e}catch(t){throw Ie.error(t),new Error("MVF parsing failed! Probably encountered a bad file.")}}function dT(t,e){var n;let r=null!=(n=e.properties.externalId)?n:"";return 0===r.length&&(r=e.properties.id),"location-".concat(t,"-").concat(r.toLowerCase().replace(" ","-"))}function gT(t,e){var n;let r=new Set;if("entrance"===t)r.add("Entrance");else if("obstruction"===t){let t=e.properties.kind;null!=t&&t.length>0&&r.add(t),e.properties.footprintComponent&&r.add("Exterior")}else if("space"===t){let t=e.properties.kind;null!=t&&t.length>0&&r.add("default"===t?"Room":t);let i=null!=(n=e.properties.tags)?n:[];if(i.length>0)for(let t of i)r.add(t)}return Array.from(r).filter((t=>t.length>0))}function mT(t){return"category-".concat(t.toLowerCase().replace(" ","-"))}function Tw(t,e,n){let r=gT(t,e);for(let t of r){let e=mT(t);null==n[e]&&(n[e]={id:e,name:t})}}function yT(t){var e,n,r;return null!=(r=null==(n=null==(e=null==t?void 0:t.properties)?void 0:e.kind)?void 0:n.startsWith("connection"))&&r}function E5(t){var e;let n=null!=(e=t.properties.externalId)?e:"";return yT(t)&&0===n.length&&(n="unnamed-connection-"+t.properties.id),n}function lh(t,e,n,r){var i;if((null==e.properties.externalId||0===e.properties.externalId.length)&&!yT(e)||"obstruction"===t&&"desks"!==(null==(i=e.properties.kind)?void 0:i.toLowerCase()))return;let o=E5(e),s=dT(t,e);if(null==r[s]){let t={id:s,type:"",name:o,nodes:[],polygons:[],categories:[]};r[s]=t}if("space"===t||"obstruction"===t){let t={map:n.id,id:e.properties.id};r[s].polygons.push(t)}if("destinationNodes"in e.properties&&e.properties.destinationNodes.forEach((t=>{let e={map:n.id,node:t};r[s].nodes.push(e)})),"node"in e.properties&&e.properties.node){let t={map:n.id,node:e.properties.node};r[s].nodes.push(t)}let a=gT(t,e);for(let t of a){let e=mT(t);r[s].categories.push(e)}}function M5(t,e=new Map){var n,r,i,o,s,a,l,u,c;let h={},p={},{space:f,"map.geojson":d,entrance:g,obstruction:y}=t;for(let t of d){let d=null!=(r=null==(n=f[t.id])?void 0:n.features)?r:[],v=null!=(o=null==(i=g[t.id])?void 0:i.features)?o:[],m=null!=(a=null==(s=y[t.id])?void 0:s.features)?a:[];for(let e of d)["Polygon","Point"].includes(e.geometry.type)&&"hallway"!==(null==(l=e.properties.kind)?void 0:l.toLowerCase())&&(Tw("space",e,p),lh("space",e,t,h));let _=new Map;for(let e of v)_.set(e.properties.id,e),e.properties.externalId&&(Tw("entrance",e,p),lh("entrance",e,t,h));let b={type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{id:"footprintComponent",externalId:"footprintComponent",node:void 0,metadata:void 0}};lh("entrance",b,t,h);for(let n of m){if(Tw("obstruction",n,p),lh("obstruction",n,t,h),n.properties.footprintComponent){let e=n.properties.entrances;for(let n of e){let e=_.get(n);e&&lh("entrance",{...e,properties:{...e.properties,externalId:b.properties.externalId}},t,h)}}if("desks"===(null==(u=n.properties.kind)?void 0:u.toLowerCase())&&n.properties.externalId.length>0){let t=null!=(c=e.get(n.properties.id))?c:[];for(let e of t){let t=dT("obstruction",n);null!=h[t]&&h[t].nodes.push({map:e.map,node:e.id})}}}}return{locations:Object.values(h),categories:Object.values(p)}}function vT(t){var e,n,r,i,o,s,a,l,u,c;let h=null!=(e=t.obstruction)?e:[],p=null!=(n=t.space)?n:[],f=null!=(r=t.entrance)?r:[],d=null!=(i=t["mapstack.geojson"])?i:[],g=null!=(o=t["map.geojson"])?o:[],y=null!=(s=t["styles.json"])?s:{},v=null!=(a=t["manifest.geojson"])?a:{},m=null!=(l=t["node.geojson"])?l:[],_=null!=(u=t["connection.json"])?u:[],b={},w=new Map,x=[],E=MN(y),I=new Map,S=new Map;g.forEach((t=>{let e=t.id;e&&!S.has(e)&&S.set(e,t)})),d.forEach((({maps:t})=>{t.forEach((t=>{if(!S.has(t))return;let e=sw(h[t],f[t],E);if(e.features.length){let n=fT(e),r=new Hm(n);w.set(t,r),b[t]=b5(t,e,p[t],I,E,r),x.push(y5(S.get(t),b[t],r))}}))})),x.sort(((t,e)=>"number"==typeof t.elevation&&"number"==typeof e.elevation?t.elevation-e.elevation:0));let N=Object.values(b).flat(),M=x5(_),C=v5(m,w),O=v.features[0],P=O.properties.name,A=O.geometry.coordinates[0],D=O.geometry.coordinates[1],T=(null==(c=IN(x))?void 0:c.id)||"",{locations:L,categories:R}=M5(t,I);return{polygons:N,venue:{name:P,latitude:D,longitude:A,defaultMap:T},maps:x,vortexes:M,nodes:C,locations:L,mapGroups:[],locationStates:[],categories:R,themes:[],imageBinaries:new Map}}function _T(t){var e,n,r,i,o,s,a;let l=null!=(e=t.obstruction)?e:{},u=null!=(n=t.space)?n:{},c=null!=(r=t.node)?r:{},h=null!=(i=t.level)?i:{},p=null!=(o=t["manifest.geojson"])?o:{},f=null!=(s=t.connection)?s:{},d={},g=new Map,y=[],v=[],m=[];Object.keys(h).forEach((t=>{let e=sw(l[t],{type:"FeatureCollection",features:[]});if(e.features.length){let n=fT(e),r=new Hm(n);g.set(t,r);let i=lT(t,u[t],r),o=lT(t,e,r);d[t]=i.concat(o),v=v.concat(_5(c[t],t,r)),y.push(I5(h[t],d[t],r))}m=m.concat(w5(f[t]))}));let _=Object.values(d).flat(),b=p.features[0],w=b.properties.name,x=b.geometry.coordinates[0],E=b.geometry.coordinates[1],I=(null==(a=y[0])?void 0:a.id)||"",S=new Map;_.forEach((t=>S.set(t.id,t)));let N=[],M=t["location.geojson"].features.map((t=>{if(t.properties.spaces){let e=t.properties.spaces.map((t=>t.id)).map((t=>S.get(t))).filter((t=>t));if(e){let t=[];e.forEach((e=>{t.push(...e.entrances.map((t=>({node:t.id,map:t.level}))))})),N=t}}return{...t.properties,nodes:N,polygons:t.properties.spaces}})),C=t["category.geojson"].features.map((t=>t.properties));return{polygons:_,venue:{name:w,latitude:E,longitude:x,defaultMap:I},maps:y,vortexes:m,nodes:v,locations:M,mapGroups:[],locationStates:[],categories:C,themes:[],imageBinaries:new Map}}function I5(t,e,n){let r=n.createGeoreferences(),i=new Set,o=t.features[0].properties;e.forEach((t=>{t.layer&&i.add(t.layer)}));let s=[...i].map((t=>({id:t,visible:!0}))),a=1/n.mapScale;return{id:o.id,georeference:r,name:o.name,shortName:o.abbreviation||o.name,scene:{polygons:e},elevation:o.elevation,scale:a,x_scale:a,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits}}l(b5,"convertPolygons"),l(x5,"convertVortexes"),l(w5,"convertVortexes_MVFv1"),l(pT,"overrideMVF"),l(Lw,"parseMVF"),l(hT,"parseMVFv1"),l(dT,"getLocationId"),l(gT,"getFeatureCategories"),l(mT,"getCategoryIdFromName"),l(Tw,"mutateCategoriesWithNewFeature"),l(yT,"isFeatureConnection"),l(E5,"getLocationLabel"),l(lh,"mutateLocationsWithNewFeature"),l(M5,"createMetaDataFromMVF"),l(vT,"convertMVFToMappedin"),l(_T,"convertMVFv1ToMappedin"),l(I5,"convertMap_MVFv1"),y();var jT,ch,oc,ac,fh,sc,uc,lc,Ds,cc,fc,pc,ph,hc,Lu,zT=er(BT()),R5=null==(jT=null==C?void 0:C.env)?void 0:jT.npm_package_version,$m=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk"],Bw=$m[0],D5=!1,Vo=class t{constructor(t){var e;oe(this,ch,void 0),oe(this,oc,void 0),oe(this,ac,void 0),oe(this,fh,void 0),oe(this,sc,void 0),oe(this,uc,void 0),oe(this,lc,void 0),oe(this,Ds,void 0),oe(this,cc,void 0),oe(this,fc,void 0),oe(this,pc,void 0),oe(this,ph,void 0),oe(this,hc,void 0),oe(this,Lu,void 0),le(this,Ds,t.clientId),le(this,cc,t.clientSecret),le(this,fc,t.accessToken),le(this,lc,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!B(this,lc)&&B(this,Ds)&&!Eg(B(this,Ds))&&(n="https://web-proxy.mappedin.com/a/"),le(this,ac,n),le(this,ac,B(this,ac)+(t.venue+"/")),le(this,hc,t.venue),le(this,oc,!1),le(this,ch,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),le(this,fh,$m.find((e=>e===t.context))||$m[0]),le(this,sc,vg()),le(this,uc,_g()),le(this,pc,new Set),le(this,ph,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=gl(this.getDirections.bind(this),2500)}static create(e){return t.instance||(t.instance=new t(e)),t.instance}track(t,e){let n={...e,g:B(this,oc)};B(this,Lu)&&(n={...n,...B(this,Lu)});let r=B(this,ac)+t+"?"+zT.default.stringify(n,{skipEmptyString:!0,skipNull:!0});if(D5&&Ie.log("Analytics.track",r),B(this,ch))return;let i={"mi-context":Bw||B(this,fh),"mi-session":B(this,uc),"mi-device":B(this,sc),"mappedin-sdk-version":R5,"mappedin-platform-version":B(this,ph)};B(this,fc)?i.Authorization="Bearer ".concat(B(this,fc)):B(this,lc)||B(this,cc)&&B(this,Ds)&&(i["x-mappedin-key"]=btoa(B(this,Ds)),i["x-mappedin-secret"]=btoa(B(this,cc))),Oi()(r,{method:"GET",mode:"cors",headers:i})}updateAnalyticsUserPosition(t){le(this,Lu,t?{...t,bluedotTimestamp:Date.now()}:void 0)}locationSelected(t){let e=t.id||t;Nr.addPendingEvent(new tf({venue:B(this,hc)})),this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;Nr.addPendingEvent(new ef({venue:B(this,hc)})),this.track("select-category",{id:e})}mapViewLoaded(t,e,n,r){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return B(this,uc)}getDeviceID(){return B(this,sc)}setGeolocationMode(t){le(this,oc,t)}trackBlueDotEvent(e){e&&Object.values(t.BLUEDOT_EVENT).includes(e)&&!B(this,pc).has(e)&&(this.track(e),B(this,pc).add(e))}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=$m.find((e=>e===t));e&&(Bw=e)}static clearContext(){Bw=void 0}static destroy(){t.instance=null}};ch=new WeakMap,oc=new WeakMap,ac=new WeakMap,fh=new WeakMap,sc=new WeakMap,uc=new WeakMap,lc=new WeakMap,Ds=new WeakMap,cc=new WeakMap,fc=new WeakMap,pc=new WeakMap,ph=new WeakMap,hc=new WeakMap,Lu=new WeakMap,l(Vo,"Analytics"),D(Vo,"instance",null),D(Vo,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var jw=Vo,hh=jw;y();var zw=class{constructor(){D(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach((function(t){"function"==typeof t&&t(e)}))}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||null==this._subscribers[t])return;let n=this._subscribers[t].indexOf(e);-1!==n&&this._subscribers[t].splice(n,1)}destroy(){this._subscribers={}}};l(zw,"PubSub");var Za,dc,Ru,gc,dh,qw,Jm,qT,Km=zw,Gw={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},Uw=class extends Km{constructor(t){super(),oe(this,dh),oe(this,Jm),D(this,"perspective"),D(this,"things"),D(this,"options"),oe(this,Za,void 0),oe(this,dc,""),D(this,"updatedAt"),D(this,"categories",[]),D(this,"locations",[]),D(this,"vortexes",[]),D(this,"maps",[]),D(this,"nodes",[]),D(this,"polygons",[]),D(this,"venue",{}),D(this,"events",[]),D(this,"mapGroups",[]),D(this,"themes",[]),D(this,"locationStates",[]),D(this,"rankings"),D(this,"currentLanguage"),oe(this,Ru,{}),D(this,"_categoriesById"),D(this,"_locationsById"),D(this,"_vortexesById"),D(this,"_mapsById"),D(this,"_nodesById"),D(this,"_polygonsById"),D(this,"_eventsById"),D(this,"_mapGroupsById"),D(this,"_locationStatesById"),D(this,"_locationRankingsById"),D(this,"_rankingsById"),D(this,"_categoriesByExternalId"),D(this,"_locationsByExternalId"),D(this,"_vortexesByExternalId"),D(this,"_mapsByExternalId"),D(this,"_nodesByExternalId"),D(this,"_polygonsByExternalId"),D(this,"_eventsByExternalId"),D(this,"_mapGroupsByExternalId"),D(this,"_locationStatesByExternalId"),D(this,"_locationRankingsByExternalId"),D(this,"_rankingsByExternalId"),oe(this,gc,void 0),D(this,"images"),D(this,"imageBinaries"),D(this,"scenes"),D(this,"analytics"),D(this,"navigator"),this.options=t,le(this,Za,ri.create(this));let e=hh.create({...t,testMode:!(null!=t&&t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(DM,"true")}})}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,"_".concat(n,"ByExternalId"),{configurable:!0,get(){let t=B(this,Za)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),B(this,Za)[n]=e,e}}),Object.defineProperty(this,"_".concat(n,"ById"),{configurable:!0,get(){let t=B(this,Za)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),B(this,Za)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n="_".concat(t,"ById"),r="_".concat(t,"ByExternalId"),i=this[n];return null!=i&&null!=i[e]||(i=this[r],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=vT(t);return this.hydrate(e)}async hydrateFromMVFv1(t){let e=_T(t);return this.hydrate(e)}async changeLanguage(t,e=!0){var n;if(this.currentLanguage.code!==t){if(null==(n=this.venue.languages)||!n.find((e=>e.code===t)))return void Ie.error("Language ".concat(t," not found in venue ").concat(this.venue.slug));if(e&&!B(this,Ru)[this.currentLanguage.code]&&(B(this,Ru)[this.currentLanguage.code]=JSON.stringify(this.toJSON())),ri.clearInstance(this),le(this,Za,ri.create(this)),this.currentLanguage=this.venue.languages.find((e=>e.code===t)),null!=B(this,Ru)[t]){let e=JSON.parse(B(this,Ru)[t]);await this.hydrate(e)}else this.options.language=this.currentLanguage.code,await this.fetch();this.publish(0,this.currentLanguage)}}async hydrate(t,e){let n;if("string"==typeof t)try{le(this,dc,t),n=JSON.parse(t)}catch(t){return void Ie.error("Unable to parse JSON",t)}else n=t,le(this,dc,JSON.stringify(n));let r=Object.keys(n);for(let t=0,e=r.length;t<e;++t){let e=r[t],i=n[e];null!=yu[e]&&"function"==typeof yu[e].hydrate&&(this[e]=yu[e].hydrate(i,this))}e&&await iS(n);let{images:i,scenes:o,imageBinaries:s}=n;this.images=i,this.scenes=o,this.imageBinaries=s,this.generateGetters(r),wr(this,dh,qw).call(this),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Eg(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];yu[r]&&e.push(yu[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return e.push(pl(this.options,"cdn-access-token",{venue:this.options.venue},!1).then((t=>le(this,gc,t.token)),(()=>Promise.resolve()))),this.generateGetters(n),Promise.all(e).then((()=>{var t;this.currentLanguage=this.currentLanguage||(null==(t=this.venue.languages)?void 0:t.find((t=>t.code===this.options.language)))||this.venue.defaultLanguage,wr(this,dh,qw).call(this),this.initNavigator()}))}initNavigator(){this.navigator=new iv({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON())),polygons:this.polygons.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in yu)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return B(this,dc)||JSON.stringify(this.toJSON())}};Za=new WeakMap,dc=new WeakMap,Ru=new WeakMap,gc=new WeakMap,dh=new WeakSet,qw=l((function(){B(this,gc)&&this.maps.forEach((t=>{var e;null!=(e=t.scene)&&e.polygons&&(t.scene.polygons+="?".concat(B(this,gc)))})),wr(this,Jm,qT).call(this)}),"#transformData"),Jm=new WeakSet,qT=l((function(){let t=this.categories.filter((t=>t.sortOrder)).map((t=>t.sortOrder));if(t.length<=0)return;let e=Math.min(...t),n=Math.max(...t);this.polygons.forEach((t=>{var r,i;let o=aS(t,this);if(o){let s=o.categories.filter((t=>t.sortOrder)).map((t=>t.sortOrder));if(s.length>0){let o=Math.min(...s);t.categoryRank=oS(o,e,n,null!=(i=null==(r=t.rank)?void 0:r.score)?i:0)}}}))}),"#applyCategoryRankToPolygons"),l(Uw,"Mappedin");var Vi=Uw;y();var GT={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId","secureContentStorage","languages","topLocations","defaultLanguage"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances","material"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery","showSmartLabelWhenImagePresent","amenity"],categories:["name","color","sortOrder","parents","icon","iconFromDefaultList"],maps:["name","subtitle","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};y(),y();var fn=l((function(){return fn=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),fn.apply(this,arguments)}),"__assign");function Wt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(Wt,"__values"),l($n,"__read");var gh,F5="ENTRIES",$T="KEYS",KT="VALUES",Kn="",Vw=function(){function t(t,e){var n=t._tree,r=Array.from(n.keys());this.set=t,this._type=e,this._path=r.length>0?[{node:n,keys:r}]:[]}return l(t,"TreeIterator"),t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=mc(this._path),e=t.node,n=t.keys;if(mc(n)===Kn)return{done:!1,value:this.result()};var r=e.get(mc(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=mc(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return mc(e)})).filter((function(t){return t!==Kn})).join("")},t.prototype.value=function(){return mc(this._path).node.get(Kn)},t.prototype.result=function(){switch(this._type){case KT:return this.value();case $T:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),mc=l((function(t){return t[t.length-1]}),"last$1"),B5=l((function(t,e,n){var r=new Map;if(void 0===e)return r;for(var i=e.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1),a=0;a<i;++a)s[a]=a;for(var l=1;l<o;++l)s[l*i]=l;return JT(t,e,n,r,s,1,i,""),r}),"fuzzySearch"),JT=l((function(t,e,n,r,i,o,s,a){var l,u,c=o*s;try{t:for(var h=Wt(t.keys()),p=h.next();!p.done;p=h.next()){var f=p.value;if(f===Kn){var d=i[c-1];d<=n&&r.set(a,[t.get(f),d])}else{for(var g=o,y=0;y<f.length;++y,++g){for(var v=f[y],m=s*g,_=m-s,b=i[m],w=Math.max(0,g-n-1),x=Math.min(s-1,g+n),E=w;E<x;++E){var I=v!==e[E],S=i[_+E]+ +I,N=i[_+E+1]+1,M=i[m+E]+1,C=i[m+E+1]=Math.min(S,N,M);C<b&&(b=C)}if(b>n)continue t}JT(t.get(f),e,n,r,i,g,s,a+f)}}}catch(t){l={error:t}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(l)throw l.error}}}),"recurse"),Xw=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return l(t,"SearchableMap"),t.prototype.atPrefix=function(e){var n,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=$n(Qm(this._tree,e.slice(this._prefix.length)),2),o=i[0],s=i[1];if(void 0===o){var a=$n(Kw(s),2),l=a[0],u=a[1];try{for(var c=Wt(l.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;if(p!==Kn&&p.startsWith(u)){var f=new Map;return f.set(p.slice(u.length),l.get(p)),new t(f,e)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}return new t(o,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,j5(this._tree,t)},t.prototype.entries=function(){return new Vw(this,F5)},t.prototype.forEach=function(t){var e,n;try{for(var r=Wt(this),i=r.next();!i.done;i=r.next()){var o=$n(i.value,2);t(o[0],o[1],this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return B5(this._tree,t,e)},t.prototype.get=function(t){var e=$w(this._tree,t);return void 0!==e?e.get(Kn):void 0},t.prototype.has=function(t){var e=$w(this._tree,t);return void 0!==e&&e.has(Kn)},t.prototype.keys=function(){return new Vw(this,$T)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,Yw(this._tree,t).set(Kn,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=Yw(this._tree,t);return n.set(Kn,e(n.get(Kn))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=Yw(this._tree,t),r=n.get(Kn);return void 0===r&&n.set(Kn,r=e()),r},t.prototype.values=function(){return new Vw(this,KT)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var o=Wt(e),s=o.next();!s.done;s=o.next()){var a=$n(s.value,2),l=a[0],u=a[1];i.set(l,u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),Qm=l((function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var o=Wt(t.keys()),s=o.next();!s.done;s=o.next()){var a=s.value;if(a!==Kn&&e.startsWith(a))return n.push([t,a]),Qm(t.get(a),e.slice(a.length),n)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return n.push([t,e]),Qm(void 0,"",n)}),"trackDown"),$w=l((function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=Wt(t.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;if(s!==Kn&&e.startsWith(s))return $w(t.get(s),e.slice(s.length))}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"lookup"),Yw=l((function(t,e){var n,r,i=e.length;t:for(var o=0;t&&o<i;){try{for(var s=(n=void 0,Wt(t.keys())),a=s.next();!a.done;a=s.next()){var l=a.value;if(l!==Kn&&e[o]===l[0]){for(var u=Math.min(i-o,l.length),c=1;c<u&&e[o+c]===l[c];)++c;var h=t.get(l);if(c===l.length)t=h;else{var p=new Map;p.set(l.slice(c),h),t.set(e.slice(o,o+c),p),t.delete(l),t=p}o+=c;continue t}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return t.set(e.slice(o),f),f}return t}),"createPath"),j5=l((function(t,e){var n=$n(Qm(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(Kn),0===r.size)ZT(i);else if(1===r.size){var o=$n(r.entries().next().value,2),s=o[0],a=o[1];QT(i,s,a)}}),"remove"),ZT=l((function(t){if(0!==t.length){var e=$n(Kw(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)ZT(t.slice(0,-1));else if(1===n.size){var i=$n(n.entries().next().value,2),o=i[0],s=i[1];o!==Kn&&QT(t.slice(0,-1),o,s)}}}),"cleanup"),QT=l((function(t,e,n){if(0!==t.length){var r=$n(Kw(t),2),i=r[0],o=r[1];i.set(o+e,n),i.delete(o)}}),"merge"),Kw=l((function(t){return t[t.length-1]}),"last"),Jw="or",z5="and",q5="and_not",Du=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=fn(fn(fn({},Hw),t),{searchOptions:fn(fn({},XT),t.searchOptions||{})}),this._index=new Xw,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return l(t,"MiniSearch"),t.prototype.add=function(t){var e,n,r,i,o=this._options,s=o.extractField,a=o.tokenize,l=o.processTerm,u=o.fields,c=o.idField,h=s(t,c);if(null==h)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(h);this.saveStoredFields(p,t);try{for(var f=Wt(u),d=f.next();!d.done;d=f.next()){var g=d.value,y=s(t,g);if(null!=y){var v=a(y.toString(),g),m=this._fieldIds[g],_=new Set(v).size;this.addFieldLength(p,m,this._documentCount-1,_);try{for(var b=(r=void 0,Wt(v)),w=b.next();!w.done;w=b.next()){var x=l(w.value,g);x&&this.addTerm(m,p,x)}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.addAll=function(t){var e,n;try{for(var r=Wt(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.add(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var r=e.chunkSize,i=void 0===r?10:r,o={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,r){var o=t.chunk,s=t.promise;return o.push(e),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(o)}))}:{chunk:o,promise:s}}),o),a=s.chunk;return s.promise.then((function(){return n.addAll(a)}))},t.prototype.remove=function(t){var e,n,r,i,o,s,a=this._options,l=a.tokenize,u=a.processTerm,c=a.extractField,h=a.fields,p=a.idField,f=c(t,p);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(p,'"'));try{for(var d=Wt(this._documentIds),g=d.next();!g.done;g=d.next()){var y=$n(g.value,2),v=y[0];if(f===y[1]){try{for(var m=(r=void 0,Wt(h)),_=m.next();!_.done;_=m.next()){var b=_.value,w=c(t,b);if(null!=w){var x=l(w.toString(),b),E=this._fieldIds[b],I=new Set(x).size;this.removeFieldLength(v,E,this._documentCount,I);try{for(var S=(o=void 0,Wt(x)),N=S.next();!N.done;N=S.next()){var M=u(N.value,b);M&&this.removeTerm(E,v,M)}}catch(t){o={error:t}}finally{try{N&&!N.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}}}}catch(t){r={error:t}}finally{try{_&&!_.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return this._storedFields.delete(v),this._documentIds.delete(v),this._fieldLength.delete(v),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},t.prototype.removeAll=function(t){var e,n;if(t)try{for(var r=Wt(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.remove(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Xw,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},t.prototype.search=function(t,e){var n,r;void 0===e&&(e={});var i=this.executeQuery(t,e),o=[];try{for(var s=Wt(i),a=s.next();!a.done;a=s.next()){var l=$n(a.value,2),u=l[0],c=l[1],h=c.score,p=c.terms,f=c.match,d=p.length,g={id:this._documentIds.get(u),score:h*d,terms:Object.keys(f),match:f};Object.assign(g,this._storedFields.get(u)),(null==e.filter||e.filter(g))&&o.push(g)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o.sort(WT),o},t.prototype.autoSuggest=function(t,e){var n,r,i,o;void 0===e&&(e={}),e=fn(fn({},Y5),e);var s=new Map;try{for(var a=Wt(this.search(t,e)),l=a.next();!l.done;l=a.next()){var u=l.value,c=u.score,h=(m=u.terms).join(" ");null!=(y=s.get(h))?(y.score+=c,y.count+=1):s.set(h,{score:c,terms:m,count:1})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var p=[];try{for(var f=Wt(s),d=f.next();!d.done;d=f.next()){var g=$n(d.value,2),y=g[0],v=g[1],m=(c=v.score,v.terms),_=v.count;p.push({suggestion:y,terms:m,score:c/_})}}catch(t){i={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}return p.sort(WT),p},Object.defineProperty(t.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),t.loadJSON=function(e,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return t.loadJS(JSON.parse(e),n)},t.getDefault=function(t){if(Hw.hasOwnProperty(t))return Ww(Hw,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},t.loadJS=function(e,n){var r,i,o,s,a=e.index,l=e.documentCount,u=e.nextId,c=e.documentIds,h=e.fieldIds,p=e.fieldLength,f=e.averageFieldLength,d=e.storedFields,g=e.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new t(n);y._documentCount=l,y._nextId=u,y._documentIds=Zm(c),y._fieldIds=h,y._fieldLength=Zm(p),y._avgFieldLength=f,y._storedFields=Zm(d),y._index=new Xw;try{for(var v=Wt(a),m=v.next();!m.done;m=v.next()){var _=$n(m.value,2),b=_[0],w=_[1],x=new Map;try{for(var E=(o=void 0,Wt(Object.keys(w))),I=E.next();!I.done;I=E.next()){var S=I.value,N=w[S];1===g&&(N=N.ds),x.set(parseInt(S,10),Zm(N))}}catch(t){o={error:t}}finally{try{I&&!I.done&&(s=E.return)&&s.call(E)}finally{if(o)throw o.error}}y._index.set(b,x)}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return y},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=fn(fn(fn({},e),t),{queries:void 0}),i=t.queries.map((function(t){return n.executeQuery(t,r)}));return this.combineResults(i,t.combineWith)}var o=this._options,s=o.tokenize,a=o.processTerm,l=o.searchOptions,u=fn(fn({tokenize:s,processTerm:a},l),e),c=u.tokenize,h=u.processTerm,p=c(t).map((function(t){return h(t)})).filter((function(t){return!!t})).map(X5(u)).map((function(t){return n.executeQuerySpec(t,u)}));return this.combineResults(p,u.combineWith)},t.prototype.executeQuerySpec=function(t,e){var n,r,i,o,s,a,l=fn(fn({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return fn(fn({},t),((n={})[e]=Ww(t,e)||1,n))}),l.boost||{}),c=l.boostDocument,h=l.weights,p=l.maxFuzzy,f=fn(fn({},XT.weights),h),d=f.fuzzy,g=f.prefix,y=this._index.get(t.term),v=this.termResults(t.term,t.term,1,y,u,c);if(t.prefix&&(s=this._index.atPrefix(t.term)),t.fuzzy){var m=!0===t.fuzzy?.2:t.fuzzy,_=m<1?Math.min(p,Math.round(t.term.length*m)):m;_&&(a=this._index.fuzzyGet(t.term,_))}if(s)try{for(var b=Wt(s),w=b.next();!w.done;w=b.next()){var x=$n(w.value,2),E=x[0],I=x[1];if(C=E.length-t.term.length){null==a||a.delete(E);var S=g*E.length/(E.length+.3*C);this.termResults(t.term,E,S,I,u,c,v)}}}catch(t){n={error:t}}finally{try{w&&!w.done&&(r=b.return)&&r.call(b)}finally{if(n)throw n.error}}if(a)try{for(var N=Wt(a.keys()),M=N.next();!M.done;M=N.next()){E=M.value;var C,O=$n(a.get(E),2),P=O[0];if(C=O[1]){S=d*E.length/(E.length+C);this.termResults(t.term,E,S,P,u,c,v)}}}catch(t){i={error:t}}finally{try{M&&!M.done&&(o=N.return)&&o.call(N)}finally{if(i)throw i.error}}return v},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=Jw),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(G5[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var o=Wt(this._index),s=o.next();!s.done;s=o.next()){var a=$n(s.value,2),l=a[0],u=a[1],c={};try{for(var h=(n=void 0,Wt(u)),p=h.next();!p.done;p=h.next()){var f=$n(p.value,2),d=f[0],g=f[1];c[d]=Object.fromEntries(g)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}i.push([l,c])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:i,serializationVersion:2}},t.prototype.termResults=function(t,e,n,r,i,o,s){var a,l,u,c,h;if(void 0===s&&(s=new Map),null==r)return s;try{for(var p=Wt(Object.keys(i)),f=p.next();!f.done;f=p.next()){var d=f.value,g=i[d],y=this._fieldIds[d],v=r.get(y);if(null!=v){var m=v.size,_=this._avgFieldLength[y];try{for(var b=(u=void 0,Wt(v.keys())),w=b.next();!w.done;w=b.next()){var x=w.value,E=o?o(this._documentIds.get(x),e):1;if(E){var I=v.get(x),S=this._fieldLength.get(x)[y],N=n*g*E*V5(I,m,this._documentCount,S,_),M=s.get(x);if(M){M.score+=N,W5(M.terms,t);var C=Ww(M.match,e);C?C.push(d):M.match[e]=[d]}else s.set(x,{score:N,terms:[t],match:(h={},h[e]=[d],h)})}}}catch(t){u={error:t}}finally{try{w&&!w.done&&(c=b.return)&&c.call(b)}finally{if(u)throw u.error}}}}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}return s},t.prototype.addTerm=function(t,e,n){var r=this._index.fetch(n,HT),i=r.get(t);if(null==i)(i=new Map).set(e,1),r.set(t,i);else{var o=i.get(e);i.set(e,(o||0)+1)}},t.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var r=this._index.fetch(n,HT),i=r.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,n):i.get(e)<=1?i.size<=1?r.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},t.prototype.warnDocumentChanged=function(t,e,n){var r,i;if(null!=console&&null!=console.warn)try{for(var o=Wt(Object.keys(this._fieldIds)),s=o.next();!s.done;s=o.next()){var a=s.value;if(this._fieldIds[a]===e)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(n,'" was not present in field "').concat(a,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},t.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},t.prototype.addFieldLength=function(t,e,n,r){var i=this._fieldLength.get(t);null==i&&this._fieldLength.set(t,i=[]),i[e]=r;var o=(this._avgFieldLength[e]||0)*n+r;this._avgFieldLength[e]=o/(n+1)},t.prototype.removeFieldLength=function(t,e,n,r){var i=this._avgFieldLength[e]*n-r;this._avgFieldLength[e]=i/(n-1)},t.prototype.saveStoredFields=function(t,e){var n,r,i=this._options,o=i.storeFields,s=i.extractField;if(null!=o&&0!==o.length){var a=this._storedFields.get(t);null==a&&this._storedFields.set(t,a={});try{for(var l=Wt(o),u=l.next();!u.done;u=l.next()){var c=u.value,h=s(e,c);void 0!==h&&(a[c]=h)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},t}(),Ww=l((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),G5=((gh={})[Jw]=function(t,e){var n,r;try{for(var i=Wt(e.keys()),o=i.next();!o.done;o=i.next()){var s=o.value,a=t.get(s);if(null==a)t.set(s,e.get(s));else{var l=e.get(s),u=l.score,c=l.terms,h=l.match;a.score=a.score+u,a.match=Object.assign(a.match,h),YT(a.terms,c)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},gh[z5]=function(t,e){var n,r,i=new Map;try{for(var o=Wt(e.keys()),s=o.next();!s.done;s=o.next()){var a=s.value,l=t.get(a);if(null!=l){var u=e.get(a),c=u.score,h=u.terms,p=u.match;YT(l.terms,h),i.set(a,{score:l.score+c,terms:l.terms,match:Object.assign(l.match,p)})}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},gh[q5]=function(t,e){var n,r;try{for(var i=Wt(e.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;t.delete(s)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},gh),UT=1.2,VT=.7,U5=.5,V5=l((function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(U5+t*(UT+1)/(t+UT*(1-VT+VT*r/i)))}),"calcBM25Score"),X5=l((function(t){return function(e,n,r){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,r):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,r):!0===t.prefix}}}),"termToQuerySpec"),Hw={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(H5)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},XT={combineWith:Jw,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Y5={prefix:function(t,e,n){return e===n.length-1}},W5=l((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),YT=l((function(t,e){var n,r;try{for(var i=Wt(e),o=i.next();!o.done;o=i.next()){var s=o.value;t.includes(s)||t.push(s)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"assignUniqueTerms"),WT=l((function(t,e){var n=t.score;return e.score-n}),"byScore"),HT=l((function(){return new Map}),"createMap"),Zm=l((function(t){var e,n,r=new Map;try{for(var i=Wt(Object.keys(t)),o=i.next();!o.done;o=i.next()){var s=o.value;r.set(parseInt(s,10),t[s])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}),"objectToNumericMap"),H5=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;y();var $5=["0","1","2","3","4","5","6","7","8","9"],K5=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],J5=["0","1","2","3","4","5","6","7","8","9"],Z5=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],vNe=[...$5,...K5,...J5,...Z5],eA=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];y();var Q5=32,Ai=!1,e8=120,Zw=0,eE=class{constructor(t){D(this,"_callback"),D(this,"_frameCount"),D(this,"_ordering"),D(this,"_supersededBy"),D(this,"name"),D(this,"_remainingFrameCount"),D(this,"_lastFrameTime"),D(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,Ai&&Ie.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};l(eE,"FrameUpdate");var ey=eE,tE=class{constructor(t){if(D(this,"_postponed"),D(this,"userdata"),D(this,"_priority"),D(this,"_group"),D(this,"name"),D(this,"_lastFrameTime"),D(this,"_callback"),D(this,"_complete"),D(this,"_scheduled"),D(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata||{},this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,Ai&&Ie.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};l(tE,"FrameTask");var Qa=tE,rE=class{constructor(t){D(this,"_postponed"),D(this,"_onComplete"),D(this,"_priority"),D(this,"userdata"),D(this,"name"),D(this,"_tasks"),D(this,"_scheduledTasks"),D(this,"_scheduled"),D(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,Ai&&Ie.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}};l(rE,"FrameTaskGroup");var ty=rE,nE=class{constructor(t){D(this,"_maxMillisecondsPerFrame"),D(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Q5,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};l(nE,"RealTimeTimer");var Qw=nE,iE=class{constructor(t){var e;D(this,"_raf"),D(this,"options"),D(this,"_timer"),D(this,"_performance"),D(this,"_scheduledUpdatesByOrdering"),D(this,"_scheduledTasksByPriority"),D(this,"_postponedTasks"),D(this,"_requestAnimationFrameHandle"),D(this,"_updatesToRunThisFrame"),D(this,"_lastFrameTime",0),D(this,"_updatesRunLastFrame"),this.options=t,this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Qw,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new yc,this._scheduledTasksByPriority=new yc,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Ai&&Ie.log("task scheduler instantiated"),null!=(e=globalThis.MappedinDebug)&&e.TEST_IOS&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new yc,this._scheduledTasksByPriority=new yc,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Ai&&Ie.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){var e;let n;this._timer.beginFrame(),this._performance&&(n=performance.now());let r=!1;Ai&&(0===Zw&&(r=!0),++Zw,Zw%=e8);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),r&&Ie.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,r&&Ie.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let n;this._performance&&(n=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-n),r&&Ie.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-n),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame(),null!=(e=this.options)&&e.onUpdateEnd&&this.options.onUpdateEnd()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;Ie.assert(void 0!==n),Object.getPrototypeOf(n)===ty.prototype&&(r=n,n=r._popTask()),Ie.assert(void 0!==n),Ie.assert(Object.getPrototypeOf(n)===Qa.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Ai&&Ie.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),Ai&&Ie.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===ty)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,Ai&&Ie.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Ai&&Ie.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===Qa.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Ai&&Ie.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===Qa.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===Qa.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Ai&&Ie.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===Qa.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===Qa.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Ai&&Ie.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Qa.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,Ai&&Ie.log("task priority changed",t.name,e)}};l(iE,"TaskScheduler");var ry=iE,oE=class{constructor(){D(this,"_map"),D(this,"_size"),D(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(Ie.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let r=t.next();if(r.done)return r;e=this._map.get(r.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return Ie.assert(t===this._size),t}};l(oE,"Multimap");var yc=oE,es=l((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),t8=/([!-/:-@])|(?:[\n\r [-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+)/u;function r8(t){return t.split(t8).filter(Boolean)}l(r8,"tokenizeAndCaptureDelimiters");var ts,yo,Fs,_a,Vr,mh,yh,_c,vh,_h,bh,xh,bc,rs,ny,iy,Bs,wh,oy,ay,sy,rA,vc="",n8=.09,i8=1,o8=.025,a8=.5,s8=5e-4,u8=5e-4,l8=.01,c8=.05,tA=1,f8=.01,p8=.2,h8={MappedinCategory:"categories",MappedinLocation:"locations"},d8={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:eA,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===C.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:n8,PRIMARY_INDEX_WEIGHT:i8,SECONDARY_INDEX_WEIGHT:o8,CATEGORY_NAME_WEIGHT:a8,LOCATION_NAME_WEIGHT:tA,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:s8,CATEGORY_LOCATION_TAGS_WEIGHT:u8,CATEGORY_LOCATION_NAME_WEIGHT:l8,PRIMARY_INDEX_TAGS_NAME_WEIGHT:c8,LOCATION_DEFAULT_RANK:tA,RATIO_OF_FUZZY_TO_EXACT:f8,RATIO_OF_PREFIX_TO_EXACT:p8}},sE=class{constructor(t,e){var n;oe(this,sy),oe(this,ts,void 0),oe(this,yo,void 0),oe(this,Fs,void 0),oe(this,_a,void 0),oe(this,Vr,void 0),oe(this,mh,new ry({performance:!0})),oe(this,yh,void 0),oe(this,_c,void 0),oe(this,vh,new Map),oe(this,_h,void 0),oe(this,bh,void 0),oe(this,xh,void 0),D(this,"buildIndices",l((()=>{var t,e;le(this,Bs,new Promise((t=>{le(this,wh,t)})));let{PRIMARY_INDEX_FUZZYNESS:n,PRIMARY_INDEX_WEIGHT:r,CATEGORY_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:o,RATIO_OF_PREFIX_TO_EXACT:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:a}=B(this,Vr).constants,l=["object","query","weight","tag","rank"],u={fields:["query","name","tag"],storeFields:l,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:n},boost:{name:r,query:r,tag:a},weights:{fuzzy:o,prefix:s},boostDocument:t=>t.includes("MappedinLocation")?r:t.includes("MappedinCategory")?i:r,tokenize:r8},c={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return null!=(n=B(this,yh))&&n.has(t.toLowerCase())?null:t.toLowerCase()}},h={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...l,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(null!=(t=B(this,Vr))&&t.jsonIndex){let{primary:t,secondary:n,extra:r}=JSON.parse(null==(e=B(this,Vr))?void 0:e.jsonIndex);le(this,yo,Du.loadJS(t,u)),le(this,Fs,Du.loadJS(n,c)),le(this,_a,Du.loadJS(r,h))}else le(this,yo,new Du(u)),le(this,Fs,new Du(c)),le(this,_a,new Du(h)),B(this,ts).locations.forEach(B(this,ny)),B(this,ts).categories.forEach(B(this,iy));B(this,mh).update(performance.now())}),"buildIndices")),oe(this,bc,0),oe(this,rs,l((t=>{Iy(this,bc)._++,B(this,mh).scheduleUpdate(new ey({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),Iy(this,bc)._--,0===B(this,bc)&&B(this,wh).call(this)}}))}),"#addTask")),oe(this,ny,l((t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=B(this,Vr).constants,a=o;null!=(e=B(this,Vr))&&e.useLocationRank&&(a=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return null!=(e=t.rank)&&e.score?null==(n=t.rank)?void 0:n.score:o})),o):o),B(this,rs).call(this,(()=>{B(this,yo).add({name:es(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:o,rank:a})})),null!=(n=B(this,Vr))&&n.searchTags&&Array.isArray(t.tags)&&t.tags.forEach((e=>{B(this,yo).add({name:"",tag:es(e),id:"MappedinLocation_"+t.id,weight:s,rank:a})})),null!=(r=B(this,Vr))&&r.searchDescriptions&&B(this,rs).call(this,(()=>B(this,Fs).add({description:es(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:a})))}),"#processLocation")),oe(this,iy,l((t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:o,CATEGORY_NAME_WEIGHT:s}=B(this,Vr).constants;B(this,rs).call(this,(()=>B(this,yo).add({name:es(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let a=t.locations.reduce(((t,e)=>t+" ".concat(vc," ")+e.name),"")+" ".concat(vc);if(null!=(e=B(this,Vr))&&e.searchDescriptionsInCategories&&t.locations.forEach((e=>{null!=e.description&&B(this,rs).call(this,(()=>B(this,_a).add({id:"MappedinCategory_"+t.id,"category.locations.description":es(e.description),ref:e.name,weight:r})))})),null!=(n=B(this,Vr))&&n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+" ".concat(vc," ")+e),""))+" ".concat(vc)}),"");B(this,rs).call(this,(()=>B(this,_a).add({"category.locations.tags":es(e),id:"MappedinCategory_"+t.id,weight:i})))}B(this,rs).call(this,(()=>B(this,_a).add({"category.locations.name":es(a),id:"MappedinCategory_"+t.id,weight:o})))}),"#processCategory")),oe(this,Bs,void 0),oe(this,wh,void 0),oe(this,oy,l((t=>{var e;let n=t.score,{object:r,id:i,weight:o,rank:s}=t,[a,l]=i.split("_"),u=r||B(this,ts).getCollectionItemById(h8[a],l);return s&&null!=(e=B(this,Vr))&&e.useLocationRank&&(n+=s),o&&(n*=o),{score:n,type:a,object:u}}),"#processSearchResult")),oe(this,ay,l(((t,e)=>{for(let n in t.match)t.match[n].forEach((r=>{let i=t.ref||t[r]||e.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let e=new RegExp("[^".concat(vc,"]* ")+n+" [^".concat(vc,"]*"),"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))}),"#addMatches")),le(this,_c,hh.create({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),le(this,Vr,{...d8,...e}),le(this,ts,t),le(this,yh,new Set(null==(n=B(this,Vr))?void 0:n.stopWords));let r=B(this,ts).venue.slug;B(this,ts).on(0,this.buildIndices),this.buildIndices(),le(this,_h,gl((t=>{B(this,_c).trackSearchSuggest({query:t}),Nr.addPendingEvent(new mf({venue:r}))}),300)),le(this,bh,gl((t=>{B(this,_c).trackSearch({query:t}),Nr.addPendingEvent(new gf({venue:r}))}),300)),le(this,xh,gl((()=>{Nr.addPendingEvent(new hf({venue:r}))}),300)),Nr.addPendingEvent(new df({search_descriptions:B(this,Vr).searchDescriptions,search_tags:B(this,Vr).searchTags,search_descriptions_in_categories:B(this,Vr).searchDescriptionsInCategories,search_tags_in_categories:B(this,Vr).searchTagsInCategories,use_location_rank:B(this,Vr).useLocationRank,venue:r}))}async suggest(t){await B(this,Bs);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:o}=B(this,Vr).constants,s=B(this,yo).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:o}});return B(this,_h).call(this,t),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await B(this,Bs);let e=wr(this,sy,rA).call(this,t);return B(this,bh).call(this,t),e}async toJSON(){return await B(this,Bs),JSON.stringify({primary:B(this,yo),secondary:B(this,Fs),extra:B(this,_a)})}async addQuery(t){let e,n,{query:r,object:i,weight:o=1}=t;await B(this,Bs),e=i instanceof za?"MappedinLocation":i instanceof hu?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=B(this,vh).get(i),n||(n="Custom_"+Ga(),B(this,vh).set(i,n))),B(this,yo).add({id:n,weight:o,object:i,query:es(r)}),B(this,xh).call(this)}};ts=new WeakMap,yo=new WeakMap,Fs=new WeakMap,_a=new WeakMap,Vr=new WeakMap,mh=new WeakMap,yh=new WeakMap,_c=new WeakMap,vh=new WeakMap,_h=new WeakMap,bh=new WeakMap,xh=new WeakMap,bc=new WeakMap,rs=new WeakMap,ny=new WeakMap,iy=new WeakMap,Bs=new WeakMap,wh=new WeakMap,oy=new WeakMap,ay=new WeakMap,sy=new WeakSet,rA=l((function(t){let e=[],n=es(t);e=[...B(this,yo).search(n),...B(this,Fs).search(n),...B(this,_a).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=B(this,oy).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},B(this,ay).call(this,t,r[t.id])}return Object.keys(r).map((t=>({...r[t],matches:r[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))}),"#doSearch"),l(sE,"OfflineSearch");var aE=sE;y();var nA=(t=>(t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY",t))(nA||{}),uE=globalThis.fetch;function Oi(){if(null==uE)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return uE}function XNe(t){uE=t}l(Oi,"isomorphicFetch"),l(XNe,"setFetchFn");var iA,g8=null==(iA=null==C?void 0:C.env)?void 0:iA.npm_package_version;globalThis.btoa||(globalThis.btoa=oA.encode);var m8=["ar"];function js(t){let e={...Gw,things:GT,...t};return e.headers={...e.headers,"mappedin-sdk-version":g8},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e}function aA(t){return t.endsWith("/")?t:"".concat(t,"/")}async function JNe(t){let e={emitAnalyticsEvents:!0,version:"2.0.0",...t},n=js({...e}),r=new Vi(n),i=await b8(n);if("1.0.0"===n.version){let t=hT(await cT(i));return r.hydrateFromMVFv1(t),r}let o=pT(Lw(await Aw(i)),n.override);return"function"==typeof e.onMVFParsed&&e.onMVFParsed(o),await r.hydrateFromMVF(o),Nr.addPendingEvent(new nf({venue:n.venue})),r}async function ZNe(t){let e={emitAnalyticsEvents:!0,clientId:t.key,clientSecret:t.secret,venue:t.mapId,...t},n=js({...e}),r=new Vi(n);try{if(!n.key)throw new Error("key is required.");if(!n.secret)throw new Error("secret is required.");if(!n.mapId)throw new Error("mapId is required.");let{access_token:i}=await x8(t),o=await E8(n,i),s=Lw(await Aw(o));"function"==typeof e.onMVFParsed&&e.onMVFParsed(s),r.hydrateFromMVF(s)}catch(t){Ie.error("Failed to get Maker map data.",t)}return r}async function y8(t){let e={emitAnalyticsEvents:!0,secure:!0,...t},n=js({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/".concat(n.useDraftData?"draft/":""),i=new Vi({...n,baseUrl:n.baseUrl+r});return await i.fetch(),e.emitAnalyticsEvents,Nr.addPendingEvent(new rf({venue:n.venue})),i}async function QNe(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,secure:!0,...t}}),n="public/1/".concat(e.useDraftData?"draft/":""),r=new Vi({...e,baseUrl:e.baseUrl+n}),i=await du.fetch(r);return{hasSecureAssets:i.secureContentStorage,languages:i.languages}}function eTe(t){y8=t}l(js,"parseOptions"),l(aA,"normalizeUrl"),l(JNe,"getVenueMVF"),l(ZNe,"getVenueMaker"),l(y8,"getVenue"),l(QNe,"getVenueMetadata"),l(eTe,"__setGetVenueMock");var lE={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function tTe(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),{url:n,updated_at:r}=await v8(t),i=await Oi()(n,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error("Unrecognized format ".concat(s));let a=new Vi(e);return await a.hydrate(o,e.shouldPopulateBundledImagesAsBlobs),a.updatedAt=r,a}async function v8(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),{version:n,venue:r}=t,i="".concat(t.bundleBaseUri||e.baseUrl+"exports/legacy".concat(null!=e.language&&m8.includes(e.language)?"-"+e.language:"","/1/bundle"),"?venue=").concat(r,"&version=1.0.0");return e.language=void 0,await Mg(e,i)}async function rTe(t,{url:e,updated_at:n}){let r=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),i=await Oi()(e,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error("Unrecognized format".concat(s));let a=new Vi(r);return await a.hydrate(o,r.shouldPopulateBundledImagesAsBlobs),a.updatedAt=n,a}async function _8(t){var e;let n=js({baseUrl:"https://api-gateway.mappedin.com/",...Gw,...t}),r="".concat(n.bundleBaseUri||n.baseUrl+"exports/mvf/1/bundle","?venue=").concat(n.venue,"&version=").concat(null!=(e=n.version)?e:"2.0.0");return n.headers["Content-Type"]="application/zip",await Mg(n,r)}async function b8(t){return new Promise((async(e,n)=>{try{let{url:n}=await _8(t),r=await Oi()(n).then((t=>t.arrayBuffer()));e(new Uint8Array(r))}catch(t){n(t)}}))}async function x8(t){let e="".concat(t.authBaseUri?aA(t.authBaseUri):"https://auth-maker.mappedin.com/","api-key/token"),n=await Oi()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.key,secret:t.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}async function w8(t,e){let n="".concat(t.bundleBaseUri?aA(t.bundleBaseUri):"https://app.mappedin.com/","api/venue/").concat(t.mapId,"/mvf"),r=await Oi()(n,{headers:{Authorization:"Bearer ".concat(e)}});if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText));return r.json()}async function E8(t,e){return new Promise((async(n,r)=>{try{let{url:r}=await w8(t,e),i=await Oi()(r).then((t=>t.arrayBuffer()));n(new Uint8Array(i))}catch(t){r(t)}}))}async function nTe(t,e=!0){let n=new Vi({venue:""});return await n.hydrate(t,e),n}async function iTe(t){let e=new Vi({venue:""});return await e.hydrateFromMVF(t),e}l(tTe,"getVenueBundle"),l(v8,"getVenueBundleURL"),l(rTe,"downloadBundle"),l(_8,"getVenueMVFURL"),l(b8,"downloadVenueBundleMVF"),l(x8,"getMakerAccessToken"),l(w8,"getMakerBundleURL"),l(E8,"downloadMVF"),l(nTe,"hydrateVenue"),l(iTe,"hydrateVenueMVF");export{hh as CustomerAnalytics,Ig as GET_VENUE_EVENT,nA as MAP_RENDER_MODE,Vi as Mappedin,hu as MappedinCategory,Lf as MappedinCollectionType,gu as MappedinCoordinate,uo as MappedinDestinationSet,Qs as MappedinDirections,rp as MappedinEvent,za as MappedinLocation,ap as MappedinLocationState,lp as MappedinMap,mp as MappedinMapGroup,Qo as MappedinNavigatable,Tf as MappedinNode,fu as MappedinPolygon,Qf as MappedinRankings,du as MappedinVenue,Vf as MappedinVortex,aE as OfflineSearch,eTe as __setGetVenueMock,GT as defaultThings,rTe as downloadBundle,E8 as downloadMVF,b8 as downloadVenueBundleMVF,x8 as getMakerAccessToken,w8 as getMakerBundleURL,y8 as getVenue,tTe as getVenueBundle,v8 as getVenueBundleURL,JNe as getVenueMVF,_8 as getVenueMVFURL,ZNe as getVenueMaker,QNe as getVenueMetadata,nTe as hydrateVenue,iTe as hydrateVenueMVF,Oi as isomorphicFetch,js as parseOptions,XNe as setFetchFn};
|
|
1
|
+
var C,yA=Object.create,Fc=Object.defineProperty,vA=Object.getOwnPropertyDescriptor,_A=Object.getOwnPropertyNames,bA=Object.getPrototypeOf,xA=Object.prototype.hasOwnProperty,wA=(t,e,n)=>e in t?Fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,l=(t,e)=>Fc(t,"name",{value:e,configurable:!0}),AE=(t,e)=>()=>(t&&(e=t(t=0)),e),fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),EA=(t,e)=>{for(var n in e)Fc(t,n,{get:e[n],enumerable:!0})},MA=(t,e,n,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of _A(e))!xA.call(t,i)&&i!==n&&Fc(t,i,{get:()=>e[i],enumerable:!(r=vA(e,i))||r.enumerable});return t},er=(t,e,n)=>(n=null!=t?yA(bA(t)):{},MA(!e&&t&&t.__esModule?n:Fc(n,"default",{value:t,enumerable:!0}),t)),D=(t,e,n)=>(wA(t,"symbol"!=typeof e?e+"":e,n),n),My=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},B=(t,e,n)=>(My(t,e,"read from private field"),n?n.call(t):e.get(t)),oe=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},le=(t,e,n,r)=>(My(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Iy=(t,e,n,r)=>({set _(r){le(t,e,r,n)},get _(){return B(t,e,r)}}),wr=(t,e,n)=>(My(t,e,"access private method"),n),y=AE((()=>{C={env:{NODE_ENV:"production",npm_package_version:"5.29.4"}}})),LE=fe(((t,e)=>{y(),function(n){var r="object"==typeof t&&t,i="object"==typeof e&&e&&e.exports==r&&e,o="object"==typeof global&&global;(o.global===o||o.window===o)&&(n=o);var s=l((function(t){this.message=t}),"InvalidCharacterError");s.prototype=new Error,s.prototype.name="InvalidCharacterError";var a=l((function(t){throw new s(t)}),"error"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=/[\t\n\f\r ]/g,h=l((function(t){var e=(t=String(t).replace(c,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,o="",s=-1;++s<e;)r=u.indexOf(t.charAt(s)),n=i%4?64*n+r:r,i++%4&&(o+=String.fromCharCode(255&n>>(-2*i&6)));return o}),"decode"),p={encode:l((function(t){t=String(t),/[^\0-\xFF]/.test(t)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,r,i,o=t.length%3,s="",l=-1,c=t.length-o;++l<c;)e=t.charCodeAt(l)<<16,n=t.charCodeAt(++l)<<8,r=t.charCodeAt(++l),s+=u.charAt((i=e+n+r)>>18&63)+u.charAt(i>>12&63)+u.charAt(i>>6&63)+u.charAt(63&i);return 2==o?(e=t.charCodeAt(l)<<8,n=t.charCodeAt(++l),s+=u.charAt((i=e+n)>>10)+u.charAt(i>>4&63)+u.charAt(i<<2&63)+"="):1==o&&(i=t.charCodeAt(l),s+=u.charAt(i>>2)+u.charAt(i<<4&63)+"=="),s}),"encode"),decode:h,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return p}));else if(r&&!r.nodeType)if(i)i.exports=p;else for(var f in p)p.hasOwnProperty(f)&&(r[f]=p[f]);else n.base64=p}(t)})),Vn=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),jc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t,e){return e.reduce((function(e,n){if(typeof t>"u"||null===t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&typeof n<"u"&&typeof e>"u"?(e=n,n):e}),void 0)}),"getCoordinateKey");t.default=e})),zc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)}),"isDecimal");t.default=e})),qc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){return e.sexagesimalPattern.test(t.toString().trim())}),"isSexagesimal");t.default=n})),Gc=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(typeof n>"u"||null===n)throw new Error("Given value is not in sexagesimal format");var r=Number(n[2])/60||0,i=Number(n[4])/3600||0,o=parseFloat(n[1])+r+i;return["S","W"].includes(n[7])?-o:o}),"sexagesimalToDecimal");t.default=n})),jh=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=r(jc());function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}l(r,"_interopRequireDefault"),l(i,"ownKeys"),l(o,"_objectSpread"),l(s,"_defineProperty");var a=l((function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:e.longitudeKeys,latitude:e.latitudeKeys,altitude:e.altitudeKeys},i=(0,n.default)(t,r.longitude),s=(0,n.default)(t,r.latitude),a=(0,n.default)(t,r.altitude);return o({latitude:s,longitude:i},a?{altitude:a}:{})}),"getCoordinateKeys");t.default=a})),ky=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(zc()),n=o(qc()),r=o(Gc()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function t(o){return(0,e.default)(o)?!(parseFloat(o)>i.MAXLAT||o<i.MINLAT):!!(0,n.default)(o)&&t((0,r.default)(o))}),"isValidLatitude");t.default=s})),Ny=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(zc()),n=o(qc()),r=o(Gc()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function t(o){return(0,e.default)(o)?!(parseFloat(o)>i.MAXLON||o<i.MINLON):!!(0,n.default)(o)&&t((0,r.default)(o))}),"isValidLongitude");t.default=s})),Ay=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(jh()),n=i(ky()),r=i(Ny());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t){var i=(0,e.default)(t),o=i.latitude,s=i.longitude;if(Array.isArray(t)&&t.length>=2)return(0,r.default)(t[0])&&(0,n.default)(t[1]);if(typeof o>"u"||typeof s>"u")return!1;var a=t[s],l=t[o];return!(typeof l>"u"||typeof a>"u"||!1===(0,n.default)(l)||!1===(0,r.default)(a))}),"isValidCoordinate");t.default=o})),Vh=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(zc()),n=s(qc()),r=s(Gc()),i=s(Ay()),o=s(jh());function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}l(s,"_interopRequireDefault"),l(a,"ownKeys"),l(u,"_objectSpread"),l(c,"_defineProperty");var h=l((function t(s){if((0,e.default)(s))return Number(s);if((0,n.default)(s))return(0,r.default)(s);if((0,i.default)(s)){var a=(0,o.default)(s);return Array.isArray(s)?s.map((function(e,n){return[0,1].includes(n)?t(e):e})):u(u(u({},s),a.latitude&&c({},a.latitude,t(s[a.latitude]))),a.longitude&&c({},a.longitude,t(s[a.longitude])))}return Array.isArray(s)?s.map((function(e){return(0,i.default)(e)?t(e):e})):s}),"toDecimal");t.default=h})),oo=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=i(jc()),r=i(Vh());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t,i){var o=(0,n.default)(t,e.latitudeKeys);if(!(typeof o>"u"||null===o)){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLatitude");t.default=o})),ao=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=i(jc()),r=i(Vh());function i(t){return t&&t.__esModule?t:{default:t}}l(i,"_interopRequireDefault");var o=l((function(t,i){var o=(0,n.default)(t,e.longitudeKeys);if(!(typeof o>"u"||null===o)){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLongitude");t.default=o})),Zo=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t*Math.PI/180}),"toRad");t.default=e})),Js=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return 180*t/Math.PI}),"toDeg");t.default=e})),XE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(Js()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s,a){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),c=(0,n.default)(t),h=s/l,p=(0,r.default)(a),f=(0,r.default)(u),d=(0,r.default)(c),g=Math.asin(Math.sin(f)*Math.cos(h)+Math.cos(f)*Math.sin(h)*Math.cos(p)),y=d+Math.atan2(Math.sin(p)*Math.sin(h)*Math.cos(f),Math.cos(h)-Math.sin(f)*Math.sin(g)),v=(0,i.default)(y);return(v<o.MINLON||v>o.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,i.default)(y)),{latitude:(0,i.default)(g),longitude:v}}),"computeDestinationPoint");t.default=a})),YE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.areaConversion[n];if(r)return t*r;throw new Error("Invalid unit used for area conversion.")}),"convertArea");t.default=n})),WE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=e.distanceConversion[n];if(r)return t*r;throw new Error("Invalid unit used for distance conversion.")}),"convertDistance");t.default=n})),HE=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Vn(),n=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}}),"convertSpeed");t.default=n})),JE=fe((t=>{"use strict";function e(t,e){return s(t)||o(t,e)||r(t,e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&null!=a.return&&a.return()}finally{if(i)throw o}}return n}}function s(t){if(Array.isArray(t))return t}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l(e,"_slicedToArray"),l(n,"_nonIterableRest"),l(r,"_unsupportedIterableToArray"),l(i,"_arrayLikeToArray"),l(o,"_iterableToArrayLimit"),l(s,"_arrayWithHoles");var a=l((function(t){var e=Math.pow(10,12);return Math.round(t*e)/e}),"imprecise"),u=l((function(t){var n=e(t.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*+("0."+(i||0))),l=Math.floor(s),u=a(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'}),"decimal2sexagesimal");t.default=u})),By=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t>1?1:t<-1?-1:t}),"robustAcos");t.default=e})),gs=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(By()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;a=typeof a<"u"&&!isNaN(a)?a:1;var l=(0,e.default)(t),u=(0,n.default)(t),c=(0,e.default)(s),h=(0,n.default)(s),p=Math.acos((0,i.default)(Math.sin((0,r.default)(c))*Math.sin((0,r.default)(l))+Math.cos((0,r.default)(c))*Math.cos((0,r.default)(l))*Math.cos((0,r.default)(u)-(0,r.default)(h))))*o.earthRadius;return Math.round(p/a)*a}),"getDistance");t.default=a})),jy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default;return r="function"==typeof r?r:e.default,n.slice().sort((function(e,n){return r(t,e)-r(t,n)}))}),"orderByDistance");t.default=r})),tM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(jy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){return(0,e.default)(t,n)[0]}),"findNearest");t.default=r})),iM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zo()),n=o(oo()),r=o(ao()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t){var o=0;if(t.length>2){for(var s,a,l,u=0;u<t.length;u++){u===t.length-2?(s=t.length-2,a=t.length-1,l=0):u===t.length-1?(s=t.length-1,a=0,l=1):(s=u,a=u+1,l=u+2);var c=(0,r.default)(t[s]),h=(0,n.default)(t[a]),p=(0,r.default)(t[l]);o+=((0,e.default)(p)-(0,e.default)(c))*Math.sin((0,e.default)(h))}o=o*i.earthRadius*i.earthRadius/2}return Math.abs(o)}),"getAreaOfPolygon");t.default=s})),Gy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(oo()),n=r(ao());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,r){var i=(0,e.default)(r),o=(0,n.default)(r);return{maxLat:Math.max(i,t.maxLat),minLat:Math.min(i,t.minLat),maxLng:Math.max(o,t.maxLng),minLng:Math.min(o,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}),"getBounds");t.default=i})),aM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(oo()),n=s(ao()),r=s(Zo()),i=s(Js()),o=Vn();function s(t){return t&&t.__esModule?t:{default:t}}l(s,"_interopRequireDefault");var a=l((function(t,s){var a,l,u=(0,e.default)(t),c=(0,n.default)(t),h=(0,r.default)(u),p=(0,r.default)(c),f=s/o.earthRadius,d=h-f,g=h+f,y=(0,r.default)(o.MAXLAT),v=(0,r.default)(o.MINLAT),m=(0,r.default)(o.MAXLON),_=(0,r.default)(o.MINLON);if(d>v&&g<y){var b=Math.asin(Math.sin(f)/Math.cos(h));(a=p-b)<_&&(a+=2*Math.PI),(l=p+b)>m&&(l-=2*Math.PI)}else d=Math.max(d,v),g=Math.min(g,y),a=_,l=m;return[{latitude:(0,i.default)(d),longitude:(0,i.default)(a)},{latitude:(0,i.default)(g),longitude:(0,i.default)(l)}]}),"getBoundsOfDistance");t.default=a})),lM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var o=t.length,s=t.reduce((function(t,i){var o=(0,r.default)((0,e.default)(i)),s=(0,r.default)((0,n.default)(i));return{X:t.X+Math.cos(o)*Math.cos(s),Y:t.Y+Math.cos(o)*Math.sin(s),Z:t.Z+Math.sin(o)}}),{X:0,Y:0,Z:0}),a=s.X/o,l=s.Y/o,u=s.Z/o;return{longitude:(0,i.default)(Math.atan2(l,a)),latitude:(0,i.default)(Math.atan2(u,Math.sqrt(a*a+l*l)))}}),"getCenter");t.default=s})),cM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Gy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t){var n=(0,e.default)(t),r=n.minLat+(n.maxLat-n.minLat)/2,i=n.minLng+(n.maxLng-n.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(i.toFixed(6))}}),"getCenterOfBounds");t.default=r})),Uy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=(0,r.default)((0,n.default)(o))-(0,r.default)((0,n.default)(t)),a=Math.log(Math.tan((0,r.default)((0,e.default)(o))/2+Math.PI/4)/Math.tan((0,r.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(s)>Math.PI&&(s=s>0?-1*(2*Math.PI-s):2*Math.PI+s),((0,i.default)(Math.atan2(s,a))+360)%360}),"getRhumbLineBearing");t.default=s})),dM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Uy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,i="function"==typeof r?r(t,n):(0,e.default)(t,n);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}),"getCompassDirection");t.default=r})),Xy=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(gs()),n=r(By());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t,r,i){var o=(0,e.default)(r,t),s=(0,e.default)(t,i),a=(0,e.default)(r,i),l=Math.acos((0,n.default)((o*o+a*a-s*s)/(2*o*a))),u=Math.acos((0,n.default)((s*s+a*a-o*o)/(2*s*a)));return l>Math.PI/2?o:u>Math.PI/2?s:Math.sin(l)*o}),"getDistanceFromLine");t.default=i})),_M=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=o(Js());function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=(0,e.default)(o),a=(0,n.default)(o),l=(0,e.default)(t),u=(0,n.default)(t);return((0,i.default)(Math.atan2(Math.sin((0,r.default)(a)-(0,r.default)(u))*Math.cos((0,r.default)(s)),Math.cos((0,r.default)(l))*Math.sin((0,r.default)(s))-Math.sin((0,r.default)(l))*Math.cos((0,r.default)(s))*Math.cos((0,r.default)(a)-(0,r.default)(u))))+360)%360}),"getGreatCircleBearing");t.default=s})),bM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?l((function(t){return typeof t}),"_typeof"):l((function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}),"_typeof"))(t)}l(n,"_interopRequireDefault"),l(r,"_typeof");var i=l((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default;return t.reduce((function(t,e){return"object"===r(t)&&null!==t.last&&(t.distance+=n(e,t.last)),t.last=e,t}),{last:null,distance:0}).distance}),"getPathLength");t.default=i})),MM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(oo()),n=o(ao()),r=o(Zo()),i=Vn();function o(t){return t&&t.__esModule?t:{default:t}}l(o,"_interopRequireDefault");var s=l((function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=typeof s<"u"&&!isNaN(s)?s:1;var a,l,u,c,h,p,f,d=(0,e.default)(t),g=(0,n.default)(t),y=(0,e.default)(o),v=(0,n.default)(o),m=6356752.314245,_=1/298.257223563,b=(0,r.default)(v-g),w=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(d)))),x=Math.atan((1-_)*Math.tan((0,r.default)(parseFloat(y)))),E=Math.sin(w),I=Math.cos(w),S=Math.sin(x),N=Math.cos(x),M=b,C=100;do{var O=Math.sin(M),P=Math.cos(M);if(0===(p=Math.sqrt(N*O*(N*O)+(I*S-E*N*P)*(I*S-E*N*P))))return 0;a=E*S+I*N*P,l=Math.atan2(p,a),h=a-2*E*S/(c=1-(u=I*N*O/p)*u),isNaN(h)&&(h=0);var A=_/16*c*(4+_*(4-3*c));f=M,M=b+(1-A)*_*u*(l+A*p*(h+A*a*(2*h*h-1)))}while(Math.abs(M-f)>1e-12&&--C>0);if(0===C)return NaN;var D=c*(i.earthRadius*i.earthRadius-m*m)/(m*m),T=1+D/16384*(4096+D*(D*(320-175*D)-768)),L=D/1024*(256+D*(D*(74-47*D)-128)),R=L*p*(h+L/4*(a*(2*h*h-1)-L/6*h*(4*p*p-3)*(4*h*h-3))),F=m*T*(l-R);return Math.round(F/s)*s}),"getDistance");t.default=s})),IM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0}),"getRoughCompassDirection");t.default=e})),PM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,i=r(t,n),o=Number(n.time)-Number(t.time),s=i/o*1e3;return s}),"getSpeed");t.default=r})),SM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r){return(0,e.default)(n,t)+(0,e.default)(t,r)===(0,e.default)(n,r)}),"isPointInLine");t.default=r})),kM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(oo()),n=r(ao());function r(t){return t&&t.__esModule?t:{default:t}}l(r,"_interopRequireDefault");var i=l((function(t,r){for(var i=!1,o=r.length,s=-1,a=o-1;++s<o;a=s)((0,n.default)(r[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[a])||(0,n.default)(r[a])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(r[s]))&&(0,e.default)(t)<((0,e.default)(r[a])-(0,e.default)(r[s]))*((0,n.default)(t)-(0,n.default)(r[s]))/((0,n.default)(r[a])-(0,n.default)(r[s]))+(0,e.default)(r[s])&&(i=!i);return i}),"isPointInPolygon");t.default=i})),OM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Xy());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r,i){return(0,e.default)(t,n,r)<i}),"isPointNearLine");t.default=r})),NM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(gs());function n(t){return t&&t.__esModule?t:{default:t}}l(n,"_interopRequireDefault");var r=l((function(t,n,r){return(0,e.default)(t,n)<r}),"isPointWithinRadius");t.default=r})),AM=fe((t=>{"use strict";function e(t,e){return s(t)||o(t,e)||r(t,e)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&null!=a.return&&a.return()}finally{if(i)throw o}}return n}}function s(t){if(Array.isArray(t))return t}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,l(e,"_slicedToArray"),l(n,"_nonIterableRest"),l(r,"_unsupportedIterableToArray"),l(i,"_arrayLikeToArray"),l(o,"_iterableToArrayLimit"),l(s,"_arrayWithHoles");var a=l((function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),r=n[0],i=n[1];return{longitude:parseFloat(r),latitude:parseFloat(i)}}))}),"wktToPolygon");t.default=a})),RM=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:l((function(){return n.default}),"get")}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:l((function(){return r.default}),"get")}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:l((function(){return i.default}),"get")}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:l((function(){return o.default}),"get")}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:l((function(){return s.default}),"get")}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:l((function(){return a.default}),"get")}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:l((function(){return u.default}),"get")}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:l((function(){return c.default}),"get")}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:l((function(){return h.default}),"get")}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:l((function(){return p.default}),"get")}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:l((function(){return f.default}),"get")}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:l((function(){return d.default}),"get")}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:l((function(){return g.default}),"get")}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:l((function(){return v.default}),"get")}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:l((function(){return m.default}),"get")}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:l((function(){return _.default}),"get")}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:l((function(){return b.default}),"get")}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:l((function(){return w.default}),"get")}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:l((function(){return x.default}),"get")}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:l((function(){return E.default}),"get")}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:l((function(){return I.default}),"get")}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:l((function(){return S.default}),"get")}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:l((function(){return N.default}),"get")}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:l((function(){return M.default}),"get")}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:l((function(){return C.default}),"get")}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:l((function(){return O.default}),"get")}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:l((function(){return P.default}),"get")}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:l((function(){return A.default}),"get")}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:l((function(){return D.default}),"get")}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:l((function(){return T.default}),"get")}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:l((function(){return L.default}),"get")}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:l((function(){return R.default}),"get")}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:l((function(){return F.default}),"get")}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:l((function(){return k.default}),"get")}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:l((function(){return B.default}),"get")}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:l((function(){return j.default}),"get")}),Object.defineProperty(t,"toRad",{enumerable:!0,get:l((function(){return G.default}),"get")}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:l((function(){return z.default}),"get")}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:l((function(){return U.default}),"get")});var n=V(XE()),r=V(YE()),i=V(WE()),o=V(HE()),s=V(JE()),a=V(tM()),u=V(iM()),c=V(Gy()),h=V(aM()),p=V(lM()),f=V(cM()),d=V(dM()),g=V(jc()),v=V(jh()),m=V(gs()),_=V(Xy()),b=V(_M()),w=V(oo()),x=V(ao()),E=V(bM()),I=V(MM()),S=V(Uy()),N=V(IM()),M=V(PM()),C=V(zc()),O=V(SM()),P=V(kM()),A=V(OM()),D=V(NM()),T=V(qc()),L=V(Ay()),R=V(ky()),F=V(Ny()),k=V(jy()),B=V(Gc()),j=V(Vh()),G=V(Zo()),z=V(Js()),U=V(AM()),q=Vn();function V(t){return t&&t.__esModule?t:{default:t}}Object.keys(q).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:l((function(){return q[n]}),"get")})})),l(V,"_interopRequireDefault")})),Ov=fe(((t,e)=>{y(),function(n,r){"use strict";var i="function",o="undefined",s="object",a="string",u="model",c="name",h="type",p="vendor",f="version",d="architecture",g="console",y="mobile",v="tablet",m="smarttv",_="wearable",b="embedded",w="Amazon",x="Apple",E="ASUS",I="BlackBerry",S="Browser",N="Chrome",M="Firefox",C="Google",O="Huawei",P="LG",A="Microsoft",D="Motorola",T="Opera",L="Samsung",R="Sony",F="Xiaomi",k="Zebra",B="Facebook",j=l((function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}),"extend"),G=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),z=l((function(t,e){return typeof t===a&&-1!==U(e).indexOf(U(t))}),"has"),U=l((function(t){return t.toLowerCase()}),"lowerize"),q=l((function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:r}),"majorize"),V=l((function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===o?t:t.substring(0,275)}),"trim"),Y=l((function(t,e){for(var n,o,a,l,u,c,h=0;h<e.length&&!u;){var p=e[h],f=e[h+1];for(n=o=0;n<p.length&&!u;)if(u=p[n++].exec(t))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;h+=2}}),"rgxMapper"),X=l((function(t,e){for(var n in e)if(typeof e[n]===s&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(z(e[n][i],t))return"?"===n?r:n}else if(z(e[n],t))return"?"===n?r:n;return t}),"strMapper"),W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+S]],[/\bqbcore\/([\w\.]+)/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[c,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[c,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,B],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,N+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,N+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,U]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",U]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,U]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,L],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,L],[h,y]],[/((ipod|iphone)\d+,\d+)/i],[u,[p,x],[h,y]],[/(ipad\d+,\d+)/i],[u,[p,x],[h,v]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[p,x],[h,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,x],[h,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,O],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,O],[h,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,F],[h,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,F],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[h,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[h,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[h,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,D],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,D],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,P],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,P],[h,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[h,y]],[/(pixel c)\b/i],[u,[p,C],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,C],[h,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,R],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,R],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,w],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,w],[h,y]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[h,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[h,y]],[/(nexus 9)/i],[u,[p,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[h,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[h,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,"Sharp"],[h,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[h,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[h,v]],[/(surface duo)/i],[u,[p,A],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[h,y]],[/(u304aa)/i],[u,[p,"AT&T"],[h,y]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[h,y]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[h,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[h,y]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[h,y]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[h,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[h,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[h,y]],[/\b(ph-1) /i],[u,[p,"Essential"],[h,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[p,u,[h,y]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,A],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,k],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,k],[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[h,g]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[p,R],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,A],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,L],[h,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,P],[h,m]],[/(apple) ?tv/i],[p,[u,x+" TV"],[h,m]],[/crkey/i],[[u,N+"cast"],[p,C],[h,m]],[/droid.+aft(\w)( bui|\))/i],[u,[p,w],[h,m]],[/\(dtv[\);].+(aquos)/i],[u,[p,"Sharp"],[h,m]],[/(bravia[\w- ]+) bui/i],[u,[p,R],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,V],[u,V],[h,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,m]],[/((pebble))app/i],[p,u,[h,_]],[/droid.+; (glass) \d/i],[u,[p,C],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,k],[h,_]],[/(quest( 2)?)/i],[u,[p,B],[h,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[h,y]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,X,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,X,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,N+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},H=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof H))return new H(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?j(J,e):J;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.browser),t.major=q(t.version),t},this.getCPU=function(){var t={};return t[d]=r,Y.call(t,i,l.cpu),t},this.getDevice=function(){var t={};return t[p]=r,t[u]=r,t[h]=r,Y.call(t,i,l.device),t},this.getEngine=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.engine),t},this.getOS=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=typeof t===a&&t.length>275?V(t,275):t,this},this.setUA(i),this}),"UAParser");H.VERSION="0.7.31",H.BROWSER=G([c,f,"major"]),H.CPU=G([d]),H.DEVICE=G([u,p,h,g,y,m,v,_,b]),H.ENGINE=H.OS=G([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=H),t.UAParser=H):typeof define===i&&define.amd?define((function(){return H})):typeof n!==o&&(n.UAParser=H);var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var K=new H;Z.ua=K.getResult(),Z.ua.get=function(){return K.getUA()},Z.ua.set=function(t){K.setUA(t);var e=K.getResult();for(var n in e)Z.ua[n]=e[n]}}}("object"==typeof window?window:t)})),hP=fe(((t,e)=>{y();var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",u="[object Error]",c="[object Function]",h="[object Map]",p="[object Number]",f="[object Object]",d="[object Promise]",g="[object RegExp]",v="[object Set]",m="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",x=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[i]=I[o]=I[b]=I[s]=I[w]=I[a]=I[u]=I[c]=I[h]=I[p]=I[f]=I[g]=I[v]=I[m]=I[_]=!1;var S="object"==typeof global&&global&&global.Object===Object&&global,N="object"==typeof self&&self&&self.Object===Object&&self,M=S||N||Function("return this")(),C="object"==typeof t&&t&&!t.nodeType&&t,O=C&&"object"==typeof e&&e&&!e.nodeType&&e,P=O&&O.exports===C,A=P&&S.process,D=function(){try{return A&&A.binding&&A.binding("util")}catch{}}(),T=D&&D.isTypedArray;function L(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function R(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function F(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function k(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function B(t){return function(e){return t(e)}}function j(t,e){return t.has(e)}function G(t,e){return null==t?void 0:t[e]}function z(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function U(t,e){return function(n){return t(e(n))}}function q(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}l(L,"arrayFilter"),l(R,"arrayPush"),l(F,"arraySome"),l(k,"baseTimes"),l(B,"baseUnary"),l(j,"cacheHas"),l(G,"getValue"),l(z,"mapToArray"),l(U,"overArg"),l(q,"setToArray");var V,Y=Array.prototype,X=Function.prototype,W=Object.prototype,J=M["__core-js_shared__"],H=X.toString,Z=W.hasOwnProperty,K=(V=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",$=W.toString,Q=RegExp("^"+H.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=P?M.Buffer:void 0,et=M.Symbol,nt=M.Uint8Array,rt=W.propertyIsEnumerable,it=Y.splice,ot=et?et.toStringTag:void 0,st=Object.getOwnPropertySymbols,at=tt?tt.isBuffer:void 0,lt=U(Object.keys,Object),ut=ce(M,"DataView"),ct=ce(M,"Map"),ht=ce(M,"Promise"),pt=ce(M,"Set"),ft=ce(M,"WeakMap"),dt=ce(Object,"create"),gt=_e(ut),yt=_e(ct),vt=_e(ht),mt=_e(pt),_t=_e(ft),bt=et?et.prototype:void 0,wt=bt?bt.valueOf:void 0;function xt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Et(){this.__data__=dt?dt(null):{},this.size=0}function It(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function St(t){var e=this.__data__;if(dt){var r=e[t];return r===n?void 0:r}return Z.call(e,t)?e[t]:void 0}function Nt(t){var e=this.__data__;return dt?void 0!==e[t]:Z.call(e,t)}function Mt(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dt&&void 0===e?n:e,this}function Ct(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(){this.__data__=[],this.size=0}function Pt(t){var e=this.__data__,n=Zt(e,t);return!(n<0)&&(n==e.length-1?e.pop():it.call(e,n,1),--this.size,!0)}function At(t){var e=this.__data__,n=Zt(e,t);return n<0?void 0:e[n][1]}function Dt(t){return Zt(this.__data__,t)>-1}function Tt(t,e){var n=this.__data__,r=Zt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Rt(){this.size=0,this.__data__={hash:new xt,map:new(ct||Ct),string:new xt}}function Ft(t){var e=ue(this,t).delete(t);return this.size-=e?1:0,e}function kt(t){return ue(this,t).get(t)}function Bt(t){return ue(this,t).has(t)}function jt(t,e){var n=ue(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Gt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Lt;++e<n;)this.add(t[e])}function zt(t){return this.__data__.set(t,n),this}function Ut(t){return this.__data__.has(t)}function qt(t){var e=this.__data__=new Ct(t);this.size=e.size}function Vt(){this.__data__=new Ct,this.size=0}function Yt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Xt(t){return this.__data__.get(t)}function Wt(t){return this.__data__.has(t)}function Jt(t,e){var n=this.__data__;if(n instanceof Ct){var r=n.__data__;if(!ct||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Lt(r)}return n.set(t,e),this.size=n.size,this}function Ht(t,e){var n=xe(t),r=!n&&we(t),i=!n&&!r&&Ie(t),o=!n&&!r&&!i&&Pe(t),s=n||r||i||o,a=s?k(t.length,String):[],l=a.length;for(var u in t)(e||Z.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||de(u,l)))&&a.push(u);return a}function Zt(t,e){for(var n=t.length;n--;)if(be(t[n][0],e))return n;return-1}function Kt(t,e,n){var r=e(t);return xe(t)?r:R(r,n(t))}function $t(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ot&&ot in Object(t)?he(t):me(t)}function Qt(t){return Oe(t)&&$t(t)==i}function te(t,e,n,r,i){return t===e||(null==t||null==e||!Oe(t)&&!Oe(e)?t!=t&&e!=e:ee(t,e,n,r,te,i))}function ee(t,e,n,r,s,a){var l=xe(t),u=xe(e),c=l?o:fe(t),h=u?o:fe(e),p=(c=c==i?f:c)==f,d=(h=h==i?f:h)==f,g=c==h;if(g&&Ie(t)){if(!Ie(e))return!1;l=!0,p=!1}if(g&&!p)return a||(a=new qt),l||Pe(t)?oe(t,e,n,r,s,a):se(t,e,c,n,r,s,a);if(!(1&n)){var y=p&&Z.call(t,"__wrapped__"),v=d&&Z.call(e,"__wrapped__");if(y||v){var m=y?t.value():t,_=v?e.value():e;return a||(a=new qt),s(m,_,n,r,a)}}return!!g&&(a||(a=new qt),ae(t,e,n,r,s,a))}function ne(t){return!(!Ce(t)||ye(t))&&(Ne(t)?Q:x).test(_e(t))}function re(t){return Oe(t)&&Me(t.length)&&!!I[$t(t)]}function ie(t){if(!ve(t))return lt(t);var e=[];for(var n in Object(t))Z.call(t,n)&&"constructor"!=n&&e.push(n);return e}function oe(t,e,n,r,i,o){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var c=-1,h=!0,p=2&n?new Gt:void 0;for(o.set(t,e),o.set(e,t);++c<a;){var f=t[c],d=e[c];if(r)var g=s?r(d,f,c,e,t,o):r(f,d,c,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!F(e,(function(t,e){if(!j(p,e)&&(f===t||i(f,t,n,r,o)))return p.push(e)}))){h=!1;break}}else if(f!==d&&!i(f,d,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function se(t,e,n,r,i,o,l){switch(n){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!o(new nt(t),new nt(e)));case s:case a:case p:return be(+t,+e);case u:return t.name==e.name&&t.message==e.message;case g:case m:return t==e+"";case h:var c=z;case v:var f=1&r;if(c||(c=q),t.size!=e.size&&!f)return!1;var d=l.get(t);if(d)return d==e;r|=2,l.set(t,e);var y=oe(c(t),c(e),r,i,o,l);return l.delete(t),y;case"[object Symbol]":if(wt)return wt.call(t)==wt.call(e)}return!1}function ae(t,e,n,r,i,o){var s=1&n,a=le(t),l=a.length;if(l!=le(e).length&&!s)return!1;for(var u=l;u--;){var c=a[u];if(!(s?c in e:Z.call(e,c)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var p=!0;o.set(t,e),o.set(e,t);for(var f=s;++u<l;){var d=t[c=a[u]],g=e[c];if(r)var y=s?r(g,d,c,e,t,o):r(d,g,c,t,e,o);if(!(void 0===y?d===g||i(d,g,n,r,o):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var v=t.constructor,m=e.constructor;v!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof v&&v instanceof v&&"function"==typeof m&&m instanceof m)&&(p=!1)}return o.delete(t),o.delete(e),p}function le(t){return Kt(t,Ae,pe)}function ue(t,e){var n=t.__data__;return ge(e)?n["string"==typeof e?"string":"hash"]:n.map}function ce(t,e){var n=G(t,e);return ne(n)?n:void 0}function he(t){var e=Z.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch{}var i=$.call(t);return r&&(e?t[ot]=n:delete t[ot]),i}l(xt,"Hash"),l(Et,"hashClear"),l(It,"hashDelete"),l(St,"hashGet"),l(Nt,"hashHas"),l(Mt,"hashSet"),xt.prototype.clear=Et,xt.prototype.delete=It,xt.prototype.get=St,xt.prototype.has=Nt,xt.prototype.set=Mt,l(Ct,"ListCache"),l(Ot,"listCacheClear"),l(Pt,"listCacheDelete"),l(At,"listCacheGet"),l(Dt,"listCacheHas"),l(Tt,"listCacheSet"),Ct.prototype.clear=Ot,Ct.prototype.delete=Pt,Ct.prototype.get=At,Ct.prototype.has=Dt,Ct.prototype.set=Tt,l(Lt,"MapCache"),l(Rt,"mapCacheClear"),l(Ft,"mapCacheDelete"),l(kt,"mapCacheGet"),l(Bt,"mapCacheHas"),l(jt,"mapCacheSet"),Lt.prototype.clear=Rt,Lt.prototype.delete=Ft,Lt.prototype.get=kt,Lt.prototype.has=Bt,Lt.prototype.set=jt,l(Gt,"SetCache"),l(zt,"setCacheAdd"),l(Ut,"setCacheHas"),Gt.prototype.add=Gt.prototype.push=zt,Gt.prototype.has=Ut,l(qt,"Stack"),l(Vt,"stackClear"),l(Yt,"stackDelete"),l(Xt,"stackGet"),l(Wt,"stackHas"),l(Jt,"stackSet"),qt.prototype.clear=Vt,qt.prototype.delete=Yt,qt.prototype.get=Xt,qt.prototype.has=Wt,qt.prototype.set=Jt,l(Ht,"arrayLikeKeys"),l(Zt,"assocIndexOf"),l(Kt,"baseGetAllKeys"),l($t,"baseGetTag"),l(Qt,"baseIsArguments"),l(te,"baseIsEqual"),l(ee,"baseIsEqualDeep"),l(ne,"baseIsNative"),l(re,"baseIsTypedArray"),l(ie,"baseKeys"),l(oe,"equalArrays"),l(se,"equalByTag"),l(ae,"equalObjects"),l(le,"getAllKeys"),l(ue,"getMapData"),l(ce,"getNative"),l(he,"getRawTag");var pe=st?function(t){return null==t?[]:(t=Object(t),L(st(t),(function(e){return rt.call(t,e)})))}:De,fe=$t;function de(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&t<e}function ge(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function ye(t){return!!K&&K in t}function ve(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function me(t){return $.call(t)}function _e(t){if(null!=t){try{return H.call(t)}catch{}try{return t+""}catch{}}return""}function be(t,e){return t===e||t!=t&&e!=e}(ut&&fe(new ut(new ArrayBuffer(1)))!=w||ct&&fe(new ct)!=h||ht&&fe(ht.resolve())!=d||pt&&fe(new pt)!=v||ft&&fe(new ft)!=_)&&(fe=l((function(t){var e=$t(t),n=e==f?t.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case gt:return w;case yt:return h;case vt:return d;case mt:return v;case _t:return _}return e}),"getTag")),l(de,"isIndex"),l(ge,"isKeyable"),l(ye,"isMasked"),l(ve,"isPrototype"),l(me,"objectToString"),l(_e,"toSource"),l(be,"eq");var we=Qt(function(){return arguments}())?Qt:function(t){return Oe(t)&&Z.call(t,"callee")&&!rt.call(t,"callee")},xe=Array.isArray;function Ee(t){return null!=t&&Me(t.length)&&!Ne(t)}l(Ee,"isArrayLike");var Ie=at||Te;function Se(t,e){return te(t,e)}function Ne(t){if(!Ce(t))return!1;var e=$t(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Me(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Ce(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Oe(t){return null!=t&&"object"==typeof t}l(Se,"isEqual"),l(Ne,"isFunction"),l(Me,"isLength"),l(Ce,"isObject"),l(Oe,"isObjectLike");var Pe=T?B(T):re;function Ae(t){return Ee(t)?Ht(t):ie(t)}function De(){return[]}function Te(){return!1}l(Ae,"keys"),l(De,"stubArray"),l(Te,"stubFalse"),e.exports=Se})),GP=fe(((t,e)=>{y();var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c[i]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c[o]=c["[object Map]"]=c["[object Number]"]=c[s]=c["[object RegExp]"]=c["[object Set]"]=c["[object String]"]=c["[object WeakMap]"]=!1;var h="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,f=h||p||Function("return this")(),d="object"==typeof t&&t&&!t.nodeType&&t,g=d&&"object"==typeof e&&e&&!e.nodeType&&e,v=g&&g.exports===d,m=v&&h.process,_=function(){try{return g&&g.require&&g.require("util").types||m&&m.binding&&m.binding("util")}catch{}}(),b=_&&_.isTypedArray;function w(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function x(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function E(t){return function(e){return t(e)}}function I(t,e){return null==t?void 0:t[e]}function S(t,e){return function(n){return t(e(n))}}l(w,"apply"),l(x,"baseTimes"),l(E,"baseUnary"),l(I,"getValue"),l(S,"overArg");var N,M=Array.prototype,C=Function.prototype,O=Object.prototype,P=f["__core-js_shared__"],A=C.toString,D=O.hasOwnProperty,T=(N=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",L=O.toString,R=A.call(Object),F=RegExp("^"+A.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=v?f.Buffer:void 0,B=f.Symbol,j=f.Uint8Array,G=k?k.allocUnsafe:void 0,z=S(Object.getPrototypeOf,Object),U=Object.create,q=O.propertyIsEnumerable,V=M.splice,Y=B?B.toStringTag:void 0,X=function(){try{var t=Xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),W=k?k.isBuffer:void 0,J=Math.max,H=Date.now,Z=Xt(f,"Map"),K=Xt(Object,"create"),$=function(){function t(){}return l(t,"object"),function(e){if(!ge(e))return{};if(U)return U(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function tt(){this.__data__=K?K(null):{},this.size=0}function et(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function nt(t){var e=this.__data__;if(K){var r=e[t];return r===n?void 0:r}return D.call(e,t)?e[t]:void 0}function rt(t){var e=this.__data__;return K?void 0!==e[t]:D.call(e,t)}function it(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=K&&void 0===e?n:e,this}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function st(){this.__data__=[],this.size=0}function at(t){var e=this.__data__,n=Nt(e,t);return!(n<0)&&(n==e.length-1?e.pop():V.call(e,n,1),--this.size,!0)}function lt(t){var e=this.__data__,n=Nt(e,t);return n<0?void 0:e[n][1]}function ut(t){return Nt(this.__data__,t)>-1}function ct(t,e){var n=this.__data__,r=Nt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ht(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function pt(){this.size=0,this.__data__={hash:new Q,map:new(Z||ot),string:new Q}}function ft(t){var e=Yt(this,t).delete(t);return this.size-=e?1:0,e}function dt(t){return Yt(this,t).get(t)}function gt(t){return Yt(this,t).has(t)}function yt(t,e){var n=Yt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function vt(t){var e=this.__data__=new ot(t);this.size=e.size}function mt(){this.__data__=new ot,this.size=0}function _t(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function bt(t){return this.__data__.get(t)}function wt(t){return this.__data__.has(t)}function xt(t,e){var n=this.__data__;if(n instanceof ot){var r=n.__data__;if(!Z||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ht(r)}return n.set(t,e),this.size=n.size,this}function Et(t,e){var n=ue(t),r=!n&&le(t),i=!n&&!r&&pe(t),o=!n&&!r&&!i&&me(t),s=n||r||i||o,a=s?x(t.length,String):[],l=a.length;for(var u in t)(e||D.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ht(u,l)))&&a.push(u);return a}function It(t,e,n){(void 0!==n&&!ae(t[e],n)||void 0===n&&!(e in t))&&Mt(t,e,n)}function St(t,e,n){var r=t[e];(!D.call(t,e)||!ae(r,n)||void 0===n&&!(e in t))&&Mt(t,e,n)}function Nt(t,e){for(var n=t.length;n--;)if(ae(t[n][0],e))return n;return-1}function Mt(t,e,n){"__proto__"==e&&X?X(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}l(Q,"Hash"),l(tt,"hashClear"),l(et,"hashDelete"),l(nt,"hashGet"),l(rt,"hashHas"),l(it,"hashSet"),Q.prototype.clear=tt,Q.prototype.delete=et,Q.prototype.get=nt,Q.prototype.has=rt,Q.prototype.set=it,l(ot,"ListCache"),l(st,"listCacheClear"),l(at,"listCacheDelete"),l(lt,"listCacheGet"),l(ut,"listCacheHas"),l(ct,"listCacheSet"),ot.prototype.clear=st,ot.prototype.delete=at,ot.prototype.get=lt,ot.prototype.has=ut,ot.prototype.set=ct,l(ht,"MapCache"),l(pt,"mapCacheClear"),l(ft,"mapCacheDelete"),l(dt,"mapCacheGet"),l(gt,"mapCacheHas"),l(yt,"mapCacheSet"),ht.prototype.clear=pt,ht.prototype.delete=ft,ht.prototype.get=dt,ht.prototype.has=gt,ht.prototype.set=yt,l(vt,"Stack"),l(mt,"stackClear"),l(_t,"stackDelete"),l(bt,"stackGet"),l(wt,"stackHas"),l(xt,"stackSet"),vt.prototype.clear=mt,vt.prototype.delete=_t,vt.prototype.get=bt,vt.prototype.has=wt,vt.prototype.set=xt,l(Et,"arrayLikeKeys"),l(It,"assignMergeValue"),l(St,"assignValue"),l(Nt,"assocIndexOf"),l(Mt,"baseAssignValue");var Ct=Vt();function Ot(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Y&&Y in Object(t)?Wt(t):ee(t)}function Pt(t){return ye(t)&&Ot(t)==i}function At(t){return!(!ge(t)||$t(t))&&(fe(t)?F:a).test(se(t))}function Dt(t){return ye(t)&&de(t.length)&&!!c[Ot(t)]}function Tt(t){if(!ge(t))return te(t);var e=Qt(t),n=[];for(var r in t)"constructor"==r&&(e||!D.call(t,r))||n.push(r);return n}function Lt(t,e,n,r,i){t!==e&&Ct(e,(function(o,s){if(i||(i=new vt),ge(o))Rt(t,e,s,n,Lt,r,i);else{var a=r?r(re(t,s),o,s+"",t,e,i):void 0;void 0===a&&(a=o),It(t,s,a)}}),be)}function Rt(t,e,n,r,i,o,s){var a=re(t,n),l=re(e,n),u=s.get(l);if(u)It(t,n,u);else{var c=o?o(a,l,n+"",t,e,s):void 0,h=void 0===c;if(h){var p=ue(l),f=!p&&pe(l),d=!p&&!f&&me(l);c=l,p||f||d?ue(a)?c=a:he(a)?c=zt(a):f?(h=!1,c=Bt(l,!0)):d?(h=!1,c=Gt(l,!0)):c=[]:ve(l)||le(l)?(c=a,le(a)?c=_e(a):(!ge(a)||fe(a))&&(c=Jt(l))):h=!1}h&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),It(t,n,c)}}function Ft(t,e){return ie(ne(t,e,Ee),t+"")}l(Ot,"baseGetTag"),l(Pt,"baseIsArguments"),l(At,"baseIsNative"),l(Dt,"baseIsTypedArray"),l(Tt,"baseKeysIn"),l(Lt,"baseMerge"),l(Rt,"baseMergeDeep"),l(Ft,"baseRest");var kt=X?function(t,e){return X(t,"toString",{configurable:!0,enumerable:!1,value:xe(e),writable:!0})}:Ee;function Bt(t,e){if(e)return t.slice();var n=t.length,r=G?G(n):new t.constructor(n);return t.copy(r),r}function jt(t){var e=new t.constructor(t.byteLength);return new j(e).set(new j(t)),e}function Gt(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function zt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ut(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=r?r(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?Mt(n,a,l):St(n,a,l)}return n}function qt(t){return Ft((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&Zt(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e}))}function Vt(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}function Yt(t,e){var n=t.__data__;return Kt(e)?n["string"==typeof e?"string":"hash"]:n.map}function Xt(t,e){var n=I(t,e);return At(n)?n:void 0}function Wt(t){var e=D.call(t,Y),n=t[Y];try{t[Y]=void 0;var r=!0}catch{}var i=L.call(t);return r&&(e?t[Y]=n:delete t[Y]),i}function Jt(t){return"function"!=typeof t.constructor||Qt(t)?{}:$(z(t))}function Ht(t,e){var n=typeof t;return!!(e=null==e?r:e)&&("number"==n||"symbol"!=n&&u.test(t))&&t>-1&&t%1==0&&t<e}function Zt(t,e,n){if(!ge(n))return!1;var r=typeof e;return!!("number"==r?ce(n)&&Ht(e,n.length):"string"==r&&e in n)&&ae(n[e],t)}function Kt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function $t(t){return!!T&&T in t}function Qt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||O)}function te(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}function ee(t){return L.call(t)}function ne(t,e,n){return e=J(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=J(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(s),w(t,this,a)}}function re(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}l(Bt,"cloneBuffer"),l(jt,"cloneArrayBuffer"),l(Gt,"cloneTypedArray"),l(zt,"copyArray"),l(Ut,"copyObject"),l(qt,"createAssigner"),l(Vt,"createBaseFor"),l(Yt,"getMapData"),l(Xt,"getNative"),l(Wt,"getRawTag"),l(Jt,"initCloneObject"),l(Ht,"isIndex"),l(Zt,"isIterateeCall"),l(Kt,"isKeyable"),l($t,"isMasked"),l(Qt,"isPrototype"),l(te,"nativeKeysIn"),l(ee,"objectToString"),l(ne,"overRest"),l(re,"safeGet");var ie=oe(kt);function oe(t){var e=0,n=0;return function(){var r=H(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function se(t){if(null!=t){try{return A.call(t)}catch{}try{return t+""}catch{}}return""}function ae(t,e){return t===e||t!=t&&e!=e}l(oe,"shortOut"),l(se,"toSource"),l(ae,"eq");var le=Pt(function(){return arguments}())?Pt:function(t){return ye(t)&&D.call(t,"callee")&&!q.call(t,"callee")},ue=Array.isArray;function ce(t){return null!=t&&de(t.length)&&!fe(t)}function he(t){return ye(t)&&ce(t)}l(ce,"isArrayLike"),l(he,"isArrayLikeObject");var pe=W||Ie;function fe(t){if(!ge(t))return!1;var e=Ot(t);return e==o||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function de(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function ge(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ye(t){return null!=t&&"object"==typeof t}function ve(t){if(!ye(t)||Ot(t)!=s)return!1;var e=z(t);if(null===e)return!0;var n=D.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&A.call(n)==R}l(fe,"isFunction"),l(de,"isLength"),l(ge,"isObject"),l(ye,"isObjectLike"),l(ve,"isPlainObject");var me=b?E(b):Dt;function _e(t){return Ut(t,be(t))}function be(t){return ce(t)?Et(t,!0):Tt(t)}l(_e,"toPlainObject"),l(be,"keysIn");var we=qt((function(t,e,n){Lt(t,e,n)}));function xe(t){return function(){return t}}function Ee(t){return t}function Ie(){return!1}l(xe,"constant"),l(Ee,"identity"),l(Ie,"stubFalse"),e.exports=we})),UP=fe(((t,e)=>{y(),function(n,r){"use strict";var i="function",o="undefined",s="object",a="string",u="model",c="name",h="type",p="vendor",f="version",d="architecture",g="console",y="mobile",v="tablet",m="smarttv",_="wearable",b="embedded",w="Amazon",x="Apple",E="ASUS",I="BlackBerry",S="Browser",N="Chrome",M="Firefox",C="Google",O="Huawei",P="LG",A="Microsoft",D="Motorola",T="Opera",L="Samsung",R="Sharp",F="Sony",k="Xiaomi",B="Zebra",j="Facebook",G=l((function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n}),"extend"),z=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),U=l((function(t,e){return typeof t===a&&-1!==q(e).indexOf(q(t))}),"has"),q=l((function(t){return t.toLowerCase()}),"lowerize"),V=l((function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:r}),"majorize"),Y=l((function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,""),typeof e===o?t:t.substring(0,350)}),"trim"),X=l((function(t,e){for(var n,o,a,l,u,c,h=0;h<e.length&&!u;){var p=e[h],f=e[h+1];for(n=o=0;n<p.length&&!u;)if(u=p[n++].exec(t))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;h+=2}}),"rgxMapper"),W=l((function(t,e){for(var n in e)if(typeof e[n]===s&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(U(e[n][i],t))return"?"===n?r:n}else if(U(e[n],t))return"?"===n?r:n;return t}),"strMapper"),J={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[c,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[c,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,j],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,N+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,N+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,q]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,L],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,L],[h,y]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[p,x],[h,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,x],[h,v]],[/(macintosh);/i],[u,[p,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,O],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,O],[h,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,k],[h,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,k],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[h,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[h,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[h,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,D],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,D],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,P],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,P],[h,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[h,y]],[/(pixel c)\b/i],[u,[p,C],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,C],[h,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,F],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,F],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[h,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,w],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,w],[h,y]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,I],[h,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,E],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,E],[h,y]],[/(nexus 9)/i],[u,[p,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[h,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[h,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,R],[h,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[h,y]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[h,v]],[/(surface duo)/i],[u,[p,A],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[h,y]],[/(u304aa)/i],[u,[p,"AT&T"],[h,y]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[h,y]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[h,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[h,y]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[h,y]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[h,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[h,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[h,y]],[/\b(ph-1) /i],[u,[p,"Essential"],[h,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[p,u,[h,y]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,A],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[h,g]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[p,F],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,A],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,L],[h,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,P],[h,m]],[/(apple) ?tv/i],[p,[u,x+" TV"],[h,m]],[/crkey/i],[[u,N+"cast"],[p,C],[h,m]],[/droid.+aft(\w)( bui|\))/i],[u,[p,w],[h,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,R],[h,m]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,F],[h,m]],[/(mitv-\w{5}) bui/i],[u,[p,k],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,Y],[u,Y],[h,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,m]],[/((pebble))app/i],[p,u,[h,_]],[/droid.+; (glass) \d/i],[u,[p,C],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[h,_]],[/(quest( 2)?)/i],[u,[p,j],[h,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,y]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,W,J]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,W,J]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,N+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},Z=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof Z))return new Z(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?G(H,e):H;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.browser),t.major=V(t.version),t},this.getCPU=function(){var t={};return t[d]=r,X.call(t,i,l.cpu),t},this.getDevice=function(){var t={};return t[p]=r,t[u]=r,t[h]=r,X.call(t,i,l.device),t},this.getEngine=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.engine),t},this.getOS=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=typeof t===a&&t.length>350?Y(t,350):t,this},this.setUA(i),this}),"UAParser");Z.VERSION="0.7.33",Z.BROWSER=z([c,f,"major"]),Z.CPU=z([d]),Z.DEVICE=z([u,p,h,g,y,m,v,_,b]),Z.ENGINE=Z.OS=z([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=Z),t.UAParser=Z):typeof define===i&&define.amd?define((function(){return Z})):typeof n!==o&&(n.UAParser=Z);var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var $=new Z;K.ua=$.getResult(),K.ua.get=function(){return $.getUA()},K.ua.set=function(t){$.setUA(t);var e=$.getResult();for(var n in e)K.ua[n]=e[n]}}}("object"==typeof window?window:t)})),Sg=fe(((t,e)=>{"use strict";y();var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch{return!1}}l(o,"toObject"),l(s,"shouldUseNative"),e.exports=s()?Object.assign:function(t,e){for(var s,a,l=o(t),u=1;u<arguments.length;u++){for(var c in s=Object(arguments[u]))r.call(s,c)&&(l[c]=s[c]);if(n){a=n(s);for(var h=0;h<a.length;h++)i.call(s,a[h])&&(l[a[h]]=s[a[h]])}}return l}})),vS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,r,i,o,s){l((function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=n[r],f=i,d=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}),"t")(t,r,i||0,o||t.length-1,s||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}l(t,"t"),l(e,"i"),l(n,"n");var r=l((function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}),"r");function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return l(i,"e"),l(o,"a"),l(s,"h"),l(a,"o"),l(u,"s"),l(c,"l"),l(h,"f"),l(p,"u"),l(f,"m"),l(d,"c"),l(g,"p"),l(y,"d"),r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!d(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;d(t,a)&&(e.leaf?n.push(s):f(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(d(t,o)){if(e.leaf||f(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=u.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!f(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));y(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);y(t,c,h,l,this.compareMinY);for(var p=c;p<=h;p+=l){var f=Math.min(p+l-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,i=u<i?u:i,s=l):c===o&&u<i&&(i=u,s=l)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),y=s(t,d,n,this.toBBox),v=(i=g,o=y,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),m=h(g)+h(y);v<p?(p=v,r=d,f=m<f?m:f):v===p&&m<f&&(f=m,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),l=s(t,n-e,n,i),u=p(o)+p(l),c=e;c<n-e;c++){var h=t.children[c];a(o,t.leaf?i(h):h),u+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?i(d):d),u+=p(l)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),_S=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";var t=l((function(t,n){if(void 0===t&&(t=[]),void 0===n&&(n=e),this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}),"TinyQueue");function e(t,e){return t<e?-1:t>e?1:0}return t.prototype.push=l((function(t){this.data.push(t),this.length++,this._up(this.length-1)}),"push"),t.prototype.pop=l((function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}),"pop"),t.prototype.peek=l((function(){return this.data[0]}),"peek"),t.prototype._up=l((function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}),"_up"),t.prototype._down=l((function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}),"_down"),l(e,"defaultCompare"),t},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).TinyQueue=r()})),xS=fe(((t,e)=>{y(),e.exports=l((function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var c=e[n+2*l+0],h=e[n+2*l+1],p=e[n+2*u+0],f=e[n+2*u+1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(s=!s)}return s}),"pointInPolygonFlat")})),ES=fe(((t,e)=>{y(),e.exports=l((function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var c=e[l+n][0],h=e[l+n][1],p=e[u+n][0],f=e[u+n][1];h>o!=f>o&&i<(p-c)*(o-h)/(f-h)+c&&(s=!s)}return s}),"pointInPolygonNested")})),PS=fe(((t,e)=>{y();var n=xS(),r=ES();e.exports=l((function(t,e,i,o){return e.length>0&&Array.isArray(e[0])?r(t,e,i,o):n(t,e,i,o)}),"pointInPolygon"),e.exports.nested=r,e.exports.flat=n})),CS=fe(((t,e)=>{var n,r;y(),n=t,r=function(t){"use strict";function e(t,e,n,r,i){let o,s,a,l,u=e[0],c=r[0],h=0,p=0;c>u==c>-u?(o=u,u=e[++h]):(o=c,c=r[++p]);let f=0;if(h<t&&p<n)for(c>u==c>-u?(a=o-((s=u+o)-u),u=e[++h]):(a=o-((s=c+o)-c),c=r[++p]),o=s,0!==a&&(i[f++]=a);h<t&&p<n;)c>u==c>-u?(a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++h]):(a=o-((s=o+c)-(l=s-o))+(c-l),c=r[++p]),o=s,0!==a&&(i[f++]=a);for(;h<t;)a=o-((s=o+u)-(l=s-o))+(u-l),u=e[++h],o=s,0!==a&&(i[f++]=a);for(;p<n;)a=o-((s=o+c)-(l=s-o))+(c-l),c=r[++p],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function n(t){return new Float64Array(t)}l(e,"r"),l(n,"o");let r=n(4),i=n(8),o=n(12),s=n(16),a=n(4);t.orient2d=function(t,n,l,u,c,h){let p=(n-h)*(l-c),f=(t-c)*(u-h),d=p-f;if(0===p||0===f||p>0!=f>0)return d;let g=Math.abs(p+f);return Math.abs(d)>=33306690738754716e-32*g?d:-function(t,n,l,u,c,h,p){let f,d,g,y,v,m,_,b,w,x,E,I,S,N,M,C,O,P,A=t-c,D=l-c,T=n-h,L=u-h;v=(M=(b=A-(_=(m=134217729*A)-(m-A)))*(x=L-(w=(m=134217729*L)-(m-L)))-((N=A*L)-_*w-b*w-_*x))-(E=M-(O=(b=T-(_=(m=134217729*T)-(m-T)))*(x=D-(w=(m=134217729*D)-(m-D)))-((C=T*D)-_*w-b*w-_*x))),r[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),r[1]=S-(E+v)+(v-C),v=(P=I+E)-I,r[2]=I-(P-v)+(E-v),r[3]=P;let R=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,r),F=22204460492503146e-32*p;if(R>=F||-R>=F||(f=t-(A+(v=t-A))+(v-c),g=l-(D+(v=l-D))+(v-c),d=n-(T+(v=n-T))+(v-h),y=u-(L+(v=u-L))+(v-h),0===f&&0===d&&0===g&&0===y)||(F=11093356479670487e-47*p+33306690738754706e-32*Math.abs(R),(R+=A*y+L*f-(T*g+D*d))>=F||-R>=F))return R;v=(M=(b=f-(_=(m=134217729*f)-(m-f)))*(x=L-(w=(m=134217729*L)-(m-L)))-((N=f*L)-_*w-b*w-_*x))-(E=M-(O=(b=d-(_=(m=134217729*d)-(m-d)))*(x=D-(w=(m=134217729*D)-(m-D)))-((C=d*D)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let k=e(4,r,4,a,i);v=(M=(b=A-(_=(m=134217729*A)-(m-A)))*(x=y-(w=(m=134217729*y)-(m-y)))-((N=A*y)-_*w-b*w-_*x))-(E=M-(O=(b=T-(_=(m=134217729*T)-(m-T)))*(x=g-(w=(m=134217729*g)-(m-g)))-((C=T*g)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let B=e(k,i,4,a,o);v=(M=(b=f-(_=(m=134217729*f)-(m-f)))*(x=y-(w=(m=134217729*y)-(m-y)))-((N=f*y)-_*w-b*w-_*x))-(E=M-(O=(b=d-(_=(m=134217729*d)-(m-d)))*(x=g-(w=(m=134217729*g)-(m-g)))-((C=d*g)-_*w-b*w-_*x))),a[0]=M-(E+v)+(v-O),v=(S=N-((I=N+E)-(v=I-N))+(E-v))-(E=S-C),a[1]=S-(E+v)+(v-C),v=(P=I+E)-I,a[2]=I-(P-v)+(E-v),a[3]=P;let j=e(B,o,4,a,s);return s[j-1]}(t,n,l,u,c,h,g)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).predicates={})})),LS=fe(((t,e)=>{"use strict";y();var n=vS(),r=_S(),i=PS(),o=CS().orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=v(t),o=new n(16);o.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},o.compareMinX=function(t,e){return t[0]-e[0]},o.compareMinY=function(t,e){return t[1]-e[1]},o.load(t);for(var s,l=[],u=0;u<i.length;u++){var c=i[u];o.remove(c),s=m(c,s),l.push(s)}var h=new n(16);for(u=0;u<l.length;u++)h.insert(g(l[u]));for(var p=e*e,f=r*r;l.length;){var d=l.shift(),y=d.p,b=d.next.p,w=_(y,b);if(!(w<f)){var x=w/p;(c=a(o,d.prev.p,y,b,d.next.next.p,x,h))&&Math.min(_(c,y),_(c,b))<=x&&(l.push(d),l.push(m(c,d)),o.remove(c),h.remove(d),h.insert(g(d)),h.insert(g(d.next)))}}d=s;var E=[];do{E.push(d.p),d=d.next}while(d!==s);return E.push(d.p),E}function a(t,e,n,i,o,s,a){for(var l=new r([],u),h=t.data;h;){for(var f=0;f<h.children.length;f++){var d=h.children[f],g=h.leaf?b(d,n,i):c(n,i,d);g>s||l.push({node:d,dist:g})}for(;l.length&&!l.peek().node.children;){var y=l.pop(),v=y.node,m=b(v,e,n),_=b(v,i,o);if(y.dist<m&&y.dist<_&&p(n,v,a)&&p(i,v,a))return v}(h=l.pop())&&(h=h.node)}return null}function u(t,e){return t.dist-e.dist}function c(t,e,n){if(h(t,n)||h(e,n))return 0;var r=w(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=w(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=w(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=w(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function h(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),l=0;l<a.length;l++)if(d(a[l].p,a[l].next.p,t,e))return!1;return!0}function f(t,e,n){return o(t[0],t[1],e[0],e[1],n[0],n[1])}function d(t,e,n,r){return t!==r&&e!==n&&f(t,e,n)>0!=f(t,e,r)>0&&f(n,r,t)>0!=f(n,r,e)>0}function g(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function v(t){for(var e=t[0],n=t[0],r=t[0],o=t[0],s=0;s<t.length;s++){var a=t[s];a[0]<e[0]&&(e=a),a[0]>r[0]&&(r=a),a[1]<n[1]&&(n=a),a[1]>o[1]&&(o=a)}var l=[e,n,r,o],u=l.slice();for(s=0;s<t.length;s++)i(t[s],l)||u.push(t[s]);return E(u)}function m(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function _(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function b(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function w(t,e,n,r,i,o,s,a){var l,u,c,h,p=n-t,f=r-e,d=s-i,g=a-o,y=t-i,v=e-o,m=p*p+f*f,_=p*d+f*g,b=d*d+g*g,w=p*y+f*v,x=d*y+g*v,E=m*b-_*_,I=E,S=E;0===E?(u=0,I=1,h=x,S=b):(h=m*x-_*w,(u=_*x-b*w)<0?(u=0,h=x,S=b):u>I&&(u=I,h=x+_,S=b)),h<0?(h=0,-w<0?u=0:-w>m?u=I:(u=-w,I=m)):h>S&&(h=S,-w+_<0?u=0:-w+_>m?u=I:(u=-w+_,I=m));var N=(1-(c=0===h?0:h/S))*i+c*s-((1-(l=0===u?0:u/I))*t+l*n),M=(1-c)*o+c*a-((1-l)*e+l*r);return N*N+M*M}function x(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}function E(t){t.sort(x);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&f(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&f(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}r.default&&(r=r.default),e.exports=s,e.exports.default=s,l(s,"concaveman"),l(a,"findCandidate"),l(u,"compareDist"),l(c,"sqSegBoxDist"),l(h,"inside"),l(p,"noIntersections"),l(f,"cross"),l(d,"intersects"),l(g,"updateBBox"),l(v,"fastConvexHull"),l(m,"insertNode"),l(_,"getSqDist"),l(b,"sqSegDist"),l(w,"sqSegSegDist"),l(x,"compareByX"),l(E,"convexHull")})),jS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,n,i,o,s){e(t,n,i||0,o||t.length-1,s||r)}function e(t,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=t[r],f=i,d=o;for(n(t,i,r),s(t[o],p)>0&&n(t,i,o);f<d;){for(n(t,f,d),f++,d--;s(t[f],p)<0;)f++;for(;s(t[d],p)>0;)d--}0===s(t[i],p)?n(t,i,d):n(t,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}return l(t,"quickselect"),l(e,"quickselectStep"),l(n,"swap"),l(r,"defaultCompare"),t},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):n.quickselect=r()})),kb=fe(((t,e)=>{"use strict";y(),e.exports=r,e.exports.default=r;var n=jS();function r(t,e){if(!(this instanceof r))return new r(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],a(i,t.leaf?r(o):o);return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(t,e,r,i,o){for(var s,a=[e,r];a.length;)!((r=a.pop())-(e=a.pop())<=i)&&(s=e+Math.ceil((r-e)/i/2)*i,n(t,s,e,r,o),a.push(e,s,s,r))}l(r,"rbush"),r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!v(t,e))return n;for(var i,o,s,a,l=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],v(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):g(t,a)?this._all(s,n):l.push(s));e=l.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!v(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],v(t,s=e.leaf?n(o):o)){if(e.leaf||g(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var n,r,o,s,a=this.data,l=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),s=!0),a.leaf&&-1!==(o=i(t,a.children,e)))return a.children.splice(o,1),u.push(a),this._condense(u),this;s||a.leaf||!g(a,l)?r?(n++,a=r.children[n],s=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:u,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=m([])).leaf=!1,i.height=r;var l,u,c,h,p=Math.ceil(s/a),f=p*Math.ceil(Math.sqrt(a));for(_(t,e,n,f,this.compareMinX),l=e;l<=n;l+=f)for(_(t,l,c=Math.min(l+f-1,n),p,this.compareMinY),u=l;u<=c;u+=p)h=Math.min(u+p-1,c),i.children.push(this._build(t,u,h,r-1));return o(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,l,u,c,p;r.push(e),!e.leaf&&r.length-1!==n;){for(c=p=1/0,i=0,o=e.children.length;i<o;i++)l=h(s=e.children[i]),(u=f(t,s)-l)<p?(p=u,c=l<c?l:c,a=s):u===p&&l<c&&(c=l,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),a(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=m(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,a,l,u,c,p;for(u=c=1/0,r=e;r<=n-e;r++)a=d(i=s(t,0,r,this.toBBox),o=s(t,r,n,this.toBBox)),l=h(i)+h(o),a<u?(u=a,p=r,c=l<c?l:c):a===u&&l<c&&(c=l,p=r);return p},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,l=this.toBBox,u=s(t,0,e,l),c=s(t,n-e,n,l),h=p(u)+p(c);for(i=e;i<n-e;i++)o=t.children[i],a(u,t.leaf?l(o):o),h+=p(u);for(i=n-e-1;i>=e;i--)o=t.children[i],a(c,t.leaf?l(o):o),h+=p(c);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},l(i,"findItem"),l(o,"calcBBox"),l(s,"distBBox"),l(a,"extend"),l(u,"compareNodeMinX"),l(c,"compareNodeMinY"),l(h,"bboxArea"),l(p,"bboxMargin"),l(f,"enlargedArea"),l(d,"intersectionArea"),l(g,"contains"),l(v,"intersects"),l(m,"createNode"),l(_,"multiSelect")})),WS=fe(((t,e)=>{"use strict";function n(t,e,n){n=n||2;var i,s,a,l,u,c,p,f=e&&e.length,d=f?e[0]*n:t.length,g=r(t,0,d,n,!0),y=[];if(!g||g.next===g.prev)return y;if(f&&(g=h(t,e,g,n)),t.length>80*n){i=a=t[0],s=l=t[1];for(var v=n;v<d;v+=n)(u=t[v])<i&&(i=u),(c=t[v+1])<s&&(s=c),u>a&&(a=u),c>l&&(l=c);p=0!==(p=Math.max(a-i,l-s))?32767/p:0}return o(g,y,n,i,s,p,0),y}function r(t,e,n,r,i){var o,s;if(i===R(t,e,n,r)>0)for(o=e;o<n;o+=r)s=D(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=D(o,t[o],t[o+1],s);return s&&I(s,s.next)&&(T(s),s=s.next),s}function i(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!I(r,r.next)&&0!==E(r.prev,r,r.next))r=r.next;else{if(T(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function o(t,e,n,r,l,h,p){if(t){!p&&h&&v(t,r,l,h);for(var f,d,g=t;t.prev!==t.next;)if(f=t.prev,d=t.next,h?a(t,r,l,h):s(t))e.push(f.i/n|0),e.push(t.i/n|0),e.push(d.i/n|0),T(t),t=d.next,g=d.next;else if((t=d)===g){p?1===p?o(t=u(i(t),e,n),e,n,r,l,h,2):2===p&&c(t,e,n,r,l,h):o(i(t),e,n,r,l,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(E(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,c=i<o?i<s?i:s:o<s?o:s,h=a<l?a<u?a:u:l<u?l:u,p=i>o?i>s?i:s:o>s?o:s,f=a>l?a>u?a:u:l>u?l:u,d=r.next;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&w(i,a,o,l,s,u,d.x,d.y)&&E(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function a(t,e,n,r){var i=t.prev,o=t,s=t.next;if(E(i,o,s)>=0)return!1;for(var a=i.x,l=o.x,u=s.x,c=i.y,h=o.y,p=s.y,f=a<l?a<u?a:u:l<u?l:u,d=c<h?c<p?c:p:h<p?h:p,g=a>l?a>u?a:u:l>u?l:u,y=c>h?c>p?c:p:h>p?h:p,v=_(f,d,e,n,r),m=_(g,y,e,n,r),b=t.prevZ,x=t.nextZ;b&&b.z>=v&&x&&x.z<=m;){if(b.x>=f&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==s&&w(a,c,l,h,u,p,b.x,b.y)&&E(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=f&&x.x<=g&&x.y>=d&&x.y<=y&&x!==i&&x!==s&&w(a,c,l,h,u,p,x.x,x.y)&&E(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=v;){if(b.x>=f&&b.x<=g&&b.y>=d&&b.y<=y&&b!==i&&b!==s&&w(a,c,l,h,u,p,b.x,b.y)&&E(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=m;){if(x.x>=f&&x.x<=g&&x.y>=d&&x.y<=y&&x!==i&&x!==s&&w(a,c,l,h,u,p,x.x,x.y)&&E(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function u(t,e,n){var r=t;do{var o=r.prev,s=r.next.next;!I(o,s)&&S(o,r,r.next,s)&&O(o,s)&&O(s,o)&&(e.push(o.i/n|0),e.push(r.i/n|0),e.push(s.i/n|0),T(r),T(r.next),r=t=s),r=r.next}while(r!==t);return i(r)}function c(t,e,n,r,s,a){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=A(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,n,r,s,a,0),void o(c,e,n,r,s,a,0)}u=u.next}l=l.next}while(l!==t)}function h(t,e,n,i){var o,s,a,l=[];for(o=0,s=e.length;o<s;o++)(a=r(t,e[o]*i,o<s-1?e[o+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),l.push(b(a));for(l.sort(p),o=0;o<l.length;o++)n=f(l[o],n);return n}function p(t,e){return t.x-e.x}function f(t,e){var n=d(t,e);if(!n)return e;var r=A(n,t);return i(r,r.next),i(n,n.next)}function d(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var l,u=n,c=n.x,h=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&w(o<h?i:s,o,c,h,o<h?s:i,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(i-r.x),O(r,t)&&(l<p||l===p&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,p=l)),r=r.next}while(r!==u);return n}function g(t,e){return E(t.prev,t,e.prev)<0&&E(e.next,t,t.next)<0}function v(t,e,n,r){var i=t;do{0===i.z&&(i.z=_(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,m(i)}function m(t){var e,n,r,i,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(l=u;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(s>1);return t}function _(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function b(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function w(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!C(t,e)&&(O(t,e)&&O(e,t)&&P(t,e)&&(E(t.prev,t,e.prev)||E(t,e.prev,e))||I(t,e)&&E(t.prev,t,t.next)>0&&E(e.prev,e,e.next)>0)}function E(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,n,r){var i=M(E(t,e,n)),o=M(E(t,e,r)),s=M(E(n,r,t)),a=M(E(n,r,e));return!!(i!==o&&s!==a||0===i&&N(t,n,e)||0===o&&N(t,r,e)||0===s&&N(n,t,r)||0===a&&N(n,e,r))}function N(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function M(t){return t>0?1:t<0?-1:0}function C(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&S(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function O(t,e){return E(t.prev,t,t.next)<0?E(t,e,t.next)>=0&&E(t,t.prev,e)>=0:E(t,e,t.prev)<0||E(t,t.next,e)<0}function P(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}function A(t,e){var n=new L(t.i,t.x,t.y),r=new L(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function D(t,e,n,r){var i=new L(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function L(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}y(),e.exports=n,e.exports.default=n,l(n,"earcut"),l(r,"linkedList"),l(i,"filterPoints"),l(o,"earcutLinked"),l(s,"isEar"),l(a,"isEarHashed"),l(u,"cureLocalIntersections"),l(c,"splitEarcut"),l(h,"eliminateHoles"),l(p,"compareX"),l(f,"eliminateHole"),l(d,"findHoleBridge"),l(g,"sectorContainsSector"),l(v,"indexCurve"),l(m,"sortLinked"),l(_,"zOrder"),l(b,"getLeftmost"),l(w,"pointInTriangle"),l(x,"isValidDiagonal"),l(E,"area"),l(I,"equals"),l(S,"intersects"),l(N,"onSegment"),l(M,"sign"),l(C,"intersectsPolygon"),l(O,"locallyInside"),l(P,"middleInside"),l(A,"splitPolygon"),l(D,"insertNode"),l(T,"removeNode"),l(L,"Node"),n.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(R(t,0,o,n));if(i)for(var a=0,l=e.length;a<l;a++){var u=e[a]*n,c=a<l-1?e[a+1]*n:t.length;s-=Math.abs(R(t,u,c,n))}var h=0;for(a=0;a<r.length;a+=3){var p=r[a]*n,f=r[a+1]*n,d=r[a+2]*n;h+=Math.abs((t[p]-t[d])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[d+1]-t[p+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},l(R,"signedArea"),n.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}})),HS=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,r,i,o,s){l((function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*c/a+h)),Math.min(o,Math.floor(r+(a-l)*c/a+h)),s)}var p=n[r],f=i,d=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}),"t")(t,r,i||0,o||t.length-1,s||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}l(t,"t"),l(e,"i"),l(n,"n");var r=l((function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}),"r");function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return l(i,"e"),l(o,"a"),l(s,"h"),l(a,"o"),l(u,"s"),l(c,"l"),l(h,"f"),l(p,"u"),l(f,"m"),l(d,"c"),l(g,"p"),l(y,"d"),r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!d(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;d(t,a)&&(e.leaf?n.push(s):f(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(d(t,o)){if(e.leaf||f(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),r=l[l.length-1],n=u.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),l.push(s),this._condense(l),this}o||s.leaf||!f(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));y(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);y(t,c,h,l,this.compareMinY);for(var p=c;p<=h;p+=l){var f=Math.min(p+l-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,i=u<i?u:i,s=l):c===o&&u<i&&(i=u,s=l)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),y=s(t,d,n,this.toBBox),v=(i=g,o=y,a=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),m=h(g)+h(y);v<p?(p=v,r=d,f=m<f?m:f):v===p&&m<f&&(f=m,r=d)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),l=s(t,n-e,n,i),u=p(o)+p(l),c=e;c<n-e;c++){var h=t.children[c];a(o,t.leaf?i(h):h),u+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?i(d):d),u+=p(l)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),qb=fe((t=>{"use strict";function e(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 n(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return a(e).geometry;case"Polygon":return o(e).geometry;case"MultiPoint":return p(e).geometry;case"MultiLineString":return h(e).geometry;case"MultiPolygon":return f(e).geometry;default:throw new Error(t+" is invalid")}}function r(t,n,r){if(void 0===r&&(r={}),!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(!S(t[0])||!S(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return e({type:"Polygon",coordinates:t},n,r)}function s(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return o(t,e)})),n)}function a(t,n,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return e({type:"LineString",coordinates:t},n,r)}function u(t,e,n){return void 0===n&&(n={}),c(t.map((function(t){return a(t,e)})),n)}function c(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 h(t,n,r){return void 0===r&&(r={}),e({type:"MultiLineString",coordinates:t},n,r)}function p(t,n,r){return void 0===r&&(r={}),e({type:"MultiPoint",coordinates:t},n,r)}function f(t,n,r){return void 0===r&&(r={}),e({type:"MultiPolygon",coordinates:t},n,r)}function d(t,n,r){return void 0===r&&(r={}),e({type:"GeometryCollection",geometries:t},n,r)}function g(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function v(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e*r}function m(e,n){void 0===n&&(n="kilometers");var r=t.factors[n];if(!r)throw new Error(n+" units is invalid");return e/r}function _(t,e){return w(m(t,e))}function b(t){var e=t%360;return e<0&&(e+=360),e}function w(t){return 180*(t%(2*Math.PI))/Math.PI}function x(t){return t%360*Math.PI/180}function E(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 v(m(t,e),n)}function I(e,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var i=t.areaFactors[n];if(!i)throw new Error("invalid original units");var o=t.areaFactors[r];if(!o)throw new Error("invalid final units");return e/i*o}function S(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function N(t){return!!t&&t.constructor===Object}function M(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!S(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}y(),Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=6371008.8,t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:1.0936*t.earthRadius},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},l(e,"feature"),t.feature=e,l(n,"geometry"),t.geometry=n,l(r,"point"),t.point=r,l(i,"points"),t.points=i,l(o,"polygon"),t.polygon=o,l(s,"polygons"),t.polygons=s,l(a,"lineString"),t.lineString=a,l(u,"lineStrings"),t.lineStrings=u,l(c,"featureCollection"),t.featureCollection=c,l(h,"multiLineString"),t.multiLineString=h,l(p,"multiPoint"),t.multiPoint=p,l(f,"multiPolygon"),t.multiPolygon=f,l(d,"geometryCollection"),t.geometryCollection=d,l(g,"round"),t.round=g,l(v,"radiansToLength"),t.radiansToLength=v,l(m,"lengthToRadians"),t.lengthToRadians=m,l(_,"lengthToDegrees"),t.lengthToDegrees=_,l(b,"bearingToAzimuth"),t.bearingToAzimuth=b,l(w,"radiansToDegrees"),t.radiansToDegrees=w,l(x,"degreesToRadians"),t.degreesToRadians=x,l(E,"convertLength"),t.convertLength=E,l(I,"convertArea"),t.convertArea=I,l(S,"isNumber"),t.isNumber=S,l(N,"isObject"),t.isObject=N,l(M,"validateBBox"),t.validateBBox=M,l(C,"validateId"),t.validateId=C})),Ub=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e=qb();function n(t,e,r){if(null!==t)for(var i,o,s,a,l,u,c,h,p=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,v=g?t.features.length:1,m=0;m<v;m++){l=(h=!!(c=g?t.features[m].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var b=0,w=0;if(null!==(a=h?c.geometries[_]:c)){u=a.coordinates;var x=a.type;switch(p=!r||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(u,f,m,b,w))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<u.length;i++){if(!1===e(u[i],f,m,b,w))return!1;f++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<u.length;i++){for(o=0;o<u[i].length-p;o++){if(!1===e(u[i][o],f,m,b,w))return!1;f++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(i=0;i<u.length;i++){for(w=0,o=0;o<u[i].length;o++){for(s=0;s<u[i][o].length-p;s++){if(!1===e(u[i][o][s],f,m,b,w))return!1;f++}w++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(!1===n(a.geometries[i],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function r(t,e,r,i){var o=r;return n(t,(function(t,n,i,s,a){o=0===n&&void 0===r?t:e(o,t,n,i,s,a)}),i),o}function i(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function o(t,e,n){var r=n;return i(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function s(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 a(t,e,n){var r=n;return s(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function u(t){var e=[];return n(t,(function(t){e.push(t)})),e}function c(t,e){var n,r,i,o,s,a,l,u,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,u=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,h))return!1;p++}}function h(t,e,n){var r=n;return c(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function p(t,n){c(t,(function(t,r,i,o,s){var a,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==n(e.feature(t,i,{bbox:o,id:s}),r,0)&&void 0}switch(l){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:a,coordinates:t.coordinates[u]};if(!1===n(e.feature(c,i),r,u))return!1}}))}function f(t,e,n){var r=n;return p(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function d(t,r){p(t,(function(t,i,o){var s=0;if(t.geometry){var a=t.geometry.type;if("Point"!==a&&"MultiPoint"!==a){var l,u=0,c=0,h=0;if(!1===n(t,(function(n,a,p,f,d){if(void 0===l||i>u||f>c||d>h)return l=n,u=i,c=f,h=d,void(s=0);var g=e.lineString([l,n],t.properties);if(!1===r(g,i,o,d,s))return!1;s++,l=n})))return!1}}}))}function g(t,e,n){var r=n,i=!1;return d(t,(function(t,o,s,a,l){r=!1===i&&void 0===n?t:e(r,t,o,s,a,l),i=!0})),r}function v(t,n){if(!t)throw new Error("geojson is required");p(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===n(t,r,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===n(e.lineString(s[a],t.properties),r,i,a))return!1}}}))}function m(t,e,n){var r=n;return v(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function _(t,n){if(n=n||{},!e.isObject(n))throw new Error("options is invalid");var r,i=n.featureIndex||0,o=n.multiFeatureIndex||0,s=n.geometryIndex||0,a=n.segmentIndex||0,l=n.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=u.length+a-1),e.lineString([u[a],u[a+1]],l,n);case"Polygon":return s<0&&(s=u.length+s),a<0&&(a=u[s].length+a-1),e.lineString([u[s][a],u[s][a+1]],l,n);case"MultiLineString":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a-1),e.lineString([u[o][a],u[o][a+1]],l,n);case"MultiPolygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),a<0&&(a=u[o][s].length-a-1),e.lineString([u[o][s][a],u[o][s][a+1]],l,n)}throw new Error("geojson is invalid")}function b(t,n){if(n=n||{},!e.isObject(n))throw new Error("options is invalid");var r,i=n.featureIndex||0,o=n.multiFeatureIndex||0,s=n.geometryIndex||0,a=n.coordIndex||0,l=n.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":return e.point(u,l,n);case"MultiPoint":return o<0&&(o=u.length+o),e.point(u[o],l,n);case"LineString":return a<0&&(a=u.length+a),e.point(u[a],l,n);case"Polygon":return s<0&&(s=u.length+s),a<0&&(a=u[s].length+a),e.point(u[s][a],l,n);case"MultiLineString":return o<0&&(o=u.length+o),a<0&&(a=u[o].length+a),e.point(u[o][a],l,n);case"MultiPolygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),a<0&&(a=u[o][s].length-a),e.point(u[o][s][a],l,n)}throw new Error("geojson is invalid")}l(n,"coordEach"),l(r,"coordReduce"),l(i,"propEach"),l(o,"propReduce"),l(s,"featureEach"),l(a,"featureReduce"),l(u,"coordAll"),l(c,"geomEach"),l(h,"geomReduce"),l(p,"flattenEach"),l(f,"flattenReduce"),l(d,"segmentEach"),l(g,"segmentReduce"),l(v,"lineEach"),l(m,"lineReduce"),l(_,"findSegment"),l(b,"findPoint"),t.coordAll=u,t.coordEach=n,t.coordReduce=r,t.featureEach=s,t.featureReduce=a,t.findPoint=b,t.findSegment=_,t.flattenEach=p,t.flattenReduce=f,t.geomEach=c,t.geomReduce=h,t.lineEach=v,t.lineReduce=m,t.propEach=i,t.propReduce=o,t.segmentEach=d,t.segmentReduce=g})),iC=fe((t=>{"use strict";y(),Object.defineProperty(t,"__esModule",{value:!0});var e=Ub();function n(t){var n=[1/0,1/0,-1/0,-1/0];return e.coordEach(t,(function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])})),n}l(n,"bbox"),n.default=n,t.default=n})),Ug=fe(((t,e)=>{y();var n=HS(),r=qb(),i=Ub(),o=iC().default,s=i.featureEach,a=(i.coordEach,r.polygon,r.featureCollection);function u(t){var e=new n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:o(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:o(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:o(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:o(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return a(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return a(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=o(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=o(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}l(u,"geojsonRbush"),e.exports=u,e.exports.default=u})),Jb=fe(((t,e)=>{"use strict";y();var n=Object.prototype.toString;e.exports=l((function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}),"isArguments")})),SC=fe(((t,e)=>{"use strict";var n,r,i,o,s,a,u,c,h,p,f,d;y(),Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Jb(),s=Object.prototype.propertyIsEnumerable,a=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=l((function(t){var e=t.constructor;return e&&e.prototype===t}),"equalsConstructorPrototype"),p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!p["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch{return!0}}catch{return!0}return!1}(),d=l((function(t){if(typeof window>"u"||!f)return h(t);try{return h(t)}catch{return!1}}),"equalsConstructorPrototypeIfNotBuggy"),n=l((function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),s=o(t),l=e&&"[object String]"===i.call(t),h=[];if(!e&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var p=u&&n;if(l&&t.length>0&&!r.call(t,0))for(var f=0;f<t.length;++f)h.push(String(f));if(s&&t.length>0)for(var g=0;g<t.length;++g)h.push(String(g));else for(var y in t)(!p||"prototype"!==y)&&r.call(t,y)&&h.push(String(y));if(a)for(var v=d(t),m=0;m<c.length;++m)(!v||"constructor"!==c[m])&&r.call(t,c[m])&&h.push(c[m]);return h}),"keys")),e.exports=n})),Hg=fe(((t,e)=>{"use strict";y();var n=Array.prototype.slice,r=Jb(),i=Object.keys,o=i?l((function(t){return i(t)}),"keys"):SC(),s=Object.keys;o.shim=l((function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=l((function(t){return r(t)?s(n.call(t)):s(t)}),"keys"))}else Object.keys=o;return Object.keys||o}),"shimObjectKeys"),e.exports=o})),TC=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),ex=fe(((t,e)=>{"use strict";y();var n=TC();e.exports=l((function(){return n()&&!!Symbol.toStringTag}),"hasToStringTagShams")})),RC=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),BC=fe(((t,e)=>{"use strict";y();var n=typeof Symbol<"u"&&Symbol,r=RC();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),zC=fe(((t,e)=>{"use strict";y();var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,i=Object.prototype.toString,o="[object Function]";e.exports=l((function(t){var e=this;if("function"!=typeof e||i.call(e)!==o)throw new TypeError(n+e);for(var s,a=r.call(arguments,1),u=l((function(){if(this instanceof s){var n=e.apply(this,a.concat(r.call(arguments)));return Object(n)===n?n:this}return e.apply(t,a.concat(r.call(arguments)))}),"binder"),c=Math.max(0,e.length-a.length),h=[],p=0;p<c;p++)h.push("$"+p);if(s=Function("binder","return function ("+h.join(",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var f=l((function(){}),"Empty");f.prototype=e.prototype,s.prototype=new f,f.prototype=null}return s}),"bind")})),Rp=fe(((t,e)=>{"use strict";y();var n=zC();e.exports=Function.prototype.bind||n})),rx=fe(((t,e)=>{"use strict";y();var n=Rp();e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),ox=fe(((t,e)=>{"use strict";y();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch{}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch{try{return a(arguments,"callee").get}catch{return u}}}():u,h=BC()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d=typeof Uint8Array>"u"?n:p(Uint8Array),g={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h?n:p((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h?n:p((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet},v=l((function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=p(i.prototype))}return g[e]=n,n}),"doEval"),m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=Rp(),b=rx(),w=_.call(Function.call,Array.prototype.concat),x=_.call(Function.apply,Array.prototype.splice),E=_.call(Function.call,String.prototype.replace),I=_.call(Function.call,String.prototype.slice),S=_.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,C=l((function(t){var e=I(t,0,1),n=I(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var i=[];return E(t,N,(function(t,e,n,r){i[i.length]=n?E(r,M,"$1"):e||t})),i}),"stringToPath"),O=l((function(t,e){var n,i=t;if(b(m,i)&&(i="%"+(n=m[i])[0]+"%"),b(g,i)){var s=g[i];if(s===f&&(s=v(i)),typeof s>"u"&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new r("intrinsic "+t+" does not exist!")}),"getBaseIntrinsic");e.exports=l((function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/g,t))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=C(t),i=n.length>0?n[0]:"",s=O("%"+i+"%",e),l=s.name,u=s.value,c=!1,h=s.alias;h&&(i=h[0],x(n,w([0,1],h)));for(var p=1,f=!0;p<n.length;p+=1){var d=n[p],y=I(d,0,1),v=I(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new r("property names with quotes must have matching quotes");if(("constructor"===d||!f)&&(c=!0),b(g,l="%"+(i+="."+d)+"%"))u=g[l];else if(null!=u){if(!(d in u)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(a&&p+1>=n.length){var m=a(u,d);u=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[d]}else f=b(u,d),u=u[d];f&&!c&&(g[l]=u)}}return u}),"GetIntrinsic")})),Zg=fe(((t,e)=>{"use strict";y();var n=Rp(),r=ox(),i=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(o,i),a=r("%Object.getOwnPropertyDescriptor%",!0),u=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}e.exports=l((function(t){var e=s(n,o,arguments);if(a&&u){var r=a(e,"length");r.configurable&&u(e,"length",{value:1+c(0,t.length-(arguments.length-1))})}return e}),"callBind");var h=l((function(){return s(n,i,arguments)}),"applyBind");u?u(e.exports,"apply",{value:h}):e.exports.apply=h})),sx=fe(((t,e)=>{"use strict";y();var n=ox(),r=Zg(),i=r(n("String.prototype.indexOf"));e.exports=l((function(t,e){var o=n(t,!!e);return"function"==typeof o&&i(t,".prototype.")>-1?r(o):o}),"callBoundIntrinsic")})),nk=fe(((t,e)=>{"use strict";y();var n=ex()(),r=sx()("Object.prototype.toString"),i=l((function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===r(t)}),"isArguments"),o=l((function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==r(t)&&"[object Function]"===r(t.callee)}),"isArguments"),s=function(){return i(arguments)}();i.isLegacyArguments=o,e.exports=s?i:o})),cx=fe(((t,e)=>{"use strict";y();var n=Hg(),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,a=l((function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}),"isFunction"),u=l((function(){var t={};try{for(var e in s(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}),"arePropertyDescriptorsSupported"),c=s&&u(),h=l((function(t,e,n,r){e in t&&(!a(r)||!r())||(c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)}),"defineProperty"),p=l((function(t,e){var i=arguments.length>2?arguments[2]:{},s=n(e);r&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)h(t,s[a],e[s[a]],i[s[a]])}),"defineProperties");p.supportsDescriptors=!!c,e.exports=p})),fx=fe(((t,e)=>{"use strict";y();var n=l((function(t){return t!=t}),"numberIsNaN");e.exports=l((function(t,e){return 0===t&&0===e?1/t==1/e:!!(t===e||n(t)&&n(e))}),"is")})),px=fe(((t,e)=>{"use strict";y();var n=fx();e.exports=l((function(){return"function"==typeof Object.is?Object.is:n}),"getPolyfill")})),fk=fe(((t,e)=>{"use strict";y();var n=px(),r=cx();e.exports=l((function(){var t=n();return r(Object,{is:t},{is:l((function(){return Object.is!==t}),"testObjectIs")}),t}),"shimObjectIs")})),gk=fe(((t,e)=>{"use strict";y();var n=cx(),r=Zg(),i=fx(),o=px(),s=fk(),a=r(o(),Object);n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),bk=fe(((t,e)=>{"use strict";y();var n,r,i,o,s=sx(),a=ex()();a&&(n=s("Object.prototype.hasOwnProperty"),r=s("RegExp.prototype.exec"),i={},u=l((function(){throw i}),"throwRegexMarker"),o={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(o[Symbol.toPrimitive]=u));var u,c=s("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;e.exports=l(a?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{r(t,o)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===c(t)},"isRegex")})),wk=fe(((t,e)=>{"use strict";y(),e.exports=l((function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e||"[object Symbol]"!==Object.prototype.toString.call(e)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),"hasSymbols")})),Ik=fe(((t,e)=>{"use strict";y();var n=typeof Symbol<"u"&&Symbol,r=wk();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),Ok=fe(((t,e)=>{"use strict";y();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch{}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch{a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch{try{return a(arguments,"callee").get}catch{return u}}}():u,h=Ik()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d=typeof Uint8Array>"u"?n:p(Uint8Array),g={"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h?n:p((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h?n:p((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet},v=l((function t(e){var n;if("%AsyncFunction%"===e)n=s("async function () {}");else if("%GeneratorFunction%"===e)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=s("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=p(i.prototype))}return g[e]=n,n}),"doEval"),m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=Rp(),b=rx(),w=_.call(Function.call,Array.prototype.concat),x=_.call(Function.apply,Array.prototype.splice),E=_.call(Function.call,String.prototype.replace),I=_.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,M=l((function(t){var e=I(t,0,1),n=I(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var i=[];return E(t,S,(function(t,e,n,r){i[i.length]=n?E(r,N,"$1"):e||t})),i}),"stringToPath"),C=l((function(t,e){var n,i=t;if(b(m,i)&&(i="%"+(n=m[i])[0]+"%"),b(g,i)){var s=g[i];if(s===f&&(s=v(i)),typeof s>"u"&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new r("intrinsic "+t+" does not exist!")}),"getBaseIntrinsic");e.exports=l((function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');var n=M(t),i=n.length>0?n[0]:"",s=C("%"+i+"%",e),l=s.name,u=s.value,c=!1,h=s.alias;h&&(i=h[0],x(n,w([0,1],h)));for(var p=1,f=!0;p<n.length;p+=1){var d=n[p],y=I(d,0,1),v=I(d,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new r("property names with quotes must have matching quotes");if(("constructor"===d||!f)&&(c=!0),b(g,l="%"+(i+="."+d)+"%"))u=g[l];else if(null!=u){if(!(d in u)){if(!e)throw new o("base intrinsic for "+t+" exists, but the property is not available.");return}if(a&&p+1>=n.length){var m=a(u,d);u=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[d]}else f=b(u,d),u=u[d];f&&!c&&(g[l]=u)}}return u}),"GetIntrinsic")})),Tk=fe(((t,e)=>{"use strict";y();var n=Ok()("%Object.defineProperty%",!0),r=l((function(){if(n)try{return n({},"a",{value:1}),!0}catch{return!1}return!1}),"hasPropertyDescriptors");r.hasArrayLengthDefineBug=l((function(){if(!r())return null;try{return 1!==n([],"length",{value:1}).length}catch{return!0}}),"hasArrayLengthDefineBug"),e.exports=r})),im=fe(((t,e)=>{"use strict";y();var n=Hg(),r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,a=l((function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}),"isFunction"),u=Tk()(),c=s&&u,h=l((function(t,e,n,r){if(e in t)if(!0===r){if(t[e]===n)return}else if(!a(r)||!r())return;c?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n}),"defineProperty"),p=l((function(t,e){var i=arguments.length>2?arguments[2]:{},s=n(e);r&&(s=o.call(s,Object.getOwnPropertySymbols(e)));for(var a=0;a<s.length;a+=1)h(t,s[a],e[s[a]],i[s[a]])}),"defineProperties");p.supportsDescriptors=!!c,e.exports=p})),Bk=fe(((t,e)=>{"use strict";y();var n=l((function(){return"string"==typeof l((function(){}),"f").name}),"functionsHaveNames"),r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch{r=null}n.functionsHaveConfigurableNames=l((function(){if(!n()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable}),"functionsHaveConfigurableNames");var i=Function.prototype.bind;n.boundFunctionsHaveNames=l((function(){return n()&&"function"==typeof i&&""!==l((function(){}),"f").bind().name}),"boundFunctionsHaveNames"),e.exports=n})),xx=fe(((t,e)=>{"use strict";y();var n=Bk().functionsHaveConfigurableNames(),r=Object,i=TypeError;e.exports=l((function(){if(null!=this&&this!==r(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"flags"),n&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})})),wx=fe(((t,e)=>{"use strict";y();var n=xx(),r=im().supportsDescriptors,i=Object.getOwnPropertyDescriptor;e.exports=l((function(){if(r&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}),"getPolyfill")})),Gk=fe(((t,e)=>{"use strict";y();var n=im().supportsDescriptors,r=wx(),i=Object.getOwnPropertyDescriptor,o=Object.defineProperty,s=TypeError,a=Object.getPrototypeOf,u=/a/;e.exports=l((function(){if(!n||!a)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r(),e=a(u),l=i(e,"flags");return(!l||l.get!==t)&&o(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}),"shimFlags")})),Yk=fe(((t,e)=>{"use strict";y();var n=im(),r=Zg(),i=xx(),o=wx(),s=Gk(),a=r(o());n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),Hk=fe(((t,e)=>{"use strict";y();var n=Date.prototype.getDay,r=l((function(t){try{return n.call(t),!0}catch{return!1}}),"tryDateGetDayCall"),i=Object.prototype.toString,o="function"==typeof Symbol&&!!Symbol.toStringTag;e.exports=l((function(t){return"object"==typeof t&&null!==t&&(o?r(t):"[object Date]"===i.call(t))}),"isDateObject")})),Ex=fe(((t,e)=>{y();var n=Hg(),r=nk(),i=gk(),o=bk(),s=Yk(),a=Hk(),u=Date.prototype.getTime;function c(t,e,n){var r=n||{};return!!(r.strict?i(t,e):t===e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?i(t,e):t==e:f(t,e,r))}function h(t){return null==t}function p(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}function f(t,e,i){var l,f;if(typeof t!=typeof e||h(t)||h(e)||t.prototype!==e.prototype||r(t)!==r(e))return!1;var d=o(t),g=o(e);if(d!==g)return!1;if(d||g)return t.source===e.source&&s(t)===s(e);if(a(t)&&a(e))return u.call(t)===u.call(e);var y=p(t),v=p(e);if(y!==v)return!1;if(y||v){if(t.length!==e.length)return!1;for(l=0;l<t.length;l++)if(t[l]!==e[l])return!1;return!0}if(typeof t!=typeof e)return!1;try{var m=n(t),_=n(e)}catch{return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),l=m.length-1;l>=0;l--)if(m[l]!=_[l])return!1;for(l=m.length-1;l>=0;l--)if(!c(t[f=m[l]],e[f],i))return!1;return!0}l(c,"deepEqual"),l(h,"isUndefinedOrNull"),l(p,"isBuffer"),l(f,"objEquiv"),e.exports=c})),Rx=fe(((t,e)=>{y();var n=Ex(),r=l((function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:s}),"Equality");function i(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function o(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function s(t,e){return n(t,e,{strict:!0})}r.prototype.compare=function(t,e){if(t.type!==e.type||!o(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=i(t),s=i(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),s)}}return!1},l(i,"explode"),l(o,"sameLength"),r.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},r.prototype.compareLine=function(t,e,n,r){if(!o(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],s[0])||(s=this.fixStartIndex(s,i))){var a=this.compareCoord(i[n],s[n]);return this.direction||a?this.comparePath(i,s):!!this.compareCoord(i[n],s[s.length-(1+n)])&&this.comparePath(i.slice().reverse(),s)}},r.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},r.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},r.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},r.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},r.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},r.prototype.removePseudo=function(t){return t},l(s,"objectComparator"),e.exports=r})),hO=fe(((t,e)=>{function n(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}y(),l(n,"DBSCAN"),n.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(i,s),this._expandCluster(s,o)}}return this.clusters},n.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},n.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},n.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},n.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++){this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n)}return e},n.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},n.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=n)})),dO=fe(((t,e)=>{function n(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}y(),l(n,"KMEANS"),n.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],typeof t<"u"&&(this.dataset=t),typeof e<"u"&&(this.k=e),typeof n<"u"&&(this.distance=n)},n.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(c),a=0,l=0;l<c;l++)s[l]=0;for(var u=0;u<n;u++){var c=this.dataset[u].length;if(o===this.assignments[u]){for(l=0;l<c;l++)s[l]+=this.dataset[u][l];a++}}if(a>0){for(l=0;l<c;l++)s[l]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},n.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},n.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},n.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)typeof e[t=this.assignments[n]]>"u"&&(e[t]=[]),e[t].push(n);return e},n.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(r=n(t,e[a]))<i&&(i=r,o=a);return o},n.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=n)})),Dx=fe(((t,e)=>{function n(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}y(),l(n,"PriorityQueue"),n.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},n.prototype.remove=function(t){for(var e=this._queue.length;e--;){if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}}},n.prototype.forEach=function(t){this._queue.forEach(t)},n.prototype.getElements=function(){return this._queue},n.prototype.getElementPriority=function(t){return this._priorities[t]},n.prototype.getPriorities=function(){return this._priorities},n.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},n.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},n.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},typeof e<"u"&&e.exports&&(e.exports=n)})),mO=fe(((t,e)=>{var n;function r(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}y(),typeof e<"u"&&e.exports&&(n=Dx()),l(r,"OPTICS"),r.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var l=new n(null,null,"asc"),u=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,u,l),this._expandCluster(a,l))}return this.clusters},r.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},r.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},r.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},r.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},r.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++){if(this._regionQuery(t,n).length>=this.minPts)return n}},r.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},r.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},typeof e<"u"&&e.exports&&(e.exports=r)})),yO=fe(((t,e)=>{y(),typeof e<"u"&&e.exports&&(e.exports={DBSCAN:hO(),KMEANS:dO(),OPTICS:mO(),PriorityQueue:Dx()})})),Fx=fe(((t,e)=>{"use strict";y(),e.exports={eudist:l((function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i}),"eudist"),mandist:l((function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i}),"mandist"),dist:l((function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}),"dist")}})),wO=fe(((t,e)=>{"use strict";y();var n=Fx(),r=n.eudist,i=n.dist;e.exports={kmrand:l((function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],l=s?a.join("_"):""+a;n[l]||(n[l]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r}),"kmrand"),kmpp:l((function(t,e){var n=t[0].length?r:i,o=[],s=t.length,a=t[0].length>0,l=t[Math.floor(Math.random()*s)];a&&l.join("_");for(o.push(l);o.length<e;){for(var u=[],c=o.length,h=0,p=[],f=0;f<s;f++){for(var d=1/0,g=0;g<c;g++){var y=n(t[f],o[g]);y<=d&&(d=y)}u[f]=d}for(var v=0;v<s;v++)h+=u[v];for(var m=0;m<s;m++)p[m]={i:m,v:t[m],pr:u[m]/h,cs:0};p.sort((function(t,e){return t.pr-e.pr})),p[0].cs=p[0].pr;for(var _=1;_<s;_++)p[_].cs=p[_-1].cs+p[_].pr;for(var b=Math.random(),w=0;w<s-1&&p[w++].cs<b;);o.push(p[w-1].v)}return o}),"kmpp")}})),SO=fe(((t,e)=>{"use strict";y();var n=Fx(),r=wO(),i=n.eudist,o=(n.mandist,n.dist,r.kmrand),s=r.kmpp;function a(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}function u(t,e,n,r){var l=[],u=[],c=[],h=[],p=!1,f=r||1e4,d=t.length,g=t[0].length,y=g>0,v=[];if(n)l="kmrand"==n?o(t,e):"kmpp"==n?s(t,e):n;else for(var m={};l.length<e;){var _=Math.floor(Math.random()*d);m[_]||(m[_]=!0,l.push(t[_]))}do{a(e,0,v);for(var b=0;b<d;b++){for(var w=1/0,x=0,E=0;E<e;E++){(h=y?i(t[b],l[E]):Math.abs(t[b]-l[E]))<=w&&(w=h,x=E)}c[b]=x,v[x]++}for(var I=[],S=(u=[],0);S<e;S++)I[S]=y?a(g,0,I[S]):0,u[S]=l[S];if(y){for(var N=0;N<e;N++)l[N]=[];for(var M=0;M<d;M++)for(var C=I[c[M]],O=t[M],P=0;P<g;P++)C[P]+=O[P];p=!0;for(var A=0;A<e;A++){for(var D=l[A],T=I[A],L=u[A],R=v[A],F=0;F<g;F++)D[F]=T[F]/R||0;if(p)for(var k=0;k<g;k++)if(L[k]!=D[k]){p=!1;break}}}else{for(var B=0;B<d;B++){I[c[B]]+=t[B]}for(var j=0;j<e;j++)l[j]=I[j]/v[j]||0;p=!0;for(var G=0;G<e;G++)if(u[G]!=l[G]){p=!1;break}}p=p||--f<=0}while(!p);return{it:1e4-f,k:e,idxs:c,centroids:l}}l(a,"init"),l(u,"skmeans"),e.exports=u})),jl=fe(((t,e)=>{var n,r;y(),n=t,r=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}l(t,"_classCallCheck"),l(e,"_defineProperties"),l(n,"_createClass");var r=function(){function t(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return l(t,"Node"),t}();function i(t,e){return t>e?1:t<e?-1:0}function o(t,e,n){for(var i=new r(null,null),o=i,s=i;;){var a=n(t,e.key);if(a<0){if(null===e.left)break;if(n(t,e.left.key)<0){var l=e.left;if(e.left=l.right,l.right=e,null===(e=l).left)break}s.left=e,s=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(n(t,e.right.key)>0&&(l=e.right,e.right=l.left,l.left=e,null===(e=l).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,s.left=e.right,e.left=i.right,e.right=i.left,e}function s(t,e,n,i){var s=new r(t,e);if(null===n)return s.left=s.right=null,s;var a=i(t,(n=o(t,n,i)).key);return a<0?(s.left=n.left,s.right=n,n.left=null):a>=0&&(s.right=n.right,s.left=n,n.right=null),s}function a(t,e,n){var r=null,i=null;if(e){var s=n((e=o(t,e,n)).key,t);0===s?(r=e.left,i=e.right):s<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function u(t,e,n){return null===e?t:(null===t||((e=o(t.key,e,n)).left=t),e)}function c(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&c(t.left,o,!1,r,i),t.right&&c(t.right,o,!0,r,i)}}l(i,"DEFAULT_COMPARE"),l(o,"splay"),l(s,"insert"),l(a,"split"),l(u,"merge"),l(c,"printRow");var h=function(){function t(t){void 0===t&&(t=i),this._root=null,this._size=0,this._comparator=t}return l(t,"Tree"),t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var n=new r(t,e);null===this._root&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,s=o(t,this._root,i),a=i(t,s.key);return 0===a?this._root=s:(a<0?(n.left=s.left,n.right=s,s.left=null):a>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,n){var r;return null===e?null:0===n(t,(e=o(t,e,n)).key)?(null===e.left?r=e.right:(r=o(t,e.left,n)).right=e.right,this._size--,r):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=o(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=o(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},t.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},t.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return d(this._root)},t.prototype.load=function(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=!1);var r=t.length,i=this._comparator;if(n&&v(t,e,0,r-1,i),null===this._root)this._root=p(t,e,0,r),this._size=r;else{var o=y(this.toList(),f(t,e),i);r=this._size+r,this._root=g({head:o},0,r)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:l((function(){return this._size}),"get"),enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:l((function(){return this._root}),"get"),enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=l((function(t){return String(t.key)}),"printNode"));var e=[];return c(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,n){var r=this._comparator,i=a(t,this._root,r),o=i.left,l=i.right;r(t,e)<0?l=s(e,n,l,r):o=s(e,n,o,r),this._root=u(o,l,r)},t.prototype.split=function(t){return a(t,this._root,this._comparator)},t}();function p(t,e,n,i){var o=i-n;if(o>0){var s=n+Math.floor(o/2),a=t[s],l=e[s],u=new r(a,l);return u.left=p(t,e,n,s),u.right=p(t,e,s+1,i),u}return null}function f(t,e){for(var n=new r(null,null),i=n,o=0;o<t.length;o++)i=i.next=new r(t[o],e[o]);return i.next=null,n.next}function d(t){for(var e=t,n=[],i=!1,o=new r(null,null),s=o;!i;)e?(n.push(e),e=e.left):n.length>0?e=(e=s=s.next=n.pop()).right:i=!0;return s.next=null,o.next}function g(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=g(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=g(t,i+1,n),s}return null}function y(t,e,n){for(var i=new r(null,null),o=i,s=t,a=e;null!==s&&null!==a;)n(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}function v(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}v(t,e,n,a,i),v(t,e,a+1,r,i)}}l(p,"loadRecursive"),l(f,"createList"),l(d,"toList"),l(g,"sortedListToBST"),l(y,"mergeLists"),l(v,"sort");var m=l((function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y}),"isInBbox"),_=l((function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}}),"getBboxOverlap"),b=Number.EPSILON;void 0===b&&(b=Math.pow(2,-52));var w=b*b,x=l((function(t,e){if(-b<t&&t<b&&-b<e&&e<b)return 0;var n=t-e;return n*n<w*t*e?0:t<e?-1:1}),"cmp"),E=function(){function e(){t(this,e),this.reset()}return l(e,"PtRounder"),n(e,[{key:"reset",value:l((function(){this.xRounder=new I,this.yRounder=new I}),"reset")},{key:"round",value:l((function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}),"round")}]),e}(),I=function(){function e(){t(this,e),this.tree=new h,this.round(0)}return l(e,"CoordRounder"),n(e,[{key:"round",value:l((function(t){var e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===x(e.key,n.key))return this.tree.remove(t),n.key;var r=this.tree.next(e);return null!==r&&0===x(e.key,r.key)?(this.tree.remove(t),r.key):t}),"round")}]),e}(),S=new E,N=l((function(t,e){return t.x*e.y-t.y*e.x}),"crossProduct"),M=l((function(t,e){return t.x*e.x+t.y*e.y}),"dotProduct"),O=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y},o=N(r,i);return x(o,0)}),"compareVectorAngles"),P=l((function(t){return Math.sqrt(M(t,t))}),"length"),A=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return N(i,r)/P(i)/P(r)}),"sineOfAngle"),D=l((function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return M(i,r)/P(i)/P(r)}),"cosineOfAngle"),T=l((function(t,e,n){return 0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n}}),"horizontalIntersection"),L=l((function(t,e,n){return 0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}}),"verticalIntersection"),R=l((function(t,e,n,r){if(0===e.x)return L(n,r,t.x);if(0===r.x)return L(t,e,n.x);if(0===e.y)return T(n,r,t.y);if(0===r.y)return T(t,e,n.y);var i=N(e,r);if(0==i)return null;var o={x:n.x-t.x,y:n.y-t.y},s=N(o,e)/i,a=N(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}}),"intersection"),F=function(){function e(n,r){t(this,e),void 0===n.events?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=r}return n(e,null,[{key:"compare",value:l((function(t,n){var r=e.comparePoints(t.point,n.point);return 0!==r?r:(t.point!==n.point&&t.link(n),t.isLeft!==n.isLeft?t.isLeft?1:-1:B.compare(t.segment,n.segment))}),"compare")},{key:"comparePoints",value:l((function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}),"comparePoints")}]),l(e,"SweepEvent"),n(e,[{key:"link",value:l((function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}),"link")},{key:"checkForConsuming",value:l((function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment)}}}),"checkForConsuming")},{key:"getAvailableLinkedEvents",value:l((function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}),"getAvailableLinkedEvents")},{key:"getLeftmostComparator",value:l((function(t){var e=this,n=new Map,r=l((function(r){var i=r.otherSE;n.set(r,{sine:A(e.point,t.point,i.point),cosine:D(e.point,t.point,i.point)})}),"fillCache");return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,s=i.cosine,a=n.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}),"getLeftmostComparator")}]),e}(),k=0,B=function(){function e(n,r,i,o){t(this,e),this.id=++k,this.leftSE=n,n.segment=this,n.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=n,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:l((function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(n<r){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var c=t.comparePoint(e.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n>r){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){var d=e.comparePoint(t.rightSE.point);if(0!==d)return d}if(i>o){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var y=l-s,v=i-n,m=u-a,_=o-r;if(y>v&&m<_)return 1;if(y<v&&m>_)return-1}return i>o?1:i<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}),"compare")}]),l(e,"Segment"),n(e,[{key:"replaceRightSE",value:l((function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}),"replaceRightSE")},{key:"bbox",value:l((function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}),"bbox")},{key:"vector",value:l((function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}),"vector")},{key:"isAnEndpoint",value:l((function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}),"isAnEndpoint")},{key:"comparePoint",value:l((function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;var i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;var s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}),"comparePoint")},{key:"getIntersection",value:l((function(t){var e=this.bbox(),n=t.bbox(),r=_(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=m(e,s)&&0===this.comparePoint(s),u=m(n,i)&&0===t.comparePoint(i),c=m(e,a)&&0===this.comparePoint(a),h=m(n,o)&&0===t.comparePoint(o);if(u&&l)return h&&!c?o:!h&&c?a:null;if(u)return c&&i.x===a.x&&i.y===a.y?null:i;if(l)return h&&o.x===s.x&&o.y===s.y?null:s;if(h&&c)return null;if(h)return o;if(c)return a;var p=R(i,this.vector(),s,t.vector());return null!==p&&m(r,p)?S.round(p.x,p.y):null}),"getIntersection")},{key:"split",value:l((function(t){var n=[],r=void 0!==t.events,i=new F(t,!0),o=new F(t,!1),s=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var a=new e(i,s,this.rings.slice(),this.windings.slice());return F.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),F.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}),"split")},{key:"swapEvents",value:l((function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}),"swapEvents")},{key:"consume",value:l((function(t){for(var n=this,r=t;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=e.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,l=r.rings.length;a<l;a++){var u=r.rings[a],c=r.windings[a],h=n.rings.indexOf(u);-1===h?(n.rings.push(u),n.windings.push(c)):n.windings[h]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}),"consume")},{key:"prevInResult",value:l((function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}),"prevInResult")},{key:"beforeState",value:l((function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}),"beforeState")},{key:"afterState",value:l((function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var s=this.rings[i],a=this.windings[i],l=e.indexOf(s);-1===l?(e.push(s),n.push(a)):n[l]+=a}for(var u=[],c=[],h=0,p=e.length;h<p;h++)if(0!==n[h]){var f=e[h],d=f.poly;if(-1===c.indexOf(d))if(f.isExterior)u.push(d);else{-1===c.indexOf(d)&&c.push(d);var g=u.indexOf(f.poly);-1!==g&&u.splice(g,1)}}for(var y=0,v=u.length;y<v;y++){var m=u[y].multiPoly;-1===r.indexOf(m)&&r.push(m)}return this._afterState}),"afterState")},{key:"isInResult",value:l((function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(J.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===J.numMultiPolys&&i<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=l((function(t){return 1===t.length&&t[0].isSubject}),"isJustSubject");this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(J.type))}return this._isInResult}),"isInResult")}],[{key:"fromRing",value:l((function(t,n,r){var i,o,s,a=F.comparePoints(t,n);if(a<0)i=t,o=n,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=n,o=t,s=-1}return new e(new F(i,!0),new F(o,!1),[r],[s])}),"fromRing")}]),e}(),j=function(){function e(n,r,i){if(t(this,e),!Array.isArray(n)||0===n.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],"number"!=typeof n[0][0]||"number"!=typeof n[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=S.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=n.length;a<l;a++){if("number"!=typeof n[a][0]||"number"!=typeof n[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=S.round(n[a][0],n[a][1]);u.x===s.x&&u.y===s.y||(this.segments.push(B.fromRing(s,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),s=u)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(B.fromRing(s,o,this))}return l(e,"RingIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}),"getSweepEvents")}]),e}(),G=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new j(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,o=n.length;i<o;i++){var s=new j(n[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=r}return l(e,"PolyIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}),"getSweepEvents")}]),e}(),z=function(){function e(n,r){if(t(this,e),!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof n[0][0][0]&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,o=n.length;i<o;i++){var s=new G(n[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=r}return l(e,"MultiPolyIn"),n(e,[{key:"getSweepEvents",value:l((function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}),"getSweepEvents")}]),e}(),U=function(){function e(n){t(this,e),this.events=n;for(var r=0,i=n.length;r<i;r++)n[r].segment.ringOut=this;this.poly=null}return n(e,null,[{key:"factory",value:l((function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],c=a.point,h=[];s=a,a=l,u.push(a),a.point!==c;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var f=u[0].point,d=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(f.x,",")+" ".concat(f.y,"]. Last matching segment found ends at")+" [".concat(d.x,", ").concat(d.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var g=null,y=0,v=h.length;y<v;y++)if(h[y].point===a.point){g=y;break}if(null===g){h.push({index:u.length,point:a.point});var m=a.getLeftmostComparator(s);l=p.sort(m)[0].otherSE;break}var _=h.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),n.push(new e(b.reverse()))}n.push(new e(u))}}return n}),"factory")}]),l(e,"RingOut"),n(e,[{key:"getGeom",value:l((function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==O(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var s=e[0],a=e[1];0===O(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,h=[],p=u;p!=c;p+=l)h.push([e[p].x,e[p].y]);return h}),"getGeom")},{key:"isExteriorRing",value:l((function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}),"isExteriorRing")},{key:"enclosingRing",value:l((function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}),"enclosingRing")},{key:"_calcEnclosingRing",value:l((function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];F.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}),"_calcEnclosingRing")}]),e}(),q=function(){function e(n){t(this,e),this.exteriorRing=n,n.poly=this,this.interiorRings=[]}return l(e,"PolyOut"),n(e,[{key:"addInterior",value:l((function(t){this.interiorRings.push(t),t.poly=this}),"addInterior")},{key:"getGeom",value:l((function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,n=this.interiorRings.length;e<n;e++){var r=this.interiorRings[e].getGeom();null!==r&&t.push(r)}return t}),"getGeom")}]),e}(),V=function(){function e(n){t(this,e),this.rings=n,this.polys=this._composePolys(n)}return l(e,"MultiPolyOut"),n(e,[{key:"getGeom",value:l((function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}),"getGeom")},{key:"_composePolys",value:l((function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new q(i));else{var o=i.enclosingRing();o.poly||e.push(new q(o)),o.poly.addInterior(i)}}return e}),"_composePolys")}]),e}(),Y=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B.compare;t(this,e),this.queue=n,this.tree=new h(r),this.segments=[]}return l(e,"SweepLine"),n(e,[{key:"process",value:l((function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,s=void 0,a=void 0;void 0===s;)null===(i=this.tree.prev(i))?s=null:void 0===i.key.consumedBy&&(s=i.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var c=this._splitSafely(s,u),h=0,p=c.length;h<p;h++)n.push(c[h])}var f=null;if(a){var d=a.getIntersection(e);if(null!==d&&(e.isAnEndpoint(d)||(f=d),!a.isAnEndpoint(d)))for(var g=this._splitSafely(a,d),y=0,v=g.length;y<v;y++)n.push(g[y])}if(null!==l||null!==f){var m=null;m=null===l?f:null===f||F.comparePoints(l,f)<=0?l:f,this.queue.remove(e.rightSE),n.push(e.rightSE);for(var _=e.split(m),b=0,w=_.length;b<w;b++)n.push(_[b])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var x=s.getIntersection(a);if(null!==x){if(!s.isAnEndpoint(x))for(var E=this._splitSafely(s,x),I=0,S=E.length;I<S;I++)n.push(E[I]);if(!a.isAnEndpoint(x))for(var N=this._splitSafely(a,x),M=0,C=N.length;M<C;M++)n.push(N[M])}}this.tree.remove(e)}return n}),"process")},{key:"_splitSafely",value:l((function(t,e){this.tree.remove(t);var n=t.rightSE;this.queue.remove(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.insert(t),r}),"_splitSafely")}]),e}(),X=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,W=typeof C<"u"&&C.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,J=new(function(){function e(){t(this,e)}return l(e,"Operation"),n(e,[{key:"run",value:l((function(t,e,n){J.type=t,S.reset();for(var r=[new z(e,!0)],i=0,o=n.length;i<o;i++)r.push(new z(n[i],!1));if(J.numMultiPolys=r.length,"difference"===J.type)for(var s=r[0],a=1;a<r.length;)null!==_(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===J.type)for(var l=0,u=r.length;l<u;l++)for(var c=r[l],p=l+1,f=r.length;p<f;p++)if(null===_(c.bbox,r[p].bbox))return[];for(var d=new h(F.compare),g=0,y=r.length;g<y;g++)for(var v=r[g].getSweepEvents(),m=0,b=v.length;m<b;m++)if(d.insert(v[m]),d.size>X)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var w=new Y(d),x=d.size,E=d.pop();E;){var I=E.key;if(d.size===x){var N=I.segment;throw new Error("Unable to pop() ".concat(I.isLeft?"left":"right"," SweepEvent ")+"[".concat(I.point.x,", ").concat(I.point.y,"] from segment #").concat(N.id," ")+"[".concat(N.leftSE.point.x,", ").concat(N.leftSE.point.y,"] -> ")+"[".concat(N.rightSE.point.x,", ").concat(N.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>X)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(w.segments.length>W)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var M=w.process(I),C=0,O=M.length;C<O;C++){var P=M[C];void 0===P.consumedBy&&d.insert(P)}x=d.size,E=d.pop()}S.reset();var A=U.factory(w.segments);return new V(A).getGeom()}),"run")}]),e}()),H=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("union",t,n)}),"union"),Z=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("intersection",t,n)}),"intersection"),K=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("xor",t,n)}),"xor"),$=l((function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return J.run("difference",t,n)}),"difference");return{union:H,intersection:Z,xor:K,difference:$}},"object"==typeof t&&typeof e<"u"?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=typeof globalThis<"u"?globalThis:n||self).polygonClipping=r()})),YO=fe(((t,e)=>{var n,r;y(),n=t,r=function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Rt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function h(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function f(){}function d(){this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}function g(){}function y(t){this.message=t||""}function v(){this.array_=[]}l(e,"e"),l(n,"n"),l(r,"i"),l(i,"r"),l(o,"o"),l(s,"s"),l(a,"a"),l(u,"u"),l(c,"l"),l(h,"c"),l(p,"p"),l(f,"h"),l(d,"f"),l(g,"g"),l(y,"d"),l(v,"y"),"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 i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)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 m=l((function(){}),"_");m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.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 l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),b=l((function(){}),"v"),w={MAX_VALUE:{configurable:!0}};b.isNaN=function(t){return Number.isNaN(t)},b.doubleToLongBits=function(t){return t},b.longBitsToDouble=function(t){return t},b.isInfinite=function(t){return!Number.isFinite(t)},w.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(b,w);var x=l((function(){}),"E"),E=l((function(){}),"x"),I=l((function(){}),"N"),S=l((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])}),"t"),N={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};S.prototype.setOrdinate=function(t,e){switch(t){case S.X:this.x=e;break;case S.Y:this.y=e;break;case S.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},S.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!!m.equalsWithTolerance(this.x,e.x,n)&&!!m.equalsWithTolerance(this.y,e.y,n)}},S.prototype.getOrdinate=function(t){switch(t){case S.X:return this.x;case S.Y:return this.y;case S.Z:return this.z}throw new _("Invalid ordinate index: "+t)},S.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||b.isNaN(this.z))&&b.isNaN(t.z)},S.prototype.equals=function(t){return t instanceof S&&this.equals2D(t)},S.prototype.equalInZ=function(t,e){return m.equalsWithTolerance(this.z,t.z,e)},S.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},S.prototype.clone=function(){},S.prototype.copy=function(){return new S(this)},S.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},S.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)},S.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},S.prototype.hashCode=function(){var t=17;return 37*(t=37*t+S.hashCode(this.x))+S.hashCode(this.y)},S.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},S.prototype.interfaces_=function(){return[x,E,e]},S.prototype.getClass=function(){return S},S.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=b.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},N.DimensionalComparator.get=function(){return M},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return b.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(S,N);var M=l((function(t){if(this._dimensionsToTest=2,0!==arguments.length&&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}}),"L");M.prototype.compare=function(t,e){var n=t,r=e,i=M.compare(n.x,r.x);if(0!==i)return i;var o=M.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:M.compare(n.z,r.z)},M.prototype.interfaces_=function(){return[I]},M.prototype.getClass=function(){return M},M.compare=function(t,e){return t<e?-1:t>e?1:b.isNaN(t)?b.isNaN(e)?0:-1:b.isNaN(e)?1:0};var C=l((function(){}),"b");C.prototype.create=function(){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C};var O=l((function(){}),"w"),P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new _("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(O,P);var A=l((function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),"T"),D=l((function(){}),"R"),T={LOG_10:{configurable:!0}};D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.log10=function(t){var e=Math.log(t);return b.isInfinite(e)||b.isNaN(e)?e:e/D.LOG_10},D.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},D.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],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},D.wrap=function(t,e){return t<0?e- -t%e:t%e},D.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],l=i;return o>l&&(l=o),s>l&&(l=s),a>l&&(l=a),l}},D.average=function(t,e){return(t+e)/2},T.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(D,T);var L=l((function(t){this.str=t}),"D");L.prototype.append=function(t){this.str+=t},L.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},L.prototype.toString=function(t){return this.str};var R=l((function(t){this.value=t}),"M");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 F=l((function(){}),"A");F.isWhitespace=function(t){return t<=32&&t>=0||127===t},F.toUpperCase=function(t){return t.toUpperCase()};var k=l((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 if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}),"t"),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),i=k.TEN.pow(r);(n=n.divide(i)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var o=r+1,s=new L,a=k.MAX_PRINT_DIGITS-1,l=0;l<=a;l++){t&&l===o&&s.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,h=0;u>9?(c=!0,h="9"):h="0"+u,s.append(h),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var p=!0,f=k.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-l&&(p=!1),!p)break}return e[0]=r,s.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],i=null,o=null,s=null,a=null,l=null,u=null,c=null,h=null;return l=this._hi/n,h=(i=(u=k.SPLIT*l)-(i=u-l))*(s=(h=k.SPLIT*n)-(s=h-n))-(c=l*n)+i*(a=n-s)+(o=l-i)*s+o*a,h=l+(u=(this._hi-c-h+this._lo-l*r)/n),this._hi=h,this._lo=l-h+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,i=null,o=null,s=null,a=null,l=null;return n=(o=this._hi/t._hi)-(e=(s=k.SPLIT*o)-(e=s-o)),l=e*(r=(l=k.SPLIT*t._hi)-(r=l-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-l+this._lo-o*t._lo)/t._hi,new k(l=o+s,o-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return b.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,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var l=arguments[0],u=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,y=null;f=this._hi+l,h=this._lo+u,d=f-(g=f-this._hi),p=h-(y=h-this._lo);var v=(c=f+(g=(d=l-g+(this._hi-d))+h))+(g=(p=u-y+(this._lo-p))+(g+(f-c))),m=g+(c-v);return this._hi=v,this._lo=m,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],i=null,o=null,s=null,a=null,l=null,u=null;i=(l=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,i=l-i,o=this._hi-i,s=u-n;var c=(l=this._hi*n)+(u=i*(s=u-s)-l+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=u+(i=l-c);return this._hi=c,this._lo=h,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 b.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return b.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,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+k.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},k.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=k.SPLIT*n)-(i=s-n)),o=(a=k.SPLIT*this._hi)-this._hi;var l=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new k(l,n-l+s)},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 i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+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,x,E]},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]){var e=arguments[0];return new k(e)}},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;F.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new k,s=0,a=0,l=0;!(e>=n);){var u=t.charAt(e);if(e++,F.isDigit(u)){var c=u-"0";o.selfMultiply(k.TEN),o.selfAdd(c),s++}else{if("."!==u){if("e"===u||"E"===u){var h=t.substring(e);try{l=R.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-l;if(0===f)p=o;else if(f>0){var d=k.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=k.TEN.pow(-f);p=o.multiply(g)}return r?p.negate():p},k.createNaN=function(){return new k(b.NaN,b.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 L,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(b.NaN,b.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 j=l((function(){}),"q"),G={DP_SAFE_EPSILON:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(t,e,n){var r=j.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=k.valueOf(e.x).selfAdd(-t.x),o=k.valueOf(e.y).selfAdd(-t.y),s=k.valueOf(n.x).selfAdd(-e.x),a=k.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},j.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},j.intersection=function(t,e,n,r){var i=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),o=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),l=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=a.subtract(l).selfDivide(s).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),h=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),p=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),d=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new S(c,d)},j.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return j.signum(s);r=i+o}else{if(!(i<0)||o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,G);var z=l((function(){}),"V"),U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},z.prototype.setOrdinate=function(t,e,n){},z.prototype.size=function(){},z.prototype.getOrdinate=function(t,e){},z.prototype.getCoordinate=function(){},z.prototype.getCoordinateCopy=function(t){},z.prototype.getDimension=function(){},z.prototype.getX=function(t){},z.prototype.clone=function(){},z.prototype.expandEnvelope=function(t){},z.prototype.copy=function(){},z.prototype.getY=function(t){},z.prototype.toCoordinateArray=function(){},z.prototype.interfaces_=function(){return[E]},z.prototype.getClass=function(){return z},Object.defineProperties(z,U);var q=l((function(){}),"z"),V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return l(e,"e"),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}(q),Y=l((function(){}),"Y");Y.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},Y.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=l((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 i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof S&&arguments[1]instanceof S){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2];this.x=l,this.y=u,this.w=c}else if(4===arguments.length){var h=arguments[0],p=arguments[1],f=arguments[2],d=arguments[3],g=h.y-p.y,y=p.x-h.x,v=h.x*p.y-p.x*h.y,m=f.y-d.y,_=d.x-f.x,b=f.x*d.y-d.x*f.y;this.x=y*b-_*v,this.y=m*v-g*b,this.w=g*_-m*y}}),"t");X.prototype.getY=function(){var t=this.y/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},X.prototype.getX=function(){var t=this.x/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},X.prototype.getCoordinate=function(){var t=new S;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,l=r.x-n.x,u=n.x*r.y-r.x*n.y,c=i*l-a*o,h=(o*u-l*s)/c,p=(a*s-i*u)/c;if(b.isNaN(h)||b.isInfinite(h)||b.isNaN(p)||b.isInfinite(p))throw new V;return new S(h,p)};var W=l((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 S){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],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3];this.init(o,s,a,l)}}),"t"),J={serialVersionUID:{configurable:!0}};W.prototype.getArea=function(){return this.getWidth()*this.getHeight()},W.prototype.equals=function(t){if(!(t instanceof W))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()},W.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new W;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,i=this._maxy<t._maxy?this._maxy:t._maxy;return new W(e,r,n,i)},W.prototype.isNull=function(){return this._maxx<this._minx},W.prototype.getMaxX=function(){return this._maxx},W.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof W){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}},W.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof W){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 S){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)}},W.prototype.getMinY=function(){return this._miny},W.prototype.getMinX=function(){return this._minx},W.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof W){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))}},W.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},W.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},W.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},W.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},W.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},W.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},W.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},W.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},W.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()}},W.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof W){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof S){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)}},W.prototype.centre=function(){return this.isNull()?null:new S((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},W.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof W){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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},W.prototype.getMaxY=function(){return this._maxy},W.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)},W.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+S.hashCode(this._minx))+S.hashCode(this._maxx))+S.hashCode(this._miny))+S.hashCode(this._maxy)},W.prototype.interfaces_=function(){return[x,e]},W.prototype.getClass=function(){return W},W.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],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),l=Math.max(o.x,s.x),u=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u>l||c<a||(a=Math.min(o.y,s.y),l=Math.max(o.y,s.y),u=Math.min(r.y,i.y),c=Math.max(r.y,i.y),u>l||c<a))}},J.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,J);var H={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*$/},Z=l((function(t){this.geometryFactory=t||new me}),"K");Z.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],$[n]&&(e=$[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Z.prototype.write=function(t){return this.extractGeometry(t)},Z.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"};var K={coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.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(K.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(K.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("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+K.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("("+K.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(",")}},$={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new S(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=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(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=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(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(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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,i,o=t.trim().split(H.parenComma),s=[],a=0,l=o.length;a<l;++a)e=o[a].replace(H.trimParens,"$1"),n=$.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.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,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Q=l((function(t){this.parser=new Z(t)}),"Z");Q.prototype.write=function(t){return this.parser.write(t)},Q.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var tt=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),et=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 l(e,"e"),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}(tt),nt=l((function(){}),"et");nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.shouldNeverReachHere=function(){if(0===arguments.length)nt.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new et("Should never reach here"+(null!==t?": "+t:""))}},nt.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],nt.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new et:new et(e)},nt.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],nt.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new et("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var rt=l((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 S,this._intPt[1]=new S,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}),"nt"),it={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};rt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},rt.prototype.getTopologySummary=function(){var t=new L;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},rt.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)},rt.prototype.getIntersectionNum=function(){return this._result},rt.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)}},rt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},rt.prototype.setPrecisionModel=function(t){this._precisionModel=t},rt.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}},rt.prototype.getIntersection=function(t){return this._intPt[t]},rt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},rt.prototype.hasIntersection=function(){return this._result!==rt.NO_INTERSECTION},rt.prototype.getEdgeDistance=function(t,e){return rt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},rt.prototype.isCollinear=function(){return this._result===rt.COLLINEAR_INTERSECTION},rt.prototype.toString=function(){return Q.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Q.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},rt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},rt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},rt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return nt.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},rt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return nt.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},it.DONT_INTERSECT.get=function(){return 0},it.DO_INTERSECT.get=function(){return 1},it.COLLINEAR.get=function(){return 2},it.NO_INTERSECTION.get=function(){return 0},it.POINT_INTERSECTION.get=function(){return 1},it.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(rt,it);var ot=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new W(this._inputLines[0][0],this._inputLines[0][1]),n=new W(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,W.intersects(n,r,e)&&0===lt.orientationIndex(n,r,e)&&0===lt.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,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof V))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new S(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=j.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);Y.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&Y.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new S(t),o=new S(e),s=new S(n),a=new S(r),l=new S;this.normalizeToEnvCentre(i,o,s,a,l);var u=this.safeHCoordinateIntersection(i,o,s,a);return u.x+=l.x,u.y+=l.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=W.intersects(e,n,r),s=W.intersects(e,n,i),a=W.intersects(r,i,e),l=W.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&l?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&l?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,l=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,h=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>u?o:u)+(a<h?a:h))/2,d=((s>c?s:c)+(l<p?l:p))/2;i.x=f,i.y=d,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!W.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=lt.orientationIndex(e,n,r),s=lt.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=lt.orientationIndex(r,i,e),l=lt.orientationIndex(r,i,n);return a>0&&l>0||a<0&&l<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===l?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===l?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new S(r):0===s?this._intPt[0]=new S(i):0===a?this._intPt[0]=new S(e):0===l&&(this._intPt[0]=new S(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=lt.distancePointLine(t,n,r),s=lt.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=lt.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=lt.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(rt),st=l((function(){}),"ot");st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return st.signOfDet2x2(r,i,o,s)},st.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0&&t<=n))return i}else{if(n>0||!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n||(t-=(s=Math.floor(t/n))*n,(e-=s*r)<0))return i;if(e>r)return-i;if(n>t+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=l((function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}),"st");at.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 i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,l=st.signOfDet2x2(i,o,s,a);if(0===l)return this._isPointOnSegment=!0,null;a<o&&(l=-l),l>0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2==1?O.INTERIOR:O.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof S&&A(arguments[1],z)){for(var t=arguments[0],e=arguments[1],n=new at(t),r=new S,i=new S,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof S&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],l=new at(s),u=1;u<a.length;u++){var c=a[u],h=a[u-1];if(l.countSegment(c,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var lt=l((function(){}),"at"),ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},lt.orientationIndex=function(t,e,n){return j.orientationIndex(t,e,n)},lt.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 i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(A(arguments[0],z)){var s=arguments[0],a=s.size();if(a<3)return 0;var l=new S,u=new S,c=new S;s.getCoordinate(0,u),s.getCoordinate(1,c);var h=u.x;c.x-=h;for(var p=0,f=1;f<a-1;f++)l.y=u.y,u.x=c.x,u.y=c.y,s.getCoordinate(f+1,c),c.x-=h,p+=u.x*(l.y-c.y);return p/2}},lt.distanceLineLine=function(t,e,n,r){if(t.equals(e))return lt.distancePointLine(t,n,r);if(n.equals(r))return lt.distancePointLine(r,t,e);var i=!1;if(W.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,l=s/o;(l<0||l>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?D.min(lt.distancePointLine(t,n,r),lt.distancePointLine(e,n,r),lt.distancePointLine(n,t,e),lt.distancePointLine(r,t,e)):0},lt.isPointInRing=function(t,e){return lt.locatePointInRing(t,e)!==O.EXTERIOR},lt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new S;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,l=r.y,u=a-i,c=l-o;n+=Math.sqrt(u*u+c*c),i=a,o=l}return n},lt.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,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var l=t[s],u=t[a];if(l.equals2D(n)||u.equals2D(n)||l.equals2D(u))return!1;var c=lt.computeOrientation(l,n,u);return 0===c?l.x>u.x:c>0},lt.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},lt.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},lt.computeOrientation=function(t,e,n){return lt.orientationIndex(t,e,n)},lt.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 i=lt.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var l=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),u=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/l;if(u<=0)return o.distance(s);if(u>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/l;return Math.abs(c)*Math.sqrt(l)}},lt.isOnLine=function(t,e){for(var n=new ot,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return lt.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return lt.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return lt.COLLINEAR},Object.defineProperties(lt,ut);var ct=l((function(){}),"lt");ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var ht=l((function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()}),"ct"),pt={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}};ht.prototype.isGeometryCollection=function(){return this.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION},ht.prototype.getFactory=function(){return this._factory},ht.prototype.getGeometryN=function(t){return this},ht.prototype.getArea=function(){return 0},ht.prototype.isRectangle=function(){return!1},ht.prototype.equals=function(){if(arguments[0]instanceof ht){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ht))return!1;var n=e;return this.equalsExact(n)}},ht.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ht.prototype.geometryChanged=function(){this.apply(ht.geometryChangedFilter)},ht.prototype.geometryChangedAction=function(){this._envelope=null},ht.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ht.prototype.getLength=function(){return 0},ht.prototype.getNumGeometries=function(){return 1},ht.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)}},ht.prototype.getUserData=function(){return this._userData},ht.prototype.getSRID=function(){return this._SRID},ht.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ht.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ht.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ht.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ht.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ht.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new W(this._envelope)},ht.prototype.setSRID=function(t){this._SRID=t},ht.prototype.setUserData=function(t){this._userData=t},ht.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},ht.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ht.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ht.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ht.SORTINDEX_MULTIPOINT||this.getSortIndex()===ht.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ht.SORTINDEX_MULTIPOLYGON},ht.prototype.interfaces_=function(){return[E,x,e]},ht.prototype.getClass=function(){return ht},ht.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ht.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},pt.serialVersionUID.get=function(){return 0x799ea46522854c00},pt.SORTINDEX_POINT.get=function(){return 0},pt.SORTINDEX_MULTIPOINT.get=function(){return 1},pt.SORTINDEX_LINESTRING.get=function(){return 2},pt.SORTINDEX_LINEARRING.get=function(){return 3},pt.SORTINDEX_MULTILINESTRING.get=function(){return 4},pt.SORTINDEX_POLYGON.get=function(){return 5},pt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},pt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},pt.geometryChangedFilter.get=function(){return ft},Object.defineProperties(ht,pt);var ft=l((function(){}),"ht");ft.interfaces_=function(){return[ct]},ft.filter=function(t){t.geometryChangedAction()};var dt=l((function(){}),"ft");dt.prototype.filter=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var gt=l((function(){}),"gt"),yt={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}};gt.prototype.isInBoundary=function(t){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},yt.Mod2BoundaryNodeRule.get=function(){return vt},yt.EndPointBoundaryNodeRule.get=function(){return mt},yt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},yt.MonoValentEndPointBoundaryNodeRule.get=function(){return bt},yt.MOD2_BOUNDARY_RULE.get=function(){return new vt},yt.ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},yt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},yt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bt},yt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,yt);var vt=l((function(){}),"yt");vt.prototype.isInBoundary=function(t){return t%2==1},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt};var mt=l((function(){}),"_t");mt.prototype.isInBoundary=function(t){return t>0},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt};var _t=l((function(){}),"mt");_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t};var bt=l((function(){}),"vt");bt.prototype.isInBoundary=function(t){return 1===t},bt.prototype.interfaces_=function(){return[gt]},bt.prototype.getClass=function(){return bt};var wt=l((function(){}),"It");wt.prototype.add=function(){},wt.prototype.addAll=function(){},wt.prototype.isEmpty=function(){},wt.prototype.iterator=function(){},wt.prototype.size=function(){},wt.prototype.toArray=function(){},wt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var xt=l((function(){}),"Et");xt.prototype.hasNext=function(){},xt.prototype.next=function(){},xt.prototype.remove=function(){};var Et=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),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}(wt);(r.prototype=new Error).name="NoSuchElementException";var It=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}return l(e,"e"),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,wt]},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 St(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}(Et),St=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return l(e,"e"),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}(xt),Nt=function(t){function e(){if(t.call(this),0!==arguments.length)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)}}l(e,"e"),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[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}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 S&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],l=arguments[1];if(arguments[2])for(var u=0;u<a.length;u++)this.add(a[u],l);else for(var c=a.length-1;c>=0;c--)this.add(a[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0&&(h>0&&this.get(h-1).equals2D(p)||h<f&&this.get(h).equals2D(p)))return null}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],m=1;y>v&&(m=-1);for(var _=y;_!==v;_+=m)this.add(d[_],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new S(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(It),Mt=l((function(){}),"Lt"),Ct={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ct.ForwardComparator.get=function(){return Ot},Ct.BidirectionalComparator.get=function(){return Pt},Ct.coordArrayType.get=function(){return new Array(0).fill(null)},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Mt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Mt.indexOf(r,e)<0)return r}return null},Mt.scroll=function(t,e){var n=Mt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);Y.arraycopy(t,n,r,0,t.length-n),Y.arraycopy(t,0,r,t.length-n,n),Y.arraycopy(r,0,t,0,t.length)},Mt.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e||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],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i||r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Mt.intersection=function(t,e){for(var n=new Nt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Mt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Mt.removeRepeatedPoints=function(t){return Mt.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Mt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Mt.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 i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Mt.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 S(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],l=0;l<a;l++)o[s+l]=new S(r[i+l])},Mt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Mt.envelope=function(t){for(var e=new W,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Mt.toCoordinateArray=function(t){return t.toArray(Mt.coordArrayType)},Mt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Mt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Mt.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},Mt.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},Mt.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},Mt.extract=function(t,e,n){e=D.clamp(e,0,t.length);var r=(n=D.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Mt,Ct);var Ot=l((function(){}),"wt");Ot.prototype.compare=function(t,e){return Mt.compare(t,e)},Ot.prototype.interfaces_=function(){return[I]},Ot.prototype.getClass=function(){return Ot};var Pt=l((function(){}),"Ot");Pt.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 i=Mt.compare(n,r);return Mt.isEqualReversed(n,r)?0:i},Pt.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 i=Mt.increasingDirection(n),o=Mt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,l=0;l<n.length;l++){var u=n[s].compareTo(r[a]);if(0!==u)return u;s+=i,a+=o}return 0},Pt.prototype.interfaces_=function(){return[I]},Pt.prototype.getClass=function(){return Pt};var At=l((function(){}),"Tt");At.prototype.get=function(){},At.prototype.put=function(){},At.prototype.size=function(){},At.prototype.values=function(){},At.prototype.entrySet=function(){};var Dt=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(At);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new wt).contains=function(){};var Tt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}return l(e,"e"),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 Lt(this)},e}(o),Lt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return l(e,"e"),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 i},e}(xt),Rt=0;(p.prototype=new Dt).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},p.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,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={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=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===c(a(a(t)))){var e=h(a(a(t)));1===s(e)?(u(a(t),Rt),u(e,Rt),u(a(a(t)),1),t=a(a(t))):(t===h(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Rt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=c(a(a(t)));1===s(n)?(u(a(t),Rt),u(n,Rt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Rt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Rt},p.prototype.values=function(){var t=new It,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new Tt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.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}},p.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}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.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},p.prototype.size=function(){return this.size_};var Ft=l((function(){}),"At");Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},f.prototype=new o,(d.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},d.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},d.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},d.prototype.remove=function(t){throw new i},d.prototype.size=function(){return this.array_.length},d.prototype.isEmpty=function(){return 0===this.array_.length},d.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},d.prototype.iterator=function(){return new kt(this)};var kt=l((function(t){this.treeSet_=t,this.position_=0}),"Ft");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 i};var Bt=l((function(){}),"Gt");Bt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=l((function(t,e){return t.compareTo(e)}),"i"),i.sort(r);else if(2===arguments.length)n=arguments[1],r=l((function(t,e){return n.compare(t,e)}),"i"),i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=l((function(t,e){return n.compare(t,e)}),"i"),e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Bt.asList=function(t){for(var e=new It,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var jt=l((function(){}),"qt"),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"},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toDimensionSymbol=function(t){switch(t){case jt.FALSE:return jt.SYM_FALSE;case jt.TRUE:return jt.SYM_TRUE;case jt.DONTCARE:return jt.SYM_DONTCARE;case jt.P:return jt.SYM_P;case jt.L:return jt.SYM_L;case jt.A:return jt.SYM_A}throw new _("Unknown dimension value: "+t)},jt.toDimensionValue=function(t){switch(F.toUpperCase(t)){case jt.SYM_FALSE:return jt.FALSE;case jt.SYM_TRUE:return jt.TRUE;case jt.SYM_DONTCARE:return jt.DONTCARE;case jt.SYM_P:return jt.P;case jt.SYM_L:return jt.L;case jt.SYM_A:return jt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(jt,Gt);var zt=l((function(){}),"Vt");zt.prototype.filter=function(t){},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Ut=l((function(){}),"Ut");Ut.prototype.filter=function(t,e){},Ut.prototype.isDone=function(){},Ut.prototype.isGeometryChanged=function(){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var qt=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")}l(e,"e"),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 W,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(),i=0;i<r.length;i++)t[++e]=r[i];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 i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],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=jt.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=jt.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 d(Bt.asList(this._geometries)),n=new d(Bt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,s=this.getNumGeometries(),a=o.getNumGeometries(),l=0;l<s&&l<a;){var u=this.getGeometryN(l),c=o.getGeometryN(l),h=u.compareToSameClass(c,i);if(0!==h)return h;l++}return l<s?1:l<a?-1:0}},e.prototype.apply=function(){if(A(arguments[0],dt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(A(arguments[0],Ut)){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(A(arguments[0],zt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(A(arguments[0],ct)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),nt.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}(ht),Vt=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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()?jt.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 Yt(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[Ft]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(qt),Yt=l((function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=gt.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}}),"Yt");Yt.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)},Yt.prototype.getBoundary=function(){return this._geom instanceof Zt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Yt.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()])},Yt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Yt.prototype.computeBoundaryCoordinates=function(t){var e=new It;this._endpointMap=new p;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 i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Mt.toCoordinateArray(e)},Yt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new Yt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Yt(e,n).getBoundary()}};var Xt=l((function(){this.count=null}),"kt");Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var Wt=l((function(){}),"jt"),Jt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Wt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Wt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Wt.NEWLINE}catch(t){if(!(t instanceof g))throw t;nt.shouldNeverReachHere()}return o}},Wt.split=function(t,e){for(var n=e.length,r=new It,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),l=0;l<a.length;l++)a[l]=r.get(l);return a},Wt.toString=function(){if(1===arguments.length){var t=arguments[0];return Wt.SIMPLE_ORDINATE_FORMAT.format(t)}},Wt.spaces=function(t){return Wt.chars(" ",t)},Jt.NEWLINE.get=function(){return Y.getProperty("line.separator")},Jt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Wt,Jt);var Ht=l((function(){}),"Wt");Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,z.X)===t.getOrdinate(e-1,z.X)&&t.getOrdinate(0,z.Y)===t.getOrdinate(e-1,z.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||b.isNaN(s)&&b.isNaN(a)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new L;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Wt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,z.X)===e.getOrdinate(n-1,z.X)&&e.getOrdinate(0,z.Y)===e.getOrdinate(n-1,z.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Zt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}l(e,"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 W:this._points.expandEnvelope(new W)},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 i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),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&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.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 lt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.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 i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(A(arguments[0],dt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(A(arguments[0],Ut)){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(A(arguments[0],zt)||A(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Yt(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[Ft]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ht),Kt=l((function(){}),"Jt");Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var $t=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}l(e,"e"),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 W;var t=new W;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 jt.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(A(arguments[0],dt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(A(arguments[0],Ut)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(A(arguments[0],zt)||A(arguments[0],ct))&&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([])),nt.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ht),Qt=l((function(){}),"Zt");Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var te=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}l(e,"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._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 i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(lt.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(lt.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing()||null===this._shell||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 i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var l=t.getX(a),u=t.getY(a);if(l!==o==(u!==s))return!1;o=l,s=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,i=this._shell,o=r._shell;if(!i.equalsExact(o,n)||this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],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);Y.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Mt.minCoordinate(e.getCoordinates());Mt.scroll(r,i),Y.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],lt.isCCW(e.getCoordinates())===n&&Mt.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[0],i=arguments[1],o=r,s=this._shell,a=o._shell,l=s.compareToSameClass(a,i);if(0!==l)return l;for(var u=this.getNumInteriorRing(),c=o.getNumInteriorRing(),h=0;h<u&&h<c;){var p=this.getInteriorRingN(h),f=o.getInteriorRingN(h),d=p.compareToSameClass(f,i);if(0!==d)return d;h++}return h<u?1:h<c?-1:0}},e.prototype.apply=function(t){if(A(t,dt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(A(t,Ut)){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(A(t,zt))t.filter(this);else if(A(t,ct)){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[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ht),ee=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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 jt.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[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(qt),ne=function(t){function e(e,n){e instanceof S&&n instanceof me&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}l(e,"e"),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 ht.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.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}(Zt),re=function(t){function e(){t.apply(this,arguments)}l(e,"e"),t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ht.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 It,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 i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},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[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(qt),ie=l((function(t){this._factory=t||null,this._isUserDataCopied=!1}),"ie"),oe={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};ie.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},ie.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},ie.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof qt?this.editGeometryCollection(t,e):t instanceof te?this.editPolygon(t,e):t instanceof $t||t instanceof Zt?e.edit(t,this._factory):(nt.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},ie.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new It,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===ee?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===re?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},ie.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 i=new It,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.GeometryEditorOperation=function(){},oe.NoOpGeometryOperation.get=function(){return se},oe.CoordinateOperation.get=function(){return ae},oe.CoordinateSequenceOperation.get=function(){return le},Object.defineProperties(ie,oe);var se=l((function(){}),"oe");se.prototype.edit=function(t,e){return t},se.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=l((function(){}),"se");ae.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ne?e.createLinearRing(n):t instanceof Zt?e.createLineString(n):t instanceof $t?n.length>0?e.createPoint(n[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var le=l((function(){}),"ae");le.prototype.edit=function(t,e){return t instanceof ne?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},le.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},le.prototype.getClass=function(){return le};var ue=l((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 S}else if(A(arguments[0],z)){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 i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var l=0;l<s;l++)this._coordinates[l]=new S}}),"ue"),ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case z.X:this._coordinates[t].x=n;break;case z.Y:this._coordinates[t].y=n;break;case z.Z:this._coordinates[t].z=n;break;default:throw new _("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case z.X:return this._coordinates[t].x;case z.Y:return this._coordinates[t].y;case z.Z:return this._coordinates[t].z}return b.NaN},ue.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}},ue.prototype.getCoordinateCopy=function(t){return new S(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.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 ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.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 ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new L(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"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[z,e]},ue.prototype.getClass=function(){return ue},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,ce);var he=l((function(){}),"ce"),pe={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};he.prototype.readResolve=function(){return he.instance()},he.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ue(t)}if(A(arguments[0],z)){var e=arguments[0];return new ue(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new ue(n):new ue(n,r)}},he.prototype.interfaces_=function(){return[C,e]},he.prototype.getClass=function(){return he},he.instance=function(){return he.instanceObject},pe.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pe.instanceObject.get=function(){return new he},Object.defineProperties(he,pe);var fe=function(t){function e(){t.call(this),this.map_=new Map}return l(e,"e"),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 It,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 Tt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(At),de=l((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 ye){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}}),"t"),ge={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};de.prototype.equals=function(t){if(!(t instanceof de))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},de.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new R(n).compareTo(new R(r))},de.prototype.getScale=function(){return this._scale},de.prototype.isFloating=function(){return this._modelType===de.FLOATING||this._modelType===de.FLOATING_SINGLE},de.prototype.getType=function(){return this._modelType},de.prototype.toString=function(){var t="UNKNOWN";return this._modelType===de.FLOATING?t="Floating":this._modelType===de.FLOATING_SINGLE?t="Floating-Single":this._modelType===de.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},de.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return b.isNaN(t)||this._modelType===de.FLOATING_SINGLE?t:this._modelType===de.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof S){var e=arguments[0];if(this._modelType===de.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},de.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===de.FLOATING?t=16:this._modelType===de.FLOATING_SINGLE?t=6:this._modelType===de.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},de.prototype.setScale=function(t){this._scale=Math.abs(t)},de.prototype.interfaces_=function(){return[e,x]},de.prototype.getClass=function(){return de},de.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ge.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ge.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(de,ge);var ye=l((function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),"t"),ve={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ye.prototype.readResolve=function(){return ye.nameToTypeMap.get(this._name)},ye.prototype.toString=function(){return this._name},ye.prototype.interfaces_=function(){return[e]},ye.prototype.getClass=function(){return ye},ve.serialVersionUID.get=function(){return-552860263173159e4},ve.nameToTypeMap.get=function(){return new fe},Object.defineProperties(ye,ve),de.Type=ye,de.FIXED=new ye("FIXED"),de.FLOATING=new ye("FLOATING"),de.FLOATING_SINGLE=new ye("FLOATING SINGLE");var me=l((function t(){this._precisionModel=new de,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?A(arguments[0],C)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof de&&(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]))}),"t"),_e={serialVersionUID:{configurable:!0}};me.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new S(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new S(t.getMinX(),t.getMinY()),new S(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new S(t.getMinX(),t.getMinY()),new S(t.getMinX(),t.getMaxY()),new S(t.getMaxX(),t.getMaxY()),new S(t.getMaxX(),t.getMinY()),new S(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Zt(this.getCoordinateSequenceFactory().create(t),this):A(t,z)?new Zt(t,this):void 0:new Zt(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){if(0===arguments.length)return new Vt(null,this);if(1===arguments.length){var t=arguments[0];return new Vt(t,this)}},me.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(me.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof te)return this.createMultiPolygon(me.toPolygonArray(t));if(a instanceof Zt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof $t)return this.createMultiPoint(me.toPointArray(t));nt.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(A(arguments[0],z)){var e=arguments[0];return new $t(e,this)}}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new te(null,null,this);if(1===arguments.length){if(A(arguments[0],z)){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 ne){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new te(r,i,this)}},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){if(0===arguments.length)return new qt(null,this);if(1===arguments.length){var t=arguments[0];return new qt(t,this)}},me.prototype.createGeometry=function(t){return new ie(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.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(A(arguments[0],z)){var e=arguments[0];return new ne(e,this)}}},me.prototype.createMultiPolygon=function(){if(0===arguments.length)return new re(null,this);if(1===arguments.length){var t=arguments[0];return new re(t,this)}},me.prototype.createMultiPoint=function(){if(0===arguments.length)return new ee(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ee(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(A(arguments[0],z)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Ht.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},me.getDefaultCoordinateSequenceFactory=function(){return he.instance()},me.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(me,_e);var be=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],we=l((function(t){this.geometryFactory=t||new me}),"Ie");we.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!xe[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==be.indexOf(n)?xe[n].apply(this,[e.coordinates]):"GeometryCollection"===n?xe[n].apply(this,[e.geometries]):xe[n].apply(this,[e])},we.prototype.write=function(t){var e=t.getGeometryType();if(!Ee[e])throw new Error("Geometry is not supported");return Ee[e].apply(this,[t])};var xe={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!xe[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=xe.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 S(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new S(t[0],t[1]),new S(t[2],t[1]),new S(t[2],t[3]),new S(t[0],t[3]),new S(t[0],t[1])])},Point:function(t){var e=new S(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=xe.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(xe.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=xe.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=xe.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(xe.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)}},Ee={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:Ee.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(Ee.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=Ee.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=Ee.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ee.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(Ee[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ie=l((function(t){this.geometryFactory=t||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new we(this.geometryFactory)}),"Ne");Ie.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===de.FIXED&&this.reducePrecision(e),e},Ie.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 Se=l((function(){this.parser=new we(this.geometryFactory)}),"Ce");Se.prototype.write=function(t){return this.parser.write(t)};var Ne=l((function(){}),"Se"),Me={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.opposite=function(t){return t===Ne.LEFT?Ne.RIGHT:t===Ne.RIGHT?Ne.LEFT:t},Me.ON.get=function(){return 0},Me.LEFT.get=function(){return 1},Me.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Me),(y.prototype=new Error).name="EmptyStackException",(v.prototype=new Et).add=function(t){return this.array_.push(t),!0},v.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},v.prototype.push=function(t){return this.array_.push(t),t},v.prototype.pop=function(t){if(0===this.array_.length)throw new y;return this.array_.pop()},v.prototype.peek=function(){if(0===this.array_.length)throw new y;return this.array_[this.array_.length-1]},v.prototype.empty=function(){return 0===this.array_.length},v.prototype.isEmpty=function(){return this.empty()},v.prototype.search=function(t){return this.array_.indexOf(t)},v.prototype.size=function(){return this.array_.length},v.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ce=l((function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),"be");Ce.prototype.getCoordinate=function(){return this._minCoord},Ce.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},Ce.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();nt.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=lt.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===lt.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===lt.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ce.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length||n[e].y===n[e+1].y)return-1;var r=Ne.LEFT;return n[e].y<n[e+1].y&&(r=Ne.RIGHT),r},Ce.prototype.getEdge=function(){return this._orientedDe},Ce.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])},Ce.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)},Ce.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}nt.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)===Ne.LEFT&&(this._orientedDe=this._minDe.getSym())},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Oe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new S(r):null,this.name="TopologyException"}return l(e,"e"),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}(tt),Pe=l((function(){this.array_=[]}),"Oe");Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length};var Ae=l((function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Ce}),"Te");Ae.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ae.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ae.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 Oe("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ae.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ae.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ae.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ne.RIGHT)>=1&&e.getDepth(Ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ae.prototype.computeDepths=function(t){var e=new Tt,n=new Pe,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Ae.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ae.prototype.getEnvelope=function(){if(null===this._env){for(var t=new W,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},Ae.prototype.addReachable=function(t){var e=new v;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Ae.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Ae.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 i=r.getSym().getNode();i.isVisited()||e.push(i)}},Ae.prototype.getNodes=function(){return this._nodes},Ae.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ae.prototype.interfaces_=function(){return[x]},Ae.prototype.getClass=function(){return Ae};var De=l((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[Ne.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Ne.ON]=o,this.location[Ne.LEFT]=s,this.location[Ne.RIGHT]=a}}),"t");De.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},De.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},De.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},De.prototype.isLine=function(){return 1===this.location.length},De.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ne.ON]=this.location[Ne.ON],e[Ne.LEFT]=O.NONE,e[Ne.RIGHT]=O.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===O.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},De.prototype.getLocations=function(){return this.location},De.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ne.LEFT];this.location[Ne.LEFT]=this.location[Ne.RIGHT],this.location[Ne.RIGHT]=t},De.prototype.toString=function(){var t=new L;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.LEFT])),t.append(O.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},De.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},De.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},De.prototype.isArea=function(){return this.location.length>1},De.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},De.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ne.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},De.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},De.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},De.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Te=l((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 De(e),this.elt[1]=new De(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new De(n.elt[0]),this.elt[1]=new De(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new De(O.NONE),this.elt[1]=new De(O.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new De(o,s,a),this.elt[1]=new De(o,s,a)}else if(4===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new De(O.NONE,O.NONE,O.NONE),this.elt[1]=new De(O.NONE,O.NONE,O.NONE),this.elt[l].setLocations(u,c,h)}}),"t");Te.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Te.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Te.prototype.isNull=function(t){return this.elt[t].isNull()},Te.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)}},Te.prototype.isLine=function(t){return this.elt[t].isLine()},Te.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new De(t.elt[e]):this.elt[e].merge(t.elt[e])},Te.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Te.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ne.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Te.prototype.toString=function(){var t=new L;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()},Te.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()}},Te.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Te.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ne.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Te.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Te.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Te.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new De(this.elt[t].location[0]))},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.toLineLabel=function(t){for(var e=new Te(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Le=l((function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new It,this._pts=new It,this._label=new Te(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new It,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}),"De");Le.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=lt.isCCW(this._ring.getCoordinates())},Le.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Le.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Oe("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Oe("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();nt.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)},Le.prototype.getLinearRing=function(){return this._ring},Le.prototype.getCoordinate=function(t){return this._pts.get(t)},Le.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},Le.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Le.prototype.isHole=function(){return this._isHole},Le.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Le.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!lt.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Le.prototype.addHole=function(t){this._holes.add(t)},Le.prototype.isShell=function(){return null===this._shell},Le.prototype.getLabel=function(){return this._label},Le.prototype.getEdges=function(){return this._edges},Le.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Le.prototype.getShell=function(){return this._shell},Le.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[0],n=arguments[1],r=e.getLocation(n,Ne.RIGHT);if(r===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,r),null}},Le.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Le.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)},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le};var Re=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return l(e,"e"),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}(Le),Fe=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new It,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}(Le),ke=l((function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0!==arguments.length&&1===arguments.length){var t=arguments[0];this._label=t}}),"Fe");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){nt.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 Te(0,O.NONE)}return l(e,"e"),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=O.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==O.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 Te(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 Te)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===O.NONE&&this._label.setLocation(r,i)}},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=O.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case O.BOUNDARY:n=O.INTERIOR;break;case O.INTERIOR:default:n=O.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),je=l((function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}),"qe");je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof S){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)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new It,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===O.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Ge=l((function(){}),"Be"),ze={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&&(t-e+4)%4==2},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if((t-e+4)%4==2)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 S&&arguments[1]instanceof S){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}},ze.NE.get=function(){return 0},ze.NW.get=function(){return 1},ze.SW.get=function(){return 2},ze.SE.get=function(){return 3},Object.defineProperties(Ge,ze);var Ue=l((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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}}),"Ue");Ue.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:lt.computeOrientation(t._p0,t._p1,this._p1)},Ue.prototype.getDy=function(){return this._dy},Ue.prototype.getCoordinate=function(){return this._p0},Ue.prototype.setNode=function(t){this._node=t},Ue.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Ue.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ue.prototype.getDirectedCoordinate=function(){return this._p1},Ue.prototype.getDx=function(){return this._dx},Ue.prototype.getLabel=function(){return this._label},Ue.prototype.getEdge=function(){return this._edge},Ue.prototype.getQuadrant=function(){return this._quadrant},Ue.prototype.getNode=function(){return this._node},Ue.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},Ue.prototype.computeLabel=function(t){},Ue.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),nt.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ue.prototype.interfaces_=function(){return[x]},Ue.prototype.getClass=function(){return Ue};var qe=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 l(e,"e"),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 Te(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 Oe("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,Ne.LEFT)===O.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===O.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[Ne.LEFT]+"/"+this._depth[Ne.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,O.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.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===Ne.LEFT&&(r=-1);var i=Ne.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},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===O.EXTERIOR&&e===O.INTERIOR?1:t===O.INTERIOR&&e===O.EXTERIOR?-1:0},e}(Ue),Ve=l((function(){}),"Xe");Ve.prototype.createNode=function(t){return new Be(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var Ye=l((function(){if(this._edges=new It,this._nodes=null,this._edgeEndList=new It,0===arguments.length)this._nodes=new je(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new je(t)}}),"Ye");Ye.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)}},Ye.prototype.find=function(t){return this._nodes.find(t)},Ye.prototype.addNode=function(){if(arguments[0]instanceof Be){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof S){var e=arguments[0];return this._nodes.addNode(e)}},Ye.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ye.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ye.prototype.debugPrintln=function(t){Y.out.println(t)},Ye.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)===O.BOUNDARY},Ye.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ye.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&<.computeOrientation(t,e,r)===lt.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},Ye.prototype.getEdgeEnds=function(){return this._edgeEndList},Ye.prototype.debugPrint=function(t){Y.out.print(t)},Ye.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ye.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1])||this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ye.prototype.insertEdge=function(t){this._edges.add(t)},Ye.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ye.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new qe(n,!0),i=new qe(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ye.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ye.prototype.getNodes=function(){return this._nodes.values()},Ye.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=l((function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),"ke");Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Oe("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new It,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Fe(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&<.isPointInRing(i,u.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=l)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return nt.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.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];Ye.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new It,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var We=l((function(){}),"je");We.prototype.getBounds=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var Je=l((function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),"He");Je.prototype.getItem=function(){return this._item},Je.prototype.getBounds=function(){return this._bounds},Je.prototype.interfaces_=function(){return[We,e]},Je.prototype.getClass=function(){return Je};var He=l((function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),"We");He.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},He.prototype.size=function(){return this._size},He.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)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.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)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ze=l((function(){}),"Ke");Ze.prototype.visitItem=function(t){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ke=l((function(){}),"Je");Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var $e=l((function(){if(this._childBoundables=new It,this._bounds=null,this._level=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];this._level=t}}),"Qe"),Qe={serialVersionUID:{configurable:!0}};$e.prototype.getLevel=function(){return this._level},$e.prototype.size=function(){return this._childBoundables.size()},$e.prototype.getChildBoundables=function(){return this._childBoundables},$e.prototype.addChildBoundable=function(t){nt.isTrue(null===this._bounds),this._childBoundables.add(t)},$e.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},$e.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},$e.prototype.interfaces_=function(){return[We,e]},$e.prototype.getClass=function(){return $e},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties($e,Qe);var tn=l((function(){}),"$e");tn.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},tn.min=function(t){return tn.sort(t),t.get(0)},tn.sort=function(t,e){var n=t.toArray();e?Bt.sort(n,e):Bt.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},tn.singletonList=function(t){var e=new It;return e.add(t),e};var en=l((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");en.prototype.expandToQueue=function(t,e){var n=en.isComposite(this._boundable1),r=en.isComposite(this._boundable2);if(n&&r)return en.area(this._boundable1)>en.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")},en.prototype.isLeaves=function(){return!(en.isComposite(this._boundable1)||en.isComposite(this._boundable2))},en.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},en.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new en(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},en.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},en.prototype.getDistance=function(){return this._distance},en.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},en.prototype.interfaces_=function(){return[x]},en.prototype.getClass=function(){return en},en.area=function(t){return t.getBounds().getArea()},en.isComposite=function(t){return t instanceof $e};var nn=l((function t(){if(this._root=null,this._built=!1,this._itemBoundables=new It,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];nt.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}}),"t"),rn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};nn.prototype.getNodeCapacity=function(){return this._nodeCapacity},nn.prototype.lastNode=function(t){return t.get(t.size()-1)},nn.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 $e?t+=this.size(n):n instanceof Je&&(t+=1)}return t}},nn.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Je&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},nn.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new It:t}if(1===arguments.length){for(var e=arguments[0],n=new It,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof $e){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Je?n.add(i.getItem()):nt.shouldNeverReachHere()}return n.size()<=0?null:n}},nn.prototype.insert=function(t,e){nt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Je(t,e))},nn.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new It;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(nt.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof $e?this.boundablesAtLevel(n,s,i):(nt.isTrue(s instanceof Je),-1===n&&i.add(s))}return null}},nn.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new It;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(A(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),l=0;l<a.size();l++){var u=a.get(l);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof $e?this.query(i,u,s):u instanceof Je?s.visitItem(u.getItem()):nt.shouldNeverReachHere())}else if(A(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var c=arguments[0],h=arguments[1],p=arguments[2],f=h.getChildBoundables(),d=0;d<f.size();d++){var g=f.get(d);this.getIntersectsOp().intersects(g.getBounds(),c)&&(g instanceof $e?this.query(c,g,p):g instanceof Je?p.add(g.getItem()):nt.shouldNeverReachHere())}},nn.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},nn.prototype.getRoot=function(){return this.build(),this._root},nn.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],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var l=a.next();if(this.getIntersectsOp().intersects(l.getBounds(),n)&&l instanceof $e&&(o=this.remove(n,l,i))){s=l;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},nn.prototype.createHigherLevels=function(t,e){nt.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},nn.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 $e){var r=this.depth(n);r>t&&(t=r)}}return t+1}},nn.prototype.createParentBoundables=function(t,e){nt.isTrue(!t.isEmpty());var n=new It;n.add(this.createNode(e));var r=new It(t);tn.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},nn.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},nn.prototype.interfaces_=function(){return[e]},nn.prototype.getClass=function(){return nn},nn.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},rn.IntersectsOp.get=function(){return on},rn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},rn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(nn,rn);var on=l((function(){}),"rn"),sn=l((function(){}),"on");sn.prototype.distance=function(t,e){},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn};var an=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}l(n,"n"),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){nt.isTrue(t.length>0);for(var n=new It,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new ln(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),i=t.iterator(),o=0;o<e;o++){r[o]=new It;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}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(A(arguments[2],Ze)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(A(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var a=arguments[0],l=arguments[1],u=arguments[2];t.prototype.query.call(this,a,l,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){nt.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new It(t);tn.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(A(arguments[0],sn)){var t=arguments[0],e=new en(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof en){var r=arguments[0];return this.nearestNeighbour(r,b.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&A(arguments[1],sn)){var i=arguments[0],o=arguments[1],s=new en(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof en&&"number"==typeof arguments[1]){var a=arguments[0],l=arguments[1],u=null,c=new He;for(c.add(a);!c.isEmpty()&&l>0;){var h=c.poll(),p=h.getDistance();if(p>=l)break;h.isLeaves()?(l=p,u=h):h.expandToQueue(c,l)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],d=arguments[1],g=arguments[2],y=new Je(f,d),v=new en(this.getRoot(),y,g);return this.nearestNeighbour(v)[0]}},n.prototype.interfaces_=function(){return[Ke,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 ln},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[I]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[I]},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}(nn),ln=function(t){function e(){var e=arguments[0];t.call(this,e)}return l(e,"e"),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 W(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($e),un=l((function(){}),"un");un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return nt.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=l((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 S(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}),"ln");cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[x]},cn.prototype.getClass=function(){return cn};var hn=l((function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t}),"cn");hn.prototype.getSplitCoordinates=function(){var t=new Nt;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()},hn.prototype.addCollapsedNodes=function(){var t=new It;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)}},hn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},hn.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))}},hn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new S(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new S(e.coord))},hn.prototype.iterator=function(){return this._nodeMap.values().iterator()},hn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},hn.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)},hn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new R(e[0])),r=i}},hn.prototype.getEdge=function(){return this._edge},hn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},hn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new S(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new S(e.coord)),new gn(o,this._edge.getData())},hn.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(nt.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},hn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new tt("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new tt("bad split edge end point at "+i)},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var pn=l((function(){}),"pn");pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.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 S&&arguments[1]instanceof S){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _("Cannot compute the octant for two identical points "+i);return pn.octant(s,a)}};var fn=l((function(){}),"hn");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 dn=l((function(){}),"fn");dn.prototype.addIntersection=function(t,e){},dn.prototype.interfaces_=function(){return[fn]},dn.prototype.getClass=function(){return dn};var gn=l((function(){this._nodeList=new hn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"gn");gn.prototype.getCoordinates=function(){return this._pts},gn.prototype.size=function(){return this._pts.length},gn.prototype.getCoordinate=function(t){return this._pts[t]},gn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},gn.prototype.setData=function(t){this._data=t},gn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:pn.octant(t,e)},gn.prototype.getData=function(){return this._data},gn.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[0],r=arguments[1],i=arguments[3],o=new S(n.getIntersection(i));this.addIntersection(o,r)}},gn.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},gn.prototype.getNodeList=function(){return this._nodeList},gn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},gn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},gn.prototype.interfaces_=function(){return[dn]},gn.prototype.getClass=function(){return gn},gn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new It;return gn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var yn=l((function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new S,this.p1=new S;else if(1===arguments.length){var t=arguments[0];this.p0=new S(t.p0),this.p1=new S(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],i=arguments[3];this.p0=new S(e,n),this.p1=new S(r,i)}}),"dn"),vn={serialVersionUID:{configurable:!0}};yn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},yn.prototype.orientationIndex=function(){if(arguments[0]instanceof yn){var t=arguments[0],e=lt.orientationIndex(this.p0,this.p1,t.p0),n=lt.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 S){var r=arguments[0];return lt.orientationIndex(this.p0,this.p1,r)}},yn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},yn.prototype.isVertical=function(){return this.p0.x===this.p1.x},yn.prototype.equals=function(t){if(!(t instanceof yn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},yn.prototype.intersection=function(t){var e=new ot;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},yn.prototype.project=function(){if(arguments[0]instanceof S){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new S(t);var e=this.projectionFactor(t),n=new S;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 yn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1||i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new yn(s,a)}},yn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},yn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},yn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},yn.prototype.distancePerpendicular=function(t){return lt.distancePointLinePerpendicular(t,this.p0,this.p1)},yn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},yn.prototype.midPoint=function(){return yn.midPoint(this.p0,this.p1)},yn.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?b.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},yn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=b.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var l=t.closestPoint(this.p1);return(i=l.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=l),n},yn.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},yn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},yn.prototype.getLength=function(){return this.p0.distance(this.p1)},yn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},yn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},yn.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)},yn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},yn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},yn.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),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,l=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,l=e*o/s}return new S(n-l,r+a)},yn.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}},yn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||b.isNaN(e))&&(e=1),e},yn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},yn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},yn.prototype.distance=function(){if(arguments[0]instanceof yn){var t=arguments[0];return lt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof S){var e=arguments[0];return lt.distancePointLine(e,this.p0,this.p1)}},yn.prototype.pointAlong=function(t){var e=new S;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},yn.prototype.hashCode=function(){var t=b.doubleToLongBits(this.p0.x);t^=31*b.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=b.doubleToLongBits(this.p1.x);return n^=31*b.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},yn.prototype.interfaces_=function(){return[x,e]},yn.prototype.getClass=function(){return yn},yn.midPoint=function(t,e){return new S((t.x+e.x)/2,(t.y+e.y)/2)},vn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(yn,vn);var mn=l((function(){this.tempEnv1=new W,this.tempEnv2=new W,this._overlapSeg1=new yn,this._overlapSeg2=new yn}),"_n");mn.prototype.overlap=function(){if(2!==arguments.length&&4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var _n=l((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}),"mn");_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 i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,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 W(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,i,o){var s=this._pts[t],a=this._pts[e],l=n._pts[r],u=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(l,u),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var bn=l((function(){}),"vn");bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},bn.getChainStartIndices=function(t){var e=0,n=new It;n.add(new R(e));do{var r=bn.findChainEnd(t,e);n.add(new R(r)),e=r}while(e<t.length-1);return bn.toIntArray(n)},bn.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]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},bn.getChains=function(){if(1===arguments.length){var t=arguments[0];return bn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new It,i=bn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},bn.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 wn=l((function(){}),"In");wn.prototype.computeNodes=function(t){},wn.prototype.getNodedSubstrings=function(){},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var xn=l((function(){if(this._segInt=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}),"En");xn.prototype.setSegmentIntersector=function(t){this._segInt=t},xn.prototype.interfaces_=function(){return[wn]},xn.prototype.getClass=function(){return xn};var En=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new It,this._index=new an,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}l(e,"e"),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 gn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=bn.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 In(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return In},Object.defineProperties(e,n),e}(xn),In=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return l(e,"e"),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[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(mn),Sn=l((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)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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}),"t"),Nn={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}};Sn.prototype.getEndCapStyle=function(){return this._endCapStyle},Sn.prototype.isSingleSided=function(){return this._isSingleSided},Sn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Sn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Sn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Sn.JOIN_ROUND&&(this._quadrantSegments=Sn.DEFAULT_QUADRANT_SEGMENTS)},Sn.prototype.getJoinStyle=function(){return this._joinStyle},Sn.prototype.setJoinStyle=function(t){this._joinStyle=t},Sn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Sn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Sn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Sn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Sn.prototype.getMitreLimit=function(){return this._mitreLimit},Sn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Sn.prototype.setSingleSided=function(t){this._isSingleSided=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Nn.CAP_ROUND.get=function(){return 1},Nn.CAP_FLAT.get=function(){return 2},Nn.CAP_SQUARE.get=function(){return 3},Nn.JOIN_ROUND.get=function(){return 1},Nn.JOIN_MITRE.get=function(){return 2},Nn.JOIN_BEVEL.get=function(){return 3},Nn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Nn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Nn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Sn,Nn);var Mn=l((function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=lt.COUNTERCLOCKWISE,this._inputLine=t||null}),"Ln"),Cn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Mn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Mn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Mn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Mn.prototype.isShallowConcavity=function(t,e,n,r){return lt.computeOrientation(t,e,n)===this._angleOrientation&<.distancePointLine(e,t,n)<r},Mn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Mn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Mn.prototype.isConcave=function(t,e,n){return lt.computeOrientation(t,e,n)===this._angleOrientation},Mn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=lt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Mn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Mn.DELETE;)e++;return e},Mn.prototype.isShallow=function(t,e,n,r){return lt.distancePointLine(e,t,n)<r},Mn.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Mn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.simplify=function(t,e){return new Mn(t).simplify(e)},Cn.INIT.get=function(){return 0},Cn.DELETE.get=function(){return 1},Cn.KEEP.get=function(){return 1},Cn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Mn,Cn);var On=l((function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new It}),"wn"),Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){return this._ptList.toArray(On.COORDINATE_ARRAY_TYPE)},On.prototype.setPrecisionModel=function(t){this._precisionModel=t},On.prototype.addPt=function(t){var e=new S(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},On.prototype.revere=function(){},On.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])},On.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},On.prototype.toString=function(){return(new me).createLineString(this.getCoordinates()).toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new S(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},On.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,Pn);var An=l((function(){}),"Tn"),Dn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.toDegrees=function(t){return 180*t/Math.PI},An.normalize=function(t){for(;t>Math.PI;)t-=An.PI_TIMES_2;for(;t<=-Math.PI;)t+=An.PI_TIMES_2;return t},An.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,i=n.y-e.y;return Math.atan2(i,r)}},An.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},An.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},An.interiorAngle=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n);return Math.abs(i-r)},An.normalizePositive=function(t){if(t<0){for(;t<0;)t+=An.PI_TIMES_2;t>=An.PI_TIMES_2&&(t=0)}else{for(;t>=An.PI_TIMES_2;)t-=An.PI_TIMES_2;t<0&&(t=0)}return t},An.angleBetween=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n);return An.diff(r,i)},An.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},An.toRadians=function(t){return t*Math.PI/180},An.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?An.COUNTERCLOCKWISE:n<0?An.CLOCKWISE:An.NONE},An.angleBetweenOriented=function(t,e,n){var r=An.angle(e,t),i=An.angle(e,n)-r;return i<=-Math.PI?i+An.PI_TIMES_2:i>Math.PI?i-An.PI_TIMES_2:i},Dn.PI_TIMES_2.get=function(){return 2*Math.PI},Dn.PI_OVER_2.get=function(){return Math.PI/2},Dn.PI_OVER_4.get=function(){return Math.PI/4},Dn.COUNTERCLOCKWISE.get=function(){return lt.COUNTERCLOCKWISE},Dn.CLOCKWISE.get=function(){return lt.CLOCKWISE},Dn.NONE.get=function(){return lt.COLLINEAR},Object.defineProperties(An,Dn);var Tn=l((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 yn,this._seg1=new yn,this._offset0=new yn,this._offset1=new yn,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 ot,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Sn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}),"t"),Ln={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}};Tn.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=lt.computeOrientation(this._s0,this._s1,this._s2),r=n===lt.CLOCKWISE&&this._side===Ne.LEFT||n===lt.COUNTERCLOCKWISE&&this._side===Ne.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Tn.prototype.addLineEndCap=function(t,e){var n=new yn(t,e),r=new yn;this.computeOffsetSegment(n,Ne.LEFT,this._distance,r);var i=new yn;this.computeOffsetSegment(n,Ne.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,lt.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Sn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Sn.CAP_SQUARE:var l=new S;l.x=Math.abs(this._distance)*Math.cos(a),l.y=Math.abs(this._distance)*Math.sin(a);var u=new S(r.p1.x+l.x,r.p1.y+l.y),c=new S(i.p1.x+l.x,i.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},Tn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Tn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new S(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Tn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),l=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,l);r===lt.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Tn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Tn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Sn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Sn.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))},Tn.prototype.createSquare=function(t){this._segList.addPt(new S(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new S(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Tn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Tn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Tn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Tn.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)},Tn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=An.angle(i,this._seg0.p0),s=An.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=An.normalize(o+s),l=An.normalize(a+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(s)),h=i.x+u*Math.cos(l),p=i.y+u*Math.sin(l),f=new S(h,p),d=new yn(i,f),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Ne.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},Tn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ne.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),l=i*n*o/a,u=i*n*s/a;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+l,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+l},Tn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===lt.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var l=s/a,u=0,c=new S;u<s;){var h=e+o*u;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),u+=l}},Tn.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*Tn.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 S((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 S((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)}},Tn.prototype.createCircle=function(t){var e=new S(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Tn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Tn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Tn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Tn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Sn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Sn.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,lt.CLOCKWISE,this._distance))},Tn.prototype.closeRing=function(){this._segList.closeRing()},Tn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Ln.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Ln.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Tn,Ln);var Rn=l((function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}),"Mn");Rn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Mt.reverse(o),o},Rn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Mn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Mn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment(),n.closeRing()},Rn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ne.RIGHT&&(r=-r);var i=Mn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},Rn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Mn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ne.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Mn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ne.LEFT);for(var l=a-2;l>=0;l--)e.addNextSegment(s[l],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Rn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:e.createCircle(t);break;case Sn.CAP_SQUARE:e.createSquare(t)}},Rn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||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 i=e<0;this.computeSingleSidedBufferCurve(t,i,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 i=Mn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Mn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(a[u],!0)}n.addLastSegment()},Rn.prototype.getSegGen=function(t){return new Tn(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 S(t[n]);return e};var Fn=l((function(){this._subgraphs=null,this._seg=new yn,this._cga=new lt;var t=arguments[0];this._subgraphs=t}),"An"),kn={DepthSegment:{configurable:!0}};Fn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new It,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(A(arguments[2],Et)&&arguments[0]instanceof S&&arguments[1]instanceof qe){for(var o=arguments[0],s=arguments[1],a=arguments[2],l=s.getEdge().getCoordinates(),u=0;u<l.length-1;u++)if(this._seg.p0=l[u],this._seg.p1=l[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||lt.computeOrientation(this._seg.p0,this._seg.p1,o)===lt.RIGHT)){var c=s.getDepth(Ne.LEFT);this._seg.p0.equals(l[u])||(c=s.getDepth(Ne.RIGHT));var h=new Bn(this._seg,c);a.add(h)}}else if(A(arguments[2],Et)&&arguments[0]instanceof S&&A(arguments[1],Et))for(var p=arguments[0],f=arguments[1],d=arguments[2],g=f.iterator();g.hasNext();){var y=g.next();y.isForward()&&this.findStabbedSegments(p,y,d)}},Fn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:tn.min(e)._leftDepth},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},kn.DepthSegment.get=function(){return Bn},Object.defineProperties(Fn,kn);var Bn=l((function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new yn(t),this._leftDepth=e}),"Gn");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[x]},Bn.prototype.getClass=function(){return Bn};var jn=l((function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}),"qn");jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.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)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,l=n.y-o,u=r.y-o,c=s*u-a*l,h=t.x-i,p=t.y-o,f=(u*h-a*p)/c,d=(-l*h+s*p)/c;return e.z+f*(n.z-e.z)+d*(r.z-e.z)},jn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},jn.isAcute=function(t,e,n){return!!An.isAcute(t,e,n)&&!!An.isAcute(e,n,t)&&!!An.isAcute(n,t,e)},jn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,l=e.y-i,u=2*jn.det(o,s,a,l),c=jn.det(s,o*o+s*s,l,a*a+l*l),h=jn.det(o,o*o+s*s,a,a*a+l*l);return new S(r-c/u,i+h/u)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},jn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new S(t.x+i*o,t.y+i*s)},jn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,l=n.z-t.z,u=i*l-o*a,c=o*s-r*l,h=r*a-i*s,p=u*u+c*c+h*h;return Math.sqrt(p)/2},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new S(r,i)},jn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,l=(r*t.y+i*e.y+o*n.y)/s;return new S(a,l)};var Gn=l((function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}),"Bn");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,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ne.LEFT;this._distance<0&&(e=-this._distance,n=Ne.RIGHT);var r=t.getExteriorRing(),i=Mt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance)||this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,O.EXTERIOR,O.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Mt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),O.INTERIOR,O.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return lt.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=Mt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Te(0,O.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,i){if(0===e&&t.length<ne.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ne.MINIMUM_VALID_SIZE&<.isCCW(t)&&(o=i,s=r,n=Ne.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof te?this.addPolygon(t):t instanceof Zt?this.addLineString(t):t instanceof $t?this.addPoint(t):(t instanceof ee||t instanceof Vt||t instanceof re||t instanceof qt)&&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(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},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 zn=l((function(){}),"Vn");zn.prototype.locate=function(t){},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn};var Un=l((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()}),"Un");Un.prototype.next=function(){if(this._atStart)return this._atStart=!1,Un.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 qt?(this._subcollectionIterator=new Un(t),this._subcollectionIterator.next()):t},Un.prototype.remove=function(){throw new Error(this.getClass().getName())},Un.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)},Un.prototype.interfaces_=function(){return[xt]},Un.prototype.getClass=function(){return Un},Un.isAtomic=function(t){return!(t instanceof qt)};var qn=l((function(){this._geom=null;var t=arguments[0];this._geom=t}),"zn");qn.prototype.locate=function(t){return qn.locate(t,this._geom)},qn.prototype.interfaces_=function(){return[zn]},qn.prototype.getClass=function(){return qn},qn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&<.isPointInRing(t,e.getCoordinates())},qn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!qn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(qn.isPointInRing(t,i))return!1}return!0},qn.containsPoint=function(t,e){if(e instanceof te)return qn.containsPointInPolygon(t,e);if(e instanceof qt)for(var n=new Un(e);n.hasNext();){var r=n.next();if(r!==e&&qn.containsPoint(t,r))return!0}return!1},qn.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:qn.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var Vn=l((function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]}),"Xn");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=O.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==O.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===O.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ne.ON)===O.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var l=a.getLocation(t,Ne.LEFT),u=a.getLocation(t,Ne.RIGHT);if(u!==O.NONE){if(u!==i)throw new Oe("side location conflict",s.getCoordinate());l===O.NONE&&nt.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=l}else nt.isTrue(a.getLocation(t,Ne.LEFT)===O.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){Y.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,Ne.LEFT);nt.isTrue(r!==O.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();nt.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ne.LEFT),l=s.getLocation(t,Ne.RIGHT);if(a===l||l!==i)return!1;i=a}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 It(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=qn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new L;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(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===O.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),l=0;l<2;l++)if(a.isAnyNull(l)){var u=O.NONE;if(e[l])u=O.EXTERIOR;else{var c=s.getCoordinate();u=this.getLocation(l,c,t)}a.setAllLocationsIfNull(l,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 Yn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return l(e,"e"),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 i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Oe("no outgoing dirEdge found",this.getCoordinate());nt.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),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(nt.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){Y.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 It;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),i=r.getSym();null===e&&(e=i),null!==t&&i.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(Ne.LEFT),r=t.getDepth(Ne.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Oe("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],l=o;l<s;l++){var u=this._edgeList.get(l);u.setEdgeDepths(Ne.RIGHT,a),a=u.getDepth(Ne.LEFT)}return a}},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,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(nt.isTrue(null!==e,"found null for first outgoing dirEdge"),nt.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,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(r.isInResult()){t=O.EXTERIOR;break}}}if(t===O.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===O.INTERIOR):(s.isInResult()&&(i=O.EXTERIOR),a.isInResult()&&(i=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Te(O.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(i,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Xn=function(t){function e(){t.apply(this,arguments)}return l(e,"e"),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 Yn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Wn=l((function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)}),"t");Wn.prototype.compareTo=function(t){var e=t;return Wn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Wn.prototype.interfaces_=function(){return[x]},Wn.prototype.getClass=function(){return Wn},Wn.orientation=function(t){return 1===Mt.increasingDirection(t)},Wn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,l=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[l].compareTo(n[u]);if(0!==c)return c;var h=(l+=i)===s,p=(u+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Jn=l((function(){this._edges=new It,this._ocaMap=new p}),"Hn");Jn.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(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Jn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Jn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Jn.prototype.iterator=function(){return this._edges.iterator()},Jn.prototype.getEdges=function(){return this._edges},Jn.prototype.get=function(t){return this._edges.get(t)},Jn.prototype.findEqualEdge=function(t){var e=new Wn(t.getCoordinates());return this._ocaMap.get(e)},Jn.prototype.add=function(t){this._edges.add(t);var e=new Wn(t.getCoordinates());this._ocaMap.put(e,t)},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};var Hn=l((function(){}),"Wn");Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Zn=l((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}),"Kn");Zn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Zn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Zn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zn.prototype.getLineIntersector=function(){return this._li},Zn.prototype.hasProperIntersection=function(){return this._hasProper},Zn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),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)))},Zn.prototype.hasIntersection=function(){return this._hasIntersection},Zn.prototype.isDone=function(){return!1},Zn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Zn.prototype.interfaces_=function(){return[Hn]},Zn.prototype.getClass=function(){return Zn},Zn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kn=l((function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new S(t),this.segmentIndex=e,this.dist=n}),"Jn");Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[x]},Kn.prototype.getClass=function(){return Kn};var $n=l((function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t}),"Qn");$n.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},$n.prototype.iterator=function(){return this._nodeMap.values().iterator()},$n.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},$n.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)},$n.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new S(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new rr(o,new Te(this.edge._label))},$n.prototype.add=function(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},$n.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Qn=l((function(){}),"Zn");Qn.prototype.getChainStartIndices=function(t){var e=0,n=new It;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 Qn.toIntArray(n)},Qn.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},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},Qn.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 tr=l((function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new W,this.env2=new W;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Qn;this.startIndex=e.getChainStartIndices(this.pts)}),"$n");tr.prototype.getCoordinates=function(){return this.pts},tr.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},tr.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},tr.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 i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],l=arguments[4],u=arguments[5],c=this.pts[i],h=this.pts[o],p=s.pts[a],f=s.pts[l];if(o-i==1&&l-a==1)return u.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,h),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+l)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,u),g<l&&this.computeIntersectsForChain(i,d,s,g,l,u)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,u),g<l&&this.computeIntersectsForChain(d,o,s,g,l,u))}},tr.prototype.getStartIndexes=function(){return this.startIndex},tr.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)},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var er=l((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}),"t"),nr={NULL_VALUE:{configurable:!0}};er.prototype.getDepth=function(t,e){return this._depth[t][e]},er.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},er.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]!==er.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===er.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===er.NULL_VALUE}},er.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}}},er.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},er.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},er.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},er.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!==O.EXTERIOR&&r!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=er.depthAtLocation(r):this._depth[e][n]+=er.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[i][o]++}},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},er.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:er.NULL_VALUE},nr.NULL_VALUE.get=function(){return-1},Object.defineProperties(er,nr);var rr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new er,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return l(e,"e"),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,Te.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,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)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 tr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new W;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 i=new S(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var l=this.pts[a];i.equals2D(l)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new L;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,Ne.ON),e.getLocation(1,Ne.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ne.LEFT),e.getLocation(1,Ne.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ne.RIGHT),e.getLocation(1,Ne.RIGHT),2))},e}(ke),ir=l((function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Jn,this._bufParams=t||null}),"ii");ir.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ir.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 Te(t.getLabel())).flip(),n.merge(r);var i=ir.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(ir.depthDelta(t.getLabel()))},ir.prototype.buildSubgraphs=function(t,e){for(var n=new It,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Fn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},ir.prototype.createSubgraphs=function(t){for(var e=new It,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Ae;i.create(r),e.add(i)}}return tn.sort(e,tn.reverseOrder()),e},ir.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},ir.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new En,n=new ot;return n.setPrecisionModel(t),e.setSegmentIntersector(new Zn(n)),e},ir.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),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ye(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},ir.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new rr(i.getCoordinates(),new Te(s));this.insertUniqueEdge(a)}}},ir.prototype.setNoder=function(t){this._workingNoder=t},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},ir.convertSegStrings=function(t){for(var e=new me,n=new It;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var or=l((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],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}}),"ri");or.prototype.rescale=function(){if(A(arguments[0],wt))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])&&Y.out.println(n)}},or.prototype.scale=function(){if(A(arguments[0],wt)){for(var t=arguments[0],e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new gn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new S(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Mt.removeRepeatedPoints(o)}},or.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},or.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},or.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},or.prototype.interfaces_=function(){return[wn]},or.prototype.getClass=function(){return or};var sr=l((function(){this._li=new ot,this._segStrings=null;var t=arguments[0];this._segStrings=t}),"oi"),ar={fact:{configurable:!0}};sr.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 i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new tt("found endpt/interior pt intersection at index "+o+" :pt "+n)},sr.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 i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),l=0;l<s.length-1;l++)for(var u=0;u<a.length-1;u++)this.checkInteriorIntersections(i,l,o,u);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var d=c.getCoordinates()[h],g=c.getCoordinates()[h+1],y=p.getCoordinates()[f],v=p.getCoordinates()[f+1];if(this._li.computeIntersection(d,g,y,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,v)))throw new tt("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+v)}},sr.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},sr.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])},sr.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},sr.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new tt("found non-noded collapse at "+sr.fact.createLineString([t,e,n]))},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},ar.fact.get=function(){return new me},Object.defineProperties(sr,ar);var lr=l((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 S(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new S,this._p1Scaled=new S),this.initCorners(this._pt)}),"ai"),ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};lr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return nt.isTrue(!(s&&a),"Found bad envelope test"),a},lr.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 S(this._maxx,this._maxy),this._corner[1]=new S(this._minx,this._maxy),this._corner[2]=new S(this._minx,this._miny),this._corner[3]=new S(this._maxx,this._miny)},lr.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))},lr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},lr.prototype.getCoordinate=function(){return this._originalPt},lr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},lr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=lr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new W(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},lr.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()))))},lr.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)))))},lr.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)},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(lr,ur);var cr=l((function(){this.tempEnv1=new W,this.selectedSegment=new yn}),"li");cr.prototype.select=function(){if(1!==arguments.length&&2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var hr=l((function(){this._index=null;var t=arguments[0];this._index=t}),"ci"),pr={HotPixelSnapAction:{configurable:!0}};hr.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],i=e.getSafeEnvelope(),o=new fr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ze]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr},pr.HotPixelSnapAction.get=function(){return fr},Object.defineProperties(hr,pr);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 l(e,"e"),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[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),dr=l((function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new It}),"fi");dr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)this._interiorIntersections.add(this._li.getIntersection(l));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},dr.prototype.isDone=function(){return!1},dr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},dr.prototype.interfaces_=function(){return[Hn]},dr.prototype.getClass=function(){return dr};var gr=l((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 ot,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}),"gi");gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new sr(e);try{n.checkValid()}catch(t){if(!(t instanceof q))throw t;t.printStackTrace()}},gr.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},gr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},gr.prototype.findInteriorIntersections=function(t,e){var n=new dr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},gr.prototype.computeVertexSnaps=function(){if(A(arguments[0],wt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof gn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new lr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new En,this._pointSnapper=new hr(this._noder.getIndex()),this.snapRound(t,this._li)},gr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new lr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},gr.prototype.interfaces_=function(){return[wn]},gr.prototype.getClass=function(){return gr};var yr=l((function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Sn,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}}),"di"),vr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};yr.prototype.bufferFixedPrecision=function(t){var e=new or(new gr(new de(1)),t.getScale()),n=new ir(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},yr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=yr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Oe))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=yr.precisionScaleFactor(this._argGeom,this._distance,n),i=new de(r);this.bufferFixedPrecision(i)}},yr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===de.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},yr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},yr.prototype.bufferOriginalPrecision=function(){try{var t=new ir(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof tt))throw t;this._saveException=t}},yr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},yr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},yr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new yr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ht&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new yr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof Sn&&arguments[0]instanceof ht&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],l=arguments[2];return new yr(s,l).getResultGeometry(a)}}else if(4===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],p=arguments[3],f=new yr(u);return f.setQuadrantSegments(h),f.setEndCapStyle(p),f.getResultGeometry(c)}},yr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=D.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},vr.CAP_ROUND.get=function(){return Sn.CAP_ROUND},vr.CAP_BUTT.get=function(){return Sn.CAP_FLAT},vr.CAP_FLAT.get=function(){return Sn.CAP_FLAT},vr.CAP_SQUARE.get=function(){return Sn.CAP_SQUARE},vr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(yr,vr);var mr=l((function(){this._pt=[new S,new S],this._distance=b.NaN,this._isNull=!0}),"_i");mr.prototype.getCoordinates=function(){return this._pt},mr.prototype.getCoordinate=function(t){return this._pt[t]},mr.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)}},mr.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],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},mr.prototype.getDistance=function(){return this._distance},mr.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)}},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var _r=l((function(){}),"mi");_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof mr&&arguments[0]instanceof Zt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new yn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof mr&&arguments[0]instanceof te&&arguments[1]instanceof S){var a=arguments[0],l=arguments[1],u=arguments[2];_r.computeDistance(a.getExteriorRing(),l,u);for(var c=0;c<a.getNumInteriorRing();c++)_r.computeDistance(a.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof mr&&arguments[0]instanceof ht&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Zt)_r.computeDistance(h,p,f);else if(h instanceof te)_r.computeDistance(h,p,f);else if(h instanceof qt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);_r.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof mr&&arguments[0]instanceof yn&&arguments[1]instanceof S){var v=arguments[0],m=arguments[1],_=arguments[2],b=v.closestPoint(m);_.setMinimum(b,m)}};var br=l((function(t){this._maxPtDist=new mr,this._inputGeom=t||null}),"vi"),wr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};br.prototype.computeMaxMidpointDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},br.prototype.computeMaxVertexDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},br.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},br.prototype.getDistancePoints=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},wr.MaxPointDistanceFilter.get=function(){return xr},wr.MaxMidpointDistanceFilter.get=function(){return Er},Object.defineProperties(br,wr);var xr=l((function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),"Ei");xr.prototype.filter=function(t){this._minPtDist.initialize(),_r.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[dt]},xr.prototype.getClass=function(){return xr};var Er=l((function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),"xi");Er.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new S((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.isDone=function(){return!1},Er.prototype.isGeometryChanged=function(){return!1},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[Ut]},Er.prototype.getClass=function(){return Er};var Ir=l((function(t){this._comps=t||null}),"Ni");Ir.prototype.filter=function(t){t instanceof te&&this._comps.add(t)},Ir.prototype.interfaces_=function(){return[zt]},Ir.prototype.getClass=function(){return Ir},Ir.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Ir.getPolygons(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof te?n.add(e):e instanceof qt&&e.apply(new Ir(n)),n}};var Sr=l((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}}),"Ci");Sr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ne){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Zt&&this._lines.add(t)},Sr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Sr.prototype.interfaces_=function(){return[ct]},Sr.prototype.getClass=function(){return Sr},Sr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Sr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Sr.getLines(e,n))}},Sr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Sr.getLines(t,!1)}if(2===arguments.length){if(A(arguments[0],wt)&&A(arguments[1],wt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Sr.getLines(i,n)}return n}if(arguments[0]instanceof ht&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new It;return o.apply(new Sr(a,s)),a}if(arguments[0]instanceof ht&&A(arguments[1],wt)){var l=arguments[0],u=arguments[1];return l instanceof Zt?u.add(l):l.apply(new Sr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&A(arguments[0],wt)&&A(arguments[1],wt)){for(var c=arguments[0],h=arguments[1],p=arguments[2],f=c.iterator();f.hasNext();){var d=f.next();Sr.getLines(d,h,p)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ht&&A(arguments[1],wt)){var g=arguments[0],y=arguments[1],v=arguments[2];return g.apply(new Sr(y,v)),y}}};var Nr=l((function(){if(this._boundaryRule=gt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0!==arguments.length&&1===arguments.length){var t=arguments[0];if(null===t)throw new _("Rule must be non-null");this._boundaryRule=t}}),"Si");Nr.prototype.locateInternal=function(){if(arguments[0]instanceof S&&arguments[1]instanceof te){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===O.EXTERIOR)return O.EXTERIOR;if(r===O.BOUNDARY)return O.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof S&&arguments[1]instanceof Zt){var a=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var u=l.getCoordinates();return l.isClosed()||!a.equals(u[0])&&!a.equals(u[u.length-1])?lt.isOnLine(a,u)?O.INTERIOR:O.EXTERIOR:O.BOUNDARY}if(arguments[0]instanceof S&&arguments[1]instanceof $t){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?O.INTERIOR:O.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?lt.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof $t&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof te)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof re)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof qt)for(var l=new Un(e);l.hasNext();){var u=l.next();u!==e&&this.computeLocation(t,u)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof Zt||e instanceof te?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Mr=l((function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}}),"t"),Cr={INSIDE_AREA:{configurable:!0}};Mr.prototype.isInsideArea=function(){return this._segIndex===Mr.INSIDE_AREA},Mr.prototype.getCoordinate=function(){return this._pt},Mr.prototype.getGeometryComponent=function(){return this._component},Mr.prototype.getSegmentIndex=function(){return this._segIndex},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Cr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Mr,Cr);var Or=l((function(t){this._pts=t||null}),"wi");Or.prototype.filter=function(t){t instanceof $t&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[zt]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof $t?tn.singletonList(t):Or.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $t?n.add(e):e instanceof qt&&e.apply(new Or(n)),n}};var Pr=l((function(){this._locations=null;var t=arguments[0];this._locations=t}),"Oi");Pr.prototype.filter=function(t){(t instanceof $t||t instanceof Zt||t instanceof te)&&this._locations.add(new Mr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[zt]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e};var Ar=l((function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=b.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],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}}),"Ti");Ar.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,i=Ir.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,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&&A(arguments[0],Et)&&A(arguments[1],Et)){for(var s=arguments[0],a=arguments[1],l=arguments[2],u=0;u<s.size();u++)for(var c=s.get(u),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),l),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Mr&&arguments[1]instanceof te){var p=arguments[0],f=arguments[1],d=arguments[2],g=p.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,d[0]=p,d[1]=new Mr(f,g),null}},Ar.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Ar.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Sr.getLines(this._geom[0]),n=Sr.getLines(this._geom[1]),r=Or.getPoints(this._geom[0]),i=Or.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,i,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,i,t),void this.updateMinDistance(t,!1))))},Ar.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Ar.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])},Ar.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Ar.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation||(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 Zt&&arguments[1]instanceof $t){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(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=lt.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new yn(r[o],r[o+1]).closestPoint(i);n[0]=new Mr(t,o,a),n[1]=new Mr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Zt&&arguments[1]instanceof Zt){var l=arguments[0],u=arguments[1],c=arguments[2];if(l.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var h=l.getCoordinates(),p=u.getCoordinates(),f=0;f<h.length-1;f++)for(var d=0;d<p.length-1;d++){var g=lt.distanceLineLine(h[f],h[f+1],p[d],p[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new yn(h[f],h[f+1]),v=new yn(p[d],p[d+1]),m=y.closestPoints(v);c[0]=new Mr(l,f,m[0]),c[1]=new Mr(u,d,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Ar.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Mr(i,0,i.getCoordinate()),n[1]=new Mr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Ar.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)},Ar.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.distance=function(t,e){return new Ar(t,e).distance()},Ar.isWithinDistance=function(t,e,n){return new Ar(t,e,n).distance()<=n},Ar.nearestPoints=function(t,e){return new Ar(t,e).nearestPoints()};var Dr=l((function(){this._pt=[new S,new S],this._distance=b.NaN,this._isNull=!0}),"Ri");Dr.prototype.getCoordinates=function(){return this._pt},Dr.prototype.getCoordinate=function(t){return this._pt[t]},Dr.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)}},Dr.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],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Dr.prototype.toString=function(){return Q.toLineString(this._pt[0],this._pt[1])},Dr.prototype.getDistance=function(){return this._distance},Dr.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)}},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr};var Tr=l((function(){}),"Pi");Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.computeDistance=function(){if(arguments[2]instanceof Dr&&arguments[0]instanceof Zt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new yn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof te&&arguments[1]instanceof S){var a=arguments[0],l=arguments[1],u=arguments[2];Tr.computeDistance(a.getExteriorRing(),l,u);for(var c=0;c<a.getNumInteriorRing();c++)Tr.computeDistance(a.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof ht&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Zt)Tr.computeDistance(h,p,f);else if(h instanceof te)Tr.computeDistance(h,p,f);else if(h instanceof qt)for(var d=h,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);Tr.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Dr&&arguments[0]instanceof yn&&arguments[1]instanceof S){var v=arguments[0],m=arguments[1],_=arguments[2],b=v.closestPoint(m);_.setMinimum(b,m)}};var Lr=l((function(){this._g0=null,this._g1=null,this._ptDist=new Dr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),"Di"),Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Lr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Lr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Lr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Lr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Lr.prototype.computeOrientedDistance=function(t,e,n){var r=new Fr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new kr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Lr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Lr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Lr(n,r);return o.setDensifyFraction(i),o.distance()}},Rr.MaxPointDistanceFilter.get=function(){return Fr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Lr,Rr);var Fr=l((function(){this._maxPtDist=new Dr,this._minPtDist=new Dr,this._euclideanDist=new Tr,this._geom=null;var t=arguments[0];this._geom=t}),"Ai");Fr.prototype.filter=function(t){this._minPtDist.initialize(),Tr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[dt]},Fr.prototype.getClass=function(){return Fr};var kr=l((function(){this._maxPtDist=new Dr,this._minPtDist=new Dr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}),"Fi");kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,l=n.y+s*o,u=new S(a,l);this._minPtDist.initialize(),Tr.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[Ut]},kr.prototype.getClass=function(){return kr};var Br=l((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}),"Gi"),jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Br.prototype.checkMaximumDistance=function(t,e,n){var r=new Lr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Q.toLineString(i[0],i[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&&Y.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 te||this._input instanceof re||this._input instanceof qt))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 Ar(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Q.toLineString(i[0],i[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 It,n=new Sr(e),r=Ir.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},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,jr);var Gr=l((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}),"Bi"),zr={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 W(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new W(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 te||this._result instanceof re||(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;Y.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()},zr.VERBOSE.get=function(){return!1},zr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,zr);var Ur=l((function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"Ui");Ur.prototype.getCoordinates=function(){return this._pts},Ur.prototype.size=function(){return this._pts.length},Ur.prototype.getCoordinate=function(t){return this._pts[t]},Ur.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ur.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ur.prototype.setData=function(t){this._data=t},Ur.prototype.getData=function(){return this._data},Ur.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},Ur.prototype.interfaces_=function(){return[fn]},Ur.prototype.getClass=function(){return Ur};var qr=l((function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new It,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}),"zi");qr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qr.prototype.getIntersectionSegments=function(){return this._intSegments},qr.prototype.count=function(){return this._intersectionCount},qr.prototype.getIntersections=function(){return this._intersections},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r||this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},qr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qr.prototype.interfaces_=function(){return[Hn]},qr.prototype.getClass=function(){return qr},qr.createAllIntersectionsFinder=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e},qr.createAnyIntersectionFinder=function(t){return new qr(t)},qr.createIntersectionCounter=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=l((function(){this._li=new ot,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t}),"Xi");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 qr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new En;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 Oe(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 "+Q.toLineString(t[0],t[1])+" and "+Q.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 Yr=l((function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))}),"t");Yr.prototype.checkValid=function(){this._nv.checkValid()},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ur(r.getCoordinates(),r))}return e},Yr.checkValid=function(t){new Yr(t).checkValid()};var Xr=l((function(t){this._mapOp=t}),"ki");Xr.prototype.map=function(t){for(var e=new It,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(me.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var Wr=l((function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new It,this._resultLineList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}),"ji");Wr.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)}},Wr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Wr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Wr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Mi.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Wr.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 i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Wr.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))}},Wr.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)}},Wr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(nt.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Mi.isResultOfOp(r,e)&&e===Mi.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Jr=l((function(){this._op=null,this._geometryFactory=null,this._resultPointList=new It;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}),"Hi");Jr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Jr.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!==Mi.INTERSECTION)){var r=n.getLabel();Mi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Jr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr};var Hr=l((function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),"Wi");Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ne&&!r.isEmpty()||(n=!1);for(var i=new It,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ne||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new It;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new It,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(me.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof $t)return this.transformPoint(t,null);if(t instanceof ee)return this.transformMultiPoint(t,null);if(t instanceof ne)return this.transformLinearRing(t,null);if(t instanceof Zt)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof te)return this.transformPolygon(t,null);if(t instanceof re)return this.transformMultiPolygon(t,null);if(t instanceof qt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Hr.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)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Zr=l((function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new yn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Zt&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}}),"t");Zr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new S(o)),0===r&&this._isClosed&&t.set(t.size()-1,new S(o)))}},Zr.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},Zr.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Zr.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 i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new S(i),!1)}},Zr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=b.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Zr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Kr=l((function(t){this._srcGeom=t||null}),"Ji"),$r={SNAP_PRECISION_FACTOR:{configurable:!0}};Kr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Qr(e,n).transform(this._srcGeom)},Kr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Qr(t,n,!0).transform(this._srcGeom),i=r;return e&&A(i,Qt)&&(i=r.buffer(0)),i},Kr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Kr.prototype.extractTargetCoordinates=function(t){for(var e=new d,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Kr.prototype.computeMinimumSegmentLength=function(t){for(var e=b.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Kr(t);r[0]=i.snapTo(e,n);var o=new Kr(e);return r[1]=o.snapTo(r[0],n),r},Kr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Kr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===de.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kr.computeOverlaySnapTolerance(i),Kr.computeOverlaySnapTolerance(o))}},Kr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kr.SNAP_PRECISION_FACTOR},Kr.snapToSelf=function(t,e,n){return new Kr(t).snapToSelf(e,n)},$r.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,$r);var Qr=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 l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Zr(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}(Hr),ti=l((function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null}),"$i");ti.prototype.getCommon=function(){return b.longBitsToDouble(this._commonBits)},ti.prototype.add=function(t){var e=b.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=ti.signExpBits(this._commonBits),this._isFirst=!1,null):ti.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=ti.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=ti.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},ti.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=b.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+b.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.getBit=function(t,e){return t&1<<e?1:0},ti.signExpBits=function(t){return t>>52},ti.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},ti.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(ti.getBit(t,r)!==ti.getBit(e,r))return n;n++}return 52};var ei=l((function(){this._commonCoord=null,this._ccFilter=new ri}),"tr"),ni={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ei.prototype.addCommonBits=function(t){var e=new ii(this._commonCoord);t.apply(e),t.geometryChanged()},ei.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new S(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ii(e);return t.apply(n),t.geometryChanged(),t},ei.prototype.getCommonCoordinate=function(){return this._commonCoord},ei.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ni.CommonCoordinateFilter.get=function(){return ri},ni.Translater.get=function(){return ii},Object.defineProperties(ei,ni);var ri=l((function(){this._commonBitsX=new ti,this._commonBitsY=new ti}),"nr");ri.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ri.prototype.getCommonCoordinate=function(){return new S(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ri.prototype.interfaces_=function(){return[dt]},ri.prototype.getClass=function(){return ri};var ii=l((function(){this.trans=null;var t=arguments[0];this.trans=t}),"ir");ii.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)},ii.prototype.isDone=function(){return!1},ii.prototype.isGeometryChanged=function(){return!0},ii.prototype.interfaces_=function(){return[Ut]},ii.prototype.getClass=function(){return ii};var oi=l((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()}),"rr");oi.prototype.selfSnap=function(t){return new Kr(t).snapTo(t,this._snapTolerance)},oi.prototype.removeCommonBits=function(t){this._cbr=new ei,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},oi.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},oi.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Mi.overlayOp(e[0],e[1],t);return this.prepareResult(n)},oi.prototype.checkValid=function(t){t.isValid()||Y.out.println("Snapped geometry is invalid")},oi.prototype.computeSnapTolerance=function(){this._snapTolerance=Kr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},oi.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kr.snap(e[0],e[1],this._snapTolerance)},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Mi.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Mi.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Mi.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Mi.DIFFERENCE)};var si=l((function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e}),"or");si.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Mi.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof tt))throw t;r=t}if(!n)try{e=oi.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof tt?r:t}return e},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.overlayOp=function(t,e,n){return new si(t,e).getResultGeometry(n)},si.union=function(t,e){return si.overlayOp(t,e,Mi.UNION)},si.intersection=function(t,e){return si.overlayOp(t,e,Mi.INTERSECTION)},si.symDifference=function(t,e){return si.overlayOp(t,e,Mi.SYMDIFFERENCE)},si.difference=function(t,e){return si.overlayOp(t,e,Mi.DIFFERENCE)};var ai=l((function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}),"sr");ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var li=l((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],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}}),"t"),ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};li.prototype.isDelete=function(){return this._eventType===li.DELETE},li.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},li.prototype.getObject=function(){return this._obj},li.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},li.prototype.getInsertEvent=function(){return this._insertEvent},li.prototype.isInsert=function(){return this._eventType===li.INSERT},li.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},li.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},li.prototype.interfaces_=function(){return[x]},li.prototype.getClass=function(){return li},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(li,ui);var ci=l((function(){}),"lr");ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var hi=l((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}),"cr");hi.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hi.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hi.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hi.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hi.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hi.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},hi.prototype.hasProperIntersection=function(){return this._hasProper},hi.prototype.hasIntersection=function(){return this._hasIntersection},hi.prototype.isDone=function(){return this._isDone},hi.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},hi.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hi.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),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))))},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},hi.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pi=function(t){function e(){t.call(this),this.events=new It,this.nOverlaps=null}return l(e,"e"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){tn.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 hi&&A(arguments[0],Et)&&A(arguments[1],Et)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&A(arguments[0],Et)&&arguments[1]instanceof hi){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new ai(n,i),s=new li(e,n.getMinX(i),o);this.events.add(s),this.events.add(new li(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,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[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),fi=l((function(){this._min=b.POSITIVE_INFINITY,this._max=b.NEGATIVE_INFINITY}),"hr"),di={NodeComparator:{configurable:!0}};fi.prototype.getMin=function(){return this._min},fi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},fi.prototype.getMax=function(){return this._max},fi.prototype.toString=function(){return Q.toLineString(new S(this._min,0),new S(this._max,0))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},di.NodeComparator.get=function(){return gi},Object.defineProperties(fi,di);var gi=l((function(){}),"gr");gi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gi.prototype.interfaces_=function(){return[I]},gi.prototype.getClass=function(){return gi};var yi=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 l(e,"e"),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}(fi),vi=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 l(e,"e"),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}(fi),mi=l((function(){this._leaves=new It,this._root=null,this._level=0}),"_r");mi.prototype.buildTree=function(){tn.sort(this._leaves,new fi.NodeComparator);for(var t=this._leaves,e=null,n=new It;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},mi.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 yi(t,e,n))},mi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){Y.out.println(Q.toLineString(new S(t._min,this._level),new S(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.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 i=new vi(t.get(n),t.get(n+1));e.add(i)}}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var _i=l((function(){this._items=new It}),"mr");_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Ze]},_i.prototype.getClass=function(){return _i};var bi=l((function(){this._index=null;var t=arguments[0];if(!A(t,Qt))throw new _("Argument must be Polygonal");this._index=new Ei(t)}),"vr"),wi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};bi.prototype.locate=function(t){var e=new at(t),n=new xi(e);return this._index.query(t.y,t.y,n),e.getLocation()},bi.prototype.interfaces_=function(){return[zn]},bi.prototype.getClass=function(){return bi},wi.SegmentVisitor.get=function(){return xi},wi.IntervalIndexedGeometry.get=function(){return Ei},Object.defineProperties(bi,wi);var xi=l((function(){this._counter=null;var t=arguments[0];this._counter=t}),"Er");xi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},xi.prototype.interfaces_=function(){return[Ze]},xi.prototype.getClass=function(){return xi};var Ei=l((function(){this._index=new mi;var t=arguments[0];this.init(t)}),"xr");Ei.prototype.init=function(t){for(var e=Sr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},Ei.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new yn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},Ei.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var Ii=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 Nr,2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return l(e,"e"),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(),i=1;O.NONE,r.getLocation(t,Ne.ON)===O.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},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[0],r=arguments[1],i=arguments[2],o=new hi(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ne||this._parentGeom instanceof te||this._parentGeom instanceof re,l=r||!a;return s.computeIntersections(this._edges,o,l),this.addSelfIntersectionNodes(this._argIndex),o}},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 hi(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 $t){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof S){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=Mt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new rr(e,new Te(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),nt.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 i=r.next();e[n++]=i.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===O.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=Mt.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;lt.isCCW(r)&&(i=n,o=e);var s=new rr(r,new Te(this._argIndex,O.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Te(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.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 re&&(this._useBoundaryDeterminationRule=!1),e instanceof te)this.addPolygon(e);else if(e instanceof Zt)this.addLineString(e);else if(e instanceof $t)this.addPoint(e);else if(e instanceof ee)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof re)this.addCollection(e);else{if(!(e instanceof qt))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 A(this._parentGeom,Qt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new bi(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)?O.BOUNDARY:O.INTERIOR},e}(Ye),Si=l((function(){if(this._li=new ot,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 Ii(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.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 Ii(0,e,r),this._arg[1]=new Ii(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ii(0,i,s),this._arg[1]=new Ii(1,o,s)}}),"Cr");Si.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Si.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Ni=l((function(){}),"Sr");Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof ht&&A(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new It,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(A(arguments[0],wt)&&A(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new It,l=o.iterator();l.hasNext();){var u=l.next(),c=s.map(u);null!==c&&a.add(c)}return a}},Ni.MapOp=function(){};var Mi=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Jn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Ye(new Xn),this._geomFact=e.getFactory()}return l(e,"e"),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 Te(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.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,i){var o=new It;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},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)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new It,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 It;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Yr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Wr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Jr(this,this._geomFact,this._ptLocator);this._resultPointList=i.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(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ne.RIGHT),i.getLocation(1,Ne.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 i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(nt.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),nt.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.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}(Si);Mi.overlayOp=function(t,e,n){return new Mi(t,e).getResultGeometry(n)},Mi.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Mi.createEmptyResult(Mi.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.INTERSECTION)},Mi.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Mi.createEmptyResult(Mi.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.SYMDIFFERENCE)},Mi.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Mi.INTERSECTION:o=Math.min(r,i);break;case Mi.UNION:o=Math.max(r,i);break;case Mi.DIFFERENCE:o=r;break;case Mi.SYMDIFFERENCE:o=Math.max(r,i)}return o},Mi.createEmptyResult=function(t,e,n,r){var i=null;switch(Mi.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Mi.difference=function(t,e){return t.isEmpty()?Mi.createEmptyResult(Mi.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.DIFFERENCE))},Mi.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Mi.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Mi.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Mi.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Mi.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Mi.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Mi.INTERSECTION=1,Mi.UNION=2,Mi.DIFFERENCE=3,Mi.SYMDIFFERENCE=4;var Ci=l((function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new yn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)}),"br");Ci.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},Ci.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Ci.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Oi=l((function(){this._linework=null,this._linework=new It}),"wr");Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof te){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[zt]},Oi.prototype.getClass=function(){return Oi};var Pi=l((function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t}),"Or");Pi.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new It,n=Sr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,l=n*o/s,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new S(u-l,c+a);r.add(h)}if(this._doRight){var p=new S(u+l,c-a);r.add(p)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ai=l((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 It;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ci(this._geom[0],this._boundaryDistanceTolerance),new Ci(this._geom[1],this._boundaryDistanceTolerance),new Ci(this._geom[2],this._boundaryDistanceTolerance)]}),"t"),Di={TOLERANCE:{configurable:!0}};Ai.prototype.reportResult=function(t,e,n){Y.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ai.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Ai.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],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ai.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ai.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ai.prototype.isValidResult=function(t,e){var n=Mi.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ai.prototype.getInvalidLocation=function(){return this._invalidLocation},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ai.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Ai.isValid=function(t,e,n,r){return new Ai(t,e,r).isValid(n)},Di.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ai,Di);var Ti=l((function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e}),"t");Ti.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)}},Ti.prototype.combine=function(){for(var t=new It,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)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.combine=function(){if(1===arguments.length){var t=arguments[0];return new Ti(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Ti(Ti.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Ti(Ti.createList(r,i,o)).combine()}},Ti.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ti.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new It;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new It;return s.add(r),s.add(i),s.add(o),s}};var Li=l((function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new It)}),"Dr"),Ri={STRTREE_NODE_CAPACITY:{configurable:!0}};Li.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;A(r,Et)?i=this.unionTree(r):r instanceof ht&&(i=r),e.add(i)}return e},Li.prototype.extractByEnvelope=function(t,e,n){for(var r=new It,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Li.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Ti.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Li.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 an(Li.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)},Li.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 i=Li.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Li.getGeometry(e,n),Li.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Li.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},Li.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Li.prototype.unionActual=function(t,e){return Li.restrictToPolygons(t.union(e))},Li.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Li.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new It,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Ti.combine(r)},Li.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)}},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.restrictToPolygons=function(t){if(A(t,Qt))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Li.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Li.union=function(t){return new Li(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Li,Ri);var Fi=l((function(){}),"Ar");Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi},Fi.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Mi.createEmptyResult(Mi.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Mi.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=Se,t.OverlayOp=Mi,t.UnionOp=Fi,t.BufferOp=yr,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&typeof e<"u"?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r(n.jsts={})})),Ow={};function Mw(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function $N(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc],(function(t){return Rs(uh(t.data[0],t.data[1]))}),0,n)}function uh(t,e){return Au(t,e||{},0,0)}function Pw(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec],(function(t){return Rs(ic(t.data[0],_w(t.data[1])))}),1,n)}function ic(t,e){return ah(t,e)}function JG(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc,GN,function(){return[hw]}],(function(t){return Rs(hw(t.data[0],t.data[1]))}),2,n)}function hw(t,e){e||(e={});var n=Ql(),r=t.length;n.p(t);var i=Au(t,e,ww(e),8),o=i.length;return bw(i,e),Zt(i,o-8,n.d()),Zt(i,o-4,r),i}function JN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec,UN,function(){return[Vm]}],(function(t){return Rs(Vm(t.data[0]))}),3,n)}function Vm(t,e){return ah(t.subarray(xw(t),-8),e||new Dt(YN(t)))}function QG(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[tc,VN,function(){return[gw]}],(function(t){return Rs(gw(t.data[0],t.data[1]))}),4,n)}function gw(t,e){e||(e={});var n=vw();n.p(t);var r=Au(t,e,2,4);return Ew(r,e),Zt(r,r.length-4,n.d()),r}function QN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),rc(t,e,[ec,XN,function(){return[Ym]}],(function(t){return Rs(Ym(t.data[0],_w(t.data[1])))}),5,n)}function Ym(t,e){return ah((WN(t),t.subarray(2,-4)),e)}function t5(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Ne(7),31==t[0]&&139==t[1]&&8==t[2]?JN(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Pw(t,e,n):QN(t,e,n)}function r5(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Vm(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?ic(t,e):Ym(t,e)}function Ls(t,e){if(e){for(var n=new Dt(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(CN)return CN.encode(t);var i=t.length,o=new Dt(t.length+(t.length>>1)),s=0,a=l((function(t){o[s++]=t}),"w");for(r=0;r<i;++r){if(s+5>o.length){var u=new Dt(s+8+(i-r<<1));u.set(o),o=u}var c=t.charCodeAt(r);c<128||e?a(c):c<2048?(a(192|c>>6),a(128|63&c)):c>55295&&c<57344?(a(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++r))>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|63&c)):(a(224|c>>12),a(128|c>>6&63),a(128|63&c))}return go(o,0,s)}function Cw(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(mw)return mw.decode(t);var i=rT(t),o=i[0];return i[1].length&&Ne(8),o}function u5(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Ne(7);var r={};Sw(t,"",r,e);var i=Object.keys(r),o=i.length,s=0,a=0,u=o,c=new Array(o),h=[],p=l((function(){for(var t=0;t<h.length;++t)h[t]()}),"tAll"),f=l((function(t,e){Wm((function(){n(t,e)}))}),"cbd");Wm((function(){f=n}));var d=l((function(){var t=new Dt(a+22),e=s,n=a-s;a=0;for(var r=0;r<u;++r){var i=c[r];try{var o=i.c.length;$l(t,a,i,i.f,i.u,o);var l=30+i.f.length+As(i.extra),h=a+l;t.set(i.c,h),$l(t,s,i,i.f,i.u,o,a,i.m),s+=16+l+(i.m?i.m.length:0),a=h+o}catch(t){return f(t,null)}}kw(t,s,c.length,n,e),f(null,t)}),"cbf");o||d();for(var g=l((function(t){var e=i[t],n=r[e],u=n[0],g=n[1],y=Ql(),v=u.length;y.p(u);var m=Ls(e),_=m.length,b=g.comment,w=b&&Ls(b),x=w&&w.length,E=As(g.extra),I=0==g.level?0:8,S=l((function(n,r){if(n)p(),f(n,null);else{var i=r.length;c[t]=sh(g,{size:v,crc:y.d(),c:r,f:m,m:w,u:_!=e.length||w&&b.length!=x,compression:I}),s+=30+_+E+i,a+=76+2*(_+E)+(x||0)+i,--o||d()}}),"cbl");if(_>65535&&S(Ne(11,0,1),null),I)if(v<16e4)try{S(null,uh(u,g))}catch(t){S(t,null)}else h.push($N(u,g,S));else S(null,u)}),"_loop_1"),y=0;y<u;++y)g(y);return p}function l5(t,e){e||(e={});var n={},r=[];Sw(t,"",n,e);var i=0,o=0;for(var s in n){var a=n[s],l=a[0],u=a[1],c=0==u.level?0:8,h=(E=Ls(s)).length,p=u.comment,f=p&&Ls(p),d=f&&f.length,g=As(u.extra);h>65535&&Ne(11);var y=c?uh(l,u):l,v=y.length,m=Ql();m.p(l),r.push(sh(u,{size:l.length,crc:m.d(),c:y,f:E,m:f,u:h!=s.length||f&&p.length!=d,o:i,compression:c})),i+=30+h+g+v,o+=76+2*(h+g)+(d||0)+v}for(var _=new Dt(o+22),b=i,w=o-i,x=0;x<r.length;++x){var E=r[x];$l(_,E.o,E,E.f,E.u,E.c.length);var I=30+E.f.length+As(E.extra);_.set(E.c,E.o+I),$l(_,i,E,E.f,E.u,E.c.length,E.o,E.m),i+=16+I+(E.m?E.m.length:0)}return kw(_,i,r.length,w,b),_}function h5(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Ne(7);var r=[],i=l((function(){for(var t=0;t<r.length;++t)r[t]()}),"tAll"),o={},s=l((function(t,e){Wm((function(){n(t,e)}))}),"cbd");Wm((function(){s=n}));for(var a=t.length-22;101010256!=Qr(t,a);--a)if(!a||t.length-a>65558)return s(Ne(13,0,1),null),i;var u=Ei(t,a+8);if(u){var c=u,h=Qr(t,a+16),p=4294967295==h;if(p){if(a=Qr(t,a-12),101075792!=Qr(t,a))return s(Ne(13,0,1),null),i;c=u=Qr(t,a+32),h=Qr(t,a+48)}for(var f=e&&e.filter,d=l((function(e){var n=oT(t,h,p),a=n[0],c=n[1],d=n[2],g=n[3],y=n[4],v=n[5],m=iT(t,v);h=y;var _=l((function(t,e){t?(i(),s(t,null)):(e&&(o[g]=e),--u||s(null,o))}),"cbl");if(!f||f({name:g,size:c,originalSize:d,compression:a}))if(a)if(8==a){var b=t.subarray(m,m+c);if(c<32e4)try{_(null,ic(b,new Dt(d)))}catch(t){_(t,null)}else r.push(Pw(b,{size:d},_))}else _(Ne(14,"unknown compression type "+a,1),null);else _(null,go(t,m,m+c));else _(null,null)}),"_loop_3"),g=0;g<c;++g)d(g)}else s(null,{});return i}function d5(t,e){for(var n={},r=t.length-22;101010256!=Qr(t,r);--r)(!r||t.length-r>65558)&&Ne(13);var i=Ei(t,r+8);if(!i)return{};var o=Qr(t,r+16),s=4294967295==o;s&&(r=Qr(t,r-12),101075792!=Qr(t,r)&&Ne(13),i=Qr(t,r+32),o=Qr(t,r+48));for(var a=e&&e.filter,l=0;l<i;++l){var u=oT(t,o,s),c=u[0],h=u[1],p=u[2],f=u[3],d=u[4],g=u[5],y=iT(t,g);o=d,(!a||a({name:f,size:h,originalSize:p,compression:c}))&&(c?8==c?n[f]=ic(t.subarray(y,y+h),new Dt(p)):Ne(14,"unknown compression type "+c):n[f]=go(t,y,y+h))}return n}EA(Ow,{AsyncCompress:()=>KG,AsyncDecompress:()=>e5,AsyncDeflate:()=>HN,AsyncGunzip:()=>KN,AsyncGzip:()=>KG,AsyncInflate:()=>Iw,AsyncUnzipInflate:()=>f5,AsyncUnzlib:()=>ZN,AsyncZipDeflate:()=>a5,AsyncZlib:()=>ZG,Compress:()=>pw,DecodeUTF8:()=>n5,Decompress:()=>eT,Deflate:()=>va,EncodeUTF8:()=>i5,FlateErrorCode:()=>HG,Gunzip:()=>Um,Gzip:()=>pw,Inflate:()=>Ni,Unzip:()=>p5,UnzipInflate:()=>c5,UnzipPassThrough:()=>sT,Unzlib:()=>Xm,Zip:()=>s5,ZipDeflate:()=>o5,ZipPassThrough:()=>ih,Zlib:()=>dw,compress:()=>JG,compressSync:()=>hw,decompress:()=>t5,decompressSync:()=>r5,deflate:()=>$N,deflateSync:()=>uh,gunzip:()=>JN,gunzipSync:()=>Vm,gzip:()=>JG,gzipSync:()=>hw,inflate:()=>Pw,inflateSync:()=>ic,strFromU8:()=>Cw,strToU8:()=>Ls,unzip:()=>h5,unzipSync:()=>d5,unzlib:()=>QN,unzlibSync:()=>Ym,zip:()=>u5,zipSync:()=>l5,zlib:()=>QG,zlibSync:()=>gw});var PN,WG,Dt,ai,Kl,Jl,Zl,rh,kN,ON,yw,zm,NN,TN,lw,nh,Ha,ho,Ka,Hl,Kt,AN,LN,RN,DN,Fm,po,Bm,oh,go,HG,FN,Ne,ah,ya,Yl,jm,qm,cw,Wl,Gm,fw,BN,$a,jN,zN,Ql,vw,Au,sh,SN,Dm,$G,qN,ec,tc,GN,UN,VN,XN,Rs,_w,rc,mo,nc,Ei,Qr,uw,Zt,bw,xw,YN,ww,Ew,WN,va,HN,Ni,Iw,pw,KG,Um,KN,dw,ZG,Xm,ZN,eT,e5,Sw,CN,mw,tT,rT,n5,i5,nT,iT,oT,aT,As,$l,kw,ih,o5,a5,s5,sT,c5,f5,p5,Wm,Nw=AE((()=>{for(y(),PN={},WG=l((function(t,e,n,r,i){var o=new Worker(PN[e]||(PN[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,e)},o.postMessage(n,r),o}),"wk"),Dt=Uint8Array,ai=Uint16Array,Kl=Uint32Array,Jl=new Dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Zl=new Dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rh=new Dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kN=l((function(t,e){for(var n=new ai(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Kl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]}),"freb"),ON=kN(Jl,2),yw=ON[0],zm=ON[1],yw[28]=258,zm[258]=28,NN=kN(Zl,0),TN=NN[0],lw=NN[1],nh=new ai(32768),Kt=0;Kt<32768;++Kt)Ha=(61680&(Ha=(52428&(Ha=(43690&Kt)>>>1|(21845&Kt)<<1))>>>2|(13107&Ha)<<2))>>>4|(3855&Ha)<<4,nh[Kt]=((65280&Ha)>>>8|(255&Ha)<<8)>>>1;for(ho=l((function(t,e,n){for(var r=t.length,i=0,o=new ai(e);i<r;++i)t[i]&&++o[t[i]-1];var s,a=new ai(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new ai(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=a[t[i]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[nh[h]>>>l]=u}else for(s=new ai(r),i=0;i<r;++i)t[i]&&(s[i]=nh[a[t[i]-1]++]>>>15-t[i]);return s}),"hMap"),Ka=new Dt(288),Kt=0;Kt<144;++Kt)Ka[Kt]=8;for(Kt=144;Kt<256;++Kt)Ka[Kt]=9;for(Kt=256;Kt<280;++Kt)Ka[Kt]=7;for(Kt=280;Kt<288;++Kt)Ka[Kt]=8;for(Hl=new Dt(32),Kt=0;Kt<32;++Kt)Hl[Kt]=5;AN=ho(Ka,9,0),LN=ho(Ka,9,1),RN=ho(Hl,5,0),DN=ho(Hl,5,1),Fm=l((function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e}),"max"),po=l((function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n}),"bits"),Bm=l((function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)}),"bits16"),oh=l((function(t){return(t+7)/8|0}),"shft"),go=l((function(t,e,n){(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length);var r=new(2==t.BYTES_PER_ELEMENT?ai:4==t.BYTES_PER_ELEMENT?Kl:Dt)(n-e);return r.set(t.subarray(e,n)),r}),"slc"),HG={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},FN=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ne=l((function(t,e,n){var r=new Error(e||FN[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ne),!n)throw r;return r}),"err"),ah=l((function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new Dt(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new Dt(3*r));var s=l((function(t){var n=e.length;if(t>n){var r=new Dt(Math.max(2*n,t));r.set(e),e=r}}),"cbuf"),a=n.f||0,u=n.p||0,c=n.b||0,h=n.l,p=n.d,f=n.m,d=n.n,g=8*r;do{if(!h){a=po(t,u,1);var y=po(t,u+1,3);if(u+=3,!y){var v=t[(C=oh(u)+4)-4]|t[C-3]<<8,m=C+v;if(m>r){o&&Ne(0);break}i&&s(c+v),e.set(t.subarray(C,m),c),n.b=c+=v,n.p=u=8*m,n.f=a;continue}if(1==y)h=LN,p=DN,f=9,d=5;else if(2==y){var _=po(t,u,31)+257,b=po(t,u+10,15)+4,w=_+po(t,u+5,31)+1;u+=14;for(var x=new Dt(w),E=new Dt(19),I=0;I<b;++I)E[rh[I]]=po(t,u+3*I,7);u+=3*b;var S=Fm(E),N=(1<<S)-1,M=ho(E,S,1);for(I=0;I<w;){var C,O=M[po(t,u,N)];if(u+=15&O,(C=O>>>4)<16)x[I++]=C;else{var P=0,A=0;for(16==C?(A=3+po(t,u,3),u+=2,P=x[I-1]):17==C?(A=3+po(t,u,7),u+=3):18==C&&(A=11+po(t,u,127),u+=7);A--;)x[I++]=P}}var D=x.subarray(0,_),T=x.subarray(_);f=Fm(D),d=Fm(T),h=ho(D,f,1),p=ho(T,d,1)}else Ne(1);if(u>g){o&&Ne(0);break}}i&&s(c+131072);for(var L=(1<<f)-1,R=(1<<d)-1,F=u;;F=u){var k=(P=h[Bm(t,u)&L])>>>4;if((u+=15&P)>g){o&&Ne(0);break}if(P||Ne(2),k<256)e[c++]=k;else{if(256==k){F=u,h=null;break}var B=k-254;if(k>264){var j=Jl[I=k-257];B=po(t,u,(1<<j)-1)+yw[I],u+=j}var G=p[Bm(t,u)&R],z=G>>>4;G||Ne(3),u+=15&G;T=TN[z];if(z>3){j=Zl[z];T+=Bm(t,u)&(1<<j)-1,u+=j}if(u>g){o&&Ne(0);break}i&&s(c+131072);for(var U=c+B;c<U;c+=4)e[c]=e[c-T],e[c+1]=e[c+1-T],e[c+2]=e[c+2-T],e[c+3]=e[c+3-T];c=U}}n.l=h,n.p=F,n.b=c,n.f=a,h&&(a=1,n.m=f,n.d=p,n.n=d)}while(!a);return c==e.length?e:go(e,0,c)}),"inflt"),ya=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8}),"wbits"),Yl=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16}),"wbits16"),jm=l((function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[$a,0];if(1==i){var s=new Dt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new ai(p+1),d=qm(n[c-1],f,0);if(d>e){r=0;var g=0,y=d-e,v=1<<y;for(o.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));r<i;++r){var m=o[r].s;if(!(f[m]>e))break;g+=v-(1<<d-f[m]),f[m]=e}for(g>>>=y;g>0;){var _=o[r].s;f[_]<e?g-=1<<e-f[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;f[b]==e&&(--f[b],++g)}d=e}return[new Dt(f),d]}),"hTree"),qm=l((function(t,e,n){return-1==t.s?Math.max(qm(t.l,e,n+1),qm(t.r,e,n+1)):e[t.s]=n}),"ln"),cw=l((function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ai(++e),r=0,i=t[0],o=1,s=l((function(t){n[r++]=t}),"w"),a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]}),"lc"),Wl=l((function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n}),"clen"),Gm=l((function(t,e,n){var r=n.length,i=oh(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)}),"wfblk"),fw=l((function(t,e,n,r,i,o,s,a,l,u,c){ya(e,c++,n),++i[256];for(var h=jm(i,15),p=h[0],f=h[1],d=jm(o,15),g=d[0],y=d[1],v=cw(p),m=v[0],_=v[1],b=cw(g),w=b[0],x=b[1],E=new ai(19),I=0;I<m.length;++I)E[31&m[I]]++;for(I=0;I<w.length;++I)E[31&w[I]]++;for(var S=jm(E,7),N=S[0],M=S[1],C=19;C>4&&!N[rh[C-1]];--C);var O,P,A,D,T=u+5<<3,L=Wl(i,Ka)+Wl(o,Hl)+s,R=Wl(i,p)+Wl(o,g)+s+14+3*C+Wl(E,N)+(2*E[16]+3*E[17]+7*E[18]);if(T<=L&&T<=R)return Gm(e,c,t.subarray(l,l+u));if(ya(e,c,1+(R<L)),c+=2,R<L){O=ho(p,f,0),P=p,A=ho(g,y,0),D=g;var F=ho(N,M,0);ya(e,c,_-257),ya(e,c+5,x-1),ya(e,c+10,C-4),c+=14;for(I=0;I<C;++I)ya(e,c+3*I,N[rh[I]]);c+=3*C;for(var k=[m,w],B=0;B<2;++B){var j=k[B];for(I=0;I<j.length;++I){var G=31&j[I];ya(e,c,F[G]),c+=N[G],G>15&&(ya(e,c,j[I]>>>5&127),c+=j[I]>>>12)}}}else O=AN,P=Ka,A=RN,D=Hl;for(I=0;I<a;++I)if(r[I]>255){G=r[I]>>>18&31;Yl(e,c,O[G+257]),c+=P[G+257],G>7&&(ya(e,c,r[I]>>>23&31),c+=Jl[G]);var z=31&r[I];Yl(e,c,A[z]),c+=D[z],z>3&&(Yl(e,c,r[I]>>>5&8191),c+=Zl[z])}else Yl(e,c,O[r[I]]),c+=P[r[I]];return Yl(e,c,O[256]),c+P[256]}),"wblk"),BN=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$a=new Dt(0),jN=l((function(t,e,n,r,i,o){var s=t.length,a=new Dt(r+s+5*(1+Math.ceil(s/7e3))+i),u=a.subarray(r,a.length-i),c=0;if(!e||s<8)for(var h=0;h<=s;h+=65535){var p=h+65535;p>=s&&(u[c>>3]=o),c=Gm(u,c+1,t.subarray(h,p))}else{for(var f=BN[e-1],d=f>>>13,g=8191&f,y=(1<<n)-1,v=new ai(32768),m=new ai(y+1),_=Math.ceil(n/3),b=2*_,w=l((function(e){return(t[e]^t[e+1]<<_^t[e+2]<<b)&y}),"hsh"),x=new Kl(25e3),E=new ai(288),I=new ai(32),S=0,N=0,M=(h=0,0),C=0,O=0;h<s;++h){var P=w(h),A=32767&h,D=m[P];if(v[A]=D,m[P]=A,C<=h){var T=s-h;if((S>7e3||M>24576)&&T>423){c=fw(t,u,0,x,E,I,N,M,O,h-O,c),M=S=N=0,O=h;for(var L=0;L<286;++L)E[L]=0;for(L=0;L<30;++L)I[L]=0}var R=2,F=0,k=g,B=A-D&32767;if(T>2&&P==w(h-B))for(var j=Math.min(d,T)-1,G=Math.min(32767,h),z=Math.min(258,T);B<=G&&--k&&A!=D;){if(t[h+R]==t[h+R-B]){for(var U=0;U<z&&t[h+U]==t[h+U-B];++U);if(U>R){if(R=U,F=B,U>j)break;var q=Math.min(B,U-2),V=0;for(L=0;L<q;++L){var Y=h-B+L+32768&32767,X=Y-v[Y]+32768&32767;X>V&&(V=X,D=Y)}}}B+=(A=D)-(D=v[A])+32768&32767}if(F){x[M++]=268435456|zm[R]<<18|lw[F];var W=31&zm[R],J=31&lw[F];N+=Jl[W]+Zl[J],++E[257+W],++I[J],C=h+R,++S}else x[M++]=t[h],++E[t[h]]}}c=fw(t,u,o,x,E,I,N,M,O,h-O,c),!o&&7&c&&(c=Gm(u,c+1,$a))}return go(a,0,r+oh(c)+i)}),"dflt"),zN=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),Ql=l((function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=zN[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}}),"crc"),vw=l((function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,o=0|n.length,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}}),"adler"),Au=l((function(t,e,n,r,i){return jN(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!i)}),"dopt"),sh=l((function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n}),"mrg"),SN=l((function(t,e,n){for(var r=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var a=r[s],l=o[s];if("function"==typeof a){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var h in e+=u,a.prototype)e+=";"+l+".prototype."+h+"="+a.prototype[h].toString();else e+=u}else n[l]=a}return[e,n]}),"wcln"),Dm=[],$G=l((function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}),"cbfs"),qN=l((function(t,e,n,r){var i;if(!Dm[n]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)o=(i=SN(t[l],o,s))[0],s=i[1];Dm[n]=SN(t[a],o,s)}var u=sh({},Dm[n][1]);return WG(Dm[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,$G(u),r)}),"wrkr"),ec=l((function(){return[Dt,ai,Kl,Jl,Zl,rh,yw,TN,LN,DN,nh,FN,ho,Fm,po,Bm,oh,go,Ne,ah,ic,Rs,_w]}),"bInflt"),tc=l((function(){return[Dt,ai,Kl,Jl,Zl,rh,zm,lw,AN,Ka,RN,Hl,nh,BN,$a,ho,ya,Yl,jm,qm,cw,Wl,Gm,fw,oh,go,jN,Au,uh,Rs]}),"bDflt"),GN=l((function(){return[bw,ww,Zt,Ql,zN]}),"gze"),UN=l((function(){return[xw,YN]}),"guze"),VN=l((function(){return[Ew,Zt,vw]}),"zle"),XN=l((function(){return[WN]}),"zule"),Rs=l((function(t){return postMessage(t,[t.buffer])}),"pbf"),_w=l((function(t){return t&&t.size&&new Dt(t.size)}),"gu8"),rc=l((function(t,e,n,r,i,o){var s=qN(n,r,i,(function(t,e){s.terminate(),o(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}}),"cbify"),mo=l((function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}}),"astrm"),nc=l((function(t,e,n,r,i){var o,s=qN(t,r,i,(function(t,n){t?(s.terminate(),e.ondata.call(e,t)):(n[1]&&s.terminate(),e.ondata.call(e,t,n[0],n[1]))}));s.postMessage(n),e.push=function(t,n){e.ondata||Ne(5),o&&e.ondata(Ne(4,0,1),null,!!n),s.postMessage([t,o=n],[t.buffer])},e.terminate=function(){s.terminate()}}),"astrmify"),Ei=l((function(t,e){return t[e]|t[e+1]<<8}),"b2"),Qr=l((function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}),"b4"),uw=l((function(t,e){return Qr(t,e)+4294967296*Qr(t,e+4)}),"b8"),Zt=l((function(t,e,n){for(;n;++e)t[e]=n,n>>>=8}),"wbytes"),bw=l((function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Zt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}}),"gzh"),xw=l((function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&Ne(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)}),"gzs"),YN=l((function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}),"gzl"),ww=l((function(t){return 10+(t.filename&&t.filename.length+1||0)}),"gzhl"),Ew=l((function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)}),"zlh"),WN=l((function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Ne(6,"invalid zlib data"),32&t[1]&&Ne(6,"invalid zlib data: preset dictionaries not supported")}),"zlv"),l(Mw,"AsyncCmpStrm"),va=function(){function t(t,e){!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{}}return l(t,"Deflate"),t.prototype.p=function(t,e){this.ondata(Au(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||Ne(5),this.d&&Ne(4),this.d=e,this.p(t,e||!1)},t}(),HN=function(){function t(t,e){nc([tc,function(){return[mo,va]}],this,Mw.call(this,t,e),(function(t){var e=new va(t.data);onmessage=mo(e)}),6)}return l(t,"AsyncDeflate"),t}(),l($N,"deflate"),l(uh,"deflateSync"),Ni=function(){function t(t){this.s={},this.p=new Dt(0),this.ondata=t}return l(t,"Inflate"),t.prototype.e=function(t){this.ondata||Ne(5),this.d&&Ne(4);var e=this.p.length,n=new Dt(e+t.length);n.set(this.p),n.set(t,e),this.p=n},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,n=ah(this.p,this.o,this.s);this.ondata(go(n,e,this.s.b),this.d),this.o=go(n,this.s.b-32768),this.s.b=this.o.length,this.p=go(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Iw=function(){function t(t){this.ondata=t,nc([ec,function(){return[mo,Ni]}],this,0,(function(){var t=new Ni;onmessage=mo(t)}),7)}return l(t,"AsyncInflate"),t}(),l(Pw,"inflate"),l(ic,"inflateSync"),pw=function(){function t(t,e){this.c=Ql(),this.l=0,this.v=1,va.call(this,t,e)}return l(t,"Gzip"),t.prototype.push=function(t,e){va.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Au(t,this.o,this.v&&ww(this.o),e&&8,!e);this.v&&(bw(n,this.o),this.v=0),e&&(Zt(n,n.length-8,this.c.d()),Zt(n,n.length-4,this.l)),this.ondata(n,e)},t}(),KG=function(){function t(t,e){nc([tc,GN,function(){return[mo,va,pw]}],this,Mw.call(this,t,e),(function(t){var e=new pw(t.data);onmessage=mo(e)}),8)}return l(t,"AsyncGzip"),t}(),l(JG,"gzip"),l(hw,"gzipSync"),Um=function(){function t(t){this.v=1,Ni.call(this,t)}return l(t,"Gunzip"),t.prototype.push=function(t,e){if(Ni.prototype.e.call(this,t),this.v){var n=this.p.length>3?xw(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&Ne(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Ni.prototype.c.call(this,e)},t}(),KN=function(){function t(t){this.ondata=t,nc([ec,UN,function(){return[mo,Ni,Um]}],this,0,(function(){var t=new Um;onmessage=mo(t)}),9)}return l(t,"AsyncGunzip"),t}(),l(JN,"gunzip"),l(Vm,"gunzipSync"),dw=function(){function t(t,e){this.c=vw(),this.v=1,va.call(this,t,e)}return l(t,"Zlib"),t.prototype.push=function(t,e){va.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Au(t,this.o,this.v&&2,e&&4,!e);this.v&&(Ew(n,this.o),this.v=0),e&&Zt(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),ZG=function(){function t(t,e){nc([tc,VN,function(){return[mo,va,dw]}],this,Mw.call(this,t,e),(function(t){var e=new dw(t.data);onmessage=mo(e)}),10)}return l(t,"AsyncZlib"),t}(),l(QG,"zlib"),l(gw,"zlibSync"),Xm=function(){function t(t){this.v=1,Ni.call(this,t)}return l(t,"Unzlib"),t.prototype.push=function(t,e){if(Ni.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&Ne(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ni.prototype.c.call(this,e)},t}(),ZN=function(){function t(t){this.ondata=t,nc([ec,XN,function(){return[mo,Ni,Xm]}],this,0,(function(){var t=new Xm;onmessage=mo(t)}),11)}return l(t,"AsyncUnzlib"),t}(),l(QN,"unzlib"),l(Ym,"unzlibSync"),eT=function(){function t(t){this.G=Um,this.I=Ni,this.Z=Xm,this.ondata=t}return l(t,"Decompress"),t.prototype.push=function(t,e){if(this.ondata||Ne(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new Dt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,i=l((function(){r.ondata.apply(r,arguments)}),"cb");this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,e),this.p=null}}},t}(),e5=function(){function t(t){this.G=KN,this.I=Iw,this.Z=ZN,this.ondata=t}return l(t,"AsyncDecompress"),t.prototype.push=function(t,e){eT.prototype.push.call(this,t,e)},t}(),l(t5,"decompress"),l(r5,"decompressSync"),Sw=l((function(t,e,n,r){for(var i in t){var o=t[i],s=e+i,a=r;Array.isArray(o)&&(a=sh(r,o[1]),o=o[0]),o instanceof Dt?n[s]=[o,a]:(n[s+="/"]=[new Dt(0),a],Sw(o,s,n,r))}}),"fltn"),CN=typeof TextEncoder<"u"&&new TextEncoder,mw=typeof TextDecoder<"u"&&new TextDecoder,tT=0;try{mw.decode($a,{stream:!0}),tT=1}catch{}rT=l((function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return[e,go(t,n-1)];i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}}),"dutf8"),n5=function(){function t(t){this.ondata=t,tT?this.t=new TextDecoder:this.p=$a}return l(t,"DecodeUTF8"),t.prototype.push=function(t,e){if(this.ondata||Ne(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&Ne(8),this.t=null));this.p||Ne(4);var n=new Dt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=rT(n),i=r[0],o=r[1];e?(o.length&&Ne(8),this.p=null):this.p=o,this.ondata(i,e)},t}(),i5=function(){function t(t){this.ondata=t}return l(t,"EncodeUTF8"),t.prototype.push=function(t,e){this.ondata||Ne(5),this.d&&Ne(4),this.ondata(Ls(t),this.d=e||!1)},t}(),l(Ls,"strToU8"),l(Cw,"strFromU8"),nT=l((function(t){return 1==t?3:t<6?2:9==t?1:0}),"dbf"),iT=l((function(t,e){return e+30+Ei(t,e+26)+Ei(t,e+28)}),"slzh"),oT=l((function(t,e,n){var r=Ei(t,e+28),i=Cw(t.subarray(e+46,e+46+r),!(2048&Ei(t,e+8))),o=e+46+r,s=Qr(t,e+20),a=n&&4294967295==s?aT(t,o):[s,Qr(t,e+24),Qr(t,e+42)],l=a[0],u=a[1],c=a[2];return[Ei(t,e+10),l,u,i,o+Ei(t,e+30)+Ei(t,e+32),c]}),"zh"),aT=l((function(t,e){for(;1!=Ei(t,e);e+=4+Ei(t,e+2));return[uw(t,e+12),uw(t,e+4),uw(t,e+20)]}),"z64e"),As=l((function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&Ne(9),e+=r+4}return e}),"exfl"),$l=l((function(t,e,n,r,i,o,s,a){var l=r.length,u=n.extra,c=a&&a.length,h=As(u);Zt(t,e,null!=s?33639248:67324752),e+=4,null!=s&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(null==o&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var p=new Date(null==n.mtime?Date.now():n.mtime),f=p.getFullYear()-1980;if((f<0||f>119)&&Ne(10),Zt(t,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),e+=4,null!=o&&(Zt(t,e,n.crc),Zt(t,e+4,o),Zt(t,e+8,n.size)),Zt(t,e+12,l),Zt(t,e+14,h),e+=16,null!=s&&(Zt(t,e,c),Zt(t,e+6,n.attrs),Zt(t,e+10,s),e+=14),t.set(r,e),e+=l,h)for(var d in u){var g=u[d],y=g.length;Zt(t,e,+d),Zt(t,e+2,y),t.set(g,e+4),e+=4+y}return c&&(t.set(a,e),e+=c),e}),"wzh"),kw=l((function(t,e,n,r,i){Zt(t,e,101010256),Zt(t,e+8,n),Zt(t,e+10,n),Zt(t,e+12,r),Zt(t,e+16,i)}),"wzf"),ih=function(){function t(t){this.filename=t,this.c=Ql(),this.size=0,this.compression=0}return l(t,"ZipPassThrough"),t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||Ne(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),o5=function(){function t(t,e){var n=this;e||(e={}),ih.call(this,t),this.d=new va(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=nT(e.level)}return l(t,"ZipDeflate"),t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ih.prototype.push.call(this,t,e)},t}(),a5=function(){function t(t,e){var n=this;e||(e={}),ih.call(this,t),this.d=new HN(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=nT(e.level),this.terminate=this.d.terminate}return l(t,"AsyncZipDeflate"),t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ih.prototype.push.call(this,t,e)},t}(),s5=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return l(t,"Zip"),t.prototype.add=function(t){var e=this;if(this.ondata||Ne(5),2&this.d)this.ondata(Ne(4+8*(1&this.d),0,1),null,!1);else{var n=Ls(t.filename),r=n.length,i=t.comment,o=i&&Ls(i),s=r!=t.filename.length||o&&i.length!=o.length,a=r+As(t.extra)+30;r>65535&&this.ondata(Ne(11,0,1),null,!1);var u=new Dt(a);$l(u,0,t,n,s);var c=[u],h=l((function(){for(var t=0,n=c;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}c=[]}),"pAll_1"),p=this.d;this.d=0;var f=this.u.length,d=sh(t,{f:n,u:s,o:o,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),p){var t=e.u[f+1];t?t.r():e.d=1}p=1}}),g=0;t.ondata=function(n,r,i){if(n)e.ondata(n,r,i),e.terminate();else if(g+=r.length,c.push(r),i){var o=new Dt(16);Zt(o,0,134695760),Zt(o,4,t.crc),Zt(o,8,g),Zt(o,12,t.size),c.push(o),d.c=g,d.b=a+g+16,d.crc=t.crc,d.size=t.size,p&&d.r(),p=1}else p&&h()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(Ne(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,i=this.u;r<i.length;r++){n+=46+(l=i[r]).f.length+As(l.extra)+(l.o?l.o.length:0)}for(var o=new Dt(n+22),s=0,a=this.u;s<a.length;s++){var l=a[s];$l(o,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+As(l.extra)+(l.o?l.o.length:0),e+=l.b}kw(o,t,this.u.length,n,e),this.ondata(null,o,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}(),l(u5,"zip"),l(l5,"zipSync"),sT=function(){function t(){}return l(t,"UnzipPassThrough"),t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),c5=function(){function t(){var t=this;this.i=new Ni((function(e,n){t.ondata(null,e,n)}))}return l(t,"UnzipInflate"),t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),f5=function(){function t(t,e){var n=this;e<32e4?this.i=new Ni((function(t,e){n.ondata(null,t,e)})):(this.i=new Iw((function(t,e,r){n.ondata(t,e,r)})),this.terminate=this.i.terminate)}return l(t,"AsyncUnzipInflate"),t.prototype.push=function(t,e){this.i.terminate&&(t=go(t,0)),this.i.push(t,e)},t.compression=8,t}(),p5=function(){function t(t){this.onfile=t,this.k=[],this.o={0:sT},this.p=$a}return l(t,"Unzip"),t.prototype.push=function(t,e){var n=this;if(this.onfile||Ne(5),this.p||Ne(4),this.c>0){var r=Math.min(this.c,t.length),i=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(t=t.subarray(r)).length)return this.push(t,e)}else{var o=0,s=0,a=void 0,u=void 0;this.p.length?t.length?((u=new Dt(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,h=this.c,p=h&&this.d,f=l((function(){var t,e=Qr(u,s);if(67324752==e){o=1,a=s,d.d=null,d.c=0;var r=Ei(u,s+6),i=Ei(u,s+8),l=2048&r,p=8&r,f=Ei(u,s+26),g=Ei(u,s+28);if(c>s+30+f+g){var y=[];d.k.unshift(y),o=2;var v=Qr(u,s+18),m=Qr(u,s+22),_=Cw(u.subarray(s+30,s+=30+f),!l);4294967295==v?(t=p?[-2]:aT(u,s),v=t[0],m=t[1]):p&&(v=-1),s+=g,d.c=v;var b,w={name:_,compression:i,start:function(){if(w.ondata||Ne(5),v){var t=n.o[i];t||w.ondata(Ne(14,"unknown compression type "+i,1),null,!1),(b=v<0?new t(_):new t(_,v,m)).ondata=function(t,e,n){w.ondata(t,e,n)};for(var e=0,r=y;e<r.length;e++){var o=r[e];b.push(o,!1)}n.k[0]==y&&n.c?n.d=b:b.push($a,!0)}else w.ondata(null,$a,!0)},terminate:function(){b&&b.terminate&&b.terminate()}};v>=0&&(w.size=v,w.originalSize=m),d.onfile(w)}return"break"}if(h){if(134695760==e)return a=s+=12+(-2==h&&8),o=3,d.c=0,"break";if(33639248==e)return a=s-=4,o=3,d.c=0,"break"}}),"_loop_2"),d=this;s<c-4;++s){if("break"===f())break}if(this.p=$a,h<0){var g=o?u.subarray(0,a-12-(-2==h&&8)-(134695760==Qr(u,a-16)&&4)):u.subarray(0,s);p?p.push(g,!!o):this.k[+(2==o)].push(g)}if(2&o)return this.push(u.subarray(s),e);this.p=u.subarray(s)}e&&(this.c&&Ne(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),Wm="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()},l(h5,"unzip"),l(d5,"unzipSync")})),xT=fe(((t,e)=>{"use strict";y(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>"%".concat(t.charCodeAt(0).toString(16).toUpperCase())))})),PT=fe(((t,e)=>{"use strict";y();var n="%[a-f0-9]{2}",r=new RegExp("("+n+")|([^%]+?)","gi"),i=new RegExp("("+n+")+","gi");function o(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],o(n),o(r))}function s(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(r)||[],n=1;n<e.length;n++)e=(t=o(e,n).join("")).match(r)||[];return t}}function a(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=i.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch{var r=s(n[0]);r!==n[0]&&(e[n[0]]=r)}n=i.exec(t)}e["%C2"]="�";for(var o=Object.keys(e),a=0;a<o.length;a++){var l=o[a];t=t.replace(new RegExp(l,"g"),e[l])}return t}l(o,"decodeComponents"),l(s,"decode"),l(a,"customDecodeURIComponent"),e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return a(t)}}})),CT=fe(((t,e)=>{"use strict";y(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),OT=fe(((t,e)=>{"use strict";y(),e.exports=function(t,e){for(var n={},r=Object.keys(t),i=Array.isArray(e),o=0;o<r.length;o++){var s=r[o],a=t[s];(i?-1!==e.indexOf(s):e(s,a,t))&&(n[s]=a)}return n}})),BT=fe((t=>{"use strict";y();var e=xT(),n=PT(),r=CT(),i=OT(),o=l((t=>null==t),"isNullOrUndefined"),s=Symbol("encodeFragmentIdentifier");function a(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{let i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[h(e,t),"[",i,"]"].join("")]:[...n,[h(e,t),"[",h(i,t),"]=",h(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[h(e,t),"[]"].join("")]:[...n,[h(e,t),"[]=",h(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[h(n,t),e,h(i,t)].join("")]:[[r,h(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,h(e,t)]:[...n,[h(e,t),"=",h(r,t)].join("")]}}function u(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{let i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&p(n,t).includes(t.arrayFormatSeparator);n=o?p(n,t):n;let s=i||o?n.split(t.arrayFormatSeparator).map((e=>p(e,t))):null===n?n:p(n,t);r[e]=s};case"bracket-separator":return(e,n,r)=>{let i=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!i)return void(r[e]=n&&p(n,t));let o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>p(e,t)));void 0!==r[e]?r[e]=[].concat(r[e],o):r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}function c(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function h(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function p(t,e){return e.decode?n(t):t}function f(t){return Array.isArray(t)?t.sort():"object"==typeof t?f(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function d(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function g(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}function v(t){let e=(t=d(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function m(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function _(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=u(e),i=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return i;for(let o of t.split("&")){if(""===o)continue;let[t,s]=r(e.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:p(s,e),n(p(t,e),s,i)}for(let t of Object.keys(i)){let n=i[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=m(n[t],e);else i[t]=m(n,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce(((t,e)=>{let n=i[e];return n&&"object"==typeof n&&!Array.isArray(n)?t[e]=f(n):t[e]=n,t}),Object.create(null))}l(a,"encoderForArrayFormat"),l(u,"parserForArrayFormat"),l(c,"validateArrayFormatSeparator"),l(h,"encode"),l(p,"decode"),l(f,"keysSorter"),l(d,"removeHash"),l(g,"getHash"),l(v,"extract"),l(m,"parseValue"),l(_,"parse"),t.extract=v,t.parse=_,t.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=l((n=>e.skipNull&&o(t[n])||e.skipEmptyString&&""===t[n]),"shouldFilter"),r=a(e),i={};for(let e of Object.keys(t))n(e)||(i[e]=t[e]);let s=Object.keys(i);return!1!==e.sort&&s.sort(e.sort),s.map((n=>{let i=t[n];return void 0===i?"":null===i?h(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?h(n,e)+"[]":i.reduce(r(n),[]).join("&"):h(n,e)+"="+h(i,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,i]=r(t,"#");return Object.assign({url:n.split("?")[0]||"",query:_(v(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:p(i,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);let r=d(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query),l=t.stringify(a,n);l&&(l="?".concat(l));let u=g(e.url);return e.fragmentIdentifier&&(u="#".concat(n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(r).concat(l).concat(u)},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);let{url:o,query:a,fragmentIdentifier:l}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:i(a,n),fragmentIdentifier:l},r)},t.exclude=(e,n,r)=>{let i=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,i,r)}}));y();var oA=er(LE());y(),y(),y();var FM=er(RM());y();var Ky=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:o=0,pathWeight:s=0}){let a,l;if(D(this,"origin"),D(this,"destination"),D(this,"vortex"),D(this,"distance"),D(this,"angle"),D(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=i,this.angle=o,n)this.distance=0,this.angle=0,a=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,l=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*l+a;else{let t=s||e.weight;a=t&&t>=0?t:0,l=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*l+a}if(isNaN(this.angle))throw new Error("nan angle")}};l(Ky,"Edge");var $y=Ky,Zs=$y;y();var DM="mi-debug",nD={logState:0,log(...t){this.logState<=0&&console.log("[MappedInJS]",...t)},warn(...t){this.logState<=1&&console.warn("[MappedInJS]",...t)},error(...t){this.logState<=2&&console.error("[MappedInJS]",...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)}},Ie=nD;function iD(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error("map ".concat(t.name||t.shortName||t.id," does not have a georeference field"));if(t.georeference.length<3)throw new Error("map ".concat(t.name||t.shortName||t.id," has less than 3 georeference points, we require at least 3 for proper map scaling"));let e=t.georeference[0],n=t.georeference[2],r=(0,FM.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),i=e.control.x-n.control.x,o=e.control.y-n.control.y;return Math.sqrt(i*i+o*o)/r}catch(t){return Ie.error(t),1}}function Ad(t,e){let n=t.x-e.x,r=t.y-e.y;return(Math.atan2(r,n)+2.5*Math.PI)%(2*Math.PI)}l(iD,"getMapScale"),l(Ad,"getAngle");var Qy=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:r=!1}){D(this,"edges"),D(this,"nodesById"),D(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>({...t,_scale:iD(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let i=t.filter((t=>!!this.mapsById[t.map])).map((t=>({...t,paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=i.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let o=e.map((t=>({...t,name:r?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));i.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e,weight:n})=>{let r=this.nodesById[e];return new Zs({angle:Ad(t,r),destination:r,distance:this.getDistance(t,r),origin:t,pathWeight:n})}))})),o.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let r=e;for(;r<t.nodes.length;){let e=this.nodesById[t.nodes[r]];if(r++,null==e)continue;let i=this.mapsById[n.map].elevation||0,o=this.mapsById[e.map].elevation||0,s=Math.abs(i-o);this.edges[n.id].push(new Zs({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new Zs({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar({originIds:t,destinationNodeIds:e,accessible:n,includedVortexIds:r,excludedVortexIds:i}){let o=t.map((t=>this.nodesById[t])).filter((t=>t)),s=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===o.length||0===s.length)return[];let a=[],l={},u={};for(o.forEach((t=>{let e=this.getShortestEuclideanDistance(t,s);a.push({origin:t,priority:e}),l[t.id]=null,u[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(s.includes(t.origin)){let e=[],n=l[t.origin.id];for(;null!=n;){e.push(n);let t=l[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let o=e.vortex&&!1===e.vortex.accessible||!1===e.origin.accessible||!1===e.destination.accessible,c=e.vortex&&(r&&!r.has(e.vortex.id)||i&&i.has(e.vortex.id));if(n&&o||c)continue;let h=u[t.origin.id]+e.weight;if(null==u[e.destination.id]||h<u[e.destination.id]){u[e.destination.id]=h;let t=h+this.getShortestEuclideanDistance(e.destination,s);a.push({origin:e.destination,priority:t}),l[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,r=t.x-e.x,i=t.y-e.y,o=r*r+i*i;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(o)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let r=this.getDistance(t,n);return Math.min(e,r)}),Number.MAX_VALUE)}};l(Qy,"NavigationGraph");var Jy=Qy,Zy=Jy;function oD(t){switch(t){case"down":case"up":return"".concat(t," ");default:return""}}y(),y(),l(oD,"vortexDirectionTest");var tv=class{constructor({origin:t,action:e,distance:n,atLocation:r,instruction:i}){D(this,"node"),D(this,"instruction"),D(this,"action"),D(this,"atLocation"),D(this,"type"),D(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=r,this.instruction="",i?this.instruction=i:(null!=e&&"Departure"===e.type?this.instruction=null!=r?"Depart from ".concat(r.name):"Depart from current location":null!=e&&"Arrival"===e.type?this.instruction=null!=r?"Arrive at ".concat(r.name):"Arrive at destination":null!=e&&"TakeVortex"===e.type?this.instruction="Take ".concat(r&&r.name," ").concat(oD(e.direction),"to ").concat(e.toMap.name):null!=e&&"ExitVortex"===e.type?this.instruction="Exit ".concat(r&&r.name," at ").concat(e.toMap.name):null!=e&&"bearing"in e&&"Right"===e.bearing?this.instruction="Turn right":null!=e&&"bearing"in e&&"SlightRight"===e.bearing?this.instruction="Turn slightly right":null!=e&&"bearing"in e&&"Straight"===e.bearing?this.instruction="Head straight":null!=e&&"bearing"in e&&"SlightLeft"===e.bearing?this.instruction="Turn slightly left":null!=e&&"bearing"in e&&"Left"===e.bearing&&(this.instruction="Turn left"),null!=e&&"Turn"===e.type&&r&&(this.instruction+=" at ".concat(r.name)))}};l(tv,"Directive");var ev=tv,ms=ev;function rv(t,e,n,r){if(!(t&&e&&n&&r))return null;let i=t.x,o=t.y,s=e.x,a=e.y,l=n.x,u=n.y,c=r.x,h=r.y;if(i===s&&o===a||l===c&&u===h)return null;let p=(h-u)*(s-i)-(c-l)*(a-o);if(0===p)return null;let f=((c-l)*(o-u)-(h-u)*(i-l))/p,d=((s-i)*(o-u)-(a-o)*(i-l))/p;return f<0||f>1||d<0||d>1?null:{x:i+f*(s-i),y:o+f*(a-o)}}function BM(t,e,n){if(t.x===e.x)return[{x:t.x+n,y:t.y},{x:e.x+n,y:e.y}];if(t.y===e.y)return[{x:t.x,y:t.y+n},{x:e.x,y:e.y+n}];let r=-1/((e.y-t.y)/(e.x-t.x)),i=n*Math.sqrt(1/(1+r*r)),o=r*i;return[{x:t.x+i,y:t.y+o},{x:e.x+i,y:e.y+o}]}function jM(t,e,n=[],r=0){let i=!0;return n.forEach((n=>{if(r>0){let o=BM(t,e,-r),s=BM(t,e,r);if(rv(o[0],o[1],n[0],n[1])||rv(s[0],s[1],n[0],n[1]))return void(i=!1)}else if(rv(t,e,n[0],n[1]))return void(i=!1)})),i}y(),l(rv,"getLineIntersection"),l(BM,"getOffsetLine"),l(jM,"hasLineOfSight");var Ld=.1*Math.PI;function Rd(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}l(Rd,"differenceBetweenAngles");var ov=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,polygons:i,showVortexNames:o}){D(this,"graph"),D(this,"locationsByNodeId"),D(this,"geometryEdgesByMapId",new Map),this.graph=new Zy({maps:r,nodes:e,showVortexNames:o,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{}),i&&i.forEach((t=>{this.geometryEdgesByMapId.has(t.map)||this.geometryEdgesByMapId.set(t.map,[]),t.vertexes.forEach(((e,n)=>{t.vertexes[n+1]?this.geometryEdgesByMapId.get(t.map).push([e,t.vertexes[n+1]]):this.geometryEdgesByMapId.get(t.map).push([e,t.vertexes[0]])}))}))}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let r=0,i=0,o=t;for(;Math.abs(r)<e&&i<n;){let t=this.graph.edges[o.destination.id],s=null,a=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-Rd(o.angle,e.angle);Math.abs(t)<Math.abs(a)&&(s=e,a=t)}else s=e,a=-Rd(o.angle,e.angle);if(null==s)return null;{if(Math.abs(a)>=e||(r+=a,i+=s.distance,Math.abs(r)>=e||i>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;o=s}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:r,arriveAt:i,includedVortexIds:o,excludedVortexIds:s,simplify:a}){var l,u,c;let h=this.graph.aStar({originIds:t,destinationNodeIds:e,accessible:n,includedVortexIds:o,excludedVortexIds:s});if(0===h.length)return{distance:0,instructions:[new ms({distance:0,instruction:"No Valid Path Available"})],path:[]};let p=0,f=[],d=[];if(null!=a&&a.enabled){let t=null!=(l=null==a?void 0:a.bufferRadius)?l:1.8,e=[h[0]];for(let n=1;n<h.length;n++){if(h[n].origin.map!==h[n-1].origin.map){let r=null!=(u=this.geometryEdgesByMapId.get(h[n-1].origin.map))?u:[];d.push(...this.simplifySteps(e,r,t)),e=[h[n]]}e.push(h[n])}let n=h[h.length-1],r=null!=(c=this.geometryEdgesByMapId.get(n.origin.map))?c:[];d.push(...this.simplifySteps(e,r,t)),h=d}for(let t=0;t<h.length;t++)f.push(h[t].origin);f.push(h[h.length-1].destination);let g=[],y=null,v=null,m=0,_=0;for(let t=0;t<h.length;t++){let e=h[t],n=e.origin,o=e.destination;if(p+=e.distance,m+=(null==v?void 0:v.distance)||0,0===t&&g.push(new ms({action:{type:"Departure"},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[o.map],i="none";if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i="down":e<0&&(i="up")}g.push(new ms({action:{direction:i,fromMap:t,toMap:r,type:"TakeVortex"},atLocation:e.vortex,distance:m,origin:n})),_+=m,m=0}else if(null!=y&&null!=v)if(null!=v.vortex){let t=this.graph.mapsById[y.map],e=this.graph.mapsById[v.destination.map];g.push(new ms({action:{fromMap:t,toMap:e,type:"ExitVortex"},atLocation:v.vortex,distance:m,origin:n})),_+=m,m=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==y&&t.destination!==e.destination));if(t.length>0){let r=-Rd(v.angle,e.angle),i=t.reduce(((t,n)=>{let r=-Rd(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=Ld||Math.abs(i)<=Ld){let t;t=r<=-Math.PI/4?"Right":r<=-Ld?"SlightRight":r<=Ld?"Straight":r<=Math.PI/4?"SlightLeft":"Left";let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(v,.5*Math.PI,10)),null!=e){let r=new ms({action:{bearing:t,referencePosition:"At",type:"Turn"},atLocation:e,distance:m,origin:n});r.type=t,g.push(r)}else g.push(new ms({action:{bearing:t,referencePosition:"At",type:"Turn"},distance:m,origin:n}));_+=m,m=0}}}t===h.length-1&&(g.push(new ms({action:{type:"Arrival"},atLocation:i,distance:p-_<0?0:p-_,origin:e.destination})),_+=m,m=0),y=n,v=e}let b=[],w=null;for(let t=g.length-1;t>=0;t--){let e=g[t],{action:n}=e;n&&"TakeVortex"===n.type?(w=e.node,b.unshift(e)):n&&"Turn"===n.type&&null!=w?this.graph.getDistance(e.node,w)>5&&b.unshift(e):b.unshift(e)}return{distance:p,instructions:b,path:f}}simplifySteps(t,e,n){if(t.length<3)return t;let r=[t[0]],i=1;for(let o=i+2;o<t.length;o++)if(!jM(t[i].origin,t[o].origin,e,n)){let e=o-1;r.push(new Zs({...t[i],destination:t[e].origin,distance:this.graph.getDistance(t[i].origin,t[e].origin),angle:Ad(t[i].origin,t[e].origin)})),i=e}return r.push(new Zs({...t[i],destination:t[t.length-1].origin,distance:this.graph.getDistance(t[i].origin,t[t.length-1].origin),angle:Ad(t[i].origin,t[t.length-1].origin)}),t[t.length-1]),r}};l(ov,"Navigator");var nv=ov,iv=nv;y(),y();var Aa,Yc,av,Dd,qM,sv=class{constructor(t){oe(this,Yc),oe(this,Dd),oe(this,Aa,void 0),le(this,Aa,t)}directionsTo(t,e){let n=B(this,Aa).analytics;return t instanceof uo?0===t.destinations.length?[]:(n.getDirections(this,t.destinations[t.destinations.length-1]),wr(this,Dd,qM).call(this,t,e)):(n.getDirections(this,t),wr(this,Yc,av).call(this,t,e))}distanceTo(t,e){let n=wr(this,Yc,av).call(this,t,e);return(null==n?void 0:n.distance)||0}};Aa=new WeakMap,Yc=new WeakSet,av=l((function(t,e){let n=Xc(this),r=Xc(t),i=B(this,Aa).navigator.getDirections({originIds:n,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1,includedVortexIds:null!=e&&e.includedVortexIds?new Set(e.includedVortexIds):void 0,excludedVortexIds:null!=e&&e.excludedVortexIds?new Set(e.excludedVortexIds):void 0,simplify:null==e?void 0:e.simplify});return new Qs(B(this,Aa),i)}),"#directionsToSingleDestination"),Dd=new WeakSet,qM=l((function(t,e){let n,r=[],i=Xc(this);for(let o=0;o<t.destinations.length;o++){n=Xc(t.destinations[o]);let s=B(this,Aa).navigator.getDirections({originIds:i,destinationNodeIds:n,includedVortexIds:null!=e&&e.includedVortexIds?new Set(e.includedVortexIds):void 0,excludedVortexIds:null!=e&&e.excludedVortexIds?new Set(e.excludedVortexIds):void 0,accessible:(null==e?void 0:e.accessible)||!1,simplify:null==e?void 0:e.simplify}),a=new Qs(B(this,Aa),s);r.push(a),i=0===a.path.length?n:[a.path[a.path.length-1].id]}return r}),"#directionsToDestinationSet"),l(sv,"MappedinNavigatable");var Qo=sv;y(),y(),y(),y(),y();var uv=l((function(t,e){return(uv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)}),"extendStatics");function ys(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uv(t,e),l(n,"__"),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}l(ys,"__extends");var $t=l((function(){return $t=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),$t.apply(this,arguments)}),"__assign");function Er(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function Mr(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function GM(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function UM(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(Er,"__awaiter"),l(Mr,"__generator"),l(GM,"__values"),l(UM,"__read"),y(),y(),y();var vs,An,La,_s,di,ki,Or,Ju,Ir=l((function(){return Ir=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),Ir.apply(this,arguments)}),"__assign");function VM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function zr(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function qr(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function ea(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Lo(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}l(VM,"__rest"),l(zr,"__awaiter"),l(qr,"__generator"),l(ea,"__values"),l(hi,"__read"),l(Lo,"__spreadArray"),y(),y(),y(),function(t){t.US="US",t.EU="EU"}(vs||(vs={})),y(),function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"}(An||(An={})),function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"}(La||(La={})),function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}(_s||(_s={})),y(),function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"}(di||(di={})),y(),function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(ki||(ki={})),y(),function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(Or||(Or={})),y(),function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(Ju||(Ju={})),y(),y();var lv="-",Wc="AMP",XM="".concat(Wc,"_unsent"),cv="https://api2.amplitude.com/2/httpapi",YM="https://api.eu.amplitude.com/2/httpapi",WM="https://api2.amplitude.com/batch",HM="https://api.eu.amplitude.com/batch";y();var sD=1e3,Fd=l((function(t){if(Object.keys(t).length>sD)return!1;for(var e in t){var n=t[e];if(!fv(e,n))return!1}return!0}),"isValidObject"),fv=l((function(t,e){var n,r;if("string"!=typeof t)return!1;if(Array.isArray(e)){var i=!0;try{for(var o=ea(e),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Fd(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==e)return!1;if("object"==typeof e)return Fd(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0}),"isValidProperties"),Ro=function(){function t(){this._propertySet=new Set,this._properties={}}return l(t,"Identify"),t.prototype.getUserProperties=function(){return Ir({},this._properties)},t.prototype.set=function(t,e){return this._safeSet(An.SET,t,e),this},t.prototype.setOnce=function(t,e){return this._safeSet(An.SET_ONCE,t,e),this},t.prototype.append=function(t,e){return this._safeSet(An.APPEND,t,e),this},t.prototype.prepend=function(t,e){return this._safeSet(An.PREPEND,t,e),this},t.prototype.postInsert=function(t,e){return this._safeSet(An.POSTINSERT,t,e),this},t.prototype.preInsert=function(t,e){return this._safeSet(An.PREINSERT,t,e),this},t.prototype.remove=function(t,e){return this._safeSet(An.REMOVE,t,e),this},t.prototype.add=function(t,e){return this._safeSet(An.ADD,t,e),this},t.prototype.unset=function(t){return this._safeSet(An.UNSET,t,lv),this},t.prototype.clearAll=function(){return this._properties={},this._properties[An.CLEAR_ALL]=lv,this},t.prototype._safeSet=function(t,e,n){if(this._validate(t,e,n)){var r=this._properties[t];return void 0===r&&(r={},this._properties[t]=r),r[e]=n,this._propertySet.add(e),!0}return!1},t.prototype._validate=function(t,e,n){return void 0===this._properties[An.CLEAR_ALL]&&!this._propertySet.has(e)&&(t===An.ADD?"number"==typeof n:t===An.UNSET||t===An.REMOVE||fv(e,n))},t}(),$M=l((function(t,e,n){return Ir(Ir(Ir({},"string"==typeof t?{event_type:t}:t),n),e&&{event_properties:e})}),"createTrackEvent"),Hc=l((function(t,e){return Ir(Ir({},e),{event_type:_s.IDENTIFY,user_properties:t.getUserProperties()})}),"createIdentifyEvent"),KM=l((function(t,e,n,r){var i;return Ir(Ir({},r),{event_type:_s.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)})}),"createGroupIdentifyEvent"),JM=l((function(t,e,n){var r,i=new Ro;return i.set(t,e),Ir(Ir({},n),{event_type:_s.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)})}),"createGroupEvent"),ZM=l((function(t,e){return Ir(Ir({},e),{event_type:_s.REVENUE,event_properties:t.getEventProperties()})}),"createRevenueEvent");y(),y();var bs=l((function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=Or.Unknown),{event:t,code:e,message:n}}),"buildResult"),QM=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return l(t,"Timeline"),t.prototype.register=function(t,e){return zr(this,void 0,void 0,(function(){return qr(this,(function(n){switch(n.label){case 0:return[4,t.setup(e)];case 1:return n.sent(),this.plugins.push(t),[2]}}))}))},t.prototype.deregister=function(t){return this.plugins.splice(this.plugins.findIndex((function(e){return e.name===t})),1),Promise.resolve()},t.prototype.reset=function(){this.applying=!1,this.plugins=[]},t.prototype.push=function(t){var e=this;return new Promise((function(n){e.queue.push([t,n]),e.scheduleApply(0)}))},t.prototype.scheduleApply=function(t){var e=this;this.applying||(this.applying=!0,setTimeout((function(){e.apply(e.queue.shift()).then((function(){e.applying=!1,e.queue.length>0&&e.scheduleApply(0)}))}),t))},t.prototype.apply=function(t){return zr(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m;return qr(this,(function(_){switch(_.label){case 0:if(!t)return[2];e=hi(t,1),n=e[0],r=hi(t,2),i=r[1],o=this.plugins.filter((function(t){return t.type===ki.BEFORE})),_.label=1;case 1:_.trys.push([1,6,7,8]),s=ea(o),a=s.next(),_.label=2;case 2:return a.done?[3,5]:[4,a.value.execute(Ir({},n))];case 3:n=_.sent(),_.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return l=_.sent(),g={error:l},[3,8];case 7:try{a&&!a.done&&(y=s.return)&&y.call(s)}finally{if(g)throw g.error}return[7];case 8:u=this.plugins.filter((function(t){return t.type===ki.ENRICHMENT})),_.label=9;case 9:_.trys.push([9,14,15,16]),c=ea(u),h=c.next(),_.label=10;case 10:return h.done?[3,13]:[4,h.value.execute(Ir({},n))];case 11:n=_.sent(),_.label=12;case 12:return h=c.next(),[3,10];case 13:return[3,16];case 14:return p=_.sent(),v={error:p},[3,16];case 15:try{h&&!h.done&&(m=c.return)&&m.call(c)}finally{if(v)throw v.error}return[7];case 16:return f=this.plugins.filter((function(t){return t.type===ki.DESTINATION})),d=f.map((function(t){var e=Ir({},n);return t.execute(e).catch((function(t){return bs(e,0,String(t))}))})),Promise.all(d).then((function(t){var e=hi(t,1)[0];i(e)})),[2]}}))}))},t.prototype.flush=function(){return zr(this,void 0,void 0,(function(){var t,e,n,r=this;return qr(this,(function(i){switch(i.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map((function(t){return r.apply(t)})))];case 1:return i.sent(),e=this.plugins.filter((function(t){return t.type===ki.DESTINATION})),n=e.map((function(t){return t.flush&&t.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},t}();y();var eI="Event tracked successfully",tI="Unexpected error occurred",rI="Event rejected due to exceeded retry count",nI="Event skipped due to optOut config",iI="Event rejected due to missing API key",oI="Invalid API key",aI="Client not initialized",pv=function(){function t(t){void 0===t&&(t="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new QM,this.name=t}return l(t,"AmplitudeCore"),t.prototype._init=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){switch(e.label){case 0:return this.config=t,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return e.sent(),[2]}}))}))},t.prototype.runQueuedFunctions=function(t){return zr(this,void 0,void 0,(function(){var e,n,r,i,o,s;return qr(this,(function(a){switch(a.label){case 0:e=this[t],this[t]=[],a.label=1;case 1:a.trys.push([1,6,7,8]),n=ea(e),r=n.next(),a.label=2;case 2:return r.done?[3,5]:[4,(0,r.value)()];case 3:a.sent(),a.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return i=a.sent(),o={error:i},[3,8];case 7:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},t.prototype.track=function(t,e,n){var r=$M(t,e,n);return this.dispatch(r)},t.prototype.identify=function(t,e){var n=Hc(t,e);return this.dispatch(n)},t.prototype.groupIdentify=function(t,e,n,r){var i=KM(t,e,n,r);return this.dispatch(i)},t.prototype.setGroup=function(t,e,n){var r=JM(t,e,n);return this.dispatch(r)},t.prototype.revenue=function(t,e){var n=ZM(t,e);return this.dispatch(n)},t.prototype.add=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.config?[2,this.timeline.register(t,this.config)]:(this.q.push(this.add.bind(this,t)),[2])}))}))},t.prototype.remove=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.config?[2,this.timeline.deregister(t)]:(this.q.push(this.remove.bind(this,t)),[2])}))}))},t.prototype.dispatchWithCallback=function(t,e){if(!this.config)return e(bs(t,0,aI));this.process(t).then(e)},t.prototype.dispatch=function(t){return zr(this,void 0,void 0,(function(){var e=this;return qr(this,(function(n){return this.config?[2,this.process(t)]:[2,new Promise((function(n){e.dispatchQ.push(e.dispatchWithCallback.bind(e,t,n))}))]}))}))},t.prototype.process=function(t){return zr(this,void 0,void 0,(function(){var e,n,r;return qr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,bs(t,0,nI)]:[4,this.timeline.push(t)];case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return e=i.sent(),n=String(e),this.config.loggerProvider.error(n),[2,r=bs(t,0,n)];case 3:return[2]}}))}))},t.prototype.setOptOut=function(t){this.config?this.config.optOut=!!t:this.q.push(this.setOptOut.bind(this,!!t))},t.prototype.flush=function(){return this.timeline.flush()},t}();y();var Bd=function(){function t(){this.productId="",this.quantity=1,this.price=0}return l(t,"Revenue"),t.prototype.setProductId=function(t){return this.productId=t,this},t.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},t.prototype.setPrice=function(t){return this.price=t,this},t.prototype.setRevenueType=function(t){return this.revenueType=t,this},t.prototype.setRevenue=function(t){return this.revenue=t,this},t.prototype.setEventProperties=function(t){return Fd(t)&&(this.properties=t),this},t.prototype.getEventProperties=function(){var t=this.properties?Ir({},this.properties):{};return t[La.REVENUE_PRODUCT_ID]=this.productId,t[La.REVENUE_QUANTITY]=this.quantity,t[La.REVENUE_PRICE]=this.price,t[La.REVENUE_TYPE]=this.revenueType,t[La.REVENUE]=this.revenue,t},t}();y(),y();var sI=l((function(t,e){var n=Math.max(e,1);return t.reduce((function(t,e,r){var i=Math.floor(r/n);return t[i]||(t[i]=[]),t[i].push(e),t}),[])}),"chunk");y(),y();var jd="Amplitude Logger ",uI=function(){function t(){this.logLevel=di.None}return l(t,"Logger"),t.prototype.disable=function(){this.logLevel=di.None},t.prototype.enable=function(t){void 0===t&&(t=di.Warn),this.logLevel=t},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Verbose||console.log("".concat(jd,"[Log]: ").concat(t.join(" ")))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Warn||console.warn("".concat(jd,"[Warn]: ").concat(t.join(" ")))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Error||console.error("".concat(jd,"[Error]: ").concat(t.join(" ")))},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<di.Debug||console.log("".concat(jd,"[Debug]: ").concat(t.join(" ")))},t}(),zd=l((function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:di.Warn,loggerProvider:new uI,optOut:!1,serverUrl:cv,serverZone:vs.US,useBatch:!1}}),"getDefaultConfig"),hv=function(){function t(t){var e,n,r;this._optOut=!1;var i=zd();this.apiKey=t.apiKey,this.flushIntervalMillis=t.flushIntervalMillis||i.flushIntervalMillis,this.flushMaxRetries=t.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=t.flushQueueSize||i.flushQueueSize,this.loggerProvider=t.loggerProvider||i.loggerProvider,this.logLevel=null!==(e=t.logLevel)&&void 0!==e?e:i.logLevel,this.minIdLength=t.minIdLength,this.plan=t.plan,this.ingestionMetadata=t.ingestionMetadata,this.optOut=null!==(n=t.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=t.serverUrl,this.serverZone=t.serverZone||i.serverZone,this.storageProvider=t.storageProvider,this.transportProvider=t.transportProvider,this.useBatch=null!==(r=t.useBatch)&&void 0!==r?r:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=dv(t.serverUrl,t.serverZone,t.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return l(t,"Config"),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(t){this._optOut=t},enumerable:!1,configurable:!0}),t}(),uD=l((function(t,e){return t===vs.EU?e?HM:YM:e?WM:cv}),"getServerUrl"),dv=l((function(t,e,n){if(void 0===t&&(t=""),void 0===e&&(e=zd().serverZone),void 0===n&&(n=zd().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=[vs.US,vs.EU].includes(e)?e:zd().serverZone;return{serverZone:r,serverUrl:uD(r,n)}}),"createServerConfig"),gv=function(){function t(){this.name="amplitude",this.type=ki.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return l(t,"Destination"),t.prototype.setup=function(t){var e;return zr(this,void 0,void 0,(function(){var n,r=this;return qr(this,(function(i){switch(i.label){case 0:return this.config=t,this.storageKey="".concat(XM,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(e=this.config.storageProvider)||void 0===e?void 0:e.get(this.storageKey)];case 1:return n=i.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map((function(t){return r.execute(t)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},t.prototype.execute=function(t){var e=this;return new Promise((function(n){var r={event:t,attempts:0,callback:function(t){return n(t)},timeout:0};e.addToQueue(r)}))},t.prototype.addToQueue=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.filter((function(e){return e.attempts<t.config.flushMaxRetries?(e.attempts+=1,!0):(t.fulfillRequest([e],500,rI),!1)}));r.forEach((function(e){t.queue=t.queue.concat(e),0!==e.timeout?setTimeout((function(){e.timeout=0,t.schedule(0)}),e.timeout):t.schedule(t.config.flushIntervalMillis)})),this.saveEvents()},t.prototype.schedule=function(t){var e=this;this.scheduled||(this.scheduled=setTimeout((function(){e.flush(!0).then((function(){e.queue.length>0&&e.schedule(t)}))}),t))},t.prototype.flush=function(t){return void 0===t&&(t=!1),zr(this,void 0,void 0,(function(){var e,n,r,i=this;return qr(this,(function(o){switch(o.label){case 0:return e=[],n=[],this.queue.forEach((function(t){return 0===t.timeout?e.push(t):n.push(t)})),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),r=sI(e,this.config.flushQueueSize),[4,Promise.all(r.map((function(e){return i.send(e,t)})))];case 1:return o.sent(),[2]}}))}))},t.prototype.send=function(t,e){return void 0===e&&(e=!0),zr(this,void 0,void 0,(function(){var n,r,i,o,s;return qr(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,iI)];n={api_key:this.config.apiKey,events:t.map((function(t){var e=t.event;e.extra;return VM(e,["extra"])})),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),r=dv(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,n)];case 2:if(null===(i=a.sent()))return this.fulfillRequest(t,0,tI),[2];if(!e){if("body"in i){o="";try{o=JSON.stringify(i.body,null,2)}catch{}this.fulfillRequest(t,i.statusCode,"".concat(i.status,": ").concat(o))}else this.fulfillRequest(t,i.statusCode,i.status);return[2]}return this.handleReponse(i,t),[3,4];case 3:return s=a.sent(),this.fulfillRequest(t,0,String(s)),[3,4];case 4:return[2]}}))}))},t.prototype.handleReponse=function(t,e){switch(t.status){case Or.Success:this.handleSuccessResponse(t,e);break;case Or.Invalid:this.handleInvalidResponse(t,e);break;case Or.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,e);break;case Or.RateLimit:this.handleRateLimitResponse(t,e);break;default:this.handleOtherReponse(e)}},t.prototype.handleSuccessResponse=function(t,e){this.fulfillRequest(e,t.statusCode,eI)},t.prototype.handleInvalidResponse=function(t,e){var n=this;if(t.body.missingField||t.body.error.startsWith(oI))this.fulfillRequest(e,t.statusCode,t.body.error);else{var r=Lo(Lo(Lo(Lo([],hi(Object.values(t.body.eventsWithInvalidFields)),!1),hi(Object.values(t.body.eventsWithMissingFields)),!1),hi(Object.values(t.body.eventsWithInvalidIdLengths)),!1),hi(t.body.silencedEvents),!1).flat(),i=new Set(r),o=e.filter((function(e,r){if(!i.has(r))return!0;n.fulfillRequest([e],t.statusCode,t.body.error)}));this.addToQueue.apply(this,Lo([],hi(o),!1))}},t.prototype.handlePayloadTooLargeResponse=function(t,e){1!==e.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,Lo([],hi(e),!1))):this.fulfillRequest(e,t.statusCode,t.body.error)},t.prototype.handleRateLimitResponse=function(t,e){var n=this,r=Object.keys(t.body.exceededDailyQuotaUsers),i=Object.keys(t.body.exceededDailyQuotaDevices),o=t.body.throttledEvents,s=new Set(r),a=new Set(i),l=new Set(o),u=e.filter((function(e,r){if(!(e.event.user_id&&s.has(e.event.user_id)||e.event.device_id&&a.has(e.event.device_id)))return l.has(r)&&(e.timeout=n.throttleTimeout),!0;n.fulfillRequest([e],t.statusCode,t.body.error)}));this.addToQueue.apply(this,Lo([],hi(u),!1))},t.prototype.handleOtherReponse=function(t){var e=this;this.addToQueue.apply(this,Lo([],hi(t.map((function(t){return t.timeout=t.attempts*e.retryTimeout,t}))),!1))},t.prototype.fulfillRequest=function(t,e,n){this.saveEvents(),t.forEach((function(t){return t.callback(bs(t.event,e,n))}))},t.prototype.saveEvents=function(){if(this.config.storageProvider){var t=Array.from(this.queue.map((function(t){return t.event})));this.config.storageProvider.set(this.storageKey,t)}},t}();y();var lo=l((function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,Lo([],hi(e),!1))}}}),"returnWrapper");y();var lD=l((function(t){return void 0===t&&(t=0),((new Error).stack||"").split("\n").slice(2+t).map((function(t){return t.trim()}))}),"getStacktrace"),$r=l((function(t){return function(){var e=Ir({},t.config);return{logger:e.loggerProvider,logLevel:e.logLevel}}}),"getClientLogConfig"),cD=l((function(t,e){var n,r;e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=ea(e.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in t))return;t=t[s]}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t}),"getValueByStringPath"),Kr=l((function(t,e){return function(){var n,r,i={};try{for(var o=ea(e),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=cD(t,a)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}}),"getClientStates"),Jr=l((function(t,e,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<di.Debug||!u||!l)return t.apply(i,o);var c={type:"invoke public method",name:e,args:o,stacktrace:lD(1),time:{start:(new Date).toISOString()},states:{}};r&&c.states&&(c.states.before=r());var h=t.apply(i,o);return h&&h.promise?h.promise.then((function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))})):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}}),"debugWrapper");y();var xs=l((function(t){return t?(t^16*Math.random()>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,xs)}),"UUID");y();var $c=function(){function t(){this.memoryStorage=new Map}return l(t,"MemoryStorage"),t.prototype.isEnabled=function(){return zr(this,void 0,void 0,(function(){return qr(this,(function(t){return[2,!0]}))}))},t.prototype.get=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return[2,this.memoryStorage.get(t)]}))}))},t.prototype.getRaw=function(t){return zr(this,void 0,void 0,(function(){var e;return qr(this,(function(n){switch(n.label){case 0:return[4,this.get(t)];case 1:return[2,(e=n.sent())?JSON.stringify(e):void 0]}}))}))},t.prototype.set=function(t,e){return zr(this,void 0,void 0,(function(){return qr(this,(function(n){return this.memoryStorage.set(t,e),[2]}))}))},t.prototype.remove=function(t){return zr(this,void 0,void 0,(function(){return qr(this,(function(e){return this.memoryStorage.delete(t),[2]}))}))},t.prototype.reset=function(){return zr(this,void 0,void 0,(function(){return qr(this,(function(t){return this.memoryStorage.clear(),[2]}))}))},t}();y();var eu=function(){function t(){}return l(t,"BaseTransport"),t.prototype.send=function(t,e){return Promise.resolve(null)},t.prototype.buildResponse=function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m,_,b,w,x;if("object"!=typeof t)return null;var E=t.code||0,I=this.buildStatus(E);switch(I){case Or.Success:return{status:I,statusCode:E,body:{eventsIngested:null!==(e=t.events_ingested)&&void 0!==e?e:0,payloadSizeBytes:null!==(n=t.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=t.server_upload_time)&&void 0!==r?r:0}};case Or.Invalid:return{status:I,statusCode:E,body:{error:null!==(i=t.error)&&void 0!==i?i:"",missingField:null!==(o=t.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=t.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=t.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=t.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=t.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=t.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=t.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(p=t.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=t.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(d=t.throttled_events)&&void 0!==d?d:[]}};case Or.PayloadTooLarge:return{status:I,statusCode:E,body:{error:null!==(g=t.error)&&void 0!==g?g:""}};case Or.RateLimit:return{status:I,statusCode:E,body:{error:null!==(y=t.error)&&void 0!==y?y:"",epsThreshold:null!==(v=t.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(m=t.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(_=t.throttled_users)&&void 0!==_?_:{},exceededDailyQuotaDevices:null!==(b=t.exceeded_daily_quota_devices)&&void 0!==b?b:{},exceededDailyQuotaUsers:null!==(w=t.exceeded_daily_quota_users)&&void 0!==w?w:{},throttledEvents:null!==(x=t.throttled_events)&&void 0!==x?x:[]}};case Or.Timeout:default:return{status:I,statusCode:E}}},t.prototype.buildStatus=function(t){return t>=200&&t<300?Or.Success:429===t?Or.RateLimit:413===t?Or.PayloadTooLarge:408===t?Or.Timeout:t>=400&&t<500?Or.Invalid:t>=500?Or.Failed:Or.Unknown},t}();y(),y(),y();var mv=l((function(t,e){return(mv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)}),"extendStatics");function lI(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}mv(t,e),l(n,"__"),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}l(lI,"__extends");var Xn=l((function(){return Xn=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),Xn.apply(this,arguments)}),"__assign");function yv(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function mn(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return l(i,"adopt"),new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}l(s,"fulfilled"),l(a,"rejected"),l(u,"step"),u((r=r.apply(t,e||[])).next())}))}function yn(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function cI(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(yv,"__rest"),l(mn,"__awaiter"),l(yn,"__generator"),l(cI,"__read"),y(),y();var gi=l((function(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:void 0}),"getGlobalScope"),Zu=l((function(){var t,e=gi();return null!==(t=null==e?void 0:e.location)&&void 0!==t&&t.search?e.location.search.substring(1).split("&").filter(Boolean).reduce((function(t,e){var n=e.split("=",2),r=fI(n[0]),i=fI(n[1]);return i&&(t[r]=i),t}),{}):{}}),"getQueryParams"),fI=l((function(t){void 0===t&&(t="");try{return decodeURIComponent(t)}catch{return""}}),"tryDecodeURIComponent");y();var pI="utm_campaign",hI="utm_content",dI="utm_id",gI="utm_medium",mI="utm_source",yI="utm_term",vv="dclid",_v="fbclid",bv="gbraid",xv="gclid",wv="ko_click_id",Ev="msclkid",Mv="ttclid",Iv="twclid",Pv="wbraid",vI="EMPTY",qd={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},_I="MKTG",bI=function(){function t(){}return l(t,"CampaignParser"),t.prototype.parse=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){return[2,Xn(Xn(Xn(Xn({},qd),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},t.prototype.getUtmParam=function(){var t=Zu();return{utm_campaign:t[pI],utm_content:t[hI],utm_id:t[dI],utm_medium:t[gI],utm_source:t[mI],utm_term:t[yI]}},t.prototype.getReferrer=function(){var t,e,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(e=null===(t=n.referrer)||void 0===t?void 0:t.split("/")[2])&&void 0!==e?e:void 0}catch{}return n},t.prototype.getClickIds=function(){var t,e=Zu();return(t={})[vv]=e[vv],t[_v]=e[_v],t[bv]=e[bv],t[xv]=e[xv],t[wv]=e[wv],t[Ev]=e[Ev],t[Mv]=e[Mv],t[Iv]=e[Iv],t[Pv]=e[Pv],t},t}();y(),y();var tu=l((function(t,e,n){return void 0===e&&(e=""),void 0===n&&(n=10),[Wc,e,t.substring(0,n)].filter(Boolean).join("_")}),"getCookieName"),Sv=l((function(t){return"".concat(Wc.toLowerCase(),"_").concat(t.substring(0,6))}),"getOldCookieName"),Cv=function(){function t(t,e){var n,r;this.storage=e.storage,this.storageKey=tu(t,_I),this.parser=new bI,this.track=e.track,this.onNewCampaign=e.onNewCampaign,this.disabled=!!e.disabled,this.trackNewCampaigns=!!e.trackNewCampaigns,this.trackPageViews=!!e.trackPageViews,this.excludeReferrers=null!==(n=e.excludeReferrers)&&void 0!==n?n:[],typeof location<"u"&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(r=e.initialEmptyValue)&&void 0!==r?r:vI}return l(t,"CampaignTracker"),t.prototype.isNewCampaign=function(t,e,n){void 0===n&&(n=!1);t.referrer;var r=t.referring_domain,i=yv(t,["referrer","referring_domain"]),o=e||{},s=(o.referrer,o.referring_domain),a=yv(o,["referrer","referring_domain"]);if(t.referring_domain&&this.excludeReferrers.includes(t.referring_domain))return!1;var l=JSON.stringify(i)!==JSON.stringify(a),u=n?xI(r||"")!==xI(s||""):r!==s;return!e||l||u},t.prototype.saveCampaignToStorage=function(t){return mn(this,void 0,void 0,(function(){return yn(this,(function(e){switch(e.label){case 0:return[4,this.storage.set(this.storageKey,t)];case 1:return e.sent(),[2]}}))}))},t.prototype.getCampaignFromStorage=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,t.sent()]}}))}))},t.prototype.createCampaignEvent=function(t){var e=this,n=Xn(Xn({},qd),t),r=Object.entries(n).reduce((function(t,n){var r=cI(n,2),i=r[0],o=r[1];return t.setOnce("initial_".concat(i),o||e.initialEmptyValue),o?t.set(i,o):t.unset(i)}),new Ro),i={event_type:"Page View",event_properties:{page_title:typeof document<"u"&&document.title||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||""}};return Xn(Xn({},Hc(r)),this.trackPageViews&&i)},t.prototype.send=function(t){return mn(this,void 0,void 0,(function(){var e,n;return yn(this,(function(r){switch(r.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return e=r.sent(),[4,this.getCampaignFromStorage()];case 2:if(n=r.sent(),!t){if(!this.trackNewCampaigns||!this.isNewCampaign(e,n))return[2];this.onNewCampaign(e)}return[4,this.track(this.createCampaignEvent(e))];case 3:return r.sent(),[4,this.saveCampaignToStorage(e)];case 4:return r.sent(),[2]}}))}))},t}(),xI=l((function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")}),"domainWithoutSubdomain");y();var ru=function(){function t(t){this.options=Xn({},t)}return l(t,"CookieStorage"),t.prototype.isEnabled=function(){return mn(this,void 0,void 0,(function(){var e,n,r;return yn(this,(function(i){switch(i.label){case 0:if(!gi())return[2,!1];e=String(Date.now()),n=new t(this.options),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===e];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},t.prototype.get=function(t){return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(t)];case 1:if(!(e=n.sent()))return[2,void 0];try{try{e=decodeURIComponent(atob(e))}catch{}return[2,JSON.parse(e)]}catch{return[2,void 0]}return[2]}}))}))},t.prototype.getRaw=function(t){var e;return mn(this,void 0,void 0,(function(){var n,r,i;return yn(this,(function(o){return n=gi(),r=null!==(e=null==n?void 0:n.document.cookie.split("; "))&&void 0!==e?e:[],(i=r.find((function(e){return 0===e.indexOf(t+"=")})))?[2,i.substring(t.length+1)]:[2,void 0]}))}))},t.prototype.set=function(t,e){var n;return mn(this,void 0,void 0,(function(){var r,i,o,s,a,l;return yn(this,(function(u){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==e?r:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(e)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(l=gi())&&(l.document.cookie=a)}catch{}return[2]}))}))},t.prototype.remove=function(t){return mn(this,void 0,void 0,(function(){return yn(this,(function(e){switch(e.label){case 0:return[4,this.set(t,null)];case 1:return e.sent(),[2]}}))}))},t.prototype.reset=function(){return mn(this,void 0,void 0,(function(){return yn(this,(function(t){return[2]}))}))},t}();y();var Gd=function(){function t(t,e){this.storage=t,this.storageKey=tu(e),this.cache={optOut:!1}}return l(t,"SessionManager"),t.prototype.load=function(){var t;return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){switch(n.label){case 0:return e=this,[4,this.storage.get(this.storageKey)];case 1:return e.cache=null!==(t=n.sent())&&void 0!==t?t:{optOut:!1},[2,this]}}))}))},t.prototype.setSession=function(t){this.cache=Xn(Xn({},this.cache),t),this.storage.set(this.storageKey,this.cache)},t.prototype.getSessionId=function(){return this.cache.sessionId},t.prototype.setSessionId=function(t){this.setSession({sessionId:t})},t.prototype.getDeviceId=function(){return this.cache.deviceId},t.prototype.setDeviceId=function(t){this.setSession({deviceId:t})},t.prototype.getUserId=function(){return this.cache.userId},t.prototype.setUserId=function(t){this.setSession({userId:t})},t.prototype.getLastEventTime=function(){return this.cache.lastEventTime},t.prototype.setLastEventTime=function(t){this.setSession({lastEventTime:t})},t.prototype.getOptOut=function(){return this.cache.optOut},t.prototype.setOptOut=function(t){this.setSession({optOut:t})},t.prototype.getLastEventId=function(){return this.cache.lastEventId},t.prototype.setLastEventId=function(t){this.setSession({lastEventId:t})},t}();y();var kv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lI(e,t),l(e,"FetchTransport"),e.prototype.send=function(t,e){return mn(this,void 0,void 0,(function(){var n,r;return yn(this,(function(i){switch(i.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return n={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(e),method:"POST"},[4,fetch(t,n)];case 1:return[4,i.sent().json()];case 2:return r=i.sent(),[2,this.buildResponse(r)]}}))}))},e}(eu);y(),y();var wI=er(Ov()),fD=function(){function t(){this.ua=new wI.UAParser(typeof navigator<"u"?navigator.userAgent:null).getResult()}return l(t,"ApplicationContextProviderImpl"),t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:dD(),platform:"Web",os:pD(this.ua),deviceModel:hD(this.ua)}},t}(),pD=l((function(t){var e,n;return[null===(e=t.browser)||void 0===e?void 0:e.name,null===(n=t.browser)||void 0===n?void 0:n.major].filter((function(t){return null!=t})).join(" ")}),"getOs"),hD=l((function(t){var e;return null===(e=t.os)||void 0===e?void 0:e.name}),"getDeviceModel"),dD=l((function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""}),"getLanguage"),gD=function(){function t(){this.queue=[]}return l(t,"EventBridgeImpl"),t.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},t.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach((function(e){t(e)})),this.queue=[])},t}(),ws=l((function(){return ws=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),ws.apply(this,arguments)}),"__assign"),Vd=l((function(t,e){var n=typeof t;if(n!==typeof e)return!1;for(var r=0,i=["string","number","boolean","undefined"];r<i.length;r++){if(i[r]===n)return t===e}if(null==t&&null==e)return!0;if(null==t||null==e||t.length!==e.length)return!1;var o=Array.isArray(t),s=Array.isArray(e);if(o!==s)return!1;if(!o||!s){var a=Object.keys(t).sort(),l=Object.keys(e).sort();if(!Vd(a,l))return!1;var u=!0;return Object.keys(t).forEach((function(n){Vd(t[n],e[n])||(u=!1)})),u}for(var c=0;c<t.length;c++)if(!Vd(t[c],e[c]))return!1;return!0}),"isEqual"),mD="$set",yD="$unset",vD="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r});var _D=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return l(t,"IdentityStoreImpl"),t.prototype.editIdentity=function(){var t=this,e=ws({},this.identity.userProperties),n=ws(ws({},this.identity),{userProperties:e});return{setUserId:function(t){return n.userId=t,this},setDeviceId:function(t){return n.deviceId=t,this},setUserProperties:function(t){return n.userProperties=t,this},updateUserProperties:function(t){for(var e=n.userProperties||{},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r],s=o[0],a=o[1];switch(s){case mD:for(var l=0,u=Object.entries(a);l<u.length;l++){var c=u[l],h=c[0],p=c[1];e[h]=p}break;case yD:for(var f=0,d=Object.keys(a);f<d.length;f++){delete e[h=d[f]]}break;case vD:e={}}}return n.userProperties=e,this},commit:function(){return t.setIdentity(n),this}}},t.prototype.getIdentity=function(){return ws({},this.identity)},t.prototype.setIdentity=function(t){var e=ws({},this.identity);this.identity=ws({},t),Vd(e,this.identity)||this.listeners.forEach((function(e){e(t)}))},t.prototype.addIdentityListener=function(t){this.listeners.add(t)},t.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},t}(),Jc=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,EI=function(){function t(){this.identityStore=new _D,this.eventBridge=new gD,this.applicationContextProvider=new fD}return l(t,"AnalyticsConnector"),t.getInstance=function(e){return Jc.analyticsConnectorInstances||(Jc.analyticsConnectorInstances={}),Jc.analyticsConnectorInstances[e]||(Jc.analyticsConnectorInstances[e]=new t),Jc.analyticsConnectorInstances[e]},t}(),Zc=l((function(){return EI.getInstance("$default_instance")}),"getAnalyticsConnector");y();var Nv=function(){function t(){this.name="identity",this.type=ki.BEFORE,this.identityStore=Zc().identityStore}return l(t,"IdentityEventSender"),t.prototype.execute=function(t){return mn(this,void 0,void 0,(function(){var e;return yn(this,(function(n){return(e=t.user_properties)&&this.identityStore.editIdentity().updateUserProperties(e).commit(),[2,t]}))}))},t.prototype.setup=function(t){return Promise.resolve(void 0)},t}();y();var Tv=l((function(){var t,e,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(e=null===(t=navigator.languages)||void 0===t?void 0:t[0])&&void 0!==e?e:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""}),"getLanguage");y();var Xd=l((function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.name,o=r.args,s=r.resolve,a=t&&t[i];if("function"==typeof a){var l=a.apply(t,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return t}),"convertProxyObjectToRealObject"),Yd=l((function(t){return t&&void 0!==t._q}),"isInstanceProxy");y();var II=er(Ov());y();var MI="1.6.8",bD="Web",xD="$remote",PI=function(){function t(){var t;this.name="context",this.type=ki.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(MI),typeof navigator<"u"&&(t=navigator.userAgent),this.uaResult=new II.default(t).getResult()}return l(t,"Context"),t.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},t.prototype.execute=function(t){return Er(this,void 0,void 0,(function(){var e,n,r,i,o;return Mr(this,(function(s){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),e=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,i=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,[2,$t($t($t($t($t($t($t($t($t($t($t($t({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:e},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:bD}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:i}),this.config.trackingOptions.language&&{language:Tv()}),this.config.trackingOptions.ipAddress&&{ip:xD}),{insert_id:xs(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:this.eventId++,library:this.library})]}))}))},t.prototype.isSessionValid=function(){var t=this.config.lastEventTime||Date.now();return Date.now()-t<this.config.sessionTimeout},t}();y(),y();var Qc=function(){function t(){}return l(t,"LocalStorage"),t.prototype.isEnabled=function(){return Er(this,void 0,void 0,(function(){var e,n,r;return Mr(this,(function(i){switch(i.label){case 0:if(!gi())return[2,!1];e=String(Date.now()),n=new t,r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===e];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},t.prototype.get=function(t){return Er(this,void 0,void 0,(function(){var e;return Mr(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return(e=n.sent())?[2,JSON.parse(e)]:[2,void 0];case 2:return n.sent(),[2,void 0];case 3:return[2]}}))}))},t.prototype.getRaw=function(t){var e;return Er(this,void 0,void 0,(function(){return Mr(this,(function(n){return[2,(null===(e=gi())||void 0===e?void 0:e.localStorage.getItem(t))||void 0]}))}))},t.prototype.set=function(t,e){var n;return Er(this,void 0,void 0,(function(){return Mr(this,(function(r){try{null===(n=gi())||void 0===n||n.localStorage.setItem(t,JSON.stringify(e))}catch{}return[2]}))}))},t.prototype.remove=function(t){var e;return Er(this,void 0,void 0,(function(){return Mr(this,(function(n){try{null===(e=gi())||void 0===e||e.localStorage.removeItem(t)}catch{}return[2]}))}))},t.prototype.reset=function(){var t;return Er(this,void 0,void 0,(function(){return Mr(this,(function(e){try{null===(t=gi())||void 0===t||t.localStorage.clear()}catch{}return[2]}))}))},t}();y();var SI=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={done:4},e}return ys(e,t),l(e,"XHRTransport"),e.prototype.send=function(t,e){return Er(this,void 0,void 0,(function(){var n=this;return Mr(this,(function(r){return[2,new Promise((function(r,i){typeof XMLHttpRequest>"u"&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",t,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done)try{var t=o.responseText,e=JSON.parse(t),s=n.buildResponse(e);r(s)}catch(t){i(t)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(e))}))]}))}))},e}(eu);y();var CI=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ys(e,t),l(e,"SendBeaconTransport"),e.prototype.send=function(t,e){return Er(this,void 0,void 0,(function(){var n=this;return Mr(this,(function(r){return[2,new Promise((function(r,i){var o=gi();if(null==o||!o.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(e);return r(o.navigator.sendBeacon(t,JSON.stringify(e))?n.buildResponse({code:200,events_ingested:e.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(t){i(t)}}))]}))}))},e}(eu),Wd=l((function(){var t=new $c;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,disableCookies:!1,domain:"",sessionManager:new Gd(t,""),sessionTimeout:18e5,storageProvider:new $c,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new kv}}),"getDefaultConfig"),kI=function(t){function e(e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=this,v=Wd();return(y=t.call(this,$t($t({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:e,storageProvider:null!==(i=null==r?void 0:r.storageProvider)&&void 0!==i?i:v.storageProvider,transportProvider:null!==(o=null==r?void 0:r.transportProvider)&&void 0!==o?o:v.transportProvider}))||this).cookieStorage=null!==(s=null==r?void 0:r.cookieStorage)&&void 0!==s?s:v.cookieStorage,y.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:v.sessionManager,y.sessionTimeout=null!==(l=null==r?void 0:r.sessionTimeout)&&void 0!==l?l:v.sessionTimeout,y.appVersion=null==r?void 0:r.appVersion,y.attribution=null==r?void 0:r.attribution,y.cookieExpiration=null!==(u=null==r?void 0:r.cookieExpiration)&&void 0!==u?u:v.cookieExpiration,y.cookieSameSite=null!==(c=null==r?void 0:r.cookieSameSite)&&void 0!==c?c:v.cookieSameSite,y.cookieSecure=null!==(h=null==r?void 0:r.cookieSecure)&&void 0!==h?h:v.cookieSecure,y.deviceId=null==r?void 0:r.deviceId,y.disableCookies=null!==(p=null==r?void 0:r.disableCookies)&&void 0!==p?p:v.disableCookies,y.domain=null!==(f=null==r?void 0:r.domain)&&void 0!==f?f:v.domain,y.lastEventTime=null!==(d=y.lastEventTime)&&void 0!==d?d:null==r?void 0:r.lastEventTime,y.optOut=!(null==r||!r.optOut),y.partnerId=null==r?void 0:r.partnerId,y.sessionId=null==r?void 0:r.sessionId,y.trackingOptions=null!==(g=null==r?void 0:r.trackingOptions)&&void 0!==g?g:v.trackingOptions,y.userId=n,y}return ys(e,t),l(e,"BrowserConfig"),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(t){this.sessionManager.setDeviceId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(t){this.sessionManager.setUserId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(t){this.sessionManager.setSessionId(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(t){var e;null===(e=this.sessionManager)||void 0===e||e.setOptOut(!!t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(t){this.sessionManager.setLastEventTime(t)},enumerable:!1,configurable:!0}),e}(hv),OI=l((function(t,e,n){return Er(void 0,void 0,void 0,(function(){var r,i,o,s,a,l,u,c,h,p,f,d,g,y,v,m,_;return Mr(this,(function(b){switch(b.label){case 0:return r=Wd(),null!==(g=null==n?void 0:n.domain)&&void 0!==g?(o=g,[3,3]):[3,1];case 1:return[4,ID()];case 2:o=b.sent(),b.label=3;case 3:return i=o,[4,wD($t($t({},n),{domain:i}))];case 4:return s=b.sent(),a=tu(t),[4,s.get(a)];case 5:return l=b.sent(),u=Zu(),[4,new Gd(s,t).load()];case 6:return c=b.sent(),h=kI.bind,p=[void 0,t,null!=e?e:null==l?void 0:l.userId],f=[$t({},n)],d={cookieStorage:s,sessionManager:c,deviceId:MD(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,u.deviceId),domain:i,optOut:null!==(y=null==n?void 0:n.optOut)&&void 0!==y?y:!(null==l||!l.optOut)},[4,s.get(a)];case 7:return d.sessionId=null!==(m=null===(v=b.sent())||void 0===v?void 0:v.sessionId)&&void 0!==m?m:null==n?void 0:n.sessionId,[4,ED(n)];case 8:return[2,new(h.apply(kI,p.concat([$t.apply(void 0,f.concat([(d.storageProvider=b.sent(),d.trackingOptions=$t($t({},r.trackingOptions),null==n?void 0:n.trackingOptions),d.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Lv(null==n?void 0:n.transport),d)]))])))]}}))}))}),"useBrowserConfig"),wD=l((function(t,e){return void 0===e&&(e=Wd()),Er(void 0,void 0,void 0,(function(){var n,r,i;return Mr(this,(function(o){switch(o.label){case 0:return n=$t($t({},e),t),r=null==t?void 0:t.cookieStorage,(i=!r)?[3,2]:[4,r.isEnabled()];case 1:i=!o.sent(),o.label=2;case 2:return i?[2,Av(n)]:[2,r]}}))}))}),"createCookieStorage"),Av=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n;return Mr(this,(function(r){switch(r.label){case 0:return e=new ru({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),(n=t.disableCookies)?[3,2]:[4,e.isEnabled()];case 1:n=!r.sent(),r.label=2;case 2:return n?[4,(e=new Qc).isEnabled()]:[3,4];case 3:r.sent()||(e=new $c),r.label=4;case 4:return[2,e]}}))}))}),"createFlexibleStorage"),ED=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return Mr(this,(function(l){switch(l.label){case 0:if(t&&Object.prototype.hasOwnProperty.call(t,"storageProvider")&&!t.storageProvider)return[3,9];l.label=1;case 1:l.trys.push([1,7,8,9]),e=GM([null==t?void 0:t.storageProvider,new Qc]),n=e.next(),l.label=2;case 2:return n.done?[3,6]:(r=n.value,(i=r)?[4,r.isEnabled()]:[3,4]);case 3:i=l.sent(),l.label=4;case 4:if(i)return[2,r];l.label=5;case 5:return n=e.next(),[3,2];case 6:return[3,9];case 7:return o=l.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=e.return)&&a.call(e)}finally{if(s)throw s.error}return[7];case 9:return[2,void 0]}}))}))}),"createEventsStorage"),MD=l((function(t,e,n){return e||n||t||xs()}),"createDeviceId"),Lv=l((function(t){return t===Ju.XHR?new SI:t===Ju.SendBeacon?new CI:Wd().transportProvider}),"createTransport"),ID=l((function(t){return Er(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return Mr(this,(function(l){switch(l.label){case 0:return[4,(new ru).isEnabled()];case 1:if(!l.sent()||!t&&typeof location>"u")return[2,""];for(e=null!=t?t:location.hostname,n=e.split("."),r=[],i="AMP_TLDTEST",o=n.length-2;o>=0;--o)r.push(n.slice(o).join("."));o=0,l.label=2;case 2:return o<r.length?(s=r[o],[4,(a=new ru({domain:"."+s})).set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return l.sent()?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))}),"getTopLevelDomain");y();var TI=l((function(t,e){return Er(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,l,u,c;return Mr(this,(function(h){switch(h.label){case 0:return[4,(n=new ru).isEnabled()];case 1:return(!h.sent()||null!=e&&e.disableCookies)&&(n=new Qc),[4,n.isEnabled()];case 2:return h.sent()?(r=Sv(t),[4,n.getRaw(r)]):[2,{optOut:!1}];case 3:return(i=h.sent())?[4,n.remove(r)]:[2,{optOut:!1}];case 4:return h.sent(),o=UM(i.split("."),5),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],[2,{deviceId:s,userId:PD(a),sessionId:NI(u),lastEventTime:NI(c),optOut:!!l}]}}))}))}),"parseOldCookies"),NI=l((function(t){var e=parseInt(t,32);if(!isNaN(e))return e}),"parseTime"),PD=l((function(t){if(atob&&escape&&t)try{return decodeURIComponent(escape(atob(t)))}catch{return}}),"decode"),SD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ys(e,t),l(e,"AmplitudeBrowser"),e.prototype.init=function(e,n,r){var i,o,s;return void 0===e&&(e=""),Er(this,void 0,void 0,(function(){var a,l,u,c,h=this;return Mr(this,(function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,TI(e,r)]);case 1:return a=p.sent(),[4,OI(e,n||a.userId,$t($t({},r),{deviceId:null!==(i=a.deviceId)&&void 0!==i?i:null==r?void 0:r.deviceId,sessionId:null!==(o=a.sessionId)&&void 0!==o?o:null==r?void 0:r.sessionId,optOut:null!==(s=null==r?void 0:r.optOut)&&void 0!==s?s:a.optOut,lastEventTime:a.lastEventTime}))];case 2:return l=p.sent(),[4,t.prototype._init.call(this,l)];case 3:return p.sent(),u=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),u=!0),(c=Zc()).eventBridge.setEventReceiver((function(t){h.track(t.eventType,t.eventProperties)})),c.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new PI)];case 4:return p.sent(),[4,this.add(new Nv)];case 5:return p.sent(),[4,this.add(new gv)];case 6:return p.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,u)];case 7:return p.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return p.sent(),[2]}}))}))},e.prototype.runAttributionStrategy=function(t,e){return void 0===e&&(e=!1),Er(this,void 0,void 0,(function(){var n,r,i;return Mr(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Av(this.config)];case 1:return i=o.sent(),[4,new Cv(this.config.apiKey,$t($t({},t),{storage:i,track:n,onNewCampaign:r})).send(e)];case 2:return o.sent(),[2]}}))}))},e.prototype.getUserId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.userId},e.prototype.setUserId=function(t){this.config?this.config.userId=t:this.q.push(this.setUserId.bind(this,t))},e.prototype.getDeviceId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.deviceId},e.prototype.setDeviceId=function(t){this.config?this.config.deviceId=t:this.q.push(this.setDeviceId.bind(this,t))},e.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(xs())},e.prototype.getSessionId=function(){var t;return null===(t=this.config)||void 0===t?void 0:t.sessionId},e.prototype.setSessionId=function(t){this.config?(this.config.sessionId=t,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,t))},e.prototype.setTransport=function(t){this.config?this.config.transportProvider=Lv(t):this.q.push(this.setTransport.bind(this,t))},e.prototype.identify=function(e,n){if(Yd(e)){var r=e._q;e._q=[],e=Xd(new Ro,r)}return null!=n&&n.user_id&&this.setUserId(n.user_id),null!=n&&n.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,e,n)},e.prototype.groupIdentify=function(e,n,r,i){if(Yd(r)){var o=r._q;r._q=[],r=Xd(new Ro,o)}return t.prototype.groupIdentify.call(this,e,n,r,i)},e.prototype.revenue=function(e,n){if(Yd(e)){var r=e._q;e._q=[],e=Xd(new Bd,r)}return t.prototype.revenue.call(this,e,n)},e}(pv),Hd=l((function(){var t=new SD;return{init:Jr(lo(t.init.bind(t)),"init",$r(t),Kr(t,["config"])),add:Jr(lo(t.add.bind(t)),"add",$r(t),Kr(t,["config.apiKey","timeline.plugins"])),remove:Jr(lo(t.remove.bind(t)),"remove",$r(t),Kr(t,["config.apiKey","timeline.plugins"])),track:Jr(lo(t.track.bind(t)),"track",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),logEvent:Jr(lo(t.logEvent.bind(t)),"logEvent",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),identify:Jr(lo(t.identify.bind(t)),"identify",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Jr(lo(t.groupIdentify.bind(t)),"groupIdentify",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),setGroup:Jr(lo(t.setGroup.bind(t)),"setGroup",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),revenue:Jr(lo(t.revenue.bind(t)),"revenue",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),flush:Jr(lo(t.flush.bind(t)),"flush",$r(t),Kr(t,["config.apiKey","timeline.queue.length"])),getUserId:Jr(t.getUserId.bind(t),"getUserId",$r(t),Kr(t,["config","config.userId"])),setUserId:Jr(t.setUserId.bind(t),"setUserId",$r(t),Kr(t,["config","config.userId"])),getDeviceId:Jr(t.getDeviceId.bind(t),"getDeviceId",$r(t),Kr(t,["config","config.deviceId"])),setDeviceId:Jr(t.setDeviceId.bind(t),"setDeviceId",$r(t),Kr(t,["config","config.deviceId"])),reset:Jr(t.reset.bind(t),"reset",$r(t),Kr(t,["config","config.userId","config.deviceId"])),getSessionId:Jr(t.getSessionId.bind(t),"getSessionId",$r(t),Kr(t,["config"])),setSessionId:Jr(t.setSessionId.bind(t),"setSessionId",$r(t),Kr(t,["config"])),setOptOut:Jr(t.setOptOut.bind(t),"setOptOut",$r(t),Kr(t,["config"])),setTransport:Jr(t.setTransport.bind(t),"setTransport",$r(t),Kr(t,["config"]))}}),"createInstance"),sn=Hd(),xH=sn.add,wH=sn.flush,EH=sn.getDeviceId,MH=sn.getSessionId,IH=sn.getUserId,PH=sn.groupIdentify,SH=sn.identify,CH=sn.init,kH=sn.logEvent,OH=sn.remove,NH=sn.reset,TH=sn.revenue,AH=sn.setDeviceId,LH=sn.setGroup,RH=sn.setOptOut,DH=sn.setSessionId,FH=sn.setTransport,BH=sn.setUserId,jH=sn.track,Y0={production:"40ead723d18886045e302513245edb27",development:""},Qu={plan:{version:"22",branch:"main",source:"websdk",versionId:"197467d1-8926-452d-a088-b3817cbac89f"},ingestionMetadata:{sourceName:"browser-typescript-ampli",sourceVersion:"2.0.0"}},W0=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:categorySelected-call"),this.event_properties=t}};l(W0,"AnalyticsCategorySelectedCall");var ef=W0,H0=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:locationSelected-call"),this.event_properties=t}};l(H0,"AnalyticsLocationSelectedCall");var tf=H0,$0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:disable-call"),this.event_properties=t}};l($0,"BlueDotDisableCall");var Rv=$0,K0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:enable-call"),this.event_properties=t}};l(K0,"BlueDotEnableCall");var Dv=K0,J0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:off-call"),this.event_properties=t}};l(J0,"BlueDotOffCall");var Fv=J0,Z0=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:on-call"),this.event_properties=t}};l(Z0,"BlueDotOnCall");var Bv=Z0,Q0=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:animate-call"),this.event_properties=t}};l(Q0,"CameraAnimateCall");var jv=Q0,e1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:cancelAnimation-call"),this.event_properties=t}};l(e1,"CameraCancelAnimationCall");var zv=e1,t1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:focusOn-call"),this.event_properties=t}};l(t1,"CameraFocusOnCall");var qv=t1,r1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:getSafeAreaInsets-call"),this.event_properties=t}};l(r1,"CameraGetSafeAreaInsetsCall");var Gv=r1,n1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.disable-call"),this.event_properties=t}};l(n1,"CameraInteractionDisableCall");var Uv=n1,i1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.enable-call"),this.event_properties=t}};l(i1,"CameraInteractionEnableCall");var Vv=i1,o1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:set-call"),this.event_properties=t}};l(o1,"CameraSetCall");var Xv=o1,a1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:setSafeAreaInsets-call"),this.event_properties=t}};l(a1,"CameraSetSafeAreaInsetsCall");var Yv=a1,s1=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:translate-call"),this.event_properties=t}};l(s1,"CameraTranslateCall");var Wv=s1,u1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:add-call"),this.event_properties=t}};l(u1,"FlatLabelsAddCall");var Hv=u1,l1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:labelAllLocations-call"),this.event_properties=t}};l(l1,"FlatLabelsLabelAllLocationsCall");var $v=l1,c1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:remove-call"),this.event_properties=t}};l(c1,"FlatLabelsRemoveCall");var Kv=c1,f1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:removeAll-call"),this.event_properties=t}};l(f1,"FlatLabelsRemoveAllCall");var Jv=f1,p1=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:setAppearance-call"),this.event_properties=t}};l(p1,"FlatLabelsSetAppearanceCall");var Zv=p1,h1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:add-call"),this.event_properties=t}};l(h1,"FloatingLabelsAddCall");var Qv=h1,d1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:labelAllLocations-call"),this.event_properties=t}};l(d1,"FloatingLabelsLabelAllLocationsCall");var e0=d1,g1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:remove-call"),this.event_properties=t}};l(g1,"FloatingLabelsRemoveCall");var t0=g1,m1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:removeAll-call"),this.event_properties=t}};l(m1,"FloatingLabelsRemoveAllCall");var r0=m1,y1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:resetPriority-call"),this.event_properties=t}};l(y1,"FloatingLabelsResetPriorityCall");var n0=y1,v1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setAppearance-call"),this.event_properties=t}};l(v1,"FloatingLabelsSetAppearanceCall");var i0=v1,_1=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setPriority-call"),this.event_properties=t}};l(_1,"FloatingLabelsSetPriorityCall");var o0=_1,b1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenue-call"),this.event_properties=t}};l(b1,"GlobalGetVenueCall");var rf=b1,x1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenueMVF-call"),this.event_properties=t}};l(x1,"GlobalGetVenueMvfCall");var nf=x1,w1=class{constructor(t){this.event_properties=t,D(this,"event_type","global:showVenue-call"),this.event_properties=t}};l(w1,"GlobalShowVenueCall");var a0=w1,E1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:clear-call"),this.event_properties=t}};l(E1,"JourneyClearCall");var s0=E1,M1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:draw-call"),this.event_properties=t}};l(M1,"JourneyDrawCall");var u0=M1,I1=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:setStep-call"),this.event_properties=t}};l(I1,"JourneySetStepCall");var l0=I1,P1=class{constructor(t){this.event_properties=t,D(this,"event_type","Mappedin:getCollectionItemById-call"),this.event_properties=t}};l(P1,"MappedinGetCollectionItemByIdCall");var c0=P1,S1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:absoluteDistanceTo-call"),this.event_properties=t}};l(S1,"MappedinCoordinateAbsoluteDistanceToCall");var f0=S1,C1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:nearestNode-call"),this.event_properties=t}};l(C1,"MappedinCoordinateNearestNodeCall");var p0=C1,k1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:clone-call"),this.event_properties=t}};l(k1,"MappedinLocationCloneCall");var of=k1,O1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:directionsTo-call"),this.event_properties=t}};l(O1,"MappedinLocationDirectionsToCall");var af=O1,N1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:distanceTo-call"),this.event_properties=t}};l(N1,"MappedinLocationDistanceToCall");var sf=N1,T1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinate-call"),this.event_properties=t}};l(T1,"MappedinMapCreateCoordinateCall");var h0=T1,A1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinateByXY-call"),this.event_properties=t}};l(A1,"MappedinMapCreateCoordinateByXyCall");var d0=A1,L1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:getNorth-call"),this.event_properties=t}};l(L1,"MappedinMapGetNorthCall");var g0=L1,R1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:directionsTo-call"),this.event_properties=t}};l(R1,"MappedinNodeDirectionsToCall");var uf=R1,D1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:distanceTo-call"),this.event_properties=t}};l(D1,"MappedinNodeDistanceToCall");var lf=D1,F1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:directionsTo-call"),this.event_properties=t}};l(F1,"MappedinPolygonDirectionsToCall");var cf=F1,B1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:distanceTo-call"),this.event_properties=t}};l(B1,"MappedinPolygonDistanceToCall");var ff=B1,j1=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinVenue:metadata-read"),this.event_properties=t}};l(j1,"MappedinVenueMetadataRead");var pf=j1,z1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygon-call"),this.event_properties=t}};l(z1,"MapViewAddInteractivePolygonCall");var m0=z1,q1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygonsForAllLocations-call"),this.event_properties=t}};l(q1,"MapViewAddInteractivePolygonsForAllLocationsCall");var y0=q1,G1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:clearPolygonColor-call"),this.event_properties=t}};l(G1,"MapViewClearPolygonColorCall");var v0=G1,U1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createCustomTooltip-call"),this.event_properties=t}};l(U1,"MapViewCreateCustomTooltipCall");var _0=U1,V1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createMarker-call"),this.event_properties=t}};l(V1,"MapViewCreateMarkerCall");var b0=V1,X1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createTooltip-call"),this.event_properties=t}};l(X1,"MapViewCreateTooltipCall");var x0=X1,Y1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:destroy-call"),this.event_properties=t}};l(Y1,"MapViewDestroyCall");var w0=Y1,W1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:disableImageFlippingForAllPolygons-call"),this.event_properties=t}};l(W1,"MapViewDisableImageFlippingForAllPolygonsCall");var E0=W1,H1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:drawPath-call"),this.event_properties=t}};l(H1,"MapViewDrawPathCall");var M0=H1,$1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForAllLocations-call"),this.event_properties=t}};l($1,"MapViewEnableImageFlippingForAllLocationsCall");var I0=$1,K1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForPolygon-call"),this.event_properties=t}};l(K1,"MapViewEnableImageFlippingForPolygonCall");var P0=K1,J1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getNearestNodeByScreenCoordinates-call"),this.event_properties=t}};l(J1,"MapViewGetNearestNodeByScreenCoordinatesCall");var S0=J1,Z1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPolygonAtCoordinate-call"),this.event_properties=t}};l(Z1,"MapViewGetPolygonAtCoordinateCall");var C0=Z1,Q1=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPrimaryLocationForPolygon-call"),this.event_properties=t}};l(Q1,"MapViewGetPrimaryLocationForPolygonCall");var k0=Q1,e_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:labelAllLocations-call"),this.event_properties=t}};l(e_,"MapViewLabelAllLocationsCall");var O0=e_,t_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllInteractivePolygons-call"),this.event_properties=t}};l(t_,"MapViewRemoveAllInteractivePolygonsCall");var N0=t_,r_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllMarkers-call"),this.event_properties=t}};l(r_,"MapViewRemoveAllMarkersCall");var T0=r_,n_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllPaths-call"),this.event_properties=t}};l(n_,"MapViewRemoveAllPathsCall");var A0=n_,i_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllTooltips-call"),this.event_properties=t}};l(i_,"MapViewRemoveAllTooltipsCall");var L0=i_,o_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeInteractivePolygon-call"),this.event_properties=t}};l(o_,"MapViewRemoveInteractivePolygonCall");var R0=o_,a_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeMarker-call"),this.event_properties=t}};l(a_,"MapViewRemoveMarkerCall");var D0=a_,s_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removePath-call"),this.event_properties=t}};l(s_,"MapViewRemovePathCall");var F0=s_,u_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeTooltip-call"),this.event_properties=t}};l(u_,"MapViewRemoveTooltipCall");var B0=u_,l_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setBackgroundColor-call"),this.event_properties=t}};l(l_,"MapViewSetBackgroundColorCall");var j0=l_,c_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setHoverColor-call"),this.event_properties=t}};l(c_,"MapViewSetHoverColorCall");var z0=c_,f_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setMap-call"),this.event_properties=t}};l(f_,"MapViewSetMapCall");var q0=f_,p_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setPolygonColor-call"),this.event_properties=t}};l(p_,"MapViewSetPolygonColorCall");var G0=p_,h_=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setState-call"),this.event_properties=t}};l(h_,"MapViewSetStateCall");var U0=h_,d_=class{constructor(t){this.event_properties=t,D(this,"event_type","metrics:mapLoad-event"),this.event_properties=t}};l(d_,"MetricsMapLoadEvent");var V0=d_,g_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:addQuery-call"),this.event_properties=t}};l(g_,"OfflineSearchAddQueryCall");var hf=g_,m_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:constructor-call"),this.event_properties=t}};l(m_,"OfflineSearchConstructorCall");var df=m_,y_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:search-call"),this.event_properties=t}};l(y_,"OfflineSearchSearchCall");var gf=y_,v_=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:suggest-call"),this.event_properties=t}};l(v_,"OfflineSearchSuggestCall");var mf=v_,$d=l((()=>({promise:Promise.resolve()})),"getVoidPromiseResult"),__=class{constructor(){D(this,"disabled",!1),D(this,"amplitude")}get client(){return this.isInitializedAndEnabled(),this.amplitude}get isLoaded(){return null!=this.amplitude}isInitializedAndEnabled(){return this.amplitude?!this.disabled:(console.error("ERROR: Ampli is not yet initialized. Have you called ampli.load() on app start?"),!1)}load(t){var e,n;if(this.disabled=null!=(e=t.disabled)&&e,this.amplitude)return console.warn("WARNING: Ampli is already intialized. Ampli.load() should be called once at application startup."),$d();let r=null;if(t.client&&"apiKey"in t.client?r=t.client.apiKey:"environment"in t&&(r=Y0[t.environment]),t.client&&"instance"in t.client)this.amplitude=t.client.instance;else{if(r)return this.amplitude=Hd(),this.amplitude.init(r,void 0,{...Qu,...null!=(null==t?void 0:t.client)&&"configuration"in t.client?null==(n=t.client)?void 0:n.configuration:{}});console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'")}return $d()}identify(t,e,n){if(!this.isInitializedAndEnabled())return $d();t&&(n={...n,user_id:t});let r=new Ro,i=e;if(null!=i)for(let[t,e]of Object.entries(i))r.set(t,e);return this.amplitude.identify(r,n)}track(t,e){return this.isInitializedAndEnabled()?this.amplitude.track(t,void 0,e):$d()}analyticsCategorySelectedCall(t,e){return this.track(new ef(t),e)}analyticsLocationSelectedCall(t,e){return this.track(new tf(t),e)}blueDotDisableCall(t,e){return this.track(new Rv(t),e)}blueDotEnableCall(t,e){return this.track(new Dv(t),e)}blueDotOffCall(t,e){return this.track(new Fv(t),e)}blueDotOnCall(t,e){return this.track(new Bv(t),e)}cameraAnimateCall(t,e){return this.track(new jv(t),e)}cameraCancelAnimationCall(t,e){return this.track(new zv(t),e)}cameraFocusOnCall(t,e){return this.track(new qv(t),e)}cameraGetSafeAreaInsetsCall(t,e){return this.track(new Gv(t),e)}cameraInteractionDisableCall(t,e){return this.track(new Uv(t),e)}cameraInteractionEnableCall(t,e){return this.track(new Vv(t),e)}cameraSetCall(t,e){return this.track(new Xv(t),e)}cameraSetSafeAreaInsetsCall(t,e){return this.track(new Yv(t),e)}cameraTranslateCall(t,e){return this.track(new Wv(t),e)}flatLabelsAddCall(t,e){return this.track(new Hv(t),e)}flatLabelsLabelAllLocationsCall(t,e){return this.track(new $v(t),e)}flatLabelsRemoveCall(t,e){return this.track(new Kv(t),e)}flatLabelsRemoveAllCall(t,e){return this.track(new Jv(t),e)}flatLabelsSetAppearanceCall(t,e){return this.track(new Zv(t),e)}floatingLabelsAddCall(t,e){return this.track(new Qv(t),e)}floatingLabelsLabelAllLocationsCall(t,e){return this.track(new e0(t),e)}floatingLabelsRemoveCall(t,e){return this.track(new t0(t),e)}floatingLabelsRemoveAllCall(t,e){return this.track(new r0(t),e)}floatingLabelsResetPriorityCall(t,e){return this.track(new n0(t),e)}floatingLabelsSetAppearanceCall(t,e){return this.track(new i0(t),e)}floatingLabelsSetPriorityCall(t,e){return this.track(new o0(t),e)}globalGetVenueCall(t,e){return this.track(new rf(t),e)}globalGetVenueMvfCall(t,e){return this.track(new nf(t),e)}globalShowVenueCall(t,e){return this.track(new a0(t),e)}journeyClearCall(t,e){return this.track(new s0(t),e)}journeyDrawCall(t,e){return this.track(new u0(t),e)}journeySetStepCall(t,e){return this.track(new l0(t),e)}mappedinGetCollectionItemByIdCall(t,e){return this.track(new c0(t),e)}mappedinCoordinateAbsoluteDistanceToCall(t,e){return this.track(new f0(t),e)}mappedinCoordinateNearestNodeCall(t,e){return this.track(new p0(t),e)}mappedinLocationCloneCall(t,e){return this.track(new of(t),e)}mappedinLocationDirectionsToCall(t,e){return this.track(new af(t),e)}mappedinLocationDistanceToCall(t,e){return this.track(new sf(t),e)}mappedinMapCreateCoordinateCall(t,e){return this.track(new h0(t),e)}mappedinMapCreateCoordinateByXyCall(t,e){return this.track(new d0(t),e)}mappedinMapGetNorthCall(t,e){return this.track(new g0(t),e)}mappedinNodeDirectionsToCall(t,e){return this.track(new uf(t),e)}mappedinNodeDistanceToCall(t,e){return this.track(new lf(t),e)}mappedinPolygonDirectionsToCall(t,e){return this.track(new cf(t),e)}mappedinPolygonDistanceToCall(t,e){return this.track(new ff(t),e)}mappedinVenueMetadataRead(t,e){return this.track(new pf(t),e)}mapViewAddInteractivePolygonCall(t,e){return this.track(new m0(t),e)}mapViewAddInteractivePolygonsForAllLocationsCall(t,e){return this.track(new y0(t),e)}mapViewClearPolygonColorCall(t,e){return this.track(new v0(t),e)}mapViewCreateCustomTooltipCall(t,e){return this.track(new _0(t),e)}mapViewCreateMarkerCall(t,e){return this.track(new b0(t),e)}mapViewCreateTooltipCall(t,e){return this.track(new x0(t),e)}mapViewDestroyCall(t,e){return this.track(new w0(t),e)}mapViewDisableImageFlippingForAllPolygonsCall(t,e){return this.track(new E0(t),e)}mapViewDrawPathCall(t,e){return this.track(new M0(t),e)}mapViewEnableImageFlippingForAllLocationsCall(t,e){return this.track(new I0(t),e)}mapViewEnableImageFlippingForPolygonCall(t,e){return this.track(new P0(t),e)}mapViewGetNearestNodeByScreenCoordinatesCall(t,e){return this.track(new S0(t),e)}mapViewGetPolygonAtCoordinateCall(t,e){return this.track(new C0(t),e)}mapViewGetPrimaryLocationForPolygonCall(t,e){return this.track(new k0(t),e)}mapViewLabelAllLocationsCall(t,e){return this.track(new O0(t),e)}mapViewRemoveAllInteractivePolygonsCall(t,e){return this.track(new N0(t),e)}mapViewRemoveAllMarkersCall(t,e){return this.track(new T0(t),e)}mapViewRemoveAllPathsCall(t,e){return this.track(new A0(t),e)}mapViewRemoveAllTooltipsCall(t,e){return this.track(new L0(t),e)}mapViewRemoveInteractivePolygonCall(t,e){return this.track(new R0(t),e)}mapViewRemoveMarkerCall(t,e){return this.track(new D0(t),e)}mapViewRemovePathCall(t,e){return this.track(new F0(t),e)}mapViewRemoveTooltipCall(t,e){return this.track(new B0(t),e)}mapViewSetBackgroundColorCall(t,e){return this.track(new j0(t),e)}mapViewSetHoverColorCall(t,e){return this.track(new z0(t),e)}mapViewSetMapCall(t,e){return this.track(new q0(t),e)}mapViewSetPolygonColorCall(t,e){return this.track(new G0(t),e)}mapViewSetStateCall(t,e){return this.track(new U0(t),e)}metricsMapLoadEvent(t,e){return this.track(new V0(t),e)}offlineSearchAddQueryCall(t,e){return this.track(new hf(t),e)}offlineSearchConstructorCall(t,e){return this.track(new df(t),e)}offlineSearchSearchCall(t,e){return this.track(new gf(t),e)}offlineSearchSuggestCall(t,e){return this.track(new mf(t),e)}};l(__,"Ampli");var X0=__,yf=new X0;y();var ja,cu,Do,al,ra,mg,HP,yg,$P,kf,U_,Of,V_,Fo,XP=er(hP()),YP=er(GP()),WP=er(UP()),VP="5.29.4",ZB="https://api2.amplitude.com/2/httpapi",QB="https://api2.amplitude.com/batch",ej="__unspecified__",q_={branch:"main",version:"0",source:"websdk"},mi=class t{constructor(){oe(this,mg),oe(this,yg),oe(this,kf),oe(this,Of),oe(this,Do,{}),oe(this,al,!1),oe(this,ra,void 0),oe(this,Fo,l((async t=>{rj(t.type)&&(window.removeEventListener("visibilitychange",B(this,Fo)),window.removeEventListener("pagehide",B(this,Fo)),window.removeEventListener("beforeunload",B(this,Fo)),window.removeEventListener("unload",B(this,Fo)),await this.sendAllPendingEvents())}),"#handlePageUnload")),null==B(t,cu)&&le(t,cu,VP),typeof navigator<"u"&&null!=navigator.userAgent&&le(this,ra,new WP.UAParser(navigator.userAgent).getResult())}static setContext(e){le(t,ja,e)}static setVersion(e){le(t,cu,e)}addPendingEvent(e){var n;if(null==B(t,ja))return;let r=e.event_type;if(!wr(this,yg,$P).call(this,e))return;null==e.event_properties&&(e.event_properties={});let i=B(this,Do)[r];(0,YP.default)(e.event_properties,null!=(n=null==i?void 0:i.event_properties)?n:{}),B(this,Do)[r]=e}async sendAllPendingEvents(){if(null==B(t,ja)||Object.keys(B(this,Do)).length<1)return;if(B(this,al))return void Ie.warn("The current batch of analytics is already sending. Wait until this finishes before trying to send again.");let e=[];for(let t in B(this,Do)){let n=B(this,Do)[t],r=wr(this,kf,U_).call(this,n);null!=r&&e.push(r)}if(!(e.length<1))try{le(this,al,!0),200===(await wr(this,Of,V_).call(this,QB,e)).status&&le(this,Do,{})}catch(t){Ie.warn("Error sending batch product analytics!",t)}finally{le(this,al,!1)}}async load(){if(!yf.isLoaded){let{promise:t}=yf.load({environment:"production",client:{configuration:{trackingOptions:{osName:!0}}}});t.then((()=>{window.addEventListener("pagehide",B(this,Fo)),window.addEventListener("beforeunload",B(this,Fo)),window.addEventListener("unload",B(this,Fo)),window.addEventListener("visibilitychange",B(this,Fo))}))}}async sendEventNow(e){if(null==B(t,ja))return;let n=wr(this,kf,U_).call(this,e);if(null!=n)try{await wr(this,Of,V_).call(this,ZB,[n])}catch(t){Ie.warn("Error sending single product analytics event!",t)}}};ja=new WeakMap,cu=new WeakMap,Do=new WeakMap,al=new WeakMap,ra=new WeakMap,mg=new WeakSet,HP=l((function(t){let e=t.event_type;return null!=B(this,Do)[e]}),"#isEventTypePending"),yg=new WeakSet,$P=l((function(t){if(!wr(this,mg,HP).call(this,t))return!0;let e=t.event_type,n=B(this,Do)[e];return!(0,XP.default)(n.event_properties,t.event_properties)}),"#didEventPropertiesChange"),kf=new WeakSet,U_=l((function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v;if(null!=B(mi,ja))return null==(null==(e=t.event_properties)?void 0:e.venue)&&Ie.warn("Error processing product analytics event! Unspecified venue slug",t),null==Qu.plan&&Ie.warn("Error processing product analytics event! Unknown coinfiguration plan",t),{event_type:t.event_type,session_id:null!=(n=yf.client.getSessionId())?n:_g(),device_id:null!=(r=yf.client.getDeviceId())?r:vg(),plan:{branch:null!=(o=null==(i=Qu.plan)?void 0:i.branch)?o:q_.branch,version:null!=(a=null==(s=Qu.plan)?void 0:s.version)?a:q_.version,source:null!=(u=null==(l=Qu.plan)?void 0:l.source)?u:q_.source},os_name:null==(c=B(this,ra))?void 0:c.browser.name,os_version:null==(h=B(this,ra))?void 0:h.browser.version,device_manufacturer:null==(p=B(this,ra))?void 0:p.device.vendor,device_model:null==(f=B(this,ra))?void 0:f.device.model,event_properties:{...t.event_properties,context:B(mi,ja),sdk_version:B(mi,cu),browser_name:null==(d=B(this,ra))?void 0:d.browser.name,browser_version:null==(g=B(this,ra))?void 0:g.browser.version,venue:null!=(v=null==(y=t.event_properties)?void 0:y.venue)?v:ej},time:t.time}}),"#makeBatchFormattedEvent"),Of=new WeakSet,V_=l((async function(t,e){return await Oi()(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({api_key:Y0.production,events:e})})}),"#batchSend"),Fo=new WeakMap,l(mi,"ProductAnalytics"),oe(mi,ja,void 0),oe(mi,cu,void 0);var G_=mi,tj=new G_,Nr=tj;function rj(t){return"beforeunload"===t||"pagehide"===t||"unload"===t||"hidden"===document.visibilityState}l(rj,"areWeLeavingThePage");var co,sl,Yn,Af,Nf=class t extends Qo{constructor(t,e){super(t),oe(this,co,void 0),oe(this,sl,void 0),oe(this,Yn,{}),D(this,"id",""),D(this,"x",0),D(this,"y",0),D(this,"operationHours"),D(this,"externalId"),oe(this,Af,void 0),le(this,co,t),le(this,sl,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=B(this,Yn).map;if(typeof t<"u")return t;let e=B(this,co).getCollectionItemById("maps",B(this,sl).map);return B(this,Yn).map=e,e}get lat(){var t;let e=B(this,Yn).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=B(this,co)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return B(this,Yn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),B(this,Yn).cachedLatLon.lat}get lon(){var t;let e=B(this,Yn).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=B(this,co)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return B(this,Yn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),B(this,Yn).cachedLatLon.lon}get paths(){let t=B(this,Yn).paths;if(typeof t<"u")return t;let e=[],n=B(this,co)._nodesById,r=B(this,Af);if(Array.isArray(r))for(let t=0,i=r.length;t<i;++t){let i=n[r[t].node];null!=i&&e.push(i)}return B(this,Yn).paths=e,e}set paths(t){le(this,Af,t)}get locations(){var t,e,n;let r=B(this,Yn).locations;if(typeof r<"u")return r;let i=[],o=null!=(n=null==(e=null==(t=ri.instances.get(B(this,co)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=o.length;t<e;++t){let e=o[t],n=e.nodes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===s){i.push(e);break}}return B(this,Yn).locations=i,i}get polygon(){var t,e,n;let r=B(this,Yn).polygon;if(typeof r<"u")return r;let i,o=null!=(n=null==(e=null==(t=ri.instances.get(B(this,co)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=o.length;t<e;++t){let e=o[t];e.entrances.map((t=>t.id)).includes(s)&&(i=e)}return B(this,Yn).polygon=i,i}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.nodes.slice();e.options.things.maps&&Gr(n,"map"),["weight","multiplier","accessible"].forEach((function(t){Gr(n,t)}));let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"node",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Nodes:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,co).venue.slug,i=new uf({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,co).venue.slug;return Nr.addPendingEvent(new lf({venue:n})),super.distanceTo(t,e)}toJSON(){return B(this,sl)}};co=new WeakMap,sl=new WeakMap,Yn=new WeakMap,Af=new WeakMap,l(Nf,"MappedinNode");var Tf=Nf;y();var na,ul,fo,Df,Rf=class t extends Qo{constructor(t,e){super(t),oe(this,na,void 0),oe(this,ul,void 0),oe(this,fo,{}),D(this,"geometry"),D(this,"perspectives"),D(this,"image"),D(this,"holes"),D(this,"textures"),D(this,"material"),D(this,"label"),D(this,"id",""),D(this,"layer"),D(this,"layerId"),D(this,"name"),D(this,"externalId"),D(this,"vertexes"),D(this,"center"),D(this,"canvasBounds"),D(this,"categoryRank"),oe(this,Df,void 0),le(this,na,t),le(this,ul,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=B(this,fo).map;if(typeof t<"u")return t;let e=B(this,na).getCollectionItemById("maps",B(this,ul).map);return B(this,fo).map=e,e}get locations(){var t,e;let n=B(this,fo).locations;if(typeof n<"u")return n;let r=[],i=null!=(e=null==(t=ri.instances.get(B(this,na)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:o}=this;for(let t=0,e=i.length;t<e;++t){let e=i[t],n=e.polygons;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===o){r.push(e);break}}return B(this,fo).locations=r,r}get entrances(){let t=B(this,fo).entrances;if(typeof t<"u")return t;let e=[],n=B(this,Df),r=B(this,na)._nodesById;if(Array.isArray(n)){for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return B(this,fo).entrances=e,e}return[]}set entrances(t){le(this,Df,t)}get rank(){let t=B(this,fo).rank;if(typeof t<"u")return t;let{rankings:e}=B(this,na);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(B(this,fo).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(B(this,fo).rank=null,null)}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.polygons.slice();e.options.things.maps&&Gr(n,"map"),e.options.things.nodes&&Gr(n,"entrances");let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"polygon",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Polygons:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,na).venue.slug,i=new cf({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,na).venue.slug;return Nr.addPendingEvent(new ff({venue:n})),super.distanceTo(t,e)}toJSON(){return B(this,ul)}};na=new WeakMap,ul=new WeakMap,fo=new WeakMap,Df=new WeakMap,l(Rf,"MappedinPolygon");var fu=Rf;y();var nj=0,ij="9999-12-31T00:00:00.000Z";function oj(t,e,n=new Date){if(!t.states)return;let r=n||new Date,i=t.states.find((t=>{let e=new Date(t.start||nj),n=new Date(t.end||ij);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}l(oj,"getCurrentLocationState");var Gi,Is,Ui,Ff,Bf,jf,ll=class t extends Qo{constructor(t,e){super(t),oe(this,Gi,void 0),oe(this,Is,void 0),oe(this,Ui,{}),D(this,"states"),D(this,"id",""),D(this,"name",""),D(this,"type",""),D(this,"description"),D(this,"sortOrder"),D(this,"logo"),D(this,"phone"),D(this,"social"),D(this,"color"),D(this,"shortName"),D(this,"detailsUrl"),D(this,"tags"),D(this,"toMap"),D(this,"externalId"),D(this,"showLabelWhenImagePresent"),D(this,"showSmartLabelWhenImagePresent"),D(this,"picture"),D(this,"operationHours"),D(this,"siblingGroups"),D(this,"gallery"),D(this,"amenity"),oe(this,Ff,void 0),oe(this,Bf,[]),oe(this,jf,void 0),le(this,Gi,t),le(this,Is,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=B(this,Ui).polygons;if(typeof t<"u")return t;let e=[],n=B(this,Ff),r=B(this,Gi)._polygonsById;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t){let i=r[n[t].id];null!=i&&e.push(i)}return B(this,Ui).polygons=e,e}set polygons(t){le(this,Ff,t)}get nodes(){let t=B(this,Ui).nodes;if(typeof t<"u")return t;let e=[],n=B(this,Bf),r=B(this,Gi)._nodesById;if(n&&n.length)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return B(this,Ui).nodes=e,e}set nodes(t){le(this,Bf,t)}get parent(){let t=B(this,Ui).parent;if(typeof t<"u")return t;let e,n=B(this,Gi)._locationsById,r=B(this,jf);return void 0!==r&&(e=n[r]),B(this,Ui).parent=e,e}set parent(t){le(this,jf,t)}get categories(){let t=B(this,Ui).categories;if(typeof t<"u")return t;let e=[];return B(this,Is).categories.forEach((t=>{let n=B(this,Gi).getCollectionItemById("categories",t);n&&e.push(n)})),B(this,Ui).categories=e,e}get state(){return oj(this,B(this,Gi).locationStates)}clone(){let e=B(this,Gi).venue.slug;return Nr.addPendingEvent(new of({venue:e})),new t(B(this,Gi),B(this,Is))}get nodeOperationHours(){let t=B(this,Ui).nodeOperationHours;if(typeof t<"u")return t;if(null==this.nodes)return{};let e=B(this,Is).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return B(this,Ui).nodeOperationHours=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.locations.slice();e.options.things.categories&&Gr(n,"categories"),e.options.things.nodes&&Gr(n,"nodes"),e.options.things.polygons&&Gr(n,"polygons"),e.options.things.locationStates&&Gr(n,"states");let r={fields:n,venue:e.options.venue};try{let n=await Ur(e.options,"location",r);return e.options.includeHidden||(n=n.filter((t=>!t.hidden))),n.map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Locations:",t),[]}}directionsTo(t,e){let n=t instanceof uo,r=B(this,Gi).venue.slug,i=new af({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=B(this,Gi).venue.slug;return Nr.addPendingEvent(new sf({venue:n})),super.distanceTo(t,e)}toJSON(){let t=B(this,Is);return delete t.color,t}};Gi=new WeakMap,Is=new WeakMap,Ui=new WeakMap,Ff=new WeakMap,Bf=new WeakMap,jf=new WeakMap,l(ll,"MappedinLocation");var za=ll;y();var cl,pu,qf,zf=class t{constructor(t,e){oe(this,cl,void 0),oe(this,pu,{}),oe(this,qf,void 0),D(this,"name"),D(this,"externalId"),D(this,"parents"),D(this,"id"),D(this,"icon"),D(this,"iconFromDefaultList"),D(this,"sortOrder"),this.id=e.id,le(this,qf,e),le(this,cl,t),Object.assign(this,e)}get locations(){var t;let e=B(this,pu).locations;if(typeof e<"u")return e;let n=[],{locations:r}=B(this,cl),{id:i}=this;for(let e=0,o=r.length;e<o;++e){let o=r[e],s=o.categories;if(Array.isArray(s))for(let e=0,r=s.length;e<r;++e)if((null==(t=s[e])?void 0:t.id)===i){n.push(o);break}}return B(this,pu).locations=n,n}get children(){var t;let e=B(this,pu).children;if(typeof e<"u")return e;let{categories:n}=B(this,cl),{id:r}=this,i=[];for(let e=0;e<n.length;e++)r&&null!=(t=n[e].parents)&&t.includes(r)&&i.push(n[e]);return B(this,pu).children=i,i}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n={fields:e.options.things.categories,venue:e.options.venue};try{return(await Ur(e.options,"category",n)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Categories:",t),[]}}toJSON(){return B(this,qf)}};cl=new WeakMap,pu=new WeakMap,qf=new WeakMap,l(zf,"MappedinCategory");var hu=zf;y();var Gf,qa,X_=class{constructor(t,e){oe(this,Gf,void 0),oe(this,qa,void 0),D(this,"distance",0),D(this,"path",[]),D(this,"instructions",[]),le(this,qa,t),le(this,Gf,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,r,i,o,s,a,l,u,c,h,p;let f={...t,action:{...t.action},atLocation:null!=(e=t.atLocation)&&e.id?null==(r=null==(n=B(this,qa))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:null!=(i=t.node)&&i.id?null==(s=null==(o=B(this,qa))?void 0:o._nodesById)?void 0:s[t.node.id]:void 0};if("TakeVortex"===(null==(a=f.action)?void 0:a.type)||"ExitVortex"===(null==(l=f.action)?void 0:l.type)){let t=null==(c=B(this,qa)._mapsById)?void 0:c[null==(u=f.action)?void 0:u.fromMap.id],e=null==(p=B(this,qa)._mapsById)?void 0:p[null==(h=f.action)?void 0:h.toMap.id];t&&e&&(f.action.fromMap=t,f.action.toMap=e)}return f})),this.path=e.path.reduce(((t,{id:e})=>{var n,r;let i=null==(r=null==(n=B(this,qa))?void 0:n._nodesById)?void 0:r[e];return i&&t.push(i),t}),[])}toJSON(){return B(this,Gf)}};Gf=new WeakMap,qa=new WeakMap,l(X_,"MappedinDirections");var Qs=X_;y();var Y_=class{constructor(t){D(this,"destinations",[]),this.destinations=t}};l(Y_,"MappedinDestinationSet");var uo=Y_;y();var Xf,Uf=class t{constructor(t){D(this,"id",""),oe(this,Xf,void 0),D(this,"accessible"),D(this,"name"),D(this,"type"),D(this,"weight"),D(this,"multiplier"),D(this,"nodes"),le(this,Xf,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){Gr(n,t)}));let r={fields:n,venue:e.options.venue};try{return(await Ur(e.options,"vortex",r)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Vortexes:",t),[]}}toJSON(){return B(this,Xf)}};Xf=new WeakMap,l(Uf,"MappedinVortex");var Vf=Uf;y();var Wf,Hf,$f,fl,Yf=class t{constructor(t,e){oe(this,Wf,void 0),oe(this,Hf,void 0),oe(this,$f,void 0),oe(this,fl,{}),D(this,"defaultMap",""),D(this,"address",""),D(this,"city",""),D(this,"countrycode",""),D(this,"externalId",""),D(this,"id",""),D(this,"latitude"),D(this,"logo"),D(this,"longitude"),D(this,"name",""),D(this,"operationHours"),D(this,"postal",""),D(this,"slug",""),D(this,"state",""),D(this,"telephone",""),D(this,"tzid",""),D(this,"tzidOverride",""),D(this,"utcOffset",""),D(this,"website",""),D(this,"secureContentStorage",!1),D(this,"defaultLanguage"),D(this,"languages",[]),D(this,"topLocations",[]),le(this,Hf,t),le(this,Wf,e),Object.assign(this,e)}get metadata(){return Nr.addPendingEvent(new pf({venue:this.slug})),B(this,$f)}set metadata(t){le(this,$f,t)}static hydrate(e,n){return new t(n,e)}static async fetch(e){let n={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let r=await Ur(e.options,"venue",n);return new t(e,Array.isArray(r)?r[0]:r)}catch(t){return Ie.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==B(this,fl).isMultiBuilding){let t=B(this,Hf).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;B(this,fl).isMultiBuilding=n}return B(this,fl).isMultiBuilding}toJSON(){return B(this,Wf)}};Wf=new WeakMap,Hf=new WeakMap,$f=new WeakMap,fl=new WeakMap,l(Yf,"MappedinVenue");var du=Yf;y();var Jf,Kf=class t{constructor(t){D(this,"id",""),oe(this,Jf,void 0),le(this,Jf,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Ur(e.options,"apollo-theme",n)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Theme:",t),[]}}toJSON(){return B(this,Jf)}};Jf=new WeakMap,l(Kf,"MappedinTheme");var bg=Kf;y();var ep,Zf=class t{constructor(t){oe(this,ep,void 0),D(this,"polygons",[]),le(this,ep,t),Object.assign(this,t)}static hydrate(e){return new t(e)}static async fetch(e){try{let n=await pl({...e.options,secure:!1},"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new t(n)}catch(t){return Ie.error("Fetch Rankings:",t),null}}toJSON(){return B(this,ep)}};ep=new WeakMap,l(Zf,"MappedinRankings");var Qf=Zf;y(),y();var np,hl,ip,tp=class t{constructor(t,e){oe(this,np,void 0),oe(this,hl,void 0),oe(this,ip,{}),D(this,"id",""),D(this,"type",""),D(this,"name",""),D(this,"description"),D(this,"image"),D(this,"startDate"),D(this,"endDate"),D(this,"showDate"),le(this,hl,e),le(this,np,t),Object.assign(this,e)}location(){let t=B(this,ip).location;if(typeof t<"u")return t;let e,n=B(this,np)._locationsById,r=B(this,hl).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return B(this,ip).location=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n=e.options.things.events.slice();e.options.things.locations&&Gr(n,"location");let r={fields:n,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Ur(e.options,"event",r)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Events:",t),[]}}toJSON(){return B(this,hl)}};np=new WeakMap,hl=new WeakMap,ip=new WeakMap,l(tp,"MappedinEvent");var rp=tp;y();var sp,op=class t{constructor(t){oe(this,sp,void 0),D(this,"id",""),D(this,"name",""),D(this,"value",""),le(this,sp,t),Object.assign(this,t)}static hydrate(e){return e.map((e=>new t(e)))}static async fetch(e){let n={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Ur(e.options,"location-state",n)).map((e=>new t(e)))}catch(t){return Ie.error("Fetch Location States:",t),[]}}toJSON(){return B(this,sp)}};sp=new WeakMap,l(op,"MappedinLocationState");var ap=op;y(),y(),y();var KP=" ",yi=class t{static get separator(){return KP}static set separator(t){KP=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(e,n="d",r){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===r)switch(n){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:n="d",r=4}e=Math.abs(e);let i=null,o=null,s=null,a=null;switch(n){default:case"d":case"deg":o=e.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),i=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),s=(60*e%60).toFixed(r),60==s&&(s=(0).toFixed(r),o++),o=("000"+o).slice(-3),s<10&&(s="0"+s),i=o+"°"+t.separator+s+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),s=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(r),60==a&&(a=(0).toFixed(r),s++),60==s&&(s=0,o++),o=("000"+o).slice(-3),s=("00"+s).slice(-2),a<10&&(a="0"+a),i=o+"°"+t.separator+s+"′"+t.separator+a+"″"}return i}static toLat(e,n,r){let i=t.toDms(t.wrap90(e),n,r);return null===i?"–":i.slice(1)+t.separator+(e<0?"S":"N")}static toLon(e,n,r){let i=t.toDms(t.wrap180(e),n,r);return null===i?"–":i+t.separator+(e<0?"W":"E")}static toBrng(e,n,r){let i=t.toDms(t.wrap360(e),n,r);return null===i?"–":i.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,n=3){if(![1,2,3].includes(Number(n)))throw new RangeError("invalid precision ‘".concat(n,"’"));e=t.wrap360(e);let r=4*2**(n-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};l(yi,"Dms");var W_=yi;Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var Pt=W_,Tr=Math.PI,Ue=class t{constructor(t,e){if(isNaN(t))throw new TypeError("invalid lat ‘".concat(t,"’"));if(isNaN(e))throw new TypeError("invalid lon ‘".concat(e,"’"));this._lat=Pt.wrap90(Number(t)),this._lon=Pt.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?Pt.wrap90(Pt.parse(t)):Pt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError("invalid lat ‘".concat(t,"’"))}set latitude(t){if(this._lat=isNaN(t)?Pt.wrap90(Pt.parse(t)):Pt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError("invalid latitude ‘".concat(t,"’"))}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid lon ‘".concat(t,"’"))}set lng(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid lng ‘".concat(t,"’"))}set longitude(t){if(this._lon=isNaN(t)?Pt.wrap180(Pt.parse(t)):Pt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError("invalid longitude ‘".concat(t,"’"))}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let n,r;if(2==e.length&&([n,r]=e,n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r)),isNaN(n)||isNaN(r)))throw new TypeError("invalid point ‘".concat(e.toString(),"’"));if(1==e.length&&"string"==typeof e[0]&&([n,r]=e[0].split(","),n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r)),isNaN(n)||isNaN(r)))throw new TypeError("invalid point ‘".concat(e[0],"’"));if(1==e.length&&"object"==typeof e[0]){let t=e[0];if("Point"==t.type&&Array.isArray(t.coordinates)?[r,n]=t.coordinates:(null!=t.latitude&&(n=t.latitude),null!=t.lat&&(n=t.lat),null!=t.longitude&&(r=t.longitude),null!=t.lng&&(r=t.lng),null!=t.lon&&(r=t.lon),n=Pt.wrap90(Pt.parse(n)),r=Pt.wrap180(Pt.parse(r))),isNaN(n)||isNaN(r))throw new TypeError("invalid point ‘".concat(JSON.stringify(e[0]),"’"))}if(isNaN(n)||isNaN(r))throw new TypeError("invalid point ‘".concat(e.toString(),"’"));return new t(n,r)}distanceTo(e,n=6371e3){if(e instanceof t||(e=t.parse(e)),isNaN(n))throw new TypeError("invalid radius ‘".concat(n,"’"));let r=n,i=this.lat.toRadians(),o=this.lon.toRadians(),s=e.lat.toRadians(),a=s-i,l=e.lon.toRadians()-o,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2);return r*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}initialBearingTo(e){if(e instanceof t||(e=t.parse(e)),this.equals(e))return NaN;let n=this.lat.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),o=Math.cos(n)*Math.sin(r)-Math.sin(n)*Math.cos(r)*Math.cos(i),s=Math.sin(i)*Math.cos(r),a=Math.atan2(s,o).toDegrees();return Pt.wrap360(a)}finalBearingTo(e){e instanceof t||(e=t.parse(e));let n=e.initialBearingTo(this)+180;return Pt.wrap360(n)}midpointTo(e){e instanceof t||(e=t.parse(e));let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),o=(e.lon-this.lon).toRadians(),s=Math.cos(n),a=0,l=Math.sin(n),u={x:s+Math.cos(i)*Math.cos(o),y:a+Math.cos(i)*Math.sin(o),z:l+Math.sin(i)},c=Math.atan2(u.z,Math.sqrt(u.x*u.x+u.y*u.y)),h=r+Math.atan2(u.y,u.x),p=c.toDegrees(),f=h.toDegrees();return new t(p,f)}intermediatePointTo(e,n){if(e instanceof t||(e=t.parse(e)),this.equals(e))return new t(this.lat,this.lon);let r=this.lat.toRadians(),i=this.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians(),a=o-r,l=s-i,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(o)*Math.sin(l/2)*Math.sin(l/2),c=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),h=Math.sin((1-n)*c)/Math.sin(c),p=Math.sin(n*c)/Math.sin(c),f=h*Math.cos(r)*Math.cos(i)+p*Math.cos(o)*Math.cos(s),d=h*Math.cos(r)*Math.sin(i)+p*Math.cos(o)*Math.sin(s),g=h*Math.sin(r)+p*Math.sin(o),y=Math.atan2(g,Math.sqrt(f*f+d*d)),v=Math.atan2(d,f),m=y.toDegrees(),_=v.toDegrees();return new t(m,_)}destinationPoint(e,n,r=6371e3){let i=e/r,o=Number(n).toRadians(),s=this.lat.toRadians(),a=this.lon.toRadians(),l=Math.sin(s)*Math.cos(i)+Math.cos(s)*Math.sin(i)*Math.cos(o),u=Math.asin(l),c=Math.sin(o)*Math.sin(i)*Math.cos(s),h=Math.cos(i)-Math.sin(s)*l,p=a+Math.atan2(c,h),f=u.toDegrees(),d=p.toDegrees();return new t(f,d)}static intersection(e,n,r,i){if(e instanceof t||(e=t.parse(e)),r instanceof t||(r=t.parse(r)),isNaN(n))throw new TypeError("invalid brng1 ‘".concat(n,"’"));if(isNaN(i))throw new TypeError("invalid brng2 ‘".concat(i,"’"));let o=e.lat.toRadians(),s=e.lon.toRadians(),a=r.lat.toRadians(),l=r.lon.toRadians(),u=Number(n).toRadians(),c=Number(i).toRadians(),h=a-o,p=l-s,f=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(a)*Math.sin(p/2)*Math.sin(p/2)));if(Math.abs(f)<Number.EPSILON)return new t(e.lat,e.lon);let d=(Math.sin(a)-Math.sin(o)*Math.cos(f))/(Math.sin(f)*Math.cos(o)),g=(Math.sin(o)-Math.sin(a)*Math.cos(f))/(Math.sin(f)*Math.cos(a)),y=Math.acos(Math.min(Math.max(d,-1),1)),v=Math.acos(Math.min(Math.max(g,-1),1)),m=u-(Math.sin(l-s)>0?y:2*Tr-y),_=(Math.sin(l-s)>0?2*Tr-v:v)-c;if(0==Math.sin(m)&&0==Math.sin(_)||Math.sin(m)*Math.sin(_)<0)return null;let b=-Math.cos(m)*Math.cos(_)+Math.sin(m)*Math.sin(_)*Math.cos(f),w=Math.atan2(Math.sin(f)*Math.sin(m)*Math.sin(_),Math.cos(_)+Math.cos(m)*b),x=Math.asin(Math.min(Math.max(Math.sin(o)*Math.cos(w)+Math.cos(o)*Math.sin(w)*Math.cos(u),-1),1)),E=s+Math.atan2(Math.sin(u)*Math.sin(w)*Math.cos(o),Math.cos(w)-Math.sin(o)*Math.sin(x)),I=x.toDegrees(),S=E.toDegrees();return new t(I,S)}crossTrackDistanceTo(e,n,r=6371e3){e instanceof t||(e=t.parse(e)),n instanceof t||(n=t.parse(n));let i=r;if(this.equals(e))return 0;let o=e.distanceTo(this,i)/i,s=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(n).toRadians();return Math.asin(Math.sin(o)*Math.sin(s-a))*i}alongTrackDistanceTo(e,n,r=6371e3){e instanceof t||(e=t.parse(e)),n instanceof t||(n=t.parse(n));let i=r;if(this.equals(e))return 0;let o=e.distanceTo(this,i)/i,s=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(n).toRadians(),l=Math.asin(Math.sin(o)*Math.sin(s-a));return Math.acos(Math.cos(o)/Math.abs(Math.cos(l)))*Math.sign(Math.cos(a-s))*i}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let r=Number(n).toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),s=e.lat.toRadians(),a=e.lon.toRadians()-o,l=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.sin(a),u=Math.sin(i)*Math.cos(s)*Math.cos(r)*Math.cos(a)-Math.cos(i)*Math.sin(s)*Math.cos(r),c=Math.cos(i)*Math.cos(s)*Math.sin(r)*Math.sin(a);if(c*c>l*l+u*u)return null;let h=Math.atan2(-u,l),p=Math.acos(c/Math.sqrt(l*l+u*u)),f=o+h+p,d=(o+h-p).toDegrees(),g=f.toDegrees();return{lon1:Pt.wrap180(d),lon2:Pt.wrap180(g)}}rhumbDistanceTo(e,n=6371e3){e instanceof t||(e=t.parse(e));let r=n,i=this.lat.toRadians(),o=e.lat.toRadians(),s=o-i,a=Math.abs(e.lon-this.lon).toRadians();Math.abs(a)>Tr&&(a=a>0?-(2*Tr-a):2*Tr+a);let l=Math.log(Math.tan(o/2+Tr/4)/Math.tan(i/2+Tr/4)),u=Math.abs(l)>1e-11?s/l:Math.cos(i);return Math.sqrt(s*s+u*u*a*a)*r}rhumbBearingTo(e){if(e instanceof t||(e=t.parse(e)),this.equals(e))return NaN;let n=this.lat.toRadians(),r=e.lat.toRadians(),i=(e.lon-this.lon).toRadians();Math.abs(i)>Tr&&(i=i>0?-(2*Tr-i):2*Tr+i);let o=Math.log(Math.tan(r/2+Tr/4)/Math.tan(n/2+Tr/4)),s=Math.atan2(i,o).toDegrees();return Pt.wrap360(s)}rhumbDestinationPoint(e,n,r=6371e3){let i=this.lat.toRadians(),o=this.lon.toRadians(),s=Number(n).toRadians(),a=e/r,l=a*Math.cos(s),u=i+l;Math.abs(u)>Tr/2&&(u=u>0?Tr-u:-Tr-u);let c=Math.log(Math.tan(u/2+Tr/4)/Math.tan(i/2+Tr/4)),h=Math.abs(c)>1e-11?l/c:Math.cos(i),p=o+a*Math.sin(s)/h,f=u.toDegrees(),d=p.toDegrees();return new t(f,d)}rhumbMidpointTo(e){e instanceof t||(e=t.parse(e));let n=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians();Math.abs(o-r)>Tr&&(r+=2*Tr);let s=(n+i)/2,a=Math.tan(Tr/4+n/2),l=Math.tan(Tr/4+i/2),u=Math.tan(Tr/4+s/2),c=((o-r)*Math.log(u)+r*Math.log(l)-o*Math.log(a))/Math.log(l/a);isFinite(c)||(c=(r+o)/2);let h=s.toDegrees(),p=c.toDegrees();return new t(h,p)}static areaOf(t,e=6371e3){let n=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);let i=t.length-1,o=0;for(let e=0;e<i;e++){let n=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),i=(t[e+1].lon-t[e].lon).toRadians();o+=2*Math.atan2(Math.tan(i/2)*(Math.tan(n/2)+Math.tan(r/2)),1+Math.tan(n/2)*Math.tan(r/2))}a(t)&&(o=Math.abs(o)-2*Tr);let s=Math.abs(o*n*n);return r||t.pop(),s;function a(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){let i=t[r].initialBearingTo(t[r+1]),o=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(o-i+540)%360-180,n=o}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90}}equals(e){return e instanceof t||(e=t.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError("invalid format ‘".concat(t,"’"));if("n"==t)return null==e&&(e=4),"".concat(this.lat.toFixed(e),",").concat(this.lon.toFixed(e));let n=Pt.toLat(this.lat,t,e),r=Pt.toLon(this.lon,t,e);return"".concat(n,", ").concat(r)}};l(Ue,"LatLonSpherical");var ia,Ps,cp,Zr=Ue,up=class t{constructor(t,e){oe(this,ia,void 0),oe(this,Ps,{}),oe(this,cp,void 0),D(this,"id",""),D(this,"group",""),D(this,"name",""),D(this,"shortName",""),D(this,"elevation",0),D(this,"subtitle"),D(this,"scale",0),D(this,"layers"),D(this,"x_scale"),D(this,"perspectiveId"),D(this,"scene"),D(this,"width",0),D(this,"height",0),D(this,"georeference",[]),D(this,"_scale",0),le(this,ia,t),le(this,cp,e),Object.assign(this,e),this._scale=JP(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=ri.instances.get(B(this,ia)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=B(this,Ps).mapGroup;if(typeof t<"u")return t;let e=this.group,n=e&&B(this,ia)._mapGroupsById[e]||null;return B(this,Ps).mapGroup=n,n}createCoordinateByXY(t,e){return new gu({x:t,y:e,map:this,mappedin:B(this,ia)})}createCoordinate(t,e){return new gu({lat:t,lon:e,map:this,mappedin:B(this,ia)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new Zr(e.target.x,e.target.y),i=new Zr(n.target.x,n.target.y);t=-((r.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,Ie.warn(e),Ie.warn("Couldn't georeference ".concat(this.name||this.shortName||this.id,". Probably not enough geocoordinates."))}return t}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){var n;let r=e.options.things.maps.slice();e.options.perspective&&Gr(r,"perspectives"),e.options.things.mapGroups&&Gr(r,"group"),Gr(r,"elevation"),Gr(r,"x_scale"),Gr(r,"scale"),Gr(r,"georeference");let i={fields:r,perspective:e.options.perspective,venue:e.options.venue};try{let s=await Ur(e.options,"map",i),a=l((t=>{let e=o.layers.find((e=>e.id===t));e?e.visible=!0:o.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let i=0,l=s.length;i<l;++i){var o=s[i];if(o){let t=o.perspective;null!=t&&(o.perspectiveId=t.id,r.indexOf("scene")>-1&&(o.scene=t.scene),t.layers?(o.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):o.layers.forEach((t=>{t.visible=!0}))),delete o.perspective}if(e.options.preloadMapGeometry&&null!=(n=o.scene)&&n.polygons&&"string"==typeof o.scene.polygons){let t=await Oi()(o.scene.polygons);o.scene.polygons=await t.json()}s[i]=new t(e,o)}return s}catch(t){return Ie.error("Fetch Maps:",t),[]}}get center(){if(B(this,Ps).center)return B(this,Ps).center;let[t,e]=[this.georeference[0].control.x,this.georeference[0].control.y],[n,r]=[this.georeference[2].control.x,this.georeference[2].control.y],{lat:i,lon:o}=this.createCoordinateByXY(t,e),{lat:s,lon:a}=this.createCoordinateByXY(n,r),l=new Zr(i,o),u=new Zr(s,a),c=l.midPointTo(u);return B(this,Ps).center=c,c}toJSON(){return B(this,cp)}};ia=new WeakMap,Ps=new WeakMap,cp=new WeakMap,l(up,"MappedinMap");var lp=up;y();var fp,H_,pp,$_,hp,dp,xg,ZP,wg,QP,oa,aa,sa,ua,K_=class{constructor(t){oe(this,fp),oe(this,pp),oe(this,xg),oe(this,wg),D(this,"map"),oe(this,hp,{}),oe(this,dp,void 0),oe(this,oa,void 0),oe(this,aa,void 0),oe(this,sa,void 0),oe(this,ua,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(le(this,oa,t.lat),le(this,aa,t.lon)),null!=t.x&&null!=t.y&&(le(this,sa,t.x),le(this,ua,t.y)),this.map=e,le(this,dp,n)}get x(){return wr(this,pp,$_).call(this,"x")}get y(){return wr(this,pp,$_).call(this,"y")}get lat(){return wr(this,fp,H_).call(this,"lat")}get lon(){return wr(this,fp,H_).call(this,"lon")}absoluteDistanceTo(t){return eS([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=B(this,hp).nearestNode;if(typeof t<"u")return t;let e=ri.instances.get(B(this,dp)).findNearestNodeOnMap(this.map.id,this);return B(this,hp).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};fp=new WeakSet,H_=l((function(t){if(typeof B(this,oa)<"u"&&typeof B(this,aa)<"u")return B(this,"lat"===t?oa:aa);if(typeof B(this,sa)<"u"&&typeof B(this,ua)<"u"){let[e,n]=wr(this,wg,QP).call(this,B(this,sa),B(this,ua));return le(this,oa,e),le(this,aa,n),B(this,"lat"===t?oa:aa)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),pp=new WeakSet,$_=l((function(t){if(B(this,sa)&&B(this,ua))return B(this,"x"===t?sa:ua);if(null!=B(this,oa)&&null!=B(this,aa)){let[e,n]=wr(this,xg,ZP).call(this,B(this,oa),B(this,aa));return le(this,sa,e),le(this,ua,n),B(this,"x"===t?sa:ua)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),hp=new WeakMap,dp=new WeakMap,xg=new WeakSet,ZP=l((function(t,e){let n=this.map.georeference[0],r=new Zr(n.target.x,n.target.y),i=new Zr(t,e),o=r.distanceTo(i),s=(r.finalBearingTo(i)+360)%360*Math.PI/180||0,a=o*(1/this.map.scale),l=s+this.map.getNorth(),u=Math.sin(l)*a,c=Math.cos(l)*a;return[n.control.x+u,n.control.y-c]}),"#latLonToXY"),wg=new WeakSet,QP=l((function(t,e){let n,r=this.map.georeference[0],i=new Zr(r.target.x,r.target.y),o=t-r.control.x,s=r.control.y-e,a=Math.atan2(o,s);n=0===o&&0===s?0:0===o?s:o/Math.sin(a);let l=a-this.map.getNorth(),u=n/this.map._scale,c=i.destinationPoint(u,180*l/Math.PI);return[c.lat,c.lon]}),"#xyToLatLon"),oa=new WeakMap,aa=new WeakMap,sa=new WeakMap,ua=new WeakMap,l(K_,"MappedinCoordinate");var gu=K_;y();var yp,dl,vp,gp=class t{constructor(t,e){oe(this,yp,void 0),oe(this,dl,void 0),oe(this,vp,{}),D(this,"id",""),D(this,"name",""),le(this,dl,e),le(this,yp,t),Object.assign(this,e)}get maps(){let t=B(this,vp).maps;if(typeof t<"u")return t;let e=[],{maps:n}=B(this,yp),{id:r}=B(this,dl);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return B(this,vp).maps=e,e}static hydrate(e,n){return e.map((e=>new t(n,e)))}static async fetch(e){let n={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Ur(e.options,"map-group",n)).map((n=>new t(e,n)))}catch(t){return Ie.error("Fetch Map Groups:",t),[]}}toJSON(){return B(this,dl)}};yp=new WeakMap,dl=new WeakMap,vp=new WeakMap,l(gp,"MappedinMapGroup");var mp=gp;y(),y(),y();var mu,Bo,jo,J_=[0,4,6,8,10],Ga=l((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&!(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],J_.map(((t,e)=>n.slice(t,e===J_.length-1?void 0:J_[e+1]).join(""))).join("-")}),"randomId"),tS="mi-session-data",rS="mi-local-data",_p=class t{constructor(){oe(this,Bo,void 0),oe(this,jo,void 0);try{let t=sessionStorage.getItem(tS);le(this,Bo,t?JSON.parse(t):{id:Ga()})}catch{le(this,Bo,{id:Ga()})}try{let t=localStorage.getItem(rS);le(this,jo,t?JSON.parse(t):{deviceId:Ga()})}catch{le(this,jo,{deviceId:Ga()})}B(this,Bo).id||(B(this,Bo).id=Ga()),B(this,jo).deviceId||(B(this,jo).deviceId=Ga())}static getInstance(){return B(this,mu)||le(this,mu,new t),B(this,mu)}static ___clearInstance(){le(this,mu,void 0)}saveSessionData(t,e){B(this,Bo)[t]=e;try{return sessionStorage.setItem(tS,JSON.stringify(B(this,Bo))),!0}catch{return!1}}loadSessionData(t){let e=B(this,Bo)[t];if(null!=e)return e}saveLocalData(t,e){B(this,jo)[t]=e;try{return localStorage.setItem(rS,JSON.stringify(B(this,jo))),!0}catch{return!1}}loadLocalData(t){let e=B(this,jo)[t];if(null!=e)return e}};mu=new WeakMap,Bo=new WeakMap,jo=new WeakMap,l(_p,"SafeStorage"),oe(_p,mu,void 0);var bp=_p;function Eg(t){return/^[\da-f]{24}$/i.test(t)}function nS(t,e=!1){let n="";if(null!=t){let r="?",i=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,o=i.length;e<o;++e){let o=i[e],s=t[o];null!=s&&(n+="".concat(r+encodeURIComponent(o),"=").concat(encodeURIComponent(s)),r="&")}}return n}function aj(t,e,n,r=!1){var i,o;return r?"".concat(t.supplementaryUrl).concat(e,"?venue=").concat(n.venue||n.slug):null!=(i=t.baseUrl)&&i.includes("gateway")?"".concat(t.baseUrl).concat(e,"/").concat(n.venue||n.slug).concat(nS(n,null==(o=t.baseUrl)?void 0:o.includes("gateway"))):t.baseUrl+e+nS(n)}async function Ur(t,e,n,r=!1){return pl(t,e,n,r,!0)}async function pl(t,e,n,r=!1,i=!1){let o=aj(t,e,n,r),s=await Mg(t,o,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}function sj(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+="&lang=".concat(encodeURIComponent(r.language)));let{headers:i}=t;i["Content-Type"]=i["Content-Type"]||"text/json",t.accessToken?i.Authorization="Bearer ".concat(t.accessToken):t.noAuth||t.clientId&&t.clientSecret&&(i["x-mappedin-key"]=btoa(t.clientId),i["x-mappedin-secret"]=btoa(t.clientSecret)),r.language&&(i["Accept-Language"]=r.language);let o={method:"GET",headers:i};return t.secure&&(e+="&withcdntoken"),{req:o,url:e}}async function Mg(t,e,n=!1){let r=sj(t,e,n),i=await Oi()(r.url,r.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}function Gr(t,e){t.indexOf(e)<0&&t.push(e)}function eS([t,e],[n,r]){let i=new Zr(t,e),o=new Zr(n,r);return i.distanceTo(o)}function JP(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],r=t.georeference[2],i=new Zr(n.target.x,n.target.y),o=new Zr(r.target.x,r.target.y),s=i.distanceTo(o),a=n.control.x-r.control.x,l=n.control.y-r.control.y;e=Math.sqrt(a*a+l*l)/s}catch(n){e=1,Ie.warn(n),Ie.warn("Couldn't georeference ".concat(t.name||t.shortName||t.id,". Probably not enough geocoordinates."))}return e}function Xc(t){var e;return t instanceof fu?t.entrances.map((t=>t.id)):t instanceof za?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function iS(t){let e={},{maps:n,images:r,scenes:i,polygons:o}=t;if(null!=r)try{let t=Object.keys(r).map((t=>fetch("data:image/png;base64,".concat(r[t])).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{Ie.error(t)}))));await Promise.all(t)}catch(t){Ie.error(t)}return n.forEach((t=>{var n;(null!=(n=t.scene)&&n.polygons||i[t.id])&&(null!=i&&i[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>i[t.id]})),null!=r&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,r;if(null!=(n=null==t?void 0:t.image)&&n.url&&null!=(r=null==t?void 0:t.image)&&r.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}}))))})),null!=r&&o.forEach((t=>{var n;if(null!=(n=null==t?void 0:t.image)&&n.url){let n=t.image.url.split("/"),r=e[n[n.length-1]];r&&(t.image.url=r)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function gl(t,e,n){let r;return function(...i){let o=this,s=l((function(){r=null,n||t.apply(o,i)}),"later"),a=n&&!r;clearTimeout(r),r=setTimeout(s,e),a&&t.apply(o,i)}}function oS(t,e,n,r=0){if(!t||t<=0)return 0;let i=0;r>=0&&r<=1&&(i=r/10);let o=1e-5,s=1+(n-t)/(n-e)+i;return Math.max(1+o,Math.min(2-o,s))}function vg(){return bp.getInstance().loadLocalData("deviceId")}function _g(){return bp.getInstance().loadSessionData("id")}l(Eg,"isGatewayKey"),l(nS,"stringifyQuery"),l(aj,"buildUrl"),l(Ur,"getArray"),l(pl,"getObject"),l(sj,"constructParamsForRequest"),l(Mg,"generateAPIRequest"),l(Gr,"addToSet"),l(eS,"getDistanceBetweenLatLon"),l(JP,"getMapScale"),l(Xc,"getNodesForNavigatable"),l(iS,"populateBundledImagesAsBlobs"),l(gl,"debounce"),l(oS,"normalizeCategoryRank"),l(vg,"getDeviceID"),l(_g,"getSessionID");var aS=l(((t,e)=>{if("string"==typeof t){if(void 0===e||!Array.isArray(e.polygons))return null;t=e.polygons.find((function(e){return e.id===t}))}let n=null;if(null!=t&&void 0!==t.locations&&t.locations.length>0){n=t.locations[0];for(let e=0,r=t.locations.length;e<r;e++){let r=t.locations[e];for(;void 0!==r.parent;)r=r.parent,r.polygons.includes(t)&&(n=r);if(void 0===r.parent&&r.polygons.includes(t))return r}}return n}),"getPrimaryLocationForPolygon");function Z_(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return sS(this.cover(e,n),e,n,t)}function sS(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,s,a,l,u,c,h,p,f=t._root,d={data:r},g=t._x0,y=t._y0,v=t._x1,m=t._y1;if(!f)return t._root=d,t;for(;f.length;)if((u=e>=(o=(g+v)/2))?g=o:v=o,(c=n>=(s=(y+m)/2))?y=s:m=s,i=f,!(f=f[h=c<<1|u]))return i[h]=d,t;if(a=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===a&&n===l)return d.next=f,i?i[h]=d:t._root=d,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(o=(g+v)/2))?g=o:v=o,(c=n>=(s=(y+m)/2))?y=s:m=s}while((h=c<<1|u)==(p=(l>=s)<<1|a>=o));return i[p]=f,i[h]=d,t}function uS(t){var e,n,r,i,o=t.length,s=new Array(o),a=new Array(o),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(s[n]=r,a[n]=i,r<l&&(l=r),r>c&&(c=r),i<u&&(u=i),i>h&&(h=i));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<o;++n)sS(this,s[n],a[n],t[n]);return this}function Q_(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var s,a,l=i-n||1,u=this._root;n>t||t>=i||r>e||e>=o;)switch(a=(e<r)<<1|t<n,s=new Array(4),s[a]=u,u=s,l*=2,a){case 0:i=n+l,o=r+l;break;case 1:n=i-l,o=r+l;break;case 2:i=n+l,r=o-l;break;case 3:n=i-l,r=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function eb(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function tb(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function vn(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function rb(t,e,n){var r,i,o,s,a,l,u,c=this._x0,h=this._y0,p=this._x1,f=this._y1,d=[],g=this._root;for(g&&d.push(new vn(g,c,h,p,f)),null==n?n=1/0:(c=t-n,h=e-n,p=t+n,f=e+n,n*=n);l=d.pop();)if(!(!(g=l.node)||(i=l.x0)>p||(o=l.y0)>f||(s=l.x1)<c||(a=l.y1)<h))if(g.length){var y=(i+s)/2,v=(o+a)/2;d.push(new vn(g[3],y,v,s,a),new vn(g[2],i,v,y,a),new vn(g[1],y,o,s,v),new vn(g[0],i,o,y,v)),(u=(e>=v)<<1|t>=y)&&(l=d[d.length-1],d[d.length-1]=d[d.length-1-u],d[d.length-1-u]=l)}else{var m=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=m*m+_*_;if(b<n){var w=Math.sqrt(n=b);c=t-w,h=e-w,p=t+w,f=e+w,r=g.data}}return r}function nb(t){if(isNaN(o=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,r,i,o,s,a,l,u,c,h,p,f=this._root,d=this._x0,g=this._y0,y=this._x1,v=this._y1;if(!f)return this;if(f.length)for(;;){if((u=o>=(a=(d+y)/2))?d=a:y=a,(c=s>=(l=(g+v)/2))?g=l:v=l,e=f,!(f=f[h=c<<1|u]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,p=h)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[p]=f:this._root=f),this):(this._root=i,this)}function lS(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ib(){return this._root}function ob(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function ab(t){var e,n,r,i,o,s,a=[],l=this._root;for(l&&a.push(new vn(l,this._x0,this._y0,this._x1,this._y1));e=a.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,o=e.x1,s=e.y1)&&l.length){var u=(r+o)/2,c=(i+s)/2;(n=l[3])&&a.push(new vn(n,u,c,o,s)),(n=l[2])&&a.push(new vn(n,r,c,u,s)),(n=l[1])&&a.push(new vn(n,u,i,o,c)),(n=l[0])&&a.push(new vn(n,r,i,u,c))}return this}function sb(t){var e,n=[],r=[];for(this._root&&n.push(new vn(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,s=e.x0,a=e.y0,l=e.x1,u=e.y1,c=(s+l)/2,h=(a+u)/2;(o=i[0])&&n.push(new vn(o,s,a,c,h)),(o=i[1])&&n.push(new vn(o,c,a,l,h)),(o=i[2])&&n.push(new vn(o,s,h,c,u)),(o=i[3])&&n.push(new vn(o,c,h,l,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function cS(t){return t[0]}function ub(t){return arguments.length?(this._x=t,this):this._x}function fS(t){return t[1]}function lb(t){return arguments.length?(this._y=t,this):this._y}function xp(t,e,n){var r=new cb(null==e?cS:e,null==n?fS:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function cb(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function pS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}y(),y(),y(),y(),l(Z_,"default"),l(sS,"add"),l(uS,"addAll"),y(),l(Q_,"default"),y(),l(eb,"default"),y(),l(tb,"default"),y(),y(),l(vn,"default"),l(rb,"default"),y(),l(nb,"default"),l(lS,"removeAll"),y(),l(ib,"default"),y(),l(ob,"default"),y(),l(ab,"default"),y(),l(sb,"default"),y(),l(cS,"defaultX"),l(ub,"default"),y(),l(fS,"defaultY"),l(lb,"default"),l(xp,"quadtree"),l(cb,"Quadtree"),l(pS,"leaf_copy");var vi=xp.prototype=cb.prototype;vi.copy=function(){var t,e,n=new cb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=pS(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=pS(e));return n},vi.add=Z_,vi.addAll=uS,vi.cover=Q_,vi.data=eb,vi.extent=tb,vi.find=rb,vi.remove=nb,vi.removeAll=lS,vi.root=ib,vi.size=ob,vi.visit=ab,vi.visitAfter=sb,vi.x=ub,vi.y=lb;var la,un,zo=class t{constructor(t){oe(this,la,void 0),D(this,"categories"),D(this,"locations"),D(this,"vortexes"),D(this,"maps"),D(this,"nodes"),D(this,"polygons"),D(this,"events"),D(this,"mapGroups"),D(this,"locationStates"),D(this,"rankings"),D(this,"languages",{}),oe(this,un,{}),le(this,la,t)}get polygonsByMapId(){if(B(this,un).polygonsByMapId)return B(this,un).polygonsByMapId;let t,e={};for(let n=0,r=B(this,la).polygons.length;n<r;++n)t=B(this,la).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).polygonsByMapId=n,B(this,un).polygonsByMapId}get nodesByMapId(){if(B(this,un).nodesByMapId)return B(this,un).nodesByMapId;let t,e={};for(let n=0,r=B(this,la).nodes.length;n<r;++n)t=B(this,la).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).nodesByMapId=n,B(this,un).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(B(this,un).nodeTreesByMap||(B(this,un).nodeTreesByMap=new Map),!B(this,un).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=xp();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),B(this,un).nodeTreesByMap.set(t,r)}return B(this,un).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(B(this,un).locationsByMapId)return B(this,un).locationsByMapId;let t,e={};for(let n=0,r=B(this,la).locations.length;n<r;++n){t=B(this,la).locations[n];for(let n=0,r=t.polygons.length;n<r;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),-1===e[t.polygons[n].map.id].indexOf(t)&&e[t.polygons[n].map.id].push(t);for(let n=0,r=t.nodes.length;n<r;++n){let r=t.nodes[n];e[r.map.id]||(e[r.map.id]=[]),-1===e[r.map.id].indexOf(t)&&e[r.map.id].push(t)}}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return B(this,un).locationsByMapId=n,B(this,un).locationsByMapId}static create(e){return t.instances.has(e)||t.instances.set(e,new t(e)),t.instances.get(e)}static clear(){t.instances.clear()}static clearInstance(e){t.instances.has(e)&&t.instances.delete(e)}};la=new WeakMap,un=new WeakMap,l(zo,"MappedinCache"),D(zo,"instances",new Map);var fb=zo,ri=fb,Lf=(t=>(t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes",t))(Lf||{}),yu={categories:hu,locations:za,vortexes:Vf,maps:lp,nodes:Tf,polygons:fu,venue:du,events:rp,mapGroups:mp,themes:bg,locationStates:ap,rankings:Qf},Ig=(t=>(t[t.LANGUAGE_CHANGED=0]="LANGUAGE_CHANGED",t))(Ig||{});y(),y(),y(),y();var _n=6371008.8,hS={centimeters:100*_n,centimetres:100*_n,degrees:_n/111325,feet:3.28084*_n,inches:39.37*_n,kilometers:_n/1e3,kilometres:_n/1e3,meters:_n,metres:_n,miles:_n/1609.344,millimeters:1e3*_n,millimetres:1e3*_n,nauticalmiles:_n/1852,radians:1,yards:1.0936*_n},sQ={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/_n,yards:1.0936133};function bn(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 jt(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(!ca(t[0])||!ca(t[1]))throw new Error("coordinates must contain numbers");return bn({type:"Point",coordinates:t},e,n)}function cr(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return bn({type:"Polygon",coordinates:t},e,n)}function Ar(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return bn({type:"LineString",coordinates:t},e,n)}function Ve(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 vu(t,e,n){return void 0===n&&(n={}),bn({type:"MultiLineString",coordinates:t},e,n)}function pb(t,e,n){return void 0===n&&(n={}),bn({type:"MultiPoint",coordinates:t},e,n)}function wp(t,e){void 0===e&&(e="kilometers");var n=hS[e];if(!n)throw new Error(e+" units is invalid");return t*n}function Ep(t,e){void 0===e&&(e="kilometers");var n=hS[e];if(!n)throw new Error(e+" units is invalid");return t/n}function _u(t){return 180*(t%(2*Math.PI))/Math.PI}function Ln(t){return t%360*Math.PI/180}function ca(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ln(t,e,n){if(null!==t)for(var r,i,o,s,a,l,u,c,h=0,p=0,f=t.type,d="FeatureCollection"===f,g="Feature"===f,y=d?t.features.length:1,v=0;v<y;v++){a=(c=!!(u=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var m=0;m<a;m++){var _=0,b=0;if(null!==(s=c?u.geometries[m]:u)){l=s.coordinates;var w=s.type;switch(h=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(l,p,v,_,b))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],p,v,_,b))return!1;p++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===e(l[r][i],p,v,_,b))return!1;p++}"MultiLineString"===w&&_++,"Polygon"===w&&b++}"Polygon"===w&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===e(l[r][i][o],p,v,_,b))return!1;p++}b++}_++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===ln(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function dS(t,e,n,r){var i=n;return ln(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function rr(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 fa(t,e){var n,r,i,o,s,a,l,u,c,h,p=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,u=f?t.features[n].properties:d?t.properties:{},c=f?t.features[n].bbox:d?t.bbox:void 0,h=f?t.features[n].id:d?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=l?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,u,c,h))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],p,u,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,u,c,h))return!1;p++}}function ni(t,e){fa(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(bn(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var u=t.coordinates[l];if(!1===e(bn({type:s,coordinates:u},r),n,l))return!1}}))}function Pg(t,e){ni(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,u=0;if(!1===ln(t,(function(o,c,h,p,f){if(void 0===s||n>a||p>l||f>u)return s=o,a=n,l=p,u=f,void(i=0);var d=Ar([s,o],t.properties);if(!1===e(d,n,r,f,i))return!1;i++,s=o})))return!1}}}))}function gS(t,e,n){var r=n,i=!1;return Pg(t,(function(t,o,s,a,l){r=!1===i&&void 0===n?t:e(r,t,o,s,a,l),i=!0})),r}function hb(t){var e=[1/0,1/0,-1/0,-1/0];return ln(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}l(bn,"feature"),l(jt,"point"),l(cr,"polygon"),l(Ar,"lineString"),l(Ve,"featureCollection"),l(vu,"multiLineString"),l(pb,"multiPoint"),l(wp,"radiansToLength"),l(Ep,"lengthToRadians"),l(_u,"radiansToDegrees"),l(Ln,"degreesToRadians"),l(ca,"isNumber"),l(ln,"coordEach"),l(dS,"coordReduce"),l(rr,"featureEach"),l(fa,"geomEach"),l(ni,"flattenEach"),l(Pg,"segmentEach"),l(gS,"segmentReduce"),l(hb,"bbox"),hb.default=hb;var Rn=hb;function Rr(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 nr(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")}function db(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function Wn(t){return"Feature"===t.type?t.geometry:t}function Xi(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}y(),y(),y(),y(),l(Rr,"getCoord"),l(nr,"getCoords"),l(db,"featureOf"),l(Wn,"getGeom"),l(Xi,"getType");var gj=er(Sg(),1);y();var Ij=er(LS(),1);function Dn(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Rr(t),i=Wn(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===Pj(r,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(RS(r,a[u][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[u].length&&!c;)RS(r,a[u][h],!n.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function RS(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],l=e[o][0],u=e[o][1];if(t[1]*(s-l)+a*(l-t[0])+u*(t[0]-s)==0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(u-t[1])<=0)return!n;a>t[1]!=u>t[1]&&t[0]<(l-s)*(t[1]-a)/(u-a)+s&&(r=!r)}return r}function Pj(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function Sj(t,e,n){void 0===n&&(n={});var r=Rr(t),i=Rr(e),o=Ln(i[1]-r[1]),s=Ln(i[0]-r[0]),a=Ln(r[1]),l=Ln(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return wp(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}y(),y(),l(Dn,"booleanPointInPolygon"),l(RS,"inRing"),l(Pj,"inBBox"),y(),y(),l(Sj,"distance");var Pr=Sj;y();var gee=function(){function t(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,l=n.y-t.y,u=o*(t.x+e.x)+s*(t.y+e.y),c=a*(t.x+n.x)+l*(t.y+n.y),h=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(l*u-s*c)/h,this.y=(o*c-a*u)/h,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}return l(t,"Triangle"),t}();y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y();var FS=new ArrayBuffer(16),nre=new Float64Array(FS),ire=new Uint32Array(FS);y(),y(),y(),y(),y(),y();var Gj=er(kb(),1);y(),y(),y(),y(),y();var hie=function(){function t(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(e=0;e<this.centers.length-1;e++){var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return l(t,"Spline"),t.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},t.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return Uj((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},t}();function Uj(t,e,n,r,i){var o=Vj(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}function Vj(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function Sp(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return cr([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}function Xj(t){return Sp(Rn(t))}l(Uj,"bezier"),l(Vj,"B"),y(),y(),y(),y(),l(Sp,"bboxPolygon"),l(Xj,"envelope");var Ob=Xj;function pa(t,e,n,r){void 0===r&&(r={});var i=Rr(t),o=Ln(i[0]),s=Ln(i[1]),a=Ln(n),l=Ep(e,r.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return jt([_u(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),_u(u)],r.properties)}function Ua(t,e,n){if(void 0===n&&(n={}),!0===n.final)return Yj(t,e);var r=Rr(t),i=Rr(e),o=Ln(r[0]),s=Ln(i[0]),a=Ln(r[1]),l=Ln(i[1]),u=Math.sin(s-o)*Math.cos(l),c=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return _u(Math.atan2(u,c))}function Yj(t,e){var n=Ua(e,t);return n=(n+180)%360}function Wj(t,e){void 0===e&&(e={});var n=Rn(t);return jt([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}y(),y(),y(),l(pa,"destination"),y(),y(),l(Ua,"bearing"),l(Yj,"calculateFinalBearing"),y(),l(Wj,"center");var bu=Wj;y(),y(),y(),y(),y();var cz=er(WS(),1);function fz(t){if(!t)throw new Error("geojson is required");var e=[];return ni(t,(function(t){pz(t,e)})),Ve(e)}function pz(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=nr(r);break;case"LineString":n=[nr(r)]}n.forEach((function(n){hz(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}function hz(t,e){var n=[];return t.reduce((function(t,r){var i=Ar([t,r],e);return i.bbox=dz(t,r),n.push(i),r})),n}function dz(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?n:i,r>o?r:o]}y(),y(),y(),y(),l(fz,"lineSegment"),l(pz,"lineSegmentFeature"),l(hz,"createSegments"),l(dz,"bbox");var wu=fz,cC=er(Ug(),1);function qz(t,e){var n={},r=[];if("LineString"===t.type&&(t=bn(t)),"LineString"===e.type&&(e=bn(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var i=lC(t,e);return i&&r.push(i),Ve(r)}var o=(0,cC.default)();return o.load(wu(e)),rr(wu(t),(function(t){rr(o.search(t),(function(e){var i=lC(t,e);if(i){var o=nr(i).join(",");n[o]||(n[o]=!0,r.push(i))}}))})),Ve(r)}function lC(t,e){var n=nr(t),r=nr(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],l=r[0][0],u=r[0][1],c=r[1][0],h=r[1][1],p=(h-u)*(s-i)-(c-l)*(a-o);if(0===p)return null;var f=((c-l)*(o-u)-(h-u)*(i-l))/p,d=((s-i)*(o-u)-(a-o)*(i-l))/p;return f>=0&&f<=1&&d>=0&&d<=1?jt([i+f*(s-i),o+f*(a-o)]):null}l(qz,"lineIntersect"),l(lC,"intersects");var Eu=qz;function Gz(t,e,n){void 0===n&&(n={});var r=jt([1/0,1/0],{dist:1/0}),i=0;return ni(t,(function(t){for(var o=nr(t),s=0;s<o.length-1;s++){var a=jt(o[s]);a.properties.dist=Pr(e,a,n);var l=jt(o[s+1]);l.properties.dist=Pr(e,l,n);var u=Pr(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),h=Ua(a,l),p=pa(e,c,h+90,n),f=pa(e,c,h-90,n),d=Eu(Ar([p.geometry.coordinates,f.geometry.coordinates]),Ar([a.geometry.coordinates,l.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=Pr(e,g,n),g.properties.location=i+Pr(a,g,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),l.properties.dist<r.properties.dist&&((r=l).properties.index=s+1,r.properties.location=i+u),g&&g.properties.dist<r.properties.dist&&((r=g).properties.index=s),i+=u}})),r}l(Gz,"nearestPointOnLine");var Va=Gz;y(),y(),y();var Vz=er(Sg(),1);function Mu(t,e){return void 0===e&&(e={}),gS(t,(function(t,n){var r=n.geometry.coordinates;return t+Pr(r[0],r[1],e)}),0)}function Xz(t,e,n){var r=nr(n);if("LineString"!==Xi(n))throw new Error("line must be a LineString");for(var i,o=Va(n,t),s=Va(n,e),a=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],l=i[0].properties.index+1;l<i[1].properties.index+1;l++)a.push(r[l]);return a.push(i[1].geometry.coordinates),Ar(a,n.properties)}y(),y(),y(),y(),y(),y(),l(Mu,"length"),y(),l(Xz,"lineSlice");var Xg=Xz;function Yz(t,e,n){void 0===n&&(n={});for(var r=Rr(t),i=nr(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),Wz(i[o],i[o+1],r,s,typeof n.epsilon>"u"?null:n.epsilon))return!0}return!1}function Wz(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],l=t[1],u=e[0],c=e[1],h=u-a,p=c-l,f=(n[0]-a)*p-(n[1]-l)*h;if(null!==i){if(Math.abs(f)>i)return!1}else if(0!==f)return!1;return r?"start"===r?Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<=u:u<=o&&o<a:p>0?l<s&&s<=c:c<=s&&s<l:"end"===r?Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<u:u<o&&o<=a:p>0?l<=s&&s<c:c<s&&s<=l:"both"===r&&(Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<u:u<o&&o<a:p>0?l<s&&s<c:c<s&&s<l):Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<=u:u<=o&&o<=a:p>0?l<=s&&s<=c:c<=s&&s<=l}y(),y(),y(),y(),l(Yz,"booleanPointOnLine"),l(Wz,"isPointOnLineSegment");var wl=Yz;y(),y(),y(),y();var Kz=er(kb(),1);y();var pC=Math.PI/180,hC=180/Math.PI,Tp=l((function(t,e){this.lon=t,this.lat=e,this.x=pC*t,this.y=pC*e}),"Coord");Tp.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Tp.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new Tp(e,t)};var dC=l((function(){this.coords=[],this.length=0}),"LineString");dC.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Kb=l((function(t){this.properties=t||{},this.geometries=[]}),"Arc");Kb.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Kb.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=l((function(t){e+=t[0]+" "+t[1]+","}),"collect"),r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var gC=l((function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Tp(t.x,t.y),this.end=new Tp(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)}),"GreatCircle");gC.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=hC*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[hC*Math.atan2(i,r),s]},gC.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,l=0,u=e&&e.offset?e.offset:10,c=180-u,h=-180+u,p=360-u,f=1;f<n.length;++f){var d=n[f-1][0],g=n[f][0],y=Math.abs(g-d);y>p&&(g>c&&d<h||d>c&&g<h)?a=!0:y>l&&(l=y)}var v=[];if(a&&l<u){var m=[];v.push(m);for(var _=0;_<n.length;++_){var b=parseFloat(n[_][0]);if(_>0&&Math.abs(b-n[_-1][0])>p){var w=parseFloat(n[_-1][0]),x=parseFloat(n[_-1][1]),E=parseFloat(n[_][0]),I=parseFloat(n[_][1]);if(w>-180&&w<h&&180===E&&_+1<n.length&&n[_-1][0]>-180&&n[_-1][0]<h){m.push([-180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(w>c&&w<180&&-180===E&&_+1<n.length&&n[_-1][0]>c&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(w<h&&E>c){var S=w;w=E,E=S;var N=x;x=I,I=N}if(w>c&&E<h&&(E+=360),w<=180&&E>=180&&w<E){var M=(180-w)/(E-w),C=M*I+(1-M)*x;m.push([n[_-1][0]>c?180:-180,C]),(m=[]).push([n[_-1][0]>c?-180:180,C]),v.push(m)}else m=[],v.push(m);m.push([b,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var O=[];v.push(O);for(var P=0;P<n.length;++P)O.push([n[P][0],n[P][1]])}for(var A=new Kb(this.properties),D=0;D<v.length;++D){var T=new dC;A.geometries.push(T);for(var L=v[D],R=0;R<L.length;++R)T.move_to(L[R])}return A},y();var Qz=er(Ug(),1);y(),y(),y(),y(),y(),y();var C6=er(Ug(),1),k6=er(Ex(),1);y(),y(),y(),y(),y(),y(),y();var T6=er(Sg(),1),Je=[],Ze=[],Qe=[],et=[],tt=[],rt=[],nt=[],it=[],ot=[],at=[],st=[],ut=[],lt=[],ct=[],ft=[],pt=[],ht=[],dt=[],gt=[],mt=[],yt=[],vt=[],_t=[],bt=[];nt[85]=at[85]=-1,it[85]=st[85]=0,ot[85]=ut[85]=1,gt[85]=vt[85]=1,mt[85]=_t[85]=0,yt[85]=bt[85]=1,Je[85]=et[85]=0,Ze[85]=tt[85]=-1,Qe[85]=ft[85]=0,pt[85]=lt[85]=0,ht[85]=ct[85]=1,rt[85]=dt[85]=1,vt[1]=vt[169]=0,_t[1]=_t[169]=-1,bt[1]=bt[169]=0,lt[1]=lt[169]=-1,ct[1]=ct[169]=0,ft[1]=ft[169]=0,at[4]=at[166]=0,st[4]=st[166]=-1,ut[4]=ut[166]=1,pt[4]=pt[166]=1,ht[4]=ht[166]=0,dt[4]=dt[166]=0,nt[16]=nt[154]=0,it[16]=it[154]=1,ot[16]=ot[154]=1,et[16]=et[154]=1,tt[16]=tt[154]=0,rt[16]=rt[154]=1,gt[64]=gt[106]=0,mt[64]=mt[106]=1,yt[64]=yt[106]=0,Je[64]=Je[106]=-1,Ze[64]=Ze[106]=0,Qe[64]=Qe[106]=1,gt[2]=gt[168]=0,mt[2]=mt[168]=-1,yt[2]=yt[168]=1,vt[2]=vt[168]=0,_t[2]=_t[168]=-1,bt[2]=bt[168]=0,lt[2]=lt[168]=-1,ct[2]=ct[168]=0,ft[2]=ft[168]=0,pt[2]=pt[168]=-1,ht[2]=ht[168]=0,dt[2]=dt[168]=1,nt[8]=nt[162]=0,it[8]=it[162]=-1,ot[8]=ot[162]=0,at[8]=at[162]=0,st[8]=st[162]=-1,ut[8]=ut[162]=1,lt[8]=lt[162]=1,ct[8]=ct[162]=0,ft[8]=ft[162]=1,pt[8]=pt[162]=1,ht[8]=ht[162]=0,dt[8]=dt[162]=0,nt[32]=nt[138]=0,it[32]=it[138]=1,ot[32]=ot[138]=1,at[32]=at[138]=0,st[32]=st[138]=1,ut[32]=ut[138]=0,Je[32]=Je[138]=1,Ze[32]=Ze[138]=0,Qe[32]=Qe[138]=0,et[32]=et[138]=1,tt[32]=tt[138]=0,rt[32]=rt[138]=1,vt[128]=vt[42]=0,_t[128]=_t[42]=1,bt[128]=bt[42]=1,gt[128]=gt[42]=0,mt[128]=mt[42]=1,yt[128]=yt[42]=0,Je[128]=Je[42]=-1,Ze[128]=Ze[42]=0,Qe[128]=Qe[42]=1,et[128]=et[42]=-1,tt[128]=tt[42]=0,rt[128]=rt[42]=0,at[5]=at[165]=-1,st[5]=st[165]=0,ut[5]=ut[165]=0,vt[5]=vt[165]=1,_t[5]=_t[165]=0,bt[5]=bt[165]=0,pt[20]=pt[150]=0,ht[20]=ht[150]=1,dt[20]=dt[150]=1,et[20]=et[150]=0,tt[20]=tt[150]=-1,rt[20]=rt[150]=1,nt[80]=nt[90]=-1,it[80]=it[90]=0,ot[80]=ot[90]=1,gt[80]=gt[90]=1,mt[80]=mt[90]=0,yt[80]=yt[90]=1,lt[65]=lt[105]=0,ct[65]=ct[105]=1,ft[65]=ft[105]=0,Je[65]=Je[105]=0,Ze[65]=Ze[105]=-1,Qe[65]=Qe[105]=0,nt[160]=nt[10]=-1,it[160]=it[10]=0,ot[160]=ot[10]=1,at[160]=at[10]=-1,st[160]=st[10]=0,ut[160]=ut[10]=0,vt[160]=vt[10]=1,_t[160]=_t[10]=0,bt[160]=bt[10]=0,gt[160]=gt[10]=1,mt[160]=mt[10]=0,yt[160]=yt[10]=1,pt[130]=pt[40]=0,ht[130]=ht[40]=1,dt[130]=dt[40]=1,lt[130]=lt[40]=0,ct[130]=ct[40]=1,ft[130]=ft[40]=0,Je[130]=Je[40]=0,Ze[130]=Ze[40]=-1,Qe[130]=Qe[40]=0,et[130]=et[40]=0,tt[130]=tt[40]=-1,rt[130]=rt[40]=1,at[37]=at[133]=0,st[37]=st[133]=1,ut[37]=ut[133]=1,vt[37]=vt[133]=0,_t[37]=_t[133]=1,bt[37]=bt[133]=0,Je[37]=Je[133]=-1,Ze[37]=Ze[133]=0,Qe[37]=Qe[133]=0,et[37]=et[133]=1,tt[37]=tt[133]=0,rt[37]=rt[133]=0,pt[148]=pt[22]=-1,ht[148]=ht[22]=0,dt[148]=dt[22]=0,vt[148]=vt[22]=0,_t[148]=_t[22]=-1,bt[148]=bt[22]=1,gt[148]=gt[22]=0,mt[148]=mt[22]=1,yt[148]=yt[22]=1,et[148]=et[22]=-1,tt[148]=tt[22]=0,rt[148]=rt[22]=1,nt[82]=nt[88]=0,it[82]=it[88]=-1,ot[82]=ot[88]=1,pt[82]=pt[88]=1,ht[82]=ht[88]=0,dt[82]=dt[88]=1,lt[82]=lt[88]=-1,ct[82]=ct[88]=0,ft[82]=ft[88]=1,gt[82]=gt[88]=0,mt[82]=mt[88]=-1,yt[82]=yt[88]=0,nt[73]=nt[97]=0,it[73]=it[97]=1,ot[73]=ot[97]=0,at[73]=at[97]=0,st[73]=st[97]=-1,ut[73]=ut[97]=0,lt[73]=lt[97]=1,ct[73]=ct[97]=0,ft[73]=ft[97]=0,Je[73]=Je[97]=1,Ze[73]=Ze[97]=0,Qe[73]=Qe[97]=1,nt[145]=nt[25]=0,it[145]=it[25]=-1,ot[145]=ot[25]=0,lt[145]=lt[25]=1,ct[145]=ct[25]=0,ft[145]=ft[25]=1,vt[145]=vt[25]=0,_t[145]=_t[25]=1,bt[145]=bt[25]=1,et[145]=et[25]=-1,tt[145]=tt[25]=0,rt[145]=rt[25]=0,at[70]=at[100]=0,st[70]=st[100]=1,ut[70]=ut[100]=0,pt[70]=pt[100]=-1,ht[70]=ht[100]=0,dt[70]=dt[100]=1,gt[70]=gt[100]=0,mt[70]=mt[100]=-1,yt[70]=yt[100]=1,Je[70]=Je[100]=1,Ze[70]=Ze[100]=0,Qe[70]=Qe[100]=0,at[101]=at[69]=0,st[101]=st[69]=1,ut[101]=ut[69]=0,Je[101]=Je[69]=1,Ze[101]=Ze[69]=0,Qe[101]=Qe[69]=0,vt[149]=vt[21]=0,_t[149]=_t[21]=1,bt[149]=bt[21]=1,et[149]=et[21]=-1,tt[149]=tt[21]=0,rt[149]=rt[21]=0,pt[86]=pt[84]=-1,ht[86]=ht[84]=0,dt[86]=dt[84]=1,gt[86]=gt[84]=0,mt[86]=mt[84]=-1,yt[86]=yt[84]=1,nt[89]=nt[81]=0,it[89]=it[81]=-1,ot[89]=ot[81]=0,lt[89]=lt[81]=1,ct[89]=ct[81]=0,ft[89]=ft[81]=1,nt[96]=nt[74]=0,it[96]=it[74]=1,ot[96]=ot[74]=0,at[96]=at[74]=-1,st[96]=st[74]=0,ut[96]=ut[74]=1,gt[96]=gt[74]=1,mt[96]=mt[74]=0,yt[96]=yt[74]=0,Je[96]=Je[74]=1,Ze[96]=Ze[74]=0,Qe[96]=Qe[74]=1,nt[24]=nt[146]=0,it[24]=it[146]=-1,ot[24]=ot[146]=1,pt[24]=pt[146]=1,ht[24]=ht[146]=0,dt[24]=dt[146]=1,lt[24]=lt[146]=0,ct[24]=ct[146]=1,ft[24]=ft[146]=1,et[24]=et[146]=0,tt[24]=tt[146]=-1,rt[24]=rt[146]=0,at[6]=at[164]=-1,st[6]=st[164]=0,ut[6]=ut[164]=1,pt[6]=pt[164]=-1,ht[6]=ht[164]=0,dt[6]=dt[164]=0,vt[6]=vt[164]=0,_t[6]=_t[164]=-1,bt[6]=bt[164]=1,gt[6]=gt[164]=1,mt[6]=mt[164]=0,yt[6]=yt[164]=0,lt[129]=lt[41]=0,ct[129]=ct[41]=1,ft[129]=ft[41]=1,vt[129]=vt[41]=0,_t[129]=_t[41]=1,bt[129]=bt[41]=0,Je[129]=Je[41]=-1,Ze[129]=Ze[41]=0,Qe[129]=Qe[41]=0,et[129]=et[41]=0,tt[129]=tt[41]=-1,rt[129]=rt[41]=0,pt[66]=pt[104]=0,ht[66]=ht[104]=1,dt[66]=dt[104]=0,lt[66]=lt[104]=-1,ct[66]=ct[104]=0,ft[66]=ft[104]=1,gt[66]=gt[104]=0,mt[66]=mt[104]=-1,yt[66]=yt[104]=0,Je[66]=Je[104]=0,Ze[66]=Ze[104]=-1,Qe[66]=Qe[104]=1,nt[144]=nt[26]=-1,it[144]=it[26]=0,ot[144]=ot[26]=0,vt[144]=vt[26]=1,_t[144]=_t[26]=0,bt[144]=bt[26]=1,gt[144]=gt[26]=0,mt[144]=mt[26]=1,yt[144]=yt[26]=1,et[144]=et[26]=-1,tt[144]=tt[26]=0,rt[144]=rt[26]=1,at[36]=at[134]=0,st[36]=st[134]=1,ut[36]=ut[134]=1,pt[36]=pt[134]=0,ht[36]=ht[134]=1,dt[36]=dt[134]=0,Je[36]=Je[134]=0,Ze[36]=Ze[134]=-1,Qe[36]=Qe[134]=1,et[36]=et[134]=1,tt[36]=tt[134]=0,rt[36]=rt[134]=0,nt[9]=nt[161]=-1,it[9]=it[161]=0,ot[9]=ot[161]=0,at[9]=at[161]=0,st[9]=st[161]=-1,ut[9]=ut[161]=0,lt[9]=lt[161]=1,ct[9]=ct[161]=0,ft[9]=ft[161]=0,vt[9]=vt[161]=1,_t[9]=_t[161]=0,bt[9]=bt[161]=1,nt[136]=0,it[136]=1,ot[136]=1,at[136]=0,st[136]=1,ut[136]=0,pt[136]=-1,ht[136]=0,dt[136]=1,lt[136]=-1,ct[136]=0,ft[136]=0,vt[136]=0,_t[136]=-1,bt[136]=0,gt[136]=0,mt[136]=-1,yt[136]=1,Je[136]=1,Ze[136]=0,Qe[136]=0,et[136]=1,tt[136]=0,rt[136]=1,nt[34]=0,it[34]=-1,ot[34]=0,at[34]=0,st[34]=-1,ut[34]=1,pt[34]=1,ht[34]=0,dt[34]=0,lt[34]=1,ct[34]=0,ft[34]=1,vt[34]=0,_t[34]=1,bt[34]=1,gt[34]=0,mt[34]=1,yt[34]=0,Je[34]=-1,Ze[34]=0,Qe[34]=1,et[34]=-1,tt[34]=0,rt[34]=0,nt[35]=0,it[35]=1,ot[35]=1,at[35]=0,st[35]=-1,ut[35]=1,pt[35]=1,ht[35]=0,dt[35]=0,lt[35]=-1,ct[35]=0,ft[35]=0,vt[35]=0,_t[35]=-1,bt[35]=0,gt[35]=0,mt[35]=1,yt[35]=0,Je[35]=-1,Ze[35]=0,Qe[35]=1,et[35]=1,tt[35]=0,rt[35]=1,nt[153]=0,it[153]=1,ot[153]=1,lt[153]=-1,ct[153]=0,ft[153]=0,vt[153]=0,_t[153]=-1,bt[153]=0,et[153]=1,tt[153]=0,rt[153]=1,at[102]=0,st[102]=-1,ut[102]=1,pt[102]=1,ht[102]=0,dt[102]=0,gt[102]=0,mt[102]=1,yt[102]=0,Je[102]=-1,Ze[102]=0,Qe[102]=1,nt[155]=0,it[155]=-1,ot[155]=0,lt[155]=1,ct[155]=0,ft[155]=1,vt[155]=0,_t[155]=1,bt[155]=1,et[155]=-1,tt[155]=0,rt[155]=0,at[103]=0,st[103]=1,ut[103]=0,pt[103]=-1,ht[103]=0,dt[103]=1,gt[103]=0,mt[103]=-1,yt[103]=1,Je[103]=1,Ze[103]=0,Qe[103]=0,nt[152]=0,it[152]=1,ot[152]=1,pt[152]=-1,ht[152]=0,dt[152]=1,lt[152]=-1,ct[152]=0,ft[152]=0,vt[152]=0,_t[152]=-1,bt[152]=0,gt[152]=0,mt[152]=-1,yt[152]=1,et[152]=1,tt[152]=0,rt[152]=1,nt[156]=0,it[156]=-1,ot[156]=1,pt[156]=1,ht[156]=0,dt[156]=1,lt[156]=-1,ct[156]=0,ft[156]=0,vt[156]=0,_t[156]=-1,bt[156]=0,gt[156]=0,mt[156]=1,yt[156]=1,et[156]=-1,tt[156]=0,rt[156]=1,nt[137]=0,it[137]=1,ot[137]=1,at[137]=0,st[137]=1,ut[137]=0,lt[137]=-1,ct[137]=0,ft[137]=0,vt[137]=0,_t[137]=-1,bt[137]=0,Je[137]=1,Ze[137]=0,Qe[137]=0,et[137]=1,tt[137]=0,rt[137]=1,nt[139]=0,it[139]=1,ot[139]=1,at[139]=0,st[139]=-1,ut[139]=0,lt[139]=1,ct[139]=0,ft[139]=0,vt[139]=0,_t[139]=1,bt[139]=0,Je[139]=-1,Ze[139]=0,Qe[139]=0,et[139]=1,tt[139]=0,rt[139]=1,nt[98]=0,it[98]=-1,ot[98]=0,at[98]=0,st[98]=-1,ut[98]=1,pt[98]=1,ht[98]=0,dt[98]=0,lt[98]=1,ct[98]=0,ft[98]=1,gt[98]=0,mt[98]=1,yt[98]=0,Je[98]=-1,Ze[98]=0,Qe[98]=1,nt[99]=0,it[99]=1,ot[99]=0,at[99]=0,st[99]=-1,ut[99]=1,pt[99]=1,ht[99]=0,dt[99]=0,lt[99]=-1,ct[99]=0,ft[99]=1,gt[99]=0,mt[99]=-1,yt[99]=0,Je[99]=1,Ze[99]=0,Qe[99]=1,at[38]=0,st[38]=-1,ut[38]=1,pt[38]=1,ht[38]=0,dt[38]=0,vt[38]=0,_t[38]=1,bt[38]=1,gt[38]=0,mt[38]=1,yt[38]=0,Je[38]=-1,Ze[38]=0,Qe[38]=1,et[38]=-1,tt[38]=0,rt[38]=0,at[39]=0,st[39]=1,ut[39]=1,pt[39]=-1,ht[39]=0,dt[39]=0,vt[39]=0,_t[39]=-1,bt[39]=1,gt[39]=0,mt[39]=1,yt[39]=0,Je[39]=-1,Ze[39]=0,Qe[39]=1,et[39]=1,tt[39]=0,rt[39]=0;var Mx=l((function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p00"),Ix=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]}),"p01"),Px=l((function(t){return[[t.topright,1],[1,1],[1,t.righttop]]}),"p02"),Sx=l((function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]}),"p03"),Cx=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]}),"p04"),kx=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]}),"p05"),Ox=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]}),"p06"),Nx=l((function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p07"),A6=l((function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]}),"p08"),L6=l((function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]}),"p09"),R6=l((function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]}),"p10"),D6=l((function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p11"),F6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]}),"p12"),B6=l((function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]}),"p13"),j6=l((function(){return[[0,0],[0,1],[1,1],[1,0]]}),"p14"),z6=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]}),"p15"),q6=l((function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]}),"p16"),G6=l((function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]}),"p17"),U6=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]}),"p18"),V6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p19"),X6=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]}),"p20"),Y6=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]}),"p21"),W6=l((function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]}),"p22"),H6=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p23"),$6=l((function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p24"),K6=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]}),"p25"),J6=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p26"),Z6=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p27"),Q6=l((function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p28"),e4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]}),"p29"),t4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p30"),r4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p31"),n4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p32"),i4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p33"),o4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p34"),a4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p35"),s4=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p36"),u4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p37"),l4=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p38"),c4=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p39"),St=[],Ct=[],kt=[],Ot=[],Nt=[],Tt=[],At=[],Lt=[];Ot[1]=Nt[1]=18,Ot[169]=Nt[169]=18,kt[4]=Ct[4]=12,kt[166]=Ct[166]=12,St[16]=Lt[16]=4,St[154]=Lt[154]=4,Tt[64]=At[64]=22,Tt[106]=At[106]=22,kt[2]=Tt[2]=17,Ot[2]=Nt[2]=18,kt[168]=Tt[168]=17,Ot[168]=Nt[168]=18,St[8]=Ot[8]=9,Ct[8]=kt[8]=12,St[162]=Ot[162]=9,Ct[162]=kt[162]=12,St[32]=Lt[32]=4,Ct[32]=At[32]=1,St[138]=Lt[138]=4,Ct[138]=At[138]=1,Nt[128]=Lt[128]=21,Tt[128]=At[128]=22,Nt[42]=Lt[42]=21,Tt[42]=At[42]=22,Ct[5]=Nt[5]=14,Ct[165]=Nt[165]=14,kt[20]=Lt[20]=6,kt[150]=Lt[150]=6,St[80]=Tt[80]=11,St[90]=Tt[90]=11,Ot[65]=At[65]=3,Ot[105]=At[105]=3,St[160]=Tt[160]=11,Ct[160]=Nt[160]=14,St[10]=Tt[10]=11,Ct[10]=Nt[10]=14,kt[130]=Lt[130]=6,Ot[130]=At[130]=3,kt[40]=Lt[40]=6,Ot[40]=At[40]=3,Ct[101]=At[101]=1,Ct[69]=At[69]=1,Nt[149]=Lt[149]=21,Nt[21]=Lt[21]=21,kt[86]=Tt[86]=17,kt[84]=Tt[84]=17,St[89]=Ot[89]=9,St[81]=Ot[81]=9,St[96]=At[96]=0,Ct[96]=Tt[96]=15,St[74]=At[74]=0,Ct[74]=Tt[74]=15,St[24]=kt[24]=8,Ot[24]=Lt[24]=7,St[146]=kt[146]=8,Ot[146]=Lt[146]=7,Ct[6]=Tt[6]=15,kt[6]=Nt[6]=16,Ct[164]=Tt[164]=15,kt[164]=Nt[164]=16,Ot[129]=Lt[129]=7,Nt[129]=At[129]=20,Ot[41]=Lt[41]=7,Nt[41]=At[41]=20,kt[66]=At[66]=2,Ot[66]=Tt[66]=19,kt[104]=At[104]=2,Ot[104]=Tt[104]=19,St[144]=Nt[144]=10,Tt[144]=Lt[144]=23,St[26]=Nt[26]=10,Tt[26]=Lt[26]=23,Ct[36]=Lt[36]=5,kt[36]=At[36]=2,Ct[134]=Lt[134]=5,kt[134]=At[134]=2,St[9]=Nt[9]=10,Ct[9]=Ot[9]=13,St[161]=Nt[161]=10,Ct[161]=Ot[161]=13,Ct[37]=Lt[37]=5,Nt[37]=At[37]=20,Ct[133]=Lt[133]=5,Nt[133]=At[133]=20,kt[148]=Nt[148]=16,Tt[148]=Lt[148]=23,kt[22]=Nt[22]=16,Tt[22]=Lt[22]=23,St[82]=kt[82]=8,Ot[82]=Tt[82]=19,St[88]=kt[88]=8,Ot[88]=Tt[88]=19,St[73]=At[73]=0,Ct[73]=Ot[73]=13,St[97]=At[97]=0,Ct[97]=Ot[97]=13,St[145]=Ot[145]=9,Nt[145]=Lt[145]=21,St[25]=Ot[25]=9,Nt[25]=Lt[25]=21,Ct[70]=At[70]=1,kt[70]=Tt[70]=17,Ct[100]=At[100]=1,kt[100]=Tt[100]=17,St[34]=Ot[34]=9,Ct[34]=kt[34]=12,Nt[34]=Lt[34]=21,Tt[34]=At[34]=22,St[136]=Lt[136]=4,Ct[136]=At[136]=1,kt[136]=Tt[136]=17,Ot[136]=Nt[136]=18,St[35]=Lt[35]=4,Ct[35]=kt[35]=12,Ot[35]=Nt[35]=18,Tt[35]=At[35]=22,St[153]=Lt[153]=4,Ot[153]=Nt[153]=18,Ct[102]=kt[102]=12,Tt[102]=At[102]=22,St[155]=Ot[155]=9,Nt[155]=Lt[155]=23,Ct[103]=At[103]=1,kt[103]=Tt[103]=17,St[152]=Lt[152]=4,kt[152]=Tt[152]=17,Ot[152]=Nt[152]=18,St[156]=kt[156]=8,Ot[156]=Nt[156]=18,Tt[156]=Lt[156]=23,St[137]=Lt[137]=4,Ct[137]=At[137]=1,Ot[137]=Nt[137]=18,St[139]=Lt[139]=4,Ct[139]=Ot[139]=13,Nt[139]=At[139]=20,St[98]=Ot[98]=9,Ct[98]=kt[98]=12,Tt[98]=At[98]=22,St[99]=At[99]=0,Ct[99]=kt[99]=12,Ot[99]=Tt[99]=19,Ct[38]=kt[38]=12,Nt[38]=Lt[38]=21,Tt[38]=At[38]=22,Ct[39]=Lt[39]=5,kt[39]=Nt[39]=16,Tt[39]=At[39]=22;var we=[];function p4(t){return(t>0)-(t<0)||+t}function Al(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return p4(r*(n[1]-e[1])-o*i)}function aO(t,e){var n=t.geometry.coordinates[0].map((function(t){return t[0]})),r=t.geometry.coordinates[0].map((function(t){return t[1]})),i=e.geometry.coordinates[0].map((function(t){return t[0]})),o=e.geometry.coordinates[0].map((function(t){return t[1]}));return Math.max.apply(null,n)===Math.max.apply(null,i)&&Math.max.apply(null,r)===Math.max.apply(null,o)&&Math.min.apply(null,n)===Math.min.apply(null,i)&&Math.min.apply(null,r)===Math.min.apply(null,o)}function Tx(t,e){return e.geometry.coordinates[0].every((function(e){return Dn(jt(e),t)}))}function sO(t,e){return t[0]===e[0]&&t[1]===e[1]}we[1]=we[169]=Mx,we[4]=we[166]=Ix,we[16]=we[154]=Px,we[64]=we[106]=Sx,we[168]=we[2]=Cx,we[162]=we[8]=kx,we[138]=we[32]=Ox,we[42]=we[128]=Nx,we[5]=we[165]=A6,we[20]=we[150]=L6,we[80]=we[90]=R6,we[65]=we[105]=D6,we[160]=we[10]=F6,we[130]=we[40]=B6,we[85]=j6,we[101]=we[69]=z6,we[149]=we[21]=q6,we[86]=we[84]=G6,we[89]=we[81]=U6,we[96]=we[74]=V6,we[24]=we[146]=X6,we[6]=we[164]=Y6,we[129]=we[41]=W6,we[66]=we[104]=H6,we[144]=we[26]=$6,we[36]=we[134]=K6,we[9]=we[161]=J6,we[37]=we[133]=Z6,we[148]=we[22]=Q6,we[82]=we[88]=e4,we[73]=we[97]=t4,we[145]=we[25]=r4,we[70]=we[100]=n4,we[34]=function(t){return[Nx(t),kx(t)]},we[35]=i4,we[136]=function(t){return[Ox(t),Cx(t)]},we[153]=function(t){return[Px(t),Mx(t)]},we[102]=function(t){return[Ix(t),Sx(t)]},we[155]=o4,we[103]=a4,we[152]=function(t){return[Px(t),Cx(t)]},we[156]=s4,we[137]=function(t){return[Ox(t),Mx(t)]},we[139]=u4,we[98]=function(t){return[kx(t),Sx(t)]},we[99]=l4,we[38]=function(t){return[Ix(t),Nx(t)]},we[39]=c4,y(),y(),y(),y(),y(),y(),y(),y(),l(p4,"mathSign"),l(Al,"orientationIndex"),l(aO,"envelopeIsEqual"),l(Tx,"envelopeContains"),l(sO,"coordinatesEqual");var h4=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return l(t,"Node"),t.buildId=function(t){return t.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},t.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Al(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},t.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},t}(),Ax=h4;y();var d4=function(){function t(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return l(t,"Edge"),t.prototype.getSymetric=function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric},t.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},t.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},t.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},t.prototype.toLineString=function(){return Ar([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return Al(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),uO=d4;y();var g4=function(){function t(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return l(t,"EdgeRing"),t.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},t.prototype.get=function(t){return this.edges[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),t.prototype.forEach=function(t){this.edges.forEach(t)},t.prototype.map=function(t){return this.edges.map(t)},t.prototype.some=function(t){return this.edges.some(t)},t.prototype.isValid=function(){return!0},t.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Al(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},t.prototype.toMultiPoint=function(){return pb(this.edges.map((function(t){return t.from.coordinates})))},t.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=cr([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=Ob(this.toPolygon())},t.findEdgeRingContaining=function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o=e.getEnvelope();if(r&&(n=r.getEnvelope()),!aO(o,i)&&Tx(o,i)){for(var s=t.map((function(t){return t.from.coordinates})),a=void 0,u=l((function(t){e.some((function(e){return sO(t,e.from.coordinates)}))||(a=t)}),"_loop_1"),c=0,h=s;c<h.length;c++){u(h[c])}a&&e.inside(jt(a))&&(!r||Tx(n,o))&&(r=e)}})),r},t.prototype.inside=function(t){return Dn(t,this.toPolygon())},t}(),Lx=g4;function m4(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}l(m4,"validateGeoJson");var She=function(){function t(){this.edges=[],this.nodes={}}return l(t,"Graph"),t.fromGeoJson=function(e){m4(e);var n=new t;return ni(e,(function(t){db(t,"LineString","Graph::fromGeoJson"),dS(t,(function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e}))})),n},t.prototype.getNode=function(t){var e=Ax.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ax(t)),n},t.prototype.addEdge=function(t,e){var n=new uO(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},t.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},t.prototype._computeNextCWEdges=function(t){var e=this;typeof t>"u"?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))},t.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,l=void 0,u=void 0;s.label===e&&(l=s),a.label===e&&(u=a),l&&u&&(u&&(r=u),l&&(r&&(r.next=l,r=void 0),n||(n=l)))}r&&(r.next=n)},t.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},t.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},t.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=l((function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next}),"_loop_1");do{r()}while(!t.isEqual(n));return e},t.prototype._findEdgeRing=function(t){var e=t,n=new Lx;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},t.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()},t}();y(),y(),y(),y();var b4=er(Rx(),1);y();var x4=er(Rx(),1);y(),y();var E4=er(yO(),1);y();var O4=er(SO(),1);function kO(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function T4(){return new OO((function(t){return t.f}))}y(),y(),l(kO,"pathTo"),l(T4,"getHeap");var jx={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||jx.heuristics.manhattan,o=r.closest||!1,s=T4(),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var l=s.pop();if(l===n)return kO(l);l.closed=!0;for(var u=t.neighbors(l),c=0,h=u.length;c<h;++c){var p=u[c];if(!p.closed&&!p.isWall()){var f=l.g+p.getCost(l),d=p.visited;(!d||f<p.g)&&(p.visited=!0,p.parent=l,p.h=p.h||i(p,n),p.g=f,p.f=p.g+p.h,t.markDirty(p),o&&(p.h<a.h||p.h===a.h&&p.g<a.g)&&(a=p),d?s.rescoreElement(p):s.push(p))}}}return o?kO(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};function zp(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new fm(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function fm(t,e,n){this.x=t,this.y=e,this.weight=n}function OO(t){this.content=[],this.scoreFunction=t}function zx(){this._=null}function Rl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function qp(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Gp(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function NO(t){for(;t.L;)t=t.L;return t}l(zp,"Graph"),zp.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)jx.cleanNode(this.nodes[t])},zp.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)jx.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},zp.prototype.markDirty=function(t){this.dirtyNodes.push(t)},zp.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},zp.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},l(fm,"GridNode"),fm.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},fm.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},fm.prototype.isWall=function(){return 0===this.weight},l(OO,"BinaryHeap"),OO.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var l=this.content[s];(i=this.scoreFunction(l))<r&&(a=s)}if(o<e){var u=this.content[o];this.scoreFunction(u)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}},y(),y(),y(),y(),y(),y(),y(),y(),l(zx,"RedBlackTree"),l(Rl,"RedBlackNode"),zx.prototype={constructor:zx,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=NO(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(qp(this,n),n=(t=n).U),n.C=!1,r.C=!0,Gp(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Gp(this,n),n=(t=n).U),n.C=!1,r.C=!0,qp(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?NO(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,qp(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Gp(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,qp(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Gp(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,qp(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Gp(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},l(qp,"RedBlackRotateLeft"),l(Gp,"RedBlackRotateRight"),l(NO,"RedBlackFirst");var qx=zx;function Dl(t,e,n,r){var i=[null,null],o=Fn.push(i)-1;return i.left=t,i.right=e,n&&Up(i,t,e,n),r&&Up(i,e,t,r),_i[t.index].halfedges.push(o),_i[e.index].halfedges.push(o),i}function Fl(t,e,n){var r=[e,n];return r.left=t,r}function Up(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function A4(t,e,n,r,i){var o,s=t[0],a=t[1],l=s[0],u=s[1],c=0,h=1,p=a[0]-l,f=a[1]-u;if(o=e-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>c&&(c=o)}if(o=r-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<h&&(h=o)}if(o=n-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>c&&(c=o)}if(o=i-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<h&&(h=o)}return!(c>0)&&!(h<1)||(c>0&&(t[0]=[l+c*p,u+c*f]),h<1&&(t[1]=[l+h*p,u+h*f])),!0}}}}}function L4(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,l=t[0],u=t.left,c=t.right,h=u[0],p=u[1],f=c[0],d=c[1],g=(h+f)/2,y=(p+d)/2;if(d===p){if(g<e||g>=r)return;if(h>f){if(l){if(l[1]>=i)return}else l=[g,n];o=[g,i]}else{if(l){if(l[1]<n)return}else l=[g,i];o=[g,n]}}else if(a=y-(s=(h-f)/(d-p))*g,s<-1||s>1)if(h>f){if(l){if(l[1]>=i)return}else l=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(l){if(l[1]<n)return}else l=[(i-a)/s,i];o=[(n-a)/s,n]}else if(p<d){if(l){if(l[0]>=r)return}else l=[e,s*e+a];o=[r,s*r+a]}else{if(l){if(l[0]<e)return}else l=[r,s*r+a];o=[e,s*e+a]}return t[0]=l,t[1]=o,!0}function TO(t,e,n,r){for(var i,o=Fn.length;o--;)L4(i=Fn[o],t,e,n,r)&&A4(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>ir||Math.abs(i[0][1]-i[1][1])>ir)||delete Fn[o]}function AO(t){return _i[t.index]={site:t,halfedges:[]}}function R4(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Gx(t,e){return e[+(e.left!==t.site)]}function D4(t,e){return e[+(e.left===t.site)]}function LO(){for(var t,e,n,r,i=0,o=_i.length;i<o;++i)if((t=_i[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=R4(t,Fn[e[n]]);for(s.sort((function(t,e){return a[e]-a[t]})),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}function RO(t,e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=_i.length,v=!0;for(i=0;i<y;++i)if(o=_i[i]){for(s=o.site,a=(l=o.halfedges).length;a--;)Fn[l[a]]||l.splice(a,1);for(a=0,u=l.length;a<u;)d=(f=D4(o,Fn[l[a]]))[0],g=f[1],h=(c=Gx(o,Fn[l[++a%u]]))[0],p=c[1],(Math.abs(d-h)>ir||Math.abs(g-p)>ir)&&(l.splice(a,0,Fn.push(Fl(s,f,Math.abs(d-t)<ir&&r-g>ir?[t,Math.abs(h-t)<ir?p:r]:Math.abs(g-r)<ir&&n-d>ir?[Math.abs(p-r)<ir?h:n,r]:Math.abs(d-n)<ir&&g-e>ir?[n,Math.abs(h-n)<ir?p:e]:Math.abs(g-e)<ir&&d-t>ir?[Math.abs(p-e)<ir?h:t,e]:null))-1),++u);u&&(v=!1)}if(v){var m,_,b,w=1/0;for(i=0,v=null;i<y;++i)(o=_i[i])&&((b=(m=(s=o.site)[0]-t)*m+(_=s[1]-e)*_)<w&&(w=b,v=o));if(v){var x=[t,e],E=[t,r],I=[n,r],S=[n,e];v.halfedges.push(Fn.push(Fl(s=v.site,x,E))-1,Fn.push(Fl(s,E,I))-1,Fn.push(Fl(s,I,S))-1,Fn.push(Fl(s,S,x))-1)}}for(i=0;i<y;++i)(o=_i[i])&&(o.halfedges.length||delete _i[i])}y(),y(),l(Dl,"createEdge"),l(Fl,"createBorderEdge"),l(Up,"setEdgeEnd"),l(A4,"clipEdge"),l(L4,"connectEdge"),l(TO,"clipEdges"),l(AO,"createCell"),l(R4,"cellHalfedgeAngle"),l(Gx,"cellHalfedgeStart"),l(D4,"cellHalfedgeEnd"),l(LO,"sortCellHalfedges"),l(RO,"clipCells"),y();var pm,DO=[];function F4(){Rl(this),this.x=this.y=this.arc=this.site=this.cy=null}function Cu(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],l=r[0]-s,u=r[1]-a,c=o[0]-s,h=o[1]-a,p=2*(l*h-u*c);if(!(p>=-FO)){var f=l*l+u*u,d=c*c+h*h,g=(h*f-u*d)/p,y=(l*d-c*f)/p,v=DO.pop()||new F4;v.arc=t,v.site=i,v.x=g+s,v.y=(v.cy=y+a)+Math.sqrt(g*g+y*y),t.circle=v;for(var m=null,_=Bl._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Bl.insert(m,v),m||(pm=v)}}}}function ku(t){var e=t.circle;e&&(e.P||(pm=e.N),Bl.remove(e),DO.push(e),Rl(e),t.circle=null)}l(F4,"Circle"),l(Cu,"attachCircle"),l(ku,"detachCircle");var jO=[];function B4(){Rl(this),this.edge=this.site=this.circle=null}function BO(t){var e=jO.pop()||new B4;return e.site=t,e}function Ux(t){ku(t),Ou.remove(t),jO.push(t),Rl(t)}function zO(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Ux(t);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<ir&&Math.abs(r-l.circle.cy)<ir;)o=l.P,a.unshift(l),Ux(l),l=o;a.unshift(l),ku(l);for(var u=s;u.circle&&Math.abs(n-u.circle.x)<ir&&Math.abs(r-u.circle.cy)<ir;)s=u.N,a.push(u),Ux(u),u=s;a.push(u),ku(u);var c,h=a.length;for(c=1;c<h;++c)u=a[c],l=a[c-1],Up(u.edge,l.site,u.site,i);l=a[0],(u=a[h-1]).edge=Dl(l.site,u.site,null,i),Cu(l),Cu(u)}function qO(t){for(var e,n,r,i,o=t[0],s=t[1],a=Ou._;a;)if((r=GO(a,s)-o)>ir)a=a.L;else{if(!((i=o-j4(a,s))>ir)){r>-ir?(e=a.P,n=a):i>-ir?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}AO(t);var l=BO(t);if(Ou.insert(e,l),e||n){if(e===n)return ku(e),n=BO(e.site),Ou.insert(l,n),l.edge=n.edge=Dl(e.site,l.site),Cu(e),void Cu(n);if(!n)return void(l.edge=Dl(e.site,l.site));ku(e),ku(n);var u=e.site,c=u[0],h=u[1],p=t[0]-c,f=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(p*y-f*g),m=p*p+f*f,_=g*g+y*y,b=[(y*m-f*_)/v+c,(p*_-g*m)/v+h];Up(n.edge,u,d,b),l.edge=Dl(u,t,null,b),n.edge=Dl(t,d,null,b),Cu(e),Cu(n)}}function GO(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],l=n[1],u=l-e;if(!u)return a;var c=a-r,h=1/o-1/u,p=c/u;return h?(-p+Math.sqrt(p*p-2*h*(c*c/(-2*u)-l+u/2+i-o/2)))/h+r:(r+a)/2}function j4(t,e){var n=t.N;if(n)return GO(n,e);var r=t.site;return r[1]===e?r[0]:1/0}l(B4,"Beach"),l(BO,"createBeach"),l(Ux,"detachBeach"),l(zO,"removeBeach"),l(qO,"addBeach"),l(GO,"leftBreakPoint"),l(j4,"rightBreakPoint");var Ou,_i,Bl,Fn,ir=1e-6,FO=1e-12;function z4(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function q4(t,e){return e[1]-t[1]||e[0]-t[0]}function hm(t,e){var n,r,i,o=t.sort(q4).pop();for(Fn=[],_i=new Array(t.length),Ou=new qx,Bl=new qx;;)if(i=pm,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))(o[0]!==n||o[1]!==r)&&(qO(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;zO(i.arc)}if(LO(),e){var s=+e[0][0],a=+e[0][1],l=+e[1][0],u=+e[1][1];TO(s,a,l,u),RO(s,a,l,u)}this.edges=Fn,this.cells=_i,Ou=Bl=Fn=_i=null}l(z4,"triangleArea"),l(q4,"lexicographic"),l(hm,"Diagram"),hm.prototype={constructor:hm,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Gx(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,l=-1,u=e[i[o-1]],c=u.left===a?u.right:u.left;++l<o;)s=c,c=(u=e[i[l]]).left===a?u.right:u.left,s&&c&&r<s.index&&r<c.index&&z4(a,s,c)<0&&t.push([a.data,s.data,c.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var l=t-i.site[0],u=e-i.site[1],c=l*l+u*u;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var l=t-a[0],u=e-a[1],h=l*l+u*u;h<c&&(c=h,s=a.index)}}))}while(null!==s);return o._found=r,null==n||c<=n*n?i.site:null}},y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y(),y();var $4=er(jl(),1);y();var Xl=er(YO(),1);function bi(){return new mm}function mm(){this.reset()}y(),y(),y(),l(bi,"default"),l(mm,"Adder"),mm.prototype={constructor:mm,reset:function(){this.s=this.t=0},add:function(t){WO(gm,t,this.t),WO(this,gm.s,this.s),this.s?this.t+=gm.t:this.s=gm.t},valueOf:function(){return this.s}};var gm=new mm;function WO(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}l(WO,"add"),y();var je=1e-6,xt=Math.PI,wn=xt/2,ym=xt/4,Hn=2*xt,xi=180/xt,Fr=xt/180,Yt=Math.abs,qo=Math.atan,Bn=Math.atan2,De=Math.cos,vm=Math.exp,Vp=Math.log,Fe=Math.sin,cn=Math.sqrt,Xp=Math.tan;function _m(t){return t>1?0:t<-1?xt:Math.acos(t)}function En(t){return t>1?wn:t<-1?-wn:Math.asin(t)}function wi(){}function bm(t,e){t&&$O.hasOwnProperty(t.type)&&$O[t.type](t,e)}l(_m,"acos"),l(En,"asin"),y(),l(wi,"noop"),y(),l(bm,"streamGeometry");var HO={Feature:function(t,e){bm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)bm(n[r].geometry,e)}},$O={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,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Yx(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yx(n[r],e,0)},Polygon:function(t,e){KO(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)KO(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)bm(n[r],e)}};function Yx(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function KO(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yx(t[n],e,1);e.polygonEnd()}function Ya(t,e){t&&HO.hasOwnProperty(t.type)?HO[t.type](t,e):bm(t,e)}l(Yx,"streamLine"),l(KO,"streamPolygon"),l(Ya,"default");var K4=bi(),fve=bi();function zl(t){return[Bn(t[1],t[0]),En(t[2])]}function Go(t){var e=t[0],n=t[1],r=De(n);return[r*De(e),r*Fe(e),Fe(n)]}function Yp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Nu(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 xm(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Wp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ql(t){var e=cn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}y(),y(),l(zl,"spherical"),l(Go,"cartesian"),l(Yp,"cartesianDot"),l(Nu,"cartesianCross"),l(xm,"cartesianAddInPlace"),l(Wp,"cartesianScale"),l(ql,"cartesianNormalizeInPlace");var Ive=bi();function Hp(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return l(n,"compose"),t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Wx(t,e){return[t>xt?t-Hn:t<-xt?t+Hn:t,e]}function Hx(t,e,n){return(t%=Hn)?e||n?Hp(ZO(t),QO(e,n)):ZO(t):e||n?QO(e,n):Wx}function JO(t){return function(e,n){return[(e+=t)>xt?e-Hn:e<-xt?e+Hn:e,n]}}function ZO(t){var e=JO(t);return e.invert=JO(-t),e}function QO(t,e){var n=De(t),r=Fe(t),i=De(e),o=Fe(e);function s(t,e){var s=De(e),a=De(t)*s,l=Fe(t)*s,u=Fe(e),c=u*n+a*r;return[Bn(l*i-c*o,a*n-u*r),En(c*i+l*o)]}return l(s,"rotation"),s.invert=function(t,e){var s=De(e),a=De(t)*s,l=Fe(t)*s,u=Fe(e),c=u*i-l*o;return[Bn(l*i+u*o,a*n+c*r),En(c*n-a*r)]},s}function tN(t,e,n,r,i,o){if(n){var s=De(e),a=Fe(e),l=r*n;null==i?(i=e+r*Hn,o=e-l/2):(i=eN(s,i),o=eN(s,o),(r>0?i<o:i>o)&&(i+=r*Hn));for(var u,c=i;r>0?c>o:c<o;c-=l)u=zl([s,-a*De(c),-a*Fe(c)]),t.point(u[0],u[1])}}function eN(t,e){(e=Go(e))[0]-=t,ql(e);var n=_m(-e[1]);return((-e[2]<0?-n:n)+Hn-je)%Hn}function $p(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function $x(t,e,n,r,i,o){var s,a=t[0],l=t[1],u=0,c=1,h=e[0]-a,p=e[1]-l;if(s=n-a,h||!(s>0)){if(s/=h,h<0){if(s<u)return;s<c&&(c=s)}else if(h>0){if(s>c)return;s>u&&(u=s)}if(s=i-a,h||!(s<0)){if(s/=h,h<0){if(s>c)return;s>u&&(u=s)}else if(h>0){if(s<u)return;s<c&&(c=s)}if(s=r-l,p||!(s>0)){if(s/=p,p<0){if(s<u)return;s<c&&(c=s)}else if(p>0){if(s>c)return;s>u&&(u=s)}if(s=o-l,p||!(s<0)){if(s/=p,p<0){if(s>c)return;s>u&&(u=s)}else if(p>0){if(s<u)return;s<c&&(c=s)}return u>0&&(t[0]=a+u*h,t[1]=l+u*p),c<1&&(e[0]=a+c*h,e[1]=l+c*p),!0}}}}}function Tu(t,e){return Yt(t[0]-e[0])<je&&Yt(t[1]-e[1])<je}function wm(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 Kp(t,e,n,r,i){var o,s,a=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(Tu(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a.push(n=new wm(r,t,null,!0)),l.push(n.o=new wm(r,null,n,!1)),a.push(n=new wm(s,t,null,!1)),l.push(n.o=new wm(s,null,n,!0))}})),a.length){for(l.sort(e),rN(a),rN(l),o=0,s=l.length;o<s;++o)l[o].e=n=!n;for(var u,c,h=a[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;u=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=u.length;o<s;++o)i.point((c=u[o])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(u=p.p.z,o=u.length-1;o>=0;--o)i.point((c=u[o])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}u=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}}function rN(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Wa(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Em(t){return 1===t.length&&(t=J4(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function J4(t){return function(e,n){return Wa(t(e),n)}}y(),y(),y(),y(),y(),l(Hp,"default"),l(Wx,"rotationIdentity"),Wx.invert=Wx,l(Hx,"rotateRadians"),l(JO,"forwardRotationLambda"),l(ZO,"rotationLambda"),l(QO,"rotationPhiGamma"),l(tN,"circleStream"),l(eN,"circleRadius"),y(),y(),l($p,"default"),y(),l($x,"default"),y(),y(),l(Tu,"default"),l(wm,"Intersection"),l(Kp,"default"),l(rN,"link"),y(),y(),y(),l(Wa,"default"),y(),l(Em,"default"),l(J4,"ascendingComparator");var nN=Em(Wa),Z4=nN.right,Q4=nN.left;y(),y(),y(),y(),y(),y(),y(),y(),y();var iN=Array.prototype,tG=iN.slice,rG=iN.map;y(),y(),y(),y();var l1e=Math.sqrt(50),c1e=Math.sqrt(10),f1e=Math.sqrt(2);function Gl(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}y(),y(),y(),y(),y(),y(),y(),y(),l(Gl,"default"),y(),y(),y(),y(),y(),y(),y();var Jp=1e9,Im=-Jp;function Kx(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^a>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+a+4)%4)!==h);else l.point(o[0],o[1])}function s(r,i){return Yt(r[0]-t)<je?i>0?0:3:Yt(r[0]-n)<je?i>0?2:1:Yt(r[1]-e)<je?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(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 l(i,"visible"),l(o,"interpolate"),l(s,"corner"),l(a,"compareIntersection"),l(u,"comparePoint"),function(s){var u,c,h,p,f,d,g,y,v,m,_,b=s,w=$p(),x={point:E,lineStart:M,lineEnd:C,polygonStart:S,polygonEnd:N};function E(t,e){i(t,e)&&b.point(t,e)}function I(){for(var e=0,n=0,i=c.length;n<i;++n)for(var o,s,a=c[n],l=1,u=a.length,h=a[0],p=h[0],f=h[1];l<u;++l)o=p,s=f,p=(h=a[l])[0],f=h[1],s<=r?f>r&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}function S(){b=w,u=[],c=[],_=!0}function N(){var t=I(),e=_&&t,n=(u=Gl(u)).length;(e||n)&&(s.polygonStart(),e&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),n&&Kp(u,a,t,o,s),s.polygonEnd()),b=s,u=c=h=null}function M(){x.point=O,c&&c.push(h=[]),m=!0,v=!1,g=y=NaN}function C(){u&&(O(p,f),d&&v&&w.rejoin(),u.push(w.result())),x.point=E,v&&b.lineEnd()}function O(o,s){var a=i(o,s);if(c&&h.push([o,s]),m)p=o,f=s,d=a,m=!1,a&&(b.lineStart(),b.point(o,s));else if(a&&v)b.point(o,s);else{var l=[g=Math.max(Im,Math.min(Jp,g)),y=Math.max(Im,Math.min(Jp,y))],u=[o=Math.max(Im,Math.min(Jp,o)),s=Math.max(Im,Math.min(Jp,s))];$x(l,u,t,e,n,r)?(v||(b.lineStart(),b.point(l[0],l[1])),b.point(u[0],u[1]),a||b.lineEnd(),_=!1):a&&(b.lineStart(),b.point(o,s),_=!1)}g=o,y=s,v=a}return l(E,"point"),l(I,"polygonInside"),l(S,"polygonStart"),l(N,"polygonEnd"),l(M,"lineStart"),l(C,"lineEnd"),l(O,"linePoint"),x}}l(Kx,"clipExtent"),y(),y();var Jx=bi();function Pm(t,e){var n=e[0],r=e[1],i=[Fe(n),-De(n),0],o=0,s=0;Jx.reset();for(var a=0,l=t.length;a<l;++a)if(c=(u=t[a]).length)for(var u,c,h=u[c-1],p=h[0],f=h[1]/2+ym,d=Fe(f),g=De(f),y=0;y<c;++y,p=m,d=b,g=w,h=v){var v=u[y],m=v[0],_=v[1]/2+ym,b=Fe(_),w=De(_),x=m-p,E=x>=0?1:-1,I=E*x,S=I>xt,N=d*b;if(Jx.add(Bn(N*E*Fe(I),g*w+N*De(I))),o+=S?x+E*Hn:x,S^p>=n^m>=n){var M=Nu(Go(h),Go(v));ql(M);var C=Nu(i,M);ql(C);var O=(S^x>=0?-1:1)*En(C[2]);(r>O||r===O&&(M[0]||M[1]))&&(s+=S^x>=0?1:-1)}}return(o<-je||o<je&&Jx<-je)^1&s}l(Pm,"default"),y(),y();var qbe=bi();function Ul(t){return t}y(),y(),y(),y(),l(Ul,"default"),y();var vxe=bi(),_xe=bi();y();var Vl=1/0,Sm=Vl,Zp=-Vl,Cm=Zp,pG={point:hG,lineStart:wi,lineEnd:wi,polygonStart:wi,polygonEnd:wi,result:function(){var t=[[Vl,Sm],[Zp,Cm]];return Zp=Cm=-(Sm=Vl=1/0),t}};function hG(t,e){t<Vl&&(Vl=t),t>Zp&&(Zp=t),e<Sm&&(Sm=e),e>Cm&&(Cm=e)}l(hG,"boundsPoint");var km=pG;function Zx(t){this._context=t}y(),y(),l(Zx,"PathContext"),Zx.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Hn)}},result:wi},y();var jxe=bi();function Qx(){this._string=[]}function sN(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qp(t,e,n,r){return function(i,o){var s,a,u,c=e(o),h=i.invert(r[0],r[1]),p=$p(),f=e(p),d=!1,g={point:y,lineStart:m,lineEnd:_,polygonStart:function(){g.point=b,g.lineStart=w,g.lineEnd=x,a=[],s=[]},polygonEnd:function(){g.point=y,g.lineStart=m,g.lineEnd=_,a=Gl(a);var t=Pm(s,h);a.length?(d||(o.polygonStart(),d=!0),Kp(a,gG,t,n,o)):t&&(d||(o.polygonStart(),d=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),d&&(o.polygonEnd(),d=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function v(t,e){var n=i(t,e);c.point(n[0],n[1])}function m(){g.point=v,c.lineStart()}function _(){g.point=y,c.lineEnd()}function b(t,e){u.push([t,e]);var n=i(t,e);f.point(n[0],n[1])}function w(){f.lineStart(),u=[]}function x(){b(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),l=p.result(),c=l.length;if(u.pop(),s.push(u),u=null,c){if(1&i){if((e=(n=l[0]).length-1)>0){for(d||(o.polygonStart(),d=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}return}c>1&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(dG))}}return l(y,"point"),l(v,"pointLine"),l(m,"lineStart"),l(_,"lineEnd"),l(b,"pointRing"),l(w,"ringStart"),l(x,"ringEnd"),g}}function dG(t){return t.length>1}function gG(t,e){return((t=t.x)[0]<0?t[1]-wn-je:wn-t[1])-((e=e.x)[0]<0?e[1]-wn-je:wn-e[1])}y(),l(Qx,"PathString"),Qx.prototype={_radius:4.5,_circle:sN(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=sN(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},l(sN,"circle"),y(),y(),y(),y(),y(),y(),l(Qp,"default"),l(dG,"validSegment"),l(gG,"compareIntersection");var ew=Qp((function(){return!0}),mG,vG,[-xt,-wn]);function mG(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?xt:-xt,l=Yt(o-n);Yt(l-xt)<je?(t.point(n,r=(r+s)/2>0?wn:-wn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&l>=xt&&(Yt(n-i)<je&&(n-=i*je),Yt(o-a)<je&&(o-=a*je),r=yG(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}function yG(t,e,n,r){var i,o,s=Fe(t-n);return Yt(s)>je?qo((Fe(e)*(o=De(r))*Fe(n)-Fe(r)*(i=De(e))*Fe(t))/(i*o*s)):(e+r)/2}function vG(t,e,n,r){var i;if(null==t)i=n*wn,r.point(-xt,i),r.point(0,i),r.point(xt,i),r.point(xt,0),r.point(xt,-i),r.point(0,-i),r.point(-xt,-i),r.point(-xt,0),r.point(-xt,i);else if(Yt(t[0]-e[0])>je){var o=t[0]<e[0]?xt:-xt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function tw(t,e){var n=De(t),r=n>0,i=Yt(n)>je;function o(n,r,i,o){tN(o,t,e,i,n,r)}function s(t,e){return De(t)*De(e)>n}function a(t){var e,n,o,a,l;return{lineStart:function(){a=o=!1,l=1},point:function(h,p){var f,d=[h,p],g=s(h,p),y=r?g?0:c(h,p):g?c(h+(h<0?xt:-xt),p):0;if(!e&&(a=o=g)&&t.lineStart(),g!==o&&((!(f=u(e,d))||Tu(e,f)||Tu(d,f))&&(d[0]+=je,d[1]+=je,g=s(d[0],d[1]))),g!==o)l=0,g?(t.lineStart(),f=u(d,e),t.point(f[0],f[1])):(f=u(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(i&&e&&r^g){var v;!(y&n)&&(v=u(d,e,!0))&&(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}g&&(!e||!Tu(e,d))&&t.point(d[0],d[1]),e=d,o=g,n=y},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return l|(a&&o)<<1}}}function u(t,e,r){var i=[1,0,0],o=Nu(Go(t),Go(e)),s=Yp(o,o),a=o[0],l=s-a*a;if(!l)return!r&&t;var u=n*s/l,c=-n*a/l,h=Nu(i,o),p=Wp(i,u);xm(p,Wp(o,c));var f=h,d=Yp(p,f),g=Yp(f,f),y=d*d-g*(Yp(p,p)-1);if(!(y<0)){var v=cn(y),m=Wp(f,(-d-v)/g);if(xm(m,p),m=zl(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],E=e[1];w<b&&(_=b,b=w,w=_);var I=w-b,S=Yt(I-xt)<je;if(!S&&E<x&&(_=x,x=E,E=_),S||I<je?S?x+E>0^m[1]<(Yt(m[0]-b)<je?x:E):x<=m[1]&&m[1]<=E:I>xt^(b<=m[0]&&m[0]<=w)){var N=Wp(f,(-d+v)/g);return xm(N,p),[m,zl(N)]}}}function c(e,n){var i=r?t:xt-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return l(o,"interpolate"),l(s,"visible"),l(a,"clipLine"),l(u,"intersect"),l(c,"code"),Qp(s,a,o,r?[0,-t]:[-xt,t-xt])}function eh(t){return function(e){var n=new rw;for(var r in t)n[r]=t[r];return n.stream=e,n}}function rw(){}function th(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Ya(n,t.stream(km));var s=km.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),l=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,u=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([l,u])}function Om(t,e,n){return th(t,[[0,0],e],n)}l(mG,"clipAntimeridianLine"),l(yG,"clipAntimeridianIntersect"),l(vG,"clipAntimeridianInterpolate"),y(),l(tw,"default"),y(),l(eh,"transformer"),l(rw,"TransformStream"),rw.prototype={constructor:rw,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()}},y(),l(th,"fitExtent"),l(Om,"fitSize"),y();var uN=16,_G=De(30*Fr);function Nm(t,e){return+e?xG(t,e):bG(t)}function bG(t){return eh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function xG(t,e){function n(r,i,o,s,a,l,u,c,h,p,f,d,g,y){var v=u-r,m=c-i,_=v*v+m*m;if(_>4*e&&g--){var b=s+p,w=a+f,x=l+d,E=cn(b*b+w*w+x*x),I=En(x/=E),S=Yt(Yt(x)-1)<je||Yt(o-h)<je?(o+h)/2:Bn(w,b),N=t(S,I),M=N[0],C=N[1],O=M-r,P=C-i,A=m*O-v*P;(A*A/_>e||Yt((v*O+m*P)/_-.5)>.3||s*p+a*f+l*d<_G)&&(n(r,i,o,s,a,l,M,C,S,b/=E,w/=E,x,g,y),y.point(M,C),n(M,C,S,b,w,x,u,c,h,p,f,d,g,y))}}return l(n,"resampleLineTo"),function(e){var r,i,o,s,a,u,c,h,p,f,d,g,y={point:v,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),y.lineStart=w},polygonEnd:function(){e.polygonEnd(),y.lineStart=m}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){h=NaN,y.point=_,e.lineStart()}function _(r,i){var o=Go([r,i]),s=t(r,i);n(h,p,c,f,d,g,h=s[0],p=s[1],c=r,f=o[0],d=o[1],g=o[2],uN,e),e.point(h,p)}function b(){y.point=v,e.lineEnd()}function w(){m(),y.point=x,y.lineEnd=E}function x(t,e){_(r=t,e),i=h,o=p,s=f,a=d,u=g,y.point=_}function E(){n(h,p,c,f,d,g,i,o,r,s,a,u,uN,e),y.lineEnd=b,b()}return l(v,"point"),l(m,"lineStart"),l(_,"linePoint"),l(b,"lineEnd"),l(w,"ringStart"),l(x,"ringPoint"),l(E,"ringEnd"),y}}l(Nm,"default"),l(bG,"resampleNone"),l(xG,"resample");var wG=eh({point:function(t,e){this.stream.point(t*Fr,e*Fr)}});function Uo(t){return nw((function(){return t}))()}function nw(t){var e,n,r,i,o,s,a,u,c,h,p=150,f=480,d=250,g=0,y=0,v=0,m=0,_=0,b=null,w=ew,x=null,E=Ul,I=.5,S=Nm(C,I);function N(t){return[(t=o(t[0]*Fr,t[1]*Fr))[0]*p+n,r-t[1]*p]}function M(t){return(t=o.invert((t[0]-n)/p,(r-t[1])/p))&&[t[0]*xi,t[1]*xi]}function C(t,i){return[(t=e(t,i))[0]*p+n,r-t[1]*p]}function O(){o=Hp(i=Hx(v,m,_),e);var t=e(g,y);return n=f-t[0]*p,r=d+t[1]*p,P()}function P(){return c=h=null,N}return l(N,"projection"),l(M,"invert"),l(C,"projectTransform"),N.stream=function(t){return c&&h===t?c:c=wG(w(i,S(E(h=t))))},N.clipAngle=function(t){return arguments.length?(w=+t?tw(b=t*Fr,6*Fr):(b=null,ew),P()):b*xi},N.clipExtent=function(t){return arguments.length?(E=null==t?(x=s=a=u=null,Ul):Kx(x=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),P()):null==x?null:[[x,s],[a,u]]},N.scale=function(t){return arguments.length?(p=+t,O()):p},N.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],O()):[f,d]},N.center=function(t){return arguments.length?(g=t[0]%360*Fr,y=t[1]%360*Fr,O()):[g*xi,y*xi]},N.rotate=function(t){return arguments.length?(v=t[0]%360*Fr,m=t[1]%360*Fr,_=t.length>2?t[2]%360*Fr:0,O()):[v*xi,m*xi,_*xi]},N.precision=function(t){return arguments.length?(S=Nm(C,I=t*t),P()):cn(I)},N.fitExtent=function(t,e){return th(N,t,e)},N.fitSize=function(t,e){return Om(N,t,e)},l(O,"recenter"),l(P,"reset"),function(){return e=t.apply(this,arguments),N.invert=e.invert&&M,O()}}function Tm(t){return function(e,n){var r=De(e),i=De(n),o=t(r*i);return[o*i*Fe(e),o*Fe(n)]}}function ma(t){return function(e,n){var r=cn(e*e+n*n),i=t(r),o=Fe(i),s=De(i);return[Bn(e*o,r*s),En(r&&n*o/r)]}}l(Uo,"projection"),l(nw,"projectionMutator"),y(),y(),y(),y(),l(Tm,"azimuthalRaw"),l(ma,"azimuthalInvert");var pN=Tm((function(t){return cn(2/(1+t))}));pN.invert=ma((function(t){return 2*En(t/2)})),y();var iw=Tm((function(t){return(t=_m(t))&&t/Fe(t)}));function Am(){return Uo(iw).scale(79.4188).clipAngle(179.999)}function ow(t,e){return[t,Vp(Xp((wn+e)/2))]}function Lm(t,e){return[t,e]}function hN(t,e){var n=De(e),r=De(t)*n;return[n*Fe(t)/r,Fe(e)/r]}function dN(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function gN(t,e){return[De(e)*Fe(t),Fe(e)]}function mN(t,e){var n=De(e),r=1+De(t)*n;return[n*Fe(t)/r,Fe(e)/r]}function yN(t,e){return[Vp(Xp((wn+e)/2)),-t]}function IG(t,e,n){var r=(n=n||{}).units||"kilometers",i=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 i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return fa(t,(function(t){var n=Rm(t,e,r,i);n&&o.push(n)})),Ve(o);case"FeatureCollection":return rr(t,(function(t){var n=Rm(t,e,r,i);n&&rr(n,(function(t){t&&o.push(t)}))})),Ve(o)}return Rm(t,e,r,i)}function Rm(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return fa(t,(function(t){var i=Rm(t,e,n,r);i&&s.push(i)})),Ve(s)}var a=PG(o),l={type:o.type,coordinates:_N(o.coordinates,a)},u=(new Xl.GeoJSONReader).read(l),c=wp(Ep(e,n),"meters"),h=Xl.BufferOp.bufferOp(u,c,r);if(!vN((h=(new Xl.GeoJSONWriter).write(h)).coordinates))return bn({type:h.type,coordinates:bN(h.coordinates,a)},i)}function vN(t){return Array.isArray(t[0])?vN(t[0]):isNaN(t[0])}function _N(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return _N(t,e)}))}function bN(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return bN(t,e)}))}function PG(t){var e=bu(t).geometry.coordinates,n=[-e[0],-e[1]];return Am().rotate(n).scale(_n)}iw.invert=ma((function(t){return t})),l(Am,"default"),y(),y(),l(ow,"mercatorRaw"),ow.invert=function(t,e){return[t,2*qo(vm(e))-wn]},y(),y(),l(Lm,"equirectangularRaw"),Lm.invert=Lm,y(),l(hN,"gnomonicRaw"),hN.invert=ma(qo),y(),y(),l(dN,"naturalEarth1Raw"),dN.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,s=o*o;r-=n=(r*(1.007226+o*(.015085+s*(.028874*o-.044475-.005916*s)))-e)/(1.007226+o*(.045255+s*(.259866*o-.311325-.005916*11*s)))}while(Yt(n)>je&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},y(),l(gN,"orthographicRaw"),gN.invert=ma(En),y(),l(mN,"stereographicRaw"),mN.invert=ma((function(t){return 2*qo(t)})),y(),l(yN,"transverseMercatorRaw"),yN.invert=function(t,e){return[-e,2*qo(vm(t))-wn]},l(IG,"buffer"),l(Rm,"bufferFeature"),l(vN,"coordsIsNaN"),l(_N,"projectCoords"),l(bN,"unprojectCoords"),l(PG,"defineProjection");var aw=IG;y();var SG=er(jl(),1);y();var CG=er(jl(),1);y();var OG=er(jl(),1);y(),y();var NG=er(jl(),1);y(),y(),y(),y();var zG=1e-7,qG=.22,GG=.2,wN=.005,EN=["connection.json","manifest.geojson","map.geojson","node.geojson","styles.json","mapstack.geojson"];function sw(t,e,n){let r=YG(e),[i,o]=t.features.reduce(((t,e)=>{let[i,o]=t,s=[e],{properties:a}=e,l=(a.entrances||[]).reduce(((t,e)=>(r.has(e)&&t.push(r.get(e)),t)),[]);if(l.length&&(s=UG(e,l)),n&&"LineString"===s[0].geometry.type){let t=n.get(s[0].properties.id).type;i.has(t)||i.set(t,[]),i.get(t).push(...s)}else o.push(...s);return t}),[new Map,[]]),s=1;return i.forEach((t=>{var e;let r={kind:t[0].properties.kind,id:t[0].properties.id,externalId:t[0].properties.externalId},a=((null==(e=null==n?void 0:n.get(t[0].properties.id))?void 0:e.width)||qG)/2,l=s/i.size*a*GG;if(t.length){let e=aw(vu(t.map((({geometry:t})=>t.coordinates))),a+l,{units:"meters",steps:3});e.properties={...r,...e.properties};let n=[];n="MultiPolygon"===e.geometry.type?e.geometry.coordinates.map((t=>({...cr(t),properties:r}))):[e],o=o.concat(n)}s++})),Ve(o)}function UG(t,e){return e.reduce(((t,e)=>{let n={epsilon:zG},r=t.findIndex((t=>wl(bu(e),t,n))),i=t[r];if(i){let[n,o]=XG(i,e);t.splice(r,1,n,o)}return t}),[t])}function VG(t){return null!=t&&(null!=t.polygons||null!=t.lineStrings)}function XG(t,e){let{coordinates:n}=e.geometry,{coordinates:r}=t.geometry,i=n.map((e=>Va(t,jt(e))));return r.reduce(((e,n)=>{let r=Xg(jt(n),i[0],t),o=Xg(jt(n),i[1],t),s=Mu(r)<Mu(o)?r:o;return s.properties={...t.properties,entrances:[]},e.concat([s])}),[])}function MN(t){let e=new Map;for(let n in t){let r=t[n];if(!VG(r))continue;let{altitude:i,color:o,width:s,height:a,opacity:l}=r;(r.polygons||r.lineStrings).forEach((t=>{e.set(t,{altitude:i,color:o,width:s,height:a,opacity:l,type:n})}))}return e}function YG(t){return new Map(t.features.map((t=>{let{properties:e}=t,{id:n}=e;return[n,t]})))}function IN(t){if(0===t.length)return;let e;for(let n of t)if("number"==typeof n.elevation){if(!e){e=n;continue}"number"==typeof e.elevation&&(e=Math.abs(n.elevation)===Math.abs(e.elevation)?n.elevation>e.elevation?n:e:Math.abs(n.elevation)<Math.abs(e.elevation)?n:e)}return e}function g5(t){if(null==t||"object"!=typeof t)return!1;for(let e of EN)if("Uint8Array"!==t[e][Symbol.toStringTag])return!1;return!0}function m5(t){var e;if(null==t||"object"!=typeof t)return!1;let n=["building.geojson","category.geojson","location.geojson","manifest.geojson"];for(let r of n)if("Uint8Array"!==(null==(e=null==t?void 0:t[r])?void 0:e[Symbol.toStringTag]))return!1;return!0}async function cT(t){return new Promise((async(e,n)=>{try{if(null==t||"object"!=typeof t)throw new Error("Error parsing data! Unzipping failed.");if("Uint8Array"!==t[Symbol.toStringTag])throw new Error("Unexpected file type! Unzipping failed.");let n=(await Promise.resolve().then((()=>(Nw(),Ow)))).unzipSync(t);if(!m5(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let r={"building.geojson":n["building.geojson"],"category.geojson":n["category.geojson"],"location.geojson":n["location.geojson"],"manifest.geojson":n["manifest.geojson"],space:{},obstruction:{},node:{},level:{},connection:{}},i=Object.keys(n);for(let t of i){if(0===n[t].length)continue;let e=t.split("/");if(e.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(e.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(1!==e.length){if("image"===e[0]){Ie.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}null==r[e[0]]&&(r[e[0]]={}),r[e[0]][e[1]]=n[t]}}e(r)}catch(t){n(t)}}))}async function Aw(t){return new Promise((async(e,n)=>{try{if(null==t||"object"!=typeof t)throw new Error("Error parsing data! Unzipping failed.");if("Uint8Array"!==t[Symbol.toStringTag])throw new Error("Unexpected file type! Unzipping failed.");let n=(await Promise.resolve().then((()=>(Nw(),Ow)))).unzipSync(t);if(!g5(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let r={"connection.json":n["connection.json"],"manifest.geojson":n["manifest.geojson"],"node.geojson":n["node.geojson"],"map.geojson":n["map.geojson"],"mapstack.geojson":n["mapstack.geojson"],"styles.json":n["styles.json"],space:{},obstruction:{},entrance:{}},i=Object.keys(n);for(let t of i){if(0===n[t].length)continue;let e=t.split("/");if(e.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(e.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(1!==e.length){if("image"===e[0]){Ie.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}null==r[e[0]]&&(r[e[0]]={}),r[e[0]][e[1]]=n[t]}}e(r)}catch(t){n(t)}}))}function fT(t){let[e,n,r,i]=Rn(t);return{minLat:n,minLong:e,maxLat:i,maxLong:r}}function y5(t,e,n){let r=n.createGeoreferences(),i=new Set;e.forEach((t=>{t.layer&&i.add(t.layer)}));let o=t.id||"",s=t.externalId||o||"",a=t.elevation||0,l=[...i].map((t=>({id:t,visible:!0}))),u=1/n.mapScale;return{id:o,georeference:r,name:s,shortName:s,scene:{polygons:e},elevation:a,scale:u,x_scale:u,layers:l,width:n.widthInMapUnits,height:n.heightInMapUnits}}l(sw,"processObstructions"),l(UG,"splitObstructionByAllEntrances"),l(VG,"isPolygonStyle"),l(XG,"splitObstructionByEntrance"),l(MN,"getStylesMap"),l(YG,"getEntranceMap"),y(),y(),l(IN,"findMapWithElevationClosestToZero"),l(g5,"validateStaticMVFFiles"),l(m5,"validateStaticMVFv1Files"),l(cT,"unzipMVFv1"),l(Aw,"unzipMVF"),l(fT,"getMapExtent"),l(y5,"convertMap");var Rw=class{constructor(t){D(this,"mapExtent"),D(this,"stretchRatio"),D(this,"midLat"),D(this,"midLong"),D(this,"mapUnitRatio",1e6),D(this,"latDistance"),D(this,"longDistance"),D(this,"mapScale"),D(this,"widthInMapUnits"),D(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:r,maxLong:i}=t,o=(e+r)/2,s=(n+i)/2,a=new Zr(o,i),l=new Zr(o,n),u=new Zr(e,s),c=new Zr(r,s);this.latDistance=u.distanceTo(c),this.longDistance=a.distanceTo(l);let h=this.latDistance/this.longDistance,p=(r-e)/(i-n);this.stretchRatio=h/p,this.midLat=o,this.midLong=s,this.widthInMapUnits=(i-n)*this.mapUnitRatio,this.heightInMapUnits=(r-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1],n=(t[0]-this.midLong)*this.mapUnitRatio,r=(this.midLat-e)*this.mapUnitRatio*this.stretchRatio;return{x:n+this.widthInMapUnits/2,y:r+this.heightInMapUnits/2}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:r}=this.mapExtent;return[[t,e],[t,r],[n,r],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};l(Rw,"CoordinateConverter");var Hm=Rw;function v5(t,e){let n=new Map,r=[];return t.features.forEach((t=>{let e=t.properties.id;e&&!n.has(e)&&n.set(e,t)})),n.forEach(((t,i)=>{let o=t.properties.map||"",s=e.get(o);if(s){let e=s.convert(t.geometry.coordinates),a=t.properties.externalId||"",l=[];t.properties.neighbors.forEach((t=>{var e;let r=null!=(e=t.weight)?e:0,i=n.get(t.id);i&&i.properties.map===o&&l.push({node:i.properties.id,map:i.properties.map,weight:r})})),r.push({id:i,map:o,externalId:a,paths:l,...e})}})),r}function _5(t,e,n){let r=[];return t.features.forEach((t=>{let i=n.convert(t.geometry.coordinates);r.push({id:t.properties.id,x:i.x,y:i.y,map:e,paths:t.properties.neighbors.map((t=>({node:t,map:e})))})})),r}l(v5,"convertNodes"),l(_5,"convertNodes_MVFv1");var uT=l(((t,e,n,r,i)=>{let o=[];return e.features.forEach(((s,a)=>{var l;if("Point"===s.geometry.type)return;let u="desk-entrance"===(null==(l=s.properties.kind)?void 0:l.toLowerCase()),c=(u?s.properties.externalId:s.properties.id)||"",h=s.properties.externalId||"",p=n.get(c)||[];if("destinationNodes"in s.properties&&s.properties.destinationNodes.forEach((e=>{p.push({map:t,id:e})})),u&&n.set(h,p),"LineString"===s.geometry.type)return;let f=r.get(s.properties.id),d=s.geometry.coordinates[0].map((t=>i.convert(t))),g=s.properties.center?i.convert(s.properties.center):void 0,y=s.geometry.coordinates.slice(1).map((t=>t.map((t=>i.convert(t))))),v=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3,m=s.properties.kind||"",_="void"===m.toLowerCase(),b=1-(a+1)/e.features.length*wN;o.push({entrances:p,map:t,id:c,externalId:h,layer:m,geometry:{visible:!_,position:{x:0,y:0,z:((null==f?void 0:f.altitude)||0)*i.mapScale/v},scale:{x:1,y:1,z:((null==f?void 0:f.height)||1)*i.mapScale/v*b}},material:{color:(null==f?void 0:f.color)||"#000000"},vertexes:d,center:g,holes:y})})),o}),"generateMappedinPolygons"),lT=l(((t,e,n)=>{let r=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let i=e.properties,o=e.geometry.coordinates[0].map((t=>n.convert(t))),s=e.geometry.coordinates.slice(1).map((t=>t.map((t=>n.convert(t))))),a=Math.max(n.widthInMapUnits,n.heightInMapUnits)/1e3,l=[];"entrances"in e.properties&&e.properties.entrances.forEach((t=>l.push({id:"n_"+t.id,map:t.level}))),r.push({entrances:null!=l?l:[],map:t,id:e.properties.id||"",externalId:e.properties.externalId||"",layer:e.properties.layer||"Polygon",geometry:{visible:!0,position:{x:0,y:0,z:((null==i?void 0:i.altitude)||0)*n.mapScale/a},scale:{x:1,y:1,z:((null==i?void 0:i.height)||1)*n.mapScale/a}},material:{color:(null==i?void 0:i.color)||"#000000"},vertexes:o,holes:s})})),r}),"generateMappedinPolygons_MVFv1");function b5(t,e,n,r,i,o){let s=uT(t,n,r,i,o),a=uT(t,e,r,i,o);return s.concat(a)}function x5(t){let e=[];return t.forEach((t=>{var n;e.push({id:t.id||"",name:t.externalId||"",type:t.type||"",weight:1e3,multiplier:1,nodes:t.nodes||[],accessible:null!=(n=t.accessible)&&n})})),e}function w5(t){let e=new Map;return t.features.forEach((t=>{var n,r,i,o,s,a,l;let u="",c=["n_".concat(t.properties.id)];t.properties.destinations.forEach((t=>{let e=t.split("-");u=e[0],c.push("n_".concat(e[1]))}));let h=null!=(r=null==(n=e.get(u))?void 0:n.nodes)?r:[],p=new Set([...h,...c]);e.set(u,{id:u,name:null!=(i=t.properties.name)?i:"",type:null!=(o=t.properties.type)?o:"",weight:null!=(s=t.properties.weight)?s:1e3,multiplier:null!=(a=t.properties.multiplier)?a:1,nodes:Array.from(p),accessible:null!=(l=t.properties.accessible)&&l})})),Array.from(e.values())}function pT(t,e){if(e)for(let n in e)e.hasOwnProperty(n)&&Object.assign(t[n],e[n]);return t}function Lw(t){let e=new TextDecoder,n=e.decode.bind(e);try{let e={"connection.json":JSON.parse(n(t["connection.json"])),"manifest.geojson":JSON.parse(n(t["manifest.geojson"])),"styles.json":JSON.parse(n(t["styles.json"])),"map.geojson":JSON.parse(n(t["map.geojson"])),"mapstack.geojson":JSON.parse(n(t["mapstack.geojson"])),"node.geojson":JSON.parse(n(t["node.geojson"])),obstruction:{},space:{},entrance:{},annotation:{}};if(null!=t.annotation){let r=Object.keys(t.annotation);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.annotation[r]=JSON.parse(n(t.annotation[i]))}}let r=Object.keys(t.space);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.space[r]=JSON.parse(n(t.space[i]))}let i=Object.keys(t.obstruction);for(let r of i){let i=r.replace(/\.json|\.geojson/g,"");e.obstruction[i]=JSON.parse(n(t.obstruction[r]))}let o=Object.keys(t.entrance);for(let r of o){let i=r.replace(/\.json|\.geojson/g,"");e.entrance[i]=JSON.parse(n(t.entrance[r]))}return e}catch(t){throw Ie.error(t),new Error("MVF parsing failed! Probably encountered a bad file.")}}function hT(t){let e=new TextDecoder,n=e.decode.bind(e);try{let e={"manifest.geojson":JSON.parse(n(t["manifest.geojson"])),"building.geojson":JSON.parse(n(t["building.geojson"])),"category.geojson":JSON.parse(n(t["category.geojson"])),"location.geojson":JSON.parse(n(t["location.geojson"])),obstruction:{},space:{},level:{},node:{},connection:{}},r=Object.keys(t.space);for(let i of r){let r=i.replace(/\.json|\.geojson/g,"");e.space[r]=JSON.parse(n(t.space[i]))}let i=Object.keys(t.obstruction);for(let r of i){let i=r.replace(/\.json|\.geojson/g,"");e.obstruction[i]=JSON.parse(n(t.obstruction[r]))}let o=Object.keys(t.node);for(let r of o){let i=r.replace(/\.json|\.geojson/g,"");e.node[i]=JSON.parse(n(t.node[r]))}let s=Object.keys(t.level);for(let r of s){let i=r.replace(/\.json|\.geojson/g,"");e.level[i]=JSON.parse(n(t.level[r]))}let a=Object.keys(t.connection);for(let r of a){let i=r.replace(/\.json|\.geojson/g,"");e.connection[i]=JSON.parse(n(t.connection[r]))}return e}catch(t){throw Ie.error(t),new Error("MVF parsing failed! Probably encountered a bad file.")}}function dT(t,e){var n;let r=null!=(n=e.properties.externalId)?n:"";return 0===r.length&&(r=e.properties.id),"location-".concat(t,"-").concat(r.toLowerCase().replace(" ","-"))}function gT(t,e){var n;let r=new Set;if("entrance"===t)r.add("Entrance");else if("obstruction"===t){let t=e.properties.kind;null!=t&&t.length>0&&r.add(t),e.properties.footprintComponent&&r.add("Exterior")}else if("space"===t){let t=e.properties.kind;null!=t&&t.length>0&&r.add("default"===t?"Room":t);let i=null!=(n=e.properties.tags)?n:[];if(i.length>0)for(let t of i)r.add(t)}return Array.from(r).filter((t=>t.length>0))}function mT(t){return"category-".concat(t.toLowerCase().replace(" ","-"))}function Tw(t,e,n){let r=gT(t,e);for(let t of r){let e=mT(t);null==n[e]&&(n[e]={id:e,name:t})}}function yT(t){var e,n,r;return null!=(r=null==(n=null==(e=null==t?void 0:t.properties)?void 0:e.kind)?void 0:n.startsWith("connection"))&&r}function E5(t){var e;let n=null!=(e=t.properties.externalId)?e:"";return yT(t)&&0===n.length&&(n="unnamed-connection-"+t.properties.id),n}function lh(t,e,n,r){var i;if((null==e.properties.externalId||0===e.properties.externalId.length)&&!yT(e)||"obstruction"===t&&"desks"!==(null==(i=e.properties.kind)?void 0:i.toLowerCase()))return;let o=E5(e),s=dT(t,e);if(null==r[s]){let t={id:s,type:"",name:o,nodes:[],polygons:[],categories:[]};r[s]=t}if("space"===t||"obstruction"===t){let t={map:n.id,id:e.properties.id};r[s].polygons.push(t)}if("destinationNodes"in e.properties&&e.properties.destinationNodes.forEach((t=>{let e={map:n.id,node:t};r[s].nodes.push(e)})),"node"in e.properties&&e.properties.node){let t={map:n.id,node:e.properties.node};r[s].nodes.push(t)}let a=gT(t,e);for(let t of a){let e=mT(t);r[s].categories.push(e)}}function M5(t,e=new Map){var n,r,i,o,s,a,l,u,c;let h={},p={},{space:f,"map.geojson":d,entrance:g,obstruction:y}=t;for(let t of d){let d=null!=(r=null==(n=f[t.id])?void 0:n.features)?r:[],v=null!=(o=null==(i=g[t.id])?void 0:i.features)?o:[],m=null!=(a=null==(s=y[t.id])?void 0:s.features)?a:[];for(let e of d)["Polygon","Point"].includes(e.geometry.type)&&"hallway"!==(null==(l=e.properties.kind)?void 0:l.toLowerCase())&&(Tw("space",e,p),lh("space",e,t,h));let _=new Map;for(let e of v)_.set(e.properties.id,e),e.properties.externalId&&(Tw("entrance",e,p),lh("entrance",e,t,h));let b={type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{id:"footprintComponent",externalId:"footprintComponent",node:void 0,metadata:void 0}};lh("entrance",b,t,h);for(let n of m){if(Tw("obstruction",n,p),lh("obstruction",n,t,h),n.properties.footprintComponent){let e=n.properties.entrances;for(let n of e){let e=_.get(n);e&&lh("entrance",{...e,properties:{...e.properties,externalId:b.properties.externalId}},t,h)}}if("desks"===(null==(u=n.properties.kind)?void 0:u.toLowerCase())&&n.properties.externalId.length>0){let t=null!=(c=e.get(n.properties.id))?c:[];for(let e of t){let t=dT("obstruction",n);null!=h[t]&&h[t].nodes.push({map:e.map,node:e.id})}}}}return{locations:Object.values(h),categories:Object.values(p)}}function vT(t){var e,n,r,i,o,s,a,l,u,c;let h=null!=(e=t.obstruction)?e:[],p=null!=(n=t.space)?n:[],f=null!=(r=t.entrance)?r:[],d=null!=(i=t["mapstack.geojson"])?i:[],g=null!=(o=t["map.geojson"])?o:[],y=null!=(s=t["styles.json"])?s:{},v=null!=(a=t["manifest.geojson"])?a:{},m=null!=(l=t["node.geojson"])?l:[],_=null!=(u=t["connection.json"])?u:[],b={},w=new Map,x=[],E=MN(y),I=new Map,S=new Map;g.forEach((t=>{let e=t.id;e&&!S.has(e)&&S.set(e,t)})),d.forEach((({maps:t})=>{t.forEach((t=>{if(!S.has(t))return;let e=sw(h[t],f[t],E);if(e.features.length){let n=fT(e),r=new Hm(n);w.set(t,r),b[t]=b5(t,e,p[t],I,E,r),x.push(y5(S.get(t),b[t],r))}}))})),x.sort(((t,e)=>"number"==typeof t.elevation&&"number"==typeof e.elevation?t.elevation-e.elevation:0));let N=Object.values(b).flat(),M=x5(_),C=v5(m,w),O=v.features[0],P=O.properties.name,A=O.geometry.coordinates[0],D=O.geometry.coordinates[1],T=(null==(c=IN(x))?void 0:c.id)||"",{locations:L,categories:R}=M5(t,I);return{polygons:N,venue:{name:P,latitude:D,longitude:A,defaultMap:T},maps:x,vortexes:M,nodes:C,locations:L,mapGroups:[],locationStates:[],categories:R,themes:[],imageBinaries:new Map}}function _T(t){var e,n,r,i,o,s,a;let l=null!=(e=t.obstruction)?e:{},u=null!=(n=t.space)?n:{},c=null!=(r=t.node)?r:{},h=null!=(i=t.level)?i:{},p=null!=(o=t["manifest.geojson"])?o:{},f=null!=(s=t.connection)?s:{},d={},g=new Map,y=[],v=[],m=[];Object.keys(h).forEach((t=>{let e=sw(l[t],{type:"FeatureCollection",features:[]});if(e.features.length){let n=fT(e),r=new Hm(n);g.set(t,r);let i=lT(t,u[t],r),o=lT(t,e,r);d[t]=i.concat(o),v=v.concat(_5(c[t],t,r)),y.push(I5(h[t],d[t],r))}m=m.concat(w5(f[t]))}));let _=Object.values(d).flat(),b=p.features[0],w=b.properties.name,x=b.geometry.coordinates[0],E=b.geometry.coordinates[1],I=(null==(a=y[0])?void 0:a.id)||"",S=new Map;_.forEach((t=>S.set(t.id,t)));let N=[],M=t["location.geojson"].features.map((t=>{if(t.properties.spaces){let e=t.properties.spaces.map((t=>t.id)).map((t=>S.get(t))).filter((t=>t));if(e){let t=[];e.forEach((e=>{t.push(...e.entrances.map((t=>({node:t.id,map:t.level}))))})),N=t}}return{...t.properties,nodes:N,polygons:t.properties.spaces}})),C=t["category.geojson"].features.map((t=>t.properties));return{polygons:_,venue:{name:w,latitude:E,longitude:x,defaultMap:I},maps:y,vortexes:m,nodes:v,locations:M,mapGroups:[],locationStates:[],categories:C,themes:[],imageBinaries:new Map}}function I5(t,e,n){let r=n.createGeoreferences(),i=new Set,o=t.features[0].properties;e.forEach((t=>{t.layer&&i.add(t.layer)}));let s=[...i].map((t=>({id:t,visible:!0}))),a=1/n.mapScale;return{id:o.id,georeference:r,name:o.name,shortName:o.abbreviation||o.name,scene:{polygons:e},elevation:o.elevation,scale:a,x_scale:a,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits}}l(b5,"convertPolygons"),l(x5,"convertVortexes"),l(w5,"convertVortexes_MVFv1"),l(pT,"overrideMVF"),l(Lw,"parseMVF"),l(hT,"parseMVFv1"),l(dT,"getLocationId"),l(gT,"getFeatureCategories"),l(mT,"getCategoryIdFromName"),l(Tw,"mutateCategoriesWithNewFeature"),l(yT,"isFeatureConnection"),l(E5,"getLocationLabel"),l(lh,"mutateLocationsWithNewFeature"),l(M5,"createMetaDataFromMVF"),l(vT,"convertMVFToMappedin"),l(_T,"convertMVFv1ToMappedin"),l(I5,"convertMap_MVFv1"),y();var jT,ch,oc,ac,fh,sc,uc,lc,Ds,cc,fc,pc,ph,hc,Lu,zT=er(BT()),R5=null==(jT=null==C?void 0:C.env)?void 0:jT.npm_package_version,$m=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk"],Bw=$m[0],D5=!1,Vo=class t{constructor(t){var e;oe(this,ch,void 0),oe(this,oc,void 0),oe(this,ac,void 0),oe(this,fh,void 0),oe(this,sc,void 0),oe(this,uc,void 0),oe(this,lc,void 0),oe(this,Ds,void 0),oe(this,cc,void 0),oe(this,fc,void 0),oe(this,pc,void 0),oe(this,ph,void 0),oe(this,hc,void 0),oe(this,Lu,void 0),le(this,Ds,t.clientId),le(this,cc,t.clientSecret),le(this,fc,t.accessToken),le(this,lc,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!B(this,lc)&&B(this,Ds)&&!Eg(B(this,Ds))&&(n="https://web-proxy.mappedin.com/a/"),le(this,ac,n),le(this,ac,B(this,ac)+(t.venue+"/")),le(this,hc,t.venue),le(this,oc,!1),le(this,ch,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),le(this,fh,$m.find((e=>e===t.context))||$m[0]),le(this,sc,vg()),le(this,uc,_g()),le(this,pc,new Set),le(this,ph,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=gl(this.getDirections.bind(this),2500)}static create(e){return t.instance||(t.instance=new t(e)),t.instance}track(t,e){let n={...e,g:B(this,oc)};B(this,Lu)&&(n={...n,...B(this,Lu)});let r=B(this,ac)+t+"?"+zT.default.stringify(n,{skipEmptyString:!0,skipNull:!0});if(D5&&Ie.log("Analytics.track",r),B(this,ch))return;let i={"mi-context":Bw||B(this,fh),"mi-session":B(this,uc),"mi-device":B(this,sc),"mappedin-sdk-version":R5,"mappedin-platform-version":B(this,ph)};B(this,fc)?i.Authorization="Bearer ".concat(B(this,fc)):B(this,lc)||B(this,cc)&&B(this,Ds)&&(i["x-mappedin-key"]=btoa(B(this,Ds)),i["x-mappedin-secret"]=btoa(B(this,cc))),Oi()(r,{method:"GET",mode:"cors",headers:i})}updateAnalyticsUserPosition(t){le(this,Lu,t?{...t,bluedotTimestamp:Date.now()}:void 0)}locationSelected(t){let e=t.id||t;Nr.addPendingEvent(new tf({venue:B(this,hc)})),this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;Nr.addPendingEvent(new ef({venue:B(this,hc)})),this.track("select-category",{id:e})}mapViewLoaded(t,e,n,r){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return B(this,uc)}getDeviceID(){return B(this,sc)}setGeolocationMode(t){le(this,oc,t)}trackBlueDotEvent(e){e&&Object.values(t.BLUEDOT_EVENT).includes(e)&&!B(this,pc).has(e)&&(this.track(e),B(this,pc).add(e))}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=$m.find((e=>e===t));e&&(Bw=e)}static clearContext(){Bw=void 0}static destroy(){t.instance=null}};ch=new WeakMap,oc=new WeakMap,ac=new WeakMap,fh=new WeakMap,sc=new WeakMap,uc=new WeakMap,lc=new WeakMap,Ds=new WeakMap,cc=new WeakMap,fc=new WeakMap,pc=new WeakMap,ph=new WeakMap,hc=new WeakMap,Lu=new WeakMap,l(Vo,"Analytics"),D(Vo,"instance",null),D(Vo,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var jw=Vo,hh=jw;y();var zw=class{constructor(){D(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach((function(t){"function"==typeof t&&t(e)}))}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||null==this._subscribers[t])return;let n=this._subscribers[t].indexOf(e);-1!==n&&this._subscribers[t].splice(n,1)}destroy(){this._subscribers={}}};l(zw,"PubSub");var Za,dc,Ru,gc,dh,qw,Jm,qT,Km=zw,Gw={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},Uw=class extends Km{constructor(t){super(),oe(this,dh),oe(this,Jm),D(this,"perspective"),D(this,"things"),D(this,"options"),oe(this,Za,void 0),oe(this,dc,""),D(this,"updatedAt"),D(this,"categories",[]),D(this,"locations",[]),D(this,"vortexes",[]),D(this,"maps",[]),D(this,"nodes",[]),D(this,"polygons",[]),D(this,"venue",{}),D(this,"events",[]),D(this,"mapGroups",[]),D(this,"themes",[]),D(this,"locationStates",[]),D(this,"rankings"),D(this,"currentLanguage"),oe(this,Ru,{}),D(this,"_categoriesById"),D(this,"_locationsById"),D(this,"_vortexesById"),D(this,"_mapsById"),D(this,"_nodesById"),D(this,"_polygonsById"),D(this,"_eventsById"),D(this,"_mapGroupsById"),D(this,"_locationStatesById"),D(this,"_locationRankingsById"),D(this,"_rankingsById"),D(this,"_categoriesByExternalId"),D(this,"_locationsByExternalId"),D(this,"_vortexesByExternalId"),D(this,"_mapsByExternalId"),D(this,"_nodesByExternalId"),D(this,"_polygonsByExternalId"),D(this,"_eventsByExternalId"),D(this,"_mapGroupsByExternalId"),D(this,"_locationStatesByExternalId"),D(this,"_locationRankingsByExternalId"),D(this,"_rankingsByExternalId"),oe(this,gc,void 0),D(this,"images"),D(this,"imageBinaries"),D(this,"scenes"),D(this,"analytics"),D(this,"navigator"),this.options=t,le(this,Za,ri.create(this));let e=hh.create({...t,testMode:!(null!=t&&t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(DM,"true")}})}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,"_".concat(n,"ByExternalId"),{configurable:!0,get(){let t=B(this,Za)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),B(this,Za)[n]=e,e}}),Object.defineProperty(this,"_".concat(n,"ById"),{configurable:!0,get(){let t=B(this,Za)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),B(this,Za)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n="_".concat(t,"ById"),r="_".concat(t,"ByExternalId"),i=this[n];return null!=i&&null!=i[e]||(i=this[r],null!=i&&null!=i[e])?i[e]:null}async hydrateFromMVF(t){let e=vT(t);return this.hydrate(e)}async hydrateFromMVFv1(t){let e=_T(t);return this.hydrate(e)}async changeLanguage(t,e=!0){var n;if(this.currentLanguage.code!==t){if(null==(n=this.venue.languages)||!n.find((e=>e.code===t)))return void Ie.error("Language ".concat(t," not found in venue ").concat(this.venue.slug));if(e&&!B(this,Ru)[this.currentLanguage.code]&&(B(this,Ru)[this.currentLanguage.code]=JSON.stringify(this.toJSON())),ri.clearInstance(this),le(this,Za,ri.create(this)),this.currentLanguage=this.venue.languages.find((e=>e.code===t)),null!=B(this,Ru)[t]){let e=JSON.parse(B(this,Ru)[t]);await this.hydrate(e)}else this.options.language=this.currentLanguage.code,await this.fetch();this.publish(0,this.currentLanguage)}}async hydrate(t,e){let n;if("string"==typeof t)try{le(this,dc,t),n=JSON.parse(t)}catch(t){return void Ie.error("Unable to parse JSON",t)}else n=t,le(this,dc,JSON.stringify(n));let r=Object.keys(n);for(let t=0,e=r.length;t<e;++t){let e=r[t],i=n[e];null!=yu[e]&&"function"==typeof yu[e].hydrate&&(this[e]=yu[e].hydrate(i,this))}e&&await iS(n);let{images:i,scenes:o,imageBinaries:s}=n;this.images=i,this.scenes=o,this.imageBinaries=s,this.generateGetters(r),wr(this,dh,qw).call(this),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Eg(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,r=n.length;t<r;++t){let r=n[t];yu[r]&&e.push(yu[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return e.push(pl(this.options,"cdn-access-token",{venue:this.options.venue},!1).then((t=>le(this,gc,t.token)),(()=>Promise.resolve()))),this.generateGetters(n),Promise.all(e).then((()=>{var t;this.currentLanguage=this.currentLanguage||(null==(t=this.venue.languages)?void 0:t.find((t=>t.code===this.options.language)))||this.venue.defaultLanguage,wr(this,dh,qw).call(this),this.initNavigator()}))}initNavigator(){this.navigator=new iv({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON())),polygons:this.polygons.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in yu)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n={...e,venue:this.venue.toJSON()};return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return B(this,dc)||JSON.stringify(this.toJSON())}};Za=new WeakMap,dc=new WeakMap,Ru=new WeakMap,gc=new WeakMap,dh=new WeakSet,qw=l((function(){B(this,gc)&&this.maps.forEach((t=>{var e;null!=(e=t.scene)&&e.polygons&&(t.scene.polygons+="?".concat(B(this,gc)))})),wr(this,Jm,qT).call(this)}),"#transformData"),Jm=new WeakSet,qT=l((function(){let t=this.categories.filter((t=>t.sortOrder)).map((t=>t.sortOrder));if(t.length<=0)return;let e=Math.min(...t),n=Math.max(...t);this.polygons.forEach((t=>{var r,i;let o=aS(t,this);if(o){let s=o.categories.filter((t=>t.sortOrder)).map((t=>t.sortOrder));if(s.length>0){let o=Math.min(...s);t.categoryRank=oS(o,e,n,null!=(i=null==(r=t.rank)?void 0:r.score)?i:0)}}}))}),"#applyCategoryRankToPolygons"),l(Uw,"Mappedin");var Vi=Uw;y();var GT={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId","secureContentStorage","languages","topLocations","defaultLanguage"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances","material"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery","showSmartLabelWhenImagePresent","amenity"],categories:["name","color","sortOrder","parents","icon","iconFromDefaultList"],maps:["name","subtitle","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};y(),y();var fn=l((function(){return fn=Object.assign||l((function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}),"__assign"),fn.apply(this,arguments)}),"__assign");function Wt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}l(Wt,"__values"),l($n,"__read");var gh,F5="ENTRIES",$T="KEYS",KT="VALUES",Kn="",Vw=function(){function t(t,e){var n=t._tree,r=Array.from(n.keys());this.set=t,this._type=e,this._path=r.length>0?[{node:n,keys:r}]:[]}return l(t,"TreeIterator"),t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=mc(this._path),e=t.node,n=t.keys;if(mc(n)===Kn)return{done:!1,value:this.result()};var r=e.get(mc(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=mc(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return mc(e)})).filter((function(t){return t!==Kn})).join("")},t.prototype.value=function(){return mc(this._path).node.get(Kn)},t.prototype.result=function(){switch(this._type){case KT:return this.value();case $T:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),mc=l((function(t){return t[t.length-1]}),"last$1"),B5=l((function(t,e,n){var r=new Map;if(void 0===e)return r;for(var i=e.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1),a=0;a<i;++a)s[a]=a;for(var l=1;l<o;++l)s[l*i]=l;return JT(t,e,n,r,s,1,i,""),r}),"fuzzySearch"),JT=l((function(t,e,n,r,i,o,s,a){var l,u,c=o*s;try{t:for(var h=Wt(t.keys()),p=h.next();!p.done;p=h.next()){var f=p.value;if(f===Kn){var d=i[c-1];d<=n&&r.set(a,[t.get(f),d])}else{for(var g=o,y=0;y<f.length;++y,++g){for(var v=f[y],m=s*g,_=m-s,b=i[m],w=Math.max(0,g-n-1),x=Math.min(s-1,g+n),E=w;E<x;++E){var I=v!==e[E],S=i[_+E]+ +I,N=i[_+E+1]+1,M=i[m+E]+1,C=i[m+E+1]=Math.min(S,N,M);C<b&&(b=C)}if(b>n)continue t}JT(t.get(f),e,n,r,i,g,s,a+f)}}}catch(t){l={error:t}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(l)throw l.error}}}),"recurse"),Xw=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return l(t,"SearchableMap"),t.prototype.atPrefix=function(e){var n,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var i=$n(Qm(this._tree,e.slice(this._prefix.length)),2),o=i[0],s=i[1];if(void 0===o){var a=$n(Kw(s),2),l=a[0],u=a[1];try{for(var c=Wt(l.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;if(p!==Kn&&p.startsWith(u)){var f=new Map;return f.set(p.slice(u.length),l.get(p)),new t(f,e)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}return new t(o,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,j5(this._tree,t)},t.prototype.entries=function(){return new Vw(this,F5)},t.prototype.forEach=function(t){var e,n;try{for(var r=Wt(this),i=r.next();!i.done;i=r.next()){var o=$n(i.value,2);t(o[0],o[1],this)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return B5(this._tree,t,e)},t.prototype.get=function(t){var e=$w(this._tree,t);return void 0!==e?e.get(Kn):void 0},t.prototype.has=function(t){var e=$w(this._tree,t);return void 0!==e&&e.has(Kn)},t.prototype.keys=function(){return new Vw(this,$T)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,Yw(this._tree,t).set(Kn,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=Yw(this._tree,t);return n.set(Kn,e(n.get(Kn))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=Yw(this._tree,t),r=n.get(Kn);return void 0===r&&n.set(Kn,r=e()),r},t.prototype.values=function(){return new Vw(this,KT)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var o=Wt(e),s=o.next();!s.done;s=o.next()){var a=$n(s.value,2),l=a[0],u=a[1];i.set(l,u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),Qm=l((function(t,e,n){var r,i;if(void 0===n&&(n=[]),0===e.length||null==t)return[t,n];try{for(var o=Wt(t.keys()),s=o.next();!s.done;s=o.next()){var a=s.value;if(a!==Kn&&e.startsWith(a))return n.push([t,a]),Qm(t.get(a),e.slice(a.length),n)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return n.push([t,e]),Qm(void 0,"",n)}),"trackDown"),$w=l((function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=Wt(t.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;if(s!==Kn&&e.startsWith(s))return $w(t.get(s),e.slice(s.length))}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"lookup"),Yw=l((function(t,e){var n,r,i=e.length;t:for(var o=0;t&&o<i;){try{for(var s=(n=void 0,Wt(t.keys())),a=s.next();!a.done;a=s.next()){var l=a.value;if(l!==Kn&&e[o]===l[0]){for(var u=Math.min(i-o,l.length),c=1;c<u&&e[o+c]===l[c];)++c;var h=t.get(l);if(c===l.length)t=h;else{var p=new Map;p.set(l.slice(c),h),t.set(e.slice(o,o+c),p),t.delete(l),t=p}o+=c;continue t}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}var f=new Map;return t.set(e.slice(o),f),f}return t}),"createPath"),j5=l((function(t,e){var n=$n(Qm(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(Kn),0===r.size)ZT(i);else if(1===r.size){var o=$n(r.entries().next().value,2),s=o[0],a=o[1];QT(i,s,a)}}),"remove"),ZT=l((function(t){if(0!==t.length){var e=$n(Kw(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)ZT(t.slice(0,-1));else if(1===n.size){var i=$n(n.entries().next().value,2),o=i[0],s=i[1];o!==Kn&&QT(t.slice(0,-1),o,s)}}}),"cleanup"),QT=l((function(t,e,n){if(0!==t.length){var r=$n(Kw(t),2),i=r[0],o=r[1];i.set(o+e,n),i.delete(o)}}),"merge"),Kw=l((function(t){return t[t.length-1]}),"last"),Jw="or",z5="and",q5="and_not",Du=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=fn(fn(fn({},Hw),t),{searchOptions:fn(fn({},XT),t.searchOptions||{})}),this._index=new Xw,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return l(t,"MiniSearch"),t.prototype.add=function(t){var e,n,r,i,o=this._options,s=o.extractField,a=o.tokenize,l=o.processTerm,u=o.fields,c=o.idField,h=s(t,c);if(null==h)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(h);this.saveStoredFields(p,t);try{for(var f=Wt(u),d=f.next();!d.done;d=f.next()){var g=d.value,y=s(t,g);if(null!=y){var v=a(y.toString(),g),m=this._fieldIds[g],_=new Set(v).size;this.addFieldLength(p,m,this._documentCount-1,_);try{for(var b=(r=void 0,Wt(v)),w=b.next();!w.done;w=b.next()){var x=l(w.value,g);x&&this.addTerm(m,p,x)}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.addAll=function(t){var e,n;try{for(var r=Wt(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.add(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var r=e.chunkSize,i=void 0===r?10:r,o={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,r){var o=t.chunk,s=t.promise;return o.push(e),(r+1)%i==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(o)}))}:{chunk:o,promise:s}}),o),a=s.chunk;return s.promise.then((function(){return n.addAll(a)}))},t.prototype.remove=function(t){var e,n,r,i,o,s,a=this._options,l=a.tokenize,u=a.processTerm,c=a.extractField,h=a.fields,p=a.idField,f=c(t,p);if(null==f)throw new Error('MiniSearch: document does not have ID field "'.concat(p,'"'));try{for(var d=Wt(this._documentIds),g=d.next();!g.done;g=d.next()){var y=$n(g.value,2),v=y[0];if(f===y[1]){try{for(var m=(r=void 0,Wt(h)),_=m.next();!_.done;_=m.next()){var b=_.value,w=c(t,b);if(null!=w){var x=l(w.toString(),b),E=this._fieldIds[b],I=new Set(x).size;this.removeFieldLength(v,E,this._documentCount,I);try{for(var S=(o=void 0,Wt(x)),N=S.next();!N.done;N=S.next()){var M=u(N.value,b);M&&this.removeTerm(E,v,M)}}catch(t){o={error:t}}finally{try{N&&!N.done&&(s=S.return)&&s.call(S)}finally{if(o)throw o.error}}}}}catch(t){r={error:t}}finally{try{_&&!_.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return this._storedFields.delete(v),this._documentIds.delete(v),this._fieldLength.delete(v),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(f,": it is not in the index"))},t.prototype.removeAll=function(t){var e,n;if(t)try{for(var r=Wt(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.remove(o)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Xw,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},t.prototype.search=function(t,e){var n,r;void 0===e&&(e={});var i=this.executeQuery(t,e),o=[];try{for(var s=Wt(i),a=s.next();!a.done;a=s.next()){var l=$n(a.value,2),u=l[0],c=l[1],h=c.score,p=c.terms,f=c.match,d=p.length,g={id:this._documentIds.get(u),score:h*d,terms:Object.keys(f),match:f};Object.assign(g,this._storedFields.get(u)),(null==e.filter||e.filter(g))&&o.push(g)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o.sort(WT),o},t.prototype.autoSuggest=function(t,e){var n,r,i,o;void 0===e&&(e={}),e=fn(fn({},Y5),e);var s=new Map;try{for(var a=Wt(this.search(t,e)),l=a.next();!l.done;l=a.next()){var u=l.value,c=u.score,h=(m=u.terms).join(" ");null!=(y=s.get(h))?(y.score+=c,y.count+=1):s.set(h,{score:c,terms:m,count:1})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var p=[];try{for(var f=Wt(s),d=f.next();!d.done;d=f.next()){var g=$n(d.value,2),y=g[0],v=g[1],m=(c=v.score,v.terms),_=v.count;p.push({suggestion:y,terms:m,score:c/_})}}catch(t){i={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}return p.sort(WT),p},Object.defineProperty(t.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),t.loadJSON=function(e,n){if(null==n)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return t.loadJS(JSON.parse(e),n)},t.getDefault=function(t){if(Hw.hasOwnProperty(t))return Ww(Hw,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},t.loadJS=function(e,n){var r,i,o,s,a=e.index,l=e.documentCount,u=e.nextId,c=e.documentIds,h=e.fieldIds,p=e.fieldLength,f=e.averageFieldLength,d=e.storedFields,g=e.serializationVersion;if(1!==g&&2!==g)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var y=new t(n);y._documentCount=l,y._nextId=u,y._documentIds=Zm(c),y._fieldIds=h,y._fieldLength=Zm(p),y._avgFieldLength=f,y._storedFields=Zm(d),y._index=new Xw;try{for(var v=Wt(a),m=v.next();!m.done;m=v.next()){var _=$n(m.value,2),b=_[0],w=_[1],x=new Map;try{for(var E=(o=void 0,Wt(Object.keys(w))),I=E.next();!I.done;I=E.next()){var S=I.value,N=w[S];1===g&&(N=N.ds),x.set(parseInt(S,10),Zm(N))}}catch(t){o={error:t}}finally{try{I&&!I.done&&(s=E.return)&&s.call(E)}finally{if(o)throw o.error}}y._index.set(b,x)}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}return y},t.prototype.executeQuery=function(t,e){var n=this;if(void 0===e&&(e={}),"string"!=typeof t){var r=fn(fn(fn({},e),t),{queries:void 0}),i=t.queries.map((function(t){return n.executeQuery(t,r)}));return this.combineResults(i,t.combineWith)}var o=this._options,s=o.tokenize,a=o.processTerm,l=o.searchOptions,u=fn(fn({tokenize:s,processTerm:a},l),e),c=u.tokenize,h=u.processTerm,p=c(t).map((function(t){return h(t)})).filter((function(t){return!!t})).map(X5(u)).map((function(t){return n.executeQuerySpec(t,u)}));return this.combineResults(p,u.combineWith)},t.prototype.executeQuerySpec=function(t,e){var n,r,i,o,s,a,l=fn(fn({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return fn(fn({},t),((n={})[e]=Ww(t,e)||1,n))}),l.boost||{}),c=l.boostDocument,h=l.weights,p=l.maxFuzzy,f=fn(fn({},XT.weights),h),d=f.fuzzy,g=f.prefix,y=this._index.get(t.term),v=this.termResults(t.term,t.term,1,y,u,c);if(t.prefix&&(s=this._index.atPrefix(t.term)),t.fuzzy){var m=!0===t.fuzzy?.2:t.fuzzy,_=m<1?Math.min(p,Math.round(t.term.length*m)):m;_&&(a=this._index.fuzzyGet(t.term,_))}if(s)try{for(var b=Wt(s),w=b.next();!w.done;w=b.next()){var x=$n(w.value,2),E=x[0],I=x[1];if(C=E.length-t.term.length){null==a||a.delete(E);var S=g*E.length/(E.length+.3*C);this.termResults(t.term,E,S,I,u,c,v)}}}catch(t){n={error:t}}finally{try{w&&!w.done&&(r=b.return)&&r.call(b)}finally{if(n)throw n.error}}if(a)try{for(var N=Wt(a.keys()),M=N.next();!M.done;M=N.next()){E=M.value;var C,O=$n(a.get(E),2),P=O[0];if(C=O[1]){S=d*E.length/(E.length+C);this.termResults(t.term,E,S,P,u,c,v)}}}catch(t){i={error:t}}finally{try{M&&!M.done&&(o=N.return)&&o.call(N)}finally{if(i)throw i.error}}return v},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=Jw),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(G5[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var o=Wt(this._index),s=o.next();!s.done;s=o.next()){var a=$n(s.value,2),l=a[0],u=a[1],c={};try{for(var h=(n=void 0,Wt(u)),p=h.next();!p.done;p=h.next()){var f=$n(p.value,2),d=f[0],g=f[1];c[d]=Object.fromEntries(g)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}i.push([l,c])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:i,serializationVersion:2}},t.prototype.termResults=function(t,e,n,r,i,o,s){var a,l,u,c,h;if(void 0===s&&(s=new Map),null==r)return s;try{for(var p=Wt(Object.keys(i)),f=p.next();!f.done;f=p.next()){var d=f.value,g=i[d],y=this._fieldIds[d],v=r.get(y);if(null!=v){var m=v.size,_=this._avgFieldLength[y];try{for(var b=(u=void 0,Wt(v.keys())),w=b.next();!w.done;w=b.next()){var x=w.value,E=o?o(this._documentIds.get(x),e):1;if(E){var I=v.get(x),S=this._fieldLength.get(x)[y],N=n*g*E*V5(I,m,this._documentCount,S,_),M=s.get(x);if(M){M.score+=N,W5(M.terms,t);var C=Ww(M.match,e);C?C.push(d):M.match[e]=[d]}else s.set(x,{score:N,terms:[t],match:(h={},h[e]=[d],h)})}}}catch(t){u={error:t}}finally{try{w&&!w.done&&(c=b.return)&&c.call(b)}finally{if(u)throw u.error}}}}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}return s},t.prototype.addTerm=function(t,e,n){var r=this._index.fetch(n,HT),i=r.get(t);if(null==i)(i=new Map).set(e,1),r.set(t,i);else{var o=i.get(e);i.set(e,(o||0)+1)}},t.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var r=this._index.fetch(n,HT),i=r.get(t);null==i||null==i.get(e)?this.warnDocumentChanged(e,t,n):i.get(e)<=1?i.size<=1?r.delete(t):i.delete(e):i.set(e,i.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},t.prototype.warnDocumentChanged=function(t,e,n){var r,i;if(null!=console&&null!=console.warn)try{for(var o=Wt(Object.keys(this._fieldIds)),s=o.next();!s.done;s=o.next()){var a=s.value;if(this._fieldIds[a]===e)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(n,'" was not present in field "').concat(a,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},t.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},t.prototype.addFieldLength=function(t,e,n,r){var i=this._fieldLength.get(t);null==i&&this._fieldLength.set(t,i=[]),i[e]=r;var o=(this._avgFieldLength[e]||0)*n+r;this._avgFieldLength[e]=o/(n+1)},t.prototype.removeFieldLength=function(t,e,n,r){var i=this._avgFieldLength[e]*n-r;this._avgFieldLength[e]=i/(n-1)},t.prototype.saveStoredFields=function(t,e){var n,r,i=this._options,o=i.storeFields,s=i.extractField;if(null!=o&&0!==o.length){var a=this._storedFields.get(t);null==a&&this._storedFields.set(t,a={});try{for(var l=Wt(o),u=l.next();!u.done;u=l.next()){var c=u.value,h=s(e,c);void 0!==h&&(a[c]=h)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},t}(),Ww=l((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),G5=((gh={})[Jw]=function(t,e){var n,r;try{for(var i=Wt(e.keys()),o=i.next();!o.done;o=i.next()){var s=o.value,a=t.get(s);if(null==a)t.set(s,e.get(s));else{var l=e.get(s),u=l.score,c=l.terms,h=l.match;a.score=a.score+u,a.match=Object.assign(a.match,h),YT(a.terms,c)}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},gh[z5]=function(t,e){var n,r,i=new Map;try{for(var o=Wt(e.keys()),s=o.next();!s.done;s=o.next()){var a=s.value,l=t.get(a);if(null!=l){var u=e.get(a),c=u.score,h=u.terms,p=u.match;YT(l.terms,h),i.set(a,{score:l.score+c,terms:l.terms,match:Object.assign(l.match,p)})}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},gh[q5]=function(t,e){var n,r;try{for(var i=Wt(e.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;t.delete(s)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},gh),UT=1.2,VT=.7,U5=.5,V5=l((function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(U5+t*(UT+1)/(t+UT*(1-VT+VT*r/i)))}),"calcBM25Score"),X5=l((function(t){return function(e,n,r){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,r):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,r):!0===t.prefix}}}),"termToQuerySpec"),Hw={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(H5)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},XT={combineWith:Jw,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},Y5={prefix:function(t,e,n){return e===n.length-1}},W5=l((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),YT=l((function(t,e){var n,r;try{for(var i=Wt(e),o=i.next();!o.done;o=i.next()){var s=o.value;t.includes(s)||t.push(s)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}),"assignUniqueTerms"),WT=l((function(t,e){var n=t.score;return e.score-n}),"byScore"),HT=l((function(){return new Map}),"createMap"),Zm=l((function(t){var e,n,r=new Map;try{for(var i=Wt(Object.keys(t)),o=i.next();!o.done;o=i.next()){var s=o.value;r.set(parseInt(s,10),t[s])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}),"objectToNumericMap"),H5=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;y();var $5=["0","1","2","3","4","5","6","7","8","9"],K5=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],J5=["0","1","2","3","4","5","6","7","8","9"],Z5=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],vNe=[...$5,...K5,...J5,...Z5],eA=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];y();var Q5=32,Ai=!1,e8=120,Zw=0,eE=class{constructor(t){D(this,"_callback"),D(this,"_frameCount"),D(this,"_ordering"),D(this,"_supersededBy"),D(this,"name"),D(this,"_remainingFrameCount"),D(this,"_lastFrameTime"),D(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,Ai&&Ie.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};l(eE,"FrameUpdate");var ey=eE,tE=class{constructor(t){if(D(this,"_postponed"),D(this,"userdata"),D(this,"_priority"),D(this,"_group"),D(this,"name"),D(this,"_lastFrameTime"),D(this,"_callback"),D(this,"_complete"),D(this,"_scheduled"),D(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata||{},this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,Ai&&Ie.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};l(tE,"FrameTask");var Qa=tE,rE=class{constructor(t){D(this,"_postponed"),D(this,"_onComplete"),D(this,"_priority"),D(this,"userdata"),D(this,"name"),D(this,"_tasks"),D(this,"_scheduledTasks"),D(this,"_scheduled"),D(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,Ai&&Ie.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}};l(rE,"FrameTaskGroup");var ty=rE,nE=class{constructor(t){D(this,"_maxMillisecondsPerFrame"),D(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Q5,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};l(nE,"RealTimeTimer");var Qw=nE,iE=class{constructor(t){var e;D(this,"_raf"),D(this,"options"),D(this,"_timer"),D(this,"_performance"),D(this,"_scheduledUpdatesByOrdering"),D(this,"_scheduledTasksByPriority"),D(this,"_postponedTasks"),D(this,"_requestAnimationFrameHandle"),D(this,"_updatesToRunThisFrame"),D(this,"_lastFrameTime",0),D(this,"_updatesRunLastFrame"),this.options=t,this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Qw,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new yc,this._scheduledTasksByPriority=new yc,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Ai&&Ie.log("task scheduler instantiated"),null!=(e=globalThis.MappedinDebug)&&e.TEST_IOS&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new yc,this._scheduledTasksByPriority=new yc,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Ai&&Ie.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){var e;let n;this._timer.beginFrame(),this._performance&&(n=performance.now());let r=!1;Ai&&(0===Zw&&(r=!0),++Zw,Zw%=e8);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),r&&Ie.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,r&&Ie.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let n;this._performance&&(n=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-n),r&&Ie.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-n),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame(),null!=(e=this.options)&&e.onUpdateEnd&&this.options.onUpdateEnd()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),r=null;Ie.assert(void 0!==n),Object.getPrototypeOf(n)===ty.prototype&&(r=n,n=r._popTask()),Ie.assert(void 0!==n),Ie.assert(Object.getPrototypeOf(n)===Qa.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Ai&&Ie.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),Ai&&Ie.log("group completed",r.name)):this._scheduledTasksByPriority.insert(r._priority,r))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===ty)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,Ai&&Ie.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Ai&&Ie.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===Qa.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Ai&&Ie.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===Qa.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===Qa.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Ai&&Ie.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===Qa.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===Qa.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Ai&&Ie.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Qa.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,Ai&&Ie.log("task priority changed",t.name,e)}};l(iE,"TaskScheduler");var ry=iE,oE=class{constructor(){D(this,"_map"),D(this,"_size"),D(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(Ie.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let r=t.next();if(r.done)return r;e=this._map.get(r.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return Ie.assert(t===this._size),t}};l(oE,"Multimap");var yc=oE,es=l((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),t8=/([!-/:-@])|(?:[\n\r [-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+)/u;function r8(t){return t.split(t8).filter(Boolean)}l(r8,"tokenizeAndCaptureDelimiters");var ts,yo,Fs,_a,Vr,mh,yh,_c,vh,_h,bh,xh,bc,rs,ny,iy,Bs,wh,oy,ay,sy,rA,vc="",n8=.09,i8=1,o8=.025,a8=.5,s8=5e-4,u8=5e-4,l8=.01,c8=.05,tA=1,f8=.01,p8=.2,h8={MappedinCategory:"categories",MappedinLocation:"locations"},d8={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:eA,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===C.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:n8,PRIMARY_INDEX_WEIGHT:i8,SECONDARY_INDEX_WEIGHT:o8,CATEGORY_NAME_WEIGHT:a8,LOCATION_NAME_WEIGHT:tA,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:s8,CATEGORY_LOCATION_TAGS_WEIGHT:u8,CATEGORY_LOCATION_NAME_WEIGHT:l8,PRIMARY_INDEX_TAGS_NAME_WEIGHT:c8,LOCATION_DEFAULT_RANK:tA,RATIO_OF_FUZZY_TO_EXACT:f8,RATIO_OF_PREFIX_TO_EXACT:p8}},sE=class{constructor(t,e){var n;oe(this,sy),oe(this,ts,void 0),oe(this,yo,void 0),oe(this,Fs,void 0),oe(this,_a,void 0),oe(this,Vr,void 0),oe(this,mh,new ry({performance:!0})),oe(this,yh,void 0),oe(this,_c,void 0),oe(this,vh,new Map),oe(this,_h,void 0),oe(this,bh,void 0),oe(this,xh,void 0),D(this,"buildIndices",l((()=>{var t,e;le(this,Bs,new Promise((t=>{le(this,wh,t)})));let{PRIMARY_INDEX_FUZZYNESS:n,PRIMARY_INDEX_WEIGHT:r,CATEGORY_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:o,RATIO_OF_PREFIX_TO_EXACT:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:a}=B(this,Vr).constants,l=["object","query","weight","tag","rank"],u={fields:["query","name","tag"],storeFields:l,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:n},boost:{name:r,query:r,tag:a},weights:{fuzzy:o,prefix:s},boostDocument:t=>t.includes("MappedinLocation")?r:t.includes("MappedinCategory")?i:r,tokenize:r8},c={fields:["description"],storeFields:l,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return null!=(n=B(this,yh))&&n.has(t.toLowerCase())?null:t.toLowerCase()}},h={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...l,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(null!=(t=B(this,Vr))&&t.jsonIndex){let{primary:t,secondary:n,extra:r}=JSON.parse(null==(e=B(this,Vr))?void 0:e.jsonIndex);le(this,yo,Du.loadJS(t,u)),le(this,Fs,Du.loadJS(n,c)),le(this,_a,Du.loadJS(r,h))}else le(this,yo,new Du(u)),le(this,Fs,new Du(c)),le(this,_a,new Du(h)),B(this,ts).locations.forEach(B(this,ny)),B(this,ts).categories.forEach(B(this,iy));B(this,mh).update(performance.now())}),"buildIndices")),oe(this,bc,0),oe(this,rs,l((t=>{Iy(this,bc)._++,B(this,mh).scheduleUpdate(new ey({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),Iy(this,bc)._--,0===B(this,bc)&&B(this,wh).call(this)}}))}),"#addTask")),oe(this,ny,l((t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=B(this,Vr).constants,a=o;null!=(e=B(this,Vr))&&e.useLocationRank&&(a=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return null!=(e=t.rank)&&e.score?null==(n=t.rank)?void 0:n.score:o})),o):o),B(this,rs).call(this,(()=>{B(this,yo).add({name:es(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:o,rank:a})})),null!=(n=B(this,Vr))&&n.searchTags&&Array.isArray(t.tags)&&t.tags.forEach((e=>{B(this,yo).add({name:"",tag:es(e),id:"MappedinLocation_"+t.id,weight:s,rank:a})})),null!=(r=B(this,Vr))&&r.searchDescriptions&&B(this,rs).call(this,(()=>B(this,Fs).add({description:es(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:a})))}),"#processLocation")),oe(this,iy,l((t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:r,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:o,CATEGORY_NAME_WEIGHT:s}=B(this,Vr).constants;B(this,rs).call(this,(()=>B(this,yo).add({name:es(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let a=t.locations.reduce(((t,e)=>t+" ".concat(vc," ")+e.name),"")+" ".concat(vc);if(null!=(e=B(this,Vr))&&e.searchDescriptionsInCategories&&t.locations.forEach((e=>{null!=e.description&&B(this,rs).call(this,(()=>B(this,_a).add({id:"MappedinCategory_"+t.id,"category.locations.description":es(e.description),ref:e.name,weight:r})))})),null!=(n=B(this,Vr))&&n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+" ".concat(vc," ")+e),""))+" ".concat(vc)}),"");B(this,rs).call(this,(()=>B(this,_a).add({"category.locations.tags":es(e),id:"MappedinCategory_"+t.id,weight:i})))}B(this,rs).call(this,(()=>B(this,_a).add({"category.locations.name":es(a),id:"MappedinCategory_"+t.id,weight:o})))}),"#processCategory")),oe(this,Bs,void 0),oe(this,wh,void 0),oe(this,oy,l((t=>{var e;let n=t.score,{object:r,id:i,weight:o,rank:s}=t,[a,l]=i.split("_"),u=r||B(this,ts).getCollectionItemById(h8[a],l);return s&&null!=(e=B(this,Vr))&&e.useLocationRank&&(n+=s),o&&(n*=o),{score:n,type:a,object:u}}),"#processSearchResult")),oe(this,ay,l(((t,e)=>{for(let n in t.match)t.match[n].forEach((r=>{let i=t.ref||t[r]||e.object[r];if("category.locations.tags"===r||"category.locations.name"===r){let e=new RegExp("[^".concat(vc,"]* ")+n+" [^".concat(vc,"]*"),"ig").exec(t[r]);null!=e&&(i=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:r,value:i})}))}),"#addMatches")),le(this,_c,hh.create({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),le(this,Vr,{...d8,...e}),le(this,ts,t),le(this,yh,new Set(null==(n=B(this,Vr))?void 0:n.stopWords));let r=B(this,ts).venue.slug;B(this,ts).on(0,this.buildIndices),this.buildIndices(),le(this,_h,gl((t=>{B(this,_c).trackSearchSuggest({query:t}),Nr.addPendingEvent(new mf({venue:r}))}),300)),le(this,bh,gl((t=>{B(this,_c).trackSearch({query:t}),Nr.addPendingEvent(new gf({venue:r}))}),300)),le(this,xh,gl((()=>{Nr.addPendingEvent(new hf({venue:r}))}),300)),Nr.addPendingEvent(new df({search_descriptions:B(this,Vr).searchDescriptions,search_tags:B(this,Vr).searchTags,search_descriptions_in_categories:B(this,Vr).searchDescriptionsInCategories,search_tags_in_categories:B(this,Vr).searchTagsInCategories,use_location_rank:B(this,Vr).useLocationRank,venue:r}))}async suggest(t){await B(this,Bs);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:r,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:o}=B(this,Vr).constants,s=B(this,yo).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:r},weights:{fuzzy:i,prefix:o}});return B(this,_h).call(this,t),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await B(this,Bs);let e=wr(this,sy,rA).call(this,t);return B(this,bh).call(this,t),e}async toJSON(){return await B(this,Bs),JSON.stringify({primary:B(this,yo),secondary:B(this,Fs),extra:B(this,_a)})}async addQuery(t){let e,n,{query:r,object:i,weight:o=1}=t;await B(this,Bs),e=i instanceof za?"MappedinLocation":i instanceof hu?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=B(this,vh).get(i),n||(n="Custom_"+Ga(),B(this,vh).set(i,n))),B(this,yo).add({id:n,weight:o,object:i,query:es(r)}),B(this,xh).call(this)}};ts=new WeakMap,yo=new WeakMap,Fs=new WeakMap,_a=new WeakMap,Vr=new WeakMap,mh=new WeakMap,yh=new WeakMap,_c=new WeakMap,vh=new WeakMap,_h=new WeakMap,bh=new WeakMap,xh=new WeakMap,bc=new WeakMap,rs=new WeakMap,ny=new WeakMap,iy=new WeakMap,Bs=new WeakMap,wh=new WeakMap,oy=new WeakMap,ay=new WeakMap,sy=new WeakSet,rA=l((function(t){let e=[],n=es(t);e=[...B(this,yo).search(n),...B(this,Fs).search(n),...B(this,_a).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=B(this,oy).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},B(this,ay).call(this,t,r[t.id])}return Object.keys(r).map((t=>({...r[t],matches:r[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))}),"#doSearch"),l(sE,"OfflineSearch");var aE=sE;y();var nA=(t=>(t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY",t))(nA||{}),uE=globalThis.fetch;function Oi(){if(null==uE)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return uE}function XNe(t){uE=t}l(Oi,"isomorphicFetch"),l(XNe,"setFetchFn");var iA,g8=null==(iA=null==C?void 0:C.env)?void 0:iA.npm_package_version;globalThis.btoa||(globalThis.btoa=oA.encode);var m8=["ar"];function js(t){let e={...Gw,things:GT,...t};return e.headers={...e.headers,"mappedin-sdk-version":g8},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e}function aA(t){return t.endsWith("/")?t:"".concat(t,"/")}async function JNe(t){let e={emitAnalyticsEvents:!0,version:"2.0.0",...t},n=js({...e}),r=new Vi(n),i=await b8(n);if("1.0.0"===n.version){let t=hT(await cT(i));return r.hydrateFromMVFv1(t),r}let o=pT(Lw(await Aw(i)),n.override);return"function"==typeof e.onMVFParsed&&e.onMVFParsed(o),await r.hydrateFromMVF(o),Nr.addPendingEvent(new nf({venue:n.venue})),r}async function ZNe(t){let e={emitAnalyticsEvents:!0,clientId:t.key,clientSecret:t.secret,venue:t.mapId,...t},n=js({...e}),r=new Vi(n);try{if(!n.key)throw new Error("key is required.");if(!n.secret)throw new Error("secret is required.");if(!n.mapId)throw new Error("mapId is required.");let{access_token:i}=await x8(t),o=await E8(n,i),s=Lw(await Aw(o));"function"==typeof e.onMVFParsed&&e.onMVFParsed(s),r.hydrateFromMVF(s)}catch(t){Ie.error("Failed to get Maker map data.",t)}return r}async function y8(t){let e={emitAnalyticsEvents:!0,secure:!0,...t},n=js({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/".concat(n.useDraftData?"draft/":""),i=new Vi({...n,baseUrl:n.baseUrl+r});return await i.fetch(),e.emitAnalyticsEvents,Nr.addPendingEvent(new rf({venue:n.venue})),i}async function QNe(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,secure:!0,...t}}),n="public/1/".concat(e.useDraftData?"draft/":""),r=new Vi({...e,baseUrl:e.baseUrl+n}),i=await du.fetch(r);return{hasSecureAssets:i.secureContentStorage,languages:i.languages}}function eTe(t){y8=t}l(js,"parseOptions"),l(aA,"normalizeUrl"),l(JNe,"getVenueMVF"),l(ZNe,"getVenueMaker"),l(y8,"getVenue"),l(QNe,"getVenueMetadata"),l(eTe,"__setGetVenueMock");var lE={shouldPopulateBundledImagesAsBlobs:!(typeof globalThis.navigator<"u"&&"ReactNative"==globalThis.navigator.product)};async function tTe(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),{url:n,updated_at:r}=await v8(t),i=await Oi()(n,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error("Unrecognized format ".concat(s));let a=new Vi(e);return await a.hydrate(o,e.shouldPopulateBundledImagesAsBlobs),a.updatedAt=r,a}async function v8(t){let e=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),{version:n,venue:r}=t,i="".concat(t.bundleBaseUri||e.baseUrl+"exports/legacy".concat(null!=e.language&&m8.includes(e.language)?"-"+e.language:"","/1/bundle"),"?venue=").concat(r,"&version=1.0.0");return e.language=void 0,await Mg(e,i)}async function rTe(t,{url:e,updated_at:n}){let r=js({baseUrl:"https://api-gateway.mappedin.com/",...lE,...t}),i=await Oi()(e,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error("Unrecognized format".concat(s));let a=new Vi(r);return await a.hydrate(o,r.shouldPopulateBundledImagesAsBlobs),a.updatedAt=n,a}async function _8(t){var e;let n=js({baseUrl:"https://api-gateway.mappedin.com/",...Gw,...t}),r="".concat(n.bundleBaseUri||n.baseUrl+"exports/mvf/1/bundle","?venue=").concat(n.venue,"&version=").concat(null!=(e=n.version)?e:"2.0.0");return n.headers["Content-Type"]="application/zip",await Mg(n,r)}async function b8(t){return new Promise((async(e,n)=>{try{let{url:n}=await _8(t),r=await Oi()(n).then((t=>t.arrayBuffer()));e(new Uint8Array(r))}catch(t){n(t)}}))}async function x8(t){let e="".concat(t.authBaseUri?aA(t.authBaseUri):"https://auth-maker.mappedin.com/","api-key/token"),n=await Oi()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t.key,secret:t.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}async function w8(t,e){let n="".concat(t.bundleBaseUri?aA(t.bundleBaseUri):"https://app.mappedin.com/","api/venue/").concat(t.mapId,"/mvf"),r=await Oi()(n,{headers:{Authorization:"Bearer ".concat(e)}});if(!r.ok)throw new Error("".concat(r.status," ").concat(r.statusText));return r.json()}async function E8(t,e){return new Promise((async(n,r)=>{try{let{url:r}=await w8(t,e),i=await Oi()(r).then((t=>t.arrayBuffer()));n(new Uint8Array(i))}catch(t){r(t)}}))}async function nTe(t,e=!0){let n=new Vi({venue:""});return await n.hydrate(t,e),n}async function iTe(t){let e=new Vi({venue:""});return await e.hydrateFromMVF(t),e}l(tTe,"getVenueBundle"),l(v8,"getVenueBundleURL"),l(rTe,"downloadBundle"),l(_8,"getVenueMVFURL"),l(b8,"downloadVenueBundleMVF"),l(x8,"getMakerAccessToken"),l(w8,"getMakerBundleURL"),l(E8,"downloadMVF"),l(nTe,"hydrateVenue"),l(iTe,"hydrateVenueMVF");export{hh as CustomerAnalytics,Ig as GET_VENUE_EVENT,nA as MAP_RENDER_MODE,Vi as Mappedin,hu as MappedinCategory,Lf as MappedinCollectionType,gu as MappedinCoordinate,uo as MappedinDestinationSet,Qs as MappedinDirections,rp as MappedinEvent,za as MappedinLocation,ap as MappedinLocationState,lp as MappedinMap,mp as MappedinMapGroup,Qo as MappedinNavigatable,Tf as MappedinNode,fu as MappedinPolygon,Qf as MappedinRankings,du as MappedinVenue,Vf as MappedinVortex,aE as OfflineSearch,eTe as __setGetVenueMock,GT as defaultThings,rTe as downloadBundle,E8 as downloadMVF,b8 as downloadVenueBundleMVF,x8 as getMakerAccessToken,w8 as getMakerBundleURL,y8 as getVenue,tTe as getVenueBundle,v8 as getVenueBundleURL,JNe as getVenueMVF,_8 as getVenueMVFURL,ZNe as getVenueMaker,QNe as getVenueMetadata,nTe as hydrateVenue,iTe as hydrateVenueMVF,Oi as isomorphicFetch,js as parseOptions,XNe as setFetchFn};
|