@mappedin/mappedin-js 5.10.2 → 5.12.0
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/navigator/index.js +1 -1
- package/lib/esm/renderer/{browser-OZUOQJQ6.js → browser-TSKZH24T.js} +1 -1
- package/lib/esm/renderer/chunk-DSGL6VSV.js +1 -0
- package/lib/esm/renderer/index.d.ts +983 -417
- package/lib/esm/renderer/index.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/chunk-X42JXWFR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var mO,C,uO=Object.create,Du=Object.defineProperty,lO=Object.getOwnPropertyDescriptor,cO=Object.getOwnPropertyNames,fO=Object.getPrototypeOf,pO=Object.prototype.hasOwnProperty,hO=(t,e,n)=>e in t?Du(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_x=t=>Du(t,"__esModule",{value:!0}),l=(t,e)=>Du(t,"name",{value:e,configurable:!0}),bx=(t,e)=>()=>(t&&(e=t(t=0)),e),se=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dO=(t,e)=>{for(var n in _x(t),e)Du(t,n,{get:e[n],enumerable:!0})},gO=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of cO(e))!pO.call(t,r)&&"default"!==r&&Du(t,r,{get:()=>e[r],enumerable:!(n=lO(e,r))||n.enumerable});return t},er=t=>gO(_x(Du(null!=t?uO(fO(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),D=(t,e,n)=>(hO(t,"symbol"!=typeof e?e+"":e,n),n),hv=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},z=(t,e,n)=>(hv(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)},ue=(t,e,n,r)=>(hv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),dv=(t,e,n,r)=>({set _(r){ue(t,e,r,n)},get _(){return z(t,e,r)}}),Kn=(t,e,n)=>(hv(t,e,"access private method"),n),v=bx((()=>{C={env:mO={NODE_ENV:"production",npm_package_version:"5.10.2"}}})),wx=se(((t,e)=>{v(),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)})),jn=se((t=>{v(),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})),Pc=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)}),"getCoordinateKey");t.default=e})),Sc=se((t=>{v(),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})),Cc=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),n=l((function(t){return e.sexagesimalPattern.test(t.toString().trim())}),"isSexagesimal");t.default=n})),kc=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),n=l((function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(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})),mh=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),n=r(Pc());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})),yv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Sc()),n=o(Cc()),r=o(kc()),i=jn();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})),bv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Sc()),n=o(Cc()),r=o(kc()),i=jn();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})),wv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(mh()),n=i(yv()),r=i(bv());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(void 0===o||void 0===s)return!1;var a=t[s],l=t[o];return!(void 0===l||void 0===a||!1===(0,n.default)(l)||!1===(0,r.default)(a))}),"isValidCoordinate");t.default=o})),xh=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Sc()),n=s(Cc()),r=s(kc()),i=s(wv()),o=s(mh());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})),Ji=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),n=i(Pc()),r=i(xh());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(null!=o){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLatitude");t.default=o})),Zi=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),n=i(Pc()),r=i(xh());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(null!=o){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLongitude");t.default=o})),Vo=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t*Math.PI/180}),"toRad");t.default=e})),Vs=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return 180*t/Math.PI}),"toDeg");t.default=e})),Ax=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ji()),n=s(Zi()),r=s(Vo()),i=s(Vs()),o=jn();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})),Lx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),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})),Rx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),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})),Dx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=jn(),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})),jx=se((t=>{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("undefined"!=typeof Symbol&&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}v(),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*Number("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})),Sv=se((t=>{v(),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})),ls=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ji()),n=s(Zi()),r=s(Vo()),i=s(Sv()),o=jn();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=void 0===a||isNaN(a)?1:a;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})),Cv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),Ux=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Cv());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})),Yx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Vo()),n=o(Ji()),r=o(Zi()),i=jn();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})),Ov=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ji()),n=r(Zi());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})),Hx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ji()),n=s(Zi()),r=s(Vo()),i=s(Vs()),o=jn();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})),Jx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ji()),n=o(Zi()),r=o(Vo()),i=o(Vs());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})),Zx=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Ov());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})),Tv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ji()),n=o(Zi()),r=o(Vo()),i=o(Vs());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})),rw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Tv());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})),Lv=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(ls()),n=r(Sv());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})),sw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ji()),n=o(Zi()),r=o(Vo()),i=o(Vs());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})),uw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),pw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ji()),n=o(Zi()),r=o(Vo()),i=jn();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=void 0===s||isNaN(s)?1:s;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),N=Math.sin(x),S=Math.cos(x),C=b,M=100;do{var O=Math.sin(C),P=Math.cos(C);if(0===(p=Math.sqrt(S*O*(S*O)+(I*N-E*S*P)*(I*N-E*S*P))))return 0;a=E*N+I*S*P,l=Math.atan2(p,a),h=a-2*E*N/(c=1-(u=I*S*O/p)*u),isNaN(h)&&(h=0);var L=_/16*c*(4+_*(4-3*c));f=C,C=b+(1-L)*_*u*(l+L*p*(h+L*a*(2*h*h-1)))}while(Math.abs(C-f)>1e-12&&--M>0);if(0===M)return NaN;var A=c*(i.earthRadius*i.earthRadius-m*m)/(m*m),T=1+A/16384*(4096+A*(A*(320-175*A)-768)),D=A/1024*(256+A*(A*(74-47*A)-128)),R=D*p*(h+D/4*(a*(2*h*h-1)-D/6*h*(4*p*p-3)*(4*h*h-3))),k=m*T*(l-R);return Math.round(k/s)*s}),"getDistance");t.default=s})),hw=se((t=>{v(),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})),dw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),gw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),vw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Ji()),n=r(Zi());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})),yw=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Lv());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})),_w=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),xw=se((t=>{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("undefined"!=typeof Symbol&&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}v(),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})),Ew=se((t=>{v(),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 y.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 N.default}),"get")}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:l((function(){return S.default}),"get")}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:l((function(){return C.default}),"get")}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:l((function(){return M.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 L.default}),"get")}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:l((function(){return A.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 D.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 k.default}),"get")}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:l((function(){return F.default}),"get")}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:l((function(){return z.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 B.default}),"get")}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:l((function(){return G.default}),"get")}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:l((function(){return q.default}),"get")});var n=V(Ax()),r=V(Lx()),i=V(Rx()),o=V(Dx()),s=V(jx()),a=V(Ux()),u=V(Yx()),c=V(Ov()),h=V(Hx()),p=V(Jx()),f=V(Zx()),d=V(rw()),g=V(Pc()),y=V(mh()),m=V(ls()),_=V(Lv()),b=V(sw()),w=V(Ji()),x=V(Zi()),E=V(uw()),I=V(pw()),N=V(Tv()),S=V(hw()),C=V(dw()),M=V(Sc()),O=V(gw()),P=V(vw()),L=V(yw()),A=V(_w()),T=V(Cc()),D=V(wv()),R=V(yv()),k=V(bv()),F=V(Cv()),z=V(kc()),j=V(xh()),B=V(Vo()),G=V(Vs()),q=V(xw()),U=jn();function V(t){return t&&t.__esModule?t:{default:t}}Object.keys(U).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:l((function(){return U[n]}),"get")})})),l(V,"_interopRequireDefault")})),tE=se(((t,e)=>{var n,r,i,o,s,a,u,c,h,p,f,d,g,y,m,_,b,w,x,E,I,N,S,C,M;v(),function(t){var n="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,e){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,r){return t[n]=e?e(n,r):r}}"function"==typeof define&&define.amd?define("tslib",["exports"],(function(e){t(r(n,r(e)))})):"object"==typeof e&&"object"==typeof e.exports?t(r(n,r(e.exports))):t(r(n)),l(r,"createExporter")}((function(t){var e=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])};n=l((function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),l(r,"__"),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),"__extends"),r=Object.assign||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},i=l((function(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}),"__rest"),o=l((function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}),"__decorate"),s=l((function(t,e){return function(n,r){e(n,r,t)}}),"__param"),a=l((function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}),"__metadata"),u=l((function(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())}))}),"__awaiter"),c=l((function(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])}}}),"__generator"),h=l((function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&M(e,t,n)}),"__exportStar"),M=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]},p=l((function(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.")}),"__values"),f=l((function(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}),"__read"),d=l((function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}),"__spread"),g=l((function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}),"__spreadArrays"),y=l((function(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))}),"__spreadArray"),m=l((function(t){return this instanceof m?(this.v=t,this):new m(t)}),"__await"),_=l((function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{!function(t){t.value instanceof m?Promise.resolve(t.value.v).then(l,u):c(o[0][2],t)}(i[t](e))}catch(t){c(o[0][3],t)}}function l(t){a("next",t)}function u(t){a("throw",t)}function c(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}),"__asyncGenerator"),b=l((function(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}),"__asyncDelegator"),w=l((function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof p?p(t):t[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}),"__asyncValues"),x=l((function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}),"__makeTemplateObject");var v=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};E=l((function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&M(e,t,n);return v(e,t),e}),"__importStar"),I=l((function(t){return t&&t.__esModule?t:{default:t}}),"__importDefault"),N=l((function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}),"__classPrivateFieldGet"),S=l((function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}),"__classPrivateFieldSet"),C=l((function(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}),"__classPrivateFieldIn"),t("__extends",n),t("__assign",r),t("__rest",i),t("__decorate",o),t("__param",s),t("__metadata",a),t("__awaiter",u),t("__generator",c),t("__exportStar",h),t("__createBinding",M),t("__values",p),t("__read",f),t("__spread",d),t("__spreadArrays",g),t("__spreadArray",y),t("__await",m),t("__asyncGenerator",_),t("__asyncDelegator",b),t("__asyncValues",w),t("__makeTemplateObject",x),t("__importStar",E),t("__importDefault",I),t("__classPrivateFieldGet",N),t("__classPrivateFieldSet",S),t("__classPrivateFieldIn",C)}))})),My=se(((t,e)=>{v(),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",N="Browser",S="Chrome",C="Firefox",M="Google",O="Huawei",P="LG",L="Microsoft",A="Motorola",T="Opera",D="Samsung",R="Sony",k="Xiaomi",F="Zebra",z="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"),B=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),G=l((function(t,e){return typeof t===a&&-1!==q(e).indexOf(q(t))}),"has"),q=l((function(t){return t.toLowerCase()}),"lowerize"),U=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"),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"),Y=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(G(e[n][i],t))return"?"===n?r:n}else if(G(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"},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)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+N]],[/\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 "+N],f],[/\bfocus\/([\w\.]+)/i],[f,[c,C+" 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 "+N]],[/fxios\/([-\w\.]+)/i],[f,[c,C]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+N]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+N],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,z],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,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,S+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+N]],[/(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,Y,{"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,C+" 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,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-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,D],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[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,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,A],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,A],[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,M],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,M],[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,L],[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,L],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,F],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,F],[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,L],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[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,S+"cast"],[p,M],[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,M],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,F],[h,_]],[/(quest( 2)?)/i],[u,[p,z],[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,Y,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,Y,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,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,S+"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]]},$=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof $))return new $(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?j(H,e):H;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,X.call(t,i,l.browser),t.major=U(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>275?V(t,275):t,this},this.setUA(i),this}),"UAParser");$.VERSION="0.7.31",$.BROWSER=B([c,f,"major"]),$.CPU=B([d]),$.DEVICE=B([u,p,h,g,y,m,v,_,b]),$.ENGINE=$.OS=B([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=$),t.UAParser=$):typeof define===i&&define.amd?define((function(){return $})):typeof n!==o&&(n.UAParser=$);var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var J=new $;K.ua=J.getResult(),K.ua.get=function(){return J.getUA()},K.ua.set=function(t){J.setUA(t);var e=J.getResult();for(var n in e)K.ua[n]=e[n]}}}("object"==typeof window?window:t)})),EM=se(((t,e)=>{v();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]",y="[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[y]=I[m]=I[_]=!1;var N="object"==typeof global&&global&&global.Object===Object&&global,S="object"==typeof self&&self&&self.Object===Object&&self,C=N||S||Function("return this")(),M="object"==typeof t&&t&&!t.nodeType&&t,O=M&&"object"==typeof e&&e&&!e.nodeType&&e,P=O&&O.exports===M,L=P&&N.process,A=function(){try{return L&&L.binding&&L.binding("util")}catch(t){}}(),T=A&&A.isTypedArray;function D(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 k(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 F(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function z(t){return function(e){return t(e)}}function j(t,e){return t.has(e)}function B(t,e){return null==t?void 0:t[e]}function G(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function q(t,e){return function(n){return t(e(n))}}function U(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}l(D,"arrayFilter"),l(R,"arrayPush"),l(k,"arraySome"),l(F,"baseTimes"),l(z,"baseUnary"),l(j,"cacheHas"),l(B,"getValue"),l(G,"mapToArray"),l(q,"overArg"),l(U,"setToArray");var V,X=Array.prototype,Y=Function.prototype,W=Object.prototype,H=C["__core-js_shared__"],$=Y.toString,K=W.hasOwnProperty,J=(V=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Z=W.toString,Q=RegExp("^"+$.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=P?C.Buffer:void 0,et=C.Symbol,nt=C.Uint8Array,rt=W.propertyIsEnumerable,it=X.splice,ot=et?et.toStringTag:void 0,st=Object.getOwnPropertySymbols,at=tt?tt.isBuffer:void 0,lt=q(Object.keys,Object),ut=ce(C,"DataView"),ct=ce(C,"Map"),ht=ce(C,"Promise"),pt=ce(C,"Set"),ft=ce(C,"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 Nt(t){var e=this.__data__;if(dt){var r=e[t];return r===n?void 0:r}return K.call(e,t)?e[t]:void 0}function St(t){var e=this.__data__;return dt?void 0!==e[t]:K.call(e,t)}function Ct(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dt&&void 0===e?n:e,this}function Mt(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=Kt(e,t);return!(n<0)&&(n==e.length-1?e.pop():it.call(e,n,1),--this.size,!0)}function Lt(t){var e=this.__data__,n=Kt(e,t);return n<0?void 0:e[n][1]}function At(t){return Kt(this.__data__,t)>-1}function Tt(t,e){var n=this.__data__,r=Kt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Dt(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||Mt),string:new xt}}function kt(t){var e=ue(this,t).delete(t);return this.size-=e?1:0,e}function Ft(t){return ue(this,t).get(t)}function zt(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 Bt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Dt;++e<n;)this.add(t[e])}function Gt(t){return this.__data__.set(t,n),this}function qt(t){return this.__data__.has(t)}function Ut(t){var e=this.__data__=new Mt(t);this.size=e.size}function Vt(){this.__data__=new Mt,this.size=0}function Xt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Yt(t){return this.__data__.get(t)}function Wt(t){return this.__data__.has(t)}function Ht(t,e){var n=this.__data__;if(n instanceof Mt){var r=n.__data__;if(!ct||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Dt(r)}return n.set(t,e),this.size=n.size,this}function $t(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?F(t.length,String):[],l=a.length;for(var u in t)(e||K.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 Kt(t,e){for(var n=t.length;n--;)if(be(t[n][0],e))return n;return-1}function Jt(t,e,n){var r=e(t);return xe(t)?r:R(r,n(t))}function Zt(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)&&Zt(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 Ut),l||Pe(t)?oe(t,e,n,r,s,a):se(t,e,c,n,r,s,a);if(!(1&n)){var y=p&&K.call(t,"__wrapped__"),v=d&&K.call(e,"__wrapped__");if(y||v){var m=y?t.value():t,_=v?e.value():e;return a||(a=new Ut),s(m,_,n,r,a)}}return!!g&&(a||(a=new Ut),ae(t,e,n,r,s,a))}function ne(t){return!(!Me(t)||ye(t))&&(Se(t)?Q:x).test(_e(t))}function re(t){return Oe(t)&&Ce(t.length)&&!!I[Zt(t)]}function ie(t){if(!ve(t))return lt(t);var e=[];for(var n in Object(t))K.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 Bt: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(!k(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=G;case y:var f=1&r;if(c||(c=U),t.size!=e.size&&!f)return!1;var d=l.get(t);if(d)return d==e;r|=2,l.set(t,e);var v=oe(c(t),c(e),r,i,o,l);return l.delete(t),v;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:K.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 Jt(t,Le,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=B(t,e);return ne(n)?n:void 0}function he(t){var e=K.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch(t){}var i=Z.call(t);return r&&(e?t[ot]=n:delete t[ot]),i}l(xt,"Hash"),l(Et,"hashClear"),l(It,"hashDelete"),l(Nt,"hashGet"),l(St,"hashHas"),l(Ct,"hashSet"),xt.prototype.clear=Et,xt.prototype.delete=It,xt.prototype.get=Nt,xt.prototype.has=St,xt.prototype.set=Ct,l(Mt,"ListCache"),l(Ot,"listCacheClear"),l(Pt,"listCacheDelete"),l(Lt,"listCacheGet"),l(At,"listCacheHas"),l(Tt,"listCacheSet"),Mt.prototype.clear=Ot,Mt.prototype.delete=Pt,Mt.prototype.get=Lt,Mt.prototype.has=At,Mt.prototype.set=Tt,l(Dt,"MapCache"),l(Rt,"mapCacheClear"),l(kt,"mapCacheDelete"),l(Ft,"mapCacheGet"),l(zt,"mapCacheHas"),l(jt,"mapCacheSet"),Dt.prototype.clear=Rt,Dt.prototype.delete=kt,Dt.prototype.get=Ft,Dt.prototype.has=zt,Dt.prototype.set=jt,l(Bt,"SetCache"),l(Gt,"setCacheAdd"),l(qt,"setCacheHas"),Bt.prototype.add=Bt.prototype.push=Gt,Bt.prototype.has=qt,l(Ut,"Stack"),l(Vt,"stackClear"),l(Xt,"stackDelete"),l(Yt,"stackGet"),l(Wt,"stackHas"),l(Ht,"stackSet"),Ut.prototype.clear=Vt,Ut.prototype.delete=Xt,Ut.prototype.get=Yt,Ut.prototype.has=Wt,Ut.prototype.set=Ht,l($t,"arrayLikeKeys"),l(Kt,"assocIndexOf"),l(Jt,"baseGetAllKeys"),l(Zt,"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),D(st(t),(function(e){return rt.call(t,e)})))}:Ae,fe=Zt;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!!J&&J in t}function ve(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function me(t){return Z.call(t)}function _e(t){if(null!=t){try{return $.call(t)}catch(t){}try{return t+""}catch(t){}}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)!=y||ft&&fe(new ft)!=_)&&(fe=l((function(t){var e=Zt(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 y;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)&&K.call(t,"callee")&&!rt.call(t,"callee")},xe=Array.isArray;function Ee(t){return null!=t&&Ce(t.length)&&!Se(t)}l(Ee,"isArrayLike");var Ie=at||Te;function Ne(t,e){return te(t,e)}function Se(t){if(!Me(t))return!1;var e=Zt(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ce(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Me(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Oe(t){return null!=t&&"object"==typeof t}l(Ne,"isEqual"),l(Se,"isFunction"),l(Ce,"isLength"),l(Me,"isObject"),l(Oe,"isObjectLike");var Pe=T?z(T):re;function Le(t){return Ee(t)?$t(t):ie(t)}function Ae(){return[]}function Te(){return!1}l(Le,"keys"),l(Ae,"stubArray"),l(Te,"stubFalse"),e.exports=Ne})),ZM=se(((t,e)=>{v();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,y=g&&g.exports===d,m=y&&h.process,_=function(){try{return g&&g.require&&g.require("util").types||m&&m.binding&&m.binding("util")}catch(t){}}(),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 N(t,e){return function(n){return t(e(n))}}l(w,"apply"),l(x,"baseTimes"),l(E,"baseUnary"),l(I,"getValue"),l(N,"overArg");var S,C=Array.prototype,M=Function.prototype,O=Object.prototype,P=f["__core-js_shared__"],L=M.toString,A=O.hasOwnProperty,T=(S=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",D=O.toString,R=L.call(Object),k=RegExp("^"+L.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=y?f.Buffer:void 0,z=f.Symbol,j=f.Uint8Array,B=F?F.allocUnsafe:void 0,G=N(Object.getPrototypeOf,Object),q=Object.create,U=O.propertyIsEnumerable,V=C.splice,X=z?z.toStringTag:void 0,Y=function(){try{var t=Yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),W=F?F.isBuffer:void 0,H=Math.max,$=Date.now,K=Yt(f,"Map"),J=Yt(Object,"create"),Z=function(){function t(){}return l(t,"object"),function(e){if(!ge(e))return{};if(q)return q(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__=J?J(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(J){var r=e[t];return r===n?void 0:r}return A.call(e,t)?e[t]:void 0}function rt(t){var e=this.__data__;return J?void 0!==e[t]:A.call(e,t)}function it(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=J&&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=St(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=St(e,t);return n<0?void 0:e[n][1]}function ut(t){return St(this.__data__,t)>-1}function ct(t,e){var n=this.__data__,r=St(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(K||ot),string:new Q}}function ft(t){var e=Xt(this,t).delete(t);return this.size-=e?1:0,e}function dt(t){return Xt(this,t).get(t)}function gt(t){return Xt(this,t).has(t)}function yt(t,e){var n=Xt(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(!K||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||A.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||$t(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))&&Ct(t,e,n)}function Nt(t,e,n){var r=t[e];(!A.call(t,e)||!ae(r,n)||void 0===n&&!(e in t))&&Ct(t,e,n)}function St(t,e){for(var n=t.length;n--;)if(ae(t[n][0],e))return n;return-1}function Ct(t,e,n){"__proto__"==e&&Y?Y(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(Nt,"assignValue"),l(St,"assocIndexOf"),l(Ct,"baseAssignValue");var Mt=Vt();function Ot(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":X&&X in Object(t)?Wt(t):ee(t)}function Pt(t){return ye(t)&&Ot(t)==i}function Lt(t){return!(!ge(t)||Zt(t))&&(fe(t)?k:a).test(se(t))}function At(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||!A.call(t,r))||n.push(r);return n}function Dt(t,e,n,r,i){t!==e&&Mt(e,(function(o,s){if(i||(i=new vt),ge(o))Rt(t,e,s,n,Dt,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=Gt(a):f?(h=!1,c=zt(l,!0)):d?(h=!1,c=Bt(l,!0)):c=[]:ve(l)||le(l)?(c=a,le(a)?c=_e(a):(!ge(a)||fe(a))&&(c=Ht(l))):h=!1}h&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),It(t,n,c)}}function kt(t,e){return ie(ne(t,e,Ee),t+"")}l(Ot,"baseGetTag"),l(Pt,"baseIsArguments"),l(Lt,"baseIsNative"),l(At,"baseIsTypedArray"),l(Tt,"baseKeysIn"),l(Dt,"baseMerge"),l(Rt,"baseMergeDeep"),l(kt,"baseRest");var Ft=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:xe(e),writable:!0})}:Ee;function zt(t,e){if(e)return t.slice();var n=t.length,r=B?B(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 Bt(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Gt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function qt(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?Ct(n,a,l):Nt(n,a,l)}return n}function Ut(t){return kt((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&&Kt(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 Xt(t,e){var n=t.__data__;return Jt(e)?n["string"==typeof e?"string":"hash"]:n.map}function Yt(t,e){var n=I(t,e);return Lt(n)?n:void 0}function Wt(t){var e=A.call(t,X),n=t[X];try{t[X]=void 0;var r=!0}catch(t){}var i=D.call(t);return r&&(e?t[X]=n:delete t[X]),i}function Ht(t){return"function"!=typeof t.constructor||Qt(t)?{}:Z(G(t))}function $t(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 Kt(t,e,n){if(!ge(n))return!1;var r=typeof e;return!!("number"==r?ce(n)&&$t(e,n.length):"string"==r&&e in n)&&ae(n[e],t)}function Jt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Zt(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 D.call(t)}function ne(t,e,n){return e=H(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=H(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(zt,"cloneBuffer"),l(jt,"cloneArrayBuffer"),l(Bt,"cloneTypedArray"),l(Gt,"copyArray"),l(qt,"copyObject"),l(Ut,"createAssigner"),l(Vt,"createBaseFor"),l(Xt,"getMapData"),l(Yt,"getNative"),l(Wt,"getRawTag"),l(Ht,"initCloneObject"),l($t,"isIndex"),l(Kt,"isIterateeCall"),l(Jt,"isKeyable"),l(Zt,"isMasked"),l(Qt,"isPrototype"),l(te,"nativeKeysIn"),l(ee,"objectToString"),l(ne,"overRest"),l(re,"safeGet");var ie=oe(Ft);function oe(t){var e=0,n=0;return function(){var r=$(),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 L.call(t)}catch(t){}try{return t+""}catch(t){}}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)&&A.call(t,"callee")&&!U.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=G(t);if(null===e)return!0;var n=A.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&L.call(n)==R}l(fe,"isFunction"),l(de,"isLength"),l(ge,"isObject"),l(ye,"isObjectLike"),l(ve,"isPlainObject");var me=b?E(b):At;function _e(t){return qt(t,be(t))}function be(t){return ce(t)?Et(t,!0):Tt(t)}l(_e,"toPlainObject"),l(be,"keysIn");var we=Ut((function(t,e,n){Dt(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})),QM=se(((t,e)=>{v(),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",N="Browser",S="Chrome",C="Firefox",M="Google",O="Huawei",P="LG",L="Microsoft",A="Motorola",T="Opera",D="Samsung",R="Sharp",k="Sony",F="Xiaomi",z="Zebra",j="Facebook",B=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"),q=l((function(t,e){return typeof t===a&&-1!==U(e).indexOf(U(t))}),"has"),U=l((function(t){return t.toLowerCase()}),"lowerize"),V=l((function(t){return typeof t===a?t.replace(/[^\d\.]/g,"").split(".")[0]:r}),"majorize"),X=l((function(t,e){if(typeof t===a)return t=t.replace(/^\s\s*/,""),typeof e===o?t:t.substring(0,350)}),"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"),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(q(e[n][i],t))return"?"===n?r:n}else if(q(e[n],t))return"?"===n?r:n;return t}),"strMapper"),H={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"},$={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"+N]],[/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 "+N],f],[/\bfocus\/([\w\.]+)/i],[f,[c,C+" 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 "+N]],[/fxios\/([-\w\.]+)/i],[f,[c,C]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+N]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+N],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,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,S+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+N]],[/(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,C+" 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,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-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,D],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[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,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,A],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,A],[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,M],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,M],[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,k],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,k],[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,L],[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,L],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,z],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,z],[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,k],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,L],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[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,S+"cast"],[p,M],[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,k],[h,m]],[/(mitv-\w{5}) bui/i],[u,[p,F],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[p,X],[u,X],[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,M],[h,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,z],[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,H]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,W,H]],[/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,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,S+"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]]},K=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof K))return new K(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?B($,e):$;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.browser),t.major=V(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>350?X(t,350):t,this},this.setUA(i),this}),"UAParser");K.VERSION="0.7.33",K.BROWSER=G([c,f,"major"]),K.CPU=G([d]),K.DEVICE=G([u,p,h,g,y,m,v,_,b]),K.ENGINE=K.OS=G([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=K),t.UAParser=K):typeof define===i&&define.amd?define((function(){return K})):typeof n!==o&&(n.UAParser=K);var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Z=new K;J.ua=Z.getResult(),J.ua.get=function(){return Z.getUA()},J.ua.set=function(t){Z.setUA(t);var e=Z.getResult();for(var n in e)J.ua[n]=e[n]}}}("object"==typeof window?window:t)})),_g=se(((t,e)=>{v();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(t){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}})),xI=se(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),wI=se(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).TinyQueue=r()})),MI=se(((t,e)=>{v(),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")})),PI=se(((t,e)=>{v(),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")})),kI=se(((t,e)=>{v();var n=MI(),r=PI();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})),OI=se(((t,e)=>{var n,r;v(),n=t,r=function(t){"use strict";let e=134217729;function n(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 r(t){return new Float64Array(t)}l(n,"r"),l(r,"o");let i=r(4),o=r(8),s=r(12),a=r(16),u=r(4);t.orient2d=function(t,r,l,c,h,p){let f=(r-p)*(l-h),d=(t-h)*(c-p),g=f-d;if(0===f||0===d||f>0!=d>0)return g;let y=Math.abs(f+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,r,l,c,h,p,f){let d,g,y,v,m,_,b,w,x,E,I,N,S,C,M,O,P,L,A=t-h,T=l-h,D=r-p,R=c-p;m=(M=(w=A-(b=(_=e*A)-(_-A)))*(E=R-(x=(_=e*R)-(_-R)))-((C=A*R)-b*x-w*x-b*E))-(I=M-(P=(w=D-(b=(_=e*D)-(_-D)))*(E=T-(x=(_=e*T)-(_-T)))-((O=D*T)-b*x-w*x-b*E))),i[0]=M-(I+m)+(m-P),m=(S=C-((N=C+I)-(m=N-C))+(I-m))-(I=S-O),i[1]=S-(I+m)+(m-O),m=(L=N+I)-N,i[2]=N-(L-m)+(I-m),i[3]=L;let k=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,i),F=22204460492503146e-32*f;if(k>=F||-k>=F||(d=t-(A+(m=t-A))+(m-h),y=l-(T+(m=l-T))+(m-h),g=r-(D+(m=r-D))+(m-p),v=c-(R+(m=c-R))+(m-p),0===d&&0===g&&0===y&&0===v)||(F=11093356479670487e-47*f+33306690738754706e-32*Math.abs(k),(k+=A*v+R*d-(D*y+T*g))>=F||-k>=F))return k;m=(M=(w=d-(b=(_=e*d)-(_-d)))*(E=R-(x=(_=e*R)-(_-R)))-((C=d*R)-b*x-w*x-b*E))-(I=M-(P=(w=g-(b=(_=e*g)-(_-g)))*(E=T-(x=(_=e*T)-(_-T)))-((O=g*T)-b*x-w*x-b*E))),u[0]=M-(I+m)+(m-P),m=(S=C-((N=C+I)-(m=N-C))+(I-m))-(I=S-O),u[1]=S-(I+m)+(m-O),m=(L=N+I)-N,u[2]=N-(L-m)+(I-m),u[3]=L;let z=n(4,i,4,u,o);m=(M=(w=A-(b=(_=e*A)-(_-A)))*(E=v-(x=(_=e*v)-(_-v)))-((C=A*v)-b*x-w*x-b*E))-(I=M-(P=(w=D-(b=(_=e*D)-(_-D)))*(E=y-(x=(_=e*y)-(_-y)))-((O=D*y)-b*x-w*x-b*E))),u[0]=M-(I+m)+(m-P),m=(S=C-((N=C+I)-(m=N-C))+(I-m))-(I=S-O),u[1]=S-(I+m)+(m-O),m=(L=N+I)-N,u[2]=N-(L-m)+(I-m),u[3]=L;let j=n(z,o,4,u,s);m=(M=(w=d-(b=(_=e*d)-(_-d)))*(E=v-(x=(_=e*v)-(_-v)))-((C=d*v)-b*x-w*x-b*E))-(I=M-(P=(w=g-(b=(_=e*g)-(_-g)))*(E=y-(x=(_=e*y)-(_-y)))-((O=g*y)-b*x-w*x-b*E))),u[0]=M-(I+m)+(m-P),m=(S=C-((N=C+I)-(m=N-C))+(I-m))-(I=S-O),u[1]=S-(I+m)+(m-O),m=(L=N+I)-N,u[2]=N-(L-m)+(I-m),u[3]=L;let B=n(j,s,4,u,a);return a[B-1]}(t,r,l,c,h,p,y)},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&&void 0!==e?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).predicates={})})),FI=se(((t,e)=>{v();var n=xI(),r=wI(),i=kI(),o=OI().orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=y(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(),v=d.p,b=d.next.p,w=_(v,b);if(!(w<f)){var x=w/p;(c=a(o,d.prev.p,v,b,d.next.next.p,x,h))&&Math.min(_(c,v),_(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 y(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,N=E;0===E?(u=0,I=1,h=x,N=b):(h=m*x-_*w,(u=_*x-b*w)<0?(u=0,h=x,N=b):u>I&&(u=I,h=x+_,N=b)),h<0?(h=0,-w<0?u=0:-w>m?u=I:(u=-w,I=m)):h>N&&(h=N,-w+_<0?u=0:-w+_>m?u=I:(u=-w+_,I=m));var S=(1-(c=0===h?0:h/N))*i+c*s-((1-(l=0===u?0:u/I))*t+l*n),C=(1-c)*o+c*a-((1-l)*e+l*r);return S*S+C*C}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(y,"fastConvexHull"),l(m,"insertNode"),l(_,"getSqDist"),l(b,"sqSegDist"),l(w,"sqSegSegDist"),l(x,"compareByX"),l(E,"convexHull")})),GI=se(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):n.quickselect=r()})),k1=se(((t,e)=>{v(),e.exports=r,e.exports.default=r;var n=GI();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 y(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(!y(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],y(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(!y(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],y(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(y,"intersects"),l(m,"createNode"),l(_,"multiSelect")})),KI=se(((t,e)=>{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=A(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=A(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&&y(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)&&N(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=L(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=L(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 y(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&&!M(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 N(t,e,n,r){var i=C(E(t,e,n)),o=C(E(t,e,r)),s=C(E(n,r,t)),a=C(E(n,r,e));return!!(i!==o&&s!==a||0===i&&S(t,n,e)||0===o&&S(t,r,e)||0===s&&S(n,t,r)||0===a&&S(n,e,r))}function S(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 C(t){return t>0?1:t<0?-1:0}function M(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&&N(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 L(t,e){var n=new D(t.i,t.x,t.y),r=new D(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 A(t,e,n,r){var i=new D(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 D(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}v(),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(y,"indexCurve"),l(m,"sortLinked"),l(_,"zOrder"),l(b,"getLeftmost"),l(w,"pointInTriangle"),l(x,"isValidDiagonal"),l(E,"area"),l(I,"equals"),l(N,"intersects"),l(S,"onSegment"),l(C,"sign"),l(M,"intersectsPolygon"),l(O,"locallyInside"),l(P,"middleInside"),l(L,"splitPolygon"),l(A,"insertNode"),l(T,"removeNode"),l(D,"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}})),JI=se(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),q1=se((t=>{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(!N(t[0])||!N(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 y(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 y(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 N(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function S(t){return!!t&&t.constructor===Object}function C(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(!N(t))throw new Error("bbox must only contain numbers")}))}function M(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")}v(),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(y,"radiansToLength"),t.radiansToLength=y,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(N,"isNumber"),t.isNumber=N,l(S,"isObject"),t.isObject=S,l(C,"validateBBox"),t.validateBBox=C,l(M,"validateId"),t.validateId=M})),U1=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0});var e=q1();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 y(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 y(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(y,"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=y,t.lineReduce=m,t.propEach=i,t.propReduce=o,t.segmentEach=d,t.segmentReduce=g})),sP=se((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0});var e=U1();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})),Rg=se(((t,e)=>{v();var n=JI(),r=q1(),i=U1(),o=sP().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})),J1=se(((t,e)=>{v();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")})),NP=se(((t,e)=>{var n,r,i,o,s,a,u,c,h,p,f,d;v(),Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=J1(),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("undefined"==typeof window)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(t){return!0}}catch(t){return!0}return!1}(),d=l((function(t){if("undefined"==typeof window||!f)return h(t);try{return h(t)}catch(t){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})),zg=se(((t,e)=>{v();var n=Array.prototype.slice,r=J1(),i=Object.keys,o=i?l((function(t){return i(t)}),"keys"):NP(),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})),RP=se(((t,e)=>{v(),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")})),e_=se(((t,e)=>{v();var n=RP();e.exports=l((function(){return n()&&!!Symbol.toStringTag}),"hasToStringTagShams")})),BP=se(((t,e)=>{v(),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")})),qP=se(((t,e)=>{v();var n="undefined"!=typeof Symbol&&Symbol,r=BP();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),UP=se(((t,e)=>{v();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")})),hp=se(((t,e)=>{v();var n=UP();e.exports=Function.prototype.bind||n})),r_=se(((t,e)=>{v();var n=hp();e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),o_=se(((t,e)=>{v();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch(t){try{return a(arguments,"callee").get}catch(t){return u}}}():u,h=qP()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=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"]},_=hp(),b=r_(),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),N=_.call(Function.call,RegExp.prototype.exec),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/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,C,"$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=y(i)),void 0===s&&!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===N(/^%?[^%]*%?$/g,t))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=M(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")})),Vg=se(((t,e)=>{v();var n=hp(),r=o_(),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(t){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})),s_=se(((t,e)=>{v();var n=o_(),r=Vg(),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")})),aS=se(((t,e)=>{v();var n=e_()(),r=s_()("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})),c_=se(((t,e)=>{v();var n=zg(),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(t){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})),f_=se(((t,e)=>{v();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")})),p_=se(((t,e)=>{v();var n=f_();e.exports=l((function(){return"function"==typeof Object.is?Object.is:n}),"getPolyfill")})),dS=se(((t,e)=>{v();var n=p_(),r=c_();e.exports=l((function(){var t=n();return r(Object,{is:t},{is:l((function(){return Object.is!==t}),"testObjectIs")}),t}),"shimObjectIs")})),yS=se(((t,e)=>{v();var n=c_(),r=Vg(),i=f_(),o=p_(),s=dS(),a=r(o(),Object);n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),ES=se(((t,e)=>{v();var n,r,i,o,s=s_(),a=e_()();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")})),IS=se(((t,e)=>{v(),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")})),CS=se(((t,e)=>{v();var n="undefined"!=typeof Symbol&&Symbol,r=IS();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),AS=se(((t,e)=>{v();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch(t){try{return a(arguments,"callee").get}catch(t){return u}}}():u,h=CS()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=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"]},_=hp(),b=r_(),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),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/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,S,"$1"):e||t})),i}),"stringToPath"),M=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=y(i)),void 0===s&&!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=C(t),i=n.length>0?n[0]:"",s=M("%"+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")})),RS=se(((t,e)=>{v();var n=AS()("%Object.defineProperty%",!0),r=l((function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1}),"hasPropertyDescriptors");r.hasArrayLengthDefineBug=l((function(){if(!r())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}}),"hasArrayLengthDefineBug"),e.exports=r})),Kg=se(((t,e)=>{v();var n=zg(),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=RS()(),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})),qS=se(((t,e)=>{v();var n=l((function(){return"string"==typeof l((function(){}),"f").name}),"functionsHaveNames"),r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){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})),x_=se(((t,e)=>{v();var n=qS().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"})})),w_=se(((t,e)=>{v();var n=x_(),r=Kg().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")})),XS=se(((t,e)=>{v();var n=Kg().supportsDescriptors,r=w_(),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")})),$S=se(((t,e)=>{v();var n=Kg(),r=Vg(),i=x_(),o=w_(),s=XS(),a=r(o());n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),JS=se(((t,e)=>{v();var n=Date.prototype.getDay,r=l((function(t){try{return n.call(t),!0}catch(t){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")})),E_=se(((t,e)=>{v();var n=zg(),r=aS(),i=yS(),o=ES(),s=$S(),a=JS(),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(t){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})),R_=se(((t,e)=>{v();var n=E_(),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})),mC=se(((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)}v(),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)},void 0!==e&&e.exports&&(e.exports=n)})),vC=se(((t,e)=>{function n(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}v(),l(n,"KMEANS"),n.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(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++)void 0===e[t=this.assignments[n]]&&(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)},void 0!==e&&e.exports&&(e.exports=n)})),D_=se(((t,e)=>{function n(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}v(),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))},void 0!==e&&e.exports&&(e.exports=n)})),_C=se(((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)}v(),void 0!==e&&e.exports&&(n=D_()),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)},void 0!==e&&e.exports&&(e.exports=r)})),bC=se(((t,e)=>{v(),void 0!==e&&e.exports&&(e.exports={DBSCAN:mC(),KMEANS:vC(),OPTICS:_C(),PriorityQueue:D_()})})),F_=se(((t,e)=>{v(),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")}})),IC=se(((t,e)=>{v();var n=F_(),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")}})),NC=se(((t,e)=>{v();var n=F_(),r=IC(),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=[],N=(u=[],0);N<e;N++)I[N]=y?a(g,0,I[N]):0,u[N]=l[N];if(y){for(var S=0;S<e;S++)l[S]=[];for(var C=0;C<d;C++)for(var M=I[c[C]],O=t[C],P=0;P<g;P++)M[P]+=O[P];p=!0;for(var L=0;L<e;L++){for(var A=l[L],T=I[L],D=u[L],R=v[L],k=0;k<g;k++)A[k]=T[k]/R||0;if(p)for(var F=0;F<g;F++)if(D[F]!=A[F]){p=!1;break}}}else{for(var z=0;z<d;z++){I[c[z]]+=t[z]}for(var j=0;j<e;j++)l[j]=I[j]/v[j]||0;p=!0;for(var B=0;B<e;B++)if(u[B]!=l[B]){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})),Sl=se(((t,e)=>{var n,r;v(),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}(),N=new E,S=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=S(r,i);return x(o,0)}),"compareVectorAngles"),P=l((function(t){return Math.sqrt(M(t,t))}),"length"),L=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 S(i,r)/P(i)/P(r)}),"sineOfAngle"),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 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"),D=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 D(n,r,t.x);if(0===r.x)return D(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=S(e,r);if(0==i)return null;var o={x:n.x-t.x,y:n.y-t.y},s=S(o,e)/i,a=S(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"),k=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:z.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:L(e.point,t.point,i.point),cosine:A(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}(),F=0,z=function(){function e(n,r,i,o){t(this,e),this.id=++F,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)?N.round(p.x,p.y):null}),"getIntersection")},{key:"split",value:l((function(t){var n=[],r=void 0!==t.events,i=new k(t,!0),o=new k(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 k.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),k.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(H.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===H.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(H.type))}return this._isInResult}),"isInResult")}],[{key:"fromRing",value:l((function(t,n,r){var i,o,s,a=k.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 k(i,!0),new k(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=N.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=N.round(n[a][0],n[a][1]);u.x===s.x&&u.y===s.y||(this.segments.push(z.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(z.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}(),B=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}(),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");try{"number"==typeof n[0][0][0]&&(n=[n])}catch(t){}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 B(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}(),q=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];k.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}(),U=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 U(i));else{var o=i.enclosingRing();o.poly||e.push(new U(o)),o.poly.addInterior(i)}}return e}),"_composePolys")}]),e}(),X=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z.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||k.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,N=E.length;I<N;I++)n.push(E[I]);if(!a.isAnEndpoint(x))for(var S=this._splitSafely(a,x),C=0,M=S.length;C<M;C++)n.push(S[C])}}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}(),Y=void 0!==C&&C.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,W=void 0!==C&&C.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,H=new(function(){function e(){t(this,e)}return l(e,"Operation"),n(e,[{key:"run",value:l((function(t,e,n){H.type=t,N.reset();for(var r=[new G(e,!0)],i=0,o=n.length;i<o;i++)r.push(new G(n[i],!1));if(H.numMultiPolys=r.length,"difference"===H.type)for(var s=r[0],a=1;a<r.length;)null!==_(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===H.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(k.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>Y)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 X(d),x=d.size,E=d.pop();E;){var I=E.key;if(d.size===x){var S=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(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Y)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 C=w.process(I),M=0,O=C.length;M<O;M++){var P=C[M];void 0===P.consumedBy&&d.insert(P)}x=d.size,E=d.pop()}N.reset();var L=q.factory(w.segments);return new V(L).getGeom()}),"run")}]),e}()),$=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 H.run("union",t,n)}),"union"),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 H.run("intersection",t,n)}),"intersection"),J=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 H.run("xor",t,n)}),"xor"),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 H.run("difference",t,n)}),"difference");return{union:$,intersection:K,xor:J,difference:Z}},"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).polygonClipping=r()})),$C=se(((t,e)=>{var n,r;v(),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"),N=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"),S={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};N.prototype.setOrdinate=function(t,e){switch(t){case N.X:this.x=e;break;case N.Y:this.y=e;break;case N.Z:this.z=e;break;default:throw new _("Invalid ordinate index: "+t)}},N.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)}},N.prototype.getOrdinate=function(t){switch(t){case N.X:return this.x;case N.Y:return this.y;case N.Z:return this.z}throw new _("Invalid ordinate index: "+t)},N.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)},N.prototype.equals=function(t){return t instanceof N&&this.equals2D(t)},N.prototype.equalInZ=function(t,e){return m.equalsWithTolerance(this.z,t.z,e)},N.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},N.prototype.clone=function(){},N.prototype.copy=function(){return new N(this)},N.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},N.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)},N.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},N.prototype.hashCode=function(){var t=17;return 37*(t=37*t+N.hashCode(this.x))+N.hashCode(this.y)},N.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},N.prototype.interfaces_=function(){return[x,E,e]},N.prototype.getClass=function(){return N},N.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=b.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return C},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return b.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(N,S);var C=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");C.prototype.compare=function(t,e){var n=t,r=e,i=C.compare(n.x,r.x);if(0!==i)return i;var o=C.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(n.z,r.z)},C.prototype.interfaces_=function(){return[I]},C.prototype.getClass=function(){return C},C.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 M=l((function(){}),"b");M.prototype.create=function(){},M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M};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 L=l((function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),"T"),A=l((function(){}),"R"),T={LOG_10:{configurable:!0}};A.prototype.interfaces_=function(){return[]},A.prototype.getClass=function(){return A},A.log10=function(t){var e=Math.log(t);return b.isInfinite(e)||b.isNaN(e)?e:e/A.LOG_10},A.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},A.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}},A.wrap=function(t,e){return t<0?e- -t%e:t%e},A.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}},A.average=function(t,e){return(t+e)/2},T.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(A,T);var D=l((function(t){this.str=t}),"D");D.prototype.append=function(t){this.str+=t},D.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},D.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 k=l((function(){}),"A");k.isWhitespace=function(t){return t<=32&&t>=0||127===t},k.toUpperCase=function(t){return t.toUpperCase()};var F=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"),z={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}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=F.magnitude(n._hi),i=F.TEN.pow(r);(n=n.divide(i)).gt(F.TEN)?(n=n.divide(F.TEN),r+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),r-=1);for(var o=r+1,s=new D,a=F.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(F.valueOf(u)).multiply(F.TEN),c&&n.selfAdd(F.TEN);var p=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-l&&(p=!1),!p)break}return e[0]=r,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){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)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof F){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=F.SPLIT*l)-(i=u-l))*(s=(h=F.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}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){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=F.SPLIT*o)-(e=s-o)),l=e*(r=(l=F.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 F(l=o+s,o-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return b.isNaN(u)?F.createNaN():F.copy(this).selfDivide(u,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.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},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.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},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},F.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof F){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}},F.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof F){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=F.SPLIT*this._hi)-this._hi,u=F.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}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return b.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return b.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.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."+F.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},F.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=F.SPLIT*n)-(i=s-n)),o=(a=F.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 F(l,n-l+s)},F.prototype.toSciNotation=function(){if(this.isZero())return F.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=F.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},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.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 F){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}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,x,E]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new F(e)}},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;k.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 F,s=0,a=0,l=0;!(e>=n);){var u=t.charAt(e);if(e++,k.isDigit(u)){var c=u-"0";o.selfMultiply(F.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=F.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=F.TEN.pow(-f);p=o.multiply(g)}return r?p.negate():p},F.createNaN=function(){return new F(b.NaN,b.NaN)},F.copy=function(t){return new F(t)},F.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},F.stringOfChar=function(t,e){for(var n=new D,r=0;r<e;r++)n.append(t);return n.toString()},z.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},z.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},z.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},z.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},z.NaN.get=function(){return new F(b.NaN,b.NaN)},z.EPS.get=function(){return 123259516440783e-46},z.SPLIT.get=function(){return 134217729},z.MAX_PRINT_DIGITS.get=function(){return 32},z.TEN.get=function(){return F.valueOf(10)},z.ONE.get=function(){return F.valueOf(1)},z.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},z.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,z);var j=l((function(){}),"q"),B={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=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.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=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),l=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),u=a.subtract(l).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),h=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),p=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),d=F.valueOf(n.y).selfAdd(F.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new N(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},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,B);var G=l((function(){}),"V"),q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};q.X.get=function(){return 0},q.Y.get=function(){return 1},q.Z.get=function(){return 2},q.M.get=function(){return 3},G.prototype.setOrdinate=function(t,e,n){},G.prototype.size=function(){},G.prototype.getOrdinate=function(t,e){},G.prototype.getCoordinate=function(){},G.prototype.getCoordinateCopy=function(t){},G.prototype.getDimension=function(){},G.prototype.getX=function(t){},G.prototype.clone=function(){},G.prototype.expandEnvelope=function(t){},G.prototype.copy=function(){},G.prototype.getY=function(t){},G.prototype.toCoordinateArray=function(){},G.prototype.interfaces_=function(){return[E]},G.prototype.getClass=function(){return G},Object.defineProperties(G,q);var U=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}(U),X=l((function(){}),"Y");X.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},X.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=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 N&&arguments[1]instanceof N){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");Y.prototype.getY=function(){var t=this.y/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(b.isNaN(t)||b.isInfinite(t))throw new V;return t},Y.prototype.getCoordinate=function(){var t=new N;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var 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 N(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 N){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"),H={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 N){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 N){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 N){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 N){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 N((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 N){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+N.hashCode(this._minx))+N.hashCode(this._maxx))+N.hashCode(this._miny))+N.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))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,H);var $={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*$/},K=l((function(t){this.geometryFactory=t||new me}),"K");K.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=$.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=$.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Z[n]&&(e=Z[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},K.prototype.write=function(t){return this.extractGeometry(t)},K.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!J[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+J[e].apply(this,[t])+")"};var J={coordinate:function(t){return t.x+" "+t.y},point:function(t){return J.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+J.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(J.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(J.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("("+J.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+J.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+J.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("("+J.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(",")}},Z={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split($.spaces);return this.geometryFactory.createPoint(new N(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($.trimParens,"$1"),r.push(Z.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($.spaces),r.push(new N(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($.spaces),r.push(new N(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($.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace($.trimParens,"$1"),r.push(Z.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($.parenComma),s=[],a=0,l=o.length;a<l;++a)e=o[a].replace($.trimParens,"$1"),n=Z.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($.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace($.trimParens,"$1"),r.push(Z.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 K(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 N,this._intPt[1]=new N,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 D;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=Y.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 N(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);X.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&X.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new N(t),o=new N(e),s=new N(n),a=new N(r),l=new N;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 N(r):0===s?this._intPt[0]=new N(i):0===a?this._intPt[0]=new N(e):0===l&&(this._intPt[0]=new N(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 N&&L(arguments[1],G)){for(var t=arguments[0],e=arguments[1],n=new at(t),r=new N,i=new N,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 N&&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(L(arguments[0],G)){var s=arguments[0],a=s.size();if(a<3)return 0;var l=new N,u=new N,c=new N;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?A.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 N;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 Nt(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),Nt=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),St=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 N&&"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 N){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 N(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(It),Ct=l((function(){}),"Lt"),Mt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Mt.ForwardComparator.get=function(){return Ot},Mt.BidirectionalComparator.get=function(){return Pt},Mt.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Ct.indexOf(r,e)<0)return r}return null},Ct.scroll=function(t,e){var n=Ct.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);X.arraycopy(t,n,r,0,t.length-n),X.arraycopy(t,0,r,t.length-n,n),X.arraycopy(r,0,t,0,t.length)},Ct.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}},Ct.intersection=function(t,e){for(var n=new St,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Ct.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Ct.removeRepeatedPoints=function(t){return Ct.hasRepeatedPoints(t)?new St(t,!1).toCoordinateArray():t},Ct.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}},Ct.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},Ct.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 N(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 N(r[i+l])},Ct.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},Ct.envelope=function(t){for(var e=new W,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Ct.toCoordinateArray=function(t){return t.toArray(Ct.coordArrayType)},Ct.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Ct.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Ct.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},Ct.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},Ct.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},Ct.extract=function(t,e,n){e=A.clamp(e,0,t.length);var r=(n=A.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(Ct,Mt);var Ot=l((function(){}),"wt");Ot.prototype.compare=function(t,e){return Ct.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=Ct.compare(n,r);return Ct.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=Ct.increasingDirection(n),o=Ct.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 Lt=l((function(){}),"Tt");Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var At=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}(Lt);(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 Dt(this)},e}(o),Dt=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 At).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 kt=l((function(){}),"At");kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},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 Ft(this)};var Ft=l((function(t){this.treeSet_=t,this.position_=0}),"Ft");Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new i};var zt=l((function(){}),"Gt");zt.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])},zt.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"),Bt={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}};Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.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(k.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,Bt);var Gt=l((function(){}),"Vt");Gt.prototype.filter=function(t){},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var qt=l((function(){}),"Ut");qt.prototype.filter=function(t,e){},qt.prototype.isDone=function(){},qt.prototype.isGeometryChanged=function(){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var Ut=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();zt.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(zt.asList(this._geometries)),n=new d(zt.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(L(arguments[0],dt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],Gt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(L(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 Xt(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[kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Ut),Xt=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");Xt.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)},Xt.prototype.getBoundary=function(){return this._geom instanceof Kt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Xt.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()])},Xt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Xt.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 Ct.toCoordinateArray(e)},Xt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new Xt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Xt(e,n).getBoundary()}};var Yt=l((function(){this.count=null}),"kt");Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var Wt=l((function(){}),"jt"),Ht={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)},Ht.NEWLINE.get=function(){return X.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Wt,Ht);var $t=l((function(){}),"Wt");$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.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))},$t.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,G.X)===t.getOrdinate(e-1,G.X)&&t.getOrdinate(0,G.Y)===t.getOrdinate(e-1,G.Y)},$t.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},$t.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if($t.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)$t.copy(e,i-1,r,o,1);return r},$t.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)$t.swap(t,r,e-r)},$t.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)}},$t.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)$t.copyCoord(t,e+o,n,r+o)},$t.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new D;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()}},$t.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?$t.createClosedRing(t,e,4):e.getOrdinate(0,G.X)===e.getOrdinate(n-1,G.X)&&e.getOrdinate(0,G.Y)===e.getOrdinate(n-1,G.Y)?e:$t.createClosedRing(t,e,n+1)},$t.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();$t.copy(e,0,r,0,i);for(var o=i;o<n;o++)$t.copy(e,0,r,o,1);return r};var Kt=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&&$t.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 $t.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(L(arguments[0],dt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Gt)||L(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Xt(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[kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ht),Jt=l((function(){}),"Jt");Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Zt=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(L(arguments[0],dt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],Gt)||L(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[Jt]},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);zt.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);X.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Ct.minCoordinate(e.getCoordinates());Ct.scroll(r,i),X.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],lt.isCCW(e.getCoordinates())===n&&Ct.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(L(t,dt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,Gt))t.filter(this);else if(L(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[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Ut),ne=function(t){function e(e,n){e instanceof N&&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 $t.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}(Kt),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}(Ut),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 Ut?this.editGeometryCollection(t,e):t instanceof te?this.editPolygon(t,e):t instanceof Zt||t instanceof Kt?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 Kt?e.createLineString(n):t instanceof Zt?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 Kt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?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 N}else if(L(arguments[0],G)){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 N}}),"ue"),ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case G.X:this._coordinates[t].x=n;break;case G.Y:this._coordinates[t].y=n;break;case G.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 G.X:return this._coordinates[t].x;case G.Y:return this._coordinates[t].y;case G.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 N(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 D(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[G,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(L(arguments[0],G)){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[M,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}(Lt),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 N){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?L(arguments[0],M)?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 N(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new N(t.getMinX(),t.getMinY()),new N(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new N(t.getMinX(),t.getMinY()),new N(t.getMinX(),t.getMaxY()),new N(t.getMaxX(),t.getMaxY()),new N(t.getMaxX(),t.getMinY()),new N(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Kt(this.getCoordinateSequenceFactory().create(t),this):L(t,G)?new Kt(t,this):void 0:new Kt(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 Kt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof Zt)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 N){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(L(arguments[0],G)){var e=arguments[0];return new Zt(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(L(arguments[0],G)){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 Ut(null,this);if(1===arguments.length){var t=arguments[0];return new Ut(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(L(arguments[0],G)){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(L(arguments[0],G)){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());$t.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 N(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new N(t[0],t[1]),new N(t[2],t[1]),new N(t[2],t[3]),new N(t[0],t[3]),new N(t[0],t[1])])},Point:function(t){var e=new N(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 Ne=l((function(){this.parser=new we(this.geometryFactory)}),"Ce");Ne.prototype.write=function(t){return this.parser.write(t)};var Se=l((function(){}),"Se"),Ce={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.opposite=function(t){return t===Se.LEFT?Se.RIGHT:t===Se.RIGHT?Se.LEFT:t},Ce.ON.get=function(){return 0},Ce.LEFT.get=function(){return 1},Ce.RIGHT.get=function(){return 2},Object.defineProperties(Se,Ce),(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 Me=l((function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),"be");Me.prototype.getCoordinate=function(){return this._minCoord},Me.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},Me.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)},Me.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=Se.LEFT;return n[e].y<n[e+1].y&&(r=Se.RIGHT),r},Me.prototype.getEdge=function(){return this._orientedDe},Me.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])},Me.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)},Me.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)===Se.LEFT&&(this._orientedDe=this._minDe.getSym())},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me};var Oe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new N(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 Le=l((function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Me}),"Te");Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new 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)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Se.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Se.RIGHT)>=1&&e.getDepth(Se.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.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))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new 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},Le.prototype.addReachable=function(t){var e=new v;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Se.LEFT,t.getDepth(Se.RIGHT)),e.setDepth(Se.RIGHT,t.getDepth(Se.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[x]},Le.prototype.getClass=function(){return Le};var Ae=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[Se.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[Se.ON]=o,this.location[Se.LEFT]=s,this.location[Se.RIGHT]=a}}),"t");Ae.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Ae.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},Ae.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},Ae.prototype.isLine=function(){return 1===this.location.length},Ae.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Se.ON]=this.location[Se.ON],e[Se.LEFT]=O.NONE,e[Se.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])},Ae.prototype.getLocations=function(){return this.location},Ae.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Se.LEFT];this.location[Se.LEFT]=this.location[Se.RIGHT],this.location[Se.RIGHT]=t},Ae.prototype.toString=function(){var t=new D;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[Se.LEFT])),t.append(O.toLocationSymbol(this.location[Se.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[Se.RIGHT])),t.toString()},Ae.prototype.setLocations=function(t,e,n){this.location[Se.ON]=t,this.location[Se.LEFT]=e,this.location[Se.RIGHT]=n},Ae.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Ae.prototype.isArea=function(){return this.location.length>1},Ae.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},Ae.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Se.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Ae.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Ae.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Ae.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};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 Ae(e),this.elt[1]=new Ae(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Ae(n.elt[0]),this.elt[1]=new Ae(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Ae(O.NONE),this.elt[1]=new Ae(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 Ae(o,s,a),this.elt[1]=new Ae(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 Ae(O.NONE,O.NONE,O.NONE),this.elt[1]=new Ae(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 Ae(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(Se.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 D;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(Se.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 Ae(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 De=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");De.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())},De.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},De.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)},De.prototype.getLinearRing=function(){return this._ring},De.prototype.getCoordinate=function(t){return this._pts.get(t)},De.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},De.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])}},De.prototype.isHole=function(){return this._isHole},De.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},De.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},De.prototype.addHole=function(t){this._holes.add(t)},De.prototype.isShell=function(){return null===this._shell},De.prototype.getLabel=function(){return this._label},De.prototype.getEdges=function(){return this._edges},De.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},De.prototype.getShell=function(){return this._shell},De.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,Se.RIGHT);if(r===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,r),null}},De.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},De.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)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};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}(De),ke=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}(De),Fe=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");Fe.prototype.setVisited=function(t){this._isVisited=t},Fe.prototype.setInResult=function(t){this._isInResult=t},Fe.prototype.isCovered=function(){return this._isCovered},Fe.prototype.isCoveredSet=function(){return this._isCoveredSet},Fe.prototype.setLabel=function(t){this._label=t},Fe.prototype.getLabel=function(){return this._label},Fe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fe.prototype.updateIM=function(t){nt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fe.prototype.isInResult=function(){return this._isInResult},Fe.prototype.isVisited=function(){return this._isVisited},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var ze=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}(Fe),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 N){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 ze){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 Be=l((function(){}),"Be"),Ge={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&(t-e+4)%4==2},Be.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},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.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?Be.NE:Be.SE:e>=0?Be.NW:Be.SW}if(arguments[0]instanceof N&&arguments[1]instanceof N){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?Be.NE:Be.SE:r.y>=n.y?Be.NW:Be.SW}},Ge.NE.get=function(){return 0},Ge.NW.get=function(){return 1},Ge.SW.get=function(){return 2},Ge.SE.get=function(){return 3},Object.defineProperties(Be,Ge);var qe=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");qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:lt.computeOrientation(t._p0,t._p1,this._p1)},qe.prototype.getDy=function(){return this._dy},qe.prototype.getCoordinate=function(){return this._p0},qe.prototype.setNode=function(t){this._node=t},qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},qe.prototype.getDirectedCoordinate=function(){return this._p1},qe.prototype.getDx=function(){return this._dx},qe.prototype.getLabel=function(){return this._label},qe.prototype.getEdge=function(){return this._edge},qe.prototype.getQuadrant=function(){return this._quadrant},qe.prototype.getNode=function(){return this._node},qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},qe.prototype.computeLabel=function(t){},qe.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Be.quadrant(this._dx,this._dy),nt.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},qe.prototype.interfaces_=function(){return[x]},qe.prototype.getClass=function(){return qe};var Ue=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,Se.LEFT)===O.INTERIOR&&this._label.getLocation(e,Se.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[Se.LEFT]+"/"+this._depth[Se.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===Se.LEFT&&(r=-1);var i=Se.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}(qe),Ve=l((function(){}),"Xe");Ve.prototype.createNode=function(t){return new ze(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var Xe=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");Xe.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)}},Xe.prototype.find=function(t){return this._nodes.find(t)},Xe.prototype.addNode=function(){if(arguments[0]instanceof ze){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof N){var e=arguments[0];return this._nodes.addNode(e)}},Xe.prototype.getNodeIterator=function(){return this._nodes.iterator()},Xe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Xe.prototype.debugPrintln=function(t){X.out.println(t)},Xe.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},Xe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Xe.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&<.computeOrientation(t,e,r)===lt.COLLINEAR&&Be.quadrant(t,e)===Be.quadrant(n,r)},Xe.prototype.getEdgeEnds=function(){return this._edgeEndList},Xe.prototype.debugPrint=function(t){X.out.print(t)},Xe.prototype.getEdgeIterator=function(){return this._edges.iterator()},Xe.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},Xe.prototype.insertEdge=function(t){this._edges.add(t)},Xe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Xe.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ue(n,!0),i=new Ue(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Xe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Xe.prototype.getNodes=function(){return this._nodes.values()},Xe.prototype.findEdge=function(t,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},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Xe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=l((function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),"ke");Ye.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)}},Ye.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},Ye.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)}}},Ye.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},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new ke(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),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},Ye.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},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Xe.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)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var We=l((function(){}),"je");We.prototype.getBounds=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var He=l((function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),"He");He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[We,e]},He.prototype.getClass=function(){return He};var $e=l((function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),"We");$e.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},$e.prototype.size=function(){return this._size},$e.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)},$e.prototype.clear=function(){this._size=0,this._items.clear()},$e.prototype.isEmpty=function(){return 0===this._size},$e.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)},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ke=l((function(){}),"Ke");Ke.prototype.visitItem=function(t){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Je=l((function(){}),"Je");Je.prototype.insert=function(t,e){},Je.prototype.remove=function(t,e){},Je.prototype.query=function(){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Ze=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}};Ze.prototype.getLevel=function(){return this._level},Ze.prototype.size=function(){return this._childBoundables.size()},Ze.prototype.getChildBoundables=function(){return this._childBoundables},Ze.prototype.addChildBoundable=function(t){nt.isTrue(null===this._bounds),this._childBoundables.add(t)},Ze.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ze.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ze.prototype.interfaces_=function(){return[We,e]},Ze.prototype.getClass=function(){return Ze},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ze,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?zt.sort(n,e):zt.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 Ze};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 Ze?t+=this.size(n):n instanceof He&&(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 He&&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 Ze){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?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 He(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 Ze?this.boundablesAtLevel(n,s,i):(nt.isTrue(s instanceof He),-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(L(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)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 Ze?this.query(i,u,s):u instanceof He?s.visitItem(u.getItem()):nt.shouldNeverReachHere())}else if(L(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)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 Ze?this.query(c,g,p):g instanceof He?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 Ze&&(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 Ze){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(L(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(L(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){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(L(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&&L(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 $e;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 He(f,d),v=new en(this.getRoot(),y,g);return this.nearestNeighbour(v)[0]}},n.prototype.interfaces_=function(){return[Je,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}(Ze),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 N(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 St;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 N(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new N(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 N(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new N(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 N&&arguments[1]instanceof N){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 N(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 N,this.p1=new N;else if(1===arguments.length){var t=arguments[0];this.p0=new N(t.p0),this.p1=new N(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 N(e,n),this.p1=new N(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 N){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 N){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new N(t);var e=this.projectionFactor(t),n=new N;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 Y.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 N(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 N){var e=arguments[0];return lt.distancePointLine(e,this.p0,this.p1)}},yn.prototype.pointAlong=function(t){var e=new N;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 N((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=Be.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Be.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),Nn=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"),Sn={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}};Nn.prototype.getEndCapStyle=function(){return this._endCapStyle},Nn.prototype.isSingleSided=function(){return this._isSingleSided},Nn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Nn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Nn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Nn.JOIN_ROUND&&(this._quadrantSegments=Nn.DEFAULT_QUADRANT_SEGMENTS)},Nn.prototype.getJoinStyle=function(){return this._joinStyle},Nn.prototype.setJoinStyle=function(t){this._joinStyle=t},Nn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Nn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Nn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Nn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Nn.prototype.getMitreLimit=function(){return this._mitreLimit},Nn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Nn.prototype.setSingleSided=function(t){this._isSingleSided=t},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn},Nn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Sn.CAP_ROUND.get=function(){return 1},Sn.CAP_FLAT.get=function(){return 2},Sn.CAP_SQUARE.get=function(){return 3},Sn.JOIN_ROUND.get=function(){return 1},Sn.JOIN_MITRE.get=function(){return 2},Sn.JOIN_BEVEL.get=function(){return 3},Sn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Sn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Sn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Nn,Sn);var Cn=l((function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=lt.COUNTERCLOCKWISE,this._inputLine=t||null}),"Ln"),Mn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Cn.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)},Cn.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]=Cn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Cn.prototype.isShallowConcavity=function(t,e,n,r){return lt.computeOrientation(t,e,n)===this._angleOrientation&<.distancePointLine(e,t,n)<r},Cn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Cn.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},Cn.prototype.isConcave=function(t,e,n){return lt.computeOrientation(t,e,n)===this._angleOrientation},Cn.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()},Cn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Cn.DELETE;)e++;return e},Cn.prototype.isShallow=function(t,e,n,r){return lt.distancePointLine(e,t,n)<r},Cn.prototype.collapseLine=function(){for(var t=new St,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Cn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.simplify=function(t,e){return new Cn(t).simplify(e)},Mn.INIT.get=function(){return 0},Mn.DELETE.get=function(){return 1},Mn.KEEP.get=function(){return 1},Mn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Cn,Mn);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 N(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 N(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 Ln=l((function(){}),"Tn"),An={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.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},Ln.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},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},An.PI_TIMES_2.get=function(){return 2*Math.PI},An.PI_OVER_2.get=function(){return Math.PI/2},An.PI_OVER_4.get=function(){return Math.PI/4},An.COUNTERCLOCKWISE.get=function(){return lt.COUNTERCLOCKWISE},An.CLOCKWISE.get=function(){return lt.CLOCKWISE},An.NONE.get=function(){return lt.COLLINEAR},Object.defineProperties(Ln,An);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()===Nn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}),"t"),Dn={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===Se.LEFT||n===lt.COUNTERCLOCKWISE&&this._side===Se.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,Se.LEFT,this._distance,r);var i=new yn;this.computeOffsetSegment(n,Se.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 Nn.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 Nn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Nn.CAP_SQUARE:var l=new N;l.x=Math.abs(this._distance)*Math.cos(a),l.y=Math.abs(this._distance)*Math.sin(a);var u=new N(r.p1.x+l.x,r.p1.y+l.y),c=new N(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=Y.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 N(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()===Nn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Nn.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 N(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new N(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new N(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new N(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=Ln.angle(i,this._seg0.p0),s=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ln.normalize(o+s),l=Ln.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 N(h,p),d=new yn(i,f),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Se.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===Se.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 N;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 N((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 N((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 N(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()===Nn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Nn.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},Dn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Dn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Dn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Dn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Tn,Dn);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&&Ct.reverse(o),o},Rn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Se.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===Se.RIGHT&&(r=-r);var i=Cn.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=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Se.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Se.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 Nn.CAP_ROUND:e.createCircle(t);break;case Nn.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=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Se.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Cn.simplify(t,r),l=a.length-1;n.initSideSegments(a[0],a[1],Se.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 N(t[n]);return e};var kn=l((function(){this._subgraphs=null,this._seg=new yn,this._cga=new lt;var t=arguments[0];this._subgraphs=t}),"An"),Fn={DepthSegment:{configurable:!0}};kn.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(L(arguments[2],Et)&&arguments[0]instanceof N&&arguments[1]instanceof Ue){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(Se.LEFT);this._seg.p0.equals(l[u])||(c=s.getDepth(Se.RIGHT));var h=new zn(this._seg,c);a.add(h)}}else if(L(arguments[2],Et)&&arguments[0]instanceof N&&L(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)}},kn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:tn.min(e)._leftDepth},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Fn.DepthSegment.get=function(){return zn},Object.defineProperties(kn,Fn);var zn=l((function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new yn(t),this._leftDepth=e}),"Gn");zn.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)},zn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},zn.prototype.toString=function(){return this._upwardSeg.toString()},zn.prototype.interfaces_=function(){return[x]},zn.prototype.getClass=function(){return zn};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!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.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 N(r-c/u,i+h/u)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Y(t.x+n/2,t.y+r/2,1),o=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(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 N(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 N(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 N(a,l)};var Bn=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");Bn.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)},Bn.prototype.addPolygon=function(t){var e=this._distance,n=Se.LEFT;this._distance<0&&(e=-this._distance,n=Se.RIGHT);var r=t.getExteriorRing(),i=Ct.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=Ct.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Se.opposite(n),O.INTERIOR,O.EXTERIOR)}},Bn.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)},Bn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Ct.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Bn.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)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.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=Se.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof te?this.addPolygon(t):t instanceof Kt?this.addLineString(t):t instanceof Zt?this.addPoint(t):(t instanceof ee||t instanceof Vt||t instanceof re||t instanceof Ut)&&this.addCollection(t)},Bn.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},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var Gn=l((function(){}),"Vn");Gn.prototype.locate=function(t){},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var qn=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");qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Ut?(this._subcollectionIterator=new qn(t),this._subcollectionIterator.next()):t},qn.prototype.remove=function(){throw new Error(this.getClass().getName())},qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},qn.prototype.interfaces_=function(){return[xt]},qn.prototype.getClass=function(){return qn},qn.isAtomic=function(t){return!(t instanceof Ut)};var Un=l((function(){this._geom=null;var t=arguments[0];this._geom=t}),"zn");Un.prototype.locate=function(t){return Un.locate(t,this._geom)},Un.prototype.interfaces_=function(){return[Gn]},Un.prototype.getClass=function(){return Un},Un.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&<.isPointInRing(t,e.getCoordinates())},Un.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Un.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Un.isPointInRing(t,i))return!1}return!0},Un.containsPoint=function(t,e){if(e instanceof te)return Un.containsPointInPolygon(t,e);if(e instanceof Ut)for(var n=new qn(e);n.hasNext();){var r=n.next();if(r!==e&&Un.containsPoint(t,r))return!0}return!1},Un.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:Un.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,Se.LEFT)!==O.NONE&&(e=r.getLocation(t,Se.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,Se.ON)===O.NONE&&a.setLocation(t,Se.ON,i),a.isArea(t)){var l=a.getLocation(t,Se.LEFT),u=a.getLocation(t,Se.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,Se.LEFT)===O.NONE,"found single null side"),a.setLocation(t,Se.RIGHT,i),a.setLocation(t,Se.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){X.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,Se.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,Se.LEFT),l=s.getLocation(t,Se.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]=Un.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new D;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 Xn=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 Be.isNorthern(i)&&Be.isNorthern(o)?n:Be.isNorthern(i)||Be.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){X.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(Se.LEFT),r=t.getDepth(Se.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(Se.RIGHT,a),a=u.getDepth(Se.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),Yn=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 ze(t,new Xn)},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===Ct.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 Hn=l((function(){this._edges=new It,this._ocaMap=new p}),"Hn");Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Wn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Wn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var $n=l((function(){}),"Wn");$n.prototype.processIntersections=function(t,e,n,r){},$n.prototype.isDone=function(){},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Kn=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");Kn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Kn.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},Kn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Kn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Kn.prototype.getLineIntersector=function(){return this._li},Kn.prototype.hasProperIntersection=function(){return this._hasProper},Kn.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)))},Kn.prototype.hasIntersection=function(){return this._hasIntersection},Kn.prototype.isDone=function(){return!1},Kn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Kn.prototype.interfaces_=function(){return[$n]},Kn.prototype.getClass=function(){return Kn},Kn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Jn=l((function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new N(t),this.segmentIndex=e,this.dist=n}),"Jn");Jn.prototype.getSegmentIndex=function(){return this.segmentIndex},Jn.prototype.getCoordinate=function(){return this.coord},Jn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Jn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Jn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Jn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Jn.prototype.getDistance=function(){return this.dist},Jn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Jn.prototype.interfaces_=function(){return[x]},Jn.prototype.getClass=function(){return Jn};var Zn=l((function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t}),"Qn");Zn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zn.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}},Zn.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)},Zn.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 N(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))},Zn.prototype.add=function(t,e,n){var r=new Jn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Zn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};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=Be.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Be.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][Se.RIGHT]-this._depth[t][Se.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 Zn(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 N(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 D;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,Se.ON),e.getLocation(1,Se.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Se.LEFT),e.getLocation(1,Se.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Se.RIGHT),e.getLocation(1,Se.RIGHT),2))},e}(Fe),ir=l((function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,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 kn(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 Le;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 Kn(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 Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Xe(new Yn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Ye(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,Se.LEFT),n=t.getLocation(0,Se.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(L(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])&&X.out.println(n)}},or.prototype.scale=function(){if(L(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 N(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Ct.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 N(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new N,this._p1Scaled=new N),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 N(this._maxx,this._maxy),this._corner[1]=new N(this._minx,this._maxy),this._corner[2]=new N(this._minx,this._miny),this._corner[3]=new N(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[Ke]},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[$n]},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 U))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(L(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 Nn,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 Nn&&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=A.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 Nn.CAP_ROUND},vr.CAP_BUTT.get=function(){return Nn.CAP_FLAT},vr.CAP_FLAT.get=function(){return Nn.CAP_FLAT},vr.CAP_SQUARE.get=function(){return Nn.CAP_SQUARE},vr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(yr,vr);var mr=l((function(){this._pt=[new N,new N],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 Kt&&arguments[1]instanceof N)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 N){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 N){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Kt)_r.computeDistance(h,p,f);else if(h instanceof te)_r.computeDistance(h,p,f);else if(h instanceof Ut)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 N){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 N((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[qt]},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[Gt]},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 Ut&&e.apply(new Ir(n)),n}};var Nr=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");Nr.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 Kt&&this._lines.add(t)},Nr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Nr.prototype.interfaces_=function(){return[ct]},Nr.prototype.getClass=function(){return Nr},Nr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Nr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Nr.getLines(e,n))}},Nr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Nr.getLines(t,!1)}if(2===arguments.length){if(L(arguments[0],wt)&&L(arguments[1],wt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Nr.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 Nr(a,s)),a}if(arguments[0]instanceof ht&&L(arguments[1],wt)){var l=arguments[0],u=arguments[1];return l instanceof Kt?u.add(l):l.apply(new Nr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&L(arguments[1],wt)){for(var c=arguments[0],h=arguments[1],p=arguments[2],f=c.iterator();f.hasNext();){var d=f.next();Nr.getLines(d,h,p)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ht&&L(arguments[1],wt)){var g=arguments[0],y=arguments[1],v=arguments[2];return g.apply(new Nr(y,v)),y}}};var Sr=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");Sr.prototype.locateInternal=function(){if(arguments[0]instanceof N&&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 N&&arguments[1]instanceof Kt){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 N&&arguments[1]instanceof Zt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?O.INTERIOR:O.EXTERIOR}},Sr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?lt.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Sr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Sr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Sr.prototype.computeLocation=function(t,e){if(e instanceof Zt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Kt)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 Ut)for(var l=new qn(e);l.hasNext();){var u=l.next();u!==e&&this.computeLocation(t,u)}},Sr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof Kt||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)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr};var Cr=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"),Mr={INSIDE_AREA:{configurable:!0}};Cr.prototype.isInsideArea=function(){return this._segIndex===Cr.INSIDE_AREA},Cr.prototype.getCoordinate=function(){return this._pt},Cr.prototype.getGeometryComponent=function(){return this._component},Cr.prototype.getSegmentIndex=function(){return this._segIndex},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Mr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cr,Mr);var Or=l((function(t){this._pts=t||null}),"wi");Or.prototype.filter=function(t){t instanceof Zt&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[Gt]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Zt?tn.singletonList(t):Or.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof Ut&&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 Zt||t instanceof Kt||t instanceof te)&&this._locations.add(new Cr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[Gt]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e};var Lr=l((function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Sr,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");Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,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&&L(arguments[0],Et)&&L(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 Cr&&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 Cr(f,g),null}},Lr.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}},Lr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Nr.getLines(this._geom[0]),n=Nr.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))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation||(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 Kt&&arguments[1]instanceof Zt){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 Cr(t,o,a),n[1]=new Cr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Kt&&arguments[1]instanceof Kt){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 Cr(l,f,m[0]),c[1]=new Cr(u,d,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var 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 Cr(i,0,i.getCoordinate()),n[1]=new Cr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var 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}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Ar=l((function(){this._pt=[new N,new N],this._distance=b.NaN,this._isNull=!0}),"Ri");Ar.prototype.getCoordinates=function(){return this._pt},Ar.prototype.getCoordinate=function(t){return this._pt[t]},Ar.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)}},Ar.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}},Ar.prototype.toString=function(){return Q.toLineString(this._pt[0],this._pt[1])},Ar.prototype.getDistance=function(){return this._distance},Ar.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)}},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var Tr=l((function(){}),"Pi");Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.computeDistance=function(){if(arguments[2]instanceof Ar&&arguments[0]instanceof Kt&&arguments[1]instanceof N)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 Ar&&arguments[0]instanceof te&&arguments[1]instanceof N){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 Ar&&arguments[0]instanceof ht&&arguments[1]instanceof N){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Kt)Tr.computeDistance(h,p,f);else if(h instanceof te)Tr.computeDistance(h,p,f);else if(h instanceof Ut)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 Ar&&arguments[0]instanceof yn&&arguments[1]instanceof N){var v=arguments[0],m=arguments[1],_=arguments[2],b=v.closestPoint(m);_.setMinimum(b,m)}};var Dr=l((function(){this._g0=null,this._g1=null,this._ptDist=new Ar,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),"Di"),Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Dr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Dr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Dr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Dr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Dr.prototype.computeOrientedDistance=function(t,e,n){var r=new kr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Dr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Dr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Dr(n,r);return o.setDensifyFraction(i),o.distance()}},Rr.MaxPointDistanceFilter.get=function(){return kr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Dr,Rr);var kr=l((function(){this._maxPtDist=new Ar,this._minPtDist=new Ar,this._euclideanDist=new Tr,this._geom=null;var t=arguments[0];this._geom=t}),"Ai");kr.prototype.filter=function(t){this._minPtDist.initialize(),Tr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[dt]},kr.prototype.getClass=function(){return kr};var Fr=l((function(){this._maxPtDist=new Ar,this._minPtDist=new Ar,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");Fr.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 N(a,l);this._minPtDist.initialize(),Tr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[qt]},Fr.prototype.getClass=function(){return Fr};var zr=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}};zr.prototype.checkMaximumDistance=function(t,e,n){var r=new Dr(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])+")"}},zr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=zr.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(),zr.VERBOSE&&X.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},zr.prototype.checkNegativeValid=function(){if(!(this._input instanceof te||this._input instanceof re||this._input instanceof Ut))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)},zr.prototype.getErrorIndicator=function(){return this._errorIndicator},zr.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var 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])+" )"}},zr.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)},zr.prototype.getErrorLocation=function(){return this._errorLocation},zr.prototype.getPolygonLines=function(t){for(var e=new It,n=new Nr(e),r=Ir.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},zr.prototype.getErrorMessage=function(){return this._errMsg},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(zr,jr);var Br=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"),Gr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Br.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},Br.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Br.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")},Br.prototype.checkDistance=function(){var t=new zr(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")},Br.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")},Br.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")},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.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"))},Br.prototype.report=function(t){if(!Br.VERBOSE)return null;X.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Br.prototype.getErrorMessage=function(){return this._errorMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.isValidMsg=function(t,e,n){var r=new Br(t,e,n);return r.isValid()?null:r.getErrorMessage()},Br.isValid=function(t,e,n){return!!new Br(t,e,n).isValid()},Gr.VERBOSE.get=function(){return!1},Gr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Gr);var qr=l((function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"Ui");qr.prototype.getCoordinates=function(){return this._pts},qr.prototype.size=function(){return this._pts.length},qr.prototype.getCoordinate=function(t){return this._pts[t]},qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},qr.prototype.setData=function(t){this._data=t},qr.prototype.getData=function(){return this._data},qr.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},qr.prototype.interfaces_=function(){return[fn]},qr.prototype.getClass=function(){return qr};var Ur=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");Ur.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ur.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ur.prototype.getIntersectionSegments=function(){return this._intSegments},Ur.prototype.count=function(){return this._intersectionCount},Ur.prototype.getIntersections=function(){return this._intersections},Ur.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ur.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ur.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++)},Ur.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Ur.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Ur.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Ur.prototype.interfaces_=function(){return[$n]},Ur.prototype.getClass=function(){return Ur},Ur.createAllIntersectionsFinder=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e},Ur.createAnyIntersectionFinder=function(t){return new Ur(t)},Ur.createIntersectionCounter=function(t){var e=new Ur(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 Ur(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 Xr=l((function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))}),"t");Xr.prototype.checkValid=function(){this._nv.checkValid()},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new qr(r.getCoordinates(),r))}return e},Xr.checkValid=function(t){new Xr(t).checkValid()};var Yr=l((function(t){this._mapOp=t}),"ki");Yr.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))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(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()||!Ci.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(Ci.isResultOfOp(r,e)&&e===Ci.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Hr=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");Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Ci.INTERSECTION)){var r=n.getLabel();Ci.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var $r=l((function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),"Wi");$r.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},$r.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)},$r.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},$r.prototype.getInputGeometry=function(){return this._inputGeom},$r.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)},$r.prototype.transformCoordinates=function(t,e){return this.copy(t)},$r.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},$r.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)},$r.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)},$r.prototype.copy=function(t){return t.copy()},$r.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)},$r.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Zt)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 Kt)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 Ut)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},$r.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)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Kr=l((function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new yn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Kt&&"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");Kr.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 N(o)),0===r&&this._isClosed&&t.set(t.size()-1,new N(o)))}},Kr.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},Kr.prototype.snapTo=function(t){var e=new St(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Kr.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 N(i),!1)}},Kr.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},Kr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Jr=l((function(t){this._srcGeom=t||null}),"Ji"),Zr={SNAP_PRECISION_FACTOR:{configurable:!0}};Jr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Qr(e,n).transform(this._srcGeom)},Jr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Qr(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,Qt)&&(i=r.buffer(0)),i},Jr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Jr.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))},Jr.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},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Jr(t);r[0]=i.snapTo(e,n);var o=new Jr(e);return r[1]=o.snapTo(r[0],n),r},Jr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Jr.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(Jr.computeOverlaySnapTolerance(i),Jr.computeOverlaySnapTolerance(o))}},Jr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jr.SNAP_PRECISION_FACTOR},Jr.snapToSelf=function(t,e,n){return new Jr(t).snapToSelf(e,n)},Zr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jr,Zr);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 Kr(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}($r),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 0!=(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 N(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 N(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[qt]},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 Jr(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=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(n)},oi.prototype.checkValid=function(t){t.isValid()||X.out.println("Snapped geometry is invalid")},oi.prototype.computeSnapTolerance=function(){this._snapTolerance=Jr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},oi.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jr.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,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.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=Ci.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,Ci.UNION)},si.intersection=function(t,e){return si.overlayOp(t,e,Ci.INTERSECTION)},si.symDifference=function(t,e){return si.overlayOp(t,e,Ci.SYMDIFFERENCE)},si.difference=function(t,e){return si.overlayOp(t,e,Ci.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&&L(arguments[0],Et)&&L(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]&&L(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 N(this._min,0),new N(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){X.out.println(Q.toLineString(new N(t._min,this._level),new N(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[Ke]},_i.prototype.getClass=function(){return _i};var bi=l((function(){this._index=null;var t=arguments[0];if(!L(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[Gn]},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[Ke]},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=Nr.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 Sr,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,Se.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 Zt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof N){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=Ct.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=Ct.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 Kt)this.addLineString(e);else if(e instanceof Zt)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 Ut))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,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}(Xe),Ni=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");Ni.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ni.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var Si=l((function(){}),"Sr");Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof ht&&L(arguments[1],Si.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(L(arguments[0],wt)&&L(arguments[1],Si.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}},Si.MapOp=function(){};var Ci=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Sr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Xe(new Yn),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(),Xr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Wr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(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,Se.RIGHT),i.getLocation(1,Se.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,Se.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Se.LEFT,r.getLocation(i,Se.LEFT)),nt.isTrue(!r.isNull(i,Se.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Se.RIGHT,r.getLocation(i,Se.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}(Ni);Ci.overlayOp=function(t,e,n){return new Ci(t,e).getResultGeometry(n)},Ci.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ci.createEmptyResult(Ci.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[Si.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Ci.INTERSECTION)},Ci.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.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,Ci.SYMDIFFERENCE)},Ci.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ci.INTERSECTION:o=Math.min(r,i);break;case Ci.UNION:o=Math.max(r,i);break;case Ci.DIFFERENCE:o=r;break;case Ci.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ci.createEmptyResult=function(t,e,n,r){var i=null;switch(Ci.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},Ci.difference=function(t,e){return t.isEmpty()?Ci.createEmptyResult(Ci.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),si.overlayOp(t,e,Ci.DIFFERENCE))},Ci.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ci.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 Ci.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Ci.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Ci.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Ci.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Ci.INTERSECTION=1,Ci.UNION=2,Ci.DIFFERENCE=3,Ci.SYMDIFFERENCE=4;var Mi=l((function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Sr,this._seg=new yn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)}),"br");Mi.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},Mi.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Mi.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};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[Gt]},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=Nr.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 N(u-l,c+a);r.add(h)}if(this._doRight){var p=new N(u+l,c-a);r.add(p)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Li=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 Mi(this._geom[0],this._boundaryDistanceTolerance),new Mi(this._geom[1],this._boundaryDistanceTolerance),new Mi(this._geom[2],this._boundaryDistanceTolerance)]}),"t"),Ai={TOLERANCE:{configurable:!0}};Li.prototype.reportResult=function(t,e,n){X.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.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),!!Li.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.prototype.isValidResult=function(t,e){var n=Ci.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Jr.computeSizeBasedSnapTolerance(t),Jr.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ai.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ai);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 Di=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}};Di.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,Et)?i=this.unionTree(r):r instanceof ht&&(i=r),e.add(i)}return e},Di.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)},Di.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)},Di.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(Di.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)},Di.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=Di.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Di.getGeometry(e,n),Di.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)}},Di.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},Di.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Di.prototype.unionActual=function(t,e){return Di.restrictToPolygons(t.union(e))},Di.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Di.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)},Di.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)}},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.restrictToPolygons=function(t){if(L(t,Qt))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Di.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Di.union=function(t){return new Di(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Di,Ri);var ki=l((function(){}),"Ar");ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.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,Ci.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=Ne,t.OverlayOp=Ci,t.UnionOp=ki,t.BufferOp=yr,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r(n.jsts={})})),Nk=se(((t,e)=>{v(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Rk=se(((t,e)=>{v();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(t){}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(i){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(t){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(e){return a(t)}}})),Fk=se(((t,e)=>{v(),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)]}})),jk=se(((t,e)=>{v(),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}})),Wk=se((t=>{v();var e=Nk(),n=Rk(),r=Fk(),i=jk(),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 y(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 Boolean(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(y,"extract"),l(m,"parseValue"),l(_,"parse"),t.extract=y,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:_(y(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=`?${l}`);let u=g(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${l}${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)}})),WN={};function Fb(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function AN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[nc],(function(t){return Ns(Zp(t.data[0],t.data[1]))}),0,n)}function Zp(t,e){return Eu(t,e||{},0,0)}function jb(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[rc],(function(t){return Ns(ac(t.data[0],Ob(t.data[1])))}),1,n)}function ac(t,e){return Kp(t,e)}function L6(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[nc,PN,function(){return[qb]}],(function(t){return Ns(qb(t.data[0],t.data[1]))}),2,n)}function qb(t,e){e||(e={});var n=tc(),r=t.length;n.p(t);var i=Eu(t,e,Rb(e),8),o=i.length;return Ab(i,e),tr(i,o-8,n.d()),tr(i,o-4,r),i}function RN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[rc,SN,function(){return[Wm]}],(function(t){return Ns(Wm(t.data[0]))}),3,n)}function Wm(t,e){return Kp(t.subarray(Lb(t),-8),e||new jt(NN(t)))}function D6(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[nc,CN,function(){return[Ub]}],(function(t){return Ns(Ub(t.data[0],t.data[1]))}),4,n)}function Ub(t,e){e||(e={});var n=Nb();n.p(t);var r=Eu(t,e,2,4);return Db(r,e),tr(r,r.length-4,n.d()),r}function FN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),ic(t,e,[rc,kN,function(){return[$m]}],(function(t){return Ns($m(t.data[0],Ob(t.data[1])))}),5,n)}function $m(t,e){return Kp((ON(t),t.subarray(2,-4)),e)}function B6(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),31==t[0]&&139==t[1]&&8==t[2]?RN(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?jb(t,e,n):FN(t,e,n)}function j6(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Wm(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?ac(t,e):$m(t,e)}function Os(t,e){if(e){for(var n=new jt(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(jN)return jN.encode(t);var i=t.length,o=new jt(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 jt(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 uo(o,0,s)}function Yb(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(Xb)return Xb.decode(t);var i=qN(t),o=i[0];return i[1].length&&Le(8),o}function X6(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Le(7);var r={};Vb(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){Km((function(){n(t,e)}))}),"cbd");Km((function(){f=n}));var d=l((function(){var t=new jt(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;sc(t,a,i,i.f,i.u,o);var l=30+i.f.length+Ts(i.extra),h=a+l;t.set(i.c,h),sc(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)}}Wb(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=tc(),v=u.length;y.p(u);var m=Os(e),_=m.length,b=g.comment,w=b&&Os(b),x=w&&w.length,E=Ts(g.extra),I=0==g.level?0:8,N=l((function(n,r){if(n)p(),f(n,null);else{var i=r.length;c[t]=Jp(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&&N(Le(11,0,1),null),I)if(v<16e4)try{N(null,Zp(u,g))}catch(t){N(t,null)}else h.push(AN(u,g,N));else N(null,u)}),"_loop_1"),y=0;y<u;++y)g(y);return p}function Y6(t,e){e||(e={});var n={},r=[];Vb(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=Os(s)).length,p=u.comment,f=p&&Os(p),d=f&&f.length,g=Ts(u.extra);h>65535&&Le(11);var y=c?Zp(l,u):l,v=y.length,m=tc();m.p(l),r.push(Jp(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 jt(o+22),b=i,w=o-i,x=0;x<r.length;++x){var E=r[x];sc(_,E.o,E,E.f,E.u,E.c.length);var I=30+E.f.length+Ts(E.extra);_.set(E.c,E.o+I),sc(_,i,E,E.f,E.u,E.c.length,E.o,E.m),i+=16+I+(E.m?E.m.length:0)}return Wb(_,i,r.length,w,b),_}function K6(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Le(7);var r=[],i=l((function(){for(var t=0;t<r.length;++t)r[t]()}),"tAll"),o={},s=l((function(t,e){Km((function(){n(t,e)}))}),"cbd");Km((function(){s=n}));for(var a=t.length-22;101010256!=Hr(t,a);--a)if(!a||t.length-a>65558)return s(Le(13,0,1),null),i;var u=gi(t,a+8);if(u){var c=u,h=Hr(t,a+16),p=4294967295==h;if(p){if(a=Hr(t,a-12),101075792!=Hr(t,a))return s(Le(13,0,1),null),i;c=u=Hr(t,a+32),h=Hr(t,a+48)}for(var f=e&&e.filter,d=l((function(e){var n=VN(t,h,p),a=n[0],c=n[1],d=n[2],g=n[3],y=n[4],v=n[5],m=UN(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,ac(b,new jt(d)))}catch(t){_(t,null)}else r.push(jb(b,{size:d},_))}else _(Le(14,"unknown compression type "+a,1),null);else _(null,uo(t,m,m+c));else _(null,null)}),"_loop_3"),g=0;g<c;++g)d(g)}else s(null,{});return i}function J6(t,e){for(var n={},r=t.length-22;101010256!=Hr(t,r);--r)(!r||t.length-r>65558)&&Le(13);var i=gi(t,r+8);if(!i)return{};var o=Hr(t,r+16),s=4294967295==o;s&&(r=Hr(t,r-12),101075792!=Hr(t,r)&&Le(13),i=Hr(t,r+32),o=Hr(t,r+48));for(var a=e&&e.filter,l=0;l<i;++l){var u=VN(t,o,s),c=u[0],h=u[1],p=u[2],f=u[3],d=u[4],g=u[5],y=UN(t,g);o=d,(!a||a({name:f,size:h,originalSize:p,compression:c}))&&(c?8==c?n[f]=ac(t.subarray(y,y+h),new jt(p)):Le(14,"unknown compression type "+c):n[f]=uo(t,y,y+h))}return n}dO(WN,{AsyncCompress:()=>A6,AsyncDecompress:()=>F6,AsyncDeflate:()=>TN,AsyncGunzip:()=>LN,AsyncGzip:()=>A6,AsyncInflate:()=>Bb,AsyncUnzipInflate:()=>H6,AsyncUnzlib:()=>DN,AsyncZipDeflate:()=>U6,AsyncZlib:()=>R6,Compress:()=>zb,DecodeUTF8:()=>z6,Decompress:()=>BN,Deflate:()=>fa,EncodeUTF8:()=>q6,FlateErrorCode:()=>O6,Gunzip:()=>Ym,Gzip:()=>zb,Inflate:()=>Ii,Unzip:()=>$6,UnzipInflate:()=>W6,UnzipPassThrough:()=>YN,Unzlib:()=>Hm,Zip:()=>V6,ZipDeflate:()=>G6,ZipPassThrough:()=>Qp,Zlib:()=>Gb,compress:()=>L6,compressSync:()=>qb,decompress:()=>B6,decompressSync:()=>j6,deflate:()=>AN,deflateSync:()=>Zp,gunzip:()=>RN,gunzipSync:()=>Wm,gzip:()=>L6,gzipSync:()=>qb,inflate:()=>jb,inflateSync:()=>ac,strFromU8:()=>Yb,strToU8:()=>Os,unzip:()=>K6,unzipSync:()=>J6,unzlib:()=>FN,unzlibSync:()=>$m,zip:()=>X6,zipSync:()=>Y6,zlib:()=>D6,zlibSync:()=>Ub});var fN,N6,jt,ti,$l,Kl,Jl,Wp,pN,hN,Pb,jm,dN,gN,Sb,Hp,Ha,ao,$a,Zl,Zt,mN,vN,yN,_N,zm,so,qm,$p,uo,O6,bN,Le,Kp,ca,Ql,Gm,Um,Cb,ec,Vm,kb,xN,Ka,wN,EN,tc,Nb,Eu,Jp,MN,Xm,T6,IN,rc,nc,PN,SN,CN,kN,Ns,Ob,ic,lo,oc,gi,Hr,Tb,tr,Ab,Lb,NN,Rb,Db,ON,fa,TN,Ii,Bb,zb,A6,Ym,LN,Gb,R6,Hm,DN,BN,F6,Vb,jN,Xb,zN,qN,z6,q6,GN,UN,VN,XN,Ts,sc,Wb,Qp,G6,U6,V6,YN,W6,H6,$6,Km,HN=bx((()=>{for(v(),fN={},N6=l((function(t,e,n,r,i){var o=new Worker(fN[e]||(fN[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"),jt=Uint8Array,ti=Uint16Array,$l=Uint32Array,Kl=new jt([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]),Jl=new jt([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]),Wp=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pN=l((function(t,e){for(var n=new ti(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new $l(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"),hN=pN(Kl,2),Pb=hN[0],jm=hN[1],Pb[28]=258,jm[258]=28,dN=pN(Jl,0),gN=dN[0],Sb=dN[1],Hp=new ti(32768),Zt=0;Zt<32768;++Zt)Ha=(61680&(Ha=(52428&(Ha=(43690&Zt)>>>1|(21845&Zt)<<1))>>>2|(13107&Ha)<<2))>>>4|(3855&Ha)<<4,Hp[Zt]=((65280&Ha)>>>8|(255&Ha)<<8)>>>1;for(ao=l((function(t,e,n){for(var r=t.length,i=0,o=new ti(e);i<r;++i)t[i]&&++o[t[i]-1];var s,a=new ti(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new ti(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[Hp[h]>>>l]=u}else for(s=new ti(r),i=0;i<r;++i)t[i]&&(s[i]=Hp[a[t[i]-1]++]>>>15-t[i]);return s}),"hMap"),$a=new jt(288),Zt=0;Zt<144;++Zt)$a[Zt]=8;for(Zt=144;Zt<256;++Zt)$a[Zt]=9;for(Zt=256;Zt<280;++Zt)$a[Zt]=7;for(Zt=280;Zt<288;++Zt)$a[Zt]=8;for(Zl=new jt(32),Zt=0;Zt<32;++Zt)Zl[Zt]=5;mN=ao($a,9,0),vN=ao($a,9,1),yN=ao(Zl,5,0),_N=ao(Zl,5,1),zm=l((function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e}),"max"),so=l((function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n}),"bits"),qm=l((function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)}),"bits16"),$p=l((function(t){return(t+7)/8|0}),"shft"),uo=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?ti:4==t.BYTES_PER_ELEMENT?$l:jt)(n-e);return r.set(t.subarray(e,n)),r}),"slc"),O6={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},bN=["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"],Le=l((function(t,e,n){var r=new Error(e||bN[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Le),!n)throw r;return r}),"err"),Kp=l((function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new jt(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new jt(3*r));var s=l((function(t){var n=e.length;if(t>n){var r=new jt(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=so(t,u,1);var y=so(t,u+1,3);if(u+=3,!y){var v=t[(M=$p(u)+4)-4]|t[M-3]<<8,m=M+v;if(m>r){o&&Le(0);break}i&&s(c+v),e.set(t.subarray(M,m),c),n.b=c+=v,n.p=u=8*m,n.f=a;continue}if(1==y)h=vN,p=_N,f=9,d=5;else if(2==y){var _=so(t,u,31)+257,b=so(t,u+10,15)+4,w=_+so(t,u+5,31)+1;u+=14;for(var x=new jt(w),E=new jt(19),I=0;I<b;++I)E[Wp[I]]=so(t,u+3*I,7);u+=3*b;var N=zm(E),S=(1<<N)-1,C=ao(E,N,1);for(I=0;I<w;){var M,O=C[so(t,u,S)];if(u+=15&O,(M=O>>>4)<16)x[I++]=M;else{var P=0,L=0;for(16==M?(L=3+so(t,u,3),u+=2,P=x[I-1]):17==M?(L=3+so(t,u,7),u+=3):18==M&&(L=11+so(t,u,127),u+=7);L--;)x[I++]=P}}var A=x.subarray(0,_),T=x.subarray(_);f=zm(A),d=zm(T),h=ao(A,f,1),p=ao(T,d,1)}else Le(1);if(u>g){o&&Le(0);break}}i&&s(c+131072);for(var D=(1<<f)-1,R=(1<<d)-1,k=u;;k=u){var F=(P=h[qm(t,u)&D])>>>4;if((u+=15&P)>g){o&&Le(0);break}if(P||Le(2),F<256)e[c++]=F;else{if(256==F){k=u,h=null;break}var z=F-254;if(F>264){var j=Kl[I=F-257];z=so(t,u,(1<<j)-1)+Pb[I],u+=j}var B=p[qm(t,u)&R],G=B>>>4;B||Le(3),u+=15&B;T=gN[G];if(G>3){j=Jl[G];T+=qm(t,u)&(1<<j)-1,u+=j}if(u>g){o&&Le(0);break}i&&s(c+131072);for(var q=c+z;c<q;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=q}}n.l=h,n.p=k,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:uo(e,0,c)}),"inflt"),ca=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8}),"wbits"),Ql=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"),Gm=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[Ka,0];if(1==i){var s=new jt(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 ti(p+1),d=Um(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 jt(f),d]}),"hTree"),Um=l((function(t,e,n){return-1==t.s?Math.max(Um(t.l,e,n+1),Um(t.r,e,n+1)):e[t.s]=n}),"ln"),Cb=l((function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ti(++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"),ec=l((function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n}),"clen"),Vm=l((function(t,e,n){var r=n.length,i=$p(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"),kb=l((function(t,e,n,r,i,o,s,a,l,u,c){ca(e,c++,n),++i[256];for(var h=Gm(i,15),p=h[0],f=h[1],d=Gm(o,15),g=d[0],y=d[1],v=Cb(p),m=v[0],_=v[1],b=Cb(g),w=b[0],x=b[1],E=new ti(19),I=0;I<m.length;++I)E[31&m[I]]++;for(I=0;I<w.length;++I)E[31&w[I]]++;for(var N=Gm(E,7),S=N[0],C=N[1],M=19;M>4&&!S[Wp[M-1]];--M);var O,P,L,A,T=u+5<<3,D=ec(i,$a)+ec(o,Zl)+s,R=ec(i,p)+ec(o,g)+s+14+3*M+ec(E,S)+(2*E[16]+3*E[17]+7*E[18]);if(T<=D&&T<=R)return Vm(e,c,t.subarray(l,l+u));if(ca(e,c,1+(R<D)),c+=2,R<D){O=ao(p,f,0),P=p,L=ao(g,y,0),A=g;var k=ao(S,C,0);ca(e,c,_-257),ca(e,c+5,x-1),ca(e,c+10,M-4),c+=14;for(I=0;I<M;++I)ca(e,c+3*I,S[Wp[I]]);c+=3*M;for(var F=[m,w],z=0;z<2;++z){var j=F[z];for(I=0;I<j.length;++I){var B=31&j[I];ca(e,c,k[B]),c+=S[B],B>15&&(ca(e,c,j[I]>>>5&127),c+=j[I]>>>12)}}}else O=mN,P=$a,L=yN,A=Zl;for(I=0;I<a;++I)if(r[I]>255){B=r[I]>>>18&31;Ql(e,c,O[B+257]),c+=P[B+257],B>7&&(ca(e,c,r[I]>>>23&31),c+=Kl[B]);var G=31&r[I];Ql(e,c,L[G]),c+=A[G],G>3&&(Ql(e,c,r[I]>>>5&8191),c+=Jl[G])}else Ql(e,c,O[r[I]]),c+=P[r[I]];return Ql(e,c,O[256]),c+P[256]}),"wblk"),xN=new $l([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ka=new jt(0),wN=l((function(t,e,n,r,i,o){var s=t.length,a=new jt(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=Vm(u,c+1,t.subarray(h,p))}else{for(var f=xN[e-1],d=f>>>13,g=8191&f,y=(1<<n)-1,v=new ti(32768),m=new ti(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 $l(25e3),E=new ti(288),I=new ti(32),N=0,S=0,C=(h=0,0),M=0,O=0;h<s;++h){var P=w(h),L=32767&h,A=m[P];if(v[L]=A,m[P]=L,M<=h){var T=s-h;if((N>7e3||C>24576)&&T>423){c=kb(t,u,0,x,E,I,S,C,O,h-O,c),C=N=S=0,O=h;for(var D=0;D<286;++D)E[D]=0;for(D=0;D<30;++D)I[D]=0}var R=2,k=0,F=g,z=L-A&32767;if(T>2&&P==w(h-z))for(var j=Math.min(d,T)-1,B=Math.min(32767,h),G=Math.min(258,T);z<=B&&--F&&L!=A;){if(t[h+R]==t[h+R-z]){for(var q=0;q<G&&t[h+q]==t[h+q-z];++q);if(q>R){if(R=q,k=z,q>j)break;var U=Math.min(z,q-2),V=0;for(D=0;D<U;++D){var X=h-z+D+32768&32767,Y=X-v[X]+32768&32767;Y>V&&(V=Y,A=X)}}}z+=(L=A)-(A=v[L])+32768&32767}if(k){x[C++]=268435456|jm[R]<<18|Sb[k];var W=31&jm[R],H=31&Sb[k];S+=Kl[W]+Jl[H],++E[257+W],++I[H],M=h+R,++N}else x[C++]=t[h],++E[t[h]]}}c=kb(t,u,o,x,E,I,S,C,O,h-O,c),!o&&7&c&&(c=Vm(u,c+1,Ka))}return uo(a,0,r+$p(c)+i)}),"dflt"),EN=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}(),tc=l((function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=EN[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}}),"crc"),Nb=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"),Eu=l((function(t,e,n,r,i){return wN(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"),Jp=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"),MN=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"),Xm=[],T6=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"),IN=l((function(t,e,n,r){var i;if(!Xm[n]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)o=(i=MN(t[l],o,s))[0],s=i[1];Xm[n]=MN(t[a],o,s)}var u=Jp({},Xm[n][1]);return N6(Xm[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,T6(u),r)}),"wrkr"),rc=l((function(){return[jt,ti,$l,Kl,Jl,Wp,Pb,gN,vN,_N,Hp,bN,ao,zm,so,qm,$p,uo,Le,Kp,ac,Ns,Ob]}),"bInflt"),nc=l((function(){return[jt,ti,$l,Kl,Jl,Wp,jm,Sb,mN,$a,yN,Zl,Hp,xN,Ka,ao,ca,Ql,Gm,Um,Cb,ec,Vm,kb,$p,uo,wN,Eu,Zp,Ns]}),"bDflt"),PN=l((function(){return[Ab,Rb,tr,tc,EN]}),"gze"),SN=l((function(){return[Lb,NN]}),"guze"),CN=l((function(){return[Db,tr,Nb]}),"zle"),kN=l((function(){return[ON]}),"zule"),Ns=l((function(t){return postMessage(t,[t.buffer])}),"pbf"),Ob=l((function(t){return t&&t.size&&new jt(t.size)}),"gu8"),ic=l((function(t,e,n,r,i,o){var s=IN(n,r,i,(function(t,e){s.terminate(),o(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}}),"cbify"),lo=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"),oc=l((function(t,e,n,r,i){var o,s=IN(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||Le(5),o&&e.ondata(Le(4,0,1),null,!!n),s.postMessage([t,o=n],[t.buffer])},e.terminate=function(){s.terminate()}}),"astrmify"),gi=l((function(t,e){return t[e]|t[e+1]<<8}),"b2"),Hr=l((function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}),"b4"),Tb=l((function(t,e){return Hr(t,e)+4294967296*Hr(t,e+4)}),"b8"),tr=l((function(t,e,n){for(;n;++e)t[e]=n,n>>>=8}),"wbytes"),Ab=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&&tr(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"),Lb=l((function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&Le(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"),NN=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"),Rb=l((function(t){return 10+(t.filename&&t.filename.length+1||0)}),"gzhl"),Db=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"),ON=l((function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Le(6,"invalid zlib data"),32&t[1]&&Le(6,"invalid zlib data: preset dictionaries not supported")}),"zlv"),l(Fb,"AsyncCmpStrm"),fa=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(Eu(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||Le(5),this.d&&Le(4),this.d=e,this.p(t,e||!1)},t}(),TN=function(){function t(t,e){oc([nc,function(){return[lo,fa]}],this,Fb.call(this,t,e),(function(t){var e=new fa(t.data);onmessage=lo(e)}),6)}return l(t,"AsyncDeflate"),t}(),l(AN,"deflate"),l(Zp,"deflateSync"),Ii=function(){function t(t){this.s={},this.p=new jt(0),this.ondata=t}return l(t,"Inflate"),t.prototype.e=function(t){this.ondata||Le(5),this.d&&Le(4);var e=this.p.length,n=new jt(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=Kp(this.p,this.o,this.s);this.ondata(uo(n,e,this.s.b),this.d),this.o=uo(n,this.s.b-32768),this.s.b=this.o.length,this.p=uo(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Bb=function(){function t(t){this.ondata=t,oc([rc,function(){return[lo,Ii]}],this,0,(function(){var t=new Ii;onmessage=lo(t)}),7)}return l(t,"AsyncInflate"),t}(),l(jb,"inflate"),l(ac,"inflateSync"),zb=function(){function t(t,e){this.c=tc(),this.l=0,this.v=1,fa.call(this,t,e)}return l(t,"Gzip"),t.prototype.push=function(t,e){fa.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Eu(t,this.o,this.v&&Rb(this.o),e&&8,!e);this.v&&(Ab(n,this.o),this.v=0),e&&(tr(n,n.length-8,this.c.d()),tr(n,n.length-4,this.l)),this.ondata(n,e)},t}(),A6=function(){function t(t,e){oc([nc,PN,function(){return[lo,fa,zb]}],this,Fb.call(this,t,e),(function(t){var e=new zb(t.data);onmessage=lo(e)}),8)}return l(t,"AsyncGzip"),t}(),l(L6,"gzip"),l(qb,"gzipSync"),Ym=function(){function t(t){this.v=1,Ii.call(this,t)}return l(t,"Gunzip"),t.prototype.push=function(t,e){if(Ii.prototype.e.call(this,t),this.v){var n=this.p.length>3?Lb(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&Le(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Ii.prototype.c.call(this,e)},t}(),LN=function(){function t(t){this.ondata=t,oc([rc,SN,function(){return[lo,Ii,Ym]}],this,0,(function(){var t=new Ym;onmessage=lo(t)}),9)}return l(t,"AsyncGunzip"),t}(),l(RN,"gunzip"),l(Wm,"gunzipSync"),Gb=function(){function t(t,e){this.c=Nb(),this.v=1,fa.call(this,t,e)}return l(t,"Zlib"),t.prototype.push=function(t,e){fa.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Eu(t,this.o,this.v&&2,e&&4,!e);this.v&&(Db(n,this.o),this.v=0),e&&tr(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),R6=function(){function t(t,e){oc([nc,CN,function(){return[lo,fa,Gb]}],this,Fb.call(this,t,e),(function(t){var e=new Gb(t.data);onmessage=lo(e)}),10)}return l(t,"AsyncZlib"),t}(),l(D6,"zlib"),l(Ub,"zlibSync"),Hm=function(){function t(t){this.v=1,Ii.call(this,t)}return l(t,"Unzlib"),t.prototype.push=function(t,e){if(Ii.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&&Le(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ii.prototype.c.call(this,e)},t}(),DN=function(){function t(t){this.ondata=t,oc([rc,kN,function(){return[lo,Ii,Hm]}],this,0,(function(){var t=new Hm;onmessage=lo(t)}),11)}return l(t,"AsyncUnzlib"),t}(),l(FN,"unzlib"),l($m,"unzlibSync"),BN=function(){function t(t){this.G=Ym,this.I=Ii,this.Z=Hm,this.ondata=t}return l(t,"Decompress"),t.prototype.push=function(t,e){if(this.ondata||Le(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new jt(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}(),F6=function(){function t(t){this.G=LN,this.I=Bb,this.Z=DN,this.ondata=t}return l(t,"AsyncDecompress"),t.prototype.push=function(t,e){BN.prototype.push.call(this,t,e)},t}(),l(B6,"decompress"),l(j6,"decompressSync"),Vb=l((function(t,e,n,r){for(var i in t){var o=t[i],s=e+i,a=r;Array.isArray(o)&&(a=Jp(r,o[1]),o=o[0]),o instanceof jt?n[s]=[o,a]:(n[s+="/"]=[new jt(0),a],Vb(o,s,n,r))}}),"fltn"),jN="undefined"!=typeof TextEncoder&&new TextEncoder,Xb="undefined"!=typeof TextDecoder&&new TextDecoder,zN=0;try{Xb.decode(Ka,{stream:!0}),zN=1}catch(t){}qN=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,uo(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"),z6=function(){function t(t){this.ondata=t,zN?this.t=new TextDecoder:this.p=Ka}return l(t,"DecodeUTF8"),t.prototype.push=function(t,e){if(this.ondata||Le(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&Le(8),this.t=null));this.p||Le(4);var n=new jt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=qN(n),i=r[0],o=r[1];e?(o.length&&Le(8),this.p=null):this.p=o,this.ondata(i,e)},t}(),q6=function(){function t(t){this.ondata=t}return l(t,"EncodeUTF8"),t.prototype.push=function(t,e){this.ondata||Le(5),this.d&&Le(4),this.ondata(Os(t),this.d=e||!1)},t}(),l(Os,"strToU8"),l(Yb,"strFromU8"),GN=l((function(t){return 1==t?3:t<6?2:9==t?1:0}),"dbf"),UN=l((function(t,e){return e+30+gi(t,e+26)+gi(t,e+28)}),"slzh"),VN=l((function(t,e,n){var r=gi(t,e+28),i=Yb(t.subarray(e+46,e+46+r),!(2048&gi(t,e+8))),o=e+46+r,s=Hr(t,e+20),a=n&&4294967295==s?XN(t,o):[s,Hr(t,e+24),Hr(t,e+42)],l=a[0],u=a[1],c=a[2];return[gi(t,e+10),l,u,i,o+gi(t,e+30)+gi(t,e+32),c]}),"zh"),XN=l((function(t,e){for(;1!=gi(t,e);e+=4+gi(t,e+2));return[Tb(t,e+12),Tb(t,e+4),Tb(t,e+20)]}),"z64e"),Ts=l((function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&Le(9),e+=r+4}return e}),"exfl"),sc=l((function(t,e,n,r,i,o,s,a){var l=r.length,u=n.extra,c=a&&a.length,h=Ts(u);tr(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)&&Le(10),tr(t,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),e+=4,null!=o&&(tr(t,e,n.crc),tr(t,e+4,o),tr(t,e+8,n.size)),tr(t,e+12,l),tr(t,e+14,h),e+=16,null!=s&&(tr(t,e,c),tr(t,e+6,n.attrs),tr(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;tr(t,e,+d),tr(t,e+2,y),t.set(g,e+4),e+=4+y}return c&&(t.set(a,e),e+=c),e}),"wzh"),Wb=l((function(t,e,n,r,i){tr(t,e,101010256),tr(t,e+8,n),tr(t,e+10,n),tr(t,e+12,r),tr(t,e+16,i)}),"wzf"),Qp=function(){function t(t){this.filename=t,this.c=tc(),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||Le(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),G6=function(){function t(t,e){var n=this;e||(e={}),Qp.call(this,t),this.d=new fa(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=GN(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){Qp.prototype.push.call(this,t,e)},t}(),U6=function(){function t(t,e){var n=this;e||(e={}),Qp.call(this,t),this.d=new TN(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=GN(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){Qp.prototype.push.call(this,t,e)},t}(),V6=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||Le(5),2&this.d)this.ondata(Le(4+8*(1&this.d),0,1),null,!1);else{var n=Os(t.filename),r=n.length,i=t.comment,o=i&&Os(i),s=r!=t.filename.length||o&&i.length!=o.length,a=r+Ts(t.extra)+30;r>65535&&this.ondata(Le(11,0,1),null,!1);var u=new jt(a);sc(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=Jp(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 jt(16);tr(o,0,134695760),tr(o,4,t.crc),tr(o,8,g),tr(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(Le(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+Ts(l.extra)+(l.o?l.o.length:0)}for(var o=new jt(n+22),s=0,a=this.u;s<a.length;s++){var l=a[s];sc(o,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+Ts(l.extra)+(l.o?l.o.length:0),e+=l.b}Wb(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(X6,"zip"),l(Y6,"zipSync"),YN=function(){function t(){}return l(t,"UnzipPassThrough"),t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),W6=function(){function t(){var t=this;this.i=new Ii((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}(),H6=function(){function t(t,e){var n=this;e<32e4?this.i=new Ii((function(t,e){n.ondata(null,t,e)})):(this.i=new Bb((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=uo(t,0)),this.i.push(t,e)},t.compression=8,t}(),$6=function(){function t(t){this.onfile=t,this.k=[],this.o={0:YN},this.p=Ka}return l(t,"Unzip"),t.prototype.push=function(t,e){var n=this;if(this.onfile||Le(5),this.p||Le(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 jt(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=Hr(u,s);if(67324752==e){o=1,a=s,d.d=null,d.c=0;var r=gi(u,s+6),i=gi(u,s+8),l=2048&r,p=8&r,f=gi(u,s+26),g=gi(u,s+28);if(c>s+30+f+g){var y=[];d.k.unshift(y),o=2;var v=Hr(u,s+18),m=Hr(u,s+22),_=Yb(u.subarray(s+30,s+=30+f),!l);4294967295==v?(t=p?[-2]:XN(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||Le(5),v){var t=n.o[i];t||w.ondata(Le(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(Ka,!0)}else w.ondata(null,Ka,!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=Ka,h<0){var g=o?u.subarray(0,a-12-(-2==h&&8)-(134695760==Hr(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&&Le(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),Km="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()},l(K6,"unzip"),l(J6,"unzipSync")}));v();var $N=er(wx());v(),v(),v();var Pw=er(Ew());v();var Bv=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:o=0}){let s,a;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,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,a=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*a+s):(s=e.weight&&e.weight>=0?e.weight:0,a=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*a+s),isNaN(this.angle))throw new Error("nan angle")}};l(Bv,"Edge");var cd=Bv;v();var Xo,jv="mi-debug";function Mw(t){0<=t&&t<=3&&(Iw.logState=t)}!function(t){t[t.LOG=0]="LOG",t[t.WARN=1]="WARN",t[t.ERROR=2]="ERROR",t[t.SILENT=3]="SILENT"}(Xo||(Xo={})),l(Mw,"setLoggerLevel");var Iw={logState:0,loggingEnabled(){var t;return"development"===C.env.NODE_ENV||"dev"===C.env.NODE_ENV||"test"===C.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(jv))},log(...t){this.loggingEnabled()&&this.logState<=0&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&this.logState<=1&&console.warn("[MappedInJS]",...t)},error(...t){this.logState<=2&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},Me=Iw;function HL(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${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,Pw.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 Me.error(t),1}}function $L(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(HL,"getMapScale"),l($L,"getAngle");var zv=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:HL(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})=>{let n=this.nodesById[e];return new cd({angle:$L(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),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 cd({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new cd({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let r=t.map((t=>this.nodesById[t])).filter((t=>t)),i=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===r.length||0===i.length)return[];let o=[],s={},a={};for(r.forEach((t=>{let e=this.getShortestEuclideanDistance(t,i);o.push({origin:t,priority:e}),s[t.id]=null,a[t.id]=0})),o.sort(((t,e)=>t.priority-e.priority));o.length>0;){let t=o[0];if(i.includes(t.origin)){let e=[],n=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let r=e.vortex&&!1===e.vortex.accessible;if(n&&(r||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=a[t.origin.id]+e.weight;if(null==a[e.destination.id]||l<a[e.destination.id]){a[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,i);o.push({origin:e.destination,priority:t}),s[e.destination.id]=e}}o.splice(0,1),o.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(zv,"NavigationGraph");var tn,xi,cs,qv=zv;function KL(t){switch(t){case cs.DOWN:case cs.UP:return`${t} `;default:return""}}v(),v(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(tn||(tn={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(xi||(xi={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(cs||(cs={})),l(KL,"vortexDirectionTest");var Gv=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&&e.type===tn.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&e.type===tn.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&e.type===tn.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${KL(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===tn.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&e.bearing===xi.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===xi.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===xi.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===xi.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===xi.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===tn.TURN&&r&&(this.instruction+=` at ${r.name}`))}};l(Gv,"Directive");var fd,fs=Gv;(fd||(fd={})).NO_VALID_PATH="No Valid Path Available";var pd=.1*Math.PI;function hd(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}l(hd,"differenceBetweenAngles");var Uv=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){D(this,"graph"),D(this,"locationsByNodeId"),this.graph=new qv({maps:r,nodes:e,showVortexNames:i,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)),{})}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=-hd(o.angle,e.angle);Math.abs(t)<Math.abs(a)&&(s=e,a=t)}else s=e,a=-hd(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}){let o=this.graph.aStar(t,e,n);if(0===o.length)return{distance:0,instructions:[new fs({distance:0,instruction:fd.NO_VALID_PATH})],path:[]};let s=0,a=new Array(o.length+1);for(let t=0;t<o.length;t++)a[t]=o[t].origin;a[o.length]=o[o.length-1].destination;let l=[],u=null,c=null,h=0,p=0;for(let t=0;t<o.length;t++){let e=o[t],n=e.origin,a=e.destination;if(s+=e.distance,h+=(null==c?void 0:c.distance)||0,0===t&&l.push(new fs({action:{type:tn.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[a.map],i=cs.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=cs.DOWN:e<0&&(i=cs.UP)}l.push(new fs({action:{direction:i,fromMap:t,toMap:r,type:tn.TAKEVORTEX},atLocation:e.vortex,distance:h,origin:n})),p+=h,h=0}else if(null!=u&&null!=c)if(null!=c.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[c.destination.map];l.push(new fs({action:{fromMap:t,toMap:e,type:tn.EXITVORTEX},atLocation:c.vortex,distance:h,origin:n})),p+=h,h=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let r=-hd(c.angle,e.angle),i=t.reduce(((t,n)=>{let r=-hd(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=pd||Math.abs(i)<=pd){let t;t=r<=-Math.PI/4?xi.RIGHT:r<=-pd?xi.SLIGHTRIGHT:r<=pd?xi.STRAIGHT:r<=Math.PI/4?xi.SLIGHTLEFT:xi.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(c,.5*Math.PI,10)),null!=e){let r=new fs({action:{bearing:t,referencePosition:"At",type:tn.TURN},atLocation:e,distance:h,origin:n});r.type=t,l.push(r)}else l.push(new fs({action:{bearing:t,referencePosition:"At",type:tn.TURN},distance:h,origin:n}));p+=h,h=0}}}t===o.length-1&&(l.push(new fs({action:{type:tn.ARRIVAL},atLocation:i,distance:s-p<0?0:s-p,origin:e.destination})),p+=h,h=0),u=n,c=e}let f=[],d=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===tn.TAKEVORTEX?(d=e.node,f.unshift(e)):n&&n.type===tn.TURN&&null!=d?this.graph.getDistance(e.node,d)>5&&f.unshift(e):f.unshift(e)}return{distance:s,instructions:f,path:a}}};l(Uv,"Navigator");var Vv=Uv;function Xv(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Sw(this.cover(e,n),e,n,t)}function Sw(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 Cw(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)Sw(this,s[n],a[n],t[n]);return this}function Yv(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 Wv(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function Hv(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 pn(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function $v(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 pn(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 pn(g[3],y,v,s,a),new pn(g[2],i,v,y,a),new pn(g[1],y,o,s,v),new pn(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 Kv(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 kw(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function Jv(){return this._root}function Zv(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function Qv(t){var e,n,r,i,o,s,a=[],l=this._root;for(l&&a.push(new pn(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 pn(n,u,c,o,s)),(n=l[2])&&a.push(new pn(n,r,c,u,s)),(n=l[1])&&a.push(new pn(n,u,i,o,c)),(n=l[0])&&a.push(new pn(n,r,i,u,c))}return this}function ey(t){var e,n=[],r=[];for(this._root&&n.push(new pn(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 pn(o,s,a,c,h)),(o=i[1])&&n.push(new pn(o,c,a,l,h)),(o=i[2])&&n.push(new pn(o,s,h,c,u)),(o=i[3])&&n.push(new pn(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 Nw(t){return t[0]}function ty(t){return arguments.length?(this._x=t,this):this._x}function Ow(t){return t[1]}function ry(t){return arguments.length?(this._y=t,this):this._y}function Tc(t,e,n){var r=new ny(null==e?Nw:e,null==n?Ow:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ny(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 Tw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}v(),v(),v(),v(),l(Xv,"default"),l(Sw,"add"),l(Cw,"addAll"),v(),l(Yv,"default"),v(),l(Wv,"default"),v(),l(Hv,"default"),v(),v(),l(pn,"default"),l($v,"default"),v(),l(Kv,"default"),l(kw,"removeAll"),v(),l(Jv,"default"),v(),l(Zv,"default"),v(),l(Qv,"default"),v(),l(ey,"default"),v(),l(Nw,"defaultX"),l(ty,"default"),v(),l(Ow,"defaultY"),l(ry,"default"),l(Tc,"quadtree"),l(ny,"Quadtree"),l(Tw,"leaf_copy");var ui=Tc.prototype=ny.prototype;ui.copy=function(){var t,e,n=new ny(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=Tw(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]=Tw(e));return n},ui.add=Xv,ui.addAll=Cw,ui.cover=Yv,ui.data=Wv,ui.extent=Hv,ui.find=$v,ui.remove=Kv,ui.removeAll=kw,ui.root=Jv,ui.size=Zv,ui.visit=Qv,ui.visitAfter=ey,ui.x=ty,ui.y=ry;var Yo,rn,Xs=class{constructor(t){oe(this,Yo,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"),oe(this,rn,{}),ue(this,Yo,t)}get polygonsByMapId(){if(z(this,rn).polygonsByMapId)return z(this,rn).polygonsByMapId;let t,e={};for(let n=0,r=z(this,Yo).polygons.length;n<r;++n)t=z(this,Yo).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 z(this,rn).polygonsByMapId=n,z(this,rn).polygonsByMapId}get nodesByMapId(){if(z(this,rn).nodesByMapId)return z(this,rn).nodesByMapId;let t,e={};for(let n=0,r=z(this,Yo).nodes.length;n<r;++n)t=z(this,Yo).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 z(this,rn).nodesByMapId=n,z(this,rn).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(z(this,rn).nodeTreesByMap||(z(this,rn).nodeTreesByMap=new Map),!z(this,rn).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=Tc();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),z(this,rn).nodeTreesByMap.set(t,r)}return z(this,rn).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(z(this,rn).locationsByMapId)return z(this,rn).locationsByMapId;let t,e={};for(let n=0,r=z(this,Yo).locations.length;n<r;++n){t=z(this,Yo).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]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return z(this,rn).locationsByMapId=n,z(this,rn).locationsByMapId}static create(t){return Xs.instances.has(t)||Xs.instances.set(t,new Xs(t)),Xs.instances.get(t)}static clear(){Xs.instances.clear()}},dd=Xs;l(dd,"MappedinCache"),Yo=new WeakMap,rn=new WeakMap,D(dd,"instances",new Map);var Li=dd;v(),v(),v(),v();var Aw=" ",Jn=class{static get separator(){return Aw}static set separator(t){Aw=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(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let r=null,i=null,o=null,s=null;switch(e){default:case"d":case"deg":i=t.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),o=(60*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),i=("000"+i).slice(-3),o<10&&(o="0"+o),r=i+"°"+Jn.separator+o+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),o=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),o++),60==o&&(o=0,i++),i=("000"+i).slice(-3),o=("00"+o).slice(-2),s<10&&(s="0"+s),r=i+"°"+Jn.separator+o+"′"+Jn.separator+s+"″"}return r}static toLat(t,e,n){let r=Jn.toDms(Jn.wrap90(t),e,n);return null===r?"–":r.slice(1)+Jn.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=Jn.toDms(Jn.wrap180(t),e,n);return null===r?"–":r+Jn.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=Jn.toDms(Jn.wrap360(t),e,n);return null===r?"–":r.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(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=Jn.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}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(Jn,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var kt=Jn,Cr=Math.PI,Ae=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=kt.wrap90(Number(t)),this._lon=kt.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?kt.wrap90(kt.parse(t)):kt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?kt.wrap90(kt.parse(t)):kt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new Ae(e,n)}distanceTo(t,e=6371e3){if(t instanceof Ae||(t=Ae.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,r=this.lat.toRadians(),i=this.lon.toRadians(),o=t.lat.toRadians(),s=o-r,a=t.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(o)*Math.sin(a/2)*Math.sin(a/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r),o=Math.sin(r)*Math.cos(n),s=Math.atan2(o,i).toDegrees();return kt.wrap360(s)}finalBearingTo(t){t instanceof Ae||(t=Ae.parse(t));let e=t.initialBearingTo(this)+180;return kt.wrap360(e)}midpointTo(t){t instanceof Ae||(t=Ae.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),o=Math.cos(e),s=0,a=Math.sin(e),l={x:o+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:a+Math.sin(r)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=n+Math.atan2(l.y,l.x),h=u.toDegrees(),p=c.toDegrees();return new Ae(h,p)}intermediatePointTo(t,e){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return new Ae(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),s=i-n,a=o-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*u)/Math.sin(u),h=Math.sin(e*u)/Math.sin(u),p=c*Math.cos(n)*Math.cos(r)+h*Math.cos(i)*Math.cos(o),f=c*Math.cos(n)*Math.sin(r)+h*Math.cos(i)*Math.sin(o),d=c*Math.sin(n)+h*Math.sin(i),g=Math.atan2(d,Math.sqrt(p*p+f*f)),y=Math.atan2(f,p),v=g.toDegrees(),m=y.toDegrees();return new Ae(v,m)}destinationPoint(t,e,n=6371e3){let r=t/n,i=Number(e).toRadians(),o=this.lat.toRadians(),s=this.lon.toRadians(),a=Math.sin(o)*Math.cos(r)+Math.cos(o)*Math.sin(r)*Math.cos(i),l=Math.asin(a),u=Math.sin(i)*Math.sin(r)*Math.cos(o),c=Math.cos(r)-Math.sin(o)*a,h=s+Math.atan2(u,c),p=l.toDegrees(),f=h.toDegrees();return new Ae(p,f)}static intersection(t,e,n,r){if(t instanceof Ae||(t=Ae.parse(t)),n instanceof Ae||(n=Ae.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=t.lat.toRadians(),o=t.lon.toRadians(),s=n.lat.toRadians(),a=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(r).toRadians(),c=s-i,h=a-o,p=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(s)*Math.sin(h/2)*Math.sin(h/2)));if(Math.abs(p)<Number.EPSILON)return new Ae(t.lat,t.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(p))/(Math.sin(p)*Math.cos(i)),d=(Math.sin(i)-Math.sin(s)*Math.cos(p))/(Math.sin(p)*Math.cos(s)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(d,-1),1)),v=l-(Math.sin(a-o)>0?g:2*Cr-g),m=(Math.sin(a-o)>0?2*Cr-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let _=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(p),b=Math.atan2(Math.sin(p)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*_),w=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(b)+Math.cos(i)*Math.sin(b)*Math.cos(l),-1),1)),x=o+Math.atan2(Math.sin(l)*Math.sin(b)*Math.cos(i),Math.cos(b)-Math.sin(i)*Math.sin(w)),E=w.toDegrees(),I=x.toDegrees();return new Ae(E,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof Ae||(t=Ae.parse(t)),e instanceof Ae||(e=Ae.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,o=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(i)*Math.sin(o-s))*r}alongTrackDistanceTo(t,e,n=6371e3){t instanceof Ae||(t=Ae.parse(t)),e instanceof Ae||(e=Ae.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,o=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),a=Math.asin(Math.sin(i)*Math.sin(o-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(a)))*Math.sign(Math.cos(s-o))*r}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:kt.wrap180(d),lon2:kt.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof Ae||(t=Ae.parse(t));let n=e,r=this.lat.toRadians(),i=t.lat.toRadians(),o=i-r,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>Cr&&(s=s>0?-(2*Cr-s):2*Cr+s);let a=Math.log(Math.tan(i/2+Cr/4)/Math.tan(r/2+Cr/4)),l=Math.abs(a)>1e-11?o/a:Math.cos(r);return Math.sqrt(o*o+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>Cr&&(r=r>0?-(2*Cr-r):2*Cr+r);let i=Math.log(Math.tan(n/2+Cr/4)/Math.tan(e/2+Cr/4)),o=Math.atan2(r,i).toDegrees();return kt.wrap360(o)}rhumbDestinationPoint(t,e,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),o=Number(e).toRadians(),s=t/n,a=s*Math.cos(o),l=r+a;Math.abs(l)>Cr/2&&(l=l>0?Cr-l:-Cr-l);let u=Math.log(Math.tan(l/2+Cr/4)/Math.tan(r/2+Cr/4)),c=Math.abs(u)>1e-11?a/u:Math.cos(r),h=i+s*Math.sin(o)/c,p=l.toDegrees(),f=h.toDegrees();return new Ae(p,f)}rhumbMidpointTo(t){t instanceof Ae||(t=Ae.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>Cr&&(n+=2*Cr);let o=(e+r)/2,s=Math.tan(Cr/4+e/2),a=Math.tan(Cr/4+r/2),l=Math.tan(Cr/4+o/2),u=((i-n)*Math.log(l)+n*Math.log(a)-i*Math.log(s))/Math.log(a/s);isFinite(u)||(u=(n+i)/2);let c=o.toDegrees(),h=u.toDegrees();return new Ae(c,h)}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*Cr);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(t){return t instanceof Ae||(t=Ae.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.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 ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${kt.toLat(this.lat,t,e)}, ${kt.toLon(this.lon,t,e)}`}};l(Ae,"LatLonSpherical"),v(),v(),v();var So=class{constructor(t){D(this,"destinations",[]),this.destinations=t}};l(So,"MappedinDestinationSet"),v();var Ac,Ia,ju=class{constructor(t,e){oe(this,Ac,void 0),oe(this,Ia,void 0),D(this,"distance",0),D(this,"path",[]),D(this,"instructions",[]),ue(this,Ia,t),ue(this,Ac,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)?void 0:e.id)?null==(r=null==(n=z(this,Ia))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:(null==(i=t.node)?void 0:i.id)?null==(s=null==(o=z(this,Ia))?void 0:o._nodesById)?void 0:s[t.node.id]:void 0};if((null==(a=f.action)?void 0:a.type)===tn.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===tn.EXITVORTEX){let t=null==(c=z(this,Ia)._mapsById)?void 0:c[null==(u=f.action)?void 0:u.fromMap.id],e=null==(p=z(this,Ia)._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=z(this,Ia))?void 0:n._nodesById)?void 0:r[e];return i&&t.push(i),t}),[])}toJSON(){return z(this,Ac)}};l(ju,"MappedinDirections"),Ac=new WeakMap,Ia=new WeakMap;var Sa,Pa=class{constructor(t){oe(this,Sa,void 0),ue(this,Sa,t)}directionsTo(t,e){let n=z(this,Sa).analytics;if(t instanceof So){if(0===t.destinations.length)return[];n.getDirections(this,t.destinations[t.destinations.length-1]);let r,i=[],o=Lc(this);for(let n=0;n<t.destinations.length;n++){r=Lc(t.destinations[n]);let s=z(this,Sa).navigator.getDirections({originIds:o,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1}),a=new ju(z(this,Sa),s);i.push(a),o=0===a.path.length?r:[a.path[a.path.length-1].id]}return i}{n.getDirections(this,t);let r=Lc(this),i=Lc(t),o=z(this,Sa).navigator.getDirections({originIds:r,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new ju(z(this,Sa),o)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};l(Pa,"MappedinNavigatable"),Sa=new WeakMap,v(),v(),v(),v();var ps,Cn,Ca,hs,li,wi,kr,qu,rE=er(tE()),{__extends:Wo,__assign:Pe,__rest:Rc,__decorate:t8,__param:r8,__metadata:n8,__awaiter:Ce,__generator:ke,__exportStar:i8,__createBinding:o8,__values:eo,__read:hn,__spread:a8,__spreadArrays:s8,__spreadArray:Co,__await:u8,__asyncGenerator:l8,__asyncDelegator:c8,__asyncValues:f8,__makeTemplateObject:p8,__importStar:h8,__importDefault:d8,__classPrivateFieldGet:g8,__classPrivateFieldSet:m8,__classPrivateFieldIn:v8}=rE.default;v(),v(),v(),v(),v(),function(t){t.US="US",t.EU="EU"}(ps||(ps={})),v(),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"}(Cn||(Cn={})),function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"}(Ca||(Ca={})),function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}(hs||(hs={})),v(),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"}(li||(li={})),v(),function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(wi||(wi={})),v(),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"}(kr||(kr={})),v(),function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(qu||(qu={})),v(),v();var oy="-",Dc="AMP",nE="".concat(Dc,"_unsent"),ay="https://api2.amplitude.com/2/httpapi",iE="https://api.eu.amplitude.com/2/httpapi",oE="https://api2.amplitude.com/batch",aE="https://api.eu.amplitude.com/batch";v();var JL=1e3,yd=l((function(t){if(Object.keys(t).length>JL)return!1;for(var e in t){var n=t[e];if(!sy(e,n))return!1}return!0}),"isValidObject"),sy=l((function(t,e){var n,r;if("string"!=typeof t)return!1;if(Array.isArray(e)){var i=!0;try{for(var o=eo(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&&yd(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 yd(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0}),"isValidProperties"),ko=function(){function t(){this._propertySet=new Set,this._properties={}}return l(t,"Identify"),t.prototype.getUserProperties=function(){return Pe({},this._properties)},t.prototype.set=function(t,e){return this._safeSet(Cn.SET,t,e),this},t.prototype.setOnce=function(t,e){return this._safeSet(Cn.SET_ONCE,t,e),this},t.prototype.append=function(t,e){return this._safeSet(Cn.APPEND,t,e),this},t.prototype.prepend=function(t,e){return this._safeSet(Cn.PREPEND,t,e),this},t.prototype.postInsert=function(t,e){return this._safeSet(Cn.POSTINSERT,t,e),this},t.prototype.preInsert=function(t,e){return this._safeSet(Cn.PREINSERT,t,e),this},t.prototype.remove=function(t,e){return this._safeSet(Cn.REMOVE,t,e),this},t.prototype.add=function(t,e){return this._safeSet(Cn.ADD,t,e),this},t.prototype.unset=function(t){return this._safeSet(Cn.UNSET,t,oy),this},t.prototype.clearAll=function(){return this._properties={},this._properties[Cn.CLEAR_ALL]=oy,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[Cn.CLEAR_ALL]&&!this._propertySet.has(e)&&(t===Cn.ADD?"number"==typeof n:t===Cn.UNSET||t===Cn.REMOVE||sy(e,n))},t}(),sE=l((function(t,e,n){return Pe(Pe(Pe({},"string"==typeof t?{event_type:t}:t),n),e&&{event_properties:e})}),"createTrackEvent"),Fc=l((function(t,e){return Pe(Pe({},e),{event_type:hs.IDENTIFY,user_properties:t.getUserProperties()})}),"createIdentifyEvent"),uE=l((function(t,e,n,r){var i;return Pe(Pe({},r),{event_type:hs.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)})}),"createGroupIdentifyEvent"),lE=l((function(t,e,n){var r,i=new ko;return i.set(t,e),Pe(Pe({},n),{event_type:hs.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)})}),"createGroupEvent"),cE=l((function(t,e){return Pe(Pe({},e),{event_type:hs.REVENUE,event_properties:t.getEventProperties()})}),"createRevenueEvent");v(),v();var ds=l((function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=kr.Unknown),{event:t,code:e,message:n}}),"buildResult"),fE=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return l(t,"Timeline"),t.prototype.register=function(t,e){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(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 ke(this,(function(_){switch(_.label){case 0:if(!t)return[2];e=hn(t,1),n=e[0],r=hn(t,2),i=r[1],o=this.plugins.filter((function(t){return t.type===wi.BEFORE})),_.label=1;case 1:_.trys.push([1,6,7,8]),s=eo(o),a=s.next(),_.label=2;case 2:return a.done?[3,5]:[4,a.value.execute(Pe({},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===wi.ENRICHMENT})),_.label=9;case 9:_.trys.push([9,14,15,16]),c=eo(u),h=c.next(),_.label=10;case 10:return h.done?[3,13]:[4,h.value.execute(Pe({},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===wi.DESTINATION})),d=f.map((function(t){var e=Pe({},n);return t.execute(e).catch((function(t){return ds(e,0,String(t))}))})),Promise.all(d).then((function(t){var e=hn(t,1)[0];i(e)})),[2]}}))}))},t.prototype.flush=function(){return Ce(this,void 0,void 0,(function(){var t,e,n,r=this;return ke(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===wi.DESTINATION})),n=e.map((function(t){return t.flush&&t.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},t}();v();var pE="Event tracked successfully",hE="Unexpected error occurred",dE="Event rejected due to exceeded retry count",gE="Event skipped due to optOut config",mE="Event rejected due to missing API key",vE="Invalid API key",yE="Client not initialized",uy=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 fE,this.name=t}return l(t,"AmplitudeCore"),t.prototype._init=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){var e,n,r,i,o,s;return ke(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=eo(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=sE(t,e,n);return this.dispatch(r)},t.prototype.identify=function(t,e){var n=Fc(t,e);return this.dispatch(n)},t.prototype.groupIdentify=function(t,e,n,r){var i=uE(t,e,n,r);return this.dispatch(i)},t.prototype.setGroup=function(t,e,n){var r=lE(t,e,n);return this.dispatch(r)},t.prototype.revenue=function(t,e){var n=cE(t,e);return this.dispatch(n)},t.prototype.add=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(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(ds(t,0,yE));this.process(t).then(e)},t.prototype.dispatch=function(t){return Ce(this,void 0,void 0,(function(){var e=this;return ke(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 Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,ds(t,0,gE)]:[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=ds(t,0,n)];case 3:return[2]}}))}))},t.prototype.setOptOut=function(t){this.config?this.config.optOut=Boolean(t):this.q.push(this.setOptOut.bind(this,Boolean(t)))},t.prototype.flush=function(){return this.timeline.flush()},t}();v();var _d=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 yd(t)&&(this.properties=t),this},t.prototype.getEventProperties=function(){var t=this.properties?Pe({},this.properties):{};return t[Ca.REVENUE_PRODUCT_ID]=this.productId,t[Ca.REVENUE_QUANTITY]=this.quantity,t[Ca.REVENUE_PRICE]=this.price,t[Ca.REVENUE_TYPE]=this.revenueType,t[Ca.REVENUE]=this.revenue,t},t}();v(),v();var _E=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");v(),v();var bd="Amplitude Logger ",bE=function(){function t(){this.logLevel=li.None}return l(t,"Logger"),t.prototype.disable=function(){this.logLevel=li.None},t.prototype.enable=function(t){void 0===t&&(t=li.Warn),this.logLevel=t},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<li.Verbose||console.log("".concat(bd,"[Log]: ").concat(t.join(" ")))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<li.Warn||console.warn("".concat(bd,"[Warn]: ").concat(t.join(" ")))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<li.Error||console.error("".concat(bd,"[Error]: ").concat(t.join(" ")))},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<li.Debug||console.log("".concat(bd,"[Debug]: ").concat(t.join(" ")))},t}(),xd=l((function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:li.Warn,loggerProvider:new bE,optOut:!1,serverUrl:ay,serverZone:ps.US,useBatch:!1}}),"getDefaultConfig"),ly=function(){function t(t){var e,n,r;this._optOut=!1;var i=xd();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=cy(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}(),ZL=l((function(t,e){return t===ps.EU?e?aE:iE:e?oE:ay}),"getServerUrl"),cy=l((function(t,e,n){if(void 0===t&&(t=""),void 0===e&&(e=xd().serverZone),void 0===n&&(n=xd().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=[ps.US,ps.EU].includes(e)?e:xd().serverZone;return{serverZone:r,serverUrl:ZL(r,n)}}),"createServerConfig"),fy=function(){function t(){this.name="amplitude",this.type=wi.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 Ce(this,void 0,void 0,(function(){var n,r=this;return ke(this,(function(i){switch(i.label){case 0:return this.config=t,this.storageKey="".concat(nE,"_").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,dE),!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),Ce(this,void 0,void 0,(function(){var e,n,r,i=this;return ke(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=_E(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),Ce(this,void 0,void 0,(function(){var n,r,i,o,s;return ke(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,mE)];n={api_key:this.config.apiKey,events:t.map((function(t){var e=t.event;e.extra;return Rc(e,["extra"])})),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),r=cy(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,hE),[2];if(!e){if("body"in i){o="";try{o=JSON.stringify(i.body,null,2)}catch(t){}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 kr.Success:this.handleSuccessResponse(t,e);break;case kr.Invalid:this.handleInvalidResponse(t,e);break;case kr.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,e);break;case kr.RateLimit:this.handleRateLimitResponse(t,e);break;default:this.handleOtherReponse(e)}},t.prototype.handleSuccessResponse=function(t,e){this.fulfillRequest(e,t.statusCode,pE)},t.prototype.handleInvalidResponse=function(t,e){var n=this;if(t.body.missingField||t.body.error.startsWith(vE))this.fulfillRequest(e,t.statusCode,t.body.error);else{var r=Co(Co(Co(Co([],hn(Object.values(t.body.eventsWithInvalidFields)),!1),hn(Object.values(t.body.eventsWithMissingFields)),!1),hn(Object.values(t.body.eventsWithInvalidIdLengths)),!1),hn(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,Co([],hn(o),!1))}},t.prototype.handlePayloadTooLargeResponse=function(t,e){1!==e.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,Co([],hn(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,Co([],hn(u),!1))},t.prototype.handleOtherReponse=function(t){var e=this;this.addToQueue.apply(this,Co([],hn(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(ds(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}();v();var to=l((function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,Co([],hn(e),!1))}}}),"returnWrapper");v();var QL=l((function(t){return void 0===t&&(t=0),((new Error).stack||"").split("\n").slice(2+t).map((function(t){return t.trim()}))}),"getStacktrace"),Xr=l((function(t){return function(){var e=Pe({},t.config);return{logger:e.loggerProvider,logLevel:e.logLevel}}}),"getClientLogConfig"),e2=l((function(t,e){var n,r;e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=eo(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"),Yr=l((function(t,e){return function(){var n,r,i={};try{for(var o=eo(e),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=e2(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"),Wr=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<li.Debug||!u||!l)return t.apply(i,o);var c={type:"invoke public method",name:e,args:o,stacktrace:QL(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");v();var gs=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,gs)}),"UUID");v();var Bc=function(){function t(){this.memoryStorage=new Map}return l(t,"MemoryStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2,!0]}))}))},t.prototype.get=function(t){return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){return[2,this.memoryStorage.get(t)]}))}))},t.prototype.getRaw=function(t){return Ce(this,void 0,void 0,(function(){var e;return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(n){return this.memoryStorage.set(t,e),[2]}))}))},t.prototype.remove=function(t){return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){return this.memoryStorage.delete(t),[2]}))}))},t.prototype.reset=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return this.memoryStorage.clear(),[2]}))}))},t}();v();var Ys=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 kr.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 kr.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 kr.PayloadTooLarge:return{status:I,statusCode:E,body:{error:null!==(g=t.error)&&void 0!==g?g:""}};case kr.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 kr.Timeout:default:return{status:I,statusCode:E}}},t.prototype.buildStatus=function(t){return t>=200&&t<300?kr.Success:429===t?kr.RateLimit:413===t?kr.PayloadTooLarge:408===t?kr.Timeout:t>=400&&t<500?kr.Invalid:t>=500?kr.Failed:kr.Unknown},t}();v(),v(),v(),v();var ci=l((function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0}),"getGlobalScope"),Gu=l((function(){var t,e=ci();return(null===(t=null==e?void 0:e.location)||void 0===t?void 0:t.search)?e.location.search.substring(1).split("&").filter(Boolean).reduce((function(t,e){var n=e.split("=",2),r=xE(n[0]),i=xE(n[1]);return i&&(t[r]=i),t}),{}):{}}),"getQueryParams"),xE=l((function(t){void 0===t&&(t="");try{return decodeURIComponent(t)}catch(t){return""}}),"tryDecodeURIComponent");v();var wE="utm_campaign",EE="utm_content",ME="utm_id",IE="utm_medium",PE="utm_source",SE="utm_term",py="dclid",hy="fbclid",dy="gbraid",gy="gclid",my="ko_click_id",vy="msclkid",yy="ttclid",_y="twclid",by="wbraid",CE="EMPTY",wd={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},kE="MKTG",NE=function(){function t(){}return l(t,"CampaignParser"),t.prototype.parse=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2,Pe(Pe(Pe(Pe({},wd),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},t.prototype.getUtmParam=function(){var t=Gu();return{utm_campaign:t[wE],utm_content:t[EE],utm_id:t[ME],utm_medium:t[IE],utm_source:t[PE],utm_term:t[SE]}},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(t){}return n},t.prototype.getClickIds=function(){var t,e=Gu();return(t={})[py]=e[py],t[hy]=e[hy],t[dy]=e[dy],t[gy]=e[gy],t[my]=e[my],t[vy]=e[vy],t[yy]=e[yy],t[_y]=e[_y],t[by]=e[by],t},t}();v(),v();var Ws=l((function(t,e,n){return void 0===e&&(e=""),void 0===n&&(n=10),[Dc,e,t.substring(0,n)].filter(Boolean).join("_")}),"getCookieName"),xy=l((function(t){return"".concat(Dc.toLowerCase(),"_").concat(t.substring(0,6))}),"getOldCookieName"),wy=function(){function t(t,e){var n,r;this.storage=e.storage,this.storageKey=Ws(t,kE),this.parser=new NE,this.track=e.track,this.onNewCampaign=e.onNewCampaign,this.disabled=Boolean(e.disabled),this.trackNewCampaigns=Boolean(e.trackNewCampaigns),this.trackPageViews=Boolean(e.trackPageViews),this.excludeReferrers=null!==(n=e.excludeReferrers)&&void 0!==n?n:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(r=e.initialEmptyValue)&&void 0!==r?r:CE}return l(t,"CampaignTracker"),t.prototype.isNewCampaign=function(t,e,n){void 0===n&&(n=!1);t.referrer;var r=t.referring_domain,i=Rc(t,["referrer","referring_domain"]),o=e||{},s=(o.referrer,o.referring_domain),a=Rc(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?OE(r||"")!==OE(s||""):r!==s;return!e||l||u},t.prototype.saveCampaignToStorage=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(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=Pe(Pe({},wd),t),r=Object.entries(n).reduce((function(t,n){var r=hn(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 ko),i={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return Pe(Pe({},Fc(r)),this.trackPageViews&&i)},t.prototype.send=function(t){return Ce(this,void 0,void 0,(function(){var e,n;return ke(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}(),OE=l((function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")}),"domainWithoutSubdomain");v();var Hs=function(){function t(t){this.options=Pe({},t)}return l(t,"CookieStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!ci())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 Ce(this,void 0,void 0,(function(){var e;return ke(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(t){}return[2,JSON.parse(e)]}catch(t){return[2,void 0]}return[2]}}))}))},t.prototype.getRaw=function(t){var e;return Ce(this,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){return n=ci(),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 Ce(this,void 0,void 0,(function(){var r,i,o,s,a,l;return ke(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=ci())&&(l.document.cookie=a)}catch(t){}return[2]}))}))},t.prototype.remove=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2]}))}))},t}();v();var Ed=function(){function t(t,e){this.storage=t,this.storageKey=Ws(e),this.cache={optOut:!1}}return l(t,"SessionManager"),t.prototype.load=function(){var t;return Ce(this,void 0,void 0,(function(){var e;return ke(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=Pe(Pe({},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}();v();var Ey=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wo(e,t),l(e,"FetchTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n,r;return ke(this,(function(i){switch(i.label){case 0:if("undefined"==typeof fetch)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}(Ys);v(),v();var TE=er(My()),t2=function(){function t(){this.ua=new TE.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return l(t,"ApplicationContextProviderImpl"),t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:i2(),platform:"Web",os:r2(this.ua),deviceModel:n2(this.ua)}},t}(),r2=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"),n2=l((function(t){var e;return null===(e=t.os)||void 0===e?void 0:e.name}),"getDeviceModel"),i2=l((function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""}),"getLanguage"),o2=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}(),ms=l((function(){return ms=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"),ms.apply(this,arguments)}),"__assign"),Id=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(!Id(a,l))return!1;var u=!0;return Object.keys(t).forEach((function(n){Id(t[n],e[n])||(u=!1)})),u}for(var c=0;c<t.length;c++)if(!Id(t[c],e[c]))return!1;return!0}),"isEqual"),a2="$set",s2="$unset",u2="$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 l2=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return l(t,"IdentityStoreImpl"),t.prototype.editIdentity=function(){var t=this,e=ms({},this.identity.userProperties),n=ms(ms({},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 a2: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 s2:for(var f=0,d=Object.keys(a);f<d.length;f++){delete e[h=d[f]]}break;case u2:e={}}}return n.userProperties=e,this},commit:function(){return t.setIdentity(n),this}}},t.prototype.getIdentity=function(){return ms({},this.identity)},t.prototype.setIdentity=function(t){var e=ms({},this.identity);this.identity=ms({},t),Id(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}(),zc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,AE=function(){function t(){this.identityStore=new l2,this.eventBridge=new o2,this.applicationContextProvider=new t2}return l(t,"AnalyticsConnector"),t.getInstance=function(e){return zc.analyticsConnectorInstances||(zc.analyticsConnectorInstances={}),zc.analyticsConnectorInstances[e]||(zc.analyticsConnectorInstances[e]=new t),zc.analyticsConnectorInstances[e]},t}(),qc=l((function(){return AE.getInstance("$default_instance")}),"getAnalyticsConnector");v();var Iy=function(){function t(){this.name="identity",this.type=wi.BEFORE,this.identityStore=qc().identityStore}return l(t,"IdentityEventSender"),t.prototype.execute=function(t){return Ce(this,void 0,void 0,(function(){var e;return ke(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}();v();var Py=l((function(){var t,e,n,r;if("undefined"==typeof navigator)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");v();var Pd=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"),Sd=l((function(t){return t&&void 0!==t._q}),"isInstanceProxy");v();var RE=er(My());v();var LE="1.6.8",c2="Web",f2="$remote",DE=function(){function t(){var t;this.name="context",this.type=wi.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(LE),"undefined"!=typeof navigator&&(t=navigator.userAgent),this.uaResult=new RE.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 Ce(this,void 0,void 0,(function(){var e,n,r,i,o;return ke(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,Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe({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:c2}),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:Py()}),this.config.trackingOptions.ipAddress&&{ip:f2}),{insert_id:gs(),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}();v(),v();var Gc=function(){function t(){}return l(t,"LocalStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!ci())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 Ce(this,void 0,void 0,(function(){var e;return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(n){return[2,(null===(e=ci())||void 0===e?void 0:e.localStorage.getItem(t))||void 0]}))}))},t.prototype.set=function(t,e){var n;return Ce(this,void 0,void 0,(function(){return ke(this,(function(r){try{null===(n=ci())||void 0===n||n.localStorage.setItem(t,JSON.stringify(e))}catch(t){}return[2]}))}))},t.prototype.remove=function(t){var e;return Ce(this,void 0,void 0,(function(){return ke(this,(function(n){try{null===(e=ci())||void 0===e||e.localStorage.removeItem(t)}catch(t){}return[2]}))}))},t.prototype.reset=function(){var t;return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){try{null===(t=ci())||void 0===t||t.localStorage.clear()}catch(t){}return[2]}))}))},t}();v();var FE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={done:4},e}return Wo(e,t),l(e,"XHRTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n=this;return ke(this,(function(r){return[2,new Promise((function(r,i){"undefined"==typeof XMLHttpRequest&&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}(Ys);v();var BE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wo(e,t),l(e,"SendBeaconTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n=this;return ke(this,(function(r){return[2,new Promise((function(r,i){var o=ci();if(!(null==o?void 0: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}(Ys),Cd=l((function(){var t=new Bc;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,disableCookies:!1,domain:"",sessionManager:new Ed(t,""),sessionTimeout:18e5,storageProvider:new Bc,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new Ey}}),"getDefaultConfig"),jE=function(t){function e(e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=this,v=Cd();return(y=t.call(this,Pe(Pe({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=Boolean(null==r?void 0: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 Wo(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(Boolean(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}(ly),zE=l((function(t,e,n){return Ce(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 ke(this,(function(b){switch(b.label){case 0:return r=Cd(),null!==(g=null==n?void 0:n.domain)&&void 0!==g?(o=g,[3,3]):[3,1];case 1:return[4,g2()];case 2:o=b.sent(),b.label=3;case 3:return i=o,[4,p2(Pe(Pe({},n),{domain:i}))];case 4:return s=b.sent(),a=Ws(t),[4,s.get(a)];case 5:return l=b.sent(),u=Gu(),[4,new Ed(s,t).load()];case 6:return c=b.sent(),h=jE.bind,p=[void 0,t,null!=e?e:null==l?void 0:l.userId],f=[Pe({},n)],d={cookieStorage:s,sessionManager:c,deviceId:d2(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:Boolean(null==l?void 0: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,h2(n)];case 8:return[2,new(h.apply(jE,p.concat([Pe.apply(void 0,f.concat([(d.storageProvider=b.sent(),d.trackingOptions=Pe(Pe({},r.trackingOptions),null==n?void 0:n.trackingOptions),d.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Cy(null==n?void 0:n.transport),d)]))])))]}}))}))}),"useBrowserConfig"),p2=l((function(t,e){return void 0===e&&(e=Cd()),Ce(void 0,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return n=Pe(Pe({},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,Sy(n)]:[2,r]}}))}))}),"createCookieStorage"),Sy=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n;return ke(this,(function(r){switch(r.label){case 0:return e=new Hs({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 Gc).isEnabled()]:[3,4];case 3:r.sent()||(e=new Bc),r.label=4;case 4:return[2,e]}}))}))}),"createFlexibleStorage"),h2=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return ke(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=eo([null==t?void 0:t.storageProvider,new Gc]),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"),d2=l((function(t,e,n){return e||n||t||gs()}),"createDeviceId"),Cy=l((function(t){return t===qu.XHR?new FE:t===qu.SendBeacon?new BE:Cd().transportProvider}),"createTransport"),g2=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return ke(this,(function(l){switch(l.label){case 0:return[4,(new Hs).isEnabled()];case 1:if(!l.sent()||!t&&"undefined"==typeof location)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 Hs({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");v();var qE=l((function(t,e){return Ce(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,l,u,c;return ke(this,(function(h){switch(h.label){case 0:return[4,(n=new Hs).isEnabled()];case 1:return(!h.sent()||(null==e?void 0:e.disableCookies))&&(n=new Gc),[4,n.isEnabled()];case 2:return h.sent()?(r=xy(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=hn(i.split("."),5),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],[2,{deviceId:s,userId:m2(a),sessionId:GE(u),lastEventTime:GE(c),optOut:Boolean(l)}]}}))}))}),"parseOldCookies"),GE=l((function(t){var e=parseInt(t,32);if(!isNaN(e))return e}),"parseTime"),m2=l((function(t){if(atob&&escape&&t)try{return decodeURIComponent(escape(atob(t)))}catch(t){return}}),"decode"),v2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wo(e,t),l(e,"AmplitudeBrowser"),e.prototype.init=function(e,n,r){var i,o,s;return void 0===e&&(e=""),Ce(this,void 0,void 0,(function(){var a,l,u,c,h=this;return ke(this,(function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,qE(e,r)]);case 1:return a=p.sent(),[4,zE(e,n||a.userId,Pe(Pe({},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=qc()).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 DE)];case 4:return p.sent(),[4,this.add(new Iy)];case 5:return p.sent(),[4,this.add(new fy)];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),Ce(this,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Sy(this.config)];case 1:return i=o.sent(),[4,new wy(this.config.apiKey,Pe(Pe({},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(gs())},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=Cy(t):this.q.push(this.setTransport.bind(this,t))},e.prototype.identify=function(e,n){if(Sd(e)){var r=e._q;e._q=[],e=Pd(new ko,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,e,n)},e.prototype.groupIdentify=function(e,n,r,i){if(Sd(r)){var o=r._q;r._q=[],r=Pd(new ko,o)}return t.prototype.groupIdentify.call(this,e,n,r,i)},e.prototype.revenue=function(e,n){if(Sd(e)){var r=e._q;e._q=[],e=Pd(new _d,r)}return t.prototype.revenue.call(this,e,n)},e}(uy),kd=l((function(){var t=new v2;return{init:Wr(to(t.init.bind(t)),"init",Xr(t),Yr(t,["config"])),add:Wr(to(t.add.bind(t)),"add",Xr(t),Yr(t,["config.apiKey","timeline.plugins"])),remove:Wr(to(t.remove.bind(t)),"remove",Xr(t),Yr(t,["config.apiKey","timeline.plugins"])),track:Wr(to(t.track.bind(t)),"track",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),logEvent:Wr(to(t.logEvent.bind(t)),"logEvent",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),identify:Wr(to(t.identify.bind(t)),"identify",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Wr(to(t.groupIdentify.bind(t)),"groupIdentify",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),setGroup:Wr(to(t.setGroup.bind(t)),"setGroup",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),revenue:Wr(to(t.revenue.bind(t)),"revenue",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),flush:Wr(to(t.flush.bind(t)),"flush",Xr(t),Yr(t,["config.apiKey","timeline.queue.length"])),getUserId:Wr(t.getUserId.bind(t),"getUserId",Xr(t),Yr(t,["config","config.userId"])),setUserId:Wr(t.setUserId.bind(t),"setUserId",Xr(t),Yr(t,["config","config.userId"])),getDeviceId:Wr(t.getDeviceId.bind(t),"getDeviceId",Xr(t),Yr(t,["config","config.deviceId"])),setDeviceId:Wr(t.setDeviceId.bind(t),"setDeviceId",Xr(t),Yr(t,["config","config.deviceId"])),reset:Wr(t.reset.bind(t),"reset",Xr(t),Yr(t,["config","config.userId","config.deviceId"])),getSessionId:Wr(t.getSessionId.bind(t),"getSessionId",Xr(t),Yr(t,["config"])),setSessionId:Wr(t.setSessionId.bind(t),"setSessionId",Xr(t),Yr(t,["config"])),setOptOut:Wr(t.setOptOut.bind(t),"setOptOut",Xr(t),Yr(t,["config"])),setTransport:Wr(t.setTransport.bind(t),"setTransport",Xr(t),Yr(t,["config"]))}}),"createInstance"),nn=kd(),bV=nn.add,xV=nn.flush,wV=nn.getDeviceId,EV=nn.getSessionId,MV=nn.getUserId,IV=nn.groupIdentify,PV=nn.identify,SV=nn.init,CV=nn.logEvent,kV=nn.remove,NV=nn.reset,OV=nn.revenue,TV=nn.setDeviceId,AV=nn.setGroup,LV=nn.setOptOut,RV=nn.setSessionId,DV=nn.setTransport,FV=nn.setUserId,BV=nn.track,ky={production:"40ead723d18886045e302513245edb27",development:""},Uu={plan:{version:"22",branch:"main",source:"websdk",versionId:"197467d1-8926-452d-a088-b3817cbac89f"},ingestionMetadata:{sourceName:"browser-typescript-ampli",sourceVersion:"2.0.0"}},Uc=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:categorySelected-call"),this.event_properties=t}};l(Uc,"AnalyticsCategorySelectedCall");var Vc=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:locationSelected-call"),this.event_properties=t}};l(Vc,"AnalyticsLocationSelectedCall");var Ny=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:disable-call"),this.event_properties=t}};l(Ny,"BlueDotDisableCall");var Oy=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:enable-call"),this.event_properties=t}};l(Oy,"BlueDotEnableCall");var Ty=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:off-call"),this.event_properties=t}};l(Ty,"BlueDotOffCall");var Ay=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:on-call"),this.event_properties=t}};l(Ay,"BlueDotOnCall");var Ly=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:animate-call"),this.event_properties=t}};l(Ly,"CameraAnimateCall");var Ry=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:cancelAnimation-call"),this.event_properties=t}};l(Ry,"CameraCancelAnimationCall");var Dy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:focusOn-call"),this.event_properties=t}};l(Dy,"CameraFocusOnCall");var Fy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:getSafeAreaInsets-call"),this.event_properties=t}};l(Fy,"CameraGetSafeAreaInsetsCall");var By=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.disable-call"),this.event_properties=t}};l(By,"CameraInteractionDisableCall");var jy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.enable-call"),this.event_properties=t}};l(jy,"CameraInteractionEnableCall");var zy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:set-call"),this.event_properties=t}};l(zy,"CameraSetCall");var qy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:setSafeAreaInsets-call"),this.event_properties=t}};l(qy,"CameraSetSafeAreaInsetsCall");var Gy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:translate-call"),this.event_properties=t}};l(Gy,"CameraTranslateCall");var Uy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:add-call"),this.event_properties=t}};l(Uy,"FlatLabelsAddCall");var Vy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:labelAllLocations-call"),this.event_properties=t}};l(Vy,"FlatLabelsLabelAllLocationsCall");var Xy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:remove-call"),this.event_properties=t}};l(Xy,"FlatLabelsRemoveCall");var Yy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:removeAll-call"),this.event_properties=t}};l(Yy,"FlatLabelsRemoveAllCall");var Wy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:setAppearance-call"),this.event_properties=t}};l(Wy,"FlatLabelsSetAppearanceCall");var Hy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:add-call"),this.event_properties=t}};l(Hy,"FloatingLabelsAddCall");var $y=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:labelAllLocations-call"),this.event_properties=t}};l($y,"FloatingLabelsLabelAllLocationsCall");var Ky=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:remove-call"),this.event_properties=t}};l(Ky,"FloatingLabelsRemoveCall");var Jy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:removeAll-call"),this.event_properties=t}};l(Jy,"FloatingLabelsRemoveAllCall");var Zy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:resetPriority-call"),this.event_properties=t}};l(Zy,"FloatingLabelsResetPriorityCall");var Qy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setAppearance-call"),this.event_properties=t}};l(Qy,"FloatingLabelsSetAppearanceCall");var e0=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setPriority-call"),this.event_properties=t}};l(e0,"FloatingLabelsSetPriorityCall");var Xc=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenue-call"),this.event_properties=t}};l(Xc,"GlobalGetVenueCall");var Yc=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenueMVF-call"),this.event_properties=t}};l(Yc,"GlobalGetVenueMvfCall");var t0=class{constructor(t){this.event_properties=t,D(this,"event_type","global:showVenue-call"),this.event_properties=t}};l(t0,"GlobalShowVenueCall");var r0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:clear-call"),this.event_properties=t}};l(r0,"JourneyClearCall");var n0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:draw-call"),this.event_properties=t}};l(n0,"JourneyDrawCall");var i0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:setStep-call"),this.event_properties=t}};l(i0,"JourneySetStepCall");var o0=class{constructor(t){this.event_properties=t,D(this,"event_type","Mappedin:getCollectionItemById-call"),this.event_properties=t}};l(o0,"MappedinGetCollectionItemByIdCall");var a0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:absoluteDistanceTo-call"),this.event_properties=t}};l(a0,"MappedinCoordinateAbsoluteDistanceToCall");var s0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:nearestNode-call"),this.event_properties=t}};l(s0,"MappedinCoordinateNearestNodeCall");var Wc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:clone-call"),this.event_properties=t}};l(Wc,"MappedinLocationCloneCall");var Hc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:directionsTo-call"),this.event_properties=t}};l(Hc,"MappedinLocationDirectionsToCall");var $c=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:distanceTo-call"),this.event_properties=t}};l($c,"MappedinLocationDistanceToCall");var u0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinate-call"),this.event_properties=t}};l(u0,"MappedinMapCreateCoordinateCall");var l0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinateByXY-call"),this.event_properties=t}};l(l0,"MappedinMapCreateCoordinateByXyCall");var c0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:getNorth-call"),this.event_properties=t}};l(c0,"MappedinMapGetNorthCall");var Kc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:directionsTo-call"),this.event_properties=t}};l(Kc,"MappedinNodeDirectionsToCall");var Jc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:distanceTo-call"),this.event_properties=t}};l(Jc,"MappedinNodeDistanceToCall");var Zc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:directionsTo-call"),this.event_properties=t}};l(Zc,"MappedinPolygonDirectionsToCall");var Qc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:distanceTo-call"),this.event_properties=t}};l(Qc,"MappedinPolygonDistanceToCall");var ef=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinVenue:metadata-read"),this.event_properties=t}};l(ef,"MappedinVenueMetadataRead");var f0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygon-call"),this.event_properties=t}};l(f0,"MapViewAddInteractivePolygonCall");var p0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygonsForAllLocations-call"),this.event_properties=t}};l(p0,"MapViewAddInteractivePolygonsForAllLocationsCall");var h0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:clearPolygonColor-call"),this.event_properties=t}};l(h0,"MapViewClearPolygonColorCall");var d0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createCustomTooltip-call"),this.event_properties=t}};l(d0,"MapViewCreateCustomTooltipCall");var g0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createMarker-call"),this.event_properties=t}};l(g0,"MapViewCreateMarkerCall");var m0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createTooltip-call"),this.event_properties=t}};l(m0,"MapViewCreateTooltipCall");var v0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:destroy-call"),this.event_properties=t}};l(v0,"MapViewDestroyCall");var y0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:disableImageFlippingForAllPolygons-call"),this.event_properties=t}};l(y0,"MapViewDisableImageFlippingForAllPolygonsCall");var _0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:drawPath-call"),this.event_properties=t}};l(_0,"MapViewDrawPathCall");var b0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForAllLocations-call"),this.event_properties=t}};l(b0,"MapViewEnableImageFlippingForAllLocationsCall");var x0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForPolygon-call"),this.event_properties=t}};l(x0,"MapViewEnableImageFlippingForPolygonCall");var w0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getNearestNodeByScreenCoordinates-call"),this.event_properties=t}};l(w0,"MapViewGetNearestNodeByScreenCoordinatesCall");var E0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPolygonAtCoordinate-call"),this.event_properties=t}};l(E0,"MapViewGetPolygonAtCoordinateCall");var M0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPrimaryLocationForPolygon-call"),this.event_properties=t}};l(M0,"MapViewGetPrimaryLocationForPolygonCall");var I0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:labelAllLocations-call"),this.event_properties=t}};l(I0,"MapViewLabelAllLocationsCall");var P0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllInteractivePolygons-call"),this.event_properties=t}};l(P0,"MapViewRemoveAllInteractivePolygonsCall");var S0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllMarkers-call"),this.event_properties=t}};l(S0,"MapViewRemoveAllMarkersCall");var C0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllPaths-call"),this.event_properties=t}};l(C0,"MapViewRemoveAllPathsCall");var k0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllTooltips-call"),this.event_properties=t}};l(k0,"MapViewRemoveAllTooltipsCall");var N0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeInteractivePolygon-call"),this.event_properties=t}};l(N0,"MapViewRemoveInteractivePolygonCall");var O0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeMarker-call"),this.event_properties=t}};l(O0,"MapViewRemoveMarkerCall");var T0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removePath-call"),this.event_properties=t}};l(T0,"MapViewRemovePathCall");var A0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeTooltip-call"),this.event_properties=t}};l(A0,"MapViewRemoveTooltipCall");var L0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setBackgroundColor-call"),this.event_properties=t}};l(L0,"MapViewSetBackgroundColorCall");var R0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setHoverColor-call"),this.event_properties=t}};l(R0,"MapViewSetHoverColorCall");var D0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setMap-call"),this.event_properties=t}};l(D0,"MapViewSetMapCall");var F0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setPolygonColor-call"),this.event_properties=t}};l(F0,"MapViewSetPolygonColorCall");var B0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setState-call"),this.event_properties=t}};l(B0,"MapViewSetStateCall");var j0=class{constructor(t){this.event_properties=t,D(this,"event_type","metrics:mapLoad-event"),this.event_properties=t}};l(j0,"MetricsMapLoadEvent");var tf=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:addQuery-call"),this.event_properties=t}};l(tf,"OfflineSearchAddQueryCall");var rf=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:constructor-call"),this.event_properties=t}};l(rf,"OfflineSearchConstructorCall");var nf=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:search-call"),this.event_properties=t}};l(nf,"OfflineSearchSearchCall");var of=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:suggest-call"),this.event_properties=t}};l(of,"OfflineSearchSuggestCall");var Nd=l((()=>({promise:Promise.resolve()})),"getVoidPromiseResult"),z0=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."),Nd();let r=null;if(t.client&&"apiKey"in t.client?r=t.client.apiKey:"environment"in t&&(r=ky[t.environment]),t.client&&"instance"in t.client)this.amplitude=t.client.instance;else{if(r)return this.amplitude=kd(),this.amplitude.init(r,void 0,{...Uu,...null==(n=t.client)?void 0:n.configuration});console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'")}return Nd()}identify(t,e,n){if(!this.isInitializedAndEnabled())return Nd();t&&(n={...n,user_id:t});let r=new ko,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):Nd()}analyticsCategorySelectedCall(t,e){return this.track(new Uc(t),e)}analyticsLocationSelectedCall(t,e){return this.track(new Vc(t),e)}blueDotDisableCall(t,e){return this.track(new Ny(t),e)}blueDotEnableCall(t,e){return this.track(new Oy(t),e)}blueDotOffCall(t,e){return this.track(new Ty(t),e)}blueDotOnCall(t,e){return this.track(new Ay(t),e)}cameraAnimateCall(t,e){return this.track(new Ly(t),e)}cameraCancelAnimationCall(t,e){return this.track(new Ry(t),e)}cameraFocusOnCall(t,e){return this.track(new Dy(t),e)}cameraGetSafeAreaInsetsCall(t,e){return this.track(new Fy(t),e)}cameraInteractionDisableCall(t,e){return this.track(new By(t),e)}cameraInteractionEnableCall(t,e){return this.track(new jy(t),e)}cameraSetCall(t,e){return this.track(new zy(t),e)}cameraSetSafeAreaInsetsCall(t,e){return this.track(new qy(t),e)}cameraTranslateCall(t,e){return this.track(new Gy(t),e)}flatLabelsAddCall(t,e){return this.track(new Uy(t),e)}flatLabelsLabelAllLocationsCall(t,e){return this.track(new Vy(t),e)}flatLabelsRemoveCall(t,e){return this.track(new Xy(t),e)}flatLabelsRemoveAllCall(t,e){return this.track(new Yy(t),e)}flatLabelsSetAppearanceCall(t,e){return this.track(new Wy(t),e)}floatingLabelsAddCall(t,e){return this.track(new Hy(t),e)}floatingLabelsLabelAllLocationsCall(t,e){return this.track(new $y(t),e)}floatingLabelsRemoveCall(t,e){return this.track(new Ky(t),e)}floatingLabelsRemoveAllCall(t,e){return this.track(new Jy(t),e)}floatingLabelsResetPriorityCall(t,e){return this.track(new Zy(t),e)}floatingLabelsSetAppearanceCall(t,e){return this.track(new Qy(t),e)}floatingLabelsSetPriorityCall(t,e){return this.track(new e0(t),e)}globalGetVenueCall(t,e){return this.track(new Xc(t),e)}globalGetVenueMvfCall(t,e){return this.track(new Yc(t),e)}globalShowVenueCall(t,e){return this.track(new t0(t),e)}journeyClearCall(t,e){return this.track(new r0(t),e)}journeyDrawCall(t,e){return this.track(new n0(t),e)}journeySetStepCall(t,e){return this.track(new i0(t),e)}mappedinGetCollectionItemByIdCall(t,e){return this.track(new o0(t),e)}mappedinCoordinateAbsoluteDistanceToCall(t,e){return this.track(new a0(t),e)}mappedinCoordinateNearestNodeCall(t,e){return this.track(new s0(t),e)}mappedinLocationCloneCall(t,e){return this.track(new Wc(t),e)}mappedinLocationDirectionsToCall(t,e){return this.track(new Hc(t),e)}mappedinLocationDistanceToCall(t,e){return this.track(new $c(t),e)}mappedinMapCreateCoordinateCall(t,e){return this.track(new u0(t),e)}mappedinMapCreateCoordinateByXyCall(t,e){return this.track(new l0(t),e)}mappedinMapGetNorthCall(t,e){return this.track(new c0(t),e)}mappedinNodeDirectionsToCall(t,e){return this.track(new Kc(t),e)}mappedinNodeDistanceToCall(t,e){return this.track(new Jc(t),e)}mappedinPolygonDirectionsToCall(t,e){return this.track(new Zc(t),e)}mappedinPolygonDistanceToCall(t,e){return this.track(new Qc(t),e)}mappedinVenueMetadataRead(t,e){return this.track(new ef(t),e)}mapViewAddInteractivePolygonCall(t,e){return this.track(new f0(t),e)}mapViewAddInteractivePolygonsForAllLocationsCall(t,e){return this.track(new p0(t),e)}mapViewClearPolygonColorCall(t,e){return this.track(new h0(t),e)}mapViewCreateCustomTooltipCall(t,e){return this.track(new d0(t),e)}mapViewCreateMarkerCall(t,e){return this.track(new g0(t),e)}mapViewCreateTooltipCall(t,e){return this.track(new m0(t),e)}mapViewDestroyCall(t,e){return this.track(new v0(t),e)}mapViewDisableImageFlippingForAllPolygonsCall(t,e){return this.track(new y0(t),e)}mapViewDrawPathCall(t,e){return this.track(new _0(t),e)}mapViewEnableImageFlippingForAllLocationsCall(t,e){return this.track(new b0(t),e)}mapViewEnableImageFlippingForPolygonCall(t,e){return this.track(new x0(t),e)}mapViewGetNearestNodeByScreenCoordinatesCall(t,e){return this.track(new w0(t),e)}mapViewGetPolygonAtCoordinateCall(t,e){return this.track(new E0(t),e)}mapViewGetPrimaryLocationForPolygonCall(t,e){return this.track(new M0(t),e)}mapViewLabelAllLocationsCall(t,e){return this.track(new I0(t),e)}mapViewRemoveAllInteractivePolygonsCall(t,e){return this.track(new P0(t),e)}mapViewRemoveAllMarkersCall(t,e){return this.track(new S0(t),e)}mapViewRemoveAllPathsCall(t,e){return this.track(new C0(t),e)}mapViewRemoveAllTooltipsCall(t,e){return this.track(new k0(t),e)}mapViewRemoveInteractivePolygonCall(t,e){return this.track(new N0(t),e)}mapViewRemoveMarkerCall(t,e){return this.track(new O0(t),e)}mapViewRemovePathCall(t,e){return this.track(new T0(t),e)}mapViewRemoveTooltipCall(t,e){return this.track(new A0(t),e)}mapViewSetBackgroundColorCall(t,e){return this.track(new L0(t),e)}mapViewSetHoverColorCall(t,e){return this.track(new R0(t),e)}mapViewSetMapCall(t,e){return this.track(new D0(t),e)}mapViewSetPolygonColorCall(t,e){return this.track(new F0(t),e)}mapViewSetStateCall(t,e){return this.track(new B0(t),e)}metricsMapLoadEvent(t,e){return this.track(new j0(t),e)}offlineSearchAddQueryCall(t,e){return this.track(new tf(t),e)}offlineSearchConstructorCall(t,e){return this.track(new rf(t),e)}offlineSearchSearchCall(t,e){return this.track(new nf(t),e)}offlineSearchSuggestCall(t,e){return this.track(new of(t),e)}};l(z0,"Ampli");var af=new z0;v();var iI=er(EM()),oI=er(ZM()),aI=er(QM());v(),v(),v();var ru,No,Oo,u1=[0,4,6,8,10],Aa=l((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&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],u1.map(((t,e)=>n.slice(t,e===u1.length-1?void 0:u1[e+1]).join(""))).join("-")}),"randomId"),eI="mi-session-data",tI="mi-local-data",l1=class{constructor(){oe(this,No,void 0),oe(this,Oo,void 0);try{let t=sessionStorage.getItem(eI);ue(this,No,t?JSON.parse(t):{id:Aa()})}catch{ue(this,No,{id:Aa()})}try{let t=localStorage.getItem(tI);ue(this,Oo,t?JSON.parse(t):{deviceId:Aa()})}catch{ue(this,Oo,{deviceId:Aa()})}z(this,No).id||(z(this,No).id=Aa()),z(this,Oo).deviceId||(z(this,Oo).deviceId=Aa())}static getInstance(){return z(this,ru)||ue(this,ru,new l1),z(this,ru)}static ___clearInstance(){ue(this,ru,void 0)}saveSessionData(t,e){z(this,No)[t]=e;try{return sessionStorage.setItem(eI,JSON.stringify(z(this,No))),!0}catch{return!1}}loadSessionData(t){let e=z(this,No)[t];if(null!=e)return e}saveLocalData(t,e){z(this,Oo)[t]=e;try{return localStorage.setItem(tI,JSON.stringify(z(this,Oo))),!0}catch{return!1}}loadLocalData(t){let e=z(this,Oo)[t];if(null!=e)return e}},Ku=l1;function rI(t){return/^[\da-f]{24}$/i.test(t)}function Jd(){return Ku.getInstance().loadLocalData("deviceId")}function Zd(){return Ku.getInstance().loadSessionData("id")}l(Ku,"SafeStorage"),ru=new WeakMap,No=new WeakMap,Oo=new WeakMap,oe(Ku,ru,void 0),l(rI,"isGatewayKey"),l(Jd,"getDeviceID"),l(Zd,"getSessionID");var La,nu,To,Ju,$o,Qd,VF,eg,XF,_f,sI,bf,uI,Ao,nI="5.10.2",qF="https://api2.amplitude.com/2/httpapi",GF="https://api2.amplitude.com/batch",UF="__unspecified__",c1={branch:"main",version:"0",source:"websdk"},ro=class{constructor(){oe(this,Qd),oe(this,eg),oe(this,_f),oe(this,bf),oe(this,To,{}),oe(this,Ju,!1),oe(this,$o,void 0),oe(this,Ao,l((async t=>{WF(t.type)&&(window.removeEventListener("visibilitychange",z(this,Ao)),window.removeEventListener("pagehide",z(this,Ao)),window.removeEventListener("beforeunload",z(this,Ao)),window.removeEventListener("unload",z(this,Ao)),await this.sendAllPendingEvents())}),"#handlePageUnload")),null==z(ro,nu)&&ue(ro,nu,nI),null!=navigator.userAgent&&ue(this,$o,new aI.UAParser(navigator.userAgent).getResult())}static setContext(t){ue(ro,La,t)}static setVersion(t){ue(ro,nu,t)}addPendingEvent(t){var e;if(null==z(ro,La))return void Me.warn("No context defined for product analytics! Event will not be tracked.");let n=t.event_type;if(!Kn(this,eg,XF).call(this,t))return;null==t.event_properties&&(t.event_properties={});let r=z(this,To)[n];(0,oI.default)(t.event_properties,null!=(e=null==r?void 0:r.event_properties)?e:{}),z(this,To)[n]=t}async sendAllPendingEvents(){if(null==z(ro,La))return void Me.warn("No context defined for product analytics! No events will be sent.");if(Object.keys(z(this,To)).length<1)return;if(z(this,Ju))return void Me.warn("The current batch of analytics is already sending. Wait until this finishes before trying to send again.");let t=[];for(let e in z(this,To)){let n=z(this,To)[e],r=Kn(this,_f,sI).call(this,n);null!=r&&t.push(r)}if(!(t.length<1))try{ue(this,Ju,!0),200===(await Kn(this,bf,uI).call(this,GF,t)).status&&ue(this,To,{})}catch(t){Me.warn("Error sending batch product analytics!",t)}finally{ue(this,Ju,!1)}}async load(){if(!af.isLoaded){let{promise:t}=af.load({environment:"production",client:{configuration:{trackingOptions:{osName:!0}}}});t.then((()=>{window.addEventListener("pagehide",z(this,Ao)),window.addEventListener("beforeunload",z(this,Ao)),window.addEventListener("unload",z(this,Ao)),window.addEventListener("visibilitychange",z(this,Ao))}))}}async sendEventNow(t){if(null==z(ro,La))return void Me.warn("No context defined for product analytics! No events will be sent.");let e=Kn(this,_f,sI).call(this,t);if(null!=e)try{await Kn(this,bf,uI).call(this,qF,[e])}catch(t){Me.warn("Error sending single product analytics event!",t)}}},yf=ro;l(yf,"ProductAnalytics"),La=new WeakMap,nu=new WeakMap,To=new WeakMap,Ju=new WeakMap,$o=new WeakMap,Qd=new WeakSet,VF=l((function(t){let e=t.event_type;return null!=z(this,To)[e]}),"#isEventTypePending"),eg=new WeakSet,XF=l((function(t){if(!Kn(this,Qd,VF).call(this,t))return!0;let e=t.event_type,n=z(this,To)[e];return!(0,iI.default)(n.event_properties,t.event_properties)}),"#didEventPropertiesChange"),_f=new WeakSet,sI=l((function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v;if(null!=z(ro,La))return null==(null==(e=t.event_properties)?void 0:e.venue)&&Me.warn("Error processing product analytics event! Unspecified venue slug",t),null==Uu.plan&&Me.warn("Error processing product analytics event! Unknown coinfiguration plan",t),{event_type:t.event_type,session_id:null!=(n=af.client.getSessionId())?n:Zd(),device_id:null!=(r=af.client.getDeviceId())?r:Jd(),plan:{branch:null!=(o=null==(i=Uu.plan)?void 0:i.branch)?o:c1.branch,version:null!=(a=null==(s=Uu.plan)?void 0:s.version)?a:c1.version,source:null!=(u=null==(l=Uu.plan)?void 0:l.source)?u:c1.source},os_name:null==(c=z(this,$o))?void 0:c.browser.name,os_version:null==(h=z(this,$o))?void 0:h.browser.version,device_manufacturer:null==(p=z(this,$o))?void 0:p.device.vendor,device_model:null==(f=z(this,$o))?void 0:f.device.model,event_properties:{...t.event_properties,context:z(ro,La),sdk_version:z(ro,nu),browser_name:null==(d=z(this,$o))?void 0:d.browser.name,browser_version:null==(g=z(this,$o))?void 0:g.browser.version,venue:null!=(v=null==(y=t.event_properties)?void 0:y.venue)?v:UF},time:t.time}}),"#makeBatchFormattedEvent"),bf=new WeakSet,uI=l((async function(t,e){return await Ra()(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({api_key:ky.production,events:e})})}),"#batchSend"),Ao=new WeakMap,oe(yf,La,void 0),oe(yf,nu,void 0);var YF=new yf,Nr=YF;function WF(t){return"beforeunload"===t||"pagehide"===t||"unload"===t||"hidden"===document.visibilityState}l(WF,"areWeLeavingThePage");var HF=0,$F="9999-12-31T00:00:00.000Z";function KF(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||HF),n=new Date(t.end||$F);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}l(KF,"getCurrentLocationState");var Ri,_s,Di,xf,wf,Ef,Mf=class extends Pa{constructor(t,e){super(t),oe(this,Ri,void 0),oe(this,_s,void 0),oe(this,Di,{}),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,"externalId"),D(this,"showLabelWhenImagePresent"),D(this,"showSmartLabelWhenImagePresent"),D(this,"picture"),D(this,"operationHours"),D(this,"siblingGroups"),D(this,"gallery"),oe(this,xf,void 0),oe(this,wf,[]),oe(this,Ef,void 0),ue(this,Ri,t),ue(this,_s,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=z(this,Di).polygons;if(void 0!==t)return t;let e=[],n=z(this,xf),r=z(this,Ri)._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 z(this,Di).polygons=e,e}set polygons(t){ue(this,xf,t)}get nodes(){let t=z(this,Di).nodes;if(void 0!==t)return t;let e=[],n=z(this,wf),r=z(this,Ri)._nodesById;if(n)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return z(this,Di).nodes=e,e}set nodes(t){ue(this,wf,t)}get parent(){let t=z(this,Di).parent;if(void 0!==t)return t;let e,n=z(this,Ri)._locationsById,r=z(this,Ef);return void 0!==r&&(e=n[r]),z(this,Di).parent=e,e}set parent(t){ue(this,Ef,t)}get categories(){let t=z(this,Di).categories;if(void 0!==t)return t;let e=[];return z(this,_s).categories.forEach((t=>{let n=z(this,Ri).getCollectionItemById(Fa.CATEGORY,t);n&&e.push(n)})),z(this,Di).categories=e,e}get state(){return KF(this,z(this,Ri).locationStates)}clone(){let t=z(this,Ri).venue.slug;return Nr.addPendingEvent(new Wc({venue:t})),new Mf(z(this,Ri),z(this,_s))}get nodeOperationHours(){let t=z(this,Di).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=z(this,_s).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return z(this,Di).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Mf(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&jr(e,"categories"),t.options.things.nodes&&jr(e,"nodes"),t.options.things.polygons&&jr(e,"polygons"),t.options.things.locationStates&&jr(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await Br(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Mf(t,e)))}catch(t){return Me.error("Fetch Locations:",t),[]}}directionsTo(t,e){let n=t instanceof So,r=z(this,Ri).venue.slug,i=new Hc({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,Ri).venue.slug;return Nr.addPendingEvent(new $c({venue:n})),super.distanceTo(t,e)}toJSON(){let t=z(this,_s);return delete t.color,t}},Da=Mf;l(Da,"MappedinLocation"),Ri=new WeakMap,_s=new WeakMap,Di=new WeakMap,xf=new WeakMap,wf=new WeakMap,Ef=new WeakMap,v();var Ko,Zu,no,If,tg=class extends Pa{constructor(t,e){super(t),oe(this,Ko,void 0),oe(this,Zu,void 0),oe(this,no,{}),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,"canvasBounds"),oe(this,If,void 0),ue(this,Ko,t),ue(this,Zu,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=z(this,no).map;if(void 0!==t)return t;let e=z(this,Ko).getCollectionItemById(Fa.MAP,z(this,Zu).map);return z(this,no).map=e,e}get locations(){var t,e;let n=z(this,no).locations;if(void 0!==n)return n;let r=[],i=null!=(e=null==(t=Li.instances.get(z(this,Ko)))?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 z(this,no).locations=r,r}get entrances(){let t=z(this,no).entrances;if(void 0!==t)return t;let e=[],n=z(this,If),r=z(this,Ko)._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 z(this,no).entrances=e,e}return[]}set entrances(t){ue(this,If,t)}get rank(){let t=z(this,no).rank;if(void 0!==t)return t;let{rankings:e}=z(this,Ko);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(z(this,no).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(z(this,no).rank=null,null)}static hydrate(t,e){return t.map((t=>new tg(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&jr(e,"map"),t.options.things.nodes&&jr(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await Br(t.options,"polygon",n)).map((e=>new tg(t,e)))}catch(t){return Me.error("Fetch Polygons:",t),[]}}directionsTo(t,e){let n=t instanceof So,r=z(this,Ko).venue.slug,i=new Zc({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,Ko).venue.slug;return Nr.addPendingEvent(new Qc({venue:n})),super.distanceTo(t,e)}toJSON(){return z(this,Zu)}},iu=tg;function lI(t){return/^[\da-f]{24}$/i.test(t)}function cI(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+=`${r+encodeURIComponent(o)}=${encodeURIComponent(s)}`,r="&")}}return n}function JF(t,e,n,r=!1){var i,o;return r?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(i=t.baseUrl)?void 0:i.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${cI(n,null==(o=t.baseUrl)?void 0:o.includes("gateway"))}`:t.baseUrl+e+cI(n)}async function Br(t,e,n,r=!1){return f1(t,e,n,r,!0)}async function f1(t,e,n,r=!1,i=!1){let o=JF(t,e,n,r),s=await rg(t,o,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function rg(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=t;i["Content-Type"]=i["Content-Type"]||"text/json",t.authorization&&(i.Authorization=t.authorization),r.language&&(i["Accept-Language"]=r.language);let o={method:"GET",headers:i},s=await Ra()(e,o);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function jr(t,e){t.indexOf(e)<0&&t.push(e)}function fI([t,e],[n,r]){let i=new Ae(t,e),o=new Ae(n,r);return i.distanceTo(o)}function pI(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 Ae(n.target.x,n.target.y),o=new Ae(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,Me.warn(n),Me.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Lc(t){var e;return t instanceof iu?t.entrances.map((t=>t.id)):t instanceof Da?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function hI(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,${r[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{Me.error(t)}))));await Promise.all(t)}catch(t){Me.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0: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)?void 0:n.url)&&(null==(r=null==t?void 0:t.image)?void 0: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)?void 0: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 ng(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)}}l(iu,"MappedinPolygon"),Ko=new WeakMap,Zu=new WeakMap,no=new WeakMap,If=new WeakMap,l(lI,"isGatewayKey"),l(cI,"stringifyQuery"),l(JF,"buildUrl"),l(Br,"getArray"),l(f1,"getObject"),l(rg,"generateAPIRequest"),l(jr,"addToSet"),l(fI,"getDistanceBetweenLatLon"),l(pI,"getMapScale"),l(Lc,"getNodesForNavigatable"),l(hI,"populateBundledImagesAsBlobs"),l(ng,"debounce");var Pf,Sf,Cf,ig=class{constructor(t,e){oe(this,Pf,void 0),oe(this,Sf,{}),oe(this,Cf,void 0),D(this,"name"),D(this,"externalId"),D(this,"parents"),D(this,"id"),D(this,"icon"),this.id=e.id,ue(this,Cf,e),ue(this,Pf,t),Object.assign(this,e)}get locations(){var t;let e=z(this,Sf).locations;if(void 0!==e)return e;let n=[],{locations:r}=z(this,Pf),{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 z(this,Sf).locations=n,n}static hydrate(t,e){return t.map((t=>new ig(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await Br(t.options,"category",e)).map((e=>new ig(t,e)))}catch(t){return Me.error("Fetch Categories:",t),[]}}toJSON(){return z(this,Cf)}},ou=ig;l(ou,"MappedinCategory"),Pf=new WeakMap,Sf=new WeakMap,Cf=new WeakMap,v();var Nf,Qu,Of,og=class{constructor(t,e){oe(this,Nf,void 0),oe(this,Qu,void 0),oe(this,Of,{}),D(this,"id",""),D(this,"type",""),D(this,"name",""),D(this,"description"),D(this,"image"),D(this,"startDate"),D(this,"endDate"),D(this,"showDate"),ue(this,Qu,e),ue(this,Nf,t),Object.assign(this,e)}location(){let t=z(this,Of).location;if(void 0!==t)return t;let e,n=z(this,Nf)._locationsById,r=z(this,Qu).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return z(this,Of).location=e,e}static hydrate(t,e){return t.map((t=>new og(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&jr(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await Br(t.options,"event",n)).map((e=>new og(t,e)))}catch(t){return Me.error("Fetch Events:",t),[]}}toJSON(){return z(this,Qu)}},kf=og;l(kf,"MappedinEvent"),Nf=new WeakMap,Qu=new WeakMap,Of=new WeakMap,v();var Tf,sg=class{constructor(t){oe(this,Tf,void 0),D(this,"id",""),D(this,"name",""),D(this,"value",""),ue(this,Tf,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new sg(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await Br(t.options,"location-state",e)).map((t=>new sg(t)))}catch(t){return Me.error("Fetch Location States:",t),[]}}toJSON(){return z(this,Tf)}},ag=sg;l(ag,"MappedinLocationState"),Tf=new WeakMap,v(),v();var Af,dI,Lf,gI,Rf,Df,ug,ZF,lg,QF,Jo,Zo,Qo,ea,el=class{constructor(t){oe(this,Af),oe(this,Lf),oe(this,ug),oe(this,lg),D(this,"map"),oe(this,Rf,{}),oe(this,Df,void 0),oe(this,Jo,void 0),oe(this,Zo,void 0),oe(this,Qo,void 0),oe(this,ea,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(ue(this,Jo,t.lat),ue(this,Zo,t.lon)),null!=t.x&&null!=t.y&&(ue(this,Qo,t.x),ue(this,ea,t.y)),this.map=e,ue(this,Df,n)}get x(){return Kn(this,Lf,gI).call(this,"x")}get y(){return Kn(this,Lf,gI).call(this,"y")}get lat(){return Kn(this,Af,dI).call(this,"lat")}get lon(){return Kn(this,Af,dI).call(this,"lon")}absoluteDistanceTo(t){return fI([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=z(this,Rf).nearestNode;if(void 0!==t)return t;let e=Li.instances.get(z(this,Df)).findNearestNodeOnMap(this.map.id,this);return z(this,Rf).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};l(el,"MappedinCoordinate"),Af=new WeakSet,dI=l((function(t){if(void 0!==z(this,Jo)&&void 0!==z(this,Zo))return z(this,"lat"===t?Jo:Zo);if(void 0!==z(this,Qo)&&void 0!==z(this,ea)){let[e,n]=Kn(this,lg,QF).call(this,z(this,Qo),z(this,ea));return ue(this,Jo,e),ue(this,Zo,n),z(this,"lat"===t?Jo:Zo)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),Lf=new WeakSet,gI=l((function(t){if(z(this,Qo)&&z(this,ea))return z(this,"x"===t?Qo:ea);if(null!=z(this,Jo)&&null!=z(this,Zo)){let[e,n]=Kn(this,ug,ZF).call(this,z(this,Jo),z(this,Zo));return ue(this,Qo,e),ue(this,ea,n),z(this,"x"===t?Qo:ea)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),Rf=new WeakMap,Df=new WeakMap,ug=new WeakSet,ZF=l((function(t,e){let n=this.map.georeference[0],r=new Ae(n.target.x,n.target.y),i=new Ae(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"),lg=new WeakSet,QF=l((function(t,e){let n,r=this.map.georeference[0],i=new Ae(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"),Jo=new WeakMap,Zo=new WeakMap,Qo=new WeakMap,ea=new WeakMap;var ta,Bf,jf,cg=class{constructor(t,e){oe(this,ta,void 0),oe(this,Bf,{}),oe(this,jf,void 0),D(this,"id",""),D(this,"group",""),D(this,"name",""),D(this,"shortName",""),D(this,"elevation",0),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),ue(this,ta,t),ue(this,jf,e),Object.assign(this,e),this._scale=pI(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=Li.instances.get(z(this,ta)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=Li.instances.get(z(this,ta)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=Li.instances.get(z(this,ta)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=z(this,Bf).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&z(this,ta)._mapGroupsById[e]||null;return z(this,Bf).mapGroup=n,n}createCoordinateByXY(t,e){return new el({x:t,y:e,map:this,mappedin:z(this,ta)})}createCoordinate(t,e){return new el({lat:t,lon:e,map:this,mappedin:z(this,ta)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new Ae(e.target.x,e.target.y),i=new Ae(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,Me.warn(e),Me.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new cg(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&jr(e,"perspectives"),t.options.things.mapGroups&&jr(e,"group"),jr(e,"elevation"),jr(e,"x_scale"),jr(e,"scale"),jr(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await Br(t.options,"map",n),o=l((t=>{let e=r.layers.find((e=>e.id===t));e?e.visible=!0:r.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let n=0,s=i.length;n<s;++n){var r=i[n];if(r){let t=r.perspective;null!=t&&(r.perspectiveId=t.id,e.indexOf("scene")>-1&&(r.scene=t.scene),t.layers?(r.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(o)):r.layers.forEach((t=>{t.visible=!0}))),delete r.perspective}i[n]=new cg(t,r)}return i}catch(t){return Me.error("Fetch Maps:",t),[]}}toJSON(){return z(this,jf)}},Ff=cg;l(Ff,"MappedinMap"),ta=new WeakMap,Bf=new WeakMap,jf=new WeakMap,v();var qf,tl,Gf,fg=class{constructor(t,e){oe(this,qf,void 0),oe(this,tl,void 0),oe(this,Gf,{}),D(this,"id",""),D(this,"name",""),ue(this,tl,e),ue(this,qf,t),Object.assign(this,e)}get maps(){let t=z(this,Gf).maps;if(void 0!==t)return t;let e=[],{maps:n}=z(this,qf),{id:r}=z(this,tl);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return z(this,Gf).maps=e,e}static hydrate(t,e){return t.map((t=>new fg(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await Br(t.options,"map-group",e)).map((e=>new fg(t,e)))}catch(t){return Me.error("Fetch Map Groups:",t),[]}}toJSON(){return z(this,tl)}},zf=fg;l(zf,"MappedinMapGroup"),qf=new WeakMap,tl=new WeakMap,Gf=new WeakMap,v();var io,rl,zn,Vf,pg=class extends Pa{constructor(t,e){super(t),oe(this,io,void 0),oe(this,rl,void 0),oe(this,zn,{}),D(this,"id",""),D(this,"x",0),D(this,"y",0),D(this,"operationHours"),D(this,"externalId"),oe(this,Vf,void 0),ue(this,io,t),ue(this,rl,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=z(this,zn).map;if(void 0!==t)return t;let e=z(this,io).getCollectionItemById(Fa.MAP,z(this,rl).map);return z(this,zn).map=e,e}get lat(){var t;let e=z(this,zn).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=z(this,io)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return z(this,zn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),z(this,zn).cachedLatLon.lat}get lon(){var t;let e=z(this,zn).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=z(this,io)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return z(this,zn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),z(this,zn).cachedLatLon.lon}get paths(){let t=z(this,zn).paths;if(void 0!==t)return t;let e=[],n=z(this,io)._nodesById,r=z(this,Vf);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 z(this,zn).paths=e,e}set paths(t){ue(this,Vf,t)}get locations(){var t,e,n;let r=z(this,zn).locations;if(void 0!==r)return r;let i=[],o=null!=(n=null==(e=null==(t=Li.instances.get(z(this,io)))?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 z(this,zn).locations=i,i}get polygon(){var t,e,n;let r=z(this,zn).polygon;if(void 0!==r)return r;let i,o=null!=(n=null==(e=null==(t=Li.instances.get(z(this,io)))?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 z(this,zn).polygon=i,i}static hydrate(t,e){return t.map((t=>new pg(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&jr(e,"map"),["weight","multiplier","accessible"].forEach((function(t){jr(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Br(t.options,"node",n)).map((e=>new pg(t,e)))}catch(t){return Me.error("Fetch Nodes:",t),[]}}directionsTo(t,e){let n=t instanceof So,r=z(this,io).venue.slug,i=new Kc({with_destination_set:n||void 0,venue:r});return Nr.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,io).venue.slug;return Nr.addPendingEvent(new Jc({venue:n})),super.distanceTo(t,e)}toJSON(){return z(this,rl)}},Uf=pg;l(Uf,"MappedinNode"),io=new WeakMap,rl=new WeakMap,zn=new WeakMap,Vf=new WeakMap,v();var Yf,hg=class{constructor(t){oe(this,Yf,void 0),D(this,"polygons",[]),ue(this,Yf,t),Object.assign(this,t)}static hydrate(t){return new hg(t)}static async fetch(t){try{let e=await f1(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new hg(e)}catch(t){return Me.error("Fetch Rankings:",t),null}}toJSON(){return z(this,Yf)}},Xf=hg;l(Xf,"MappedinRankings"),Yf=new WeakMap,v();var Wf,gg=class{constructor(t){D(this,"id",""),oe(this,Wf,void 0),ue(this,Wf,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new gg(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await Br(t.options,"apollo-theme",e)).map((t=>new gg(t)))}catch(t){return Me.error("Fetch Theme:",t),[]}}toJSON(){return z(this,Wf)}},dg=gg;l(dg,"MappedinTheme"),Wf=new WeakMap,v();var $f,Kf,Jf,nl,mg=class{constructor(t,e){oe(this,$f,void 0),oe(this,Kf,void 0),oe(this,Jf,void 0),oe(this,nl,{}),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",""),ue(this,Kf,t),ue(this,$f,e),Object.assign(this,e)}get metadata(){return Nr.addPendingEvent(new ef({venue:this.slug})),z(this,Jf)}set metadata(t){ue(this,Jf,t)}static hydrate(t,e){return new mg(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await Br(t.options,"venue",e);return new mg(t,n[0])}catch(t){return Me.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==z(this,nl).isMultiBuilding){let t=z(this,Kf).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;z(this,nl).isMultiBuilding=n}return z(this,nl).isMultiBuilding}toJSON(){return z(this,$f)}},Hf=mg;l(Hf,"MappedinVenue"),$f=new WeakMap,Kf=new WeakMap,Jf=new WeakMap,nl=new WeakMap,v();var Qf,vg=class{constructor(t){D(this,"id",""),oe(this,Qf,void 0),D(this,"name"),D(this,"type"),D(this,"weight"),D(this,"multiplier"),D(this,"nodes"),ue(this,Qf,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new vg(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){jr(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await Br(t.options,"vortex",n)).map((t=>new vg(t)))}catch(t){return Me.error("Fetch Vortexes:",t),[]}}toJSON(){return z(this,Qf)}},Zf=vg;l(Zf,"MappedinVortex"),Qf=new WeakMap,v(),v(),v(),v();var dn=6371008.8,mI={centimeters:100*dn,centimetres:100*dn,degrees:dn/111325,feet:3.28084*dn,inches:39.37*dn,kilometers:dn/1e3,kilometres:dn/1e3,meters:dn,metres:dn,miles:dn/1609.344,millimeters:1e3*dn,millimetres:1e3*dn,nauticalmiles:dn/1852,radians:1,yards:1.0936*dn},MX={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/dn,yards:1.0936133};function gn(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 Gt(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(!ra(t[0])||!ra(t[1]))throw new Error("coordinates must contain numbers");return gn({type:"Point",coordinates:t},e,n)}function pr(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 gn({type:"Polygon",coordinates:t},e,n)}function Or(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 gn({type:"LineString",coordinates:t},e,n)}function We(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 au(t,e,n){return void 0===n&&(n={}),gn({type:"MultiLineString",coordinates:t},e,n)}function p1(t,e,n){return void 0===n&&(n={}),gn({type:"MultiPoint",coordinates:t},e,n)}function ep(t,e){void 0===e&&(e="kilometers");var n=mI[e];if(!n)throw new Error(e+" units is invalid");return t*n}function tp(t,e){void 0===e&&(e="kilometers");var n=mI[e];if(!n)throw new Error(e+" units is invalid");return t/n}function su(t){return 180*(t%(2*Math.PI))/Math.PI}function kn(t){return t%360*Math.PI/180}function ra(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function on(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===on(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function vI(t,e,n,r){var i=n;return on(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function ir(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 na(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 Zn(t,e){na(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(gn(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(gn({type:s,coordinates:u},r),n,l))return!1}}))}function yg(t,e){Zn(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===on(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=Or([s,o],t.properties);if(!1===e(d,n,r,f,i))return!1;i++,s=o})))return!1}}}))}function yI(t,e,n){var r=n,i=!1;return yg(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 h1(t){var e=[1/0,1/0,-1/0,-1/0];return on(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(gn,"feature"),l(Gt,"point"),l(pr,"polygon"),l(Or,"lineString"),l(We,"featureCollection"),l(au,"multiLineString"),l(p1,"multiPoint"),l(ep,"radiansToLength"),l(tp,"lengthToRadians"),l(su,"radiansToDegrees"),l(kn,"degreesToRadians"),l(ra,"isNumber"),l(on,"coordEach"),l(vI,"coordReduce"),l(ir,"featureEach"),l(na,"geomEach"),l(Zn,"flattenEach"),l(yg,"segmentEach"),l(yI,"segmentReduce"),l(h1,"bbox"),h1.default=h1;var Nn=h1;function Ar(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 or(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 d1(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 qn(t){return"Feature"===t.type?t.geometry:t}function Fi(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}v(),v(),v(),v(),l(Ar,"getCoord"),l(or,"getCoords"),l(d1,"featureOf"),l(qn,"getGeom"),l(Fi,"getType");var s3=er(_g());v();var v3=er(FI());function On(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=Ar(t),i=qn(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===y3(r,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(BI(r,a[u][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[u].length&&!c;)BI(r,a[u][h],!n.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function BI(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 y3(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function _3(t,e,n){void 0===n&&(n={});var r=Ar(t),i=Ar(e),o=kn(i[1]-r[1]),s=kn(i[0]-r[0]),a=kn(r[1]),l=kn(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return ep(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}v(),v(),l(On,"booleanPointInPolygon"),l(BI,"inRing"),l(y3,"inBBox"),v(),v(),l(_3,"distance");var Mr=_3;v();var ZX=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}();v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v();var zI=new ArrayBuffer(16),eW=new Float64Array(zI),tW=new Uint32Array(zI);v(),v(),v(),v(),v(),v();var L3=er(k1());v(),v(),v(),v(),v();var SH=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 R3((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},t}();function R3(t,e,n,r,i){var o=D3(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 D3(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 op(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 pr([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}function F3(t){return op(Nn(t))}l(R3,"bezier"),l(D3,"B"),v(),v(),v(),v(),l(op,"bboxPolygon"),l(F3,"envelope");var N1=F3;function ia(t,e,n,r){void 0===r&&(r={});var i=Ar(t),o=kn(i[0]),s=kn(i[1]),a=kn(n),l=tp(e,r.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return Gt([su(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),su(u)],r.properties)}function Ba(t,e,n){if(void 0===n&&(n={}),!0===n.final)return B3(t,e);var r=Ar(t),i=Ar(e),o=kn(r[0]),s=kn(i[0]),a=kn(r[1]),l=kn(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 su(Math.atan2(u,c))}function B3(t,e){var n=Ba(e,t);return n=(n+180)%360}function j3(t,e){void 0===e&&(e={});var n=Nn(t);return Gt([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}v(),v(),v(),l(ia,"destination"),v(),v(),l(Ba,"bearing"),l(B3,"calculateFinalBearing"),v(),l(j3,"center");var uu=j3;v(),v(),v(),v(),v();var rB=er(KI());function nB(t){if(!t)throw new Error("geojson is required");var e=[];return Zn(t,(function(t){iB(t,e)})),We(e)}function iB(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=or(r);break;case"LineString":n=[or(r)]}n.forEach((function(n){oB(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}function oB(t,e){var n=[];return t.reduce((function(t,r){var i=Or([t,r],e);return i.bbox=aB(t,r),n.push(i),r})),n}function aB(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]}v(),v(),v(),v(),l(nB,"lineSegment"),l(iB,"lineSegmentFeature"),l(oB,"createSegments"),l(aB,"bbox");var cu=nB,pP=er(Rg());function AB(t,e){var n={},r=[];if("LineString"===t.type&&(t=gn(t)),"LineString"===e.type&&(e=gn(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=hP(t,e);return i&&r.push(i),We(r)}var o=(0,pP.default)();return o.load(cu(e)),ir(cu(t),(function(t){ir(o.search(t),(function(e){var i=hP(t,e);if(i){var o=or(i).join(",");n[o]||(n[o]=!0,r.push(i))}}))})),We(r)}function hP(t,e){var n=or(t),r=or(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),f=(c-l)*(o-u)-(h-u)*(i-l),d=(s-i)*(o-u)-(a-o)*(i-l);if(0===p)return null;var g=f/p,y=d/p;return g>=0&&g<=1&&y>=0&&y<=1?Gt([i+g*(s-i),o+g*(a-o)]):null}l(AB,"lineIntersect"),l(hP,"intersects");var fu=AB;function LB(t,e,n){void 0===n&&(n={});var r=Gt([1/0,1/0],{dist:1/0}),i=0;return Zn(t,(function(t){for(var o=or(t),s=0;s<o.length-1;s++){var a=Gt(o[s]);a.properties.dist=Mr(e,a,n);var l=Gt(o[s+1]);l.properties.dist=Mr(e,l,n);var u=Mr(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),h=Ba(a,l),p=ia(e,c,h+90,n),f=ia(e,c,h-90,n),d=fu(Or([p.geometry.coordinates,f.geometry.coordinates]),Or([a.geometry.coordinates,l.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=Mr(e,g,n),g.properties.location=i+Mr(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(LB,"nearestPointOnLine");var ja=LB;v(),v(),v();var DB=er(_g());function pu(t,e){return void 0===e&&(e={}),yI(t,(function(t,n){var r=n.geometry.coordinates;return t+Mr(r[0],r[1],e)}),0)}function FB(t,e,n){var r=or(n);if("LineString"!==Fi(n))throw new Error("line must be a LineString");for(var i,o=ja(n,t),s=ja(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),Or(a,n.properties)}v(),v(),v(),v(),v(),v(),l(pu,"length"),v(),l(FB,"lineSlice");var Fg=FB;function BB(t,e,n){void 0===n&&(n={});for(var r=Ar(t),i=or(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")),jB(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1}function jB(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}v(),v(),v(),v(),l(BB,"booleanPointOnLine"),l(jB,"isPointOnLineSegment");var cl=BB;v(),v(),v(),v();var GB=er(k1());v();var gP=Math.PI/180,mP=180/Math.PI,cp=l((function(t,e){this.lon=t,this.lat=e,this.x=gP*t,this.y=gP*e}),"Coord");cp.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},cp.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new cp(e,t)};var vP=l((function(){this.coords=[],this.length=0}),"LineString");vP.prototype.move_to=function(t){this.length++,this.coords.push(t)};var K1=l((function(t){this.properties=t||{},this.geometries=[]}),"Arc");K1.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}},K1.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 yP=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 cp(t.x,t.y),this.end=new cp(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");yP.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=mP*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[mP*Math.atan2(i,r),s]},yP.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 N=w;w=E,E=N;var S=x;x=I,I=S}if(w>c&&E<h&&(E+=360),w<=180&&E>=180&&w<E){var C=(180-w)/(E-w),M=C*I+(1-C)*x;m.push([n[_-1][0]>c?180:-180,M]),(m=[]).push([n[_-1][0]>c?-180:180,M]),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 L=new K1(this.properties),A=0;A<v.length;++A){var T=new vP;L.geometries.push(T);for(var D=v[A],R=0;R<D.length;++R)T.move_to(D[R])}return L},v();var XB=er(Rg());v(),v(),v(),v(),v(),v();var bz=er(Rg()),xz=er(E_());v(),v(),v(),v(),v(),v(),v();var Mz=er(_g()),et=[],tt=[],rt=[],nt=[],it=[],ot=[],at=[],st=[],ut=[],lt=[],ct=[],ft=[],pt=[],ht=[],dt=[],gt=[],mt=[],vt=[],yt=[],_t=[],bt=[],xt=[],wt=[],Et=[];at[85]=lt[85]=-1,st[85]=ct[85]=0,ut[85]=ft[85]=1,yt[85]=xt[85]=1,_t[85]=wt[85]=0,bt[85]=Et[85]=1,et[85]=nt[85]=0,tt[85]=it[85]=-1,rt[85]=dt[85]=0,gt[85]=pt[85]=0,mt[85]=ht[85]=1,ot[85]=vt[85]=1,xt[1]=xt[169]=0,wt[1]=wt[169]=-1,Et[1]=Et[169]=0,pt[1]=pt[169]=-1,ht[1]=ht[169]=0,dt[1]=dt[169]=0,lt[4]=lt[166]=0,ct[4]=ct[166]=-1,ft[4]=ft[166]=1,gt[4]=gt[166]=1,mt[4]=mt[166]=0,vt[4]=vt[166]=0,at[16]=at[154]=0,st[16]=st[154]=1,ut[16]=ut[154]=1,nt[16]=nt[154]=1,it[16]=it[154]=0,ot[16]=ot[154]=1,yt[64]=yt[106]=0,_t[64]=_t[106]=1,bt[64]=bt[106]=0,et[64]=et[106]=-1,tt[64]=tt[106]=0,rt[64]=rt[106]=1,yt[2]=yt[168]=0,_t[2]=_t[168]=-1,bt[2]=bt[168]=1,xt[2]=xt[168]=0,wt[2]=wt[168]=-1,Et[2]=Et[168]=0,pt[2]=pt[168]=-1,ht[2]=ht[168]=0,dt[2]=dt[168]=0,gt[2]=gt[168]=-1,mt[2]=mt[168]=0,vt[2]=vt[168]=1,at[8]=at[162]=0,st[8]=st[162]=-1,ut[8]=ut[162]=0,lt[8]=lt[162]=0,ct[8]=ct[162]=-1,ft[8]=ft[162]=1,pt[8]=pt[162]=1,ht[8]=ht[162]=0,dt[8]=dt[162]=1,gt[8]=gt[162]=1,mt[8]=mt[162]=0,vt[8]=vt[162]=0,at[32]=at[138]=0,st[32]=st[138]=1,ut[32]=ut[138]=1,lt[32]=lt[138]=0,ct[32]=ct[138]=1,ft[32]=ft[138]=0,et[32]=et[138]=1,tt[32]=tt[138]=0,rt[32]=rt[138]=0,nt[32]=nt[138]=1,it[32]=it[138]=0,ot[32]=ot[138]=1,xt[128]=xt[42]=0,wt[128]=wt[42]=1,Et[128]=Et[42]=1,yt[128]=yt[42]=0,_t[128]=_t[42]=1,bt[128]=bt[42]=0,et[128]=et[42]=-1,tt[128]=tt[42]=0,rt[128]=rt[42]=1,nt[128]=nt[42]=-1,it[128]=it[42]=0,ot[128]=ot[42]=0,lt[5]=lt[165]=-1,ct[5]=ct[165]=0,ft[5]=ft[165]=0,xt[5]=xt[165]=1,wt[5]=wt[165]=0,Et[5]=Et[165]=0,gt[20]=gt[150]=0,mt[20]=mt[150]=1,vt[20]=vt[150]=1,nt[20]=nt[150]=0,it[20]=it[150]=-1,ot[20]=ot[150]=1,at[80]=at[90]=-1,st[80]=st[90]=0,ut[80]=ut[90]=1,yt[80]=yt[90]=1,_t[80]=_t[90]=0,bt[80]=bt[90]=1,pt[65]=pt[105]=0,ht[65]=ht[105]=1,dt[65]=dt[105]=0,et[65]=et[105]=0,tt[65]=tt[105]=-1,rt[65]=rt[105]=0,at[160]=at[10]=-1,st[160]=st[10]=0,ut[160]=ut[10]=1,lt[160]=lt[10]=-1,ct[160]=ct[10]=0,ft[160]=ft[10]=0,xt[160]=xt[10]=1,wt[160]=wt[10]=0,Et[160]=Et[10]=0,yt[160]=yt[10]=1,_t[160]=_t[10]=0,bt[160]=bt[10]=1,gt[130]=gt[40]=0,mt[130]=mt[40]=1,vt[130]=vt[40]=1,pt[130]=pt[40]=0,ht[130]=ht[40]=1,dt[130]=dt[40]=0,et[130]=et[40]=0,tt[130]=tt[40]=-1,rt[130]=rt[40]=0,nt[130]=nt[40]=0,it[130]=it[40]=-1,ot[130]=ot[40]=1,lt[37]=lt[133]=0,ct[37]=ct[133]=1,ft[37]=ft[133]=1,xt[37]=xt[133]=0,wt[37]=wt[133]=1,Et[37]=Et[133]=0,et[37]=et[133]=-1,tt[37]=tt[133]=0,rt[37]=rt[133]=0,nt[37]=nt[133]=1,it[37]=it[133]=0,ot[37]=ot[133]=0,gt[148]=gt[22]=-1,mt[148]=mt[22]=0,vt[148]=vt[22]=0,xt[148]=xt[22]=0,wt[148]=wt[22]=-1,Et[148]=Et[22]=1,yt[148]=yt[22]=0,_t[148]=_t[22]=1,bt[148]=bt[22]=1,nt[148]=nt[22]=-1,it[148]=it[22]=0,ot[148]=ot[22]=1,at[82]=at[88]=0,st[82]=st[88]=-1,ut[82]=ut[88]=1,gt[82]=gt[88]=1,mt[82]=mt[88]=0,vt[82]=vt[88]=1,pt[82]=pt[88]=-1,ht[82]=ht[88]=0,dt[82]=dt[88]=1,yt[82]=yt[88]=0,_t[82]=_t[88]=-1,bt[82]=bt[88]=0,at[73]=at[97]=0,st[73]=st[97]=1,ut[73]=ut[97]=0,lt[73]=lt[97]=0,ct[73]=ct[97]=-1,ft[73]=ft[97]=0,pt[73]=pt[97]=1,ht[73]=ht[97]=0,dt[73]=dt[97]=0,et[73]=et[97]=1,tt[73]=tt[97]=0,rt[73]=rt[97]=1,at[145]=at[25]=0,st[145]=st[25]=-1,ut[145]=ut[25]=0,pt[145]=pt[25]=1,ht[145]=ht[25]=0,dt[145]=dt[25]=1,xt[145]=xt[25]=0,wt[145]=wt[25]=1,Et[145]=Et[25]=1,nt[145]=nt[25]=-1,it[145]=it[25]=0,ot[145]=ot[25]=0,lt[70]=lt[100]=0,ct[70]=ct[100]=1,ft[70]=ft[100]=0,gt[70]=gt[100]=-1,mt[70]=mt[100]=0,vt[70]=vt[100]=1,yt[70]=yt[100]=0,_t[70]=_t[100]=-1,bt[70]=bt[100]=1,et[70]=et[100]=1,tt[70]=tt[100]=0,rt[70]=rt[100]=0,lt[101]=lt[69]=0,ct[101]=ct[69]=1,ft[101]=ft[69]=0,et[101]=et[69]=1,tt[101]=tt[69]=0,rt[101]=rt[69]=0,xt[149]=xt[21]=0,wt[149]=wt[21]=1,Et[149]=Et[21]=1,nt[149]=nt[21]=-1,it[149]=it[21]=0,ot[149]=ot[21]=0,gt[86]=gt[84]=-1,mt[86]=mt[84]=0,vt[86]=vt[84]=1,yt[86]=yt[84]=0,_t[86]=_t[84]=-1,bt[86]=bt[84]=1,at[89]=at[81]=0,st[89]=st[81]=-1,ut[89]=ut[81]=0,pt[89]=pt[81]=1,ht[89]=ht[81]=0,dt[89]=dt[81]=1,at[96]=at[74]=0,st[96]=st[74]=1,ut[96]=ut[74]=0,lt[96]=lt[74]=-1,ct[96]=ct[74]=0,ft[96]=ft[74]=1,yt[96]=yt[74]=1,_t[96]=_t[74]=0,bt[96]=bt[74]=0,et[96]=et[74]=1,tt[96]=tt[74]=0,rt[96]=rt[74]=1,at[24]=at[146]=0,st[24]=st[146]=-1,ut[24]=ut[146]=1,gt[24]=gt[146]=1,mt[24]=mt[146]=0,vt[24]=vt[146]=1,pt[24]=pt[146]=0,ht[24]=ht[146]=1,dt[24]=dt[146]=1,nt[24]=nt[146]=0,it[24]=it[146]=-1,ot[24]=ot[146]=0,lt[6]=lt[164]=-1,ct[6]=ct[164]=0,ft[6]=ft[164]=1,gt[6]=gt[164]=-1,mt[6]=mt[164]=0,vt[6]=vt[164]=0,xt[6]=xt[164]=0,wt[6]=wt[164]=-1,Et[6]=Et[164]=1,yt[6]=yt[164]=1,_t[6]=_t[164]=0,bt[6]=bt[164]=0,pt[129]=pt[41]=0,ht[129]=ht[41]=1,dt[129]=dt[41]=1,xt[129]=xt[41]=0,wt[129]=wt[41]=1,Et[129]=Et[41]=0,et[129]=et[41]=-1,tt[129]=tt[41]=0,rt[129]=rt[41]=0,nt[129]=nt[41]=0,it[129]=it[41]=-1,ot[129]=ot[41]=0,gt[66]=gt[104]=0,mt[66]=mt[104]=1,vt[66]=vt[104]=0,pt[66]=pt[104]=-1,ht[66]=ht[104]=0,dt[66]=dt[104]=1,yt[66]=yt[104]=0,_t[66]=_t[104]=-1,bt[66]=bt[104]=0,et[66]=et[104]=0,tt[66]=tt[104]=-1,rt[66]=rt[104]=1,at[144]=at[26]=-1,st[144]=st[26]=0,ut[144]=ut[26]=0,xt[144]=xt[26]=1,wt[144]=wt[26]=0,Et[144]=Et[26]=1,yt[144]=yt[26]=0,_t[144]=_t[26]=1,bt[144]=bt[26]=1,nt[144]=nt[26]=-1,it[144]=it[26]=0,ot[144]=ot[26]=1,lt[36]=lt[134]=0,ct[36]=ct[134]=1,ft[36]=ft[134]=1,gt[36]=gt[134]=0,mt[36]=mt[134]=1,vt[36]=vt[134]=0,et[36]=et[134]=0,tt[36]=tt[134]=-1,rt[36]=rt[134]=1,nt[36]=nt[134]=1,it[36]=it[134]=0,ot[36]=ot[134]=0,at[9]=at[161]=-1,st[9]=st[161]=0,ut[9]=ut[161]=0,lt[9]=lt[161]=0,ct[9]=ct[161]=-1,ft[9]=ft[161]=0,pt[9]=pt[161]=1,ht[9]=ht[161]=0,dt[9]=dt[161]=0,xt[9]=xt[161]=1,wt[9]=wt[161]=0,Et[9]=Et[161]=1,at[136]=0,st[136]=1,ut[136]=1,lt[136]=0,ct[136]=1,ft[136]=0,gt[136]=-1,mt[136]=0,vt[136]=1,pt[136]=-1,ht[136]=0,dt[136]=0,xt[136]=0,wt[136]=-1,Et[136]=0,yt[136]=0,_t[136]=-1,bt[136]=1,et[136]=1,tt[136]=0,rt[136]=0,nt[136]=1,it[136]=0,ot[136]=1,at[34]=0,st[34]=-1,ut[34]=0,lt[34]=0,ct[34]=-1,ft[34]=1,gt[34]=1,mt[34]=0,vt[34]=0,pt[34]=1,ht[34]=0,dt[34]=1,xt[34]=0,wt[34]=1,Et[34]=1,yt[34]=0,_t[34]=1,bt[34]=0,et[34]=-1,tt[34]=0,rt[34]=1,nt[34]=-1,it[34]=0,ot[34]=0,at[35]=0,st[35]=1,ut[35]=1,lt[35]=0,ct[35]=-1,ft[35]=1,gt[35]=1,mt[35]=0,vt[35]=0,pt[35]=-1,ht[35]=0,dt[35]=0,xt[35]=0,wt[35]=-1,Et[35]=0,yt[35]=0,_t[35]=1,bt[35]=0,et[35]=-1,tt[35]=0,rt[35]=1,nt[35]=1,it[35]=0,ot[35]=1,at[153]=0,st[153]=1,ut[153]=1,pt[153]=-1,ht[153]=0,dt[153]=0,xt[153]=0,wt[153]=-1,Et[153]=0,nt[153]=1,it[153]=0,ot[153]=1,lt[102]=0,ct[102]=-1,ft[102]=1,gt[102]=1,mt[102]=0,vt[102]=0,yt[102]=0,_t[102]=1,bt[102]=0,et[102]=-1,tt[102]=0,rt[102]=1,at[155]=0,st[155]=-1,ut[155]=0,pt[155]=1,ht[155]=0,dt[155]=1,xt[155]=0,wt[155]=1,Et[155]=1,nt[155]=-1,it[155]=0,ot[155]=0,lt[103]=0,ct[103]=1,ft[103]=0,gt[103]=-1,mt[103]=0,vt[103]=1,yt[103]=0,_t[103]=-1,bt[103]=1,et[103]=1,tt[103]=0,rt[103]=0,at[152]=0,st[152]=1,ut[152]=1,gt[152]=-1,mt[152]=0,vt[152]=1,pt[152]=-1,ht[152]=0,dt[152]=0,xt[152]=0,wt[152]=-1,Et[152]=0,yt[152]=0,_t[152]=-1,bt[152]=1,nt[152]=1,it[152]=0,ot[152]=1,at[156]=0,st[156]=-1,ut[156]=1,gt[156]=1,mt[156]=0,vt[156]=1,pt[156]=-1,ht[156]=0,dt[156]=0,xt[156]=0,wt[156]=-1,Et[156]=0,yt[156]=0,_t[156]=1,bt[156]=1,nt[156]=-1,it[156]=0,ot[156]=1,at[137]=0,st[137]=1,ut[137]=1,lt[137]=0,ct[137]=1,ft[137]=0,pt[137]=-1,ht[137]=0,dt[137]=0,xt[137]=0,wt[137]=-1,Et[137]=0,et[137]=1,tt[137]=0,rt[137]=0,nt[137]=1,it[137]=0,ot[137]=1,at[139]=0,st[139]=1,ut[139]=1,lt[139]=0,ct[139]=-1,ft[139]=0,pt[139]=1,ht[139]=0,dt[139]=0,xt[139]=0,wt[139]=1,Et[139]=0,et[139]=-1,tt[139]=0,rt[139]=0,nt[139]=1,it[139]=0,ot[139]=1,at[98]=0,st[98]=-1,ut[98]=0,lt[98]=0,ct[98]=-1,ft[98]=1,gt[98]=1,mt[98]=0,vt[98]=0,pt[98]=1,ht[98]=0,dt[98]=1,yt[98]=0,_t[98]=1,bt[98]=0,et[98]=-1,tt[98]=0,rt[98]=1,at[99]=0,st[99]=1,ut[99]=0,lt[99]=0,ct[99]=-1,ft[99]=1,gt[99]=1,mt[99]=0,vt[99]=0,pt[99]=-1,ht[99]=0,dt[99]=1,yt[99]=0,_t[99]=-1,bt[99]=0,et[99]=1,tt[99]=0,rt[99]=1,lt[38]=0,ct[38]=-1,ft[38]=1,gt[38]=1,mt[38]=0,vt[38]=0,xt[38]=0,wt[38]=1,Et[38]=1,yt[38]=0,_t[38]=1,bt[38]=0,et[38]=-1,tt[38]=0,rt[38]=1,nt[38]=-1,it[38]=0,ot[38]=0,lt[39]=0,ct[39]=1,ft[39]=1,gt[39]=-1,mt[39]=0,vt[39]=0,xt[39]=0,wt[39]=-1,Et[39]=1,yt[39]=0,_t[39]=1,bt[39]=0,et[39]=-1,tt[39]=0,rt[39]=1,nt[39]=1,it[39]=0,ot[39]=0;var M_=l((function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p00"),I_=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]}),"p01"),P_=l((function(t){return[[t.topright,1],[1,1],[1,t.righttop]]}),"p02"),S_=l((function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]}),"p03"),C_=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]}),"p04"),k_=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]}),"p05"),N_=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]}),"p06"),O_=l((function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p07"),Iz=l((function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]}),"p08"),Pz=l((function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]}),"p09"),Sz=l((function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]}),"p10"),Cz=l((function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p11"),kz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]}),"p12"),Nz=l((function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]}),"p13"),Oz=l((function(){return[[0,0],[0,1],[1,1],[1,0]]}),"p14"),Tz=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]}),"p15"),Az=l((function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]}),"p16"),Lz=l((function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]}),"p17"),Rz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]}),"p18"),Dz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p19"),Fz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]}),"p20"),Bz=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]}),"p21"),jz=l((function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]}),"p22"),zz=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p23"),qz=l((function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p24"),Gz=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]}),"p25"),Uz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p26"),Vz=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p27"),Xz=l((function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p28"),Yz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]}),"p29"),Wz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p30"),Hz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p31"),$z=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p32"),Kz=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"),Jz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p34"),Zz=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p35"),Qz=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"),eq=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"),tq=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"),rq=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"),Nt=[],Ot=[],Tt=[],At=[],Lt=[],Rt=[],Dt=[],Ft=[];At[1]=Lt[1]=18,At[169]=Lt[169]=18,Tt[4]=Ot[4]=12,Tt[166]=Ot[166]=12,Nt[16]=Ft[16]=4,Nt[154]=Ft[154]=4,Rt[64]=Dt[64]=22,Rt[106]=Dt[106]=22,Tt[2]=Rt[2]=17,At[2]=Lt[2]=18,Tt[168]=Rt[168]=17,At[168]=Lt[168]=18,Nt[8]=At[8]=9,Ot[8]=Tt[8]=12,Nt[162]=At[162]=9,Ot[162]=Tt[162]=12,Nt[32]=Ft[32]=4,Ot[32]=Dt[32]=1,Nt[138]=Ft[138]=4,Ot[138]=Dt[138]=1,Lt[128]=Ft[128]=21,Rt[128]=Dt[128]=22,Lt[42]=Ft[42]=21,Rt[42]=Dt[42]=22,Ot[5]=Lt[5]=14,Ot[165]=Lt[165]=14,Tt[20]=Ft[20]=6,Tt[150]=Ft[150]=6,Nt[80]=Rt[80]=11,Nt[90]=Rt[90]=11,At[65]=Dt[65]=3,At[105]=Dt[105]=3,Nt[160]=Rt[160]=11,Ot[160]=Lt[160]=14,Nt[10]=Rt[10]=11,Ot[10]=Lt[10]=14,Tt[130]=Ft[130]=6,At[130]=Dt[130]=3,Tt[40]=Ft[40]=6,At[40]=Dt[40]=3,Ot[101]=Dt[101]=1,Ot[69]=Dt[69]=1,Lt[149]=Ft[149]=21,Lt[21]=Ft[21]=21,Tt[86]=Rt[86]=17,Tt[84]=Rt[84]=17,Nt[89]=At[89]=9,Nt[81]=At[81]=9,Nt[96]=Dt[96]=0,Ot[96]=Rt[96]=15,Nt[74]=Dt[74]=0,Ot[74]=Rt[74]=15,Nt[24]=Tt[24]=8,At[24]=Ft[24]=7,Nt[146]=Tt[146]=8,At[146]=Ft[146]=7,Ot[6]=Rt[6]=15,Tt[6]=Lt[6]=16,Ot[164]=Rt[164]=15,Tt[164]=Lt[164]=16,At[129]=Ft[129]=7,Lt[129]=Dt[129]=20,At[41]=Ft[41]=7,Lt[41]=Dt[41]=20,Tt[66]=Dt[66]=2,At[66]=Rt[66]=19,Tt[104]=Dt[104]=2,At[104]=Rt[104]=19,Nt[144]=Lt[144]=10,Rt[144]=Ft[144]=23,Nt[26]=Lt[26]=10,Rt[26]=Ft[26]=23,Ot[36]=Ft[36]=5,Tt[36]=Dt[36]=2,Ot[134]=Ft[134]=5,Tt[134]=Dt[134]=2,Nt[9]=Lt[9]=10,Ot[9]=At[9]=13,Nt[161]=Lt[161]=10,Ot[161]=At[161]=13,Ot[37]=Ft[37]=5,Lt[37]=Dt[37]=20,Ot[133]=Ft[133]=5,Lt[133]=Dt[133]=20,Tt[148]=Lt[148]=16,Rt[148]=Ft[148]=23,Tt[22]=Lt[22]=16,Rt[22]=Ft[22]=23,Nt[82]=Tt[82]=8,At[82]=Rt[82]=19,Nt[88]=Tt[88]=8,At[88]=Rt[88]=19,Nt[73]=Dt[73]=0,Ot[73]=At[73]=13,Nt[97]=Dt[97]=0,Ot[97]=At[97]=13,Nt[145]=At[145]=9,Lt[145]=Ft[145]=21,Nt[25]=At[25]=9,Lt[25]=Ft[25]=21,Ot[70]=Dt[70]=1,Tt[70]=Rt[70]=17,Ot[100]=Dt[100]=1,Tt[100]=Rt[100]=17,Nt[34]=At[34]=9,Ot[34]=Tt[34]=12,Lt[34]=Ft[34]=21,Rt[34]=Dt[34]=22,Nt[136]=Ft[136]=4,Ot[136]=Dt[136]=1,Tt[136]=Rt[136]=17,At[136]=Lt[136]=18,Nt[35]=Ft[35]=4,Ot[35]=Tt[35]=12,At[35]=Lt[35]=18,Rt[35]=Dt[35]=22,Nt[153]=Ft[153]=4,At[153]=Lt[153]=18,Ot[102]=Tt[102]=12,Rt[102]=Dt[102]=22,Nt[155]=At[155]=9,Lt[155]=Ft[155]=23,Ot[103]=Dt[103]=1,Tt[103]=Rt[103]=17,Nt[152]=Ft[152]=4,Tt[152]=Rt[152]=17,At[152]=Lt[152]=18,Nt[156]=Tt[156]=8,At[156]=Lt[156]=18,Rt[156]=Ft[156]=23,Nt[137]=Ft[137]=4,Ot[137]=Dt[137]=1,At[137]=Lt[137]=18,Nt[139]=Ft[139]=4,Ot[139]=At[139]=13,Lt[139]=Dt[139]=20,Nt[98]=At[98]=9,Ot[98]=Tt[98]=12,Rt[98]=Dt[98]=22,Nt[99]=Dt[99]=0,Ot[99]=Tt[99]=12,At[99]=Rt[99]=19,Ot[38]=Tt[38]=12,Lt[38]=Ft[38]=21,Rt[38]=Dt[38]=22,Ot[39]=Ft[39]=5,Tt[39]=Lt[39]=16,Rt[39]=Dt[39]=22;var xe=[];function iq(t){return(t>0)-(t<0)||+t}function xl(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return iq(r*(n[1]-e[1])-o*i)}function lC(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 T_(t,e){return e.geometry.coordinates[0].every((function(e){return On(Gt(e),t)}))}function cC(t,e){return t[0]===e[0]&&t[1]===e[1]}xe[1]=xe[169]=M_,xe[4]=xe[166]=I_,xe[16]=xe[154]=P_,xe[64]=xe[106]=S_,xe[168]=xe[2]=C_,xe[162]=xe[8]=k_,xe[138]=xe[32]=N_,xe[42]=xe[128]=O_,xe[5]=xe[165]=Iz,xe[20]=xe[150]=Pz,xe[80]=xe[90]=Sz,xe[65]=xe[105]=Cz,xe[160]=xe[10]=kz,xe[130]=xe[40]=Nz,xe[85]=Oz,xe[101]=xe[69]=Tz,xe[149]=xe[21]=Az,xe[86]=xe[84]=Lz,xe[89]=xe[81]=Rz,xe[96]=xe[74]=Dz,xe[24]=xe[146]=Fz,xe[6]=xe[164]=Bz,xe[129]=xe[41]=jz,xe[66]=xe[104]=zz,xe[144]=xe[26]=qz,xe[36]=xe[134]=Gz,xe[9]=xe[161]=Uz,xe[37]=xe[133]=Vz,xe[148]=xe[22]=Xz,xe[82]=xe[88]=Yz,xe[73]=xe[97]=Wz,xe[145]=xe[25]=Hz,xe[70]=xe[100]=$z,xe[34]=function(t){return[O_(t),k_(t)]},xe[35]=Kz,xe[136]=function(t){return[N_(t),C_(t)]},xe[153]=function(t){return[P_(t),M_(t)]},xe[102]=function(t){return[I_(t),S_(t)]},xe[155]=Jz,xe[103]=Zz,xe[152]=function(t){return[P_(t),C_(t)]},xe[156]=Qz,xe[137]=function(t){return[N_(t),M_(t)]},xe[139]=eq,xe[98]=function(t){return[k_(t),S_(t)]},xe[99]=tq,xe[38]=function(t){return[I_(t),O_(t)]},xe[39]=rq,v(),v(),v(),v(),v(),v(),v(),v(),l(iq,"mathSign"),l(xl,"orientationIndex"),l(lC,"envelopeIsEqual"),l(T_,"envelopeContains"),l(cC,"coordinatesEqual");var oq=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=xl(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}(),A_=oq;v();var aq=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 Or([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return xl(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),fC=aq;v();var sq=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=xl(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 p1(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=pr([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=N1(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()),!lC(o,i)&&T_(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 cC(t,e.from.coordinates)}))||(a=t)}),"_loop_1"),c=0,h=s;c<h.length;c++){u(h[c])}a&&e.inside(Gt(a))&&(!r||T_(n,o))&&(r=e)}})),r},t.prototype.inside=function(t){return On(t,this.toPolygon())},t}(),L_=sq;function uq(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(uq,"validateGeoJson");var see=function(){function t(){this.edges=[],this.nodes={}}return l(t,"Graph"),t.fromGeoJson=function(e){uq(e);var n=new t;return Zn(e,(function(t){d1(t,"LineString","Graph::fromGeoJson"),vI(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=A_.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new A_(t)),n},t.prototype.addEdge=function(t,e){var n=new fC(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;void 0===t?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 L_;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}();v(),v(),v(),v();var pq=er(R_());v();var hq=er(R_());v(),v();var gq=er(bC());v();var wq=er(NC());function TC(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function Mq(){return new AC((function(t){return t.f}))}v(),v(),l(TC,"pathTo"),l(Mq,"getHeap");var j_={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||j_.heuristics.manhattan,o=r.closest||!1,s=Mq(),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var l=s.pop();if(l===n)return TC(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?TC(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 yp(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 nm(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function nm(t,e,n){this.x=t,this.y=e,this.weight=n}function AC(t){this.content=[],this.scoreFunction=t}function z_(){this._=null}function El(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function _p(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 bp(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 LC(t){for(;t.L;)t=t.L;return t}l(yp,"Graph"),yp.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)j_.cleanNode(this.nodes[t])},yp.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)j_.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},yp.prototype.markDirty=function(t){this.dirtyNodes.push(t)},yp.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},yp.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(nm,"GridNode"),nm.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},nm.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},nm.prototype.isWall=function(){return 0===this.weight},l(AC,"BinaryHeap"),AC.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}}},v(),v(),v(),v(),v(),v(),v(),v(),l(z_,"RedBlackTree"),l(El,"RedBlackNode"),z_.prototype={constructor:z_,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=LC(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&&(_p(this,n),n=(t=n).U),n.C=!1,r.C=!0,bp(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(bp(this,n),n=(t=n).U),n.C=!1,r.C=!0,_p(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?LC(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,_p(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,bp(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,_p(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,bp(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,_p(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,bp(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},l(_p,"RedBlackRotateLeft"),l(bp,"RedBlackRotateRight"),l(LC,"RedBlackFirst");var q_=z_;function Ml(t,e,n,r){var i=[null,null],o=Tn.push(i)-1;return i.left=t,i.right=e,n&&xp(i,t,e,n),r&&xp(i,e,t,r),fi[t.index].halfedges.push(o),fi[e.index].halfedges.push(o),i}function Il(t,e,n){var r=[e,n];return r.left=t,r}function xp(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 Iq(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 Pq(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 RC(t,e,n,r){for(var i,o=Tn.length;o--;)Pq(i=Tn[o],t,e,n,r)&&Iq(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>ar||Math.abs(i[0][1]-i[1][1])>ar)||delete Tn[o]}function DC(t){return fi[t.index]={site:t,halfedges:[]}}function Sq(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 G_(t,e){return e[+(e.left!==t.site)]}function Cq(t,e){return e[+(e.left===t.site)]}function FC(){for(var t,e,n,r,i=0,o=fi.length;i<o;++i)if((t=fi[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]=Sq(t,Tn[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 BC(t,e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=fi.length,v=!0;for(i=0;i<y;++i)if(o=fi[i]){for(s=o.site,a=(l=o.halfedges).length;a--;)Tn[l[a]]||l.splice(a,1);for(a=0,u=l.length;a<u;)d=(f=Cq(o,Tn[l[a]]))[0],g=f[1],h=(c=G_(o,Tn[l[++a%u]]))[0],p=c[1],(Math.abs(d-h)>ar||Math.abs(g-p)>ar)&&(l.splice(a,0,Tn.push(Il(s,f,Math.abs(d-t)<ar&&r-g>ar?[t,Math.abs(h-t)<ar?p:r]:Math.abs(g-r)<ar&&n-d>ar?[Math.abs(p-r)<ar?h:n,r]:Math.abs(d-n)<ar&&g-e>ar?[n,Math.abs(h-n)<ar?p:e]:Math.abs(g-e)<ar&&d-t>ar?[Math.abs(p-e)<ar?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=fi[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],N=[n,e];v.halfedges.push(Tn.push(Il(s=v.site,x,E))-1,Tn.push(Il(s,E,I))-1,Tn.push(Il(s,I,N))-1,Tn.push(Il(s,N,x))-1)}}for(i=0;i<y;++i)(o=fi[i])&&(o.halfedges.length||delete fi[i])}v(),v(),l(Ml,"createEdge"),l(Il,"createBorderEdge"),l(xp,"setEdgeEnd"),l(Iq,"clipEdge"),l(Pq,"connectEdge"),l(RC,"clipEdges"),l(DC,"createCell"),l(Sq,"cellHalfedgeAngle"),l(G_,"cellHalfedgeStart"),l(Cq,"cellHalfedgeEnd"),l(FC,"sortCellHalfedges"),l(BC,"clipCells"),v();var im,jC=[];function kq(){El(this),this.x=this.y=this.arc=this.site=this.cy=null}function mu(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>=-zC)){var f=l*l+u*u,d=c*c+h*h,g=(h*f-u*d)/p,y=(l*d-c*f)/p,v=jC.pop()||new kq;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,_=Pl._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Pl.insert(m,v),m||(im=v)}}}}function vu(t){var e=t.circle;e&&(e.P||(im=e.N),Pl.remove(e),jC.push(e),El(e),t.circle=null)}l(kq,"Circle"),l(mu,"attachCircle"),l(vu,"detachCircle");var qC=[];function Nq(){El(this),this.edge=this.site=this.circle=null}function GC(t){var e=qC.pop()||new Nq;return e.site=t,e}function U_(t){vu(t),yu.remove(t),qC.push(t),El(t)}function UC(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];U_(t);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<ar&&Math.abs(r-l.circle.cy)<ar;)o=l.P,a.unshift(l),U_(l),l=o;a.unshift(l),vu(l);for(var u=s;u.circle&&Math.abs(n-u.circle.x)<ar&&Math.abs(r-u.circle.cy)<ar;)s=u.N,a.push(u),U_(u),u=s;a.push(u),vu(u);var c,h=a.length;for(c=1;c<h;++c)u=a[c],l=a[c-1],xp(u.edge,l.site,u.site,i);l=a[0],(u=a[h-1]).edge=Ml(l.site,u.site,null,i),mu(l),mu(u)}function VC(t){for(var e,n,r,i,o=t[0],s=t[1],a=yu._;a;)if((r=XC(a,s)-o)>ar)a=a.L;else{if(!((i=o-Oq(a,s))>ar)){r>-ar?(e=a.P,n=a):i>-ar?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}DC(t);var l=GC(t);if(yu.insert(e,l),e||n){if(e===n)return vu(e),n=GC(e.site),yu.insert(l,n),l.edge=n.edge=Ml(e.site,l.site),mu(e),void mu(n);if(!n)return void(l.edge=Ml(e.site,l.site));vu(e),vu(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];xp(n.edge,u,d,b),l.edge=Ml(u,t,null,b),n.edge=Ml(t,d,null,b),mu(e),mu(n)}}function XC(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 Oq(t,e){var n=t.N;if(n)return XC(n,e);var r=t.site;return r[1]===e?r[0]:1/0}l(Nq,"Beach"),l(GC,"createBeach"),l(U_,"detachBeach"),l(UC,"removeBeach"),l(VC,"addBeach"),l(XC,"leftBreakPoint"),l(Oq,"rightBreakPoint");var yu,fi,Pl,Tn,ar=1e-6,zC=1e-12;function Tq(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Aq(t,e){return e[1]-t[1]||e[0]-t[0]}function om(t,e){var n,r,i,o=t.sort(Aq).pop();for(Tn=[],fi=new Array(t.length),yu=new q_,Pl=new q_;;)if(i=im,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))(o[0]!==n||o[1]!==r)&&(VC(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;UC(i.arc)}if(FC(),e){var s=+e[0][0],a=+e[0][1],l=+e[1][0],u=+e[1][1];RC(s,a,l,u),BC(s,a,l,u)}this.edges=Tn,this.cells=fi,yu=Pl=Tn=fi=null}l(Tq,"triangleArea"),l(Aq,"lexicographic"),l(om,"Diagram"),om.prototype={constructor:om,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return G_(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&&Tq(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}},v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v();var qq=er(Sl());v();var Al=er($C());function pi(){return new sm}function sm(){this.reset()}v(),v(),v(),l(pi,"default"),l(sm,"Adder"),sm.prototype={constructor:sm,reset:function(){this.s=this.t=0},add:function(t){KC(um,t,this.t),KC(this,um.s,this.s),this.s?this.t+=um.t:this.s=um.t},valueOf:function(){return this.s}};var um=new sm;function KC(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}l(KC,"add"),v();var Ue=1e-6,Mt=Math.PI,vn=Mt/2,lm=Mt/4,Gn=2*Mt,hi=180/Mt,Rr=Mt/180,$t=Math.abs,Lo=Math.atan,An=Math.atan2,ze=Math.cos,cm=Math.exp,wp=Math.log,qe=Math.sin,an=Math.sqrt,Ep=Math.tan;function fm(t){return t>1?0:t<-1?Mt:Math.acos(t)}function yn(t){return t>1?vn:t<-1?-vn:Math.asin(t)}function di(){}function pm(t,e){t&&ZC.hasOwnProperty(t.type)&&ZC[t.type](t,e)}l(fm,"acos"),l(yn,"asin"),v(),l(di,"noop"),v(),l(pm,"streamGeometry");var JC={Feature:function(t,e){pm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)pm(n[r].geometry,e)}},ZC={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){Y_(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Y_(n[r],e,0)},Polygon:function(t,e){QC(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)QC(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)pm(n[r],e)}};function Y_(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 QC(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Y_(t[n],e,1);e.polygonEnd()}function qa(t,e){t&&JC.hasOwnProperty(t.type)?JC[t.type](t,e):pm(t,e)}l(Y_,"streamLine"),l(QC,"streamPolygon"),l(qa,"default");var Gq=pi(),tne=pi();function Cl(t){return[An(t[1],t[0]),yn(t[2])]}function Ro(t){var e=t[0],n=t[1],r=ze(n);return[r*ze(e),r*qe(e),qe(n)]}function Mp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _u(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 hm(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ip(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kl(t){var e=an(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}v(),v(),l(Cl,"spherical"),l(Ro,"cartesian"),l(Mp,"cartesianDot"),l(_u,"cartesianCross"),l(hm,"cartesianAddInPlace"),l(Ip,"cartesianScale"),l(kl,"cartesianNormalizeInPlace");var fne=pi();function Pp(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 W_(t,e){return[t>Mt?t-Gn:t<-Mt?t+Gn:t,e]}function H_(t,e,n){return(t%=Gn)?e||n?Pp(tk(t),rk(e,n)):tk(t):e||n?rk(e,n):W_}function ek(t){return function(e,n){return[(e+=t)>Mt?e-Gn:e<-Mt?e+Gn:e,n]}}function tk(t){var e=ek(t);return e.invert=ek(-t),e}function rk(t,e){var n=ze(t),r=qe(t),i=ze(e),o=qe(e);function s(t,e){var s=ze(e),a=ze(t)*s,l=qe(t)*s,u=qe(e),c=u*n+a*r;return[An(l*i-c*o,a*n-u*r),yn(c*i+l*o)]}return l(s,"rotation"),s.invert=function(t,e){var s=ze(e),a=ze(t)*s,l=qe(t)*s,u=qe(e),c=u*i-l*o;return[An(l*i+u*o,a*n+c*r),yn(c*n-a*r)]},s}function nk(t,e,n,r,i,o){if(n){var s=ze(e),a=qe(e),l=r*n;null==i?(i=e+r*Gn,o=e-l/2):(i=ik(s,i),o=ik(s,o),(r>0?i<o:i>o)&&(i+=r*Gn));for(var u,c=i;r>0?c>o:c<o;c-=l)u=Cl([s,-a*ze(c),-a*qe(c)]),t.point(u[0],u[1])}}function ik(t,e){(e=Ro(e))[0]-=t,kl(e);var n=fm(-e[1]);return((-e[2]<0?-n:n)+Gn-Ue)%Gn}function Sp(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:di,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function $_(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 bu(t,e){return $t(t[0]-e[0])<Ue&&$t(t[1]-e[1])<Ue}function dm(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 Cp(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(bu(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 dm(r,t,null,!0)),l.push(n.o=new dm(r,null,n,!1)),a.push(n=new dm(s,t,null,!1)),l.push(n.o=new dm(s,null,n,!0))}})),a.length){for(l.sort(e),ok(a),ok(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 ok(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 Ga(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function gm(t){return 1===t.length&&(t=Uq(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 Uq(t){return function(e,n){return Ga(t(e),n)}}v(),v(),v(),v(),v(),l(Pp,"default"),l(W_,"rotationIdentity"),W_.invert=W_,l(H_,"rotateRadians"),l(ek,"forwardRotationLambda"),l(tk,"rotationLambda"),l(rk,"rotationPhiGamma"),l(nk,"circleStream"),l(ik,"circleRadius"),v(),v(),l(Sp,"default"),v(),l($_,"default"),v(),v(),l(bu,"default"),l(dm,"Intersection"),l(Cp,"default"),l(ok,"link"),v(),v(),v(),l(Ga,"default"),v(),l(gm,"default"),l(Uq,"ascendingComparator");var ak=gm(Ga),Vq=ak.right,Xq=ak.left;v(),v(),v(),v(),v(),v(),v(),v(),v();var sk=Array.prototype,Wq=sk.slice,Hq=sk.map;v(),v(),v(),v();var nie=Math.sqrt(50),iie=Math.sqrt(10),oie=Math.sqrt(2);function Nl(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}v(),v(),v(),v(),v(),v(),v(),v(),l(Nl,"default"),v(),v(),v(),v(),v(),v(),v();var kp=1e9,vm=-kp;function K_(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 $t(r[0]-t)<Ue?i>0?0:3:$t(r[0]-n)<Ue?i>0?2:1:$t(r[1]-e)<Ue?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=Sp(),x={point:E,lineStart:C,lineEnd:M,polygonStart:N,polygonEnd:S};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 N(){b=w,u=[],c=[],_=!0}function S(){var t=I(),e=_&&t,n=(u=Nl(u)).length;(e||n)&&(s.polygonStart(),e&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),n&&Cp(u,a,t,o,s),s.polygonEnd()),b=s,u=c=h=null}function C(){x.point=O,c&&c.push(h=[]),m=!0,v=!1,g=y=NaN}function M(){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(vm,Math.min(kp,g)),y=Math.max(vm,Math.min(kp,y))],u=[o=Math.max(vm,Math.min(kp,o)),s=Math.max(vm,Math.min(kp,s))];$_(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(N,"polygonStart"),l(S,"polygonEnd"),l(C,"lineStart"),l(M,"lineEnd"),l(O,"linePoint"),x}}l(K_,"clipExtent"),v(),v();var J_=pi();function ym(t,e){var n=e[0],r=e[1],i=[qe(n),-ze(n),0],o=0,s=0;J_.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+lm,d=qe(f),g=ze(f),y=0;y<c;++y,p=m,d=b,g=w,h=v){var v=u[y],m=v[0],_=v[1]/2+lm,b=qe(_),w=ze(_),x=m-p,E=x>=0?1:-1,I=E*x,N=I>Mt,S=d*b;if(J_.add(An(S*E*qe(I),g*w+S*ze(I))),o+=N?x+E*Gn:x,N^p>=n^m>=n){var C=_u(Ro(h),Ro(v));kl(C);var M=_u(i,C);kl(M);var O=(N^x>=0?-1:1)*yn(M[2]);(r>O||r===O&&(C[0]||C[1]))&&(s+=N^x>=0?1:-1)}}return(o<-Ue||o<Ue&&J_<-Ue)^1&s}l(ym,"default"),v(),v();var Koe=pi();function Ol(t){return t}v(),v(),v(),v(),l(Ol,"default"),v();var gae=pi(),mae=pi();v();var Tl=1/0,_m=Tl,Np=-Tl,bm=Np,i4={point:o4,lineStart:di,lineEnd:di,polygonStart:di,polygonEnd:di,result:function(){var t=[[Tl,_m],[Np,bm]];return Np=bm=-(_m=Tl=1/0),t}};function o4(t,e){t<Tl&&(Tl=t),t>Np&&(Np=t),e<_m&&(_m=e),e>bm&&(bm=e)}l(o4,"boundsPoint");var xm=i4;function Z_(t){this._context=t}v(),v(),l(Z_,"PathContext"),Z_.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,Gn)}},result:di},v();var Cae=pi();function Q_(){this._string=[]}function ck(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Op(t,e,n,r){return function(i,o){var s,a,u,c=e(o),h=i.invert(r[0],r[1]),p=Sp(),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=Nl(a);var t=ym(s,h);a.length?(d||(o.polygonStart(),d=!0),Cp(a,s4,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(a4))}}return l(y,"point"),l(v,"pointLine"),l(m,"lineStart"),l(_,"lineEnd"),l(b,"pointRing"),l(w,"ringStart"),l(x,"ringEnd"),g}}function a4(t){return t.length>1}function s4(t,e){return((t=t.x)[0]<0?t[1]-vn-Ue:vn-t[1])-((e=e.x)[0]<0?e[1]-vn-Ue:vn-e[1])}v(),l(Q_,"PathString"),Q_.prototype={_radius:4.5,_circle:ck(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=ck(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(ck,"circle"),v(),v(),v(),v(),v(),v(),l(Op,"default"),l(a4,"validSegment"),l(s4,"compareIntersection");var eb=Op((function(){return!0}),u4,c4,[-Mt,-vn]);function u4(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Mt:-Mt,l=$t(o-n);$t(l-Mt)<Ue?(t.point(n,r=(r+s)/2>0?vn:-vn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&l>=Mt&&($t(n-i)<Ue&&(n-=i*Ue),$t(o-a)<Ue&&(o-=a*Ue),r=l4(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 l4(t,e,n,r){var i,o,s=qe(t-n);return $t(s)>Ue?Lo((qe(e)*(o=ze(r))*qe(n)-qe(r)*(i=ze(e))*qe(t))/(i*o*s)):(e+r)/2}function c4(t,e,n,r){var i;if(null==t)i=n*vn,r.point(-Mt,i),r.point(0,i),r.point(Mt,i),r.point(Mt,0),r.point(Mt,-i),r.point(0,-i),r.point(-Mt,-i),r.point(-Mt,0),r.point(-Mt,i);else if($t(t[0]-e[0])>Ue){var o=t[0]<e[0]?Mt:-Mt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function tb(t,e){var n=ze(t),r=n>0,i=$t(n)>Ue;function o(n,r,i,o){nk(o,t,e,i,n,r)}function s(t,e){return ze(t)*ze(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?Mt:-Mt),p):0;if(!e&&(a=o=g)&&t.lineStart(),g!==o&&((!(f=u(e,d))||bu(e,f)||bu(d,f))&&(d[0]+=Ue,d[1]+=Ue,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||!bu(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=_u(Ro(t),Ro(e)),s=Mp(o,o),a=o[0],l=s-a*a;if(!l)return!r&&t;var u=n*s/l,c=-n*a/l,h=_u(i,o),p=Ip(i,u);hm(p,Ip(o,c));var f=h,d=Mp(p,f),g=Mp(f,f),y=d*d-g*(Mp(p,p)-1);if(!(y<0)){var v=an(y),m=Ip(f,(-d-v)/g);if(hm(m,p),m=Cl(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,N=$t(I-Mt)<Ue;if(!N&&E<x&&(_=x,x=E,E=_),N||I<Ue?N?x+E>0^m[1]<($t(m[0]-b)<Ue?x:E):x<=m[1]&&m[1]<=E:I>Mt^(b<=m[0]&&m[0]<=w)){var S=Ip(f,(-d+v)/g);return hm(S,p),[m,Cl(S)]}}}function c(e,n){var i=r?t:Mt-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"),Op(s,a,o,r?[0,-t]:[-Mt,t-Mt])}function Tp(t){return function(e){var n=new rb;for(var r in t)n[r]=t[r];return n.stream=e,n}}function rb(){}function Ap(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),qa(n,t.stream(xm));var s=xm.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 wm(t,e,n){return Ap(t,[[0,0],e],n)}l(u4,"clipAntimeridianLine"),l(l4,"clipAntimeridianIntersect"),l(c4,"clipAntimeridianInterpolate"),v(),l(tb,"default"),v(),l(Tp,"transformer"),l(rb,"TransformStream"),rb.prototype={constructor:rb,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()}},v(),l(Ap,"fitExtent"),l(wm,"fitSize"),v();var fk=16,f4=ze(30*Rr);function Em(t,e){return+e?h4(t,e):p4(t)}function p4(t){return Tp({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function h4(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=an(b*b+w*w+x*x),I=yn(x/=E),N=$t($t(x)-1)<Ue||$t(o-h)<Ue?(o+h)/2:An(w,b),S=t(N,I),C=S[0],M=S[1],O=C-r,P=M-i,L=m*O-v*P;(L*L/_>e||$t((v*O+m*P)/_-.5)>.3||s*p+a*f+l*d<f4)&&(n(r,i,o,s,a,l,C,M,N,b/=E,w/=E,x,g,y),y.point(C,M),n(C,M,N,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=Ro([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],fk,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,fk,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(Em,"default"),l(p4,"resampleNone"),l(h4,"resample");var d4=Tp({point:function(t,e){this.stream.point(t*Rr,e*Rr)}});function Do(t){return nb((function(){return t}))()}function nb(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=eb,x=null,E=Ol,I=.5,N=Em(M,I);function S(t){return[(t=o(t[0]*Rr,t[1]*Rr))[0]*p+n,r-t[1]*p]}function C(t){return(t=o.invert((t[0]-n)/p,(r-t[1])/p))&&[t[0]*hi,t[1]*hi]}function M(t,i){return[(t=e(t,i))[0]*p+n,r-t[1]*p]}function O(){o=Pp(i=H_(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,S}return l(S,"projection"),l(C,"invert"),l(M,"projectTransform"),S.stream=function(t){return c&&h===t?c:c=d4(w(i,N(E(h=t))))},S.clipAngle=function(t){return arguments.length?(w=+t?tb(b=t*Rr,6*Rr):(b=null,eb),P()):b*hi},S.clipExtent=function(t){return arguments.length?(E=null==t?(x=s=a=u=null,Ol):K_(x=+t[0][0],s=+t[0][1],a=+t[1][0],u=+t[1][1]),P()):null==x?null:[[x,s],[a,u]]},S.scale=function(t){return arguments.length?(p=+t,O()):p},S.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],O()):[f,d]},S.center=function(t){return arguments.length?(g=t[0]%360*Rr,y=t[1]%360*Rr,O()):[g*hi,y*hi]},S.rotate=function(t){return arguments.length?(v=t[0]%360*Rr,m=t[1]%360*Rr,_=t.length>2?t[2]%360*Rr:0,O()):[v*hi,m*hi,_*hi]},S.precision=function(t){return arguments.length?(N=Em(M,I=t*t),P()):an(I)},S.fitExtent=function(t,e){return Ap(S,t,e)},S.fitSize=function(t,e){return wm(S,t,e)},l(O,"recenter"),l(P,"reset"),function(){return e=t.apply(this,arguments),S.invert=e.invert&&C,O()}}function Mm(t){return function(e,n){var r=ze(e),i=ze(n),o=t(r*i);return[o*i*qe(e),o*qe(n)]}}function ua(t){return function(e,n){var r=an(e*e+n*n),i=t(r),o=qe(i),s=ze(i);return[An(e*o,r*s),yn(r&&n*o/r)]}}l(Do,"projection"),l(nb,"projectionMutator"),v(),v(),v(),v(),l(Mm,"azimuthalRaw"),l(ua,"azimuthalInvert");var gk=Mm((function(t){return an(2/(1+t))}));gk.invert=ua((function(t){return 2*yn(t/2)})),v();var ib=Mm((function(t){return(t=fm(t))&&t/qe(t)}));function Im(){return Do(ib).scale(79.4188).clipAngle(179.999)}function ob(t,e){return[t,wp(Ep((vn+e)/2))]}function Pm(t,e){return[t,e]}function mk(t,e){var n=ze(e),r=ze(t)*n;return[n*qe(t)/r,qe(e)/r]}function vk(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 yk(t,e){return[ze(e)*qe(t),qe(e)]}function _k(t,e){var n=ze(e),r=1+ze(t)*n;return[n*qe(t)/r,qe(e)/r]}function bk(t,e){return[wp(Ep((vn+e)/2)),-t]}function v4(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 na(t,(function(t){var n=Sm(t,e,r,i);n&&o.push(n)})),We(o);case"FeatureCollection":return ir(t,(function(t){var n=Sm(t,e,r,i);n&&ir(n,(function(t){t&&o.push(t)}))})),We(o)}return Sm(t,e,r,i)}function Sm(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return na(t,(function(t){var i=Sm(t,e,n,r);i&&s.push(i)})),We(s)}var a=y4(o),l={type:o.type,coordinates:wk(o.coordinates,a)},u=(new Al.GeoJSONReader).read(l),c=ep(tp(e,n),"meters"),h=Al.BufferOp.bufferOp(u,c,r);if(!xk((h=(new Al.GeoJSONWriter).write(h)).coordinates))return gn({type:h.type,coordinates:Ek(h.coordinates,a)},i)}function xk(t){return Array.isArray(t[0])?xk(t[0]):isNaN(t[0])}function wk(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return wk(t,e)}))}function Ek(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Ek(t,e)}))}function y4(t){var e=uu(t).geometry.coordinates,n=[-e[0],-e[1]];return Im().rotate(n).scale(dn)}ib.invert=ua((function(t){return t})),l(Im,"default"),v(),v(),l(ob,"mercatorRaw"),ob.invert=function(t,e){return[t,2*Lo(cm(e))-vn]},v(),v(),l(Pm,"equirectangularRaw"),Pm.invert=Pm,v(),l(mk,"gnomonicRaw"),mk.invert=ua(Lo),v(),v(),l(vk,"naturalEarth1Raw"),vk.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($t(n)>Ue&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},v(),l(yk,"orthographicRaw"),yk.invert=ua(yn),v(),l(_k,"stereographicRaw"),_k.invert=ua((function(t){return 2*Lo(t)})),v(),l(bk,"transverseMercatorRaw"),bk.invert=function(t,e){return[-e,2*Lo(cm(t))-vn]},l(v4,"buffer"),l(Sm,"bufferFeature"),l(xk,"coordsIsNaN"),l(wk,"projectCoords"),l(Ek,"unprojectCoords"),l(y4,"defineProjection");var ab=v4;v();var _4=er(Sl());v();var b4=er(Sl());v();var w4=er(Sl());v(),v();var E4=er(Sl());v(),v(),v(),v();var T4=1e-7,A4=.11;function Ik(t,e){let n=D4(e),[r,i]=t.features.reduce(((t,e)=>{let[r,i]=t,o=[e],{properties:s}=e,a=(s.entrances||[]).reduce(((t,e)=>(n.has(e)&&t.push(n.get(e)),t)),[]);if(a.length&&(o=L4(e,a)),"LineString"===o[0].geometry.type){let t=o[0].properties.kind;r.has(t)||r.set(t,[]),r.get(t).push(...o)}else i.push(...o);return t}),[new Map,[]]);return r.forEach(((t,e)=>{let n={kind:e,id:t[0].properties.id,externalId:t[0].properties.externalId};if(t.length){let e=ab(au(t.map((({geometry:t})=>t.coordinates))),A4,{units:"meters"}),r=[];r="MultiPolygon"===e.geometry.type?e.geometry.coordinates.map((t=>({...pr(t),properties:n}))):[e],i=i.concat(r)}})),We(i)}function L4(t,e){return e.reduce(((t,e)=>{let n={epsilon:T4},r=t.findIndex((t=>cl(uu(e),t,n))),i=t[r];if(i){let[n,o]=R4(i,e);t.splice(r,1,n,o)}return t}),[t])}function R4(t,e){let{coordinates:n}=e.geometry,{coordinates:r}=t.geometry,i=n.map((e=>ja(t,Gt(e))));return r.reduce(((e,n)=>{let r=Fg(Gt(n),i[0],t),o=Fg(Gt(n),i[1],t),s=pu(r)<pu(o)?r:o;return s.properties={...t.properties,entrances:[]},e.concat([s])}),[])}function D4(t){return new Map(t.features.map((t=>{let{properties:e}=t,{id:n}=e;return[n,t]})))}function F4(t){let[e,n,r,i]=Nn(t);return{minLat:n,minLong:e,maxLat:i,maxLong:r}}function B4(t){let e=new Map;for(let n in t){let r=t[n];if(!r)continue;let{polygons:i,altitude:o,color:s,height:a,opacity:l}=r;i.forEach((t=>{e.set(t,{altitude:o,color:s,height:a,opacity:l})}))}return e}function j4(t,e,n,r){let i=r.createGeoreferences(),o=new Set;n.forEach((t=>{t.layer&&o.add(t.layer)}));let s=[...o].map((t=>({id:t,visible:!0}))),a=1/r.mapScale;return{id:t,georeference:i,name:e,shortName:e,scene:{polygons:n},elevation:0,scale:a,x_scale:a,layers:s,width:r.widthInMapUnits,height:r.heightInMapUnits}}l(Ik,"processObstructions"),l(L4,"splitObstructionByAllEntrances"),l(R4,"splitObstructionByEntrance"),l(D4,"getEntranceMap"),l(F4,"getMapExtent"),l(B4,"getStylesMap"),l(j4,"convertMap");var sb=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 Ae(o,i),l=new Ae(o,n),u=new Ae(e,s),c=new Ae(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]])})))}};function z4(t,e){return[]}l(sb,"CoordinateConverter"),l(z4,"convertNodes");var Pk=l(((t,e,n,r)=>{let i=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let o=n.get(e.properties.id),s=e.geometry.coordinates[0].map((t=>r.convert(t))),a=e.geometry.coordinates.slice(1).map((t=>t.map((t=>r.convert(t))))),l=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;i.push({entrances:[],map:t,id:e.properties.externalId||"",externalId:e.properties.externalId||"",layer:e.properties.kind,geometry:{visible:!0,position:{x:0,y:0,z:((null==o?void 0:o.altitude)||0)*r.mapScale/l},scale:{x:1,y:1,z:((null==o?void 0:o.height)||1)*r.mapScale/l}},material:{color:(null==o?void 0:o.color)||"#000000"},vertexes:s,holes:a})})),i}),"generateMappedinPolygons");function q4(t,e,n,r,i){let o=Pk(t,n,r,i),s=Pk(t,e,r,i);return o.concat(s)}function G4(t){return[]}function Sk(t){let e=Object.keys(t),n={connection:t["connection.geojson"],manifest:t["manifest.geojson"],style:t["styles.json"],map:t["map.geojson"],mapstack:t["mapstack.geojson"],obstruction:new Map,space:new Map,node:new Map,entrance:new Map};return e.filter((t=>t.indexOf("/")>-1)).forEach((e=>{let r=e.split(/[\/\.]/),i=r[0],o=r[1];switch(i){case"obstruction":case"space":case"node":case"entrance":n[i].set(o,t[e])}})),n}function Ck(t){var e;let{obstruction:n,space:r,entrance:i,mapstack:o,style:s,manifest:a,node:l,connection:u}=t,c={},h=new Map,p=[],f=[],d=B4(s);o.forEach((({maps:t})=>{t.forEach(((t,e)=>{let o=Ik(n.get(t),i.get(t));if(o.features.length){let n=F4(o),i=new sb(n);h.set(t,i),c[t]=q4(t,o,r.get(t),d,i),f=f.concat(z4(l.get(t),i)),p.push(j4(t,`Map #${e+1}`,c[t],i))}}))}));let g=Object.values(c).flat(),y=G4(u),v=a.features[0],m=v.properties.name,_=v.geometry.coordinates[0];return{polygons:g,venue:{name:m,latitude:v.geometry.coordinates[1],longitude:_,defaultMap:(null==(e=p[0])?void 0:e.id)||""},maps:p,vortexes:y,nodes:f,locations:[],mapGroups:[],locationStates:[],categories:[],themes:[],imageBinaries:new Map}}l(q4,"convertPolygons"),l(G4,"convertVortexes"),l(Sk,"categorizeMVFFilesByPath"),l(Ck,"convertMVFToMappedin"),v();var $k,Kk,Rp,Ll,Rl,Dp,Dl,Fl,Bl,xu,Fp,jl,zl,Bp,ql,Hk=er(Wk()),Z4=null==(Kk=null==($k=C)?void 0:$k.env)?void 0:Kk.npm_package_version,cb=["websdk","web","webv2"],fb="websdk",pb=class{constructor(t){var e;oe(this,Rp,void 0),oe(this,Ll,void 0),oe(this,Rl,void 0),oe(this,Dp,void 0),oe(this,Dl,void 0),oe(this,Fl,void 0),oe(this,Bl,void 0),oe(this,xu,void 0),oe(this,Fp,void 0),oe(this,jl,void 0),oe(this,zl,void 0),oe(this,Bp,void 0),oe(this,ql,void 0),ue(this,xu,t.clientId),ue(this,Fp,t.clientSecret),ue(this,jl,t.accessToken),ue(this,Bl,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!z(this,Bl)&&z(this,xu)&&!rI(z(this,xu))&&(n="https://web-proxy.mappedin.com/a/"),ue(this,Rl,n),ue(this,Rl,z(this,Rl)+(t.venue+"/")),ue(this,ql,t.venue),ue(this,Ll,!1),ue(this,Rp,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),ue(this,Dp,cb.find((e=>e===t.context))||cb[0]),ue(this,Dl,Jd()),ue(this,Fl,Zd()),ue(this,zl,new Set),ue(this,Bp,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(z(this,Rp))return;let n={...e,g:z(this,Ll)},r=z(this,Rl)+t+"?"+Hk.default.stringify(n),i={"mi-context":fb||z(this,Dp),"mi-session":z(this,Fl),"mi-device":z(this,Dl),"mappedin-sdk-version":Z4,"mappedin-platform-version":z(this,Bp)};z(this,jl)?i.Authorization=`Bearer ${z(this,jl)}`:z(this,Bl)||(i.Authorization=`Basic ${btoa(`${z(this,xu)}:${z(this,Fp)}`)}`),Ra()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(t){let e=t.id||t;Nr.addPendingEvent(new Vc({venue:z(this,ql)})),this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;Nr.addPendingEvent(new Uc({venue:z(this,ql)})),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 z(this,Fl)}getDeviceID(){return z(this,Dl)}setGeolocationMode(t){ue(this,Ll,t)}trackBlueDotEvent(t){t&&Object.values(pb.BLUEDOT_EVENT).includes(t)&&!z(this,zl).has(t)?(this.track(t),z(this,zl).add(t)):Me.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=cb.find((e=>e===t));e&&(fb=e)}static clearContext(){fb=void 0}},Cm=pb;l(Cm,"Analytics"),Rp=new WeakMap,Ll=new WeakMap,Rl=new WeakMap,Dp=new WeakMap,Dl=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,xu=new WeakMap,Fp=new WeakMap,jl=new WeakMap,zl=new WeakMap,Bp=new WeakMap,ql=new WeakMap,D(Cm,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Fa,Lp=Cm,hb={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(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"}(Fa||(Fa={}));var Ps,Ul,Gl={categories:ou,locations:Da,vortexes:Zf,maps:Ff,nodes:Uf,polygons:iu,venue:Hf,events:kf,mapGroups:zf,themes:dg,locationStates:ag,rankings:Xf},Va=class{constructor(t){D(this,"perspective"),D(this,"things"),D(this,"options"),oe(this,Ps,void 0),oe(this,Ul,""),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,"_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"),D(this,"images"),D(this,"imageBinaries"),D(this,"scenes"),D(this,"analytics"),D(this,"navigator"),this.options=t,ue(this,Ps,Li.create(this));let e=new Lp({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(jv,"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,`_${n}ByExternalId`,{get(){let t=z(this,Ps)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),z(this,Ps)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=z(this,Ps)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),z(this,Ps)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,r=this[`_${t}ById`];return null!=r&&null!=r[e]||(r=this[n],null!=r&&null!=r[e])?r[e]:null}async hydrateFromMVF(t){let e=Ck(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{ue(this,Ul,t),n=JSON.parse(t)}catch(t){return void Me.error("Unable to parse JSON",t)}else n=t,ue(this,Ul,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!=Gl[e]&&"function"==typeof Gl[e].hydrate&&(this[e]=Gl[e].hydrate(i,this))}e&&await hI(n);let{images:i,scenes:o,imageBinaries:s}=n;this.images=i,this.scenes=o,this.imageBinaries=s,this.generateGetters(r),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"]),lI(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];Gl[r]&&e.push(Gl[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Vv({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()))})}toJSON(){var t;let e={};for(let t in Gl)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 z(this,Ul)||JSON.stringify(this.toJSON())}};l(Va,"Mappedin"),Ps=new WeakMap,Ul=new WeakMap,v();var Jk={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery","showSmartLabelWhenImagePresent"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};v(),v();var sn=l((function(){return sn=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"),sn.apply(this,arguments)}),"__assign");function Kt(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 Un(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(Kt,"__values"),l(Un,"__read");var jp,Q4="ENTRIES",Zk="KEYS",Qk="VALUES",Vn="",db=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=Vl(this._path),e=t.node,n=t.keys;if(Vl(n)===Vn)return{done:!1,value:this.result()};var r=e.get(Vl(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=Vl(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 Vl(e)})).filter((function(t){return t!==Vn})).join("")},t.prototype.value=function(){return Vl(this._path).node.get(Vn)},t.prototype.result=function(){switch(this._type){case Qk:return this.value();case Zk:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),Vl=l((function(t){return t[t.length-1]}),"last$1"),e6=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 eN(t,e,n,r,s,1,i,""),r}),"fuzzySearch"),eN=l((function(t,e,n,r,i,o,s,a){var l,u,c=o*s;try{t:for(var h=Kt(t.keys()),p=h.next();!p.done;p=h.next()){var f=p.value;if(f===Vn){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],N=i[_+E]+ +I,S=i[_+E+1]+1,C=i[m+E]+1,M=i[m+E+1]=Math.min(N,S,C);M<b&&(b=M)}if(b>n)continue t}eN(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"),gb=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=Un(km(this._tree,e.slice(this._prefix.length)),2),o=i[0],s=i[1];if(void 0===o){var a=Un(yb(s),2),l=a[0],u=a[1];try{for(var c=Kt(l.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;if(p!==Vn&&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,t6(this._tree,t)},t.prototype.entries=function(){return new db(this,Q4)},t.prototype.forEach=function(t){var e,n;try{for(var r=Kt(this),i=r.next();!i.done;i=r.next()){var o=Un(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 e6(this._tree,t,e)},t.prototype.get=function(t){var e=mb(this._tree,t);return void 0!==e?e.get(Vn):void 0},t.prototype.has=function(t){var e=mb(this._tree,t);return void 0!==e&&e.has(Vn)},t.prototype.keys=function(){return new db(this,Zk)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,vb(this._tree,t).set(Vn,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=vb(this._tree,t);return n.set(Vn,e(n.get(Vn))),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=vb(this._tree,t),r=n.get(Vn);return void 0===r&&n.set(Vn,r=e()),r},t.prototype.values=function(){return new db(this,Qk)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var o=Kt(e),s=o.next();!s.done;s=o.next()){var a=Un(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}(),km=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=Kt(t.keys()),s=o.next();!s.done;s=o.next()){var a=s.value;if(a!==Vn&&e.startsWith(a))return n.push([t,a]),km(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]),km(void 0,"",n)}),"trackDown"),mb=l((function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=Kt(t.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;if(s!==Vn&&e.startsWith(s))return mb(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"),vb=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,Kt(t.keys())),a=s.next();!a.done;a=s.next()){var l=a.value;if(l!==Vn&&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"),t6=l((function(t,e){var n=Un(km(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(Vn),0===r.size)tN(i);else if(1===r.size){var o=Un(r.entries().next().value,2),s=o[0],a=o[1];rN(i,s,a)}}),"remove"),tN=l((function(t){if(0!==t.length){var e=Un(yb(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)tN(t.slice(0,-1));else if(1===n.size){var i=Un(n.entries().next().value,2),o=i[0],s=i[1];o!==Vn&&rN(t.slice(0,-1),o,s)}}}),"cleanup"),rN=l((function(t,e,n){if(0!==t.length){var r=Un(yb(t),2),i=r[0],o=r[1];i.set(o+e,n),i.delete(o)}}),"merge"),yb=l((function(t){return t[t.length-1]}),"last"),_b="or",r6="and",n6="and_not",wu=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=sn(sn(sn({},xb),t),{searchOptions:sn(sn({},oN),t.searchOptions||{})}),this._index=new gb,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=Kt(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,Kt(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=Kt(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=Kt(this._documentIds),g=d.next();!g.done;g=d.next()){var y=Un(g.value,2),v=y[0];if(f===y[1]){try{for(var m=(r=void 0,Kt(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 N=(o=void 0,Kt(x)),S=N.next();!S.done;S=N.next()){var C=u(S.value,b);C&&this.removeTerm(E,v,C)}}catch(t){o={error:t}}finally{try{S&&!S.done&&(s=N.return)&&s.call(N)}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=Kt(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 gb,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=Kt(i),a=s.next();!a.done;a=s.next()){var l=Un(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(sN),o},t.prototype.autoSuggest=function(t,e){var n,r,i,o;void 0===e&&(e={}),e=sn(sn({},u6),e);var s=new Map;try{for(var a=Kt(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=Kt(s),d=f.next();!d.done;d=f.next()){var g=Un(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(sN),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(xb.hasOwnProperty(t))return bb(xb,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=Nm(c),y._fieldIds=h,y._fieldLength=Nm(p),y._avgFieldLength=f,y._storedFields=Nm(d),y._index=new gb;try{for(var v=Kt(a),m=v.next();!m.done;m=v.next()){var _=Un(m.value,2),b=_[0],w=_[1],x=new Map;try{for(var E=(o=void 0,Kt(Object.keys(w))),I=E.next();!I.done;I=E.next()){var N=I.value,S=w[N];1===g&&(S=S.ds),x.set(parseInt(N,10),Nm(S))}}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=sn(sn(sn({},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=sn(sn({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(s6(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=sn(sn({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return sn(sn({},t),((n={})[e]=bb(t,e)||1,n))}),l.boost||{}),c=l.boostDocument,h=l.weights,p=l.maxFuzzy,f=sn(sn({},oN.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=Kt(s),w=b.next();!w.done;w=b.next()){var x=Un(w.value,2),E=x[0],I=x[1];if(M=E.length-t.term.length){null==a||a.delete(E);var N=g*E.length/(E.length+.3*M);this.termResults(t.term,E,N,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 S=Kt(a.keys()),C=S.next();!C.done;C=S.next()){E=C.value;var M,O=Un(a.get(E),2),P=O[0];if(M=O[1]){N=d*E.length/(E.length+M);this.termResults(t.term,E,N,P,u,c,v)}}}catch(t){i={error:t}}finally{try{C&&!C.done&&(o=S.return)&&o.call(S)}finally{if(i)throw i.error}}return v},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=_b),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(i6[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var o=Kt(this._index),s=o.next();!s.done;s=o.next()){var a=Un(s.value,2),l=a[0],u=a[1],c={};try{for(var h=(n=void 0,Kt(u)),p=h.next();!p.done;p=h.next()){var f=Un(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=Kt(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,Kt(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),N=this._fieldLength.get(x)[y],S=n*g*E*a6(I,m,this._documentCount,N,_),C=s.get(x);if(C){C.score+=S,l6(C.terms,t);var M=bb(C.match,e);M?M.push(d):C.match[e]=[d]}else s.set(x,{score:S,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,uN),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,uN),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=Kt(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=Kt(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}(),bb=l((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),i6=((jp={})[_b]=function(t,e){var n,r;try{for(var i=Kt(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),aN(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},jp[r6]=function(t,e){var n,r,i=new Map;try{for(var o=Kt(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;aN(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},jp[n6]=function(t,e){var n,r;try{for(var i=Kt(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},jp),nN=1.2,iN=.7,o6=.5,a6=l((function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(o6+t*(nN+1)/(t+nN*(1-iN+iN*r/i)))}),"calcBM25Score"),s6=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"),xb={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(c6)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},oN={combineWith:_b,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},u6={prefix:function(t,e,n){return e===n.length-1}},l6=l((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),aN=l((function(t,e){var n,r;try{for(var i=Kt(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"),sN=l((function(t,e){var n=t.score;return e.score-n}),"byScore"),uN=l((function(){return new Map}),"createMap"),Nm=l((function(t){var e,n,r=new Map;try{for(var i=Kt(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"),c6=/[\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;v();var f6=["0","1","2","3","4","5","6","7","8","9"],p6=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],h6=["0","1","2","3","4","5","6","7","8","9"],d6=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],hde=[...f6,...p6,...h6,...d6],lN=["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"];v();var g6=32,Mi=!1,m6=120,wb=0,Om=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,Mi&&Me.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};l(Om,"FrameUpdate");var Xa=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,Mi&&Me.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};l(Xa,"FrameTask");var Tm=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,Mi&&Me.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(Tm,"FrameTaskGroup");var Eb=class{constructor(t){D(this,"_maxMillisecondsPerFrame"),D(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:g6,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};l(Eb,"RealTimeTimer");var Am=class{constructor(t){var e;D(this,"_raf"),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._timer=null!=(null==t?void 0:t.timer)?t.timer:new Eb,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new Xl,this._scheduledTasksByPriority=new Xl,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Mi&&Me.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0: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 Xl,this._scheduledTasksByPriority=new Xl,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Mi&&Me.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){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;Mi&&(0===wb&&(n=!0),++wb,wb%=m6);let r=this._scheduledUpdatesByOrdering.keys();for(let t=r.length-1;t>=0;--t){let e=r[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&Me.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,n&&Me.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 r;this._performance&&(r=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-r),n&&Me.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()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}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;Me.assert(void 0!==n),Object.getPrototypeOf(n)===Tm.prototype&&(r=n,n=r._popTask()),Me.assert(void 0!==n),Me.assert(Object.getPrototypeOf(n)===Xa.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Mi&&Me.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),Mi&&Me.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)===Tm)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,Mi&&Me.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Mi&&Me.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)===Xa.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Mi&&Me.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)===Xa.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)===Xa.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Mi&&Me.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)===Xa.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)===Xa.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Mi&&Me.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Xa.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,Mi&&Me.log("task priority changed",t.name,e)}};l(Am,"TaskScheduler");var Xl=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(Me.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 Me.assert(t===this._size),t}};l(Xl,"Multimap");var Ss,oo,Cs,la,zr,zp,qp,Wl,Gp,Hl,Wa,Lm,Rm,ks,Up,Dm,Fm,Bm,k6,Vp,Xp,Yp,Ib,Ya=l((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),Yl="",v6=.09,y6=1,_6=.025,b6=.5,x6=5e-4,w6=5e-4,E6=.01,M6=.05,cN=1,I6=.01,P6=.2,S6={MappedinCategory:"categories",MappedinLocation:"locations"},C6={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:lN,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===C.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:v6,PRIMARY_INDEX_WEIGHT:y6,SECONDARY_INDEX_WEIGHT:_6,CATEGORY_NAME_WEIGHT:b6,LOCATION_NAME_WEIGHT:cN,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:x6,CATEGORY_LOCATION_TAGS_WEIGHT:w6,CATEGORY_LOCATION_NAME_WEIGHT:E6,PRIMARY_INDEX_TAGS_NAME_WEIGHT:M6,LOCATION_DEFAULT_RANK:cN,RATIO_OF_FUZZY_TO_EXACT:I6,RATIO_OF_PREFIX_TO_EXACT:P6}},Mb=class{constructor(t,e){var n,r,i;oe(this,Bm),oe(this,Ss,void 0),oe(this,oo,void 0),oe(this,Cs,void 0),oe(this,la,void 0),oe(this,zr,void 0),oe(this,zp,new Am({performance:!0})),oe(this,qp,void 0),oe(this,Wl,void 0),oe(this,Gp,new Map),oe(this,Hl,0),oe(this,Wa,l((t=>{dv(this,Hl)._++,z(this,zp).scheduleUpdate(new Om({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),dv(this,Hl)._--,0===z(this,Hl)&&z(this,Up).call(this)}}))}),"#addTask")),oe(this,Lm,l((t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=z(this,zr).constants,a=o;(null==(e=z(this,zr))?void 0:e.useLocationRank)&&(a=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:o})),o):o),z(this,Wa).call(this,(()=>{z(this,oo).add({name:Ya(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:o,rank:a})})),(null==(n=z(this,zr))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{z(this,oo).add({name:"",tag:Ya(e),id:"MappedinLocation_"+t.id,weight:s,rank:a})})),(null==(r=z(this,zr))?void 0:r.searchDescriptions)&&z(this,Wa).call(this,(()=>z(this,Cs).add({description:Ya(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:a})))}),"#processLocation")),oe(this,Rm,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}=z(this,zr).constants;z(this,Wa).call(this,(()=>z(this,oo).add({name:Ya(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let a=t.locations.reduce(((t,e)=>t+` ${Yl} `+e.name),"")+` ${Yl}`;if((null==(e=z(this,zr))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&z(this,Wa).call(this,(()=>z(this,la).add({id:"MappedinCategory_"+t.id,"category.locations.description":Ya(e.description),ref:e.name,weight:r})))})),null==(n=z(this,zr))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${Yl} `+e),""))+` ${Yl}`}),"");z(this,Wa).call(this,(()=>z(this,la).add({"category.locations.tags":Ya(e),id:"MappedinCategory_"+t.id,weight:i})))}z(this,Wa).call(this,(()=>z(this,la).add({"category.locations.name":Ya(a),id:"MappedinCategory_"+t.id,weight:o})))}),"#processCategory")),oe(this,ks,void 0),oe(this,Up,void 0),oe(this,Dm,l((t=>{var e;let n=t.score,{object:r,id:i,weight:o,rank:s}=t,[a,l]=i.split("_"),u=r||z(this,Ss).getCollectionItemById(S6[a],l);return s&&(null==(e=z(this,zr))?void 0:e.useLocationRank)&&(n+=s),o&&(n*=o),{score:n,type:a,object:u}}),"#processSearchResult")),oe(this,Fm,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(`[^${Yl}]* `+n+` [^${Yl}]*`,"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")),oe(this,Vp,void 0),oe(this,Xp,void 0),oe(this,Yp,void 0),ue(this,Wl,new Lp({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),ue(this,zr,{...C6,...e}),ue(this,Ss,t),ue(this,qp,new Set(null==(n=z(this,zr))?void 0:n.stopWords));let o=z(this,Ss).venue.slug,{PRIMARY_INDEX_FUZZYNESS:s,PRIMARY_INDEX_WEIGHT:a,CATEGORY_NAME_WEIGHT:u,RATIO_OF_FUZZY_TO_EXACT:c,RATIO_OF_PREFIX_TO_EXACT:h,PRIMARY_INDEX_TAGS_NAME_WEIGHT:p}=z(this,zr).constants,f=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:f,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:s},boost:{name:a,query:a,tag:p},weights:{fuzzy:c,prefix:h},boostDocument:t=>t.includes("MappedinLocation")?a:t.includes("MappedinCategory")?u:a},g={fields:["description"],storeFields:f,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=z(this,qp))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...f,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(ue(this,ks,new Promise((t=>{ue(this,Up,t)}))),null==(r=z(this,zr))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=z(this,zr))?void 0:i.jsonIndex);ue(this,oo,wu.loadJS(t,d)),ue(this,Cs,wu.loadJS(e,g)),ue(this,la,wu.loadJS(n,y))}else ue(this,oo,new wu(d)),ue(this,Cs,new wu(g)),ue(this,la,new wu(y)),z(this,Ss).locations.forEach(z(this,Lm)),z(this,Ss).categories.forEach(z(this,Rm));z(this,zp).update(performance.now()),ue(this,Vp,ng(((t,e)=>{z(this,Wl).trackSearchSuggest({query:t,hits:e}),Nr.addPendingEvent(new of({venue:o}))}),300)),ue(this,Xp,ng(((t,e)=>{z(this,Wl).trackSearch({query:t,hits:e}),Nr.addPendingEvent(new nf({venue:o}))}),300)),ue(this,Yp,ng((()=>{Nr.addPendingEvent(new tf({venue:o}))}),300)),Nr.addPendingEvent(new rf({search_descriptions:z(this,zr).searchDescriptions,search_tags:z(this,zr).searchTags,search_descriptions_in_categories:z(this,zr).searchDescriptionsInCategories,search_tags_in_categories:z(this,zr).searchTagsInCategories,use_location_rank:z(this,zr).useLocationRank,venue:o}))}async suggest(t){await z(this,ks);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}=z(this,zr).constants,s=z(this,oo).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 z(this,Vp).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await z(this,ks);let e=Kn(this,Bm,k6).call(this,t);return z(this,Xp).call(this,t,e.length),e}async toJSON(){return await z(this,ks),JSON.stringify({primary:z(this,oo),secondary:z(this,Cs),extra:z(this,la)})}async addQuery(t){let e,n,{query:r,object:i,weight:o=1}=t;await z(this,ks),e=i instanceof Da?"MappedinLocation":i instanceof ou?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=z(this,Gp).get(i),n||(n="Custom_"+Aa(),z(this,Gp).set(i,n))),z(this,oo).add({id:n,weight:o,object:i,query:Ya(r)}),z(this,Yp).call(this)}};l(Mb,"OfflineSearch"),Ss=new WeakMap,oo=new WeakMap,Cs=new WeakMap,la=new WeakMap,zr=new WeakMap,zp=new WeakMap,qp=new WeakMap,Wl=new WeakMap,Gp=new WeakMap,Hl=new WeakMap,Wa=new WeakMap,Lm=new WeakMap,Rm=new WeakMap,ks=new WeakMap,Up=new WeakMap,Dm=new WeakMap,Fm=new WeakMap,Bm=new WeakSet,k6=l((function(t){let e=[],n=Ya(t);e=[...z(this,oo).search(n),...z(this,Cs).search(n),...z(this,la).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=z(this,Dm).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},z(this,Fm).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"),Vp=new WeakMap,Xp=new WeakMap,Yp=new WeakMap,v(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Ib||(Ib={}));var Hb=globalThis.fetch;function Ra(){if(null==Hb)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Hb}function Rde(t){Hb=t}l(Ra,"isomorphicFetch"),l(Rde,"setFetchFn");var KN,JN,Z6=null==(JN=null==(KN=C)?void 0:KN.env)?void 0:JN.npm_package_version;globalThis.btoa||(globalThis.btoa=$N.encode);var Q6=["ar"];function uc(t){let e={...hb,things:Jk,...t};return e.headers={...e.headers,"mappedin-sdk-version":Z6},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function jde(t){let e=uc({...{emitAnalyticsEvents:!0,...t}}),n=new Va(e),r=Sk(await nG(e));return n.hydrateFromMVF(r),Nr.addPendingEvent(new Yc({venue:e.venue})),n}async function eG(t){let e={emitAnalyticsEvents:!0,...t},n=uc({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/"+(n.useDraftData?"draft/":""),i=new Va({...n,baseUrl:n.baseUrl+r});return await i.fetch(),e.emitAnalyticsEvents,Nr.addPendingEvent(new Xc({venue:n.venue})),i}function zde(t){eG=t}l(uc,"parseOptions"),l(jde,"getVenueMVF"),l(eG,"getVenue"),l(zde,"__setGetVenueMock");var $b={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function qde(t){let e=uc({baseUrl:"https://api-gateway.mappedin.com/",...$b,...t}),{url:n,updated_at:r}=await tG(t),i=await Ra()(n,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let a=new Va(e);return await a.hydrate(o,e.shouldPopulateBundledImagesAsBlobs),a.updatedAt=r,a}async function tG(t){let e=uc({baseUrl:"https://api-gateway.mappedin.com/",...$b,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Q6.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await rg(e,i)}async function Gde(t,{url:e,updated_at:n}){let r=uc({baseUrl:"https://api-gateway.mappedin.com/",...$b,...t}),i=await Ra()(e,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let a=new Va(r);return await a.hydrate(o,r.shouldPopulateBundledImagesAsBlobs),a.updatedAt=n,a}async function rG(t){let e=uc({baseUrl:"https://api-gateway.mappedin.com/",...hb,...t}),n=`${e.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${e.venue}&version=2.0.0`;return e.headers["Content-Type"]="application/zip",await rg(e,n)}async function nG(t){return new Promise((async(e,n)=>{try{let n=new TextDecoder,r=n.decode.bind(n),[i,{url:o}]=await Promise.all([Promise.resolve().then((()=>(HN(),WN))),rG(t)]),s=await Ra()(o).then((t=>t.arrayBuffer())),a=new Uint8Array(s),l=i.unzipSync(a),u=Object.keys(l),c={};for(let t=0;t<u.length;t++){let e=u[t];if(0===e.indexOf("image/")&&-1===e.indexOf("__MACOSX"))c[e]=l[e].buffer;else if("/"!==e.slice(-1))try{c[e]=JSON.parse(r(l[e]))}catch(t){Me.warn("bad file",e)}}e(c)}catch(t){n(t)}}))}async function Ude(t,e=!0){let n=new Va({venue:""});return await n.hydrate(t,e),n}l(qde,"getVenueBundle"),l(tG,"getVenueBundleURL"),l(Gde,"downloadBundle"),l(rG,"getVenueMVFURL"),l(nG,"downloadVenueBundleMVF"),l(Ude,"hydrateVenue");export{Lp as CustomerAnalytics,Xo as E_SDK_LOG_LEVEL,Ib as MAP_RENDER_MODE,Va as Mappedin,ou as MappedinCategory,Fa as MappedinCollectionType,el as MappedinCoordinate,So as MappedinDestinationSet,ju as MappedinDirections,kf as MappedinEvent,Da as MappedinLocation,Ff as MappedinMap,zf as MappedinMapGroup,Pa as MappedinNavigatable,Uf as MappedinNode,iu as MappedinPolygon,Xf as MappedinRankings,Hf as MappedinVenue,Zf as MappedinVortex,Mb as OfflineSearch,zde as __setGetVenueMock,Gde as downloadBundle,nG as downloadVenueBundleMVF,eG as getVenue,qde as getVenueBundle,tG as getVenueBundleURL,jde as getVenueMVF,rG as getVenueMVFURL,Ude as hydrateVenue,Ra as isomorphicFetch,Rde as setFetchFn,Mw as setLoggerLevel};
|
|
1
|
+
var EO,C,gO=Object.create,ju=Object.defineProperty,mO=Object.getOwnPropertyDescriptor,vO=Object.getOwnPropertyNames,yO=Object.getPrototypeOf,_O=Object.prototype.hasOwnProperty,bO=(t,e,n)=>e in t?ju(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mw=t=>ju(t,"__esModule",{value:!0}),l=(t,e)=>ju(t,"name",{value:e,configurable:!0}),Iw=(t,e)=>()=>(t&&(e=t(t=0)),e),ue=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wO=(t,e)=>{for(var n in Mw(t),e)ju(t,n,{get:e[n],enumerable:!0})},xO=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of vO(e))!_O.call(t,r)&&"default"!==r&&ju(t,r,{get:()=>e[r],enumerable:!(n=mO(e,r))||n.enumerable});return t},Zt=t=>xO(Mw(ju(null!=t?gO(yO(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),D=(t,e,n)=>(bO(t,"symbol"!=typeof e?e+"":e,n),n),vv=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},z=(t,e,n)=>(vv(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)=>(vv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),yv=(t,e,n,r)=>({set _(r){le(t,e,r,n)},get _(){return z(t,e,r)}}),kn=(t,e,n)=>(vv(t,e,"access private method"),n),v=Iw((()=>{C={env:EO={NODE_ENV:"production",npm_package_version:"5.12.0"}}})),Sw=ue(((t,e)=>{v(),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)})),qn=ue((t=>{v(),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})),kc=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)}),"getCoordinateKey");t.default=e})),Nc=ue((t=>{v(),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})),Oc=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),n=l((function(t){return e.sexagesimalPattern.test(t.toString().trim())}),"isSexagesimal");t.default=n})),Tc=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),n=l((function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(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})),_h=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),n=r(kc());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})),xv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Nc()),n=o(Oc()),r=o(Tc()),i=qn();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})),Mv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Nc()),n=o(Oc()),r=o(Tc()),i=qn();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})),Pv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(_h()),n=i(xv()),r=i(Mv());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(void 0===o||void 0===s)return!1;var a=t[s],l=t[o];return!(void 0===l||void 0===a||!1===(0,n.default)(l)||!1===(0,r.default)(a))}),"isValidCoordinate");t.default=o})),Mh=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Nc()),n=s(Oc()),r=s(Tc()),i=s(Pv()),o=s(_h());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})),Zi=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),n=i(kc()),r=i(Mh());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(null!=o){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLatitude");t.default=o})),Qi=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),n=i(kc()),r=i(Mh());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(null!=o){var s=t[o];return!0===i?s:(0,r.default)(s)}}),"getLongitude");t.default=o})),Yo=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return t*Math.PI/180}),"toRad");t.default=e})),Vs=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=l((function(t){return 180*t/Math.PI}),"toDeg");t.default=e})),Bw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Zi()),n=s(Qi()),r=s(Yo()),i=s(Vs()),o=qn();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})),jw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),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})),zw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),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})),qw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=qn(),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})),Vw=ue((t=>{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("undefined"!=typeof Symbol&&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}v(),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*Number("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})),Ov=ue((t=>{v(),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})),ls=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Zi()),n=s(Qi()),r=s(Yo()),i=s(Ov()),o=qn();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=void 0===a||isNaN(a)?1:a;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})),Tv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),Hw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Tv());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})),Jw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Yo()),n=o(Zi()),r=o(Qi()),i=qn();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})),Rv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Zi()),n=r(Qi());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})),Qw=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Zi()),n=s(Qi()),r=s(Yo()),i=s(Vs()),o=qn();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})),rx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zi()),n=o(Qi()),r=o(Yo()),i=o(Vs());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})),nx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Rv());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})),Dv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zi()),n=o(Qi()),r=o(Yo()),i=o(Vs());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})),sx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Dv());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})),Bv=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(ls()),n=r(Ov());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})),px=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zi()),n=o(Qi()),r=o(Yo()),i=o(Vs());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})),hx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),vx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Zi()),n=o(Qi()),r=o(Yo()),i=qn();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=void 0===s||isNaN(s)?1:s;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 L=_/16*c*(4+_*(4-3*c));f=M,M=b+(1-L)*_*u*(l+L*p*(h+L*a*(2*h*h-1)))}while(Math.abs(M-f)>1e-12&&--C>0);if(0===C)return NaN;var A=c*(i.earthRadius*i.earthRadius-m*m)/(m*m),T=1+A/16384*(4096+A*(A*(320-175*A)-768)),D=A/1024*(256+A*(A*(74-47*A)-128)),R=D*p*(h+D/4*(a*(2*h*h-1)-D/6*h*(4*p*p-3)*(4*h*h-3))),k=m*T*(l-R);return Math.round(k/s)*s}),"getDistance");t.default=s})),yx=ue((t=>{v(),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})),_x=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),bx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),xx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Zi()),n=r(Qi());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})),Ex=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Bv());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})),Mx=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(ls());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})),Px=ue((t=>{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("undefined"!=typeof Symbol&&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}v(),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})),Cx=ue((t=>{v(),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 y.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 L.default}),"get")}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:l((function(){return A.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 D.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 k.default}),"get")}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:l((function(){return F.default}),"get")}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:l((function(){return z.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 B.default}),"get")}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:l((function(){return q.default}),"get")}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:l((function(){return G.default}),"get")});var n=V(Bw()),r=V(jw()),i=V(zw()),o=V(qw()),s=V(Vw()),a=V(Hw()),u=V(Jw()),c=V(Rv()),h=V(Qw()),p=V(rx()),f=V(nx()),d=V(sx()),g=V(kc()),y=V(_h()),m=V(ls()),_=V(Bv()),b=V(px()),w=V(Zi()),x=V(Qi()),E=V(hx()),I=V(vx()),S=V(Dv()),N=V(yx()),M=V(_x()),C=V(Nc()),O=V(bx()),P=V(xx()),L=V(Ex()),A=V(Mx()),T=V(Oc()),D=V(Pv()),R=V(xv()),k=V(Mv()),F=V(Tv()),z=V(Tc()),j=V(Mh()),B=V(Yo()),q=V(Vs()),G=V(Px()),U=qn();function V(t){return t&&t.__esModule?t:{default:t}}Object.keys(U).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:l((function(){return U[n]}),"get")})})),l(V,"_interopRequireDefault")})),oE=ue(((t,e)=>{var n,r,i,o,s,a,u,c,h,p,f,d,g,y,m,_,b,w,x,E,I,S,N,M,C;v(),function(t){var n="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,e){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,r){return t[n]=e?e(n,r):r}}"function"==typeof define&&define.amd?define("tslib",["exports"],(function(e){t(r(n,r(e)))})):"object"==typeof e&&"object"==typeof e.exports?t(r(n,r(e.exports))):t(r(n)),l(r,"createExporter")}((function(t){var e=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])};n=l((function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),l(r,"__"),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),"__extends"),r=Object.assign||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},i=l((function(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}),"__rest"),o=l((function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}),"__decorate"),s=l((function(t,e){return function(n,r){e(n,r,t)}}),"__param"),a=l((function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}),"__metadata"),u=l((function(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())}))}),"__awaiter"),c=l((function(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])}}}),"__generator"),h=l((function(t,e){for(var n in t)"default"!==n&&!Object.prototype.hasOwnProperty.call(e,n)&&C(e,t,n)}),"__exportStar"),C=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]},p=l((function(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.")}),"__values"),f=l((function(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}),"__read"),d=l((function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}),"__spread"),g=l((function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}),"__spreadArrays"),y=l((function(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))}),"__spreadArray"),m=l((function(t){return this instanceof m?(this.v=t,this):new m(t)}),"__await"),_=l((function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{!function(t){t.value instanceof m?Promise.resolve(t.value.v).then(l,u):c(o[0][2],t)}(i[t](e))}catch(t){c(o[0][3],t)}}function l(t){a("next",t)}function u(t){a("throw",t)}function c(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}),"__asyncGenerator"),b=l((function(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:m(t[r](e)),done:"return"===r}:i?i(e):e}:i}}),"__asyncDelegator"),w=l((function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof p?p(t):t[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}),"__asyncValues"),x=l((function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}),"__makeTemplateObject");var v=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};E=l((function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&C(e,t,n);return v(e,t),e}),"__importStar"),I=l((function(t){return t&&t.__esModule?t:{default:t}}),"__importDefault"),S=l((function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}),"__classPrivateFieldGet"),N=l((function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}),"__classPrivateFieldSet"),M=l((function(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}),"__classPrivateFieldIn"),t("__extends",n),t("__assign",r),t("__rest",i),t("__decorate",o),t("__param",s),t("__metadata",a),t("__awaiter",u),t("__generator",c),t("__exportStar",h),t("__createBinding",C),t("__values",p),t("__read",f),t("__spread",d),t("__spreadArrays",g),t("__spreadArray",y),t("__await",m),t("__asyncGenerator",_),t("__asyncDelegator",b),t("__asyncValues",w),t("__makeTemplateObject",x),t("__importStar",E),t("__importDefault",I),t("__classPrivateFieldGet",S),t("__classPrivateFieldSet",N),t("__classPrivateFieldIn",M)}))})),Sy=ue(((t,e)=>{v(),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",L="Microsoft",A="Motorola",T="Opera",D="Samsung",R="Sony",k="Xiaomi",F="Zebra",z="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"),B=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),q=l((function(t,e){return typeof t===a&&-1!==G(e).indexOf(G(t))}),"has"),G=l((function(t){return t.toLowerCase()}),"lowerize"),U=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(q(e[n][i],t))return"?"===n?r:n}else if(q(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"},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)\/([-\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,z],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,G]],[/((?: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/,"",G]],[/(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,G]]],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,D],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[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,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,A],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,A],[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,L],[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,L],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,F],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,F],[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,L],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[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,F],[h,_]],[/(quest( 2)?)/i],[u,[p,z],[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]]},$=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof $))return new $(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?j(H,e):H;return this.getBrowser=function(){var t={};return t[c]=r,t[f]=r,Y.call(t,i,l.browser),t.major=U(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");$.VERSION="0.7.31",$.BROWSER=B([c,f,"major"]),$.CPU=B([d]),$.DEVICE=B([u,p,h,g,y,m,v,_,b]),$.ENGINE=$.OS=B([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=$),t.UAParser=$):typeof define===i&&define.amd?define((function(){return $})):typeof n!==o&&(n.UAParser=$);var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new $;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(t){Z.setUA(t);var e=Z.getResult();for(var n in e)K.ua[n]=e[n]}}}("object"==typeof window?window:t)})),SM=ue(((t,e)=>{v();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]",y="[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[y]=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,L=P&&S.process,A=function(){try{return L&&L.binding&&L.binding("util")}catch(t){}}(),T=A&&A.isTypedArray;function D(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 k(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 F(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function z(t){return function(e){return t(e)}}function j(t,e){return t.has(e)}function B(t,e){return null==t?void 0:t[e]}function q(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function G(t,e){return function(n){return t(e(n))}}function U(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}l(D,"arrayFilter"),l(R,"arrayPush"),l(k,"arraySome"),l(F,"baseTimes"),l(z,"baseUnary"),l(j,"cacheHas"),l(B,"getValue"),l(q,"mapToArray"),l(G,"overArg"),l(U,"setToArray");var V,Y=Array.prototype,X=Function.prototype,W=Object.prototype,H=M["__core-js_shared__"],$=X.toString,K=W.hasOwnProperty,Z=(V=/[^.]+$/.exec(H&&H.keys&&H.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",J=W.toString,Q=RegExp("^"+$.call(K).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=G(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 K.call(e,t)?e[t]:void 0}function Nt(t){var e=this.__data__;return dt?void 0!==e[t]:K.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=Kt(e,t);return!(n<0)&&(n==e.length-1?e.pop():it.call(e,n,1),--this.size,!0)}function Lt(t){var e=this.__data__,n=Kt(e,t);return n<0?void 0:e[n][1]}function At(t){return Kt(this.__data__,t)>-1}function Tt(t,e){var n=this.__data__,r=Kt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Dt(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 kt(t){var e=ue(this,t).delete(t);return this.size-=e?1:0,e}function Ft(t){return ue(this,t).get(t)}function zt(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 Bt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Dt;++e<n;)this.add(t[e])}function qt(t){return this.__data__.set(t,n),this}function Gt(t){return this.__data__.has(t)}function Ut(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 Ht(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 Dt(r)}return n.set(t,e),this.size=n.size,this}function $t(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?F(t.length,String):[],l=a.length;for(var u in t)(e||K.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 Kt(t,e){for(var n=t.length;n--;)if(be(t[n][0],e))return n;return-1}function Zt(t,e,n){var r=e(t);return xe(t)?r:R(r,n(t))}function Jt(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)&&Jt(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 Ut),l||Pe(t)?oe(t,e,n,r,s,a):se(t,e,c,n,r,s,a);if(!(1&n)){var y=p&&K.call(t,"__wrapped__"),v=d&&K.call(e,"__wrapped__");if(y||v){var m=y?t.value():t,_=v?e.value():e;return a||(a=new Ut),s(m,_,n,r,a)}}return!!g&&(a||(a=new Ut),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[Jt(t)]}function ie(t){if(!ve(t))return lt(t);var e=[];for(var n in Object(t))K.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 Bt: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(!k(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=q;case y:var f=1&r;if(c||(c=U),t.size!=e.size&&!f)return!1;var d=l.get(t);if(d)return d==e;r|=2,l.set(t,e);var v=oe(c(t),c(e),r,i,o,l);return l.delete(t),v;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:K.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 Zt(t,Le,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=B(t,e);return ne(n)?n:void 0}function he(t){var e=K.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch(t){}var i=J.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(Lt,"listCacheGet"),l(At,"listCacheHas"),l(Tt,"listCacheSet"),Ct.prototype.clear=Ot,Ct.prototype.delete=Pt,Ct.prototype.get=Lt,Ct.prototype.has=At,Ct.prototype.set=Tt,l(Dt,"MapCache"),l(Rt,"mapCacheClear"),l(kt,"mapCacheDelete"),l(Ft,"mapCacheGet"),l(zt,"mapCacheHas"),l(jt,"mapCacheSet"),Dt.prototype.clear=Rt,Dt.prototype.delete=kt,Dt.prototype.get=Ft,Dt.prototype.has=zt,Dt.prototype.set=jt,l(Bt,"SetCache"),l(qt,"setCacheAdd"),l(Gt,"setCacheHas"),Bt.prototype.add=Bt.prototype.push=qt,Bt.prototype.has=Gt,l(Ut,"Stack"),l(Vt,"stackClear"),l(Yt,"stackDelete"),l(Xt,"stackGet"),l(Wt,"stackHas"),l(Ht,"stackSet"),Ut.prototype.clear=Vt,Ut.prototype.delete=Yt,Ut.prototype.get=Xt,Ut.prototype.has=Wt,Ut.prototype.set=Ht,l($t,"arrayLikeKeys"),l(Kt,"assocIndexOf"),l(Zt,"baseGetAllKeys"),l(Jt,"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),D(st(t),(function(e){return rt.call(t,e)})))}:Ae,fe=Jt;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!!Z&&Z in t}function ve(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||W)}function me(t){return J.call(t)}function _e(t){if(null!=t){try{return $.call(t)}catch(t){}try{return t+""}catch(t){}}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)!=y||ft&&fe(new ft)!=_)&&(fe=l((function(t){var e=Jt(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 y;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)&&K.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=Jt(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?z(T):re;function Le(t){return Ee(t)?$t(t):ie(t)}function Ae(){return[]}function Te(){return!1}l(Le,"keys"),l(Ae,"stubArray"),l(Te,"stubFalse"),e.exports=Se})),rI=ue(((t,e)=>{v();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,y=g&&g.exports===d,m=y&&h.process,_=function(){try{return g&&g.require&&g.require("util").types||m&&m.binding&&m.binding("util")}catch(t){}}(),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__"],L=C.toString,A=O.hasOwnProperty,T=(N=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",D=O.toString,R=L.call(Object),k=RegExp("^"+L.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=y?f.Buffer:void 0,z=f.Symbol,j=f.Uint8Array,B=F?F.allocUnsafe:void 0,q=S(Object.getPrototypeOf,Object),G=Object.create,U=O.propertyIsEnumerable,V=M.splice,Y=z?z.toStringTag:void 0,X=function(){try{var t=Xt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),W=F?F.isBuffer:void 0,H=Math.max,$=Date.now,K=Xt(f,"Map"),Z=Xt(Object,"create"),J=function(){function t(){}return l(t,"object"),function(e){if(!ge(e))return{};if(G)return G(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__=Z?Z(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(Z){var r=e[t];return r===n?void 0:r}return A.call(e,t)?e[t]:void 0}function rt(t){var e=this.__data__;return Z?void 0!==e[t]:A.call(e,t)}function it(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Z&&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(K||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(!K||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||A.call(t,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||$t(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];(!A.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 Lt(t){return!(!ge(t)||Jt(t))&&(fe(t)?k:a).test(se(t))}function At(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||!A.call(t,r))||n.push(r);return n}function Dt(t,e,n,r,i){t!==e&&Ct(e,(function(o,s){if(i||(i=new vt),ge(o))Rt(t,e,s,n,Dt,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=qt(a):f?(h=!1,c=zt(l,!0)):d?(h=!1,c=Bt(l,!0)):c=[]:ve(l)||le(l)?(c=a,le(a)?c=_e(a):(!ge(a)||fe(a))&&(c=Ht(l))):h=!1}h&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),It(t,n,c)}}function kt(t,e){return ie(ne(t,e,Ee),t+"")}l(Ot,"baseGetTag"),l(Pt,"baseIsArguments"),l(Lt,"baseIsNative"),l(At,"baseIsTypedArray"),l(Tt,"baseKeysIn"),l(Dt,"baseMerge"),l(Rt,"baseMergeDeep"),l(kt,"baseRest");var Ft=X?function(t,e){return X(t,"toString",{configurable:!0,enumerable:!1,value:xe(e),writable:!0})}:Ee;function zt(t,e){if(e)return t.slice();var n=t.length,r=B?B(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 Bt(t,e){var n=e?jt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function qt(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Gt(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 Ut(t){return kt((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&&Kt(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 Zt(e)?n["string"==typeof e?"string":"hash"]:n.map}function Xt(t,e){var n=I(t,e);return Lt(n)?n:void 0}function Wt(t){var e=A.call(t,Y),n=t[Y];try{t[Y]=void 0;var r=!0}catch(t){}var i=D.call(t);return r&&(e?t[Y]=n:delete t[Y]),i}function Ht(t){return"function"!=typeof t.constructor||Qt(t)?{}:J(q(t))}function $t(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 Kt(t,e,n){if(!ge(n))return!1;var r=typeof e;return!!("number"==r?ce(n)&&$t(e,n.length):"string"==r&&e in n)&&ae(n[e],t)}function Zt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Jt(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 D.call(t)}function ne(t,e,n){return e=H(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=H(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(zt,"cloneBuffer"),l(jt,"cloneArrayBuffer"),l(Bt,"cloneTypedArray"),l(qt,"copyArray"),l(Gt,"copyObject"),l(Ut,"createAssigner"),l(Vt,"createBaseFor"),l(Yt,"getMapData"),l(Xt,"getNative"),l(Wt,"getRawTag"),l(Ht,"initCloneObject"),l($t,"isIndex"),l(Kt,"isIterateeCall"),l(Zt,"isKeyable"),l(Jt,"isMasked"),l(Qt,"isPrototype"),l(te,"nativeKeysIn"),l(ee,"objectToString"),l(ne,"overRest"),l(re,"safeGet");var ie=oe(Ft);function oe(t){var e=0,n=0;return function(){var r=$(),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 L.call(t)}catch(t){}try{return t+""}catch(t){}}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)&&A.call(t,"callee")&&!U.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=q(t);if(null===e)return!0;var n=A.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&L.call(n)==R}l(fe,"isFunction"),l(de,"isLength"),l(ge,"isObject"),l(ye,"isObjectLike"),l(ve,"isPlainObject");var me=b?E(b):At;function _e(t){return Gt(t,be(t))}function be(t){return ce(t)?Et(t,!0):Tt(t)}l(_e,"toPlainObject"),l(be,"keysIn");var we=Ut((function(t,e,n){Dt(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})),nI=ue(((t,e)=>{v(),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",L="Microsoft",A="Motorola",T="Opera",D="Samsung",R="Sharp",k="Sony",F="Xiaomi",z="Zebra",j="Facebook",B=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"),q=l((function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e}),"enumerize"),G=l((function(t,e){return typeof t===a&&-1!==U(e).indexOf(U(t))}),"has"),U=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(G(e[n][i],t))return"?"===n?r:n}else if(G(e[n],t))return"?"===n?r:n;return t}),"strMapper"),H={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"},$={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,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-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[p,D],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[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,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,A],[h,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,A],[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,k],[h,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,k],[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,L],[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,L],[h,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,z],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,z],[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,k],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,L],[h,g]],[/smart-tv.+(samsung)/i],[p,[h,m]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[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,k],[h,m]],[/(mitv-\w{5}) bui/i],[u,[p,F],[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,z],[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,H]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,W,H]],[/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]]},K=l((function(t,e){if(typeof t===s&&(e=t,t=r),!(this instanceof K))return new K(t,e).getResult();var i=t||(typeof n!==o&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:""),l=e?B($,e):$;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");K.VERSION="0.7.33",K.BROWSER=q([c,f,"major"]),K.CPU=q([d]),K.DEVICE=q([u,p,h,g,y,m,v,_,b]),K.ENGINE=K.OS=q([c,f]),typeof t!==o?(typeof e!==o&&e.exports&&(t=e.exports=K),t.UAParser=K):typeof define===i&&define.amd?define((function(){return K})):typeof n!==o&&(n.UAParser=K);var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var J=new K;Z.ua=J.getResult(),Z.ua.get=function(){return J.getUA()},Z.ua.set=function(t){J.setUA(t);var e=J.getResult();for(var n in e)Z.ua[n]=e[n]}}}("object"==typeof window?window:t)})),aI=ue(((t,e)=>{v();var n=l((function(){this._tweens={},this._tweensAddedDuringUpdate={}}),"_Group");n.prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(t=void 0!==t?t:i.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var o=this._tweens[n[r]];o&&!1===o.update(t)&&(o._isPlaying=!1,e||delete this._tweens[n[r]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var r,i=new n;i.Group=n,i._nextId=0,i.nextId=function(){return i._nextId++},"undefined"==typeof self&&void 0!==C&&C.hrtime?i.now=function(){var t=C.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?i.now=self.performance.now.bind(self.performance):void 0!==Date.now?i.now=Date.now:i.now=function(){return(new Date).getTime()},i.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=i.Easing.Linear.None,this._interpolationFunction=i.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||i,this._id=i.nextId()},i.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=t,void 0!==e&&(this._duration=e),this},duration:l((function(t){return this._duration=t,this}),"duration"),start:function(t){for(var e in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?i.now()+parseFloat(t):t:i.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array||(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onRepeat:l((function(t){return this._onRepeatCallback=t,this}),"onRepeat"),onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e,n,r;if(t<this._startTime)return!0;for(e in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n,r=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[e]){var i=this._valuesStart[e]||0,o=this._valuesEnd[e];o instanceof Array?this._object[e]=this._interpolationFunction(o,r):("string"==typeof o&&(o="+"===o.charAt(0)||"-"===o.charAt(0)?i+parseFloat(o):parseFloat(o)),"number"==typeof o&&(this._object[e]=i+(o-i)*r))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var s=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=s}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a<l;a++)this._chainedTweens[a].start(this._startTime+this._duration);return!1}return!0}},i.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*i.Easing.Bounce.In(2*t):.5*i.Easing.Bounce.Out(2*t-1)+.5}}},i.Interpolation={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),s=i.Interpolation.Utils.Linear;return e<0?s(t[0],t[1],r):e>1?s(t[n],t[n-1],n-r):s(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,s=i.Interpolation.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*s(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),s=i.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),s(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(s(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):s(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(r=[1],function(t){var e=1;if(r[t])return r[t];for(var n=t;n>1;n--)e*=n;return r[t]=e,e}),CatmullRom:function(t,e,n,r,i){var o=.5*(n-t),s=.5*(r-e),a=i*i;return(2*e-2*n+o+s)*(i*a)+(-3*e+3*n-2*o-s)*a+o*i+e}}},function(n){"function"==typeof define&&define.amd?define([],(function(){return i})):void 0!==e&&"object"==typeof t?e.exports=i:void 0!==n&&(n.TWEEN=i)}(t)})),xg=ue(((t,e)=>{v();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(t){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}})),PI=ue(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),SI=ue(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).TinyQueue=r()})),kI=ue(((t,e)=>{v(),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")})),OI=ue(((t,e)=>{v(),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")})),LI=ue(((t,e)=>{v();var n=kI(),r=OI();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})),DI=ue(((t,e)=>{var n,r;v(),n=t,r=function(t){"use strict";let e=134217729;function n(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 r(t){return new Float64Array(t)}l(n,"r"),l(r,"o");let i=r(4),o=r(8),s=r(12),a=r(16),u=r(4);t.orient2d=function(t,r,l,c,h,p){let f=(r-p)*(l-h),d=(t-h)*(c-p),g=f-d;if(0===f||0===d||f>0!=d>0)return g;let y=Math.abs(f+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,r,l,c,h,p,f){let d,g,y,v,m,_,b,w,x,E,I,S,N,M,C,O,P,L,A=t-h,T=l-h,D=r-p,R=c-p;m=(C=(w=A-(b=(_=e*A)-(_-A)))*(E=R-(x=(_=e*R)-(_-R)))-((M=A*R)-b*x-w*x-b*E))-(I=C-(P=(w=D-(b=(_=e*D)-(_-D)))*(E=T-(x=(_=e*T)-(_-T)))-((O=D*T)-b*x-w*x-b*E))),i[0]=C-(I+m)+(m-P),m=(N=M-((S=M+I)-(m=S-M))+(I-m))-(I=N-O),i[1]=N-(I+m)+(m-O),m=(L=S+I)-S,i[2]=S-(L-m)+(I-m),i[3]=L;let k=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,i),F=22204460492503146e-32*f;if(k>=F||-k>=F||(d=t-(A+(m=t-A))+(m-h),y=l-(T+(m=l-T))+(m-h),g=r-(D+(m=r-D))+(m-p),v=c-(R+(m=c-R))+(m-p),0===d&&0===g&&0===y&&0===v)||(F=11093356479670487e-47*f+33306690738754706e-32*Math.abs(k),(k+=A*v+R*d-(D*y+T*g))>=F||-k>=F))return k;m=(C=(w=d-(b=(_=e*d)-(_-d)))*(E=R-(x=(_=e*R)-(_-R)))-((M=d*R)-b*x-w*x-b*E))-(I=C-(P=(w=g-(b=(_=e*g)-(_-g)))*(E=T-(x=(_=e*T)-(_-T)))-((O=g*T)-b*x-w*x-b*E))),u[0]=C-(I+m)+(m-P),m=(N=M-((S=M+I)-(m=S-M))+(I-m))-(I=N-O),u[1]=N-(I+m)+(m-O),m=(L=S+I)-S,u[2]=S-(L-m)+(I-m),u[3]=L;let z=n(4,i,4,u,o);m=(C=(w=A-(b=(_=e*A)-(_-A)))*(E=v-(x=(_=e*v)-(_-v)))-((M=A*v)-b*x-w*x-b*E))-(I=C-(P=(w=D-(b=(_=e*D)-(_-D)))*(E=y-(x=(_=e*y)-(_-y)))-((O=D*y)-b*x-w*x-b*E))),u[0]=C-(I+m)+(m-P),m=(N=M-((S=M+I)-(m=S-M))+(I-m))-(I=N-O),u[1]=N-(I+m)+(m-O),m=(L=S+I)-S,u[2]=S-(L-m)+(I-m),u[3]=L;let j=n(z,o,4,u,s);m=(C=(w=d-(b=(_=e*d)-(_-d)))*(E=v-(x=(_=e*v)-(_-v)))-((M=d*v)-b*x-w*x-b*E))-(I=C-(P=(w=g-(b=(_=e*g)-(_-g)))*(E=y-(x=(_=e*y)-(_-y)))-((O=g*y)-b*x-w*x-b*E))),u[0]=C-(I+m)+(m-P),m=(N=M-((S=M+I)-(m=S-M))+(I-m))-(I=N-O),u[1]=N-(I+m)+(m-O),m=(L=S+I)-S,u[2]=S-(L-m)+(I-m),u[3]=L;let B=n(j,s,4,u,a);return a[B-1]}(t,r,l,c,h,p,y)},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&&void 0!==e?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).predicates={})})),GI=ue(((t,e)=>{v();var n=PI(),r=SI(),i=LI(),o=DI().orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=y(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(),v=d.p,b=d.next.p,w=_(v,b);if(!(w<f)){var x=w/p;(c=a(o,d.prev.p,v,b,d.next.next.p,x,h))&&Math.min(_(c,v),_(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 y(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(y,"fastConvexHull"),l(m,"insertNode"),l(_,"getSqDist"),l(b,"sqSegDist"),l(w,"sqSegSegDist"),l(x,"compareByX"),l(E,"convexHull")})),WI=ue(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):n.quickselect=r()})),L1=ue(((t,e)=>{v(),e.exports=r,e.exports.default=r;var n=WI();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 y(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(!y(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],y(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(!y(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],y(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(y,"intersects"),l(m,"createNode"),l(_,"multiSelect")})),tP=ue(((t,e)=>{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=A(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=A(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&&y(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=L(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=L(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 y(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 L(t,e){var n=new D(t.i,t.x,t.y),r=new D(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 A(t,e,n,r){var i=new D(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 D(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}v(),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(y,"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(L,"splitPolygon"),l(A,"insertNode"),l(T,"removeNode"),l(D,"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}})),rP=ue(((t,e)=>{var n,r;v(),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&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n=n||self).RBush=r()})),Y1=ue((t=>{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 y(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 y(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")}v(),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(y,"radiansToLength"),t.radiansToLength=y,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})),H1=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0});var e=Y1();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 y(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 y(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(y,"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=y,t.lineReduce=m,t.propEach=i,t.propReduce=o,t.segmentEach=d,t.segmentReduce=g})),pP=ue((t=>{v(),Object.defineProperty(t,"__esModule",{value:!0});var e=H1();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})),Bg=ue(((t,e)=>{v();var n=rP(),r=Y1(),i=H1(),o=pP().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})),r_=ue(((t,e)=>{v();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")})),RP=ue(((t,e)=>{var n,r,i,o,s,a,u,c,h,p,f,d;v(),Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=r_(),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("undefined"==typeof window)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(t){return!0}}catch(t){return!0}return!1}(),d=l((function(t){if("undefined"==typeof window||!f)return h(t);try{return h(t)}catch(t){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})),Ug=ue(((t,e)=>{v();var n=Array.prototype.slice,r=r_(),i=Object.keys,o=i?l((function(t){return i(t)}),"keys"):RP(),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})),zP=ue(((t,e)=>{v(),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")})),o_=ue(((t,e)=>{v();var n=zP();e.exports=l((function(){return n()&&!!Symbol.toStringTag}),"hasToStringTagShams")})),UP=ue(((t,e)=>{v(),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")})),YP=ue(((t,e)=>{v();var n="undefined"!=typeof Symbol&&Symbol,r=UP();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),HP=ue(((t,e)=>{v();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")})),mp=ue(((t,e)=>{v();var n=HP();e.exports=Function.prototype.bind||n})),s_=ue(((t,e)=>{v();var n=mp();e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)})),c_=ue(((t,e)=>{v();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch(t){try{return a(arguments,"callee").get}catch(t){return u}}}():u,h=YP()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=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"]},_=mp(),b=s_(),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=y(i)),void 0===s&&!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")})),Wg=ue(((t,e)=>{v();var n=mp(),r=c_(),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(t){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})),p_=ue(((t,e)=>{v();var n=c_(),r=Wg(),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")})),fS=ue(((t,e)=>{v();var n=o_()(),r=p_()("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})),g_=ue(((t,e)=>{v();var n=Ug(),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(t){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})),m_=ue(((t,e)=>{v();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")})),v_=ue(((t,e)=>{v();var n=m_();e.exports=l((function(){return"function"==typeof Object.is?Object.is:n}),"getPolyfill")})),_S=ue(((t,e)=>{v();var n=v_(),r=g_();e.exports=l((function(){var t=n();return r(Object,{is:t},{is:l((function(){return Object.is!==t}),"testObjectIs")}),t}),"shimObjectIs")})),ES=ue(((t,e)=>{v();var n=g_(),r=Wg(),i=m_(),o=v_(),s=_S(),a=r(o(),Object);n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),CS=ue(((t,e)=>{v();var n,r,i,o,s=p_(),a=o_()();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")})),NS=ue(((t,e)=>{v(),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")})),AS=ue(((t,e)=>{v();var n="undefined"!=typeof Symbol&&Symbol,r=NS();e.exports=l((function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&r()}),"hasNativeSymbols")})),BS=ue(((t,e)=>{v();var n,r=SyntaxError,i=Function,o=TypeError,s=l((function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}}),"getEvalledConstructor"),a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(t){a=null}var u=l((function(){throw new o}),"throwTypeError"),c=a?function(){try{return u}catch(t){try{return a(arguments,"callee").get}catch(t){return u}}}():u,h=AS()(),p=Object.getPrototypeOf||function(t){return t.__proto__},f={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=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"]},_=mp(),b=s_(),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=y(i)),void 0===s&&!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")})),zS=ue(((t,e)=>{v();var n=BS()("%Object.defineProperty%",!0),r=l((function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1}),"hasPropertyDescriptors");r.hasArrayLengthDefineBug=l((function(){if(!r())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}}),"hasArrayLengthDefineBug"),e.exports=r})),Qg=ue(((t,e)=>{v();var n=Ug(),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=zS()(),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})),YS=ue(((t,e)=>{v();var n=l((function(){return"string"==typeof l((function(){}),"f").name}),"functionsHaveNames"),r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){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})),P_=ue(((t,e)=>{v();var n=YS().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"})})),S_=ue(((t,e)=>{v();var n=P_(),r=Qg().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")})),KS=ue(((t,e)=>{v();var n=Qg().supportsDescriptors,r=S_(),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")})),eC=ue(((t,e)=>{v();var n=Qg(),r=Wg(),i=P_(),o=S_(),s=KS(),a=r(o());n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a})),rC=ue(((t,e)=>{v();var n=Date.prototype.getDay,r=l((function(t){try{return n.call(t),!0}catch(t){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")})),C_=ue(((t,e)=>{v();var n=Ug(),r=fS(),i=ES(),o=CS(),s=eC(),a=rC(),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(t){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})),z_=ue(((t,e)=>{v();var n=C_(),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})),wC=ue(((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)}v(),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)},void 0!==e&&e.exports&&(e.exports=n)})),xC=ue(((t,e)=>{function n(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}v(),l(n,"KMEANS"),n.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(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++)void 0===e[t=this.assignments[n]]&&(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)},void 0!==e&&e.exports&&(e.exports=n)})),q_=ue(((t,e)=>{function n(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}v(),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))},void 0!==e&&e.exports&&(e.exports=n)})),MC=ue(((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)}v(),void 0!==e&&e.exports&&(n=q_()),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)},void 0!==e&&e.exports&&(e.exports=r)})),IC=ue(((t,e)=>{v(),void 0!==e&&e.exports&&(e.exports={DBSCAN:wC(),KMEANS:xC(),OPTICS:MC(),PriorityQueue:q_()})})),G_=ue(((t,e)=>{v(),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")}})),NC=ue(((t,e)=>{v();var n=G_(),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")}})),RC=ue(((t,e)=>{v();var n=G_(),r=NC(),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 L=0;L<e;L++){for(var A=l[L],T=I[L],D=u[L],R=v[L],k=0;k<g;k++)A[k]=T[k]/R||0;if(p)for(var F=0;F<g;F++)if(D[F]!=A[F]){p=!1;break}}}else{for(var z=0;z<d;z++){I[c[z]]+=t[z]}for(var j=0;j<e;j++)l[j]=I[j]/v[j]||0;p=!0;for(var B=0;B<e;B++)if(u[B]!=l[B]){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})),Nl=ue(((t,e)=>{var n,r;v(),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"),L=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"),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 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"),D=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 D(n,r,t.x);if(0===r.x)return D(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"),k=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:z.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:L(e.point,t.point,i.point),cosine:A(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}(),F=0,z=function(){function e(n,r,i,o){t(this,e),this.id=++F,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 k(t,!0),o=new k(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 k.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),k.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(H.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===H.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(H.type))}return this._isInResult}),"isInResult")}],[{key:"fromRing",value:l((function(t,n,r){var i,o,s,a=k.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 k(i,!0),new k(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(z.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(z.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}(),B=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}(),q=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(t){}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 B(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}(),G=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];k.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}(),U=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 U(i));else{var o=i.enclosingRing();o.poly||e.push(new U(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]:z.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||k.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=void 0!==C&&C.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,W=void 0!==C&&C.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,H=new(function(){function e(){t(this,e)}return l(e,"Operation"),n(e,[{key:"run",value:l((function(t,e,n){H.type=t,S.reset();for(var r=[new q(e,!0)],i=0,o=n.length;i<o;i++)r.push(new q(n[i],!1));if(H.numMultiPolys=r.length,"difference"===H.type)for(var s=r[0],a=1;a<r.length;)null!==_(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===H.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(k.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 L=G.factory(w.segments);return new V(L).getGeom()}),"run")}]),e}()),$=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 H.run("union",t,n)}),"union"),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 H.run("intersection",t,n)}),"intersection"),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 H.run("xor",t,n)}),"xor"),J=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 H.run("difference",t,n)}),"difference");return{union:$,intersection:K,xor:Z,difference:J}},"object"==typeof t&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).polygonClipping=r()})),ek=ue(((t,e)=>{var n,r;v(),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 L=l((function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),"T"),A=l((function(){}),"R"),T={LOG_10:{configurable:!0}};A.prototype.interfaces_=function(){return[]},A.prototype.getClass=function(){return A},A.log10=function(t){var e=Math.log(t);return b.isInfinite(e)||b.isNaN(e)?e:e/A.LOG_10},A.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},A.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}},A.wrap=function(t,e){return t<0?e- -t%e:t%e},A.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}},A.average=function(t,e){return(t+e)/2},T.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(A,T);var D=l((function(t){this.str=t}),"D");D.prototype.append=function(t){this.str+=t},D.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},D.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 k=l((function(){}),"A");k.isWhitespace=function(t){return t<=32&&t>=0||127===t},k.toUpperCase=function(t){return t.toUpperCase()};var F=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"),z={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}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=F.magnitude(n._hi),i=F.TEN.pow(r);(n=n.divide(i)).gt(F.TEN)?(n=n.divide(F.TEN),r+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),r-=1);for(var o=r+1,s=new D,a=F.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(F.valueOf(u)).multiply(F.TEN),c&&n.selfAdd(F.TEN);var p=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-l&&(p=!1),!p)break}return e[0]=r,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){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)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof F){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=F.SPLIT*l)-(i=u-l))*(s=(h=F.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}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){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=F.SPLIT*o)-(e=s-o)),l=e*(r=(l=F.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 F(l=o+s,o-l+s)}if("number"==typeof arguments[0]){var u=arguments[0];return b.isNaN(u)?F.createNaN():F.copy(this).selfDivide(u,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.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},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.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},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},F.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof F){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}},F.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof F){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=F.SPLIT*this._hi)-this._hi,u=F.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}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return b.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return b.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.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."+F.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},F.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=F.SPLIT*n)-(i=s-n)),o=(a=F.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 F(l,n-l+s)},F.prototype.toSciNotation=function(){if(this.isZero())return F.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=F.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},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.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 F){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}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,x,E]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new F(e)}},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;k.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 F,s=0,a=0,l=0;!(e>=n);){var u=t.charAt(e);if(e++,k.isDigit(u)){var c=u-"0";o.selfMultiply(F.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=F.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=F.TEN.pow(-f);p=o.multiply(g)}return r?p.negate():p},F.createNaN=function(){return new F(b.NaN,b.NaN)},F.copy=function(t){return new F(t)},F.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},F.stringOfChar=function(t,e){for(var n=new D,r=0;r<e;r++)n.append(t);return n.toString()},z.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},z.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},z.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},z.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},z.NaN.get=function(){return new F(b.NaN,b.NaN)},z.EPS.get=function(){return 123259516440783e-46},z.SPLIT.get=function(){return 134217729},z.MAX_PRINT_DIGITS.get=function(){return 32},z.TEN.get=function(){return F.valueOf(10)},z.ONE.get=function(){return F.valueOf(1)},z.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},z.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,z);var j=l((function(){}),"q"),B={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=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.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=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),l=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),u=a.subtract(l).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),h=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),p=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),d=F.valueOf(n.y).selfAdd(F.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},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,B);var q=l((function(){}),"V"),G={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};G.X.get=function(){return 0},G.Y.get=function(){return 1},G.Z.get=function(){return 2},G.M.get=function(){return 3},q.prototype.setOrdinate=function(t,e,n){},q.prototype.size=function(){},q.prototype.getOrdinate=function(t,e){},q.prototype.getCoordinate=function(){},q.prototype.getCoordinateCopy=function(t){},q.prototype.getDimension=function(){},q.prototype.getX=function(t){},q.prototype.clone=function(){},q.prototype.expandEnvelope=function(t){},q.prototype.copy=function(){},q.prototype.getY=function(t){},q.prototype.toCoordinateArray=function(){},q.prototype.interfaces_=function(){return[E]},q.prototype.getClass=function(){return q},Object.defineProperties(q,G);var U=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}(U),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"),H={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))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(W,H);var $={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*$/},K=l((function(t){this.geometryFactory=t||new me}),"K");K.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=$.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=$.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],J[n]&&(e=J[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},K.prototype.write=function(t){return this.extractGeometry(t)},K.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Z[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Z[e].apply(this,[t])+")"};var Z={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Z.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Z.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(Z.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(Z.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("("+Z.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Z.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Z.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("("+Z.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(",")}},J={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split($.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($.trimParens,"$1"),r.push(J.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($.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($.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($.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace($.trimParens,"$1"),r.push(J.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($.parenComma),s=[],a=0,l=o.length;a<l;++a)e=o[a].replace($.trimParens,"$1"),n=J.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($.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace($.trimParens,"$1"),r.push(J.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 K(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 D;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&&L(arguments[1],q)){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(L(arguments[0],q)){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?A.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=A.clamp(e,0,t.length);var r=(n=A.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 Lt=l((function(){}),"Tt");Lt.prototype.get=function(){},Lt.prototype.put=function(){},Lt.prototype.size=function(){},Lt.prototype.values=function(){},Lt.prototype.entrySet=function(){};var At=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}(Lt);(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 Dt(this)},e}(o),Dt=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 At).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 kt=l((function(){}),"At");kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},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 Ft(this)};var Ft=l((function(t){this.treeSet_=t,this.position_=0}),"Ft");Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new i};var zt=l((function(){}),"Gt");zt.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])},zt.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"),Bt={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}};Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.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(k.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,Bt);var qt=l((function(){}),"Vt");qt.prototype.filter=function(t){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var Gt=l((function(){}),"Ut");Gt.prototype.filter=function(t,e){},Gt.prototype.isDone=function(){},Gt.prototype.isGeometryChanged=function(){},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var Ut=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();zt.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(zt.asList(this._geometries)),n=new d(zt.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(L(arguments[0],dt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(L(arguments[0],Gt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(L(arguments[0],qt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(L(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[kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Ut),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 Kt?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"),Ht={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)},Ht.NEWLINE.get=function(){return Y.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Wt,Ht);var $t=l((function(){}),"Wt");$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},$t.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))},$t.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,q.X)===t.getOrdinate(e-1,q.X)&&t.getOrdinate(0,q.Y)===t.getOrdinate(e-1,q.Y)},$t.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},$t.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if($t.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)$t.copy(e,i-1,r,o,1);return r},$t.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)$t.swap(t,r,e-r)},$t.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)}},$t.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)$t.copyCoord(t,e+o,n,r+o)},$t.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new D;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()}},$t.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?$t.createClosedRing(t,e,4):e.getOrdinate(0,q.X)===e.getOrdinate(n-1,q.X)&&e.getOrdinate(0,q.Y)===e.getOrdinate(n-1,q.Y)?e:$t.createClosedRing(t,e,n+1)},$t.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();$t.copy(e,0,r,0,i);for(var o=i;o<n;o++)$t.copy(e,0,r,o,1);return r};var Kt=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&&$t.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 $t.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(L(arguments[0],dt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(L(arguments[0],Gt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],qt)||L(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[kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ht),Zt=l((function(){}),"Jt");Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var Jt=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(L(arguments[0],dt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(L(arguments[0],Gt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(L(arguments[0],qt)||L(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[Zt]},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);zt.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(L(t,dt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(L(t,Gt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(L(t,qt))t.filter(this);else if(L(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[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Ut),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 $t.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}(Kt),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}(Ut),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 Ut?this.editGeometryCollection(t,e):t instanceof te?this.editPolygon(t,e):t instanceof Jt||t instanceof Kt?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 Kt?e.createLineString(n):t instanceof Jt?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 Kt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?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(L(arguments[0],q)){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 q.X:this._coordinates[t].x=n;break;case q.Y:this._coordinates[t].y=n;break;case q.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 q.X:return this._coordinates[t].x;case q.Y:return this._coordinates[t].y;case q.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 D(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[q,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(L(arguments[0],q)){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}(Lt),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?L(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 Kt(this.getCoordinateSequenceFactory().create(t),this):L(t,q)?new Kt(t,this):void 0:new Kt(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 Kt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof Jt)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(L(arguments[0],q)){var e=arguments[0];return new Jt(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(L(arguments[0],q)){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 Ut(null,this);if(1===arguments.length){var t=arguments[0];return new Ut(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(L(arguments[0],q)){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(L(arguments[0],q)){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());$t.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 Le=l((function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Ce}),"Te");Le.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Le.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Le.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new 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)}},Le.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Le.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Le.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ne.RIGHT)>=1&&e.getDepth(Ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Le.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))}}}},Le.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Le.prototype.getEnvelope=function(){if(null===this._env){for(var t=new 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},Le.prototype.addReachable=function(t){var e=new v;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Le.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Le.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Le.prototype.getNodes=function(){return this._nodes},Le.prototype.getDirectedEdges=function(){return this._dirEdgeList},Le.prototype.interfaces_=function(){return[x]},Le.prototype.getClass=function(){return Le};var Ae=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");Ae.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Ae.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},Ae.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},Ae.prototype.isLine=function(){return 1===this.location.length},Ae.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])},Ae.prototype.getLocations=function(){return this.location},Ae.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},Ae.prototype.toString=function(){var t=new D;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()},Ae.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Ae.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Ae.prototype.isArea=function(){return this.location.length>1},Ae.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},Ae.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}},Ae.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Ae.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Ae.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};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 Ae(e),this.elt[1]=new Ae(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Ae(n.elt[0]),this.elt[1]=new Ae(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Ae(O.NONE),this.elt[1]=new Ae(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 Ae(o,s,a),this.elt[1]=new Ae(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 Ae(O.NONE,O.NONE,O.NONE),this.elt[1]=new Ae(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 Ae(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 D;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 Ae(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 De=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");De.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())},De.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},De.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)},De.prototype.getLinearRing=function(){return this._ring},De.prototype.getCoordinate=function(t){return this._pts.get(t)},De.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},De.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])}},De.prototype.isHole=function(){return this._isHole},De.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},De.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},De.prototype.addHole=function(t){this._holes.add(t)},De.prototype.isShell=function(){return null===this._shell},De.prototype.getLabel=function(){return this._label},De.prototype.getEdges=function(){return this._edges},De.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},De.prototype.getShell=function(){return this._shell},De.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}},De.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},De.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)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};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}(De),ke=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}(De),Fe=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");Fe.prototype.setVisited=function(t){this._isVisited=t},Fe.prototype.setInResult=function(t){this._isInResult=t},Fe.prototype.isCovered=function(){return this._isCovered},Fe.prototype.isCoveredSet=function(){return this._isCoveredSet},Fe.prototype.setLabel=function(t){this._label=t},Fe.prototype.getLabel=function(){return this._label},Fe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fe.prototype.updateIM=function(t){nt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fe.prototype.isInResult=function(){return this._isInResult},Fe.prototype.isVisited=function(){return this._isVisited},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var ze=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}(Fe),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 ze){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 Be=l((function(){}),"Be"),qe={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&(t-e+4)%4==2},Be.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},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.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?Be.NE:Be.SE:e>=0?Be.NW:Be.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?Be.NE:Be.SE:r.y>=n.y?Be.NW:Be.SW}},qe.NE.get=function(){return 0},qe.NW.get=function(){return 1},qe.SW.get=function(){return 2},qe.SE.get=function(){return 3},Object.defineProperties(Be,qe);var Ge=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");Ge.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)},Ge.prototype.getDy=function(){return this._dy},Ge.prototype.getCoordinate=function(){return this._p0},Ge.prototype.setNode=function(t){this._node=t},Ge.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)},Ge.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ge.prototype.getDirectedCoordinate=function(){return this._p1},Ge.prototype.getDx=function(){return this._dx},Ge.prototype.getLabel=function(){return this._label},Ge.prototype.getEdge=function(){return this._edge},Ge.prototype.getQuadrant=function(){return this._quadrant},Ge.prototype.getNode=function(){return this._node},Ge.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},Ge.prototype.computeLabel=function(t){},Ge.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=Be.quadrant(this._dx,this._dy),nt.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ge.prototype.interfaces_=function(){return[x]},Ge.prototype.getClass=function(){return Ge};var Ue=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}(Ge),Ve=l((function(){}),"Xe");Ve.prototype.createNode=function(t){return new ze(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 ze){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&&Be.quadrant(t,e)===Be.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 Ue(n,!0),i=new Ue(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 ke(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 He=l((function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),"He");He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[We,e]},He.prototype.getClass=function(){return He};var $e=l((function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),"We");$e.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},$e.prototype.size=function(){return this._size},$e.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)},$e.prototype.clear=function(){this._size=0,this._items.clear()},$e.prototype.isEmpty=function(){return 0===this._size},$e.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)},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Ke=l((function(){}),"Ke");Ke.prototype.visitItem=function(t){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Ze=l((function(){}),"Je");Ze.prototype.insert=function(t,e){},Ze.prototype.remove=function(t,e){},Ze.prototype.query=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Je=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}};Je.prototype.getLevel=function(){return this._level},Je.prototype.size=function(){return this._childBoundables.size()},Je.prototype.getChildBoundables=function(){return this._childBoundables},Je.prototype.addChildBoundable=function(t){nt.isTrue(null===this._bounds),this._childBoundables.add(t)},Je.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Je.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Je.prototype.interfaces_=function(){return[We,e]},Je.prototype.getClass=function(){return Je},Qe.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Je,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?zt.sort(n,e):zt.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 Je};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 Je?t+=this.size(n):n instanceof He&&(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 He&&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 Je){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?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 He(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 Je?this.boundablesAtLevel(n,s,i):(nt.isTrue(s instanceof He),-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(L(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)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 Je?this.query(i,u,s):u instanceof He?s.visitItem(u.getItem()):nt.shouldNeverReachHere())}else if(L(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Je)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 Je?this.query(c,g,p):g instanceof He?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 Je&&(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 Je){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(L(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(L(arguments[2],Et)&&arguments[0]instanceof Object&&arguments[1]instanceof Je){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(L(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&&L(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 $e;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 He(f,d),v=new en(this.getRoot(),y,g);return this.nearestNeighbour(v)[0]}},n.prototype.interfaces_=function(){return[Ze,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}(Je),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=Be.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Be.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 Ln=l((function(){}),"Tn"),An={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.toDegrees=function(t){return 180*t/Math.PI},Ln.normalize=function(t){for(;t>Math.PI;)t-=Ln.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ln.PI_TIMES_2;return t},Ln.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Ln.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},Ln.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},Ln.interiorAngle=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Math.abs(i-r)},Ln.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ln.PI_TIMES_2;t>=Ln.PI_TIMES_2&&(t=0)}else{for(;t>=Ln.PI_TIMES_2;)t-=Ln.PI_TIMES_2;t<0&&(t=0)}return t},Ln.angleBetween=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n);return Ln.diff(r,i)},Ln.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ln.toRadians=function(t){return t*Math.PI/180},Ln.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ln.COUNTERCLOCKWISE:n<0?Ln.CLOCKWISE:Ln.NONE},Ln.angleBetweenOriented=function(t,e,n){var r=Ln.angle(e,t),i=Ln.angle(e,n)-r;return i<=-Math.PI?i+Ln.PI_TIMES_2:i>Math.PI?i-Ln.PI_TIMES_2:i},An.PI_TIMES_2.get=function(){return 2*Math.PI},An.PI_OVER_2.get=function(){return Math.PI/2},An.PI_OVER_4.get=function(){return Math.PI/4},An.COUNTERCLOCKWISE.get=function(){return lt.COUNTERCLOCKWISE},An.CLOCKWISE.get=function(){return lt.CLOCKWISE},An.NONE.get=function(){return lt.COLLINEAR},Object.defineProperties(Ln,An);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"),Dn={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=Ln.angle(i,this._seg0.p0),s=Ln.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ln.normalize(o+s),l=Ln.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},Dn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Dn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Dn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Dn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Tn,Dn);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 kn=l((function(){this._subgraphs=null,this._seg=new yn,this._cga=new lt;var t=arguments[0];this._subgraphs=t}),"An"),Fn={DepthSegment:{configurable:!0}};kn.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(L(arguments[2],Et)&&arguments[0]instanceof S&&arguments[1]instanceof Ue){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 zn(this._seg,c);a.add(h)}}else if(L(arguments[2],Et)&&arguments[0]instanceof S&&L(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)}},kn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:tn.min(e)._leftDepth},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Fn.DepthSegment.get=function(){return zn},Object.defineProperties(kn,Fn);var zn=l((function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new yn(t),this._leftDepth=e}),"Gn");zn.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)},zn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},zn.prototype.toString=function(){return this._upwardSeg.toString()},zn.prototype.interfaces_=function(){return[x]},zn.prototype.getClass=function(){return zn};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!!Ln.isAcute(t,e,n)&&!!Ln.isAcute(e,n,t)&&!!Ln.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 Bn=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");Bn.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)},Bn.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)}},Bn.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)},Bn.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)},Bn.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)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.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)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof te?this.addPolygon(t):t instanceof Kt?this.addLineString(t):t instanceof Jt?this.addPoint(t):(t instanceof ee||t instanceof Vt||t instanceof re||t instanceof Ut)&&this.addCollection(t)},Bn.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},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var qn=l((function(){}),"Vn");qn.prototype.locate=function(t){},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn};var Gn=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");Gn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Gn.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 Ut?(this._subcollectionIterator=new Gn(t),this._subcollectionIterator.next()):t},Gn.prototype.remove=function(){throw new Error(this.getClass().getName())},Gn.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)},Gn.prototype.interfaces_=function(){return[xt]},Gn.prototype.getClass=function(){return Gn},Gn.isAtomic=function(t){return!(t instanceof Ut)};var Un=l((function(){this._geom=null;var t=arguments[0];this._geom=t}),"zn");Un.prototype.locate=function(t){return Un.locate(t,this._geom)},Un.prototype.interfaces_=function(){return[qn]},Un.prototype.getClass=function(){return Un},Un.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&<.isPointInRing(t,e.getCoordinates())},Un.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Un.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Un.isPointInRing(t,i))return!1}return!0},Un.containsPoint=function(t,e){if(e instanceof te)return Un.containsPointInPolygon(t,e);if(e instanceof Ut)for(var n=new Gn(e);n.hasNext();){var r=n.next();if(r!==e&&Un.containsPoint(t,r))return!0}return!1},Un.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:Un.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]=Un.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new D;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 Be.isNorthern(i)&&Be.isNorthern(o)?n:Be.isNorthern(i)||Be.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 ze(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 Hn=l((function(){this._edges=new It,this._ocaMap=new p}),"Hn");Hn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Wn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Wn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var $n=l((function(){}),"Wn");$n.prototype.processIntersections=function(t,e,n,r){},$n.prototype.isDone=function(){},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Kn=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");Kn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Kn.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},Kn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Kn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Kn.prototype.getLineIntersector=function(){return this._li},Kn.prototype.hasProperIntersection=function(){return this._hasProper},Kn.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)))},Kn.prototype.hasIntersection=function(){return this._hasIntersection},Kn.prototype.isDone=function(){return!1},Kn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Kn.prototype.interfaces_=function(){return[$n]},Kn.prototype.getClass=function(){return Kn},Kn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Zn=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");Zn.prototype.getSegmentIndex=function(){return this.segmentIndex},Zn.prototype.getCoordinate=function(){return this.coord},Zn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Zn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Zn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Zn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Zn.prototype.getDistance=function(){return this.dist},Zn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Zn.prototype.interfaces_=function(){return[x]},Zn.prototype.getClass=function(){return Zn};var Jn=l((function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t}),"Qn");Jn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Jn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Jn.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}},Jn.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)},Jn.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))},Jn.prototype.add=function(t,e,n){var r=new Zn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Jn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn};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=Be.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Be.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 Jn(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 D;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}(Fe),ir=l((function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,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 kn(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 Le;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 Kn(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 Bn(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(L(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(L(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[Ke]},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[$n]},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 U))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(L(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=A.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 Kt&&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 Kt)_r.computeDistance(h,p,f);else if(h instanceof te)_r.computeDistance(h,p,f);else if(h instanceof Ut)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[Gt]},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[qt]},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 Ut&&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 Kt&&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(L(arguments[0],wt)&&L(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&&L(arguments[1],wt)){var l=arguments[0],u=arguments[1];return l instanceof Kt?u.add(l):l.apply(new Sr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&L(arguments[0],wt)&&L(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&&L(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 Kt){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 Jt){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 Jt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Kt)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 Ut)for(var l=new Gn(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 Kt||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 Jt&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[qt]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Jt?tn.singletonList(t):Or.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Jt?n.add(e):e instanceof Ut&&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 Jt||t instanceof Kt||t instanceof te)&&this._locations.add(new Mr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[qt]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e};var Lr=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");Lr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,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&&L(arguments[0],Et)&&L(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}},Lr.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}},Lr.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))))},Lr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation||(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 Kt&&arguments[1]instanceof Jt){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 Kt&&arguments[1]instanceof Kt){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}}},Lr.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}},Lr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var 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}},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.distance=function(t,e){return new Lr(t,e).distance()},Lr.isWithinDistance=function(t,e,n){return new Lr(t,e,n).distance()<=n},Lr.nearestPoints=function(t,e){return new Lr(t,e).nearestPoints()};var Ar=l((function(){this._pt=[new S,new S],this._distance=b.NaN,this._isNull=!0}),"Ri");Ar.prototype.getCoordinates=function(){return this._pt},Ar.prototype.getCoordinate=function(t){return this._pt[t]},Ar.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)}},Ar.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}},Ar.prototype.toString=function(){return Q.toLineString(this._pt[0],this._pt[1])},Ar.prototype.getDistance=function(){return this._distance},Ar.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)}},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var Tr=l((function(){}),"Pi");Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.computeDistance=function(){if(arguments[2]instanceof Ar&&arguments[0]instanceof Kt&&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 Ar&&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 Ar&&arguments[0]instanceof ht&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Kt)Tr.computeDistance(h,p,f);else if(h instanceof te)Tr.computeDistance(h,p,f);else if(h instanceof Ut)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 Ar&&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 Dr=l((function(){this._g0=null,this._g1=null,this._ptDist=new Ar,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),"Di"),Rr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Dr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Dr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Dr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Dr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Dr.prototype.computeOrientedDistance=function(t,e,n){var r=new kr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Dr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Dr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Dr(n,r);return o.setDensifyFraction(i),o.distance()}},Rr.MaxPointDistanceFilter.get=function(){return kr},Rr.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Dr,Rr);var kr=l((function(){this._maxPtDist=new Ar,this._minPtDist=new Ar,this._euclideanDist=new Tr,this._geom=null;var t=arguments[0];this._geom=t}),"Ai");kr.prototype.filter=function(t){this._minPtDist.initialize(),Tr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[dt]},kr.prototype.getClass=function(){return kr};var Fr=l((function(){this._maxPtDist=new Ar,this._minPtDist=new Ar,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");Fr.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)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[Gt]},Fr.prototype.getClass=function(){return Fr};var zr=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}};zr.prototype.checkMaximumDistance=function(t,e,n){var r=new Dr(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])+")"}},zr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=zr.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(),zr.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)},zr.prototype.checkNegativeValid=function(){if(!(this._input instanceof te||this._input instanceof re||this._input instanceof Ut))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)},zr.prototype.getErrorIndicator=function(){return this._errorIndicator},zr.prototype.checkMinimumDistance=function(t,e,n){var r=new Lr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var 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])+" )"}},zr.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)},zr.prototype.getErrorLocation=function(){return this._errorLocation},zr.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)},zr.prototype.getErrorMessage=function(){return this._errMsg},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(zr,jr);var Br=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"),qr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Br.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},Br.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Br.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")},Br.prototype.checkDistance=function(){var t=new zr(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")},Br.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")},Br.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")},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.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"))},Br.prototype.report=function(t){if(!Br.VERBOSE)return null;Y.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Br.prototype.getErrorMessage=function(){return this._errorMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.isValidMsg=function(t,e,n){var r=new Br(t,e,n);return r.isValid()?null:r.getErrorMessage()},Br.isValid=function(t,e,n){return!!new Br(t,e,n).isValid()},qr.VERBOSE.get=function(){return!1},qr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,qr);var Gr=l((function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),"Ui");Gr.prototype.getCoordinates=function(){return this._pts},Gr.prototype.size=function(){return this._pts.length},Gr.prototype.getCoordinate=function(t){return this._pts[t]},Gr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Gr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Gr.prototype.setData=function(t){this._data=t},Gr.prototype.getData=function(){return this._data},Gr.prototype.toString=function(){return Q.toLineString(new ue(this._pts))},Gr.prototype.interfaces_=function(){return[fn]},Gr.prototype.getClass=function(){return Gr};var Ur=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");Ur.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ur.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ur.prototype.getIntersectionSegments=function(){return this._intSegments},Ur.prototype.count=function(){return this._intersectionCount},Ur.prototype.getIntersections=function(){return this._intersections},Ur.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ur.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ur.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++)},Ur.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Ur.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Ur.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Ur.prototype.interfaces_=function(){return[$n]},Ur.prototype.getClass=function(){return Ur},Ur.createAllIntersectionsFinder=function(t){var e=new Ur(t);return e.setFindAllIntersections(!0),e},Ur.createAnyIntersectionFinder=function(t){return new Ur(t)},Ur.createIntersectionCounter=function(t){var e=new Ur(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 Ur(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 Gr(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 Hr=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");Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Mi.INTERSECTION)){var r=n.getLabel();Mi.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var $r=l((function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),"Wi");$r.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},$r.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)},$r.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},$r.prototype.getInputGeometry=function(){return this._inputGeom},$r.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)},$r.prototype.transformCoordinates=function(t,e){return this.copy(t)},$r.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},$r.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)},$r.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)},$r.prototype.copy=function(t){return t.copy()},$r.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)},$r.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Jt)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 Kt)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 Ut)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},$r.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)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Kr=l((function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new yn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Kt&&"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");Kr.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)))}},Kr.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},Kr.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Kr.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)}},Kr.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},Kr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Zr=l((function(t){this._srcGeom=t||null}),"Ji"),Jr={SNAP_PRECISION_FACTOR:{configurable:!0}};Zr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Qr(e,n).transform(this._srcGeom)},Zr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Qr(t,n,!0).transform(this._srcGeom),i=r;return e&&L(i,Qt)&&(i=r.buffer(0)),i},Zr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Zr.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))},Zr.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},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Zr(t);r[0]=i.snapTo(e,n);var o=new Zr(e);return r[1]=o.snapTo(r[0],n),r},Zr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Zr.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(Zr.computeOverlaySnapTolerance(i),Zr.computeOverlaySnapTolerance(o))}},Zr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Zr.SNAP_PRECISION_FACTOR},Zr.snapToSelf=function(t,e,n){return new Zr(t).snapToSelf(e,n)},Jr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Zr,Jr);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 Kr(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}($r),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 0!=(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[Gt]},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 Zr(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=Zr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},oi.prototype.snap=function(t){var e=this.removeCommonBits(t);return Zr.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&&L(arguments[0],Et)&&L(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]&&L(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[Ke]},_i.prototype.getClass=function(){return _i};var bi=l((function(){this._index=null;var t=arguments[0];if(!L(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[qn]},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[Ke]},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 Jt){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 Kt)this.addLineString(e);else if(e instanceof Jt)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 Ut))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return L(this._parentGeom,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&&L(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(L(arguments[0],wt)&&L(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 Hn,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 Hr(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[qt]},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 Li=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"),Ai={TOLERANCE:{configurable:!0}};Li.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]))},Li.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Li.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),!!Li.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Li.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Li.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},Li.prototype.getInvalidLocation=function(){return this._invalidLocation},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Li.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Zr.computeSizeBasedSnapTolerance(t),Zr.computeSizeBasedSnapTolerance(e))},Li.isValid=function(t,e,n,r){return new Li(t,e,r).isValid(n)},Ai.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Li,Ai);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 Di=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}};Di.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;L(r,Et)?i=this.unionTree(r):r instanceof ht&&(i=r),e.add(i)}return e},Di.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)},Di.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)},Di.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(Di.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)},Di.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=Di.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Di.getGeometry(e,n),Di.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)}},Di.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},Di.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Di.prototype.unionActual=function(t,e){return Di.restrictToPolygons(t.union(e))},Di.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Di.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)},Di.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)}},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.restrictToPolygons=function(t){if(L(t,Qt))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Di.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Di.union=function(t){return new Di(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Di,Ri);var ki=l((function(){}),"Ar");ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},ki.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=ki,t.BufferOp=yr,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?r(t):"function"==typeof define&&define.amd?define(["exports"],r):r(n.jsts={})})),dN={};function Eb(t,e){return!e&&"function"==typeof t&&(e=t,t={}),this.ondata=e,t}function eN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Xl],(function(t){return Ps(Gp(t.data[0],t.data[1]))}),0,n)}function Gp(t,e){return Eu(t,e||{},0,0)}function Ib(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Vl],(function(t){return Ps(Hl(t.data[0],vb(t.data[1])))}),1,n)}function Hl(t,e){return zp(t,e)}function K4(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Xl,Wk,function(){return[Sb]}],(function(t){return Ps(Sb(t.data[0],t.data[1]))}),2,n)}function Sb(t,e){e||(e={});var n=Ul(),r=t.length;n.p(t);var i=Eu(t,e,wb(e),8),o=i.length;return _b(i,e),tr(i,o-8,n.d()),tr(i,o-4,r),i}function rN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Vl,Hk,function(){return[jm]}],(function(t){return Ps(jm(t.data[0]))}),3,n)}function jm(t,e){return zp(t.subarray(bb(t),-8),e||new jt(Jk(t)))}function Z4(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Xl,$k,function(){return[kb]}],(function(t){return Ps(kb(t.data[0],t.data[1]))}),4,n)}function kb(t,e){e||(e={});var n=mb();n.p(t);var r=Eu(t,e,2,4);return xb(r,e),tr(r,r.length-4,n.d()),r}function iN(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),Yl(t,e,[Vl,Kk,function(){return[qm]}],(function(t){return Ps(qm(t.data[0],vb(t.data[1])))}),5,n)}function qm(t,e){return zp((Zk(t),t.subarray(2,-4)),e)}function e6(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&Le(7),31==t[0]&&139==t[1]&&8==t[2]?rN(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ib(t,e,n):iN(t,e,n)}function t6(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?jm(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Hl(t,e):qm(t,e)}function Ss(t,e){if(e){for(var n=new jt(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(aN)return aN.encode(t);var i=t.length,o=new jt(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 jt(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 uo(o,0,s)}function Tb(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(Ob)return Ob.decode(t);var i=uN(t),o=i[0];return i[1].length&&Le(8),o}function s6(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Le(7);var r={};Nb(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){Gm((function(){n(t,e)}))}),"cbd");Gm((function(){f=n}));var d=l((function(){var t=new jt(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+Cs(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)}}Ab(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=Ul(),v=u.length;y.p(u);var m=Ss(e),_=m.length,b=g.comment,w=b&&Ss(b),x=w&&w.length,E=Cs(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]=qp(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(Le(11,0,1),null),I)if(v<16e4)try{S(null,Gp(u,g))}catch(t){S(t,null)}else h.push(eN(u,g,S));else S(null,u)}),"_loop_1"),y=0;y<u;++y)g(y);return p}function u6(t,e){e||(e={});var n={},r=[];Nb(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=Ss(s)).length,p=u.comment,f=p&&Ss(p),d=f&&f.length,g=Cs(u.extra);h>65535&&Le(11);var y=c?Gp(l,u):l,v=y.length,m=Ul();m.p(l),r.push(qp(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 jt(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+Cs(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 Ab(_,i,r.length,w,b),_}function p6(t,e,n){n||(n=e,e={}),"function"!=typeof n&&Le(7);var r=[],i=l((function(){for(var t=0;t<r.length;++t)r[t]()}),"tAll"),o={},s=l((function(t,e){Gm((function(){n(t,e)}))}),"cbd");Gm((function(){s=n}));for(var a=t.length-22;101010256!=$r(t,a);--a)if(!a||t.length-a>65558)return s(Le(13,0,1),null),i;var u=mi(t,a+8);if(u){var c=u,h=$r(t,a+16),p=4294967295==h;if(p){if(a=$r(t,a-12),101075792!=$r(t,a))return s(Le(13,0,1),null),i;c=u=$r(t,a+32),h=$r(t,a+48)}for(var f=e&&e.filter,d=l((function(e){var n=fN(t,h,p),a=n[0],c=n[1],d=n[2],g=n[3],y=n[4],v=n[5],m=cN(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,Hl(b,new jt(d)))}catch(t){_(t,null)}else r.push(Ib(b,{size:d},_))}else _(Le(14,"unknown compression type "+a,1),null);else _(null,uo(t,m,m+c));else _(null,null)}),"_loop_3"),g=0;g<c;++g)d(g)}else s(null,{});return i}function h6(t,e){for(var n={},r=t.length-22;101010256!=$r(t,r);--r)(!r||t.length-r>65558)&&Le(13);var i=mi(t,r+8);if(!i)return{};var o=$r(t,r+16),s=4294967295==o;s&&(r=$r(t,r-12),101075792!=$r(t,r)&&Le(13),i=$r(t,r+32),o=$r(t,r+48));for(var a=e&&e.filter,l=0;l<i;++l){var u=fN(t,o,s),c=u[0],h=u[1],p=u[2],f=u[3],d=u[4],g=u[5],y=cN(t,g);o=d,(!a||a({name:f,size:h,originalSize:p,compression:c}))&&(c?8==c?n[f]=Hl(t.subarray(y,y+h),new jt(p)):Le(14,"unknown compression type "+c):n[f]=uo(t,y,y+h))}return n}wO(dN,{AsyncCompress:()=>$4,AsyncDecompress:()=>Q4,AsyncDeflate:()=>Qk,AsyncGunzip:()=>tN,AsyncGzip:()=>$4,AsyncInflate:()=>Mb,AsyncUnzipInflate:()=>c6,AsyncUnzlib:()=>nN,AsyncZipDeflate:()=>o6,AsyncZlib:()=>J4,Compress:()=>Pb,DecodeUTF8:()=>r6,Decompress:()=>oN,Deflate:()=>fa,EncodeUTF8:()=>n6,FlateErrorCode:()=>W4,Gunzip:()=>Bm,Gzip:()=>Pb,Inflate:()=>Mi,Unzip:()=>f6,UnzipInflate:()=>l6,UnzipPassThrough:()=>hN,Unzlib:()=>zm,Zip:()=>a6,ZipDeflate:()=>i6,ZipPassThrough:()=>Up,Zlib:()=>Cb,compress:()=>K4,compressSync:()=>Sb,decompress:()=>e6,decompressSync:()=>t6,deflate:()=>eN,deflateSync:()=>Gp,gunzip:()=>rN,gunzipSync:()=>jm,gzip:()=>K4,gzipSync:()=>Sb,inflate:()=>Ib,inflateSync:()=>Hl,strFromU8:()=>Tb,strToU8:()=>Ss,unzip:()=>p6,unzipSync:()=>h6,unzlib:()=>iN,unzlibSync:()=>qm,zip:()=>s6,zipSync:()=>u6,zlib:()=>Z4,zlibSync:()=>kb});var Tk,Y4,jt,ri,Fl,Bl,jl,Fp,Ak,Lk,pb,Om,Rk,Dk,hb,Bp,Va,ao,Xa,zl,Qt,Fk,Bk,jk,zk,Tm,so,Am,jp,uo,W4,qk,Le,zp,ca,ql,Lm,Rm,db,Gl,Dm,gb,Gk,Ya,Uk,Vk,Ul,mb,Eu,qp,Xk,Fm,H4,Yk,Vl,Xl,Wk,Hk,$k,Kk,Ps,vb,Yl,lo,Wl,mi,$r,yb,tr,_b,bb,Jk,wb,xb,Zk,fa,Qk,Mi,Mb,Pb,$4,Bm,tN,Cb,J4,zm,nN,oN,Q4,Nb,aN,Ob,sN,uN,r6,n6,lN,cN,fN,pN,Cs,$l,Ab,Up,i6,o6,a6,hN,l6,c6,f6,Gm,gN=Iw((()=>{for(v(),Tk={},Y4=l((function(t,e,n,r,i){var o=new Worker(Tk[e]||(Tk[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"),jt=Uint8Array,ri=Uint16Array,Fl=Uint32Array,Bl=new jt([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]),jl=new jt([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]),Fp=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ak=l((function(t,e){for(var n=new ri(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Fl(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"),Lk=Ak(Bl,2),pb=Lk[0],Om=Lk[1],pb[28]=258,Om[258]=28,Rk=Ak(jl,0),Dk=Rk[0],hb=Rk[1],Bp=new ri(32768),Qt=0;Qt<32768;++Qt)Va=(61680&(Va=(52428&(Va=(43690&Qt)>>>1|(21845&Qt)<<1))>>>2|(13107&Va)<<2))>>>4|(3855&Va)<<4,Bp[Qt]=((65280&Va)>>>8|(255&Va)<<8)>>>1;for(ao=l((function(t,e,n){for(var r=t.length,i=0,o=new ri(e);i<r;++i)t[i]&&++o[t[i]-1];var s,a=new ri(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new ri(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[Bp[h]>>>l]=u}else for(s=new ri(r),i=0;i<r;++i)t[i]&&(s[i]=Bp[a[t[i]-1]++]>>>15-t[i]);return s}),"hMap"),Xa=new jt(288),Qt=0;Qt<144;++Qt)Xa[Qt]=8;for(Qt=144;Qt<256;++Qt)Xa[Qt]=9;for(Qt=256;Qt<280;++Qt)Xa[Qt]=7;for(Qt=280;Qt<288;++Qt)Xa[Qt]=8;for(zl=new jt(32),Qt=0;Qt<32;++Qt)zl[Qt]=5;Fk=ao(Xa,9,0),Bk=ao(Xa,9,1),jk=ao(zl,5,0),zk=ao(zl,5,1),Tm=l((function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e}),"max"),so=l((function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n}),"bits"),Am=l((function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)}),"bits16"),jp=l((function(t){return(t+7)/8|0}),"shft"),uo=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?ri:4==t.BYTES_PER_ELEMENT?Fl:jt)(n-e);return r.set(t.subarray(e,n)),r}),"slc"),W4={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},qk=["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"],Le=l((function(t,e,n){var r=new Error(e||qk[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Le),!n)throw r;return r}),"err"),zp=l((function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new jt(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new jt(3*r));var s=l((function(t){var n=e.length;if(t>n){var r=new jt(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=so(t,u,1);var y=so(t,u+1,3);if(u+=3,!y){var v=t[(C=jp(u)+4)-4]|t[C-3]<<8,m=C+v;if(m>r){o&&Le(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=Bk,p=zk,f=9,d=5;else if(2==y){var _=so(t,u,31)+257,b=so(t,u+10,15)+4,w=_+so(t,u+5,31)+1;u+=14;for(var x=new jt(w),E=new jt(19),I=0;I<b;++I)E[Fp[I]]=so(t,u+3*I,7);u+=3*b;var S=Tm(E),N=(1<<S)-1,M=ao(E,S,1);for(I=0;I<w;){var C,O=M[so(t,u,N)];if(u+=15&O,(C=O>>>4)<16)x[I++]=C;else{var P=0,L=0;for(16==C?(L=3+so(t,u,3),u+=2,P=x[I-1]):17==C?(L=3+so(t,u,7),u+=3):18==C&&(L=11+so(t,u,127),u+=7);L--;)x[I++]=P}}var A=x.subarray(0,_),T=x.subarray(_);f=Tm(A),d=Tm(T),h=ao(A,f,1),p=ao(T,d,1)}else Le(1);if(u>g){o&&Le(0);break}}i&&s(c+131072);for(var D=(1<<f)-1,R=(1<<d)-1,k=u;;k=u){var F=(P=h[Am(t,u)&D])>>>4;if((u+=15&P)>g){o&&Le(0);break}if(P||Le(2),F<256)e[c++]=F;else{if(256==F){k=u,h=null;break}var z=F-254;if(F>264){var j=Bl[I=F-257];z=so(t,u,(1<<j)-1)+pb[I],u+=j}var B=p[Am(t,u)&R],q=B>>>4;B||Le(3),u+=15&B;T=Dk[q];if(q>3){j=jl[q];T+=Am(t,u)&(1<<j)-1,u+=j}if(u>g){o&&Le(0);break}i&&s(c+131072);for(var G=c+z;c<G;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=G}}n.l=h,n.p=k,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:uo(e,0,c)}),"inflt"),ca=l((function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>>8}),"wbits"),ql=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"),Lm=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[Ya,0];if(1==i){var s=new jt(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 ri(p+1),d=Rm(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 jt(f),d]}),"hTree"),Rm=l((function(t,e,n){return-1==t.s?Math.max(Rm(t.l,e,n+1),Rm(t.r,e,n+1)):e[t.s]=n}),"ln"),db=l((function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ri(++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"),Gl=l((function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n}),"clen"),Dm=l((function(t,e,n){var r=n.length,i=jp(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"),gb=l((function(t,e,n,r,i,o,s,a,l,u,c){ca(e,c++,n),++i[256];for(var h=Lm(i,15),p=h[0],f=h[1],d=Lm(o,15),g=d[0],y=d[1],v=db(p),m=v[0],_=v[1],b=db(g),w=b[0],x=b[1],E=new ri(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=Lm(E,7),N=S[0],M=S[1],C=19;C>4&&!N[Fp[C-1]];--C);var O,P,L,A,T=u+5<<3,D=Gl(i,Xa)+Gl(o,zl)+s,R=Gl(i,p)+Gl(o,g)+s+14+3*C+Gl(E,N)+(2*E[16]+3*E[17]+7*E[18]);if(T<=D&&T<=R)return Dm(e,c,t.subarray(l,l+u));if(ca(e,c,1+(R<D)),c+=2,R<D){O=ao(p,f,0),P=p,L=ao(g,y,0),A=g;var k=ao(N,M,0);ca(e,c,_-257),ca(e,c+5,x-1),ca(e,c+10,C-4),c+=14;for(I=0;I<C;++I)ca(e,c+3*I,N[Fp[I]]);c+=3*C;for(var F=[m,w],z=0;z<2;++z){var j=F[z];for(I=0;I<j.length;++I){var B=31&j[I];ca(e,c,k[B]),c+=N[B],B>15&&(ca(e,c,j[I]>>>5&127),c+=j[I]>>>12)}}}else O=Fk,P=Xa,L=jk,A=zl;for(I=0;I<a;++I)if(r[I]>255){B=r[I]>>>18&31;ql(e,c,O[B+257]),c+=P[B+257],B>7&&(ca(e,c,r[I]>>>23&31),c+=Bl[B]);var q=31&r[I];ql(e,c,L[q]),c+=A[q],q>3&&(ql(e,c,r[I]>>>5&8191),c+=jl[q])}else ql(e,c,O[r[I]]),c+=P[r[I]];return ql(e,c,O[256]),c+P[256]}),"wblk"),Gk=new Fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ya=new jt(0),Uk=l((function(t,e,n,r,i,o){var s=t.length,a=new jt(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=Dm(u,c+1,t.subarray(h,p))}else{for(var f=Gk[e-1],d=f>>>13,g=8191&f,y=(1<<n)-1,v=new ri(32768),m=new ri(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 Fl(25e3),E=new ri(288),I=new ri(32),S=0,N=0,M=(h=0,0),C=0,O=0;h<s;++h){var P=w(h),L=32767&h,A=m[P];if(v[L]=A,m[P]=L,C<=h){var T=s-h;if((S>7e3||M>24576)&&T>423){c=gb(t,u,0,x,E,I,N,M,O,h-O,c),M=S=N=0,O=h;for(var D=0;D<286;++D)E[D]=0;for(D=0;D<30;++D)I[D]=0}var R=2,k=0,F=g,z=L-A&32767;if(T>2&&P==w(h-z))for(var j=Math.min(d,T)-1,B=Math.min(32767,h),q=Math.min(258,T);z<=B&&--F&&L!=A;){if(t[h+R]==t[h+R-z]){for(var G=0;G<q&&t[h+G]==t[h+G-z];++G);if(G>R){if(R=G,k=z,G>j)break;var U=Math.min(z,G-2),V=0;for(D=0;D<U;++D){var Y=h-z+D+32768&32767,X=Y-v[Y]+32768&32767;X>V&&(V=X,A=Y)}}}z+=(L=A)-(A=v[L])+32768&32767}if(k){x[M++]=268435456|Om[R]<<18|hb[k];var W=31&Om[R],H=31&hb[k];N+=Bl[W]+jl[H],++E[257+W],++I[H],C=h+R,++S}else x[M++]=t[h],++E[t[h]]}}c=gb(t,u,o,x,E,I,N,M,O,h-O,c),!o&&7&c&&(c=Dm(u,c+1,Ya))}return uo(a,0,r+jp(c)+i)}),"dflt"),Vk=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}(),Ul=l((function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=Vk[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}}),"crc"),mb=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"),Eu=l((function(t,e,n,r,i){return Uk(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"),qp=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"),Xk=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"),Fm=[],H4=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"),Yk=l((function(t,e,n,r){var i;if(!Fm[n]){for(var o="",s={},a=t.length-1,l=0;l<a;++l)o=(i=Xk(t[l],o,s))[0],s=i[1];Fm[n]=Xk(t[a],o,s)}var u=qp({},Fm[n][1]);return Y4(Fm[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,H4(u),r)}),"wrkr"),Vl=l((function(){return[jt,ri,Fl,Bl,jl,Fp,pb,Dk,Bk,zk,Bp,qk,ao,Tm,so,Am,jp,uo,Le,zp,Hl,Ps,vb]}),"bInflt"),Xl=l((function(){return[jt,ri,Fl,Bl,jl,Fp,Om,hb,Fk,Xa,jk,zl,Bp,Gk,Ya,ao,ca,ql,Lm,Rm,db,Gl,Dm,gb,jp,uo,Uk,Eu,Gp,Ps]}),"bDflt"),Wk=l((function(){return[_b,wb,tr,Ul,Vk]}),"gze"),Hk=l((function(){return[bb,Jk]}),"guze"),$k=l((function(){return[xb,tr,mb]}),"zle"),Kk=l((function(){return[Zk]}),"zule"),Ps=l((function(t){return postMessage(t,[t.buffer])}),"pbf"),vb=l((function(t){return t&&t.size&&new jt(t.size)}),"gu8"),Yl=l((function(t,e,n,r,i,o){var s=Yk(n,r,i,(function(t,e){s.terminate(),o(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}}),"cbify"),lo=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"),Wl=l((function(t,e,n,r,i){var o,s=Yk(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||Le(5),o&&e.ondata(Le(4,0,1),null,!!n),s.postMessage([t,o=n],[t.buffer])},e.terminate=function(){s.terminate()}}),"astrmify"),mi=l((function(t,e){return t[e]|t[e+1]<<8}),"b2"),$r=l((function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}),"b4"),yb=l((function(t,e){return $r(t,e)+4294967296*$r(t,e+4)}),"b8"),tr=l((function(t,e,n){for(;n;++e)t[e]=n,n>>>=8}),"wbytes"),_b=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&&tr(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"),bb=l((function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&Le(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"),Jk=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"),wb=l((function(t){return 10+(t.filename&&t.filename.length+1||0)}),"gzhl"),xb=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"),Zk=l((function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Le(6,"invalid zlib data"),32&t[1]&&Le(6,"invalid zlib data: preset dictionaries not supported")}),"zlv"),l(Eb,"AsyncCmpStrm"),fa=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(Eu(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||Le(5),this.d&&Le(4),this.d=e,this.p(t,e||!1)},t}(),Qk=function(){function t(t,e){Wl([Xl,function(){return[lo,fa]}],this,Eb.call(this,t,e),(function(t){var e=new fa(t.data);onmessage=lo(e)}),6)}return l(t,"AsyncDeflate"),t}(),l(eN,"deflate"),l(Gp,"deflateSync"),Mi=function(){function t(t){this.s={},this.p=new jt(0),this.ondata=t}return l(t,"Inflate"),t.prototype.e=function(t){this.ondata||Le(5),this.d&&Le(4);var e=this.p.length,n=new jt(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=zp(this.p,this.o,this.s);this.ondata(uo(n,e,this.s.b),this.d),this.o=uo(n,this.s.b-32768),this.s.b=this.o.length,this.p=uo(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),Mb=function(){function t(t){this.ondata=t,Wl([Vl,function(){return[lo,Mi]}],this,0,(function(){var t=new Mi;onmessage=lo(t)}),7)}return l(t,"AsyncInflate"),t}(),l(Ib,"inflate"),l(Hl,"inflateSync"),Pb=function(){function t(t,e){this.c=Ul(),this.l=0,this.v=1,fa.call(this,t,e)}return l(t,"Gzip"),t.prototype.push=function(t,e){fa.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var n=Eu(t,this.o,this.v&&wb(this.o),e&&8,!e);this.v&&(_b(n,this.o),this.v=0),e&&(tr(n,n.length-8,this.c.d()),tr(n,n.length-4,this.l)),this.ondata(n,e)},t}(),$4=function(){function t(t,e){Wl([Xl,Wk,function(){return[lo,fa,Pb]}],this,Eb.call(this,t,e),(function(t){var e=new Pb(t.data);onmessage=lo(e)}),8)}return l(t,"AsyncGzip"),t}(),l(K4,"gzip"),l(Sb,"gzipSync"),Bm=function(){function t(t){this.v=1,Mi.call(this,t)}return l(t,"Gunzip"),t.prototype.push=function(t,e){if(Mi.prototype.e.call(this,t),this.v){var n=this.p.length>3?bb(this.p):4;if(n>=this.p.length&&!e)return;this.p=this.p.subarray(n),this.v=0}e&&(this.p.length<8&&Le(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Mi.prototype.c.call(this,e)},t}(),tN=function(){function t(t){this.ondata=t,Wl([Vl,Hk,function(){return[lo,Mi,Bm]}],this,0,(function(){var t=new Bm;onmessage=lo(t)}),9)}return l(t,"AsyncGunzip"),t}(),l(rN,"gunzip"),l(jm,"gunzipSync"),Cb=function(){function t(t,e){this.c=mb(),this.v=1,fa.call(this,t,e)}return l(t,"Zlib"),t.prototype.push=function(t,e){fa.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var n=Eu(t,this.o,this.v&&2,e&&4,!e);this.v&&(xb(n,this.o),this.v=0),e&&tr(n,n.length-4,this.c.d()),this.ondata(n,e)},t}(),J4=function(){function t(t,e){Wl([Xl,$k,function(){return[lo,fa,Cb]}],this,Eb.call(this,t,e),(function(t){var e=new Cb(t.data);onmessage=lo(e)}),10)}return l(t,"AsyncZlib"),t}(),l(Z4,"zlib"),l(kb,"zlibSync"),zm=function(){function t(t){this.v=1,Mi.call(this,t)}return l(t,"Unzlib"),t.prototype.push=function(t,e){if(Mi.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&&Le(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Mi.prototype.c.call(this,e)},t}(),nN=function(){function t(t){this.ondata=t,Wl([Vl,Kk,function(){return[lo,Mi,zm]}],this,0,(function(){var t=new zm;onmessage=lo(t)}),11)}return l(t,"AsyncUnzlib"),t}(),l(iN,"unzlib"),l(qm,"unzlibSync"),oN=function(){function t(t){this.G=Bm,this.I=Mi,this.Z=zm,this.ondata=t}return l(t,"Decompress"),t.prototype.push=function(t,e){if(this.ondata||Le(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new jt(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}(),Q4=function(){function t(t){this.G=tN,this.I=Mb,this.Z=nN,this.ondata=t}return l(t,"AsyncDecompress"),t.prototype.push=function(t,e){oN.prototype.push.call(this,t,e)},t}(),l(e6,"decompress"),l(t6,"decompressSync"),Nb=l((function(t,e,n,r){for(var i in t){var o=t[i],s=e+i,a=r;Array.isArray(o)&&(a=qp(r,o[1]),o=o[0]),o instanceof jt?n[s]=[o,a]:(n[s+="/"]=[new jt(0),a],Nb(o,s,n,r))}}),"fltn"),aN="undefined"!=typeof TextEncoder&&new TextEncoder,Ob="undefined"!=typeof TextDecoder&&new TextDecoder,sN=0;try{Ob.decode(Ya,{stream:!0}),sN=1}catch(t){}uN=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,uo(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"),r6=function(){function t(t){this.ondata=t,sN?this.t=new TextDecoder:this.p=Ya}return l(t,"DecodeUTF8"),t.prototype.push=function(t,e){if(this.ondata||Le(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&Le(8),this.t=null));this.p||Le(4);var n=new jt(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=uN(n),i=r[0],o=r[1];e?(o.length&&Le(8),this.p=null):this.p=o,this.ondata(i,e)},t}(),n6=function(){function t(t){this.ondata=t}return l(t,"EncodeUTF8"),t.prototype.push=function(t,e){this.ondata||Le(5),this.d&&Le(4),this.ondata(Ss(t),this.d=e||!1)},t}(),l(Ss,"strToU8"),l(Tb,"strFromU8"),lN=l((function(t){return 1==t?3:t<6?2:9==t?1:0}),"dbf"),cN=l((function(t,e){return e+30+mi(t,e+26)+mi(t,e+28)}),"slzh"),fN=l((function(t,e,n){var r=mi(t,e+28),i=Tb(t.subarray(e+46,e+46+r),!(2048&mi(t,e+8))),o=e+46+r,s=$r(t,e+20),a=n&&4294967295==s?pN(t,o):[s,$r(t,e+24),$r(t,e+42)],l=a[0],u=a[1],c=a[2];return[mi(t,e+10),l,u,i,o+mi(t,e+30)+mi(t,e+32),c]}),"zh"),pN=l((function(t,e){for(;1!=mi(t,e);e+=4+mi(t,e+2));return[yb(t,e+12),yb(t,e+4),yb(t,e+20)]}),"z64e"),Cs=l((function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&Le(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=Cs(u);tr(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)&&Le(10),tr(t,e,f<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),e+=4,null!=o&&(tr(t,e,n.crc),tr(t,e+4,o),tr(t,e+8,n.size)),tr(t,e+12,l),tr(t,e+14,h),e+=16,null!=s&&(tr(t,e,c),tr(t,e+6,n.attrs),tr(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;tr(t,e,+d),tr(t,e+2,y),t.set(g,e+4),e+=4+y}return c&&(t.set(a,e),e+=c),e}),"wzh"),Ab=l((function(t,e,n,r,i){tr(t,e,101010256),tr(t,e+8,n),tr(t,e+10,n),tr(t,e+12,r),tr(t,e+16,i)}),"wzf"),Up=function(){function t(t){this.filename=t,this.c=Ul(),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||Le(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),i6=function(){function t(t,e){var n=this;e||(e={}),Up.call(this,t),this.d=new fa(e,(function(t,e){n.ondata(null,t,e)})),this.compression=8,this.flag=lN(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){Up.prototype.push.call(this,t,e)},t}(),o6=function(){function t(t,e){var n=this;e||(e={}),Up.call(this,t),this.d=new Qk(e,(function(t,e,r){n.ondata(t,e,r)})),this.compression=8,this.flag=lN(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){Up.prototype.push.call(this,t,e)},t}(),a6=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||Le(5),2&this.d)this.ondata(Le(4+8*(1&this.d),0,1),null,!1);else{var n=Ss(t.filename),r=n.length,i=t.comment,o=i&&Ss(i),s=r!=t.filename.length||o&&i.length!=o.length,a=r+Cs(t.extra)+30;r>65535&&this.ondata(Le(11,0,1),null,!1);var u=new jt(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=qp(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 jt(16);tr(o,0,134695760),tr(o,4,t.crc),tr(o,8,g),tr(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(Le(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+Cs(l.extra)+(l.o?l.o.length:0)}for(var o=new jt(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+Cs(l.extra)+(l.o?l.o.length:0),e+=l.b}Ab(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(s6,"zip"),l(u6,"zipSync"),hN=function(){function t(){}return l(t,"UnzipPassThrough"),t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),l6=function(){function t(){var t=this;this.i=new Mi((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}(),c6=function(){function t(t,e){var n=this;e<32e4?this.i=new Mi((function(t,e){n.ondata(null,t,e)})):(this.i=new Mb((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=uo(t,0)),this.i.push(t,e)},t.compression=8,t}(),f6=function(){function t(t){this.onfile=t,this.k=[],this.o={0:hN},this.p=Ya}return l(t,"Unzip"),t.prototype.push=function(t,e){var n=this;if(this.onfile||Le(5),this.p||Le(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 jt(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=$r(u,s);if(67324752==e){o=1,a=s,d.d=null,d.c=0;var r=mi(u,s+6),i=mi(u,s+8),l=2048&r,p=8&r,f=mi(u,s+26),g=mi(u,s+28);if(c>s+30+f+g){var y=[];d.k.unshift(y),o=2;var v=$r(u,s+18),m=$r(u,s+22),_=Tb(u.subarray(s+30,s+=30+f),!l);4294967295==v?(t=p?[-2]:pN(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||Le(5),v){var t=n.o[i];t||w.ondata(Le(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(Ya,!0)}else w.ondata(null,Ya,!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=Ya,h<0){var g=o?u.subarray(0,a-12-(-2==h&&8)-(134695760==$r(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&&Le(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),Gm="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()},l(p6,"unzip"),l(h6,"unzipSync")})),wN=ue(((t,e)=>{v(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),PN=ue(((t,e)=>{v();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(t){}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(i){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(t){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(e){return a(t)}}})),CN=ue(((t,e)=>{v(),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)]}})),NN=ue(((t,e)=>{v(),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}})),BN=ue((t=>{v();var e=wN(),n=PN(),r=CN(),i=NN(),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 y(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 Boolean(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(y,"extract"),l(m,"parseValue"),l(_,"parse"),t.extract=y,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:_(y(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=`?${l}`);let u=g(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?h(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${l}${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)}}));v();var rO=Zt(Sw());v(),v(),v();var Nx=Zt(Cx());v();var Gv=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:r=0,distance:i=0,angle:o=0}){let s,a;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,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,a=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=r*a+s):(s=e.weight&&e.weight>=0?e.weight:0,a=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*a+s),isNaN(this.angle))throw new Error("nan angle")}};l(Gv,"Edge");var hd=Gv;v();var Xs,kx="mi-debug";!function(t){t[t.LOG=0]="LOG",t[t.WARN=1]="WARN",t[t.ERROR=2]="ERROR",t[t.SILENT=3]="SILENT"}(Xs||(Xs={}));var t2={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)}},Me=t2;function r2(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${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,Nx.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 Me.error(t),1}}function n2(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(r2,"getMapScale"),l(n2,"getAngle");var Uv=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:r2(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})=>{let n=this.nodesById[e];return new hd({angle:n2(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),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 hd({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new hd({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let r=t.map((t=>this.nodesById[t])).filter((t=>t)),i=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===r.length||0===i.length)return[];let o=[],s={},a={};for(r.forEach((t=>{let e=this.getShortestEuclideanDistance(t,i);o.push({origin:t,priority:e}),s[t.id]=null,a[t.id]=0})),o.sort(((t,e)=>t.priority-e.priority));o.length>0;){let t=o[0];if(i.includes(t.origin)){let e=[],n=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let r=e.vortex&&!1===e.vortex.accessible;if(n&&(r||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=a[t.origin.id]+e.weight;if(null==a[e.destination.id]||l<a[e.destination.id]){a[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,i);o.push({origin:e.destination,priority:t}),s[e.destination.id]=e}}o.splice(0,1),o.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(Uv,"NavigationGraph");var rn,xi,cs,Vv=Uv;function i2(t){switch(t){case cs.DOWN:case cs.UP:return`${t} `;default:return""}}v(),v(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(rn||(rn={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(xi||(xi={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(cs||(cs={})),l(i2,"vortexDirectionTest");var Xv=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&&e.type===rn.DEPARTURE?this.instruction=null!=r?`Depart from ${r.name}`:"Depart from current location":null!=e&&e.type===rn.ARRIVAL?this.instruction=null!=r?`Arrive at ${r.name}`:"Arrive at destination":null!=e&&e.type===rn.TAKEVORTEX?this.instruction=`Take ${r&&r.name} ${i2(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===rn.EXITVORTEX?this.instruction=`Exit ${r&&r.name} at ${e.toMap.name}`:null!=e&&e.bearing===xi.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===xi.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===xi.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===xi.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===xi.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===rn.TURN&&r&&(this.instruction+=` at ${r.name}`))}};l(Xv,"Directive");var dd,fs=Xv;(dd||(dd={})).NO_VALID_PATH="No Valid Path Available";var gd=.1*Math.PI;function md(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}l(md,"differenceBetweenAngles");var Yv=class{constructor({locations:t,nodes:e,vortexes:n,maps:r,showVortexNames:i}){D(this,"graph"),D(this,"locationsByNodeId"),this.graph=new Vv({maps:r,nodes:e,showVortexNames:i,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)),{})}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=-md(o.angle,e.angle);Math.abs(t)<Math.abs(a)&&(s=e,a=t)}else s=e,a=-md(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}){let o=this.graph.aStar(t,e,n);if(0===o.length)return{distance:0,instructions:[new fs({distance:0,instruction:dd.NO_VALID_PATH})],path:[]};let s=0,a=new Array(o.length+1);for(let t=0;t<o.length;t++)a[t]=o[t].origin;a[o.length]=o[o.length-1].destination;let l=[],u=null,c=null,h=0,p=0;for(let t=0;t<o.length;t++){let e=o[t],n=e.origin,a=e.destination;if(s+=e.distance,h+=(null==c?void 0:c.distance)||0,0===t&&l.push(new fs({action:{type:rn.DEPARTURE},atLocation:r,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],r=this.graph.mapsById[a.map],i=cs.NONE;if(null!=t.elevation&&null!=r.elevation){let e=t.elevation-r.elevation;e>0?i=cs.DOWN:e<0&&(i=cs.UP)}l.push(new fs({action:{direction:i,fromMap:t,toMap:r,type:rn.TAKEVORTEX},atLocation:e.vortex,distance:h,origin:n})),p+=h,h=0}else if(null!=u&&null!=c)if(null!=c.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[c.destination.map];l.push(new fs({action:{fromMap:t,toMap:e,type:rn.EXITVORTEX},atLocation:c.vortex,distance:h,origin:n})),p+=h,h=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let r=-md(c.angle,e.angle),i=t.reduce(((t,n)=>{let r=-md(e.angle,n.angle);return Math.min(t,Math.abs(r))}),Math.PI);if(Math.abs(r)>=gd||Math.abs(i)<=gd){let t;t=r<=-Math.PI/4?xi.RIGHT:r<=-gd?xi.SLIGHTRIGHT:r<=gd?xi.STRAIGHT:r<=Math.PI/4?xi.SLIGHTLEFT:xi.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(c,.5*Math.PI,10)),null!=e){let r=new fs({action:{bearing:t,referencePosition:"At",type:rn.TURN},atLocation:e,distance:h,origin:n});r.type=t,l.push(r)}else l.push(new fs({action:{bearing:t,referencePosition:"At",type:rn.TURN},distance:h,origin:n}));p+=h,h=0}}}t===o.length-1&&(l.push(new fs({action:{type:rn.ARRIVAL},atLocation:i,distance:s-p<0?0:s-p,origin:e.destination})),p+=h,h=0),u=n,c=e}let f=[],d=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===rn.TAKEVORTEX?(d=e.node,f.unshift(e)):n&&n.type===rn.TURN&&null!=d?this.graph.getDistance(e.node,d)>5&&f.unshift(e):f.unshift(e)}return{distance:s,instructions:f,path:a}}};l(Yv,"Navigator");var Wv=Yv;function Hv(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Ox(this.cover(e,n),e,n,t)}function Ox(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 Tx(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)Ox(this,s[n],a[n],t[n]);return this}function $v(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 Kv(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function Jv(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 hn(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Zv(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 hn(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 hn(g[3],y,v,s,a),new hn(g[2],i,v,y,a),new hn(g[1],y,o,s,v),new hn(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 Qv(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 Ax(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ey(){return this._root}function ty(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function ry(t){var e,n,r,i,o,s,a=[],l=this._root;for(l&&a.push(new hn(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 hn(n,u,c,o,s)),(n=l[2])&&a.push(new hn(n,r,c,u,s)),(n=l[1])&&a.push(new hn(n,u,i,o,c)),(n=l[0])&&a.push(new hn(n,r,i,u,c))}return this}function ny(t){var e,n=[],r=[];for(this._root&&n.push(new hn(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 hn(o,s,a,c,h)),(o=i[1])&&n.push(new hn(o,c,a,l,h)),(o=i[2])&&n.push(new hn(o,s,h,c,u)),(o=i[3])&&n.push(new hn(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 Lx(t){return t[0]}function iy(t){return arguments.length?(this._x=t,this):this._x}function Rx(t){return t[1]}function oy(t){return arguments.length?(this._y=t,this):this._y}function Rc(t,e,n){var r=new ay(null==e?Lx:e,null==n?Rx:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ay(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 Dx(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}v(),v(),v(),v(),l(Hv,"default"),l(Ox,"add"),l(Tx,"addAll"),v(),l($v,"default"),v(),l(Kv,"default"),v(),l(Jv,"default"),v(),v(),l(hn,"default"),l(Zv,"default"),v(),l(Qv,"default"),l(Ax,"removeAll"),v(),l(ey,"default"),v(),l(ty,"default"),v(),l(ry,"default"),v(),l(ny,"default"),v(),l(Lx,"defaultX"),l(iy,"default"),v(),l(Rx,"defaultY"),l(oy,"default"),l(Rc,"quadtree"),l(ay,"Quadtree"),l(Dx,"leaf_copy");var li=Rc.prototype=ay.prototype;li.copy=function(){var t,e,n=new ay(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=Dx(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]=Dx(e));return n},li.add=Hv,li.addAll=Tx,li.cover=$v,li.data=Kv,li.extent=Jv,li.find=Zv,li.remove=Qv,li.removeAll=Ax,li.root=ey,li.size=ty,li.visit=ry,li.visitAfter=ny,li.x=iy,li.y=oy;var Wo,nn,Ys=class{constructor(t){oe(this,Wo,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"),oe(this,nn,{}),le(this,Wo,t)}get polygonsByMapId(){if(z(this,nn).polygonsByMapId)return z(this,nn).polygonsByMapId;let t,e={};for(let n=0,r=z(this,Wo).polygons.length;n<r;++n)t=z(this,Wo).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 z(this,nn).polygonsByMapId=n,z(this,nn).polygonsByMapId}get nodesByMapId(){if(z(this,nn).nodesByMapId)return z(this,nn).nodesByMapId;let t,e={};for(let n=0,r=z(this,Wo).nodes.length;n<r;++n)t=z(this,Wo).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 z(this,nn).nodesByMapId=n,z(this,nn).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(z(this,nn).nodeTreesByMap||(z(this,nn).nodeTreesByMap=new Map),!z(this,nn).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],r=Rc();r.x((t=>t.x)),r.y((t=>t.y)),r.addAll(e),z(this,nn).nodeTreesByMap.set(t,r)}return z(this,nn).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(z(this,nn).locationsByMapId)return z(this,nn).locationsByMapId;let t,e={};for(let n=0,r=z(this,Wo).locations.length;n<r;++n){t=z(this,Wo).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]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return z(this,nn).locationsByMapId=n,z(this,nn).locationsByMapId}static create(t){return Ys.instances.has(t)||Ys.instances.set(t,new Ys(t)),Ys.instances.get(t)}static clear(){Ys.instances.clear()}},vd=Ys;l(vd,"MappedinCache"),Wo=new WeakMap,nn=new WeakMap,D(vd,"instances",new Map);var Ri=vd;v(),v(),v(),v();var Fx=" ",Zn=class{static get separator(){return Fx}static set separator(t){Fx=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(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let r=null,i=null,o=null,s=null;switch(e){default:case"d":case"deg":i=t.toFixed(n),i<100&&(i="0"+i),i<10&&(i="0"+i),r=i+"°";break;case"dm":case"deg+min":i=Math.floor(t),o=(60*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),i=("000"+i).slice(-3),o<10&&(o="0"+o),r=i+"°"+Zn.separator+o+"′";break;case"dms":case"deg+min+sec":i=Math.floor(t),o=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),o++),60==o&&(o=0,i++),i=("000"+i).slice(-3),o=("00"+o).slice(-2),s<10&&(s="0"+s),r=i+"°"+Zn.separator+o+"′"+Zn.separator+s+"″"}return r}static toLat(t,e,n){let r=Zn.toDms(Zn.wrap90(t),e,n);return null===r?"–":r.slice(1)+Zn.separator+(t<0?"S":"N")}static toLon(t,e,n){let r=Zn.toDms(Zn.wrap180(t),e,n);return null===r?"–":r+Zn.separator+(t<0?"W":"E")}static toBrng(t,e,n){let r=Zn.toDms(Zn.wrap360(t),e,n);return null===r?"–":r.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(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=Zn.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}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(Zn,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var kt=Zn,kr=Math.PI,Ae=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=kt.wrap90(Number(t)),this._lon=kt.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?kt.wrap90(kt.parse(t)):kt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?kt.wrap90(kt.parse(t)):kt.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?kt.wrap180(kt.parse(t)):kt.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[n,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(n=r.longitude),null!=r.lng&&(n=r.lng),null!=r.lon&&(n=r.lon),e=kt.wrap90(kt.parse(e)),n=kt.wrap180(kt.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new Ae(e,n)}distanceTo(t,e=6371e3){if(t instanceof Ae||(t=Ae.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,r=this.lat.toRadians(),i=this.lon.toRadians(),o=t.lat.toRadians(),s=o-r,a=t.lon.toRadians()-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(o)*Math.sin(a/2)*Math.sin(a/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r),o=Math.sin(r)*Math.cos(n),s=Math.atan2(o,i).toDegrees();return kt.wrap360(s)}finalBearingTo(t){t instanceof Ae||(t=Ae.parse(t));let e=t.initialBearingTo(this)+180;return kt.wrap360(e)}midpointTo(t){t instanceof Ae||(t=Ae.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),o=Math.cos(e),s=0,a=Math.sin(e),l={x:o+Math.cos(r)*Math.cos(i),y:s+Math.cos(r)*Math.sin(i),z:a+Math.sin(r)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=n+Math.atan2(l.y,l.x),h=u.toDegrees(),p=c.toDegrees();return new Ae(h,p)}intermediatePointTo(t,e){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return new Ae(this.lat,this.lon);let n=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),s=i-n,a=o-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(i)*Math.sin(a/2)*Math.sin(a/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*u)/Math.sin(u),h=Math.sin(e*u)/Math.sin(u),p=c*Math.cos(n)*Math.cos(r)+h*Math.cos(i)*Math.cos(o),f=c*Math.cos(n)*Math.sin(r)+h*Math.cos(i)*Math.sin(o),d=c*Math.sin(n)+h*Math.sin(i),g=Math.atan2(d,Math.sqrt(p*p+f*f)),y=Math.atan2(f,p),v=g.toDegrees(),m=y.toDegrees();return new Ae(v,m)}destinationPoint(t,e,n=6371e3){let r=t/n,i=Number(e).toRadians(),o=this.lat.toRadians(),s=this.lon.toRadians(),a=Math.sin(o)*Math.cos(r)+Math.cos(o)*Math.sin(r)*Math.cos(i),l=Math.asin(a),u=Math.sin(i)*Math.sin(r)*Math.cos(o),c=Math.cos(r)-Math.sin(o)*a,h=s+Math.atan2(u,c),p=l.toDegrees(),f=h.toDegrees();return new Ae(p,f)}static intersection(t,e,n,r){if(t instanceof Ae||(t=Ae.parse(t)),n instanceof Ae||(n=Ae.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);let i=t.lat.toRadians(),o=t.lon.toRadians(),s=n.lat.toRadians(),a=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(r).toRadians(),c=s-i,h=a-o,p=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(s)*Math.sin(h/2)*Math.sin(h/2)));if(Math.abs(p)<Number.EPSILON)return new Ae(t.lat,t.lon);let f=(Math.sin(s)-Math.sin(i)*Math.cos(p))/(Math.sin(p)*Math.cos(i)),d=(Math.sin(i)-Math.sin(s)*Math.cos(p))/(Math.sin(p)*Math.cos(s)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(d,-1),1)),v=l-(Math.sin(a-o)>0?g:2*kr-g),m=(Math.sin(a-o)>0?2*kr-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let _=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(p),b=Math.atan2(Math.sin(p)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*_),w=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(b)+Math.cos(i)*Math.sin(b)*Math.cos(l),-1),1)),x=o+Math.atan2(Math.sin(l)*Math.sin(b)*Math.cos(i),Math.cos(b)-Math.sin(i)*Math.sin(w)),E=w.toDegrees(),I=x.toDegrees();return new Ae(E,I)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof Ae||(t=Ae.parse(t)),e instanceof Ae||(e=Ae.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,o=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(i)*Math.sin(o-s))*r}alongTrackDistanceTo(t,e,n=6371e3){t instanceof Ae||(t=Ae.parse(t)),e instanceof Ae||(e=Ae.parse(e));let r=n;if(this.equals(t))return 0;let i=t.distanceTo(this,r)/r,o=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),a=Math.asin(Math.sin(i)*Math.sin(o-s));return Math.acos(Math.cos(i)/Math.abs(Math.cos(a)))*Math.sign(Math.cos(s-o))*r}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:kt.wrap180(d),lon2:kt.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof Ae||(t=Ae.parse(t));let n=e,r=this.lat.toRadians(),i=t.lat.toRadians(),o=i-r,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>kr&&(s=s>0?-(2*kr-s):2*kr+s);let a=Math.log(Math.tan(i/2+kr/4)/Math.tan(r/2+kr/4)),l=Math.abs(a)>1e-11?o/a:Math.cos(r);return Math.sqrt(o*o+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof Ae||(t=Ae.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();Math.abs(r)>kr&&(r=r>0?-(2*kr-r):2*kr+r);let i=Math.log(Math.tan(n/2+kr/4)/Math.tan(e/2+kr/4)),o=Math.atan2(r,i).toDegrees();return kt.wrap360(o)}rhumbDestinationPoint(t,e,n=6371e3){let r=this.lat.toRadians(),i=this.lon.toRadians(),o=Number(e).toRadians(),s=t/n,a=s*Math.cos(o),l=r+a;Math.abs(l)>kr/2&&(l=l>0?kr-l:-kr-l);let u=Math.log(Math.tan(l/2+kr/4)/Math.tan(r/2+kr/4)),c=Math.abs(u)>1e-11?a/u:Math.cos(r),h=i+s*Math.sin(o)/c,p=l.toDegrees(),f=h.toDegrees();return new Ae(p,f)}rhumbMidpointTo(t){t instanceof Ae||(t=Ae.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians();Math.abs(i-n)>kr&&(n+=2*kr);let o=(e+r)/2,s=Math.tan(kr/4+e/2),a=Math.tan(kr/4+r/2),l=Math.tan(kr/4+o/2),u=((i-n)*Math.log(l)+n*Math.log(a)-i*Math.log(s))/Math.log(a/s);isFinite(u)||(u=(n+i)/2);let c=o.toDegrees(),h=u.toDegrees();return new Ae(c,h)}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*kr);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(t){return t instanceof Ae||(t=Ae.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.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 ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${kt.toLat(this.lat,t,e)}, ${kt.toLon(this.lon,t,e)}`}};l(Ae,"LatLonSpherical"),v(),v(),v();var Co=class{constructor(t){D(this,"destinations",[]),this.destinations=t}};l(Co,"MappedinDestinationSet"),v();var Dc,Pa,Gu=class{constructor(t,e){oe(this,Dc,void 0),oe(this,Pa,void 0),D(this,"distance",0),D(this,"path",[]),D(this,"instructions",[]),le(this,Pa,t),le(this,Dc,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)?void 0:e.id)?null==(r=null==(n=z(this,Pa))?void 0:n._vortexesById)?void 0:r[t.atLocation.id]:void 0,node:(null==(i=t.node)?void 0:i.id)?null==(s=null==(o=z(this,Pa))?void 0:o._nodesById)?void 0:s[t.node.id]:void 0};if((null==(a=f.action)?void 0:a.type)===rn.TAKEVORTEX||(null==(l=f.action)?void 0:l.type)===rn.EXITVORTEX){let t=null==(c=z(this,Pa)._mapsById)?void 0:c[null==(u=f.action)?void 0:u.fromMap.id],e=null==(p=z(this,Pa)._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=z(this,Pa))?void 0:n._nodesById)?void 0:r[e];return i&&t.push(i),t}),[])}toJSON(){return z(this,Dc)}};l(Gu,"MappedinDirections"),Dc=new WeakMap,Pa=new WeakMap;var Ca,Sa=class{constructor(t){oe(this,Ca,void 0),le(this,Ca,t)}directionsTo(t,e){let n=z(this,Ca).analytics;if(t instanceof Co){if(0===t.destinations.length)return[];n.getDirections(this,t.destinations[t.destinations.length-1]);let r,i=[],o=Fc(this);for(let n=0;n<t.destinations.length;n++){r=Fc(t.destinations[n]);let s=z(this,Ca).navigator.getDirections({originIds:o,destinationNodeIds:r,accessible:(null==e?void 0:e.accessible)||!1}),a=new Gu(z(this,Ca),s);i.push(a),o=0===a.path.length?r:[a.path[a.path.length-1].id]}return i}{n.getDirections(this,t);let r=Fc(this),i=Fc(t),o=z(this,Ca).navigator.getDirections({originIds:r,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new Gu(z(this,Ca),o)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};l(Sa,"MappedinNavigatable"),Ca=new WeakMap,v(),v(),v(),v();var ps,Nn,ka,hs,ci,Ei,Nr,Vu,aE=Zt(oE()),{__extends:Ho,__assign:Pe,__rest:Bc,__decorate:d8,__param:g8,__metadata:m8,__awaiter:Ce,__generator:ke,__exportStar:v8,__createBinding:y8,__values:to,__read:dn,__spread:_8,__spreadArrays:b8,__spreadArray:ko,__await:w8,__asyncGenerator:x8,__asyncDelegator:E8,__asyncValues:M8,__makeTemplateObject:I8,__importStar:P8,__importDefault:S8,__classPrivateFieldGet:C8,__classPrivateFieldSet:k8,__classPrivateFieldIn:N8}=aE.default;v(),v(),v(),v(),v(),function(t){t.US="US",t.EU="EU"}(ps||(ps={})),v(),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"}(Nn||(Nn={})),function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"}(ka||(ka={})),function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"}(hs||(hs={})),v(),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"}(ci||(ci={})),v(),function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(Ei||(Ei={})),v(),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"}(Nr||(Nr={})),v(),function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(Vu||(Vu={})),v(),v();var uy="-",jc="AMP",sE="".concat(jc,"_unsent"),ly="https://api2.amplitude.com/2/httpapi",uE="https://api.eu.amplitude.com/2/httpapi",lE="https://api2.amplitude.com/batch",cE="https://api.eu.amplitude.com/batch";v();var o2=1e3,wd=l((function(t){if(Object.keys(t).length>o2)return!1;for(var e in t){var n=t[e];if(!cy(e,n))return!1}return!0}),"isValidObject"),cy=l((function(t,e){var n,r;if("string"!=typeof t)return!1;if(Array.isArray(e)){var i=!0;try{for(var o=to(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&&wd(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 wd(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0}),"isValidProperties"),No=function(){function t(){this._propertySet=new Set,this._properties={}}return l(t,"Identify"),t.prototype.getUserProperties=function(){return Pe({},this._properties)},t.prototype.set=function(t,e){return this._safeSet(Nn.SET,t,e),this},t.prototype.setOnce=function(t,e){return this._safeSet(Nn.SET_ONCE,t,e),this},t.prototype.append=function(t,e){return this._safeSet(Nn.APPEND,t,e),this},t.prototype.prepend=function(t,e){return this._safeSet(Nn.PREPEND,t,e),this},t.prototype.postInsert=function(t,e){return this._safeSet(Nn.POSTINSERT,t,e),this},t.prototype.preInsert=function(t,e){return this._safeSet(Nn.PREINSERT,t,e),this},t.prototype.remove=function(t,e){return this._safeSet(Nn.REMOVE,t,e),this},t.prototype.add=function(t,e){return this._safeSet(Nn.ADD,t,e),this},t.prototype.unset=function(t){return this._safeSet(Nn.UNSET,t,uy),this},t.prototype.clearAll=function(){return this._properties={},this._properties[Nn.CLEAR_ALL]=uy,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[Nn.CLEAR_ALL]&&!this._propertySet.has(e)&&(t===Nn.ADD?"number"==typeof n:t===Nn.UNSET||t===Nn.REMOVE||cy(e,n))},t}(),fE=l((function(t,e,n){return Pe(Pe(Pe({},"string"==typeof t?{event_type:t}:t),n),e&&{event_properties:e})}),"createTrackEvent"),zc=l((function(t,e){return Pe(Pe({},e),{event_type:hs.IDENTIFY,user_properties:t.getUserProperties()})}),"createIdentifyEvent"),pE=l((function(t,e,n,r){var i;return Pe(Pe({},r),{event_type:hs.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)})}),"createGroupIdentifyEvent"),hE=l((function(t,e,n){var r,i=new No;return i.set(t,e),Pe(Pe({},n),{event_type:hs.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)})}),"createGroupEvent"),dE=l((function(t,e){return Pe(Pe({},e),{event_type:hs.REVENUE,event_properties:t.getEventProperties()})}),"createRevenueEvent");v(),v();var ds=l((function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=Nr.Unknown),{event:t,code:e,message:n}}),"buildResult"),gE=function(){function t(){this.queue=[],this.applying=!1,this.plugins=[]}return l(t,"Timeline"),t.prototype.register=function(t,e){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(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 ke(this,(function(_){switch(_.label){case 0:if(!t)return[2];e=dn(t,1),n=e[0],r=dn(t,2),i=r[1],o=this.plugins.filter((function(t){return t.type===Ei.BEFORE})),_.label=1;case 1:_.trys.push([1,6,7,8]),s=to(o),a=s.next(),_.label=2;case 2:return a.done?[3,5]:[4,a.value.execute(Pe({},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===Ei.ENRICHMENT})),_.label=9;case 9:_.trys.push([9,14,15,16]),c=to(u),h=c.next(),_.label=10;case 10:return h.done?[3,13]:[4,h.value.execute(Pe({},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===Ei.DESTINATION})),d=f.map((function(t){var e=Pe({},n);return t.execute(e).catch((function(t){return ds(e,0,String(t))}))})),Promise.all(d).then((function(t){var e=dn(t,1)[0];i(e)})),[2]}}))}))},t.prototype.flush=function(){return Ce(this,void 0,void 0,(function(){var t,e,n,r=this;return ke(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===Ei.DESTINATION})),n=e.map((function(t){return t.flush&&t.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},t}();v();var mE="Event tracked successfully",vE="Unexpected error occurred",yE="Event rejected due to exceeded retry count",_E="Event skipped due to optOut config",bE="Event rejected due to missing API key",wE="Invalid API key",xE="Client not initialized",fy=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 gE,this.name=t}return l(t,"AmplitudeCore"),t.prototype._init=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){var e,n,r,i,o,s;return ke(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=to(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=fE(t,e,n);return this.dispatch(r)},t.prototype.identify=function(t,e){var n=zc(t,e);return this.dispatch(n)},t.prototype.groupIdentify=function(t,e,n,r){var i=pE(t,e,n,r);return this.dispatch(i)},t.prototype.setGroup=function(t,e,n){var r=hE(t,e,n);return this.dispatch(r)},t.prototype.revenue=function(t,e){var n=dE(t,e);return this.dispatch(n)},t.prototype.add=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(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(ds(t,0,xE));this.process(t).then(e)},t.prototype.dispatch=function(t){return Ce(this,void 0,void 0,(function(){var e=this;return ke(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 Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,ds(t,0,_E)]:[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=ds(t,0,n)];case 3:return[2]}}))}))},t.prototype.setOptOut=function(t){this.config?this.config.optOut=Boolean(t):this.q.push(this.setOptOut.bind(this,Boolean(t)))},t.prototype.flush=function(){return this.timeline.flush()},t}();v();var xd=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 wd(t)&&(this.properties=t),this},t.prototype.getEventProperties=function(){var t=this.properties?Pe({},this.properties):{};return t[ka.REVENUE_PRODUCT_ID]=this.productId,t[ka.REVENUE_QUANTITY]=this.quantity,t[ka.REVENUE_PRICE]=this.price,t[ka.REVENUE_TYPE]=this.revenueType,t[ka.REVENUE]=this.revenue,t},t}();v(),v();var EE=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");v(),v();var Ed="Amplitude Logger ",ME=function(){function t(){this.logLevel=ci.None}return l(t,"Logger"),t.prototype.disable=function(){this.logLevel=ci.None},t.prototype.enable=function(t){void 0===t&&(t=ci.Warn),this.logLevel=t},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<ci.Verbose||console.log("".concat(Ed,"[Log]: ").concat(t.join(" ")))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<ci.Warn||console.warn("".concat(Ed,"[Warn]: ").concat(t.join(" ")))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<ci.Error||console.error("".concat(Ed,"[Error]: ").concat(t.join(" ")))},t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logLevel<ci.Debug||console.log("".concat(Ed,"[Debug]: ").concat(t.join(" ")))},t}(),Md=l((function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:ci.Warn,loggerProvider:new ME,optOut:!1,serverUrl:ly,serverZone:ps.US,useBatch:!1}}),"getDefaultConfig"),py=function(){function t(t){var e,n,r;this._optOut=!1;var i=Md();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=hy(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}(),a2=l((function(t,e){return t===ps.EU?e?cE:uE:e?lE:ly}),"getServerUrl"),hy=l((function(t,e,n){if(void 0===t&&(t=""),void 0===e&&(e=Md().serverZone),void 0===n&&(n=Md().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=[ps.US,ps.EU].includes(e)?e:Md().serverZone;return{serverZone:r,serverUrl:a2(r,n)}}),"createServerConfig"),dy=function(){function t(){this.name="amplitude",this.type=Ei.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 Ce(this,void 0,void 0,(function(){var n,r=this;return ke(this,(function(i){switch(i.label){case 0:return this.config=t,this.storageKey="".concat(sE,"_").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,yE),!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),Ce(this,void 0,void 0,(function(){var e,n,r,i=this;return ke(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=EE(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),Ce(this,void 0,void 0,(function(){var n,r,i,o,s;return ke(this,(function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,bE)];n={api_key:this.config.apiKey,events:t.map((function(t){var e=t.event;e.extra;return Bc(e,["extra"])})),options:{min_id_length:this.config.minIdLength}},a.label=1;case 1:return a.trys.push([1,3,,4]),r=hy(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,vE),[2];if(!e){if("body"in i){o="";try{o=JSON.stringify(i.body,null,2)}catch(t){}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 Nr.Success:this.handleSuccessResponse(t,e);break;case Nr.Invalid:this.handleInvalidResponse(t,e);break;case Nr.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,e);break;case Nr.RateLimit:this.handleRateLimitResponse(t,e);break;default:this.handleOtherReponse(e)}},t.prototype.handleSuccessResponse=function(t,e){this.fulfillRequest(e,t.statusCode,mE)},t.prototype.handleInvalidResponse=function(t,e){var n=this;if(t.body.missingField||t.body.error.startsWith(wE))this.fulfillRequest(e,t.statusCode,t.body.error);else{var r=ko(ko(ko(ko([],dn(Object.values(t.body.eventsWithInvalidFields)),!1),dn(Object.values(t.body.eventsWithMissingFields)),!1),dn(Object.values(t.body.eventsWithInvalidIdLengths)),!1),dn(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,ko([],dn(o),!1))}},t.prototype.handlePayloadTooLargeResponse=function(t,e){1!==e.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,ko([],dn(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,ko([],dn(u),!1))},t.prototype.handleOtherReponse=function(t){var e=this;this.addToQueue.apply(this,ko([],dn(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(ds(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}();v();var ro=l((function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return{promise:t.apply(void 0,ko([],dn(e),!1))}}}),"returnWrapper");v();var s2=l((function(t){return void 0===t&&(t=0),((new Error).stack||"").split("\n").slice(2+t).map((function(t){return t.trim()}))}),"getStacktrace"),Yr=l((function(t){return function(){var e=Pe({},t.config);return{logger:e.loggerProvider,logLevel:e.logLevel}}}),"getClientLogConfig"),u2=l((function(t,e){var n,r;e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=to(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"),Wr=l((function(t,e){return function(){var n,r,i={};try{for(var o=to(e),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=u2(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"),Hr=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<ci.Debug||!u||!l)return t.apply(i,o);var c={type:"invoke public method",name:e,args:o,stacktrace:s2(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");v();var gs=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,gs)}),"UUID");v();var qc=function(){function t(){this.memoryStorage=new Map}return l(t,"MemoryStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2,!0]}))}))},t.prototype.get=function(t){return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){return[2,this.memoryStorage.get(t)]}))}))},t.prototype.getRaw=function(t){return Ce(this,void 0,void 0,(function(){var e;return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(n){return this.memoryStorage.set(t,e),[2]}))}))},t.prototype.remove=function(t){return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){return this.memoryStorage.delete(t),[2]}))}))},t.prototype.reset=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return this.memoryStorage.clear(),[2]}))}))},t}();v();var Ws=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 Nr.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 Nr.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 Nr.PayloadTooLarge:return{status:I,statusCode:E,body:{error:null!==(g=t.error)&&void 0!==g?g:""}};case Nr.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 Nr.Timeout:default:return{status:I,statusCode:E}}},t.prototype.buildStatus=function(t){return t>=200&&t<300?Nr.Success:429===t?Nr.RateLimit:413===t?Nr.PayloadTooLarge:408===t?Nr.Timeout:t>=400&&t<500?Nr.Invalid:t>=500?Nr.Failed:Nr.Unknown},t}();v(),v(),v(),v();var fi=l((function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0}),"getGlobalScope"),Xu=l((function(){var t,e=fi();return(null===(t=null==e?void 0:e.location)||void 0===t?void 0:t.search)?e.location.search.substring(1).split("&").filter(Boolean).reduce((function(t,e){var n=e.split("=",2),r=IE(n[0]),i=IE(n[1]);return i&&(t[r]=i),t}),{}):{}}),"getQueryParams"),IE=l((function(t){void 0===t&&(t="");try{return decodeURIComponent(t)}catch(t){return""}}),"tryDecodeURIComponent");v();var PE="utm_campaign",SE="utm_content",CE="utm_id",kE="utm_medium",NE="utm_source",OE="utm_term",gy="dclid",my="fbclid",vy="gbraid",yy="gclid",_y="ko_click_id",by="msclkid",wy="ttclid",xy="twclid",Ey="wbraid",TE="EMPTY",Id={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},AE="MKTG",LE=function(){function t(){}return l(t,"CampaignParser"),t.prototype.parse=function(){return Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2,Pe(Pe(Pe(Pe({},Id),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},t.prototype.getUtmParam=function(){var t=Xu();return{utm_campaign:t[PE],utm_content:t[SE],utm_id:t[CE],utm_medium:t[kE],utm_source:t[NE],utm_term:t[OE]}},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(t){}return n},t.prototype.getClickIds=function(){var t,e=Xu();return(t={})[gy]=e[gy],t[my]=e[my],t[vy]=e[vy],t[yy]=e[yy],t[_y]=e[_y],t[by]=e[by],t[wy]=e[wy],t[xy]=e[xy],t[Ey]=e[Ey],t},t}();v(),v();var Hs=l((function(t,e,n){return void 0===e&&(e=""),void 0===n&&(n=10),[jc,e,t.substring(0,n)].filter(Boolean).join("_")}),"getCookieName"),My=l((function(t){return"".concat(jc.toLowerCase(),"_").concat(t.substring(0,6))}),"getOldCookieName"),Iy=function(){function t(t,e){var n,r;this.storage=e.storage,this.storageKey=Hs(t,AE),this.parser=new LE,this.track=e.track,this.onNewCampaign=e.onNewCampaign,this.disabled=Boolean(e.disabled),this.trackNewCampaigns=Boolean(e.trackNewCampaigns),this.trackPageViews=Boolean(e.trackPageViews),this.excludeReferrers=null!==(n=e.excludeReferrers)&&void 0!==n?n:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(r=e.initialEmptyValue)&&void 0!==r?r:TE}return l(t,"CampaignTracker"),t.prototype.isNewCampaign=function(t,e,n){void 0===n&&(n=!1);t.referrer;var r=t.referring_domain,i=Bc(t,["referrer","referring_domain"]),o=e||{},s=(o.referrer,o.referring_domain),a=Bc(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?RE(r||"")!==RE(s||""):r!==s;return!e||l||u},t.prototype.saveCampaignToStorage=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(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=Pe(Pe({},Id),t),r=Object.entries(n).reduce((function(t,n){var r=dn(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 No),i={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return Pe(Pe({},zc(r)),this.trackPageViews&&i)},t.prototype.send=function(t){return Ce(this,void 0,void 0,(function(){var e,n;return ke(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}(),RE=l((function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")}),"domainWithoutSubdomain");v();var $s=function(){function t(t){this.options=Pe({},t)}return l(t,"CookieStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!fi())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 Ce(this,void 0,void 0,(function(){var e;return ke(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(t){}return[2,JSON.parse(e)]}catch(t){return[2,void 0]}return[2]}}))}))},t.prototype.getRaw=function(t){var e;return Ce(this,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){return n=fi(),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 Ce(this,void 0,void 0,(function(){var r,i,o,s,a,l;return ke(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=fi())&&(l.document.cookie=a)}catch(t){}return[2]}))}))},t.prototype.remove=function(t){return Ce(this,void 0,void 0,(function(){return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(t){return[2]}))}))},t}();v();var Pd=function(){function t(t,e){this.storage=t,this.storageKey=Hs(e),this.cache={optOut:!1}}return l(t,"SessionManager"),t.prototype.load=function(){var t;return Ce(this,void 0,void 0,(function(){var e;return ke(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=Pe(Pe({},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}();v();var Py=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ho(e,t),l(e,"FetchTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n,r;return ke(this,(function(i){switch(i.label){case 0:if("undefined"==typeof fetch)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}(Ws);v(),v();var DE=Zt(Sy()),l2=function(){function t(){this.ua=new DE.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return l(t,"ApplicationContextProviderImpl"),t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:p2(),platform:"Web",os:c2(this.ua),deviceModel:f2(this.ua)}},t}(),c2=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"),f2=l((function(t){var e;return null===(e=t.os)||void 0===e?void 0:e.name}),"getDeviceModel"),p2=l((function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""}),"getLanguage"),h2=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}(),ms=l((function(){return ms=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"),ms.apply(this,arguments)}),"__assign"),Cd=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(!Cd(a,l))return!1;var u=!0;return Object.keys(t).forEach((function(n){Cd(t[n],e[n])||(u=!1)})),u}for(var c=0;c<t.length;c++)if(!Cd(t[c],e[c]))return!1;return!0}),"isEqual"),d2="$set",g2="$unset",m2="$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 v2=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return l(t,"IdentityStoreImpl"),t.prototype.editIdentity=function(){var t=this,e=ms({},this.identity.userProperties),n=ms(ms({},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 d2: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 g2:for(var f=0,d=Object.keys(a);f<d.length;f++){delete e[h=d[f]]}break;case m2:e={}}}return n.userProperties=e,this},commit:function(){return t.setIdentity(n),this}}},t.prototype.getIdentity=function(){return ms({},this.identity)},t.prototype.setIdentity=function(t){var e=ms({},this.identity);this.identity=ms({},t),Cd(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}(),Uc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,FE=function(){function t(){this.identityStore=new v2,this.eventBridge=new h2,this.applicationContextProvider=new l2}return l(t,"AnalyticsConnector"),t.getInstance=function(e){return Uc.analyticsConnectorInstances||(Uc.analyticsConnectorInstances={}),Uc.analyticsConnectorInstances[e]||(Uc.analyticsConnectorInstances[e]=new t),Uc.analyticsConnectorInstances[e]},t}(),Vc=l((function(){return FE.getInstance("$default_instance")}),"getAnalyticsConnector");v();var Cy=function(){function t(){this.name="identity",this.type=Ei.BEFORE,this.identityStore=Vc().identityStore}return l(t,"IdentityEventSender"),t.prototype.execute=function(t){return Ce(this,void 0,void 0,(function(){var e;return ke(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}();v();var ky=l((function(){var t,e,n,r;if("undefined"==typeof navigator)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");v();var kd=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"),Nd=l((function(t){return t&&void 0!==t._q}),"isInstanceProxy");v();var jE=Zt(Sy());v();var BE="1.6.8",y2="Web",_2="$remote",zE=function(){function t(){var t;this.name="context",this.type=Ei.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat(BE),"undefined"!=typeof navigator&&(t=navigator.userAgent),this.uaResult=new jE.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 Ce(this,void 0,void 0,(function(){var e,n,r,i,o;return ke(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,Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe(Pe({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:y2}),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:ky()}),this.config.trackingOptions.ipAddress&&{ip:_2}),{insert_id:gs(),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}();v(),v();var Xc=function(){function t(){}return l(t,"LocalStorage"),t.prototype.isEnabled=function(){return Ce(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:if(!fi())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 Ce(this,void 0,void 0,(function(){var e;return ke(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 Ce(this,void 0,void 0,(function(){return ke(this,(function(n){return[2,(null===(e=fi())||void 0===e?void 0:e.localStorage.getItem(t))||void 0]}))}))},t.prototype.set=function(t,e){var n;return Ce(this,void 0,void 0,(function(){return ke(this,(function(r){try{null===(n=fi())||void 0===n||n.localStorage.setItem(t,JSON.stringify(e))}catch(t){}return[2]}))}))},t.prototype.remove=function(t){var e;return Ce(this,void 0,void 0,(function(){return ke(this,(function(n){try{null===(e=fi())||void 0===e||e.localStorage.removeItem(t)}catch(t){}return[2]}))}))},t.prototype.reset=function(){var t;return Ce(this,void 0,void 0,(function(){return ke(this,(function(e){try{null===(t=fi())||void 0===t||t.localStorage.clear()}catch(t){}return[2]}))}))},t}();v();var qE=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={done:4},e}return Ho(e,t),l(e,"XHRTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n=this;return ke(this,(function(r){return[2,new Promise((function(r,i){"undefined"==typeof XMLHttpRequest&&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}(Ws);v();var GE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ho(e,t),l(e,"SendBeaconTransport"),e.prototype.send=function(t,e){return Ce(this,void 0,void 0,(function(){var n=this;return ke(this,(function(r){return[2,new Promise((function(r,i){var o=fi();if(!(null==o?void 0: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}(Ws),Od=l((function(){var t=new qc;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,disableCookies:!1,domain:"",sessionManager:new Pd(t,""),sessionTimeout:18e5,storageProvider:new qc,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new Py}}),"getDefaultConfig"),UE=function(t){function e(e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=this,v=Od();return(y=t.call(this,Pe(Pe({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=Boolean(null==r?void 0: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 Ho(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(Boolean(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}(py),VE=l((function(t,e,n){return Ce(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 ke(this,(function(b){switch(b.label){case 0:return r=Od(),null!==(g=null==n?void 0:n.domain)&&void 0!==g?(o=g,[3,3]):[3,1];case 1:return[4,E2()];case 2:o=b.sent(),b.label=3;case 3:return i=o,[4,b2(Pe(Pe({},n),{domain:i}))];case 4:return s=b.sent(),a=Hs(t),[4,s.get(a)];case 5:return l=b.sent(),u=Xu(),[4,new Pd(s,t).load()];case 6:return c=b.sent(),h=UE.bind,p=[void 0,t,null!=e?e:null==l?void 0:l.userId],f=[Pe({},n)],d={cookieStorage:s,sessionManager:c,deviceId:x2(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:Boolean(null==l?void 0: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,w2(n)];case 8:return[2,new(h.apply(UE,p.concat([Pe.apply(void 0,f.concat([(d.storageProvider=b.sent(),d.trackingOptions=Pe(Pe({},r.trackingOptions),null==n?void 0:n.trackingOptions),d.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:Oy(null==n?void 0:n.transport),d)]))])))]}}))}))}),"useBrowserConfig"),b2=l((function(t,e){return void 0===e&&(e=Od()),Ce(void 0,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return n=Pe(Pe({},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,Ny(n)]:[2,r]}}))}))}),"createCookieStorage"),Ny=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n;return ke(this,(function(r){switch(r.label){case 0:return e=new $s({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 Xc).isEnabled()]:[3,4];case 3:r.sent()||(e=new qc),r.label=4;case 4:return[2,e]}}))}))}),"createFlexibleStorage"),w2=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return ke(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=to([null==t?void 0:t.storageProvider,new Xc]),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"),x2=l((function(t,e,n){return e||n||t||gs()}),"createDeviceId"),Oy=l((function(t){return t===Vu.XHR?new qE:t===Vu.SendBeacon?new GE:Od().transportProvider}),"createTransport"),E2=l((function(t){return Ce(void 0,void 0,void 0,(function(){var e,n,r,i,o,s,a;return ke(this,(function(l){switch(l.label){case 0:return[4,(new $s).isEnabled()];case 1:if(!l.sent()||!t&&"undefined"==typeof location)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 $s({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");v();var XE=l((function(t,e){return Ce(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,l,u,c;return ke(this,(function(h){switch(h.label){case 0:return[4,(n=new $s).isEnabled()];case 1:return(!h.sent()||(null==e?void 0:e.disableCookies))&&(n=new Xc),[4,n.isEnabled()];case 2:return h.sent()?(r=My(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=dn(i.split("."),5),s=o[0],a=o[1],l=o[2],u=o[3],c=o[4],[2,{deviceId:s,userId:M2(a),sessionId:YE(u),lastEventTime:YE(c),optOut:Boolean(l)}]}}))}))}),"parseOldCookies"),YE=l((function(t){var e=parseInt(t,32);if(!isNaN(e))return e}),"parseTime"),M2=l((function(t){if(atob&&escape&&t)try{return decodeURIComponent(escape(atob(t)))}catch(t){return}}),"decode"),I2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ho(e,t),l(e,"AmplitudeBrowser"),e.prototype.init=function(e,n,r){var i,o,s;return void 0===e&&(e=""),Ce(this,void 0,void 0,(function(){var a,l,u,c,h=this;return ke(this,(function(p){switch(p.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,XE(e,r)]);case 1:return a=p.sent(),[4,VE(e,n||a.userId,Pe(Pe({},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=Vc()).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 zE)];case 4:return p.sent(),[4,this.add(new Cy)];case 5:return p.sent(),[4,this.add(new dy)];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),Ce(this,void 0,void 0,(function(){var n,r,i;return ke(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Ny(this.config)];case 1:return i=o.sent(),[4,new Iy(this.config.apiKey,Pe(Pe({},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(gs())},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=Oy(t):this.q.push(this.setTransport.bind(this,t))},e.prototype.identify=function(e,n){if(Nd(e)){var r=e._q;e._q=[],e=kd(new No,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,e,n)},e.prototype.groupIdentify=function(e,n,r,i){if(Nd(r)){var o=r._q;r._q=[],r=kd(new No,o)}return t.prototype.groupIdentify.call(this,e,n,r,i)},e.prototype.revenue=function(e,n){if(Nd(e)){var r=e._q;e._q=[],e=kd(new xd,r)}return t.prototype.revenue.call(this,e,n)},e}(fy),Td=l((function(){var t=new I2;return{init:Hr(ro(t.init.bind(t)),"init",Yr(t),Wr(t,["config"])),add:Hr(ro(t.add.bind(t)),"add",Yr(t),Wr(t,["config.apiKey","timeline.plugins"])),remove:Hr(ro(t.remove.bind(t)),"remove",Yr(t),Wr(t,["config.apiKey","timeline.plugins"])),track:Hr(ro(t.track.bind(t)),"track",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),logEvent:Hr(ro(t.logEvent.bind(t)),"logEvent",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),identify:Hr(ro(t.identify.bind(t)),"identify",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Hr(ro(t.groupIdentify.bind(t)),"groupIdentify",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),setGroup:Hr(ro(t.setGroup.bind(t)),"setGroup",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),revenue:Hr(ro(t.revenue.bind(t)),"revenue",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),flush:Hr(ro(t.flush.bind(t)),"flush",Yr(t),Wr(t,["config.apiKey","timeline.queue.length"])),getUserId:Hr(t.getUserId.bind(t),"getUserId",Yr(t),Wr(t,["config","config.userId"])),setUserId:Hr(t.setUserId.bind(t),"setUserId",Yr(t),Wr(t,["config","config.userId"])),getDeviceId:Hr(t.getDeviceId.bind(t),"getDeviceId",Yr(t),Wr(t,["config","config.deviceId"])),setDeviceId:Hr(t.setDeviceId.bind(t),"setDeviceId",Yr(t),Wr(t,["config","config.deviceId"])),reset:Hr(t.reset.bind(t),"reset",Yr(t),Wr(t,["config","config.userId","config.deviceId"])),getSessionId:Hr(t.getSessionId.bind(t),"getSessionId",Yr(t),Wr(t,["config"])),setSessionId:Hr(t.setSessionId.bind(t),"setSessionId",Yr(t),Wr(t,["config"])),setOptOut:Hr(t.setOptOut.bind(t),"setOptOut",Yr(t),Wr(t,["config"])),setTransport:Hr(t.setTransport.bind(t),"setTransport",Yr(t),Wr(t,["config"]))}}),"createInstance"),on=Td(),AV=on.add,LV=on.flush,RV=on.getDeviceId,DV=on.getSessionId,FV=on.getUserId,BV=on.groupIdentify,jV=on.identify,zV=on.init,qV=on.logEvent,GV=on.remove,UV=on.reset,VV=on.revenue,XV=on.setDeviceId,YV=on.setGroup,WV=on.setOptOut,HV=on.setSessionId,$V=on.setTransport,KV=on.setUserId,JV=on.track,Ty={production:"40ead723d18886045e302513245edb27",development:""},Yu={plan:{version:"22",branch:"main",source:"websdk",versionId:"197467d1-8926-452d-a088-b3817cbac89f"},ingestionMetadata:{sourceName:"browser-typescript-ampli",sourceVersion:"2.0.0"}},Yc=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:categorySelected-call"),this.event_properties=t}};l(Yc,"AnalyticsCategorySelectedCall");var Wc=class{constructor(t){this.event_properties=t,D(this,"event_type","Analytics:locationSelected-call"),this.event_properties=t}};l(Wc,"AnalyticsLocationSelectedCall");var Ay=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:disable-call"),this.event_properties=t}};l(Ay,"BlueDotDisableCall");var Ly=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:enable-call"),this.event_properties=t}};l(Ly,"BlueDotEnableCall");var Ry=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:off-call"),this.event_properties=t}};l(Ry,"BlueDotOffCall");var Dy=class{constructor(t){this.event_properties=t,D(this,"event_type","BlueDot:on-call"),this.event_properties=t}};l(Dy,"BlueDotOnCall");var Fy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:animate-call"),this.event_properties=t}};l(Fy,"CameraAnimateCall");var By=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:cancelAnimation-call"),this.event_properties=t}};l(By,"CameraCancelAnimationCall");var jy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:focusOn-call"),this.event_properties=t}};l(jy,"CameraFocusOnCall");var zy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:getSafeAreaInsets-call"),this.event_properties=t}};l(zy,"CameraGetSafeAreaInsetsCall");var qy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.disable-call"),this.event_properties=t}};l(qy,"CameraInteractionDisableCall");var Gy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:interaction.enable-call"),this.event_properties=t}};l(Gy,"CameraInteractionEnableCall");var Uy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:set-call"),this.event_properties=t}};l(Uy,"CameraSetCall");var Vy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:setSafeAreaInsets-call"),this.event_properties=t}};l(Vy,"CameraSetSafeAreaInsetsCall");var Xy=class{constructor(t){this.event_properties=t,D(this,"event_type","Camera:translate-call"),this.event_properties=t}};l(Xy,"CameraTranslateCall");var Yy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:add-call"),this.event_properties=t}};l(Yy,"FlatLabelsAddCall");var Wy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:labelAllLocations-call"),this.event_properties=t}};l(Wy,"FlatLabelsLabelAllLocationsCall");var Hy=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:remove-call"),this.event_properties=t}};l(Hy,"FlatLabelsRemoveCall");var $y=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:removeAll-call"),this.event_properties=t}};l($y,"FlatLabelsRemoveAllCall");var Ky=class{constructor(t){this.event_properties=t,D(this,"event_type","FlatLabels:setAppearance-call"),this.event_properties=t}};l(Ky,"FlatLabelsSetAppearanceCall");var Jy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:add-call"),this.event_properties=t}};l(Jy,"FloatingLabelsAddCall");var Zy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:labelAllLocations-call"),this.event_properties=t}};l(Zy,"FloatingLabelsLabelAllLocationsCall");var Qy=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:remove-call"),this.event_properties=t}};l(Qy,"FloatingLabelsRemoveCall");var e0=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:removeAll-call"),this.event_properties=t}};l(e0,"FloatingLabelsRemoveAllCall");var t0=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:resetPriority-call"),this.event_properties=t}};l(t0,"FloatingLabelsResetPriorityCall");var r0=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setAppearance-call"),this.event_properties=t}};l(r0,"FloatingLabelsSetAppearanceCall");var n0=class{constructor(t){this.event_properties=t,D(this,"event_type","FloatingLabels:setPriority-call"),this.event_properties=t}};l(n0,"FloatingLabelsSetPriorityCall");var Hc=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenue-call"),this.event_properties=t}};l(Hc,"GlobalGetVenueCall");var $c=class{constructor(t){this.event_properties=t,D(this,"event_type","global:getVenueMVF-call"),this.event_properties=t}};l($c,"GlobalGetVenueMvfCall");var i0=class{constructor(t){this.event_properties=t,D(this,"event_type","global:showVenue-call"),this.event_properties=t}};l(i0,"GlobalShowVenueCall");var o0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:clear-call"),this.event_properties=t}};l(o0,"JourneyClearCall");var a0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:draw-call"),this.event_properties=t}};l(a0,"JourneyDrawCall");var s0=class{constructor(t){this.event_properties=t,D(this,"event_type","Journey:setStep-call"),this.event_properties=t}};l(s0,"JourneySetStepCall");var u0=class{constructor(t){this.event_properties=t,D(this,"event_type","Mappedin:getCollectionItemById-call"),this.event_properties=t}};l(u0,"MappedinGetCollectionItemByIdCall");var l0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:absoluteDistanceTo-call"),this.event_properties=t}};l(l0,"MappedinCoordinateAbsoluteDistanceToCall");var c0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinCoordinate:nearestNode-call"),this.event_properties=t}};l(c0,"MappedinCoordinateNearestNodeCall");var Kc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:clone-call"),this.event_properties=t}};l(Kc,"MappedinLocationCloneCall");var Jc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:directionsTo-call"),this.event_properties=t}};l(Jc,"MappedinLocationDirectionsToCall");var Zc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinLocation:distanceTo-call"),this.event_properties=t}};l(Zc,"MappedinLocationDistanceToCall");var f0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinate-call"),this.event_properties=t}};l(f0,"MappedinMapCreateCoordinateCall");var p0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:createCoordinateByXY-call"),this.event_properties=t}};l(p0,"MappedinMapCreateCoordinateByXyCall");var h0=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinMap:getNorth-call"),this.event_properties=t}};l(h0,"MappedinMapGetNorthCall");var Qc=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:directionsTo-call"),this.event_properties=t}};l(Qc,"MappedinNodeDirectionsToCall");var ef=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinNode:distanceTo-call"),this.event_properties=t}};l(ef,"MappedinNodeDistanceToCall");var tf=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:directionsTo-call"),this.event_properties=t}};l(tf,"MappedinPolygonDirectionsToCall");var rf=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinPolygon:distanceTo-call"),this.event_properties=t}};l(rf,"MappedinPolygonDistanceToCall");var nf=class{constructor(t){this.event_properties=t,D(this,"event_type","MappedinVenue:metadata-read"),this.event_properties=t}};l(nf,"MappedinVenueMetadataRead");var d0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygon-call"),this.event_properties=t}};l(d0,"MapViewAddInteractivePolygonCall");var g0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:addInteractivePolygonsForAllLocations-call"),this.event_properties=t}};l(g0,"MapViewAddInteractivePolygonsForAllLocationsCall");var m0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:clearPolygonColor-call"),this.event_properties=t}};l(m0,"MapViewClearPolygonColorCall");var v0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createCustomTooltip-call"),this.event_properties=t}};l(v0,"MapViewCreateCustomTooltipCall");var y0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createMarker-call"),this.event_properties=t}};l(y0,"MapViewCreateMarkerCall");var _0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:createTooltip-call"),this.event_properties=t}};l(_0,"MapViewCreateTooltipCall");var b0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:destroy-call"),this.event_properties=t}};l(b0,"MapViewDestroyCall");var w0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:disableImageFlippingForAllPolygons-call"),this.event_properties=t}};l(w0,"MapViewDisableImageFlippingForAllPolygonsCall");var x0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:drawPath-call"),this.event_properties=t}};l(x0,"MapViewDrawPathCall");var E0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForAllLocations-call"),this.event_properties=t}};l(E0,"MapViewEnableImageFlippingForAllLocationsCall");var M0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:enableImageFlippingForPolygon-call"),this.event_properties=t}};l(M0,"MapViewEnableImageFlippingForPolygonCall");var I0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getNearestNodeByScreenCoordinates-call"),this.event_properties=t}};l(I0,"MapViewGetNearestNodeByScreenCoordinatesCall");var P0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPolygonAtCoordinate-call"),this.event_properties=t}};l(P0,"MapViewGetPolygonAtCoordinateCall");var S0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:getPrimaryLocationForPolygon-call"),this.event_properties=t}};l(S0,"MapViewGetPrimaryLocationForPolygonCall");var C0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:labelAllLocations-call"),this.event_properties=t}};l(C0,"MapViewLabelAllLocationsCall");var k0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllInteractivePolygons-call"),this.event_properties=t}};l(k0,"MapViewRemoveAllInteractivePolygonsCall");var N0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllMarkers-call"),this.event_properties=t}};l(N0,"MapViewRemoveAllMarkersCall");var O0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllPaths-call"),this.event_properties=t}};l(O0,"MapViewRemoveAllPathsCall");var T0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeAllTooltips-call"),this.event_properties=t}};l(T0,"MapViewRemoveAllTooltipsCall");var A0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeInteractivePolygon-call"),this.event_properties=t}};l(A0,"MapViewRemoveInteractivePolygonCall");var L0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeMarker-call"),this.event_properties=t}};l(L0,"MapViewRemoveMarkerCall");var R0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removePath-call"),this.event_properties=t}};l(R0,"MapViewRemovePathCall");var D0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:removeTooltip-call"),this.event_properties=t}};l(D0,"MapViewRemoveTooltipCall");var F0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setBackgroundColor-call"),this.event_properties=t}};l(F0,"MapViewSetBackgroundColorCall");var B0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setHoverColor-call"),this.event_properties=t}};l(B0,"MapViewSetHoverColorCall");var j0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setMap-call"),this.event_properties=t}};l(j0,"MapViewSetMapCall");var z0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setPolygonColor-call"),this.event_properties=t}};l(z0,"MapViewSetPolygonColorCall");var q0=class{constructor(t){this.event_properties=t,D(this,"event_type","MapView:setState-call"),this.event_properties=t}};l(q0,"MapViewSetStateCall");var G0=class{constructor(t){this.event_properties=t,D(this,"event_type","metrics:mapLoad-event"),this.event_properties=t}};l(G0,"MetricsMapLoadEvent");var of=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:addQuery-call"),this.event_properties=t}};l(of,"OfflineSearchAddQueryCall");var af=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:constructor-call"),this.event_properties=t}};l(af,"OfflineSearchConstructorCall");var sf=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:search-call"),this.event_properties=t}};l(sf,"OfflineSearchSearchCall");var uf=class{constructor(t){this.event_properties=t,D(this,"event_type","OfflineSearch:suggest-call"),this.event_properties=t}};l(uf,"OfflineSearchSuggestCall");var Ad=l((()=>({promise:Promise.resolve()})),"getVoidPromiseResult"),U0=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."),Ad();let r=null;if(t.client&&"apiKey"in t.client?r=t.client.apiKey:"environment"in t&&(r=Ty[t.environment]),t.client&&"instance"in t.client)this.amplitude=t.client.instance;else{if(r)return this.amplitude=Td(),this.amplitude.init(r,void 0,{...Yu,...null==(n=t.client)?void 0:n.configuration});console.error("ERROR: ampli.load() requires 'environment', 'client.apiKey', or 'client.instance'")}return Ad()}identify(t,e,n){if(!this.isInitializedAndEnabled())return Ad();t&&(n={...n,user_id:t});let r=new No,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):Ad()}analyticsCategorySelectedCall(t,e){return this.track(new Yc(t),e)}analyticsLocationSelectedCall(t,e){return this.track(new Wc(t),e)}blueDotDisableCall(t,e){return this.track(new Ay(t),e)}blueDotEnableCall(t,e){return this.track(new Ly(t),e)}blueDotOffCall(t,e){return this.track(new Ry(t),e)}blueDotOnCall(t,e){return this.track(new Dy(t),e)}cameraAnimateCall(t,e){return this.track(new Fy(t),e)}cameraCancelAnimationCall(t,e){return this.track(new By(t),e)}cameraFocusOnCall(t,e){return this.track(new jy(t),e)}cameraGetSafeAreaInsetsCall(t,e){return this.track(new zy(t),e)}cameraInteractionDisableCall(t,e){return this.track(new qy(t),e)}cameraInteractionEnableCall(t,e){return this.track(new Gy(t),e)}cameraSetCall(t,e){return this.track(new Uy(t),e)}cameraSetSafeAreaInsetsCall(t,e){return this.track(new Vy(t),e)}cameraTranslateCall(t,e){return this.track(new Xy(t),e)}flatLabelsAddCall(t,e){return this.track(new Yy(t),e)}flatLabelsLabelAllLocationsCall(t,e){return this.track(new Wy(t),e)}flatLabelsRemoveCall(t,e){return this.track(new Hy(t),e)}flatLabelsRemoveAllCall(t,e){return this.track(new $y(t),e)}flatLabelsSetAppearanceCall(t,e){return this.track(new Ky(t),e)}floatingLabelsAddCall(t,e){return this.track(new Jy(t),e)}floatingLabelsLabelAllLocationsCall(t,e){return this.track(new Zy(t),e)}floatingLabelsRemoveCall(t,e){return this.track(new Qy(t),e)}floatingLabelsRemoveAllCall(t,e){return this.track(new e0(t),e)}floatingLabelsResetPriorityCall(t,e){return this.track(new t0(t),e)}floatingLabelsSetAppearanceCall(t,e){return this.track(new r0(t),e)}floatingLabelsSetPriorityCall(t,e){return this.track(new n0(t),e)}globalGetVenueCall(t,e){return this.track(new Hc(t),e)}globalGetVenueMvfCall(t,e){return this.track(new $c(t),e)}globalShowVenueCall(t,e){return this.track(new i0(t),e)}journeyClearCall(t,e){return this.track(new o0(t),e)}journeyDrawCall(t,e){return this.track(new a0(t),e)}journeySetStepCall(t,e){return this.track(new s0(t),e)}mappedinGetCollectionItemByIdCall(t,e){return this.track(new u0(t),e)}mappedinCoordinateAbsoluteDistanceToCall(t,e){return this.track(new l0(t),e)}mappedinCoordinateNearestNodeCall(t,e){return this.track(new c0(t),e)}mappedinLocationCloneCall(t,e){return this.track(new Kc(t),e)}mappedinLocationDirectionsToCall(t,e){return this.track(new Jc(t),e)}mappedinLocationDistanceToCall(t,e){return this.track(new Zc(t),e)}mappedinMapCreateCoordinateCall(t,e){return this.track(new f0(t),e)}mappedinMapCreateCoordinateByXyCall(t,e){return this.track(new p0(t),e)}mappedinMapGetNorthCall(t,e){return this.track(new h0(t),e)}mappedinNodeDirectionsToCall(t,e){return this.track(new Qc(t),e)}mappedinNodeDistanceToCall(t,e){return this.track(new ef(t),e)}mappedinPolygonDirectionsToCall(t,e){return this.track(new tf(t),e)}mappedinPolygonDistanceToCall(t,e){return this.track(new rf(t),e)}mappedinVenueMetadataRead(t,e){return this.track(new nf(t),e)}mapViewAddInteractivePolygonCall(t,e){return this.track(new d0(t),e)}mapViewAddInteractivePolygonsForAllLocationsCall(t,e){return this.track(new g0(t),e)}mapViewClearPolygonColorCall(t,e){return this.track(new m0(t),e)}mapViewCreateCustomTooltipCall(t,e){return this.track(new v0(t),e)}mapViewCreateMarkerCall(t,e){return this.track(new y0(t),e)}mapViewCreateTooltipCall(t,e){return this.track(new _0(t),e)}mapViewDestroyCall(t,e){return this.track(new b0(t),e)}mapViewDisableImageFlippingForAllPolygonsCall(t,e){return this.track(new w0(t),e)}mapViewDrawPathCall(t,e){return this.track(new x0(t),e)}mapViewEnableImageFlippingForAllLocationsCall(t,e){return this.track(new E0(t),e)}mapViewEnableImageFlippingForPolygonCall(t,e){return this.track(new M0(t),e)}mapViewGetNearestNodeByScreenCoordinatesCall(t,e){return this.track(new I0(t),e)}mapViewGetPolygonAtCoordinateCall(t,e){return this.track(new P0(t),e)}mapViewGetPrimaryLocationForPolygonCall(t,e){return this.track(new S0(t),e)}mapViewLabelAllLocationsCall(t,e){return this.track(new C0(t),e)}mapViewRemoveAllInteractivePolygonsCall(t,e){return this.track(new k0(t),e)}mapViewRemoveAllMarkersCall(t,e){return this.track(new N0(t),e)}mapViewRemoveAllPathsCall(t,e){return this.track(new O0(t),e)}mapViewRemoveAllTooltipsCall(t,e){return this.track(new T0(t),e)}mapViewRemoveInteractivePolygonCall(t,e){return this.track(new A0(t),e)}mapViewRemoveMarkerCall(t,e){return this.track(new L0(t),e)}mapViewRemovePathCall(t,e){return this.track(new R0(t),e)}mapViewRemoveTooltipCall(t,e){return this.track(new D0(t),e)}mapViewSetBackgroundColorCall(t,e){return this.track(new F0(t),e)}mapViewSetHoverColorCall(t,e){return this.track(new B0(t),e)}mapViewSetMapCall(t,e){return this.track(new j0(t),e)}mapViewSetPolygonColorCall(t,e){return this.track(new z0(t),e)}mapViewSetStateCall(t,e){return this.track(new q0(t),e)}metricsMapLoadEvent(t,e){return this.track(new G0(t),e)}offlineSearchAddQueryCall(t,e){return this.track(new of(t),e)}offlineSearchConstructorCall(t,e){return this.track(new af(t),e)}offlineSearchSearchCall(t,e){return this.track(new sf(t),e)}offlineSearchSuggestCall(t,e){return this.track(new uf(t),e)}};l(U0,"Ampli");var lf=new U0;v();var lI=Zt(SM()),cI=Zt(rI()),fI=Zt(nI());v(),v(),v();var nu,Oo,To,f1=[0,4,6,8,10],La=l((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&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],f1.map(((t,e)=>n.slice(t,e===f1.length-1?void 0:f1[e+1]).join(""))).join("-")}),"randomId"),iI="mi-session-data",oI="mi-local-data",p1=class{constructor(){oe(this,Oo,void 0),oe(this,To,void 0);try{let t=sessionStorage.getItem(iI);le(this,Oo,t?JSON.parse(t):{id:La()})}catch{le(this,Oo,{id:La()})}try{let t=localStorage.getItem(oI);le(this,To,t?JSON.parse(t):{deviceId:La()})}catch{le(this,To,{deviceId:La()})}z(this,Oo).id||(z(this,Oo).id=La()),z(this,To).deviceId||(z(this,To).deviceId=La())}static getInstance(){return z(this,nu)||le(this,nu,new p1),z(this,nu)}static ___clearInstance(){le(this,nu,void 0)}saveSessionData(t,e){z(this,Oo)[t]=e;try{return sessionStorage.setItem(iI,JSON.stringify(z(this,Oo))),!0}catch{return!1}}loadSessionData(t){let e=z(this,Oo)[t];if(null!=e)return e}saveLocalData(t,e){z(this,To)[t]=e;try{return localStorage.setItem(oI,JSON.stringify(z(this,To))),!0}catch{return!1}}loadLocalData(t){let e=z(this,To)[t];if(null!=e)return e}},Qu=p1;l(Qu,"SafeStorage"),nu=new WeakMap,Oo=new WeakMap,To=new WeakMap,oe(Qu,nu,void 0);var HF=Zt(aI());function sI(t){return/^[\da-f]{24}$/i.test(t)}function eg(){return Qu.getInstance().loadLocalData("deviceId")}function tg(){return Qu.getInstance().loadSessionData("id")}l(sI,"isGatewayKey"),l(eg,"getDeviceID"),l(tg,"getSessionID");var Ra,iu,Ao,el,Ko,rg,QF,ng,e3,xf,pI,Ef,hI,Lo,uI="5.12.0",KF="https://api2.amplitude.com/2/httpapi",JF="https://api2.amplitude.com/batch",ZF="__unspecified__",m1={branch:"main",version:"0",source:"websdk"},no=class{constructor(){oe(this,rg),oe(this,ng),oe(this,xf),oe(this,Ef),oe(this,Ao,{}),oe(this,el,!1),oe(this,Ko,void 0),oe(this,Lo,l((async t=>{r3(t.type)&&(window.removeEventListener("visibilitychange",z(this,Lo)),window.removeEventListener("pagehide",z(this,Lo)),window.removeEventListener("beforeunload",z(this,Lo)),window.removeEventListener("unload",z(this,Lo)),await this.sendAllPendingEvents())}),"#handlePageUnload")),null==z(no,iu)&&le(no,iu,uI),null!=navigator.userAgent&&le(this,Ko,new fI.UAParser(navigator.userAgent).getResult())}static setContext(t){le(no,Ra,t)}static setVersion(t){le(no,iu,t)}addPendingEvent(t){var e;if(null==z(no,Ra))return void Me.warn("No context defined for product analytics! Event will not be tracked.");let n=t.event_type;if(!kn(this,ng,e3).call(this,t))return;null==t.event_properties&&(t.event_properties={});let r=z(this,Ao)[n];(0,cI.default)(t.event_properties,null!=(e=null==r?void 0:r.event_properties)?e:{}),z(this,Ao)[n]=t}async sendAllPendingEvents(){if(null==z(no,Ra))return void Me.warn("No context defined for product analytics! No events will be sent.");if(Object.keys(z(this,Ao)).length<1)return;if(z(this,el))return void Me.warn("The current batch of analytics is already sending. Wait until this finishes before trying to send again.");let t=[];for(let e in z(this,Ao)){let n=z(this,Ao)[e],r=kn(this,xf,pI).call(this,n);null!=r&&t.push(r)}if(!(t.length<1))try{le(this,el,!0),200===(await kn(this,Ef,hI).call(this,JF,t)).status&&le(this,Ao,{})}catch(t){Me.warn("Error sending batch product analytics!",t)}finally{le(this,el,!1)}}async load(){if(!lf.isLoaded){let{promise:t}=lf.load({environment:"production",client:{configuration:{trackingOptions:{osName:!0}}}});t.then((()=>{window.addEventListener("pagehide",z(this,Lo)),window.addEventListener("beforeunload",z(this,Lo)),window.addEventListener("unload",z(this,Lo)),window.addEventListener("visibilitychange",z(this,Lo))}))}}async sendEventNow(t){if(null==z(no,Ra))return void Me.warn("No context defined for product analytics! No events will be sent.");let e=kn(this,xf,pI).call(this,t);if(null!=e)try{await kn(this,Ef,hI).call(this,KF,[e])}catch(t){Me.warn("Error sending single product analytics event!",t)}}},wf=no;l(wf,"ProductAnalytics"),Ra=new WeakMap,iu=new WeakMap,Ao=new WeakMap,el=new WeakMap,Ko=new WeakMap,rg=new WeakSet,QF=l((function(t){let e=t.event_type;return null!=z(this,Ao)[e]}),"#isEventTypePending"),ng=new WeakSet,e3=l((function(t){if(!kn(this,rg,QF).call(this,t))return!0;let e=t.event_type,n=z(this,Ao)[e];return!(0,lI.default)(n.event_properties,t.event_properties)}),"#didEventPropertiesChange"),xf=new WeakSet,pI=l((function(t){var e,n,r,i,o,s,a,l,u,c,h,p,f,d,g,y,v;if(null!=z(no,Ra))return null==(null==(e=t.event_properties)?void 0:e.venue)&&Me.warn("Error processing product analytics event! Unspecified venue slug",t),null==Yu.plan&&Me.warn("Error processing product analytics event! Unknown coinfiguration plan",t),{event_type:t.event_type,session_id:null!=(n=lf.client.getSessionId())?n:tg(),device_id:null!=(r=lf.client.getDeviceId())?r:eg(),plan:{branch:null!=(o=null==(i=Yu.plan)?void 0:i.branch)?o:m1.branch,version:null!=(a=null==(s=Yu.plan)?void 0:s.version)?a:m1.version,source:null!=(u=null==(l=Yu.plan)?void 0:l.source)?u:m1.source},os_name:null==(c=z(this,Ko))?void 0:c.browser.name,os_version:null==(h=z(this,Ko))?void 0:h.browser.version,device_manufacturer:null==(p=z(this,Ko))?void 0:p.device.vendor,device_model:null==(f=z(this,Ko))?void 0:f.device.model,event_properties:{...t.event_properties,context:z(no,Ra),sdk_version:z(no,iu),browser_name:null==(d=z(this,Ko))?void 0:d.browser.name,browser_version:null==(g=z(this,Ko))?void 0:g.browser.version,venue:null!=(v=null==(y=t.event_properties)?void 0:y.venue)?v:ZF},time:t.time}}),"#makeBatchFormattedEvent"),Ef=new WeakSet,hI=l((async function(t,e){return await Da()(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({api_key:Ty.production,events:e})})}),"#batchSend"),Lo=new WeakMap,oe(wf,Ra,void 0),oe(wf,iu,void 0);var t3=new wf,Or=t3;function r3(t){return"beforeunload"===t||"pagehide"===t||"unload"===t||"hidden"===document.visibilityState}l(r3,"areWeLeavingThePage");var n3=0,i3="9999-12-31T00:00:00.000Z";function o3(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||n3),n=new Date(t.end||i3);return e<r&&n>r}));return i?e.find((t=>t.value===i.type)):void 0}l(o3,"getCurrentLocationState");var Di,_s,Fi,Mf,If,Pf,Sf=class extends Sa{constructor(t,e){super(t),oe(this,Di,void 0),oe(this,_s,void 0),oe(this,Fi,{}),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,"externalId"),D(this,"showLabelWhenImagePresent"),D(this,"showSmartLabelWhenImagePresent"),D(this,"picture"),D(this,"operationHours"),D(this,"siblingGroups"),D(this,"gallery"),oe(this,Mf,void 0),oe(this,If,[]),oe(this,Pf,void 0),le(this,Di,t),le(this,_s,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=z(this,Fi).polygons;if(void 0!==t)return t;let e=[],n=z(this,Mf),r=z(this,Di)._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 z(this,Fi).polygons=e,e}set polygons(t){le(this,Mf,t)}get nodes(){let t=z(this,Fi).nodes;if(void 0!==t)return t;let e=[],n=z(this,If),r=z(this,Di)._nodesById;if(n)for(let t=0,i=n.length;t<i;++t){let i=r[n[t].node];null!=i&&e.push(i)}return z(this,Fi).nodes=e,e}set nodes(t){le(this,If,t)}get parent(){let t=z(this,Fi).parent;if(void 0!==t)return t;let e,n=z(this,Di)._locationsById,r=z(this,Pf);return void 0!==r&&(e=n[r]),z(this,Fi).parent=e,e}set parent(t){le(this,Pf,t)}get categories(){let t=z(this,Fi).categories;if(void 0!==t)return t;let e=[];return z(this,_s).categories.forEach((t=>{let n=z(this,Di).getCollectionItemById(Ba.CATEGORY,t);n&&e.push(n)})),z(this,Fi).categories=e,e}get state(){return o3(this,z(this,Di).locationStates)}clone(){let t=z(this,Di).venue.slug;return Or.addPendingEvent(new Kc({venue:t})),new Sf(z(this,Di),z(this,_s))}get nodeOperationHours(){let t=z(this,Fi).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=z(this,_s).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return z(this,Fi).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Sf(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&zr(e,"categories"),t.options.things.nodes&&zr(e,"nodes"),t.options.things.polygons&&zr(e,"polygons"),t.options.things.locationStates&&zr(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await jr(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Sf(t,e)))}catch(t){return Me.error("Fetch Locations:",t),[]}}directionsTo(t,e){let n=t instanceof Co,r=z(this,Di).venue.slug,i=new Jc({with_destination_set:n||void 0,venue:r});return Or.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,Di).venue.slug;return Or.addPendingEvent(new Zc({venue:n})),super.distanceTo(t,e)}toJSON(){let t=z(this,_s);return delete t.color,t}},Fa=Sf;l(Fa,"MappedinLocation"),Di=new WeakMap,_s=new WeakMap,Fi=new WeakMap,Mf=new WeakMap,If=new WeakMap,Pf=new WeakMap,v();var Jo,tl,io,Cf,ig=class extends Sa{constructor(t,e){super(t),oe(this,Jo,void 0),oe(this,tl,void 0),oe(this,io,{}),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,"canvasBounds"),oe(this,Cf,void 0),le(this,Jo,t),le(this,tl,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=z(this,io).map;if(void 0!==t)return t;let e=z(this,Jo).getCollectionItemById(Ba.MAP,z(this,tl).map);return z(this,io).map=e,e}get locations(){var t,e;let n=z(this,io).locations;if(void 0!==n)return n;let r=[],i=null!=(e=null==(t=Ri.instances.get(z(this,Jo)))?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 z(this,io).locations=r,r}get entrances(){let t=z(this,io).entrances;if(void 0!==t)return t;let e=[],n=z(this,Cf),r=z(this,Jo)._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 z(this,io).entrances=e,e}return[]}set entrances(t){le(this,Cf,t)}get rank(){let t=z(this,io).rank;if(void 0!==t)return t;let{rankings:e}=z(this,Jo);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(z(this,io).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(z(this,io).rank=null,null)}static hydrate(t,e){return t.map((t=>new ig(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&zr(e,"map"),t.options.things.nodes&&zr(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(await jr(t.options,"polygon",n)).map((e=>new ig(t,e)))}catch(t){return Me.error("Fetch Polygons:",t),[]}}directionsTo(t,e){let n=t instanceof Co,r=z(this,Jo).venue.slug,i=new tf({with_destination_set:n||void 0,venue:r});return Or.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,Jo).venue.slug;return Or.addPendingEvent(new rf({venue:n})),super.distanceTo(t,e)}toJSON(){return z(this,tl)}},ou=ig;function dI(t){return/^[\da-f]{24}$/i.test(t)}function gI(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+=`${r+encodeURIComponent(o)}=${encodeURIComponent(s)}`,r="&")}}return n}function a3(t,e,n,r=!1){var i,o;return r?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(i=t.baseUrl)?void 0:i.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${gI(n,null==(o=t.baseUrl)?void 0:o.includes("gateway"))}`:t.baseUrl+e+gI(n)}async function jr(t,e,n,r=!1){return kf(t,e,n,r,!0)}async function kf(t,e,n,r=!1,i=!1){let o=a3(t,e,n,r),s=await og(t,o,r);if(!i&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}async function og(t,e,n=!1){let r={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete r.language,r.language&&(e+=`&lang=${encodeURIComponent(r.language)}`);let{headers:i}=t;i["Content-Type"]=i["Content-Type"]||"text/json",t.authorization&&(i.Authorization=t.authorization),r.language&&(i["Accept-Language"]=r.language);let o={method:"GET",headers:i};t.secure&&(e+="&withcdntoken");let s=await Da()(e,o);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}function zr(t,e){t.indexOf(e)<0&&t.push(e)}function mI([t,e],[n,r]){let i=new Ae(t,e),o=new Ae(n,r);return i.distanceTo(o)}function vI(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 Ae(n.target.x,n.target.y),o=new Ae(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,Me.warn(n),Me.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Fc(t){var e;return t instanceof ou?t.entrances.map((t=>t.id)):t instanceof Fa?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function yI(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,${r[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{Me.error(t)}))));await Promise.all(t)}catch(t){Me.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0: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)?void 0:n.url)&&(null==(r=null==t?void 0:t.image)?void 0: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)?void 0: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 ag(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)}}l(ou,"MappedinPolygon"),Jo=new WeakMap,tl=new WeakMap,io=new WeakMap,Cf=new WeakMap,l(dI,"isGatewayKey"),l(gI,"stringifyQuery"),l(a3,"buildUrl"),l(jr,"getArray"),l(kf,"getObject"),l(og,"generateAPIRequest"),l(zr,"addToSet"),l(mI,"getDistanceBetweenLatLon"),l(vI,"getMapScale"),l(Fc,"getNodesForNavigatable"),l(yI,"populateBundledImagesAsBlobs"),l(ag,"debounce");var Nf,Of,Tf,sg=class{constructor(t,e){oe(this,Nf,void 0),oe(this,Of,{}),oe(this,Tf,void 0),D(this,"name"),D(this,"externalId"),D(this,"parents"),D(this,"id"),D(this,"icon"),this.id=e.id,le(this,Tf,e),le(this,Nf,t),Object.assign(this,e)}get locations(){var t;let e=z(this,Of).locations;if(void 0!==e)return e;let n=[],{locations:r}=z(this,Nf),{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 z(this,Of).locations=n,n}static hydrate(t,e){return t.map((t=>new sg(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await jr(t.options,"category",e)).map((e=>new sg(t,e)))}catch(t){return Me.error("Fetch Categories:",t),[]}}toJSON(){return z(this,Tf)}},au=sg;l(au,"MappedinCategory"),Nf=new WeakMap,Of=new WeakMap,Tf=new WeakMap,v();var Lf,rl,Rf,ug=class{constructor(t,e){oe(this,Lf,void 0),oe(this,rl,void 0),oe(this,Rf,{}),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,rl,e),le(this,Lf,t),Object.assign(this,e)}location(){let t=z(this,Rf).location;if(void 0!==t)return t;let e,n=z(this,Lf)._locationsById,r=z(this,rl).location;if(null!=r){let t=n[r];null!=t&&(e=t)}return z(this,Rf).location=e,e}static hydrate(t,e){return t.map((t=>new ug(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&zr(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await jr(t.options,"event",n)).map((e=>new ug(t,e)))}catch(t){return Me.error("Fetch Events:",t),[]}}toJSON(){return z(this,rl)}},Af=ug;l(Af,"MappedinEvent"),Lf=new WeakMap,rl=new WeakMap,Rf=new WeakMap,v();var Df,cg=class{constructor(t){oe(this,Df,void 0),D(this,"id",""),D(this,"name",""),D(this,"value",""),le(this,Df,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new cg(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await jr(t.options,"location-state",e)).map((t=>new cg(t)))}catch(t){return Me.error("Fetch Location States:",t),[]}}toJSON(){return z(this,Df)}},lg=cg;l(lg,"MappedinLocationState"),Df=new WeakMap,v(),v();var Ff,_I,Bf,bI,jf,zf,fg,s3,pg,u3,Zo,Qo,ea,ta,nl=class{constructor(t){oe(this,Ff),oe(this,Bf),oe(this,fg),oe(this,pg),D(this,"map"),oe(this,jf,{}),oe(this,zf,void 0),oe(this,Zo,void 0),oe(this,Qo,void 0),oe(this,ea,void 0),oe(this,ta,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(le(this,Zo,t.lat),le(this,Qo,t.lon)),null!=t.x&&null!=t.y&&(le(this,ea,t.x),le(this,ta,t.y)),this.map=e,le(this,zf,n)}get x(){return kn(this,Bf,bI).call(this,"x")}get y(){return kn(this,Bf,bI).call(this,"y")}get lat(){return kn(this,Ff,_I).call(this,"lat")}get lon(){return kn(this,Ff,_I).call(this,"lon")}absoluteDistanceTo(t){return mI([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=z(this,jf).nearestNode;if(void 0!==t)return t;let e=Ri.instances.get(z(this,zf)).findNearestNodeOnMap(this.map.id,this);return z(this,jf).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};l(nl,"MappedinCoordinate"),Ff=new WeakSet,_I=l((function(t){if(void 0!==z(this,Zo)&&void 0!==z(this,Qo))return z(this,"lat"===t?Zo:Qo);if(void 0!==z(this,ea)&&void 0!==z(this,ta)){let[e,n]=kn(this,pg,u3).call(this,z(this,ea),z(this,ta));return le(this,Zo,e),le(this,Qo,n),z(this,"lat"===t?Zo:Qo)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),Bf=new WeakSet,bI=l((function(t){if(z(this,ea)&&z(this,ta))return z(this,"x"===t?ea:ta);if(null!=z(this,Zo)&&null!=z(this,Qo)){let[e,n]=kn(this,fg,s3).call(this,z(this,Zo),z(this,Qo));return le(this,ea,e),le(this,ta,n),z(this,"x"===t?ea:ta)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),jf=new WeakMap,zf=new WeakMap,fg=new WeakSet,s3=l((function(t,e){let n=this.map.georeference[0],r=new Ae(n.target.x,n.target.y),i=new Ae(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"),pg=new WeakSet,u3=l((function(t,e){let n,r=this.map.georeference[0],i=new Ae(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"),Zo=new WeakMap,Qo=new WeakMap,ea=new WeakMap,ta=new WeakMap;var ra,Gf,Uf,hg=class{constructor(t,e){oe(this,ra,void 0),oe(this,Gf,{}),oe(this,Uf,void 0),D(this,"id",""),D(this,"group",""),D(this,"name",""),D(this,"shortName",""),D(this,"elevation",0),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,ra,t),le(this,Uf,e),Object.assign(this,e),this._scale=vI(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(z(this,ra)))?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(z(this,ra)))?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(z(this,ra)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=z(this,Gf).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&z(this,ra)._mapGroupsById[e]||null;return z(this,Gf).mapGroup=n,n}createCoordinateByXY(t,e){return new nl({x:t,y:e,map:this,mappedin:z(this,ra)})}createCoordinate(t,e){return new nl({lat:t,lon:e,map:this,mappedin:z(this,ra)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],r=new Ae(e.target.x,e.target.y),i=new Ae(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,Me.warn(e),Me.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new hg(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&zr(e,"perspectives"),t.options.things.mapGroups&&zr(e,"group"),zr(e,"elevation"),zr(e,"x_scale"),zr(e,"scale"),zr(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let i=await jr(t.options,"map",n),o=l((t=>{let e=r.layers.find((e=>e.id===t));e?e.visible=!0:r.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let n=0,s=i.length;n<s;++n){var r=i[n];if(r){let t=r.perspective;null!=t&&(r.perspectiveId=t.id,e.indexOf("scene")>-1&&(r.scene=t.scene),t.layers?(r.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(o)):r.layers.forEach((t=>{t.visible=!0}))),delete r.perspective}i[n]=new hg(t,r)}return i}catch(t){return Me.error("Fetch Maps:",t),[]}}toJSON(){return z(this,Uf)}},qf=hg;l(qf,"MappedinMap"),ra=new WeakMap,Gf=new WeakMap,Uf=new WeakMap,v();var Xf,il,Yf,dg=class{constructor(t,e){oe(this,Xf,void 0),oe(this,il,void 0),oe(this,Yf,{}),D(this,"id",""),D(this,"name",""),le(this,il,e),le(this,Xf,t),Object.assign(this,e)}get maps(){let t=z(this,Yf).maps;if(void 0!==t)return t;let e=[],{maps:n}=z(this,Xf),{id:r}=z(this,il);for(let t=0,i=n.length;t<i;++t){let i=n[t];i.group===r&&e.push(i)}return z(this,Yf).maps=e,e}static hydrate(t,e){return t.map((t=>new dg(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await jr(t.options,"map-group",e)).map((e=>new dg(t,e)))}catch(t){return Me.error("Fetch Map Groups:",t),[]}}toJSON(){return z(this,il)}},Vf=dg;l(Vf,"MappedinMapGroup"),Xf=new WeakMap,il=new WeakMap,Yf=new WeakMap,v();var oo,ol,Gn,Hf,gg=class extends Sa{constructor(t,e){super(t),oe(this,oo,void 0),oe(this,ol,void 0),oe(this,Gn,{}),D(this,"id",""),D(this,"x",0),D(this,"y",0),D(this,"operationHours"),D(this,"externalId"),oe(this,Hf,void 0),le(this,oo,t),le(this,ol,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=z(this,Gn).map;if(void 0!==t)return t;let e=z(this,oo).getCollectionItemById(Ba.MAP,z(this,ol).map);return z(this,Gn).map=e,e}get lat(){var t;let e=z(this,Gn).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=z(this,oo)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return z(this,Gn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),z(this,Gn).cachedLatLon.lat}get lon(){var t;let e=z(this,Gn).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=z(this,oo)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return z(this,Gn).cachedLatLon=n.createCoordinateByXY(this.x,this.y),z(this,Gn).cachedLatLon.lon}get paths(){let t=z(this,Gn).paths;if(void 0!==t)return t;let e=[],n=z(this,oo)._nodesById,r=z(this,Hf);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 z(this,Gn).paths=e,e}set paths(t){le(this,Hf,t)}get locations(){var t,e,n;let r=z(this,Gn).locations;if(void 0!==r)return r;let i=[],o=null!=(n=null==(e=null==(t=Ri.instances.get(z(this,oo)))?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 z(this,Gn).locations=i,i}get polygon(){var t,e,n;let r=z(this,Gn).polygon;if(void 0!==r)return r;let i,o=null!=(n=null==(e=null==(t=Ri.instances.get(z(this,oo)))?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 z(this,Gn).polygon=i,i}static hydrate(t,e){return t.map((t=>new gg(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&zr(e,"map"),["weight","multiplier","accessible"].forEach((function(t){zr(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await jr(t.options,"node",n)).map((e=>new gg(t,e)))}catch(t){return Me.error("Fetch Nodes:",t),[]}}directionsTo(t,e){let n=t instanceof Co,r=z(this,oo).venue.slug,i=new Qc({with_destination_set:n||void 0,venue:r});return Or.addPendingEvent(i),super.directionsTo(t,e)}distanceTo(t,e){let n=z(this,oo).venue.slug;return Or.addPendingEvent(new ef({venue:n})),super.distanceTo(t,e)}toJSON(){return z(this,ol)}},Wf=gg;l(Wf,"MappedinNode"),oo=new WeakMap,ol=new WeakMap,Gn=new WeakMap,Hf=new WeakMap,v();var Kf,mg=class{constructor(t){oe(this,Kf,void 0),D(this,"polygons",[]),le(this,Kf,t),Object.assign(this,t)}static hydrate(t){return new mg(t)}static async fetch(t){try{let e=await kf({...t.options,secure:!1},"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new mg(e)}catch(t){return Me.error("Fetch Rankings:",t),null}}toJSON(){return z(this,Kf)}},$f=mg;l($f,"MappedinRankings"),Kf=new WeakMap,v();var Jf,yg=class{constructor(t){D(this,"id",""),oe(this,Jf,void 0),le(this,Jf,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new yg(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await jr(t.options,"apollo-theme",e)).map((t=>new yg(t)))}catch(t){return Me.error("Fetch Theme:",t),[]}}toJSON(){return z(this,Jf)}},vg=yg;l(vg,"MappedinTheme"),Jf=new WeakMap,v();var Zf,Qf,ep,al,_g=class{constructor(t,e){oe(this,Zf,void 0),oe(this,Qf,void 0),oe(this,ep,void 0),oe(this,al,{}),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,"languages",[]),le(this,Qf,t),le(this,Zf,e),Object.assign(this,e)}get metadata(){return Or.addPendingEvent(new nf({venue:this.slug})),z(this,ep)}set metadata(t){le(this,ep,t)}static hydrate(t,e){return new _g(e,t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await jr(t.options,"venue",e);return new _g(t,n[0])}catch(t){return Me.error("Fetch Venue:",t),{}}}get isMultiBuilding(){if(null==z(this,al).isMultiBuilding){let t=z(this,Qf).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;z(this,al).isMultiBuilding=n}return z(this,al).isMultiBuilding}toJSON(){return z(this,Zf)}},su=_g;l(su,"MappedinVenue"),Zf=new WeakMap,Qf=new WeakMap,ep=new WeakMap,al=new WeakMap,v();var rp,bg=class{constructor(t){D(this,"id",""),oe(this,rp,void 0),D(this,"name"),D(this,"type"),D(this,"weight"),D(this,"multiplier"),D(this,"nodes"),le(this,rp,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new bg(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){zr(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await jr(t.options,"vortex",n)).map((t=>new bg(t)))}catch(t){return Me.error("Fetch Vortexes:",t),[]}}toJSON(){return z(this,rp)}},tp=bg;l(tp,"MappedinVortex"),rp=new WeakMap,v(),v(),v(),v();var gn=6371008.8,wI={centimeters:100*gn,centimetres:100*gn,degrees:gn/111325,feet:3.28084*gn,inches:39.37*gn,kilometers:gn/1e3,kilometres:gn/1e3,meters:gn,metres:gn,miles:gn/1609.344,millimeters:1e3*gn,millimetres:1e3*gn,nauticalmiles:gn/1852,radians:1,yards:1.0936*gn},FX={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/gn,yards:1.0936133};function mn(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 Gt(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(!na(t[0])||!na(t[1]))throw new Error("coordinates must contain numbers");return mn({type:"Point",coordinates:t},e,n)}function hr(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 mn({type:"Polygon",coordinates:t},e,n)}function Tr(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 mn({type:"LineString",coordinates:t},e,n)}function We(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 uu(t,e,n){return void 0===n&&(n={}),mn({type:"MultiLineString",coordinates:t},e,n)}function v1(t,e,n){return void 0===n&&(n={}),mn({type:"MultiPoint",coordinates:t},e,n)}function np(t,e){void 0===e&&(e="kilometers");var n=wI[e];if(!n)throw new Error(e+" units is invalid");return t*n}function ip(t,e){void 0===e&&(e="kilometers");var n=wI[e];if(!n)throw new Error(e+" units is invalid");return t/n}function lu(t){return 180*(t%(2*Math.PI))/Math.PI}function On(t){return t%360*Math.PI/180}function na(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function an(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===an(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function xI(t,e,n,r){var i=n;return an(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function or(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 ia(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 Qn(t,e){ia(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(mn(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(mn({type:s,coordinates:u},r),n,l))return!1}}))}function wg(t,e){Qn(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===an(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=Tr([s,o],t.properties);if(!1===e(d,n,r,f,i))return!1;i++,s=o})))return!1}}}))}function EI(t,e,n){var r=n,i=!1;return wg(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 y1(t){var e=[1/0,1/0,-1/0,-1/0];return an(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(mn,"feature"),l(Gt,"point"),l(hr,"polygon"),l(Tr,"lineString"),l(We,"featureCollection"),l(uu,"multiLineString"),l(v1,"multiPoint"),l(np,"radiansToLength"),l(ip,"lengthToRadians"),l(lu,"radiansToDegrees"),l(On,"degreesToRadians"),l(na,"isNumber"),l(an,"coordEach"),l(xI,"coordReduce"),l(or,"featureEach"),l(ia,"geomEach"),l(Qn,"flattenEach"),l(wg,"segmentEach"),l(EI,"segmentReduce"),l(y1,"bbox"),y1.default=y1;var Tn=y1;function Lr(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 ar(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 _1(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 Un(t){return"Feature"===t.type?t.geometry:t}function Bi(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}v(),v(),v(),v(),l(Lr,"getCoord"),l(ar,"getCoords"),l(_1,"featureOf"),l(Un,"getGeom"),l(Bi,"getType");var m3=Zt(xg());v();var P3=Zt(GI());function An(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=Lr(t),i=Un(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===S3(r,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(UI(r,a[u][0],n.ignoreBoundary)){for(var c=!1,h=1;h<a[u].length&&!c;)UI(r,a[u][h],!n.ignoreBoundary)&&(c=!0),h++;c||(l=!0)}return l}function UI(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 S3(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function C3(t,e,n){void 0===n&&(n={});var r=Lr(t),i=Lr(e),o=On(i[1]-r[1]),s=On(i[0]-r[0]),a=On(r[1]),l=On(i[1]),u=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return np(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),n.units)}v(),v(),l(An,"booleanPointInPolygon"),l(UI,"inRing"),l(S3,"inBBox"),v(),v(),l(C3,"distance");var Ir=C3;v();var fY=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}();v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v();var XI=new ArrayBuffer(16),hW=new Float64Array(XI),dW=new Uint32Array(XI);v(),v(),v(),v(),v(),v();var U3=Zt(L1());v(),v(),v(),v(),v();var zH=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 V3((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},t}();function V3(t,e,n,r,i){var o=X3(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 X3(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 up(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 hr([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}function Y3(t){return up(Tn(t))}l(V3,"bezier"),l(X3,"B"),v(),v(),v(),v(),l(up,"bboxPolygon"),l(Y3,"envelope");var R1=Y3;function oa(t,e,n,r){void 0===r&&(r={});var i=Lr(t),o=On(i[0]),s=On(i[1]),a=On(n),l=ip(e,r.units),u=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return Gt([lu(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(u))),lu(u)],r.properties)}function ja(t,e,n){if(void 0===n&&(n={}),!0===n.final)return W3(t,e);var r=Lr(t),i=Lr(e),o=On(r[0]),s=On(i[0]),a=On(r[1]),l=On(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 lu(Math.atan2(u,c))}function W3(t,e){var n=ja(e,t);return n=(n+180)%360}function H3(t,e){void 0===e&&(e={});var n=Tn(t);return Gt([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}v(),v(),v(),l(oa,"destination"),v(),v(),l(ja,"bearing"),l(W3,"calculateFinalBearing"),v(),l(H3,"center");var cu=H3;v(),v(),v(),v(),v();var fB=Zt(tP());function pB(t){if(!t)throw new Error("geojson is required");var e=[];return Qn(t,(function(t){hB(t,e)})),We(e)}function hB(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=ar(r);break;case"LineString":n=[ar(r)]}n.forEach((function(n){dB(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}function dB(t,e){var n=[];return t.reduce((function(t,r){var i=Tr([t,r],e);return i.bbox=gB(t,r),n.push(i),r})),n}function gB(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]}v(),v(),v(),v(),l(pB,"lineSegment"),l(hB,"lineSegmentFeature"),l(dB,"createSegments"),l(gB,"bbox");var pu=pB,vP=Zt(Bg());function GB(t,e){var n={},r=[];if("LineString"===t.type&&(t=mn(t)),"LineString"===e.type&&(e=mn(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=yP(t,e);return i&&r.push(i),We(r)}var o=(0,vP.default)();return o.load(pu(e)),or(pu(t),(function(t){or(o.search(t),(function(e){var i=yP(t,e);if(i){var o=ar(i).join(",");n[o]||(n[o]=!0,r.push(i))}}))})),We(r)}function yP(t,e){var n=ar(t),r=ar(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),f=(c-l)*(o-u)-(h-u)*(i-l),d=(s-i)*(o-u)-(a-o)*(i-l);if(0===p)return null;var g=f/p,y=d/p;return g>=0&&g<=1&&y>=0&&y<=1?Gt([i+g*(s-i),o+g*(a-o)]):null}l(GB,"lineIntersect"),l(yP,"intersects");var hu=GB;function UB(t,e,n){void 0===n&&(n={});var r=Gt([1/0,1/0],{dist:1/0}),i=0;return Qn(t,(function(t){for(var o=ar(t),s=0;s<o.length-1;s++){var a=Gt(o[s]);a.properties.dist=Ir(e,a,n);var l=Gt(o[s+1]);l.properties.dist=Ir(e,l,n);var u=Ir(a,l,n),c=Math.max(a.properties.dist,l.properties.dist),h=ja(a,l),p=oa(e,c,h+90,n),f=oa(e,c,h-90,n),d=hu(Tr([p.geometry.coordinates,f.geometry.coordinates]),Tr([a.geometry.coordinates,l.geometry.coordinates])),g=null;d.features.length>0&&((g=d.features[0]).properties.dist=Ir(e,g,n),g.properties.location=i+Ir(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(UB,"nearestPointOnLine");var za=UB;v(),v(),v();var XB=Zt(xg());function du(t,e){return void 0===e&&(e={}),EI(t,(function(t,n){var r=n.geometry.coordinates;return t+Ir(r[0],r[1],e)}),0)}function YB(t,e,n){var r=ar(n);if("LineString"!==Bi(n))throw new Error("line must be a LineString");for(var i,o=za(n,t),s=za(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),Tr(a,n.properties)}v(),v(),v(),v(),v(),v(),l(du,"length"),v(),l(YB,"lineSlice");var zg=YB;function WB(t,e,n){void 0===n&&(n={});for(var r=Lr(t),i=ar(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")),HB(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1}function HB(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}v(),v(),v(),v(),l(WB,"booleanPointOnLine"),l(HB,"isPointOnLineSegment");var hl=WB;v(),v(),v(),v();var JB=Zt(L1());v();var bP=Math.PI/180,wP=180/Math.PI,hp=l((function(t,e){this.lon=t,this.lat=e,this.x=bP*t,this.y=bP*e}),"Coord");hp.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},hp.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new hp(e,t)};var xP=l((function(){this.coords=[],this.length=0}),"LineString");xP.prototype.move_to=function(t){this.length++,this.coords.push(t)};var t_=l((function(t){this.properties=t||{},this.geometries=[]}),"Arc");t_.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}},t_.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 EP=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 hp(t.x,t.y),this.end=new hp(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");EP.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=wP*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[wP*Math.atan2(i,r),s]},EP.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 L=new t_(this.properties),A=0;A<v.length;++A){var T=new xP;L.geometries.push(T);for(var D=v[A],R=0;R<D.length;++R)T.move_to(D[R])}return L},v();var ej=Zt(Bg());v(),v(),v(),v(),v(),v();var kz=Zt(Bg()),Nz=Zt(C_());v(),v(),v(),v(),v(),v(),v();var Az=Zt(xg()),et=[],tt=[],rt=[],nt=[],it=[],ot=[],at=[],st=[],ut=[],lt=[],ct=[],ft=[],pt=[],ht=[],dt=[],gt=[],mt=[],vt=[],yt=[],_t=[],bt=[],wt=[],xt=[],Et=[];at[85]=lt[85]=-1,st[85]=ct[85]=0,ut[85]=ft[85]=1,yt[85]=wt[85]=1,_t[85]=xt[85]=0,bt[85]=Et[85]=1,et[85]=nt[85]=0,tt[85]=it[85]=-1,rt[85]=dt[85]=0,gt[85]=pt[85]=0,mt[85]=ht[85]=1,ot[85]=vt[85]=1,wt[1]=wt[169]=0,xt[1]=xt[169]=-1,Et[1]=Et[169]=0,pt[1]=pt[169]=-1,ht[1]=ht[169]=0,dt[1]=dt[169]=0,lt[4]=lt[166]=0,ct[4]=ct[166]=-1,ft[4]=ft[166]=1,gt[4]=gt[166]=1,mt[4]=mt[166]=0,vt[4]=vt[166]=0,at[16]=at[154]=0,st[16]=st[154]=1,ut[16]=ut[154]=1,nt[16]=nt[154]=1,it[16]=it[154]=0,ot[16]=ot[154]=1,yt[64]=yt[106]=0,_t[64]=_t[106]=1,bt[64]=bt[106]=0,et[64]=et[106]=-1,tt[64]=tt[106]=0,rt[64]=rt[106]=1,yt[2]=yt[168]=0,_t[2]=_t[168]=-1,bt[2]=bt[168]=1,wt[2]=wt[168]=0,xt[2]=xt[168]=-1,Et[2]=Et[168]=0,pt[2]=pt[168]=-1,ht[2]=ht[168]=0,dt[2]=dt[168]=0,gt[2]=gt[168]=-1,mt[2]=mt[168]=0,vt[2]=vt[168]=1,at[8]=at[162]=0,st[8]=st[162]=-1,ut[8]=ut[162]=0,lt[8]=lt[162]=0,ct[8]=ct[162]=-1,ft[8]=ft[162]=1,pt[8]=pt[162]=1,ht[8]=ht[162]=0,dt[8]=dt[162]=1,gt[8]=gt[162]=1,mt[8]=mt[162]=0,vt[8]=vt[162]=0,at[32]=at[138]=0,st[32]=st[138]=1,ut[32]=ut[138]=1,lt[32]=lt[138]=0,ct[32]=ct[138]=1,ft[32]=ft[138]=0,et[32]=et[138]=1,tt[32]=tt[138]=0,rt[32]=rt[138]=0,nt[32]=nt[138]=1,it[32]=it[138]=0,ot[32]=ot[138]=1,wt[128]=wt[42]=0,xt[128]=xt[42]=1,Et[128]=Et[42]=1,yt[128]=yt[42]=0,_t[128]=_t[42]=1,bt[128]=bt[42]=0,et[128]=et[42]=-1,tt[128]=tt[42]=0,rt[128]=rt[42]=1,nt[128]=nt[42]=-1,it[128]=it[42]=0,ot[128]=ot[42]=0,lt[5]=lt[165]=-1,ct[5]=ct[165]=0,ft[5]=ft[165]=0,wt[5]=wt[165]=1,xt[5]=xt[165]=0,Et[5]=Et[165]=0,gt[20]=gt[150]=0,mt[20]=mt[150]=1,vt[20]=vt[150]=1,nt[20]=nt[150]=0,it[20]=it[150]=-1,ot[20]=ot[150]=1,at[80]=at[90]=-1,st[80]=st[90]=0,ut[80]=ut[90]=1,yt[80]=yt[90]=1,_t[80]=_t[90]=0,bt[80]=bt[90]=1,pt[65]=pt[105]=0,ht[65]=ht[105]=1,dt[65]=dt[105]=0,et[65]=et[105]=0,tt[65]=tt[105]=-1,rt[65]=rt[105]=0,at[160]=at[10]=-1,st[160]=st[10]=0,ut[160]=ut[10]=1,lt[160]=lt[10]=-1,ct[160]=ct[10]=0,ft[160]=ft[10]=0,wt[160]=wt[10]=1,xt[160]=xt[10]=0,Et[160]=Et[10]=0,yt[160]=yt[10]=1,_t[160]=_t[10]=0,bt[160]=bt[10]=1,gt[130]=gt[40]=0,mt[130]=mt[40]=1,vt[130]=vt[40]=1,pt[130]=pt[40]=0,ht[130]=ht[40]=1,dt[130]=dt[40]=0,et[130]=et[40]=0,tt[130]=tt[40]=-1,rt[130]=rt[40]=0,nt[130]=nt[40]=0,it[130]=it[40]=-1,ot[130]=ot[40]=1,lt[37]=lt[133]=0,ct[37]=ct[133]=1,ft[37]=ft[133]=1,wt[37]=wt[133]=0,xt[37]=xt[133]=1,Et[37]=Et[133]=0,et[37]=et[133]=-1,tt[37]=tt[133]=0,rt[37]=rt[133]=0,nt[37]=nt[133]=1,it[37]=it[133]=0,ot[37]=ot[133]=0,gt[148]=gt[22]=-1,mt[148]=mt[22]=0,vt[148]=vt[22]=0,wt[148]=wt[22]=0,xt[148]=xt[22]=-1,Et[148]=Et[22]=1,yt[148]=yt[22]=0,_t[148]=_t[22]=1,bt[148]=bt[22]=1,nt[148]=nt[22]=-1,it[148]=it[22]=0,ot[148]=ot[22]=1,at[82]=at[88]=0,st[82]=st[88]=-1,ut[82]=ut[88]=1,gt[82]=gt[88]=1,mt[82]=mt[88]=0,vt[82]=vt[88]=1,pt[82]=pt[88]=-1,ht[82]=ht[88]=0,dt[82]=dt[88]=1,yt[82]=yt[88]=0,_t[82]=_t[88]=-1,bt[82]=bt[88]=0,at[73]=at[97]=0,st[73]=st[97]=1,ut[73]=ut[97]=0,lt[73]=lt[97]=0,ct[73]=ct[97]=-1,ft[73]=ft[97]=0,pt[73]=pt[97]=1,ht[73]=ht[97]=0,dt[73]=dt[97]=0,et[73]=et[97]=1,tt[73]=tt[97]=0,rt[73]=rt[97]=1,at[145]=at[25]=0,st[145]=st[25]=-1,ut[145]=ut[25]=0,pt[145]=pt[25]=1,ht[145]=ht[25]=0,dt[145]=dt[25]=1,wt[145]=wt[25]=0,xt[145]=xt[25]=1,Et[145]=Et[25]=1,nt[145]=nt[25]=-1,it[145]=it[25]=0,ot[145]=ot[25]=0,lt[70]=lt[100]=0,ct[70]=ct[100]=1,ft[70]=ft[100]=0,gt[70]=gt[100]=-1,mt[70]=mt[100]=0,vt[70]=vt[100]=1,yt[70]=yt[100]=0,_t[70]=_t[100]=-1,bt[70]=bt[100]=1,et[70]=et[100]=1,tt[70]=tt[100]=0,rt[70]=rt[100]=0,lt[101]=lt[69]=0,ct[101]=ct[69]=1,ft[101]=ft[69]=0,et[101]=et[69]=1,tt[101]=tt[69]=0,rt[101]=rt[69]=0,wt[149]=wt[21]=0,xt[149]=xt[21]=1,Et[149]=Et[21]=1,nt[149]=nt[21]=-1,it[149]=it[21]=0,ot[149]=ot[21]=0,gt[86]=gt[84]=-1,mt[86]=mt[84]=0,vt[86]=vt[84]=1,yt[86]=yt[84]=0,_t[86]=_t[84]=-1,bt[86]=bt[84]=1,at[89]=at[81]=0,st[89]=st[81]=-1,ut[89]=ut[81]=0,pt[89]=pt[81]=1,ht[89]=ht[81]=0,dt[89]=dt[81]=1,at[96]=at[74]=0,st[96]=st[74]=1,ut[96]=ut[74]=0,lt[96]=lt[74]=-1,ct[96]=ct[74]=0,ft[96]=ft[74]=1,yt[96]=yt[74]=1,_t[96]=_t[74]=0,bt[96]=bt[74]=0,et[96]=et[74]=1,tt[96]=tt[74]=0,rt[96]=rt[74]=1,at[24]=at[146]=0,st[24]=st[146]=-1,ut[24]=ut[146]=1,gt[24]=gt[146]=1,mt[24]=mt[146]=0,vt[24]=vt[146]=1,pt[24]=pt[146]=0,ht[24]=ht[146]=1,dt[24]=dt[146]=1,nt[24]=nt[146]=0,it[24]=it[146]=-1,ot[24]=ot[146]=0,lt[6]=lt[164]=-1,ct[6]=ct[164]=0,ft[6]=ft[164]=1,gt[6]=gt[164]=-1,mt[6]=mt[164]=0,vt[6]=vt[164]=0,wt[6]=wt[164]=0,xt[6]=xt[164]=-1,Et[6]=Et[164]=1,yt[6]=yt[164]=1,_t[6]=_t[164]=0,bt[6]=bt[164]=0,pt[129]=pt[41]=0,ht[129]=ht[41]=1,dt[129]=dt[41]=1,wt[129]=wt[41]=0,xt[129]=xt[41]=1,Et[129]=Et[41]=0,et[129]=et[41]=-1,tt[129]=tt[41]=0,rt[129]=rt[41]=0,nt[129]=nt[41]=0,it[129]=it[41]=-1,ot[129]=ot[41]=0,gt[66]=gt[104]=0,mt[66]=mt[104]=1,vt[66]=vt[104]=0,pt[66]=pt[104]=-1,ht[66]=ht[104]=0,dt[66]=dt[104]=1,yt[66]=yt[104]=0,_t[66]=_t[104]=-1,bt[66]=bt[104]=0,et[66]=et[104]=0,tt[66]=tt[104]=-1,rt[66]=rt[104]=1,at[144]=at[26]=-1,st[144]=st[26]=0,ut[144]=ut[26]=0,wt[144]=wt[26]=1,xt[144]=xt[26]=0,Et[144]=Et[26]=1,yt[144]=yt[26]=0,_t[144]=_t[26]=1,bt[144]=bt[26]=1,nt[144]=nt[26]=-1,it[144]=it[26]=0,ot[144]=ot[26]=1,lt[36]=lt[134]=0,ct[36]=ct[134]=1,ft[36]=ft[134]=1,gt[36]=gt[134]=0,mt[36]=mt[134]=1,vt[36]=vt[134]=0,et[36]=et[134]=0,tt[36]=tt[134]=-1,rt[36]=rt[134]=1,nt[36]=nt[134]=1,it[36]=it[134]=0,ot[36]=ot[134]=0,at[9]=at[161]=-1,st[9]=st[161]=0,ut[9]=ut[161]=0,lt[9]=lt[161]=0,ct[9]=ct[161]=-1,ft[9]=ft[161]=0,pt[9]=pt[161]=1,ht[9]=ht[161]=0,dt[9]=dt[161]=0,wt[9]=wt[161]=1,xt[9]=xt[161]=0,Et[9]=Et[161]=1,at[136]=0,st[136]=1,ut[136]=1,lt[136]=0,ct[136]=1,ft[136]=0,gt[136]=-1,mt[136]=0,vt[136]=1,pt[136]=-1,ht[136]=0,dt[136]=0,wt[136]=0,xt[136]=-1,Et[136]=0,yt[136]=0,_t[136]=-1,bt[136]=1,et[136]=1,tt[136]=0,rt[136]=0,nt[136]=1,it[136]=0,ot[136]=1,at[34]=0,st[34]=-1,ut[34]=0,lt[34]=0,ct[34]=-1,ft[34]=1,gt[34]=1,mt[34]=0,vt[34]=0,pt[34]=1,ht[34]=0,dt[34]=1,wt[34]=0,xt[34]=1,Et[34]=1,yt[34]=0,_t[34]=1,bt[34]=0,et[34]=-1,tt[34]=0,rt[34]=1,nt[34]=-1,it[34]=0,ot[34]=0,at[35]=0,st[35]=1,ut[35]=1,lt[35]=0,ct[35]=-1,ft[35]=1,gt[35]=1,mt[35]=0,vt[35]=0,pt[35]=-1,ht[35]=0,dt[35]=0,wt[35]=0,xt[35]=-1,Et[35]=0,yt[35]=0,_t[35]=1,bt[35]=0,et[35]=-1,tt[35]=0,rt[35]=1,nt[35]=1,it[35]=0,ot[35]=1,at[153]=0,st[153]=1,ut[153]=1,pt[153]=-1,ht[153]=0,dt[153]=0,wt[153]=0,xt[153]=-1,Et[153]=0,nt[153]=1,it[153]=0,ot[153]=1,lt[102]=0,ct[102]=-1,ft[102]=1,gt[102]=1,mt[102]=0,vt[102]=0,yt[102]=0,_t[102]=1,bt[102]=0,et[102]=-1,tt[102]=0,rt[102]=1,at[155]=0,st[155]=-1,ut[155]=0,pt[155]=1,ht[155]=0,dt[155]=1,wt[155]=0,xt[155]=1,Et[155]=1,nt[155]=-1,it[155]=0,ot[155]=0,lt[103]=0,ct[103]=1,ft[103]=0,gt[103]=-1,mt[103]=0,vt[103]=1,yt[103]=0,_t[103]=-1,bt[103]=1,et[103]=1,tt[103]=0,rt[103]=0,at[152]=0,st[152]=1,ut[152]=1,gt[152]=-1,mt[152]=0,vt[152]=1,pt[152]=-1,ht[152]=0,dt[152]=0,wt[152]=0,xt[152]=-1,Et[152]=0,yt[152]=0,_t[152]=-1,bt[152]=1,nt[152]=1,it[152]=0,ot[152]=1,at[156]=0,st[156]=-1,ut[156]=1,gt[156]=1,mt[156]=0,vt[156]=1,pt[156]=-1,ht[156]=0,dt[156]=0,wt[156]=0,xt[156]=-1,Et[156]=0,yt[156]=0,_t[156]=1,bt[156]=1,nt[156]=-1,it[156]=0,ot[156]=1,at[137]=0,st[137]=1,ut[137]=1,lt[137]=0,ct[137]=1,ft[137]=0,pt[137]=-1,ht[137]=0,dt[137]=0,wt[137]=0,xt[137]=-1,Et[137]=0,et[137]=1,tt[137]=0,rt[137]=0,nt[137]=1,it[137]=0,ot[137]=1,at[139]=0,st[139]=1,ut[139]=1,lt[139]=0,ct[139]=-1,ft[139]=0,pt[139]=1,ht[139]=0,dt[139]=0,wt[139]=0,xt[139]=1,Et[139]=0,et[139]=-1,tt[139]=0,rt[139]=0,nt[139]=1,it[139]=0,ot[139]=1,at[98]=0,st[98]=-1,ut[98]=0,lt[98]=0,ct[98]=-1,ft[98]=1,gt[98]=1,mt[98]=0,vt[98]=0,pt[98]=1,ht[98]=0,dt[98]=1,yt[98]=0,_t[98]=1,bt[98]=0,et[98]=-1,tt[98]=0,rt[98]=1,at[99]=0,st[99]=1,ut[99]=0,lt[99]=0,ct[99]=-1,ft[99]=1,gt[99]=1,mt[99]=0,vt[99]=0,pt[99]=-1,ht[99]=0,dt[99]=1,yt[99]=0,_t[99]=-1,bt[99]=0,et[99]=1,tt[99]=0,rt[99]=1,lt[38]=0,ct[38]=-1,ft[38]=1,gt[38]=1,mt[38]=0,vt[38]=0,wt[38]=0,xt[38]=1,Et[38]=1,yt[38]=0,_t[38]=1,bt[38]=0,et[38]=-1,tt[38]=0,rt[38]=1,nt[38]=-1,it[38]=0,ot[38]=0,lt[39]=0,ct[39]=1,ft[39]=1,gt[39]=-1,mt[39]=0,vt[39]=0,wt[39]=0,xt[39]=-1,Et[39]=1,yt[39]=0,_t[39]=1,bt[39]=0,et[39]=-1,tt[39]=0,rt[39]=1,nt[39]=1,it[39]=0,ot[39]=0;var k_=l((function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p00"),N_=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]}),"p01"),O_=l((function(t){return[[t.topright,1],[1,1],[1,t.righttop]]}),"p02"),T_=l((function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]}),"p03"),A_=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]}),"p04"),L_=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]}),"p05"),R_=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]}),"p06"),D_=l((function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]}),"p07"),Lz=l((function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]}),"p08"),Rz=l((function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]}),"p09"),Dz=l((function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]}),"p10"),Fz=l((function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p11"),Bz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]}),"p12"),jz=l((function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]}),"p13"),zz=l((function(){return[[0,0],[0,1],[1,1],[1,0]]}),"p14"),qz=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]}),"p15"),Gz=l((function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]}),"p16"),Uz=l((function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]}),"p17"),Vz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]}),"p18"),Xz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p19"),Yz=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]}),"p20"),Wz=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]}),"p21"),Hz=l((function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]}),"p22"),$z=l((function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p23"),Kz=l((function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p24"),Jz=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]}),"p25"),Zz=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]}),"p26"),Qz=l((function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]}),"p27"),eq=l((function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]}),"p28"),tq=l((function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]}),"p29"),rq=l((function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]}),"p30"),nq=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p31"),iq=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p32"),oq=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"),aq=l((function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]}),"p34"),sq=l((function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]}),"p35"),uq=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"),lq=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"),cq=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"),fq=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"),Nt=[],Ot=[],Tt=[],At=[],Lt=[],Rt=[],Dt=[],Ft=[];At[1]=Lt[1]=18,At[169]=Lt[169]=18,Tt[4]=Ot[4]=12,Tt[166]=Ot[166]=12,Nt[16]=Ft[16]=4,Nt[154]=Ft[154]=4,Rt[64]=Dt[64]=22,Rt[106]=Dt[106]=22,Tt[2]=Rt[2]=17,At[2]=Lt[2]=18,Tt[168]=Rt[168]=17,At[168]=Lt[168]=18,Nt[8]=At[8]=9,Ot[8]=Tt[8]=12,Nt[162]=At[162]=9,Ot[162]=Tt[162]=12,Nt[32]=Ft[32]=4,Ot[32]=Dt[32]=1,Nt[138]=Ft[138]=4,Ot[138]=Dt[138]=1,Lt[128]=Ft[128]=21,Rt[128]=Dt[128]=22,Lt[42]=Ft[42]=21,Rt[42]=Dt[42]=22,Ot[5]=Lt[5]=14,Ot[165]=Lt[165]=14,Tt[20]=Ft[20]=6,Tt[150]=Ft[150]=6,Nt[80]=Rt[80]=11,Nt[90]=Rt[90]=11,At[65]=Dt[65]=3,At[105]=Dt[105]=3,Nt[160]=Rt[160]=11,Ot[160]=Lt[160]=14,Nt[10]=Rt[10]=11,Ot[10]=Lt[10]=14,Tt[130]=Ft[130]=6,At[130]=Dt[130]=3,Tt[40]=Ft[40]=6,At[40]=Dt[40]=3,Ot[101]=Dt[101]=1,Ot[69]=Dt[69]=1,Lt[149]=Ft[149]=21,Lt[21]=Ft[21]=21,Tt[86]=Rt[86]=17,Tt[84]=Rt[84]=17,Nt[89]=At[89]=9,Nt[81]=At[81]=9,Nt[96]=Dt[96]=0,Ot[96]=Rt[96]=15,Nt[74]=Dt[74]=0,Ot[74]=Rt[74]=15,Nt[24]=Tt[24]=8,At[24]=Ft[24]=7,Nt[146]=Tt[146]=8,At[146]=Ft[146]=7,Ot[6]=Rt[6]=15,Tt[6]=Lt[6]=16,Ot[164]=Rt[164]=15,Tt[164]=Lt[164]=16,At[129]=Ft[129]=7,Lt[129]=Dt[129]=20,At[41]=Ft[41]=7,Lt[41]=Dt[41]=20,Tt[66]=Dt[66]=2,At[66]=Rt[66]=19,Tt[104]=Dt[104]=2,At[104]=Rt[104]=19,Nt[144]=Lt[144]=10,Rt[144]=Ft[144]=23,Nt[26]=Lt[26]=10,Rt[26]=Ft[26]=23,Ot[36]=Ft[36]=5,Tt[36]=Dt[36]=2,Ot[134]=Ft[134]=5,Tt[134]=Dt[134]=2,Nt[9]=Lt[9]=10,Ot[9]=At[9]=13,Nt[161]=Lt[161]=10,Ot[161]=At[161]=13,Ot[37]=Ft[37]=5,Lt[37]=Dt[37]=20,Ot[133]=Ft[133]=5,Lt[133]=Dt[133]=20,Tt[148]=Lt[148]=16,Rt[148]=Ft[148]=23,Tt[22]=Lt[22]=16,Rt[22]=Ft[22]=23,Nt[82]=Tt[82]=8,At[82]=Rt[82]=19,Nt[88]=Tt[88]=8,At[88]=Rt[88]=19,Nt[73]=Dt[73]=0,Ot[73]=At[73]=13,Nt[97]=Dt[97]=0,Ot[97]=At[97]=13,Nt[145]=At[145]=9,Lt[145]=Ft[145]=21,Nt[25]=At[25]=9,Lt[25]=Ft[25]=21,Ot[70]=Dt[70]=1,Tt[70]=Rt[70]=17,Ot[100]=Dt[100]=1,Tt[100]=Rt[100]=17,Nt[34]=At[34]=9,Ot[34]=Tt[34]=12,Lt[34]=Ft[34]=21,Rt[34]=Dt[34]=22,Nt[136]=Ft[136]=4,Ot[136]=Dt[136]=1,Tt[136]=Rt[136]=17,At[136]=Lt[136]=18,Nt[35]=Ft[35]=4,Ot[35]=Tt[35]=12,At[35]=Lt[35]=18,Rt[35]=Dt[35]=22,Nt[153]=Ft[153]=4,At[153]=Lt[153]=18,Ot[102]=Tt[102]=12,Rt[102]=Dt[102]=22,Nt[155]=At[155]=9,Lt[155]=Ft[155]=23,Ot[103]=Dt[103]=1,Tt[103]=Rt[103]=17,Nt[152]=Ft[152]=4,Tt[152]=Rt[152]=17,At[152]=Lt[152]=18,Nt[156]=Tt[156]=8,At[156]=Lt[156]=18,Rt[156]=Ft[156]=23,Nt[137]=Ft[137]=4,Ot[137]=Dt[137]=1,At[137]=Lt[137]=18,Nt[139]=Ft[139]=4,Ot[139]=At[139]=13,Lt[139]=Dt[139]=20,Nt[98]=At[98]=9,Ot[98]=Tt[98]=12,Rt[98]=Dt[98]=22,Nt[99]=Dt[99]=0,Ot[99]=Tt[99]=12,At[99]=Rt[99]=19,Ot[38]=Tt[38]=12,Lt[38]=Ft[38]=21,Rt[38]=Dt[38]=22,Ot[39]=Ft[39]=5,Tt[39]=Lt[39]=16,Rt[39]=Dt[39]=22;var we=[];function hq(t){return(t>0)-(t<0)||+t}function Ml(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return hq(r*(n[1]-e[1])-o*i)}function dC(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 F_(t,e){return e.geometry.coordinates[0].every((function(e){return An(Gt(e),t)}))}function gC(t,e){return t[0]===e[0]&&t[1]===e[1]}we[1]=we[169]=k_,we[4]=we[166]=N_,we[16]=we[154]=O_,we[64]=we[106]=T_,we[168]=we[2]=A_,we[162]=we[8]=L_,we[138]=we[32]=R_,we[42]=we[128]=D_,we[5]=we[165]=Lz,we[20]=we[150]=Rz,we[80]=we[90]=Dz,we[65]=we[105]=Fz,we[160]=we[10]=Bz,we[130]=we[40]=jz,we[85]=zz,we[101]=we[69]=qz,we[149]=we[21]=Gz,we[86]=we[84]=Uz,we[89]=we[81]=Vz,we[96]=we[74]=Xz,we[24]=we[146]=Yz,we[6]=we[164]=Wz,we[129]=we[41]=Hz,we[66]=we[104]=$z,we[144]=we[26]=Kz,we[36]=we[134]=Jz,we[9]=we[161]=Zz,we[37]=we[133]=Qz,we[148]=we[22]=eq,we[82]=we[88]=tq,we[73]=we[97]=rq,we[145]=we[25]=nq,we[70]=we[100]=iq,we[34]=function(t){return[D_(t),L_(t)]},we[35]=oq,we[136]=function(t){return[R_(t),A_(t)]},we[153]=function(t){return[O_(t),k_(t)]},we[102]=function(t){return[N_(t),T_(t)]},we[155]=aq,we[103]=sq,we[152]=function(t){return[O_(t),A_(t)]},we[156]=uq,we[137]=function(t){return[R_(t),k_(t)]},we[139]=lq,we[98]=function(t){return[L_(t),T_(t)]},we[99]=cq,we[38]=function(t){return[N_(t),D_(t)]},we[39]=fq,v(),v(),v(),v(),v(),v(),v(),v(),l(hq,"mathSign"),l(Ml,"orientationIndex"),l(dC,"envelopeIsEqual"),l(F_,"envelopeContains"),l(gC,"coordinatesEqual");var dq=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=Ml(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}(),B_=dq;v();var gq=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 Tr([this.from.coordinates,this.to.coordinates])},t.prototype.compareTo=function(t){return Ml(t.from.coordinates,t.to.coordinates,this.to.coordinates)},t}(),mC=gq;v();var mq=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=Ml(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 v1(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=hr([t])},t.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=R1(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()),!dC(o,i)&&F_(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 gC(t,e.from.coordinates)}))||(a=t)}),"_loop_1"),c=0,h=s;c<h.length;c++){u(h[c])}a&&e.inside(Gt(a))&&(!r||F_(n,o))&&(r=e)}})),r},t.prototype.inside=function(t){return An(t,this.toPolygon())},t}(),j_=mq;function vq(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(vq,"validateGeoJson");var bee=function(){function t(){this.edges=[],this.nodes={}}return l(t,"Graph"),t.fromGeoJson=function(e){vq(e);var n=new t;return Qn(e,(function(t){_1(t,"LineString","Graph::fromGeoJson"),xI(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=B_.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new B_(t)),n},t.prototype.addEdge=function(t,e){var n=new mC(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;void 0===t?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 j_;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}();v(),v(),v(),v();var wq=Zt(z_());v();var xq=Zt(z_());v(),v();var Mq=Zt(IC());v();var Oq=Zt(RC());function FC(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function Aq(){return new BC((function(t){return t.f}))}v(),v(),l(FC,"pathTo"),l(Aq,"getHeap");var V_={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||V_.heuristics.manhattan,o=r.closest||!1,s=Aq(),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var l=s.pop();if(l===n)return FC(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?FC(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 wp(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 am(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function am(t,e,n){this.x=t,this.y=e,this.weight=n}function BC(t){this.content=[],this.scoreFunction=t}function X_(){this._=null}function Pl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function xp(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 Ep(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 jC(t){for(;t.L;)t=t.L;return t}l(wp,"Graph"),wp.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)V_.cleanNode(this.nodes[t])},wp.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)V_.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},wp.prototype.markDirty=function(t){this.dirtyNodes.push(t)},wp.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},wp.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(am,"GridNode"),am.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},am.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},am.prototype.isWall=function(){return 0===this.weight},l(BC,"BinaryHeap"),BC.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}}},v(),v(),v(),v(),v(),v(),v(),v(),l(X_,"RedBlackTree"),l(Pl,"RedBlackNode"),X_.prototype={constructor:X_,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=jC(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&&(xp(this,n),n=(t=n).U),n.C=!1,r.C=!0,Ep(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Ep(this,n),n=(t=n).U),n.C=!1,r.C=!0,xp(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?jC(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,xp(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,Ep(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,xp(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Ep(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,xp(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Ep(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},l(xp,"RedBlackRotateLeft"),l(Ep,"RedBlackRotateRight"),l(jC,"RedBlackFirst");var Y_=X_;function Sl(t,e,n,r){var i=[null,null],o=Ln.push(i)-1;return i.left=t,i.right=e,n&&Mp(i,t,e,n),r&&Mp(i,e,t,r),pi[t.index].halfedges.push(o),pi[e.index].halfedges.push(o),i}function Cl(t,e,n){var r=[e,n];return r.left=t,r}function Mp(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 Lq(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 Rq(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 zC(t,e,n,r){for(var i,o=Ln.length;o--;)Rq(i=Ln[o],t,e,n,r)&&Lq(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>sr||Math.abs(i[0][1]-i[1][1])>sr)||delete Ln[o]}function qC(t){return pi[t.index]={site:t,halfedges:[]}}function Dq(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 W_(t,e){return e[+(e.left!==t.site)]}function Fq(t,e){return e[+(e.left===t.site)]}function GC(){for(var t,e,n,r,i=0,o=pi.length;i<o;++i)if((t=pi[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]=Dq(t,Ln[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 UC(t,e,n,r){var i,o,s,a,l,u,c,h,p,f,d,g,y=pi.length,v=!0;for(i=0;i<y;++i)if(o=pi[i]){for(s=o.site,a=(l=o.halfedges).length;a--;)Ln[l[a]]||l.splice(a,1);for(a=0,u=l.length;a<u;)d=(f=Fq(o,Ln[l[a]]))[0],g=f[1],h=(c=W_(o,Ln[l[++a%u]]))[0],p=c[1],(Math.abs(d-h)>sr||Math.abs(g-p)>sr)&&(l.splice(a,0,Ln.push(Cl(s,f,Math.abs(d-t)<sr&&r-g>sr?[t,Math.abs(h-t)<sr?p:r]:Math.abs(g-r)<sr&&n-d>sr?[Math.abs(p-r)<sr?h:n,r]:Math.abs(d-n)<sr&&g-e>sr?[n,Math.abs(h-n)<sr?p:e]:Math.abs(g-e)<sr&&d-t>sr?[Math.abs(p-e)<sr?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=pi[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(Ln.push(Cl(s=v.site,x,E))-1,Ln.push(Cl(s,E,I))-1,Ln.push(Cl(s,I,S))-1,Ln.push(Cl(s,S,x))-1)}}for(i=0;i<y;++i)(o=pi[i])&&(o.halfedges.length||delete pi[i])}v(),v(),l(Sl,"createEdge"),l(Cl,"createBorderEdge"),l(Mp,"setEdgeEnd"),l(Lq,"clipEdge"),l(Rq,"connectEdge"),l(zC,"clipEdges"),l(qC,"createCell"),l(Dq,"cellHalfedgeAngle"),l(W_,"cellHalfedgeStart"),l(Fq,"cellHalfedgeEnd"),l(GC,"sortCellHalfedges"),l(UC,"clipCells"),v();var sm,VC=[];function Bq(){Pl(this),this.x=this.y=this.arc=this.site=this.cy=null}function yu(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>=-XC)){var f=l*l+u*u,d=c*c+h*h,g=(h*f-u*d)/p,y=(l*d-c*f)/p,v=VC.pop()||new Bq;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,_=kl._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}kl.insert(m,v),m||(sm=v)}}}}function _u(t){var e=t.circle;e&&(e.P||(sm=e.N),kl.remove(e),VC.push(e),Pl(e),t.circle=null)}l(Bq,"Circle"),l(yu,"attachCircle"),l(_u,"detachCircle");var YC=[];function jq(){Pl(this),this.edge=this.site=this.circle=null}function WC(t){var e=YC.pop()||new jq;return e.site=t,e}function H_(t){_u(t),bu.remove(t),YC.push(t),Pl(t)}function HC(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];H_(t);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<sr&&Math.abs(r-l.circle.cy)<sr;)o=l.P,a.unshift(l),H_(l),l=o;a.unshift(l),_u(l);for(var u=s;u.circle&&Math.abs(n-u.circle.x)<sr&&Math.abs(r-u.circle.cy)<sr;)s=u.N,a.push(u),H_(u),u=s;a.push(u),_u(u);var c,h=a.length;for(c=1;c<h;++c)u=a[c],l=a[c-1],Mp(u.edge,l.site,u.site,i);l=a[0],(u=a[h-1]).edge=Sl(l.site,u.site,null,i),yu(l),yu(u)}function $C(t){for(var e,n,r,i,o=t[0],s=t[1],a=bu._;a;)if((r=KC(a,s)-o)>sr)a=a.L;else{if(!((i=o-zq(a,s))>sr)){r>-sr?(e=a.P,n=a):i>-sr?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}qC(t);var l=WC(t);if(bu.insert(e,l),e||n){if(e===n)return _u(e),n=WC(e.site),bu.insert(l,n),l.edge=n.edge=Sl(e.site,l.site),yu(e),void yu(n);if(!n)return void(l.edge=Sl(e.site,l.site));_u(e),_u(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];Mp(n.edge,u,d,b),l.edge=Sl(u,t,null,b),n.edge=Sl(t,d,null,b),yu(e),yu(n)}}function KC(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 zq(t,e){var n=t.N;if(n)return KC(n,e);var r=t.site;return r[1]===e?r[0]:1/0}l(jq,"Beach"),l(WC,"createBeach"),l(H_,"detachBeach"),l(HC,"removeBeach"),l($C,"addBeach"),l(KC,"leftBreakPoint"),l(zq,"rightBreakPoint");var bu,pi,kl,Ln,sr=1e-6,XC=1e-12;function qq(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Gq(t,e){return e[1]-t[1]||e[0]-t[0]}function um(t,e){var n,r,i,o=t.sort(Gq).pop();for(Ln=[],pi=new Array(t.length),bu=new Y_,kl=new Y_;;)if(i=sm,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))(o[0]!==n||o[1]!==r)&&($C(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;HC(i.arc)}if(GC(),e){var s=+e[0][0],a=+e[0][1],l=+e[1][0],u=+e[1][1];zC(s,a,l,u),UC(s,a,l,u)}this.edges=Ln,this.cells=pi,bu=kl=Ln=pi=null}l(qq,"triangleArea"),l(Gq,"lexicographic"),l(um,"Diagram"),um.prototype={constructor:um,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return W_(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&&qq(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}},v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v(),v();var Kq=Zt(Nl());v();var Dl=Zt(ek());function hi(){return new cm}function cm(){this.reset()}v(),v(),v(),l(hi,"default"),l(cm,"Adder"),cm.prototype={constructor:cm,reset:function(){this.s=this.t=0},add:function(t){tk(fm,t,this.t),tk(this,fm.s,this.s),this.s?this.t+=fm.t:this.s=fm.t},valueOf:function(){return this.s}};var fm=new cm;function tk(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}l(tk,"add"),v();var Ue=1e-6,Mt=Math.PI,yn=Mt/2,pm=Mt/4,Vn=2*Mt,di=180/Mt,Dr=Mt/180,$t=Math.abs,Ro=Math.atan,Rn=Math.atan2,ze=Math.cos,hm=Math.exp,Ip=Math.log,qe=Math.sin,sn=Math.sqrt,Pp=Math.tan;function dm(t){return t>1?0:t<-1?Mt:Math.acos(t)}function _n(t){return t>1?yn:t<-1?-yn:Math.asin(t)}function gi(){}function gm(t,e){t&&nk.hasOwnProperty(t.type)&&nk[t.type](t,e)}l(dm,"acos"),l(_n,"asin"),v(),l(gi,"noop"),v(),l(gm,"streamGeometry");var rk={Feature:function(t,e){gm(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)gm(n[r].geometry,e)}},nk={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){J_(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)J_(n[r],e,0)},Polygon:function(t,e){ik(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ik(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)gm(n[r],e)}};function J_(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 ik(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)J_(t[n],e,1);e.polygonEnd()}function Ga(t,e){t&&rk.hasOwnProperty(t.type)?rk[t.type](t,e):gm(t,e)}l(J_,"streamLine"),l(ik,"streamPolygon"),l(Ga,"default");var Jq=hi(),dne=hi();function Ol(t){return[Rn(t[1],t[0]),_n(t[2])]}function Do(t){var e=t[0],n=t[1],r=ze(n);return[r*ze(e),r*qe(e),qe(n)]}function Sp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function wu(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 mm(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Cp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Tl(t){var e=sn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}v(),v(),l(Ol,"spherical"),l(Do,"cartesian"),l(Sp,"cartesianDot"),l(wu,"cartesianCross"),l(mm,"cartesianAddInPlace"),l(Cp,"cartesianScale"),l(Tl,"cartesianNormalizeInPlace");var Mne=hi();function kp(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 Z_(t,e){return[t>Mt?t-Vn:t<-Mt?t+Vn:t,e]}function Q_(t,e,n){return(t%=Vn)?e||n?kp(ak(t),sk(e,n)):ak(t):e||n?sk(e,n):Z_}function ok(t){return function(e,n){return[(e+=t)>Mt?e-Vn:e<-Mt?e+Vn:e,n]}}function ak(t){var e=ok(t);return e.invert=ok(-t),e}function sk(t,e){var n=ze(t),r=qe(t),i=ze(e),o=qe(e);function s(t,e){var s=ze(e),a=ze(t)*s,l=qe(t)*s,u=qe(e),c=u*n+a*r;return[Rn(l*i-c*o,a*n-u*r),_n(c*i+l*o)]}return l(s,"rotation"),s.invert=function(t,e){var s=ze(e),a=ze(t)*s,l=qe(t)*s,u=qe(e),c=u*i-l*o;return[Rn(l*i+u*o,a*n+c*r),_n(c*n-a*r)]},s}function uk(t,e,n,r,i,o){if(n){var s=ze(e),a=qe(e),l=r*n;null==i?(i=e+r*Vn,o=e-l/2):(i=lk(s,i),o=lk(s,o),(r>0?i<o:i>o)&&(i+=r*Vn));for(var u,c=i;r>0?c>o:c<o;c-=l)u=Ol([s,-a*ze(c),-a*qe(c)]),t.point(u[0],u[1])}}function lk(t,e){(e=Do(e))[0]-=t,Tl(e);var n=dm(-e[1]);return((-e[2]<0?-n:n)+Vn-Ue)%Vn}function Np(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:gi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function eb(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 xu(t,e){return $t(t[0]-e[0])<Ue&&$t(t[1]-e[1])<Ue}function vm(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 Op(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(xu(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 vm(r,t,null,!0)),l.push(n.o=new vm(r,null,n,!1)),a.push(n=new vm(s,t,null,!1)),l.push(n.o=new vm(s,null,n,!0))}})),a.length){for(l.sort(e),ck(a),ck(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 ck(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 Ua(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ym(t){return 1===t.length&&(t=Zq(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 Zq(t){return function(e,n){return Ua(t(e),n)}}v(),v(),v(),v(),v(),l(kp,"default"),l(Z_,"rotationIdentity"),Z_.invert=Z_,l(Q_,"rotateRadians"),l(ok,"forwardRotationLambda"),l(ak,"rotationLambda"),l(sk,"rotationPhiGamma"),l(uk,"circleStream"),l(lk,"circleRadius"),v(),v(),l(Np,"default"),v(),l(eb,"default"),v(),v(),l(xu,"default"),l(vm,"Intersection"),l(Op,"default"),l(ck,"link"),v(),v(),v(),l(Ua,"default"),v(),l(ym,"default"),l(Zq,"ascendingComparator");var fk=ym(Ua),Qq=fk.right,e4=fk.left;v(),v(),v(),v(),v(),v(),v(),v(),v();var pk=Array.prototype,r4=pk.slice,n4=pk.map;v(),v(),v(),v();var mie=Math.sqrt(50),vie=Math.sqrt(10),yie=Math.sqrt(2);function Al(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}v(),v(),v(),v(),v(),v(),v(),v(),l(Al,"default"),v(),v(),v(),v(),v(),v(),v();var Tp=1e9,bm=-Tp;function tb(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 $t(r[0]-t)<Ue?i>0?0:3:$t(r[0]-n)<Ue?i>0?2:1:$t(r[1]-e)<Ue?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=Np(),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=Al(u)).length;(e||n)&&(s.polygonStart(),e&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),n&&Op(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(bm,Math.min(Tp,g)),y=Math.max(bm,Math.min(Tp,y))],u=[o=Math.max(bm,Math.min(Tp,o)),s=Math.max(bm,Math.min(Tp,s))];eb(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(tb,"clipExtent"),v(),v();var rb=hi();function wm(t,e){var n=e[0],r=e[1],i=[qe(n),-ze(n),0],o=0,s=0;rb.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+pm,d=qe(f),g=ze(f),y=0;y<c;++y,p=m,d=b,g=w,h=v){var v=u[y],m=v[0],_=v[1]/2+pm,b=qe(_),w=ze(_),x=m-p,E=x>=0?1:-1,I=E*x,S=I>Mt,N=d*b;if(rb.add(Rn(N*E*qe(I),g*w+N*ze(I))),o+=S?x+E*Vn:x,S^p>=n^m>=n){var M=wu(Do(h),Do(v));Tl(M);var C=wu(i,M);Tl(C);var O=(S^x>=0?-1:1)*_n(C[2]);(r>O||r===O&&(M[0]||M[1]))&&(s+=S^x>=0?1:-1)}}return(o<-Ue||o<Ue&&rb<-Ue)^1&s}l(wm,"default"),v(),v();var lae=hi();function Ll(t){return t}v(),v(),v(),v(),l(Ll,"default"),v();var Cae=hi(),kae=hi();v();var Rl=1/0,xm=Rl,Ap=-Rl,Em=Ap,h4={point:d4,lineStart:gi,lineEnd:gi,polygonStart:gi,polygonEnd:gi,result:function(){var t=[[Rl,xm],[Ap,Em]];return Ap=Em=-(xm=Rl=1/0),t}};function d4(t,e){t<Rl&&(Rl=t),t>Ap&&(Ap=t),e<xm&&(xm=e),e>Em&&(Em=e)}l(d4,"boundsPoint");var Mm=h4;function nb(t){this._context=t}v(),v(),l(nb,"PathContext"),nb.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,Vn)}},result:gi},v();var qae=hi();function ib(){this._string=[]}function gk(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Lp(t,e,n,r){return function(i,o){var s,a,u,c=e(o),h=i.invert(r[0],r[1]),p=Np(),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=Al(a);var t=wm(s,h);a.length?(d||(o.polygonStart(),d=!0),Op(a,m4,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(g4))}}return l(y,"point"),l(v,"pointLine"),l(m,"lineStart"),l(_,"lineEnd"),l(b,"pointRing"),l(w,"ringStart"),l(x,"ringEnd"),g}}function g4(t){return t.length>1}function m4(t,e){return((t=t.x)[0]<0?t[1]-yn-Ue:yn-t[1])-((e=e.x)[0]<0?e[1]-yn-Ue:yn-e[1])}v(),l(ib,"PathString"),ib.prototype={_radius:4.5,_circle:gk(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=gk(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(gk,"circle"),v(),v(),v(),v(),v(),v(),l(Lp,"default"),l(g4,"validSegment"),l(m4,"compareIntersection");var ob=Lp((function(){return!0}),v4,_4,[-Mt,-yn]);function v4(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Mt:-Mt,l=$t(o-n);$t(l-Mt)<Ue?(t.point(n,r=(r+s)/2>0?yn:-yn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&l>=Mt&&($t(n-i)<Ue&&(n-=i*Ue),$t(o-a)<Ue&&(o-=a*Ue),r=y4(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 y4(t,e,n,r){var i,o,s=qe(t-n);return $t(s)>Ue?Ro((qe(e)*(o=ze(r))*qe(n)-qe(r)*(i=ze(e))*qe(t))/(i*o*s)):(e+r)/2}function _4(t,e,n,r){var i;if(null==t)i=n*yn,r.point(-Mt,i),r.point(0,i),r.point(Mt,i),r.point(Mt,0),r.point(Mt,-i),r.point(0,-i),r.point(-Mt,-i),r.point(-Mt,0),r.point(-Mt,i);else if($t(t[0]-e[0])>Ue){var o=t[0]<e[0]?Mt:-Mt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function ab(t,e){var n=ze(t),r=n>0,i=$t(n)>Ue;function o(n,r,i,o){uk(o,t,e,i,n,r)}function s(t,e){return ze(t)*ze(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?Mt:-Mt),p):0;if(!e&&(a=o=g)&&t.lineStart(),g!==o&&((!(f=u(e,d))||xu(e,f)||xu(d,f))&&(d[0]+=Ue,d[1]+=Ue,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||!xu(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=wu(Do(t),Do(e)),s=Sp(o,o),a=o[0],l=s-a*a;if(!l)return!r&&t;var u=n*s/l,c=-n*a/l,h=wu(i,o),p=Cp(i,u);mm(p,Cp(o,c));var f=h,d=Sp(p,f),g=Sp(f,f),y=d*d-g*(Sp(p,p)-1);if(!(y<0)){var v=sn(y),m=Cp(f,(-d-v)/g);if(mm(m,p),m=Ol(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=$t(I-Mt)<Ue;if(!S&&E<x&&(_=x,x=E,E=_),S||I<Ue?S?x+E>0^m[1]<($t(m[0]-b)<Ue?x:E):x<=m[1]&&m[1]<=E:I>Mt^(b<=m[0]&&m[0]<=w)){var N=Cp(f,(-d+v)/g);return mm(N,p),[m,Ol(N)]}}}function c(e,n){var i=r?t:Mt-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"),Lp(s,a,o,r?[0,-t]:[-Mt,t-Mt])}function Rp(t){return function(e){var n=new sb;for(var r in t)n[r]=t[r];return n.stream=e,n}}function sb(){}function Dp(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),Ga(n,t.stream(Mm));var s=Mm.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 Im(t,e,n){return Dp(t,[[0,0],e],n)}l(v4,"clipAntimeridianLine"),l(y4,"clipAntimeridianIntersect"),l(_4,"clipAntimeridianInterpolate"),v(),l(ab,"default"),v(),l(Rp,"transformer"),l(sb,"TransformStream"),sb.prototype={constructor:sb,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()}},v(),l(Dp,"fitExtent"),l(Im,"fitSize"),v();var mk=16,b4=ze(30*Dr);function Pm(t,e){return+e?x4(t,e):w4(t)}function w4(t){return Rp({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function x4(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=sn(b*b+w*w+x*x),I=_n(x/=E),S=$t($t(x)-1)<Ue||$t(o-h)<Ue?(o+h)/2:Rn(w,b),N=t(S,I),M=N[0],C=N[1],O=M-r,P=C-i,L=m*O-v*P;(L*L/_>e||$t((v*O+m*P)/_-.5)>.3||s*p+a*f+l*d<b4)&&(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=Do([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],mk,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,mk,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(Pm,"default"),l(w4,"resampleNone"),l(x4,"resample");var E4=Rp({point:function(t,e){this.stream.point(t*Dr,e*Dr)}});function Fo(t){return ub((function(){return t}))()}function ub(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=ob,x=null,E=Ll,I=.5,S=Pm(C,I);function N(t){return[(t=o(t[0]*Dr,t[1]*Dr))[0]*p+n,r-t[1]*p]}function M(t){return(t=o.invert((t[0]-n)/p,(r-t[1])/p))&&[t[0]*di,t[1]*di]}function C(t,i){return[(t=e(t,i))[0]*p+n,r-t[1]*p]}function O(){o=kp(i=Q_(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=E4(w(i,S(E(h=t))))},N.clipAngle=function(t){return arguments.length?(w=+t?ab(b=t*Dr,6*Dr):(b=null,ob),P()):b*di},N.clipExtent=function(t){return arguments.length?(E=null==t?(x=s=a=u=null,Ll):tb(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*Dr,y=t[1]%360*Dr,O()):[g*di,y*di]},N.rotate=function(t){return arguments.length?(v=t[0]%360*Dr,m=t[1]%360*Dr,_=t.length>2?t[2]%360*Dr:0,O()):[v*di,m*di,_*di]},N.precision=function(t){return arguments.length?(S=Pm(C,I=t*t),P()):sn(I)},N.fitExtent=function(t,e){return Dp(N,t,e)},N.fitSize=function(t,e){return Im(N,t,e)},l(O,"recenter"),l(P,"reset"),function(){return e=t.apply(this,arguments),N.invert=e.invert&&M,O()}}function Sm(t){return function(e,n){var r=ze(e),i=ze(n),o=t(r*i);return[o*i*qe(e),o*qe(n)]}}function la(t){return function(e,n){var r=sn(e*e+n*n),i=t(r),o=qe(i),s=ze(i);return[Rn(e*o,r*s),_n(r&&n*o/r)]}}l(Fo,"projection"),l(ub,"projectionMutator"),v(),v(),v(),v(),l(Sm,"azimuthalRaw"),l(la,"azimuthalInvert");var bk=Sm((function(t){return sn(2/(1+t))}));bk.invert=la((function(t){return 2*_n(t/2)})),v();var lb=Sm((function(t){return(t=dm(t))&&t/qe(t)}));function Cm(){return Fo(lb).scale(79.4188).clipAngle(179.999)}function cb(t,e){return[t,Ip(Pp((yn+e)/2))]}function km(t,e){return[t,e]}function wk(t,e){var n=ze(e),r=ze(t)*n;return[n*qe(t)/r,qe(e)/r]}function xk(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 Ek(t,e){return[ze(e)*qe(t),qe(e)]}function Mk(t,e){var n=ze(e),r=1+ze(t)*n;return[n*qe(t)/r,qe(e)/r]}function Ik(t,e){return[Ip(Pp((yn+e)/2)),-t]}function P4(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 ia(t,(function(t){var n=Nm(t,e,r,i);n&&o.push(n)})),We(o);case"FeatureCollection":return or(t,(function(t){var n=Nm(t,e,r,i);n&&or(n,(function(t){t&&o.push(t)}))})),We(o)}return Nm(t,e,r,i)}function Nm(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return ia(t,(function(t){var i=Nm(t,e,n,r);i&&s.push(i)})),We(s)}var a=S4(o),l={type:o.type,coordinates:Sk(o.coordinates,a)},u=(new Dl.GeoJSONReader).read(l),c=np(ip(e,n),"meters"),h=Dl.BufferOp.bufferOp(u,c,r);if(!Pk((h=(new Dl.GeoJSONWriter).write(h)).coordinates))return mn({type:h.type,coordinates:Ck(h.coordinates,a)},i)}function Pk(t){return Array.isArray(t[0])?Pk(t[0]):isNaN(t[0])}function Sk(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Sk(t,e)}))}function Ck(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Ck(t,e)}))}function S4(t){var e=cu(t).geometry.coordinates,n=[-e[0],-e[1]];return Cm().rotate(n).scale(gn)}lb.invert=la((function(t){return t})),l(Cm,"default"),v(),v(),l(cb,"mercatorRaw"),cb.invert=function(t,e){return[t,2*Ro(hm(e))-yn]},v(),v(),l(km,"equirectangularRaw"),km.invert=km,v(),l(wk,"gnomonicRaw"),wk.invert=la(Ro),v(),v(),l(xk,"naturalEarth1Raw"),xk.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($t(n)>Ue&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},v(),l(Ek,"orthographicRaw"),Ek.invert=la(_n),v(),l(Mk,"stereographicRaw"),Mk.invert=la((function(t){return 2*Ro(t)})),v(),l(Ik,"transverseMercatorRaw"),Ik.invert=function(t,e){return[-e,2*Ro(hm(t))-yn]},l(P4,"buffer"),l(Nm,"bufferFeature"),l(Pk,"coordsIsNaN"),l(Sk,"projectCoords"),l(Ck,"unprojectCoords"),l(S4,"defineProjection");var fb=P4;v();var C4=Zt(Nl());v();var k4=Zt(Nl());v();var O4=Zt(Nl());v(),v();var T4=Zt(Nl());v(),v(),v(),v();var q4=1e-7,G4=.11,Nk=["connection.json","manifest.geojson","map.geojson","node.geojson","styles.json","mapstack.geojson"];function Ok(t,e){let n=X4(e),[r,i]=t.features.reduce(((t,e)=>{let[r,i]=t,o=[e],{properties:s}=e,a=(s.entrances||[]).reduce(((t,e)=>(n.has(e)&&t.push(n.get(e)),t)),[]);if(a.length&&(o=U4(e,a)),"LineString"===o[0].geometry.type){let t=o[0].properties.kind;r.has(t)||r.set(t,[]),r.get(t).push(...o)}else i.push(...o);return t}),[new Map,[]]);return r.forEach(((t,e)=>{let n={kind:e,id:t[0].properties.id,externalId:t[0].properties.externalId};if(t.length){let e=fb(uu(t.map((({geometry:t})=>t.coordinates))),G4,{units:"meters"}),r=[];r="MultiPolygon"===e.geometry.type?e.geometry.coordinates.map((t=>({...hr(t),properties:n}))):[e],i=i.concat(r)}})),We(i)}function U4(t,e){return e.reduce(((t,e)=>{let n={epsilon:q4},r=t.findIndex((t=>hl(cu(e),t,n))),i=t[r];if(i){let[n,o]=V4(i,e);t.splice(r,1,n,o)}return t}),[t])}function V4(t,e){let{coordinates:n}=e.geometry,{coordinates:r}=t.geometry,i=n.map((e=>za(t,Gt(e))));return r.reduce(((e,n)=>{let r=zg(Gt(n),i[0],t),o=zg(Gt(n),i[1],t),s=du(r)<du(o)?r:o;return s.properties={...t.properties,entrances:[]},e.concat([s])}),[])}function X4(t){return new Map(t.features.map((t=>{let{properties:e}=t,{id:n}=e;return[n,t]})))}function d6(t){if(null==t||"object"!=typeof t)return!1;for(let e of Nk)if("Uint8Array"!==t[e][Symbol.toStringTag])return!1;return!0}async function mN(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((()=>(gN(),dN)))).unzipSync(t);if(!d6(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]){Me.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 g6(t){let[e,n,r,i]=Tn(t);return{minLat:n,minLong:e,maxLat:i,maxLong:r}}function m6(t){return null!=t&&(null!=t.polygons||null!=t.lineStrings)}function v6(t){let e=new Map;for(let n in t){let r=t[n];if(!m6(r))continue;let{altitude:i,color:o,height:s,opacity:a}=r;(r.polygons||r.lineStrings).forEach((t=>{e.set(t,{altitude:i,color:o,height:s,opacity:a})}))}return e}function y6(t,e,n,r){let i=r.createGeoreferences(),o=new Set;n.forEach((t=>{t.layer&&o.add(t.layer)}));let s=[...o].map((t=>({id:t,visible:!0}))),a=1/r.mapScale;return{id:t,georeference:i,name:e,shortName:e,scene:{polygons:n},elevation:0,scale:a,x_scale:a,layers:s,width:r.widthInMapUnits,height:r.heightInMapUnits}}l(Ok,"processObstructions"),l(U4,"splitObstructionByAllEntrances"),l(V4,"splitObstructionByEntrance"),l(X4,"getEntranceMap"),l(d6,"validateStaticMVFFiles"),l(mN,"unzipMVF"),l(g6,"getMapExtent"),l(m6,"isPolygonStyle"),l(v6,"getStylesMap"),l(y6,"convertMap");var Lb=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 Ae(o,i),l=new Ae(o,n),u=new Ae(e,s),c=new Ae(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]])})))}};function _6(t,e){return[]}l(Lb,"CoordinateConverter"),l(_6,"convertNodes");var vN=l(((t,e,n,r)=>{let i=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let o=n.get(e.properties.id),s=e.geometry.coordinates[0].map((t=>r.convert(t))),a=e.geometry.coordinates.slice(1).map((t=>t.map((t=>r.convert(t))))),l=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;i.push({entrances:[],map:t,id:e.properties.externalId||"",externalId:e.properties.externalId||"",layer:e.properties.kind,geometry:{visible:!0,position:{x:0,y:0,z:((null==o?void 0:o.altitude)||0)*r.mapScale/l},scale:{x:1,y:1,z:((null==o?void 0:o.height)||1)*r.mapScale/l}},material:{color:(null==o?void 0:o.color)||"#000000"},vertexes:s,holes:a})})),i}),"generateMappedinPolygons");function b6(t,e,n,r,i){let o=vN(t,n,r,i),s=vN(t,e,r,i);return o.concat(s)}function w6(t){return[]}function yN(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:{}},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 Me.error(t),new Error("MVF parsing failed! Probably encountered a bad file.")}}function _N(t){var e,n,r,i,o,s,a,l,u;let c=null!=(e=t.obstruction)?e:{},h=null!=(n=t.space)?n:{},p=null!=(r=t.entrance)?r:{},f=null!=(i=t["mapstack.geojson"])?i:{},d=null!=(o=t["styles.json"])?o:{},g=null!=(s=t["manifest.geojson"])?s:{},y=null!=(a=t["node.geojson"])?a:{},v=null!=(l=t["connection.json"])?l:{},m={},_=new Map,b=[],w=[],x=v6(d);f.forEach((({maps:t})=>{t.forEach(((t,e)=>{let n=Ok(c[t],p[t]);if(n.features.length){let r=g6(n),i=new Lb(r);_.set(t,i),m[t]=b6(t,n,h[t],x,i),w=w.concat(_6(y[t],i)),b.push(y6(t,`Map #${e+1}`,m[t],i))}}))}));let E=Object.values(m).flat(),I=w6(v),S=g.features[0],N=S.properties.name,M=S.geometry.coordinates[0];return{polygons:E,venue:{name:N,latitude:S.geometry.coordinates[1],longitude:M,defaultMap:(null==(u=b[0])?void 0:u.id)||""},maps:b,vortexes:I,nodes:w,locations:[],mapGroups:[],locationStates:[],categories:[],themes:[],imageBinaries:new Map}}l(b6,"convertPolygons"),l(w6,"convertVortexes"),l(yN,"parseMVF"),l(_N,"convertMVFToMappedin"),v();var zN,qN,Xp,Kl,Jl,Yp,Zl,Ql,ec,Mu,Wp,tc,rc,Hp,nc,jN=Zt(BN()),O6=null==(qN=null==(zN=C)?void 0:zN.env)?void 0:qN.npm_package_version,Fb=["websdk","web","webv2"],Bb="websdk",jb=class{constructor(t){var e;oe(this,Xp,void 0),oe(this,Kl,void 0),oe(this,Jl,void 0),oe(this,Yp,void 0),oe(this,Zl,void 0),oe(this,Ql,void 0),oe(this,ec,void 0),oe(this,Mu,void 0),oe(this,Wp,void 0),oe(this,tc,void 0),oe(this,rc,void 0),oe(this,Hp,void 0),oe(this,nc,void 0),le(this,Mu,t.clientId),le(this,Wp,t.clientSecret),le(this,tc,t.accessToken),le(this,ec,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!z(this,ec)&&z(this,Mu)&&!sI(z(this,Mu))&&(n="https://web-proxy.mappedin.com/a/"),le(this,Jl,n),le(this,Jl,z(this,Jl)+(t.venue+"/")),le(this,nc,t.venue),le(this,Kl,!1),le(this,Xp,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),le(this,Yp,Fb.find((e=>e===t.context))||Fb[0]),le(this,Zl,eg()),le(this,Ql,tg()),le(this,rc,new Set),le(this,Hp,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(z(this,Xp))return;let n={...e,g:z(this,Kl)},r=z(this,Jl)+t+"?"+jN.default.stringify(n),i={"mi-context":Bb||z(this,Yp),"mi-session":z(this,Ql),"mi-device":z(this,Zl),"mappedin-sdk-version":O6,"mappedin-platform-version":z(this,Hp)};z(this,tc)?i.Authorization=`Bearer ${z(this,tc)}`:z(this,ec)||(i.Authorization=`Basic ${btoa(`${z(this,Mu)}:${z(this,Wp)}`)}`),Da()(r,{method:"GET",mode:"cors",headers:i})}locationSelected(t){let e=t.id||t;Or.addPendingEvent(new Wc({venue:z(this,nc)})),this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;Or.addPendingEvent(new Yc({venue:z(this,nc)})),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 z(this,Ql)}getDeviceID(){return z(this,Zl)}setGeolocationMode(t){le(this,Kl,t)}trackBlueDotEvent(t){t&&Object.values(jb.BLUEDOT_EVENT).includes(t)&&!z(this,rc).has(t)?(this.track(t),z(this,rc).add(t)):Me.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=Fb.find((e=>e===t));e&&(Bb=e)}static clearContext(){Bb=void 0}},Um=jb;l(Um,"Analytics"),Xp=new WeakMap,Kl=new WeakMap,Jl=new WeakMap,Yp=new WeakMap,Zl=new WeakMap,Ql=new WeakMap,ec=new WeakMap,Mu=new WeakMap,Wp=new WeakMap,tc=new WeakMap,rc=new WeakMap,Hp=new WeakMap,nc=new WeakMap,D(Um,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Ba,Vp=Um,zb={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(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"}(Ba||(Ba={}));var ks,oc,ac,Vm,T6,ic={categories:au,locations:Fa,vortexes:tp,maps:qf,nodes:Wf,polygons:ou,venue:su,events:Af,mapGroups:Vf,themes:vg,locationStates:lg,rankings:$f},Bo=class{constructor(t){oe(this,Vm),D(this,"perspective"),D(this,"things"),D(this,"options"),oe(this,ks,void 0),oe(this,oc,""),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,"_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,ac,void 0),D(this,"images"),D(this,"imageBinaries"),D(this,"scenes"),D(this,"analytics"),D(this,"navigator"),this.options=t,le(this,ks,Ri.create(this));let e=new Vp({...t,testMode:!(null==t?void 0:t.emitAnalyticsEvents)});this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(kx,"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,`_${n}ByExternalId`,{get(){let t=z(this,ks)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),z(this,ks)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=z(this,ks)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),z(this,ks)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,r=this[`_${t}ById`];return null!=r&&null!=r[e]||(r=this[n],null!=r&&null!=r[e])?r[e]:null}async hydrateFromMVF(t){let e=_N(t);return this.hydrate(e)}async hydrate(t,e){let n;if("string"==typeof t)try{le(this,oc,t),n=JSON.parse(t)}catch(t){return void Me.error("Unable to parse JSON",t)}else n=t,le(this,oc,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!=ic[e]&&"function"==typeof ic[e].hydrate&&(this[e]=ic[e].hydrate(i,this))}e&&await yI(n);let{images:i,scenes:o,imageBinaries:s}=n;this.images=i,this.scenes=o,this.imageBinaries=s,this.generateGetters(r),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"]),dI(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];ic[r]&&e.push(ic[r].fetch(this).then((t=>(this[r]=t,Promise.resolve()))))}return e.push(kf(this.options,"cdn-access-token",{venue:this.options.venue},!1).then((t=>le(this,ac,t.token)),(()=>Promise.resolve()))),this.generateGetters(n),Promise.all(e).then((()=>{kn(this,Vm,T6).call(this),this.initNavigator()}))}initNavigator(){this.navigator=new Wv({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()))})}toJSON(){var t;let e={};for(let t in ic)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 z(this,oc)||JSON.stringify(this.toJSON())}};l(Bo,"Mappedin"),ks=new WeakMap,oc=new WeakMap,ac=new WeakMap,Vm=new WeakSet,T6=l((function(){z(this,ac)&&this.maps.forEach((t=>{var e;(null==(e=t.scene)?void 0:e.polygons)&&(t.scene.polygons+=`?${z(this,ac)}`)}))}),"#transformData"),v();var GN={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId","secureContentStorage","languages"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery","showSmartLabelWhenImagePresent"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};v(),v();var un=l((function(){return un=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"),un.apply(this,arguments)}),"__assign");function Kt(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 Xn(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(Kt,"__values"),l(Xn,"__read");var $p,A6="ENTRIES",UN="KEYS",VN="VALUES",Yn="",qb=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=sc(this._path),e=t.node,n=t.keys;if(sc(n)===Yn)return{done:!1,value:this.result()};var r=e.get(sc(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=sc(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 sc(e)})).filter((function(t){return t!==Yn})).join("")},t.prototype.value=function(){return sc(this._path).node.get(Yn)},t.prototype.result=function(){switch(this._type){case VN:return this.value();case UN:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),sc=l((function(t){return t[t.length-1]}),"last$1"),L6=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 XN(t,e,n,r,s,1,i,""),r}),"fuzzySearch"),XN=l((function(t,e,n,r,i,o,s,a){var l,u,c=o*s;try{t:for(var h=Kt(t.keys()),p=h.next();!p.done;p=h.next()){var f=p.value;if(f===Yn){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}XN(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"),Gb=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=Xn(Xm(this._tree,e.slice(this._prefix.length)),2),o=i[0],s=i[1];if(void 0===o){var a=Xn(Xb(s),2),l=a[0],u=a[1];try{for(var c=Kt(l.keys()),h=c.next();!h.done;h=c.next()){var p=h.value;if(p!==Yn&&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,R6(this._tree,t)},t.prototype.entries=function(){return new qb(this,A6)},t.prototype.forEach=function(t){var e,n;try{for(var r=Kt(this),i=r.next();!i.done;i=r.next()){var o=Xn(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 L6(this._tree,t,e)},t.prototype.get=function(t){var e=Ub(this._tree,t);return void 0!==e?e.get(Yn):void 0},t.prototype.has=function(t){var e=Ub(this._tree,t);return void 0!==e&&e.has(Yn)},t.prototype.keys=function(){return new qb(this,UN)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,Vb(this._tree,t).set(Yn,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=Vb(this._tree,t);return n.set(Yn,e(n.get(Yn))),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=Vb(this._tree,t),r=n.get(Yn);return void 0===r&&n.set(Yn,r=e()),r},t.prototype.values=function(){return new qb(this,VN)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var n,r,i=new t;try{for(var o=Kt(e),s=o.next();!s.done;s=o.next()){var a=Xn(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}(),Xm=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=Kt(t.keys()),s=o.next();!s.done;s=o.next()){var a=s.value;if(a!==Yn&&e.startsWith(a))return n.push([t,a]),Xm(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]),Xm(void 0,"",n)}),"trackDown"),Ub=l((function(t,e){var n,r;if(0===e.length||null==t)return t;try{for(var i=Kt(t.keys()),o=i.next();!o.done;o=i.next()){var s=o.value;if(s!==Yn&&e.startsWith(s))return Ub(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"),Vb=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,Kt(t.keys())),a=s.next();!a.done;a=s.next()){var l=a.value;if(l!==Yn&&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"),R6=l((function(t,e){var n=Xn(Xm(t,e),2),r=n[0],i=n[1];if(void 0!==r)if(r.delete(Yn),0===r.size)YN(i);else if(1===r.size){var o=Xn(r.entries().next().value,2),s=o[0],a=o[1];WN(i,s,a)}}),"remove"),YN=l((function(t){if(0!==t.length){var e=Xn(Xb(t),2),n=e[0],r=e[1];if(n.delete(r),0===n.size)YN(t.slice(0,-1));else if(1===n.size){var i=Xn(n.entries().next().value,2),o=i[0],s=i[1];o!==Yn&&WN(t.slice(0,-1),o,s)}}}),"cleanup"),WN=l((function(t,e,n){if(0!==t.length){var r=Xn(Xb(t),2),i=r[0],o=r[1];i.set(o+e,n),i.delete(o)}}),"merge"),Xb=l((function(t){return t[t.length-1]}),"last"),Yb="or",D6="and",F6="and_not",Iu=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=un(un(un({},Hb),t),{searchOptions:un(un({},KN),t.searchOptions||{})}),this._index=new Gb,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=Kt(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,Kt(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=Kt(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=Kt(this._documentIds),g=d.next();!g.done;g=d.next()){var y=Xn(g.value,2),v=y[0];if(f===y[1]){try{for(var m=(r=void 0,Kt(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,Kt(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=Kt(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 Gb,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=Kt(i),a=s.next();!a.done;a=s.next()){var l=Xn(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(ZN),o},t.prototype.autoSuggest=function(t,e){var n,r,i,o;void 0===e&&(e={}),e=un(un({},G6),e);var s=new Map;try{for(var a=Kt(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=Kt(s),d=f.next();!d.done;d=f.next()){var g=Xn(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(ZN),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(Hb.hasOwnProperty(t))return Wb(Hb,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=Ym(c),y._fieldIds=h,y._fieldLength=Ym(p),y._avgFieldLength=f,y._storedFields=Ym(d),y._index=new Gb;try{for(var v=Kt(a),m=v.next();!m.done;m=v.next()){var _=Xn(m.value,2),b=_[0],w=_[1],x=new Map;try{for(var E=(o=void 0,Kt(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),Ym(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=un(un(un({},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=un(un({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(q6(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=un(un({},this._options.searchOptions),e),u=(l.fields||this._options.fields).reduce((function(t,e){var n;return un(un({},t),((n={})[e]=Wb(t,e)||1,n))}),l.boost||{}),c=l.boostDocument,h=l.weights,p=l.maxFuzzy,f=un(un({},KN.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=Kt(s),w=b.next();!w.done;w=b.next()){var x=Xn(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=Kt(a.keys()),M=N.next();!M.done;M=N.next()){E=M.value;var C,O=Xn(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=Yb),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(B6[n])||new Map},t.prototype.toJSON=function(){var t,e,n,r,i=[];try{for(var o=Kt(this._index),s=o.next();!s.done;s=o.next()){var a=Xn(s.value,2),l=a[0],u=a[1],c={};try{for(var h=(n=void 0,Kt(u)),p=h.next();!p.done;p=h.next()){var f=Xn(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=Kt(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,Kt(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*z6(I,m,this._documentCount,S,_),M=s.get(x);if(M){M.score+=N,U6(M.terms,t);var C=Wb(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,QN),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,QN),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=Kt(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=Kt(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}(),Wb=l((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),B6=(($p={})[Yb]=function(t,e){var n,r;try{for(var i=Kt(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),JN(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},$p[D6]=function(t,e){var n,r,i=new Map;try{for(var o=Kt(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;JN(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},$p[F6]=function(t,e){var n,r;try{for(var i=Kt(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},$p),HN=1.2,$N=.7,j6=.5,z6=l((function(t,e,n,r,i){return Math.log(1+(n-e+.5)/(e+.5))*(j6+t*(HN+1)/(t+HN*(1-$N+$N*r/i)))}),"calcBM25Score"),q6=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"),Hb={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(V6)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},KN={combineWith:Yb,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},G6={prefix:function(t,e,n){return e===n.length-1}},U6=l((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),JN=l((function(t,e){var n,r;try{for(var i=Kt(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"),ZN=l((function(t,e){var n=t.score;return e.score-n}),"byScore"),QN=l((function(){return new Map}),"createMap"),Ym=l((function(t){var e,n,r=new Map;try{for(var i=Kt(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"),V6=/[\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;v();var X6=["0","1","2","3","4","5","6","7","8","9"],Y6=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],W6=["0","1","2","3","4","5","6","7","8","9"],H6=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],kde=[...X6,...Y6,...W6,...H6],eO=["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"];v();var $6=32,Pi=!1,K6=120,$b=0,Wm=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,Pi&&Me.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};l(Wm,"FrameUpdate");var Ha=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,Pi&&Me.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};l(Ha,"FrameTask");var Hm=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,Pi&&Me.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(Hm,"FrameTaskGroup");var Kb=class{constructor(t){D(this,"_maxMillisecondsPerFrame"),D(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:$6,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};l(Kb,"RealTimeTimer");var $m=class{constructor(t){var e;D(this,"_raf"),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._timer=null!=(null==t?void 0:t.timer)?t.timer:new Kb,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new uc,this._scheduledTasksByPriority=new uc,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Pi&&Me.log("task scheduler instantiated"),(null==(e=globalThis.MappedinDebug)?void 0: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 uc,this._scheduledTasksByPriority=new uc,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Pi&&Me.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){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;Pi&&(0===$b&&(n=!0),++$b,$b%=K6);let r=this._scheduledUpdatesByOrdering.keys();for(let t=r.length-1;t>=0;--t){let e=r[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&Me.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,n&&Me.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 r;this._performance&&(r=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-r),n&&Me.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()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}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;Me.assert(void 0!==n),Object.getPrototypeOf(n)===Hm.prototype&&(r=n,n=r._popTask()),Me.assert(void 0!==n),Me.assert(Object.getPrototypeOf(n)===Ha.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Pi&&Me.log("task completed",n.name),null!=r&&(r.isComplete()?(r.clear(),r._onComplete(),Pi&&Me.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)===Hm)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,Pi&&Me.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Pi&&Me.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)===Ha.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Pi&&Me.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)===Ha.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)===Ha.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Pi&&Me.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)===Ha.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)===Ha.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Pi&&Me.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Ha.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,Pi&&Me.log("task priority changed",t.name,e)}};l($m,"TaskScheduler");var uc=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(Me.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 Me.assert(t===this._size),t}};l(uc,"Multimap");var Ns,co,Os,pa,qr,Kp,Jp,cc,Zp,fc,Ka,Km,Jm,Ts,Qp,Zm,Qm,ev,lG,eh,th,rh,Zb,$a=l((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),lc="",J6=.09,Z6=1,Q6=.025,eG=.5,tG=5e-4,rG=5e-4,nG=.01,iG=.05,tO=1,oG=.01,aG=.2,sG={MappedinCategory:"categories",MappedinLocation:"locations"},uG={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:eO,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===C.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:J6,PRIMARY_INDEX_WEIGHT:Z6,SECONDARY_INDEX_WEIGHT:Q6,CATEGORY_NAME_WEIGHT:eG,LOCATION_NAME_WEIGHT:tO,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:tG,CATEGORY_LOCATION_TAGS_WEIGHT:rG,CATEGORY_LOCATION_NAME_WEIGHT:nG,PRIMARY_INDEX_TAGS_NAME_WEIGHT:iG,LOCATION_DEFAULT_RANK:tO,RATIO_OF_FUZZY_TO_EXACT:oG,RATIO_OF_PREFIX_TO_EXACT:aG}},Jb=class{constructor(t,e){var n,r,i;oe(this,ev),oe(this,Ns,void 0),oe(this,co,void 0),oe(this,Os,void 0),oe(this,pa,void 0),oe(this,qr,void 0),oe(this,Kp,new $m({performance:!0})),oe(this,Jp,void 0),oe(this,cc,void 0),oe(this,Zp,new Map),oe(this,fc,0),oe(this,Ka,l((t=>{yv(this,fc)._++,z(this,Kp).scheduleUpdate(new Wm({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),yv(this,fc)._--,0===z(this,fc)&&z(this,Qp).call(this)}}))}),"#addTask")),oe(this,Km,l((t=>{var e,n,r;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=z(this,qr).constants,a=o;(null==(e=z(this,qr))?void 0:e.useLocationRank)&&(a=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return(null==(e=t.rank)?void 0:e.score)?null==(n=t.rank)?void 0:n.score:o})),o):o),z(this,Ka).call(this,(()=>{z(this,co).add({name:$a(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:o,rank:a})})),(null==(n=z(this,qr))?void 0:n.searchTags)&&Array.isArray(t.tags)&&t.tags.forEach((e=>{z(this,co).add({name:"",tag:$a(e),id:"MappedinLocation_"+t.id,weight:s,rank:a})})),(null==(r=z(this,qr))?void 0:r.searchDescriptions)&&z(this,Ka).call(this,(()=>z(this,Os).add({description:$a(t.description||""),id:"MappedinLocation_"+t.id,weight:i,rank:a})))}),"#processLocation")),oe(this,Jm,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}=z(this,qr).constants;z(this,Ka).call(this,(()=>z(this,co).add({name:$a(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let a=t.locations.reduce(((t,e)=>t+` ${lc} `+e.name),"")+` ${lc}`;if((null==(e=z(this,qr))?void 0:e.searchDescriptionsInCategories)&&t.locations.forEach((e=>{null!=e.description&&z(this,Ka).call(this,(()=>z(this,pa).add({id:"MappedinCategory_"+t.id,"category.locations.description":$a(e.description),ref:e.name,weight:r})))})),null==(n=z(this,qr))?void 0:n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${lc} `+e),""))+` ${lc}`}),"");z(this,Ka).call(this,(()=>z(this,pa).add({"category.locations.tags":$a(e),id:"MappedinCategory_"+t.id,weight:i})))}z(this,Ka).call(this,(()=>z(this,pa).add({"category.locations.name":$a(a),id:"MappedinCategory_"+t.id,weight:o})))}),"#processCategory")),oe(this,Ts,void 0),oe(this,Qp,void 0),oe(this,Zm,l((t=>{var e;let n=t.score,{object:r,id:i,weight:o,rank:s}=t,[a,l]=i.split("_"),u=r||z(this,Ns).getCollectionItemById(sG[a],l);return s&&(null==(e=z(this,qr))?void 0:e.useLocationRank)&&(n+=s),o&&(n*=o),{score:n,type:a,object:u}}),"#processSearchResult")),oe(this,Qm,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(`[^${lc}]* `+n+` [^${lc}]*`,"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")),oe(this,eh,void 0),oe(this,th,void 0),oe(this,rh,void 0),le(this,cc,new Vp({...t.options,testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)})),le(this,qr,{...uG,...e}),le(this,Ns,t),le(this,Jp,new Set(null==(n=z(this,qr))?void 0:n.stopWords));let o=z(this,Ns).venue.slug,{PRIMARY_INDEX_FUZZYNESS:s,PRIMARY_INDEX_WEIGHT:a,CATEGORY_NAME_WEIGHT:u,RATIO_OF_FUZZY_TO_EXACT:c,RATIO_OF_PREFIX_TO_EXACT:h,PRIMARY_INDEX_TAGS_NAME_WEIGHT:p}=z(this,qr).constants,f=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:f,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:s},boost:{name:a,query:a,tag:p},weights:{fuzzy:c,prefix:h},boostDocument:t=>t.includes("MappedinLocation")?a:t.includes("MappedinCategory")?u:a},g={fields:["description"],storeFields:f,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return(null==(n=z(this,Jp))?void 0:n.has(t.toLowerCase()))?null:t.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...f,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(le(this,Ts,new Promise((t=>{le(this,Qp,t)}))),null==(r=z(this,qr))?void 0:r.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(i=z(this,qr))?void 0:i.jsonIndex);le(this,co,Iu.loadJS(t,d)),le(this,Os,Iu.loadJS(e,g)),le(this,pa,Iu.loadJS(n,y))}else le(this,co,new Iu(d)),le(this,Os,new Iu(g)),le(this,pa,new Iu(y)),z(this,Ns).locations.forEach(z(this,Km)),z(this,Ns).categories.forEach(z(this,Jm));z(this,Kp).update(performance.now()),le(this,eh,ag(((t,e)=>{z(this,cc).trackSearchSuggest({query:t,hits:e}),Or.addPendingEvent(new uf({venue:o}))}),300)),le(this,th,ag(((t,e)=>{z(this,cc).trackSearch({query:t,hits:e}),Or.addPendingEvent(new sf({venue:o}))}),300)),le(this,rh,ag((()=>{Or.addPendingEvent(new of({venue:o}))}),300)),Or.addPendingEvent(new af({search_descriptions:z(this,qr).searchDescriptions,search_tags:z(this,qr).searchTags,search_descriptions_in_categories:z(this,qr).searchDescriptionsInCategories,search_tags_in_categories:z(this,qr).searchTagsInCategories,use_location_rank:z(this,qr).useLocationRank,venue:o}))}async suggest(t){await z(this,Ts);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}=z(this,qr).constants,s=z(this,co).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 z(this,eh).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}async search(t){await z(this,Ts);let e=kn(this,ev,lG).call(this,t);return z(this,th).call(this,t,e.length),e}async toJSON(){return await z(this,Ts),JSON.stringify({primary:z(this,co),secondary:z(this,Os),extra:z(this,pa)})}async addQuery(t){let e,n,{query:r,object:i,weight:o=1}=t;await z(this,Ts),e=i instanceof Fa?"MappedinLocation":i instanceof au?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+i.id:"string"==typeof i.id?n="Custom_"+i.id:(n=z(this,Zp).get(i),n||(n="Custom_"+La(),z(this,Zp).set(i,n))),z(this,co).add({id:n,weight:o,object:i,query:$a(r)}),z(this,rh).call(this)}};l(Jb,"OfflineSearch"),Ns=new WeakMap,co=new WeakMap,Os=new WeakMap,pa=new WeakMap,qr=new WeakMap,Kp=new WeakMap,Jp=new WeakMap,cc=new WeakMap,Zp=new WeakMap,fc=new WeakMap,Ka=new WeakMap,Km=new WeakMap,Jm=new WeakMap,Ts=new WeakMap,Qp=new WeakMap,Zm=new WeakMap,Qm=new WeakMap,ev=new WeakSet,lG=l((function(t){let e=[],n=$a(t);e=[...z(this,co).search(n),...z(this,Os).search(n),...z(this,pa).search(n)].sort(((t,e)=>e.score-t.score));let r={};for(let t of e){let e=z(this,Zm).call(this,t);r[t.id]?r[t.id].score+=e.score:r[t.id]={...e,matches:[]},z(this,Qm).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"),eh=new WeakMap,th=new WeakMap,rh=new WeakMap,v(),function(t){t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(Zb||(Zb={}));var Qb=globalThis.fetch;function Da(){if(null==Qb)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return Qb}function Kde(t){Qb=t}l(Da,"isomorphicFetch"),l(Kde,"setFetchFn");var nO,iO,cG=null==(iO=null==(nO=C)?void 0:nO.env)?void 0:iO.npm_package_version;globalThis.btoa||(globalThis.btoa=rO.encode);var fG=["ar"];function Pu(t){let e={...zb,things:GN,...t};return e.headers={...e.headers,"mappedin-sdk-version":cG},t.platformString&&(e.headers={...e.headers,"mappedin-platform-version":t.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function tge(t){let e=Pu({...{emitAnalyticsEvents:!0,...t}}),n=new Bo(e),r=await gG(e),i=yN(await mN(r));return n.hydrateFromMVF(i),Or.addPendingEvent(new $c({venue:e.venue})),n}async function pG(t){let e={emitAnalyticsEvents:!0,secure:!0,...t},n=Pu({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/"+(n.useDraftData?"draft/":""),i=new Bo({...n,baseUrl:n.baseUrl+r});return await i.fetch(),e.emitAnalyticsEvents,Or.addPendingEvent(new Hc({venue:n.venue})),i}async function rge(t){let e=Pu({baseUrl:"https://api-gateway.mappedin.com/",...{emitAnalyticsEvents:!0,secure:!0,...t}}),n="public/1/"+(e.useDraftData?"draft/":""),r=new Bo({...e,baseUrl:e.baseUrl+n}),i=await su.fetch(r);return{hasSecureAssets:i.secureContentStorage,languages:i.languages}}function nge(t){pG=t}l(Pu,"parseOptions"),l(tge,"getVenueMVF"),l(pG,"getVenue"),l(rge,"getVenueMetadata"),l(nge,"__setGetVenueMock");var ew={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function ige(t){let e=Pu({baseUrl:"https://api-gateway.mappedin.com/",...ew,...t}),{url:n,updated_at:r}=await hG(t),i=await Da()(n,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let a=new Bo(e);return await a.hydrate(o,e.shouldPopulateBundledImagesAsBlobs),a.updatedAt=r,a}async function hG(t){let e=Pu({baseUrl:"https://api-gateway.mappedin.com/",...ew,...t}),{version:n,venue:r}=t,i=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&fG.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${r}&version=1.0.0`;return e.language=void 0,await og(e,i)}async function oge(t,{url:e,updated_at:n}){let r=Pu({baseUrl:"https://api-gateway.mappedin.com/",...ew,...t}),i=await Da()(e,{mode:"cors"}),{data:o,format:s="jsonstring"}=await i.json();if("jsonstring"!==s)throw new Error(`Unrecognized format${s}`);let a=new Bo(r);return await a.hydrate(o,r.shouldPopulateBundledImagesAsBlobs),a.updatedAt=n,a}async function dG(t){let e=Pu({baseUrl:"https://api-gateway.mappedin.com/",...zb,...t}),n=`${e.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${e.venue}&version=2.0.0`;return e.headers["Content-Type"]="application/zip",await og(e,n)}async function gG(t){return new Promise((async(e,n)=>{try{let{url:n}=await dG(t),r=await Da()(n).then((t=>t.arrayBuffer()));e(new Uint8Array(r))}catch(t){n(t)}}))}async function age(t,e=!0){let n=new Bo({venue:""});return await n.hydrate(t,e),n}async function sge(t){let e=new Bo({venue:""});return await e.hydrateFromMVF(t),e}l(ige,"getVenueBundle"),l(hG,"getVenueBundleURL"),l(oge,"downloadBundle"),l(dG,"getVenueMVFURL"),l(gG,"downloadVenueBundleMVF"),l(age,"hydrateVenue"),l(sge,"hydrateVenueMVF");export{Vp as CustomerAnalytics,Zb as MAP_RENDER_MODE,Bo as Mappedin,au as MappedinCategory,Ba as MappedinCollectionType,nl as MappedinCoordinate,Co as MappedinDestinationSet,Gu as MappedinDirections,Af as MappedinEvent,Fa as MappedinLocation,qf as MappedinMap,Vf as MappedinMapGroup,Sa as MappedinNavigatable,Wf as MappedinNode,ou as MappedinPolygon,$f as MappedinRankings,su as MappedinVenue,tp as MappedinVortex,Jb as OfflineSearch,nge as __setGetVenueMock,oge as downloadBundle,gG as downloadVenueBundleMVF,pG as getVenue,ige as getVenueBundle,hG as getVenueBundleURL,tge as getVenueMVF,dG as getVenueMVFURL,rge as getVenueMetadata,age as hydrateVenue,sge as hydrateVenueMVF,Da as isomorphicFetch,Kde as setFetchFn};
|